#include <fltBead.h>
Inheritance diagram for FltBead:
Public Member Functions | |
FltBead (FltHeader *header) | |
bool | has_transform () const |
Returns true if the bead has been transformed, false otherwise. | |
const LMatrix4d & | get_transform () const |
Returns the single-precision 4x4 matrix that represents the transform applied to this bead, or the identity matrix if the bead has not been transformed. | |
void | set_transform (const LMatrix4d &mat) |
Replaces the transform matrix on this bead. | |
void | clear_transform () |
Removes any transform matrix and all transform steps on this bead. | |
int | get_num_transform_steps () const |
Returns the number of individual steps that define the net transform on this bead as returned by set_transform(). | |
FltTransformRecord * | get_transform_step (int n) |
Returns the nth individual step that defines the net transform on this bead. | |
const FltTransformRecord * | get_transform_step (int n) const |
Returns the nth individual step that defines the net transform on this bead. | |
void | add_transform_step (FltTransformRecord *record) |
Applies the indicated transform step to the net transformation applied to the bead. | |
int | get_replicate_count () const |
Returns the replicate count of this bead. | |
void | set_replicate_count (int count) |
Changes the replicate count of this bead. | |
int | get_num_children () const |
Returns the number of child records of this record. | |
FltRecord * | get_child (int n) const |
Returns the nth child of this record. | |
void | clear_children () |
Removes all children from this record. | |
void | add_child (FltRecord *child) |
Adds a new child to the end of the list of children for this record. | |
int | get_num_subfaces () const |
Returns the number of subface records of this record. | |
FltRecord * | get_subface (int n) const |
Returns the nth subface of this record. | |
void | clear_subfaces () |
Removes all subfaces from this record. | |
void | add_subface (FltRecord *subface) |
Adds a new subface to the end of the list of subfaces for this record. | |
int | get_num_extensions () const |
Returns the number of extension attribute records for this object. | |
FltRecord * | get_extension (int n) const |
Returns the nth extension of this record. | |
void | clear_extensions () |
Removes all extensions from this record. | |
void | add_extension (FltRecord *extension) |
Adds a new extension to the end of the list of extensions for this record. | |
int | get_num_ancillary () const |
Returns the number of unsupported ancillary records of this record. | |
FltRecord * | get_ancillary (int n) const |
Returns the nth unsupported ancillary record of this record. | |
void | clear_ancillary () |
Removes all unsupported ancillary records from this record. | |
void | add_ancillary (FltRecord *ancillary) |
Adds a new unsupported ancillary record to the end of the list of ancillary records for this record. | |
bool | has_comment () const |
Returns true if this record has a nonempty comment, false otherwise. | |
const string & | get_comment () const |
Retrieves the comment for this record, or empty string if the record has no comment. | |
void | clear_comment () |
Removes the comment for this record. | |
void | set_comment (const string &comment) |
Changes the comment for this record. | |
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. | |
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. | |
virtual void | output (ostream &out) const |
Writes a quick one-line description of the record, but not its children. | |
virtual void | write (ostream &out, int indent_level=0) const |
Writes a multiple-line description of the record and all of its children. | |
virtual TypeHandle | get_type () const |
virtual TypeHandle | force_init_type () |
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 Member Functions | |
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 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 | 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 FltError | write_ancillary (FltRecordWriter &writer) const |
Writes whatever ancillary records are required for this record. | |
void | write_children (ostream &out, int indent_level) const |
Assuming the current write position has been left at the end of the last line of the record description, writes out the list of children. | |
FltRecord * | create_new_record (FltOpcode opcode) const |
Creates a new FltRecord corresponding to the opcode. | |
FltError | read_record_and_children (FltRecordReader &reader) |
Extracts this record information from the current record presented in the reader, then advances the reader and continues to read any children, if present. | |
virtual FltError | write_record_and_children (FltRecordWriter &writer) const |
Writes this record out to the flt file, along with all of its ancillary records and children records. | |
Static Protected Member Functions | |
bool | is_ancillary (FltOpcode opcode) |
Returns true if the indicated opcode corresponds to an ancillary record type, false otherwise. | |
Protected Attributes | |
FltHeader * | _header |
int | _ref_count |
Static Protected Attributes | |
TypeHandle | _type_handle |
Private Member Functions | |
bool | extract_transform_matrix (FltRecordReader &reader) |
Reads a transform matrix ancillary bead. | |
bool | extract_replicate_count (FltRecordReader &reader) |
Reads a replicate count ancillary bead. | |
FltError | write_transform (FltRecordWriter &writer) const |
Writes out the transformation and all of its defining steps. | |
FltError | write_replicate_count (FltRecordWriter &writer) const |
Writes out the replicate count, if needed. | |
Private Attributes | |
bool | _has_transform |
LMatrix4d | _transform |
These are things like group beads and object beads, as opposed to things like push and pop or comment records.
Definition at line 47 of file fltBead.h.
|
Definition at line 48 of file fltBead.cxx. References _has_transform. |
|
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 341 of file fltRecord.cxx. |
|
Adds a new child to the end of the list of children for this record.
Definition at line 126 of file fltRecord.cxx. References nassertr, and NULL. Referenced by FltRecord::is_ancillary(). |
|
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 250 of file fltRecord.cxx. Referenced by FltRecord::is_ancillary(). |
|
Adds a new subface to the end of the list of subfaces for this record.
Definition at line 187 of file fltRecord.cxx. Referenced by FltRecord::is_ancillary(). |
|
Applies the indicated transform step to the net transformation applied to the bead.
Definition at line 201 of file fltBead.cxx. |
|
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 FltExternalReference, FltHeader, and FltTexture. Definition at line 460 of file fltRecord.cxx. References FO_15_material, FO_bsp, FO_color_palette, FO_dof, FO_external_ref, FO_eyepoint_palette, FO_face, FO_group, FO_header, FO_light_definition, FO_light_point, FO_lod, FO_mesh, FO_mesh_primitive, FO_morph_list, FO_name_table, FO_object, FO_texture, FO_texture_map_palette, FO_vertex_cn, FO_vertex_cnu, FO_vertex_cu, and FO_vertex_list. Referenced by FltExternalReference::FltExternalReference(). |
|
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 FltRecord. Reimplemented in FltBeadID, FltCurve, FltExternalReference, FltFace, FltGeometry, FltGroup, FltInstanceDefinition, FltInstanceRef, FltLOD, FltMesh, FltMeshPrimitive, and FltObject. Definition at line 359 of file fltBead.cxx. References _transform, Datagram::add_be_float32(), FE_ok, FltError, FO_transform_matrix, and writer(). Referenced by FltExternalReference::extract_record(). |
|
|
Removes all unsupported ancillary records from this record. See get_num_ancillary(). Definition at line 304 of file fltRecord.cxx. References FltRecord::_header, FltHeader::get_flt_version(), DatagramIterator::get_remaining_size(), TypedReferenceCount::get_type(), FltHeader::max_flt_version(), and nout. |
|
Removes all children from this record.
Definition at line 111 of file fltRecord.cxx. |
|
Removes the comment for this record.
Definition at line 384 of file fltRecord.cxx. |
|
Removes all extensions from this record.
Definition at line 233 of file fltRecord.cxx. |
|
Removes all subfaces from this record.
Definition at line 172 of file fltRecord.cxx. |
|
Removes any transform matrix and all transform steps on this bead.
Definition at line 123 of file fltBead.cxx. |
|
Creates a new FltRecord corresponding to the opcode. If the opcode is unknown, creates a FltUnsupportedRecord. Definition at line 672 of file fltRecord.cxx. References reader(). Referenced by FltRecord::is_ancillary(). |
|
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 FltRecord. Reimplemented in FltBeadID, and FltMesh. Definition at line 292 of file fltBead.cxx. References FE_ok, FltError, FltRecord::write_ancillary(), write_replicate_count(), write_transform(), and writer(). |
|
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 FltRecord. Reimplemented in FltBeadID, FltCurve, FltExternalReference, FltFace, FltGeometry, FltGroup, FltInstanceDefinition, FltInstanceRef, FltLOD, FltMesh, FltMeshPrimitive, and FltObject. Definition at line 268 of file fltBead.cxx. References FltRecord::build_record(), and writer(). Referenced by FltInstanceDefinition::FltInstanceDefinition(), FltMeshPrimitive::FltMeshPrimitive(), FltExternalReference::get_ref_filename(), and FltInstanceRef::write(). |
|
Reads a replicate count ancillary bead.
Definition at line 442 of file fltBead.cxx. |
|
Reads a transform matrix ancillary bead. This defines the net transformation that has been applied to the bead, and precedes the set of individual transform steps that define how this net transform was computed. Definition at line 414 of file fltBead.cxx. |
|
Returns the nth unsupported ancillary record of this record. See get_num_ancillary(). Definition at line 288 of file fltRecord.cxx. |
|
Returns the nth child of this record.
Definition at line 97 of file fltRecord.cxx. Referenced by FltCopy::scan_flt(). |
|
Retrieves the comment for this record, or empty string if the record has no comment.
Definition at line 371 of file fltRecord.cxx. References indent(), and FltRecord::write_children(). |
|
Returns the nth extension of this record.
Definition at line 219 of file fltRecord.cxx. |
|
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 273 of file fltRecord.cxx. |
|
Returns the number of child records of this record. This reflects the normal scene graph hierarchy. Definition at line 84 of file fltRecord.cxx. References NULL. |
|
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 206 of file fltRecord.cxx. |
|
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 145 of file fltRecord.cxx. |
|
Returns the number of individual steps that define the net transform on this bead as returned by set_transform(). Each step is a single transformation; the concatenation of all transformations will produce the matrix represented by set_transform(). Definition at line 148 of file fltBead.cxx. References _has_transform, _transform, and FltTransformRecord::get_matrix(). |
|
Returns the replicate count of this bead. If this is nonzero, it means that the bead is implicitly copied this number of additional times (for replicate_count + 1 total copies), applying the transform on this bead for each copy. In this case, the transform does not* apply to the initial copy of the bead. Definition at line 230 of file fltBead.cxx. References FO_rotate_about_edge, FO_rotate_about_point, FO_rotate_and_scale, FO_scale, and FO_translate. |
|
Returns the nth subface of this record.
Definition at line 158 of file fltRecord.cxx. |
|
Returns the single-precision 4x4 matrix that represents the transform applied to this bead, or the identity matrix if the bead has not been transformed.
Definition at line 86 of file fltBead.cxx. Referenced by FltToEggLevelState::ParentNodes::ParentNodes(). |
|
Returns the nth individual step that defines the net transform on this bead. See get_num_transform_steps(). Definition at line 184 of file fltBead.cxx. |
|
Returns the nth individual step that defines the net transform on this bead. See get_num_transform_steps(). Definition at line 165 of file fltBead.cxx. |
|
Returns true if this record has a nonempty comment, false otherwise.
Definition at line 356 of file fltRecord.cxx. References TypedReferenceCount::get_type(). |
|
Returns true if the bead has been transformed, false otherwise. If this returns true, get_transform() will return the single-precision net transformation, and get_num_transform_steps() will return nonzero. Definition at line 69 of file fltBead.cxx. References _has_transform, and _transform. |
|
Returns true if the indicated opcode corresponds to an ancillary record type, false otherwise. In general, this function is used to identify ancillary records that are not presently supported by the FltReader; these will be ignored. Normally, ancillary records will be detected and processed by extract_ancillary(). Definition at line 575 of file fltRecord.cxx. References FltRecord::_header, FltRecord::add_child(), FltRecord::add_extension(), FltHeader::add_instance(), FltRecord::add_subface(), FltRecord::create_new_record(), DCAST, FltRecord::extract_ancillary(), FltRecord::extract_record(), FE_end_of_file, FE_invalid_record, FE_ok, flt_error_abort, FltError, FO_pop, FO_pop_extension, FO_pop_face, FO_push, FO_push_extension, FO_push_face, FltInstanceDefinition::get_class_type(), nout, PT, and reader(). |
|
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 FltBeadID, FltExternalReference, FltUnsupportedRecord, and FltVertexList. Definition at line 485 of file fltRecord.cxx. References FO_cat, FO_clip_region, FO_curve, FO_extension, FO_light_source, FO_pop, FO_pop_attribute, FO_pop_face, FO_push, FO_push_attribute, FO_push_face, FO_road_construction, FO_road_path, FO_road_segment, FO_sound, FO_switch, and FO_text. |
|
Extracts this record information from the current record presented in the reader, then advances the reader and continues to read any children, if present. On return, the reader is position on the next sibling record to this record. Returns FE_ok if successful, otherwise on error. Definition at line 740 of file fltRecord.cxx. References FE_ok. |
|
Changes the comment for this record.
Definition at line 397 of file fltRecord.cxx. |
|
Changes the replicate count of this bead. If you are setting the replicate count to some nonzero number, you must also set a transform on the bead. See set_replicate_count(). Definition at line 249 of file fltBead.cxx. References FO_replicate. |
|
Replaces the transform matrix on this bead. This implicitly removes all of the transform steps added previously, and replaces them with a single 4x4 general matrix transform step. Definition at line 105 of file fltBead.cxx. |
|
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 504 of file fltRecord.cxx. References FO_instance, FO_instance_ref, FO_pop_extension, FO_push_extension, and nout. |
|
Writes whatever ancillary records are required for this record. Returns FE_ok on success, or something else if there is some error. Reimplemented from FltRecord. Reimplemented in FltBeadID, and FltMesh. Definition at line 379 of file fltBead.cxx. References FE_invalid_record. Referenced by FltBeadID::extract_ancillary(). |
|
Assuming the current write position has been left at the end of the last line of the record description, writes out the list of children.
Definition at line 522 of file fltRecord.cxx. References FltRecord::_header, FO_curve, FO_external_ref, FO_face, FO_group, FO_instance, FO_instance_ref, FO_local_vertex_pool, FO_lod, FO_mesh, FO_mesh_primitive, FO_object, FO_vector, FO_vertex_list, and nout. Referenced by FltRecord::get_comment(), and FltInstanceRef::get_instance(). |
|
Writes this record out to the flt file, along with all of its ancillary records and children records. Returns FE_ok on success, or something else on error. Reimplemented in FltInstanceRef. Definition at line 904 of file fltRecord.cxx. Referenced by FltInstanceRef::extract_record(). |
|
Writes out the replicate count, if needed.
Definition at line 505 of file fltBead.cxx. Referenced by extract_ancillary(). |
|
Writes out the transformation and all of its defining steps.
Definition at line 464 of file fltBead.cxx. Referenced by extract_ancillary(). |
|
Definition at line 79 of file fltBead.h. Referenced by FltBead(), get_num_transform_steps(), and has_transform(). |
|
|
Definition at line 80 of file fltBead.h. Referenced by build_record(), get_num_transform_steps(), and has_transform(). |