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

LwoGroupChunk Class Reference

A particular kind of LwoChunk that is expected to contain an arbitrary number of child chunks. More...

#include <lwoGroupChunk.h>

Inheritance diagram for LwoGroupChunk:

LwoChunk IffChunk TypedReferenceCount TypedObject ReferenceCount LwoClip LwoHeader LwoSurface LwoSurfaceBlock LwoSurfaceBlockHeader LwoSurfaceBlockTMap List of all members.

Public Member Functions

int get_num_chunks () const
 Returns the number of child chunks of this group.

IffChunkget_chunk (int n) const
 Returns the nth child chunk of this group.

virtual TypeHandle get_type () const
virtual TypeHandle force_init_type ()
IffId get_id () const
 Returns the ID associated with this chunk.

void set_id (IffId id)
 Changes the ID associated with this chunk.

virtual bool read_iff (IffInputFile *in, size_t stop_at)=0
virtual void output (ostream &out) const
virtual void write (ostream &out, int indent_level=0) const
virtual IffChunkmake_new_chunk (IffInputFile *in, IffId id)
 Allocates and returns a new chunk of the appropriate type based on the given ID, according to the context given by this chunk itself.

int get_type_index () const
bool is_of_type (TypeHandle handle) const
bool is_exact_type (TypeHandle handle) const
int get_ref_count () const
int ref () const
int unref () const
void test_ref_count_integrity () const

Static Public Member Functions

TypeHandle get_class_type ()
void init_type ()

Protected Types

typedef pvector< PointerTo<
IffChunk > > 
Chunks

Protected Member Functions

bool read_chunks_iff (IffInputFile *in, size_t stop_at)
 Reads a sequence of child chunks, until byte stop_at has been been reached, and stores them as the children.

bool read_subchunks_iff (IffInputFile *in, size_t stop_at)
 Similar to read_chunks_iff(), but reads them as subchunks.

void write_chunks (ostream &out, int indent_level) const
 Formats the list of chunks for output to the user (primarily for debugging), one per line.


Protected Attributes

Chunks _chunks
int _ref_count

Static Private Attributes

TypeHandle _type_handle

Detailed Description

A particular kind of LwoChunk that is expected to contain an arbitrary number of child chunks.

Definition at line 43 of file lwoGroupChunk.h.


Member Typedef Documentation

typedef pvector< PointerTo< IffChunk > > LwoGroupChunk::Chunks [protected]
 

Definition at line 53 of file lwoGroupChunk.h.


Member Function Documentation

virtual TypeHandle LwoGroupChunk::force_init_type void   )  [inline, virtual]
 

Reimplemented from LwoChunk.

Reimplemented in LwoClip, LwoHeader, LwoSurface, LwoSurfaceBlockHeader, and LwoSurfaceBlockTMap.

Definition at line 60 of file lwoGroupChunk.h.

IffChunk * LwoGroupChunk::get_chunk int  n  )  const
 

Returns the nth child chunk of this group.

Definition at line 51 of file lwoGroupChunk.cxx.

References _chunks, IffInputFile::get_bytes_read(), IffInputFile::get_chunk(), IffInputFile::is_eof(), NULL, and PT.

TypeHandle LwoGroupChunk::get_class_type void   )  [inline, static]
 

Reimplemented from LwoChunk.

Reimplemented in LwoClip, LwoHeader, LwoSurface, LwoSurfaceBlockHeader, and LwoSurfaceBlockTMap.

Definition at line 61 of file lwoGroupChunk.h.

IffId IffChunk::get_id void   )  const [inline, inherited]
 

Returns the ID associated with this chunk.

Definition at line 43 of file iffChunk.I.

References IffChunk::_id, and INLINE.

Referenced by LwoTags::read_iff(), LwoSurfaceSmoothingAngle::read_iff(), LwoSurfaceSidedness::read_iff(), LwoSurfaceParameter::read_iff(), LwoSurfaceColor::read_iff(), LwoSurfaceBlockWrap::read_iff(), LwoSurfaceBlockVMapName::read_iff(), LwoSurfaceBlockTransform::read_iff(), LwoSurfaceBlockTMap::read_iff(), LwoSurfaceBlockRepeat::read_iff(), LwoSurfaceBlockRefObj::read_iff(), LwoSurfaceBlockProjection::read_iff(), LwoSurfaceBlockOpacity::read_iff(), LwoSurfaceBlockImage::read_iff(), LwoSurfaceBlockHeader::read_iff(), LwoSurfaceBlockEnabled::read_iff(), LwoSurfaceBlockCoordSys::read_iff(), LwoSurfaceBlockChannel::read_iff(), LwoSurfaceBlockAxis::read_iff(), LwoSurface::read_iff(), LwoStillImage::read_iff(), LwoPolygonTags::read_iff(), LwoPoints::read_iff(), LwoClip::read_iff(), LwoBoundingBox::read_iff(), and IffGenericChunk::read_iff().

int LwoGroupChunk::get_num_chunks  )  const
 

Returns the number of child chunks of this group.

Definition at line 38 of file lwoGroupChunk.cxx.

References _chunks, nassertr, and NULL.

virtual TypeHandle LwoGroupChunk::get_type void   )  const [inline, virtual]
 

Reimplemented from LwoChunk.

Reimplemented in LwoClip, LwoHeader, LwoSurface, LwoSurfaceBlockHeader, and LwoSurfaceBlockTMap.

Definition at line 57 of file lwoGroupChunk.h.

References _type_handle, LwoChunk::init_type(), and register_type().

void LwoGroupChunk::init_type void   )  [inline, static]
 

Reimplemented from LwoChunk.

Reimplemented in LwoClip, LwoHeader, LwoSurface, LwoSurfaceBlockHeader, and LwoSurfaceBlockTMap.

Definition at line 64 of file lwoGroupChunk.h.

References _type_handle.

Referenced by LwoClip::get_type().

IffChunk * IffChunk::make_new_chunk IffInputFile in,
IffId  id
[virtual, inherited]
 

Allocates and returns a new chunk of the appropriate type based on the given ID, according to the context given by this chunk itself.

Reimplemented in LwoClip, LwoSurface, LwoSurfaceBlock, LwoSurfaceBlockHeader, and LwoSurfaceBlockTMap.

Definition at line 66 of file iffChunk.cxx.

Referenced by IffInputFile::get_chunk(), LwoSurfaceBlockTMap::write(), and LwoClip::write().

void IffChunk::output ostream &  out  )  const [virtual, inherited]
 

Definition at line 37 of file iffChunk.cxx.

References IffChunk::_id, and indent().

bool LwoGroupChunk::read_chunks_iff IffInputFile in,
size_t  stop_at
[protected]
 

Reads a sequence of child chunks, until byte stop_at has been been reached, and stores them as the children.

Returns true if successful (and exactly the correct number of bytes were read), or false otherwise.

Definition at line 73 of file lwoGroupChunk.cxx.

References _chunks, IffInputFile::get_bytes_read(), IffInputFile::get_subchunk(), IffInputFile::is_eof(), NULL, and PT.

virtual bool IffChunk::read_iff IffInputFile in,
size_t  stop_at
[pure virtual, inherited]
 

Implemented in IffGenericChunk, LwoBoundingBox, LwoClip, LwoDiscontinuousVertexMap, LwoHeader, LwoLayer, LwoPoints, LwoPolygons, LwoPolygonTags, LwoStillImage, LwoSurface, LwoSurfaceBlock, LwoSurfaceBlockAxis, LwoSurfaceBlockChannel, LwoSurfaceBlockCoordSys, LwoSurfaceBlockEnabled, LwoSurfaceBlockHeader, LwoSurfaceBlockImage, LwoSurfaceBlockOpacity, LwoSurfaceBlockProjection, LwoSurfaceBlockRefObj, LwoSurfaceBlockRepeat, LwoSurfaceBlockTMap, LwoSurfaceBlockTransform, LwoSurfaceBlockVMapName, LwoSurfaceBlockWrap, LwoSurfaceColor, LwoSurfaceParameter, LwoSurfaceSidedness, LwoSurfaceSmoothingAngle, LwoTags, and LwoVertexMap.

bool LwoGroupChunk::read_subchunks_iff IffInputFile in,
size_t  stop_at
[protected]
 

Similar to read_chunks_iff(), but reads them as subchunks.

Definition at line 96 of file lwoGroupChunk.cxx.

References _chunks.

void IffChunk::set_id IffId  id  )  [inline, inherited]
 

Changes the ID associated with this chunk.

Definition at line 56 of file iffChunk.I.

void IffChunk::write ostream &  out,
int  indent_level = 0
const [virtual, inherited]
 

Reimplemented in IffGenericChunk, LwoBoundingBox, LwoClip, LwoDiscontinuousVertexMap, LwoHeader, LwoLayer, LwoPoints, LwoPolygons, LwoPolygonTags, LwoStillImage, LwoSurface, LwoSurfaceBlock, LwoSurfaceBlockAxis, LwoSurfaceBlockChannel, LwoSurfaceBlockCoordSys, LwoSurfaceBlockEnabled, LwoSurfaceBlockHeader, LwoSurfaceBlockImage, LwoSurfaceBlockOpacity, LwoSurfaceBlockProjection, LwoSurfaceBlockRefObj, LwoSurfaceBlockRepeat, LwoSurfaceBlockTMap, LwoSurfaceBlockTransform, LwoSurfaceBlockVMapName, LwoSurfaceBlockWrap, LwoSurfaceColor, LwoSurfaceParameter, LwoSurfaceSidedness, LwoSurfaceSmoothingAngle, LwoTags, and LwoVertexMap.

Definition at line 49 of file iffChunk.cxx.

References IffInputFile::make_new_chunk().

void LwoGroupChunk::write_chunks ostream &  out,
int  indent_level
const [protected]
 

Formats the list of chunks for output to the user (primarily for debugging), one per line.

Definition at line 119 of file lwoGroupChunk.cxx.

Referenced by LwoSurfaceBlockTMap::read_iff(), LwoSurface::read_iff(), and LwoClip::read_iff().


Member Data Documentation

Chunks LwoGroupChunk::_chunks [protected]
 

Definition at line 54 of file lwoGroupChunk.h.

Referenced by get_chunk(), get_num_chunks(), read_chunks_iff(), and read_subchunks_iff().

TypeHandle LwoGroupChunk::_type_handle [static, private]
 

Reimplemented from LwoChunk.

Reimplemented in LwoClip, LwoHeader, LwoSurface, LwoSurfaceBlock, LwoSurfaceBlockHeader, and LwoSurfaceBlockTMap.

Definition at line 27 of file lwoGroupChunk.cxx.

Referenced by get_type(), and init_type().


The documentation for this class was generated from the following files:
Generated on Fri May 2 03:27:26 2003 for Panda-Tool by doxygen1.3