Panda3D
|
A base class for any of a broad family of flt beads that include an ID. More...
#include "fltBeadID.h"
Public Member Functions | |
FltBeadID (FltHeader *header) | |
virtual TypeHandle | force_init_type () |
const string & | get_id () const |
Returns the id (name) of this particular bead. | |
virtual TypeHandle | get_type () const |
virtual void | output (ostream &out) const |
Writes a quick one-line description of the record, but not its children. | |
void | set_id (const string &id) |
Changes the id (name) of this particular bead. | |
Static Public Member Functions | |
static TypeHandle | get_class_type () |
static void | init_type () |
This function is declared non-inline to work around a compiler bug in g++ 2.96. | |
Protected Member Functions | |
virtual bool | build_record (FltRecordWriter &writer) const |
Fills up the current record on the FltRecordWriter with data for this record, but does not advance the writer. | |
virtual bool | extract_ancillary (FltRecordReader &reader) |
Checks whether the given bead, which follows this bead sequentially in the file, is an ancillary record of this bead. | |
virtual bool | extract_record (FltRecordReader &reader) |
Fills in the information in this bead based on the information given in the indicated datagram, whose opcode has already been read. | |
virtual FltError | write_ancillary (FltRecordWriter &writer) const |
Writes whatever ancillary records are required for this record. |
A base class for any of a broad family of flt beads that include an ID.
Definition at line 27 of file fltBeadID.h.
bool FltBeadID::build_record | ( | FltRecordWriter & | writer | ) | const [protected, virtual] |
Fills up the current record on the FltRecordWriter with data for this record, but does not advance the writer.
Returns true on success, false if there is some error.
Reimplemented from FltBead.
Reimplemented in FltCurve, FltFace, FltGeometry, FltGroup, FltHeader, FltLOD, FltMesh, and FltObject.
Definition at line 116 of file fltBeadID.cxx.
References Datagram::add_fixed_string(), FltBead::build_record(), and FltRecordWriter::update_datagram().
Referenced by FltObject::build_record(), FltMesh::build_record(), FltLOD::build_record(), FltHeader::build_record(), FltGroup::build_record(), FltFace::build_record(), and FltCurve::build_record().
bool FltBeadID::extract_ancillary | ( | FltRecordReader & | reader | ) | [protected, virtual] |
Checks whether the given bead, which follows this bead sequentially in the file, is an ancillary record of this bead.
If it is, extracts the relevant information and returns true; otherwise, leaves it alone and returns false.
Reimplemented from FltBead.
Reimplemented in FltHeader, and FltMesh.
Definition at line 96 of file fltBeadID.cxx.
References FltRecordReader::get_iterator(), FltRecordReader::get_opcode(), and DatagramIterator::get_remaining_bytes().
bool FltBeadID::extract_record | ( | FltRecordReader & | reader | ) | [protected, virtual] |
Fills in the information in this bead based on the information given in the indicated datagram, whose opcode has already been read.
Returns true on success, false if the datagram is invalid.
Reimplemented from FltBead.
Reimplemented in FltCurve, FltFace, FltGeometry, FltGroup, FltHeader, FltLOD, FltMesh, and FltObject.
Definition at line 77 of file fltBeadID.cxx.
References FltBead::extract_record(), DatagramIterator::get_fixed_string(), and FltRecordReader::get_iterator().
Referenced by FltObject::extract_record(), FltMesh::extract_record(), FltLOD::extract_record(), FltHeader::extract_record(), FltGroup::extract_record(), FltFace::extract_record(), and FltCurve::extract_record().
const string & FltBeadID::get_id | ( | ) | const |
Returns the id (name) of this particular bead.
Each MultiGen bead will have a unique name.
Definition at line 37 of file fltBeadID.cxx.
static void FltBeadID::init_type | ( | ) | [inline, static] |
This function is declared non-inline to work around a compiler bug in g++ 2.96.
Making it inline seems to cause problems in the optimizer.
Reimplemented from FltBead.
Reimplemented in FltCurve, FltFace, FltGeometry, FltGroup, FltHeader, FltLOD, FltMesh, and FltObject.
Definition at line 54 of file fltBeadID.h.
void FltBeadID::output | ( | ostream & | out | ) | const [virtual] |
Writes a quick one-line description of the record, but not its children.
This is a human-readable description, primarily for debugging; to write a flt file, use FltHeader::write_flt().
Reimplemented from FltRecord.
Definition at line 61 of file fltBeadID.cxx.
void FltBeadID::set_id | ( | const string & | id | ) |
Changes the id (name) of this particular bead.
This should be a name that is unique to this bead.
Definition at line 48 of file fltBeadID.cxx.
FltError FltBeadID::write_ancillary | ( | FltRecordWriter & | writer | ) | const [protected, virtual] |
Writes whatever ancillary records are required for this record.
Returns FE_ok on success, or something else if there is some error.
Reimplemented from FltBead.
Reimplemented in FltHeader, and FltMesh.
Definition at line 133 of file fltBeadID.cxx.
References FltRecordWriter::write_record().