Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members

PolygonBufferChunk Class Reference

#include <polygonbuffer.h>

Inheritance diagram for PolygonBufferChunk:

Inheritance graph
[legend]
Collaboration diagram for PolygonBufferChunk:

Collaboration graph
[legend]
List of all members.

Detailed Description

Polygon buffer chunk.

Author:
Mattias Jansson (mattias@realityrift.com)


Public Member Functions

 PolygonBufferChunk (unsigned short usType, const NeoEngine::HashString &rstrType, const NeoEngine::HashString &rstrID="")
 PolygonBufferChunk (const NeoEngine::PolygonBufferPtr &pkBuffer, const NeoEngine::HashString &rstrID="", bool bCreateSubChunk=false)
virtual ~PolygonBufferChunk ()
virtual int GetSize (bool bIncludeHeader=false) const
virtual int ReadData (NeoEngine::File *pkFile, ChunkIO::CHUNKIOMODE eMode, unsigned int uiEnd)
virtual int ParseData (unsigned int uiFlags, NeoEngine::FileManager *pkFileManager)
virtual int WriteData (NeoEngine::File *pkFile, ChunkIO::CHUNKIOMODE eMode, unsigned int uiLevel)
void SetNumChunk (unsigned int uiNumElements)
void SetTypeChunk (unsigned int uiType)
virtual bool IsComplex () const
void AttachChunk (Chunk *pkChunk, bool bReplace=false)
ChunkFindChunk (const NeoEngine::HashString &rstrID, unsigned short usType, int iRecurse=-1, bool bIgnoreID=false)
int FindChunks (const NeoEngine::HashString &rstrID, unsigned short usType, std::vector< Chunk * > *pvpkResult, bool bRecurse=false, bool bIgnoreID=false)
const std::vector< Chunk * > & GetSubChunks () const
unsigned short GetType () const
const NeoEngine::HashString & GetTypeAsString () const
const NeoEngine::HashString & GetID () const
int ParseRecursive (unsigned int uiFlags, NeoEngine::FileManager *pkFileManager)

Static Public Member Functions

ChunkAllocator (unsigned short usType, const NeoEngine::HashString &rstrType, const NeoEngine::HashString &rstrID)

Public Attributes

NeoEngine::PolygonBufferPtr m_pkBuffer
unsigned short m_usVersion
bool m_bParse

Protected Attributes

unsigned short m_usType
NeoEngine::HashString m_strType
NeoEngine::HashString m_strID
unsigned short m_usFindType
std::vector< Chunk * > m_vpkSubChunks


Constructor & Destructor Documentation

PolygonBufferChunk unsigned short  usType,
const NeoEngine::HashString &  rstrType,
const NeoEngine::HashString &  rstrID = ""
[inline]
 

Initialize chunk

Parameters:
usType Chunk type
rstrType Chunk type as string
rstrID Chunk ID string

PolygonBufferChunk const NeoEngine::PolygonBufferPtr &  pkBuffer,
const NeoEngine::HashString &  rstrID = "",
bool  bCreateSubChunk = false
[inline]
 

Setup chunk with default values

Parameters:
pkBuffer Polygon buffer object
rstrID Chunk ID string, default empty
bCreateSubChunk Create subchunks from polygon buffer object data (num, type) if true

virtual ~PolygonBufferChunk  )  [inline, virtual]
 

Deallocate data and subchunks


Member Function Documentation

virtual int GetSize bool  bIncludeHeader = false  )  const [virtual]
 

Get size of chunk in binary mode

Parameters:
bIncludeHeader Add header of chunk (type + ID) to size as well as subchunks and data
Returns:
Size of chunk data in bytes as if read/written from/to file

Reimplemented from ComplexChunk.

virtual int ReadData NeoEngine::File *  pkFile,
ChunkIO::CHUNKIOMODE  eMode,
unsigned int  uiEnd
[virtual]
 

Read chunk data from file

Parameters:
pkFile File
eMode Chunk mode (ChunkIO::ASCII or ChunkIO::BINARY)
uiEnd Bytes to end of chunk (in binary mode)
Returns:
<0 if error, number of bytes read if successful

Reimplemented from Chunk.

virtual int ParseData unsigned int  uiFlags,
NeoEngine::FileManager *  pkFileManager
[virtual]
 

Parse chunk data

Parameters:
uiFlags Parse flags
pkFileManager File manager
Returns:
<0 if error, >0 if successful (0 reserved)

Reimplemented from Chunk.

virtual int WriteData NeoEngine::File *  pkFile,
ChunkIO::CHUNKIOMODE  eMode,
unsigned int  uiLevel
[virtual]
 

Write chunk data to file

Parameters:
pkFile File
eMode Chunk mode (ChunkIO::ASCII or ChunkIO::BINARY)
uiLevel Recursion level for ascii format
Returns:
<0 if error, number of bytes written if successful

Reimplemented from Chunk.

void SetNumChunk unsigned int  uiNumElements  ) 
 

Set num subchunk

Parameters:
uiNumElements Number of elements

void SetTypeChunk unsigned int  uiType  ) 
 

Set buffer type subchunk

Parameters:
uiType Buffer type

Chunk* Allocator unsigned short  usType,
const NeoEngine::HashString &  rstrType,
const NeoEngine::HashString &  rstrID
[inline, static]
 

Allocate new chunk

Parameters:
usType Type identifier
rstrType Type identifier as string
rstrID ID string
Returns:
New chunk

virtual bool IsComplex  )  const [inline, virtual, inherited]
 

Returns:
true (we are a complex chunk)

Implements Chunk.

void AttachChunk Chunk pkChunk,
bool  bReplace = false
[inherited]
 

Attach subchunk

Parameters:
pkChunk Chunk to attach
bReplace Replace and deallocate old chunk of same type and ID (default false)

Chunk* FindChunk const NeoEngine::HashString &  rstrID,
unsigned short  usType,
int  iRecurse = -1,
bool  bIgnoreID = false
[inherited]
 

Locate chunk in hierarchy matching chunk properties

Parameters:
rstrID Chunk ID
usType Chunk type, ignored if zero
iRecurse Recurse on sub (1 - recurse infinite, 0 - only ourselves, -1 only child nodes - default)
bIgnoreID Ignore matching ID string
Returns:
Ptr to first chunk matching search criteria

int FindChunks const NeoEngine::HashString &  rstrID,
unsigned short  usType,
std::vector< Chunk * > *  pvpkResult,
bool  bRecurse = false,
bool  bIgnoreID = false
[inherited]
 

Find all subchunks matching query

Parameters:
rstrID Chunk ID
usType Chunk type, ignored if zero
pvpkResult Vector of chunk pointers receiving pointers to matching subchunks (if null, only count)
bRecurse Recurse on subchunks (default false, search only our subchunks)
bIgnoreID Ignore matching ID string
Returns:
Number of chunks found

const std::vector< Chunk* >& GetSubChunks  )  const [inline, inherited]
 

Returns:
Subchunk vector

unsigned short GetType  )  const [inline, inherited]
 

Returns:
Chunk type

const NeoEngine::HashString& GetTypeAsString  )  const [inline, inherited]
 

Returns:
Chunk type as string

const NeoEngine::HashString& GetID  )  const [inline, inherited]
 

Returns:
Chunk ID

int ParseRecursive unsigned int  uiFlags,
NeoEngine::FileManager *  pkFileManager
[inherited]
 

Parse child chunks, then ourselves

Parameters:
uiFlags Parse flags
pkFileManager File manager object
Returns:
<0 if error, >0 if successful (0 reserved for future use)


Member Data Documentation

NeoEngine::PolygonBufferPtr m_pkBuffer
 

Polygon buffer

unsigned short m_usVersion [inherited]
 

Chunk version

unsigned short m_usType [protected, inherited]
 

Chunk type

NeoEngine::HashString m_strType [protected, inherited]
 

Type as string

NeoEngine::HashString m_strID [protected, inherited]
 

Chunk ID

unsigned short m_usFindType [protected, inherited]
 

Chunk type used in search

std::vector< Chunk* > m_vpkSubChunks [protected, inherited]
 

Sub chunks

bool m_bParse [inherited]
 

Parse flag. If false, the chunk will not be parsed


The documentation for this class was generated from the following file:
Generated on Wed Jan 21 14:21:18 2004 for NeoChunkIO by doxygen 1.3.5