OMPF::ompfBaseChunk Class Reference

#include <ompfBaseChunk.h>

Inherited by OMPF::ompfEmitterChunk, OMPF::ompfExternalReferenceChunk, OMPF::ompfGroupChunk, OMPF::ompfHeaderChunk, OMPF::ompfMaterialReferenceChunk, OMPF::ompfMeshChunk, OMPF::ompfParticleSystemChunk, and OMPF::ompfTransformChunk.

Public Member Functions

 ompfBaseChunk (OMPFChunkType typeID)
 
virtual ~ompfBaseChunk ()=default
 
virtual bool write (std::ofstream &stream, const ompfSettings &settings)
 
virtual bool read (std::ifstream &stream, ompfSettings &settings)
 
void insertChunk (ompfBaseChunk *chunk)
 
void removeChunk (ompfBaseChunk *chunk)
 
bool hasParent () const
 
uint32 getParentID () const
 
void setParentID (const uint32 parentID)
 
bool hasChildren () const
 
const std::vector< ompfBaseChunk * > & getChildren () const
 
void setID (const uint32 chunkID)
 
uint32 getID () const
 
virtual uint32 getSize (const ompfSettings &settings)
 
OMPFChunkType getType () const
 
void setName (const iaString &name)
 
const iaStringgetName () const
 

Friends

class OMPF
 

Detailed Description

ompf base chunk. all chunks have to derive from this class

Constructor & Destructor Documentation

◆ ompfBaseChunk()

OMPF::ompfBaseChunk::ompfBaseChunk ( OMPFChunkType  typeID)

ctor

◆ ~ompfBaseChunk()

virtual OMPF::ompfBaseChunk::~ompfBaseChunk ( )
virtualdefault

dtor does nothing

Member Function Documentation

◆ getChildren()

const std::vector< ompfBaseChunk * > & OMPF::ompfBaseChunk::getChildren ( ) const
Returns
list of children

◆ getID()

uint32 OMPF::ompfBaseChunk::getID ( ) const
Returns
chunk id

◆ getName()

const iaString & OMPF::ompfBaseChunk::getName ( ) const
Returns
name of chunk

◆ getParentID()

uint32 OMPF::ompfBaseChunk::getParentID ( ) const
Returns
parent chunk id. returns INVALID_CHUNK_ID if there is no parent

◆ getSize()

uint32 OMPF::ompfBaseChunk::getSize ( const ompfSettings settings)
virtual
Returns
chunk size in bytes

size can differ for different settings

Parameters
settingsthe settings to take in to account

◆ getType()

OMPFChunkType OMPF::ompfBaseChunk::getType ( ) const
Returns
chunk type id

◆ hasChildren()

bool OMPF::ompfBaseChunk::hasChildren ( ) const
Returns
true if chunk has children

◆ hasParent()

bool OMPF::ompfBaseChunk::hasParent ( ) const
Returns
true if chunk has a parent chunk

◆ insertChunk()

void OMPF::ompfBaseChunk::insertChunk ( ompfBaseChunk chunk)

insert chunk in chunk

Parameters
chunkthe child chunk to insert

◆ read()

bool OMPF::ompfBaseChunk::read ( std::ifstream &  stream,
ompfSettings settings 
)
virtual

reads a chunk from stream

Parameters
streamsource stream
settingsthe settings used to read the stream
Returns
true if there was no error

◆ removeChunk()

void OMPF::ompfBaseChunk::removeChunk ( ompfBaseChunk chunk)

removes chunk from chunk

Parameters
chunkthe child chunk to remove

◆ setID()

void OMPF::ompfBaseChunk::setID ( const uint32  chunkID)

sets chunk id

Parameters
chunkID

◆ setName()

void OMPF::ompfBaseChunk::setName ( const iaString name)

sets name of chunk

Parameters
namethe name of the chunk

◆ setParentID()

void OMPF::ompfBaseChunk::setParentID ( const uint32  parentID)

sets parent id

Parameters
parentIDthe parents ID

◆ write()

bool OMPF::ompfBaseChunk::write ( std::ofstream &  stream,
const ompfSettings settings 
)
virtual

writes current this chunk to specified stream

Parameters
streamdestination stream
settingsthe settings used to write the ompf file
Returns
true if there was no error

Friends And Related Function Documentation

◆ OMPF

friend class OMPF
friend

The documentation for this class was generated from the following files: