The base class for all kinds of records in a MultiGen OpenFlight file. More...
#include "fltRecord.h"
Public Member Functions | |
FltRecord (FltHeader *header) | |
void | add_ancillary (FltRecord *ancillary) |
Adds a new unsupported ancillary record to the end of the list of ancillary records for this record. More... | |
void | add_child (FltRecord *child) |
Adds a new child to the end of the list of children for this record. More... | |
void | add_extension (FltRecord *extension) |
Adds a new extension to the end of the list of extensions for this record. More... | |
void | add_subface (FltRecord *subface) |
Adds a new subface to the end of the list of subfaces for this record. More... | |
virtual void | apply_converted_filenames () |
Walks the hierarchy at this record and below and copies the _converted_filename record into the _orig_filename record, so the flt file will be written out with the converted filename instead of what was originally read in. More... | |
void | check_remaining_size (const DatagramIterator &di, const string &name=string()) const |
Checks that the iterator has no bytes left, as it should at the end of a successfully read record. More... | |
void | clear_ancillary () |
Removes all unsupported ancillary records from this record. More... | |
void | clear_children () |
Removes all children from this record. More... | |
void | clear_comment () |
Removes the comment for this record. More... | |
void | clear_extensions () |
Removes all extensions from this record. More... | |
void | clear_subfaces () |
Removes all subfaces from this record. More... | |
virtual TypeHandle | force_init_type () |
FltRecord * | get_ancillary (int n) const |
Returns the nth unsupported ancillary record of this record. More... | |
FltRecord * | get_child (int n) const |
Returns the nth child of this record. More... | |
const string & | get_comment () const |
Retrieves the comment for this record, or empty string if the record has no comment. More... | |
FltRecord * | get_extension (int n) const |
Returns the nth extension of this record. More... | |
int | get_num_ancillary () const |
Returns the number of unsupported ancillary records of this record. More... | |
int | get_num_children () const |
Returns the number of child records of this record. More... | |
int | get_num_extensions () const |
Returns the number of extension attribute records for this object. More... | |
int | get_num_subfaces () const |
Returns the number of subface records of this record. More... | |
FltRecord * | get_subface (int n) const |
Returns the nth subface of this record. More... | |
virtual TypeHandle | get_type () const |
bool | has_comment () const |
Returns true if this record has a nonempty comment, false otherwise. More... | |
virtual void | output (ostream &out) const |
Writes a quick one-line description of the record, but not its children. More... | |
void | set_comment (const string &comment) |
Changes the comment for this record. More... | |
virtual void | write (ostream &out, int indent_level=0) const |
Writes a multiple-line description of the record and all of its children. More... | |
![]() | |
TypedReferenceCount (const TypedReferenceCount ©) | |
void | operator= (const TypedReferenceCount ©) |
![]() | |
TypedObject (const TypedObject ©) | |
TypedObject * | as_typed_object () |
Returns the object, upcast (if necessary) to a TypedObject pointer. More... | |
const TypedObject * | as_typed_object () const |
Returns the object, upcast (if necessary) to a TypedObject pointer. More... | |
int | get_best_parent_from_Set (const std::set< int > &) const |
int | get_type_index () const |
Returns the internal index number associated with this object's TypeHandle, a unique number for each different type. More... | |
bool | is_exact_type (TypeHandle handle) const |
Returns true if the current object is the indicated type exactly. More... | |
bool | is_of_type (TypeHandle handle) const |
Returns true if the current object is or derives from the indicated type. More... | |
void | operator= (const TypedObject ©) |
![]() | |
int | get_ref_count () const |
Returns the current reference count. More... | |
WeakReferenceList * | get_weak_list () const |
Returns the WeakReferenceList associated with this ReferenceCount object. More... | |
bool | has_weak_list () const |
Returns true if this particular ReferenceCount object has a WeakReferenceList created, false otherwise. More... | |
void | local_object () |
This function should be called, once, immediately after creating a new instance of some ReferenceCount-derived object on the stack. More... | |
void | ref () const |
Explicitly increments the reference count. More... | |
bool | test_ref_count_integrity () const |
Does some easy checks to make sure that the reference count isn't completely bogus. More... | |
bool | test_ref_count_nonzero () const |
Does some easy checks to make sure that the reference count isn't zero, or completely bogus. More... | |
virtual bool | unref () const |
Explicitly decrements the reference count. More... | |
void | weak_ref (WeakPointerToVoid *ptv) |
Adds the indicated PointerToVoid as a weak reference to this object. More... | |
void | weak_unref (WeakPointerToVoid *ptv) |
Removes the indicated PointerToVoid as a weak reference to this object. More... | |
Static Public Member Functions | |
static TypeHandle | get_class_type () |
static void | init_type () |
![]() | |
static TypeHandle | get_class_type () |
static void | init_type () |
![]() | |
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. More... | |
![]() | |
static TypeHandle | get_class_type () |
static void | init_type () |
The base class for all kinds of records in a MultiGen OpenFlight file.
A flt file consists of a hierarchy of "beads" of various kinds, each of which may be followed by n ancillary records, written sequentially to the file.
Definition at line 40 of file fltRecord.h.
void FltRecord::add_ancillary | ( | FltRecord * | ancillary | ) |
Adds a new unsupported ancillary record to the end of the list of ancillary records for this record.
This record will be written to the flt file following this record, without attempting to understand what is in it.
Normally, there is no reason to use this function; if the data stored in the FltRecord requires one or more ancillary record, the appropriate records will automatically be generated when the record is written. This function is only required to output a record whose type is not supported by the flt loader. But it would be better to extend the flt loader to know about this new kind of data record.
Definition at line 253 of file fltRecord.cxx.
void FltRecord::add_child | ( | FltRecord * | child | ) |
Adds a new child to the end of the list of children for this record.
Definition at line 102 of file fltRecord.cxx.
void FltRecord::add_extension | ( | FltRecord * | extension | ) |
Adds a new extension to the end of the list of extensions for this record.
This should be a record of type FO_extension.
Definition at line 193 of file fltRecord.cxx.
void FltRecord::add_subface | ( | FltRecord * | subface | ) |
Adds a new subface to the end of the list of subfaces for this record.
Definition at line 147 of file fltRecord.cxx.
|
virtual |
Walks the hierarchy at this record and below and copies the _converted_filename record into the _orig_filename record, so the flt file will be written out with the converted filename instead of what was originally read in.
Reimplemented in FltHeader, FltExternalReference, and FltTexture.
Definition at line 340 of file fltRecord.cxx.
Referenced by FltExternalReference::apply_converted_filenames(), FltTexture::apply_converted_filenames(), and FltHeader::apply_converted_filenames().
void FltRecord::check_remaining_size | ( | const DatagramIterator & | di, |
const string & | name = string() |
||
) | const |
Checks that the iterator has no bytes left, as it should at the end of a successfully read record.
If there *are* remaining bytes, print a warning message but otherwise don't worry about it.
If we are attempting to read a flt file whose version is newer than the newest this program understands, don't even print a warning message, since this is exactly the sort of thing we expect.
Definition at line 313 of file fltRecord.cxx.
References FltHeader::get_flt_version(), DatagramIterator::get_remaining_size(), and FltHeader::max_flt_version().
Referenced by FltLocalVertexPool::extract_record().
void FltRecord::clear_ancillary | ( | ) |
Removes all unsupported ancillary records from this record.
See get_num_ancillary().
Definition at line 231 of file fltRecord.cxx.
void FltRecord::clear_children | ( | ) |
Removes all children from this record.
Definition at line 91 of file fltRecord.cxx.
void FltRecord::clear_comment | ( | ) |
Removes the comment for this record.
Definition at line 285 of file fltRecord.cxx.
void FltRecord::clear_extensions | ( | ) |
Removes all extensions from this record.
Definition at line 181 of file fltRecord.cxx.
void FltRecord::clear_subfaces | ( | ) |
Removes all subfaces from this record.
Definition at line 136 of file fltRecord.cxx.
FltRecord * FltRecord::get_ancillary | ( | int | n | ) | const |
Returns the nth unsupported ancillary record of this record.
See get_num_ancillary().
Definition at line 219 of file fltRecord.cxx.
FltRecord * FltRecord::get_child | ( | int | n | ) | const |
Returns the nth child of this record.
Definition at line 80 of file fltRecord.cxx.
const string & FltRecord::get_comment | ( | ) | const |
Retrieves the comment for this record, or empty string if the record has no comment.
Definition at line 275 of file fltRecord.cxx.
FltRecord * FltRecord::get_extension | ( | int | n | ) | const |
Returns the nth extension of this record.
Definition at line 170 of file fltRecord.cxx.
int FltRecord::get_num_ancillary | ( | ) | const |
Returns the number of unsupported ancillary records of this record.
These are ancillary records that appeared following this record in the flt file but that aren't directly understood by the flt loader–normally, an ancillary record is examined and decoded on the spot, and no pointer to it is kept.
Definition at line 208 of file fltRecord.cxx.
int FltRecord::get_num_children | ( | ) | const |
Returns the number of child records of this record.
This reflects the normal scene graph hierarchy.
Definition at line 70 of file fltRecord.cxx.
int FltRecord::get_num_extensions | ( | ) | const |
Returns the number of extension attribute records for this object.
These are auxiliary nodes, presumably of type FO_extension, that have some local meaning to the object.
Definition at line 160 of file fltRecord.cxx.
int FltRecord::get_num_subfaces | ( | ) | const |
Returns the number of subface records of this record.
Normally, subfaces will only be present on object records, although it is logically possible for them to appear anywhere.
Definition at line 115 of file fltRecord.cxx.
FltRecord * FltRecord::get_subface | ( | int | n | ) | const |
Returns the nth subface of this record.
Definition at line 125 of file fltRecord.cxx.
bool FltRecord::has_comment | ( | ) | const |
Returns true if this record has a nonempty comment, false otherwise.
Definition at line 264 of file fltRecord.cxx.
|
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 in FltVertexList, FltBeadID, FltExternalReference, and FltUnsupportedRecord.
Definition at line 359 of file fltRecord.cxx.
void FltRecord::set_comment | ( | const string & | comment | ) |
Changes the comment for this record.
Definition at line 295 of file fltRecord.cxx.
|
virtual |
Writes a multiple-line description of the record and all of its children.
This is a human-readable description, primarily for debugging; to write a flt file, use FltHeader::write_flt().
Reimplemented in FltInstanceRef.
Definition at line 372 of file fltRecord.cxx.