Panda3D
|
This is a node which contains all of the data elements defined by a template. More...
#include "xFileDataNodeTemplate.h"
Public Member Functions | |
XFileDataNodeTemplate (XFile *x_file, const string &name, XFileTemplate *xtemplate) | |
virtual bool | add_element (XFileDataObject *element) |
Adds the indicated element as a nested data element, if this data object type supports it. | |
void | add_parse_double (PTA_double double_list) |
Adds the indicated list of doubles as a data element encountered in the parser. | |
void | add_parse_int (PTA_int int_list) |
Adds the indicated list of ints as a data element encountered in the parser. | |
void | add_parse_string (const string &str) |
Adds the indicated string as a data element encountered in the parser. | |
bool | finalize_parse_data () |
Processes all of the data elements added by add_parse_*(), checks them for syntactic and semantic correctness against the Template definition, and stores the appropriate child data elements. | |
virtual TypeHandle | force_init_type () |
virtual TypeHandle | get_type () const |
virtual bool | is_complex_object () const |
Returns true if this kind of data object is a complex object that can hold nested data elements, false otherwise. | |
virtual void | write_data (ostream &out, int indent_level, const char *separator) const |
Writes a suitable representation of this node to an .x file in text mode. | |
virtual void | write_text (ostream &out, int indent_level) const |
Writes a suitable representation of this node to an .x file in text mode. | |
void | zero_fill () |
Fills the data node with zero-valued elements appropriate to the template. | |
Static Public Member Functions | |
static TypeHandle | get_class_type () |
static void | init_type () |
Protected Member Functions | |
virtual XFileDataObject * | get_element (int n) |
Returns the nth nested data element within the object. | |
virtual XFileDataObject * | get_element (const string &name) |
Returns the nested data element within the object that has the indicated name. | |
virtual int | get_num_elements () const |
Returns the number of nested data elements within the object. |
This is a node which contains all of the data elements defined by a template.
See XFileTemplate for the definition of the template; this class only contains the data members for a particular instance of a template.
Definition at line 34 of file xFileDataNodeTemplate.h.
bool XFileDataNodeTemplate::add_element | ( | XFileDataObject * | element | ) | [virtual] |
Adds the indicated element as a nested data element, if this data object type supports it.
Returns true if added successfully, false if the data object type does not support nested data elements.
Reimplemented from XFileDataObject.
Definition at line 145 of file xFileDataNodeTemplate.cxx.
void XFileDataNodeTemplate::add_parse_double | ( | PTA_double | double_list | ) |
Adds the indicated list of doubles as a data element encountered in the parser.
It will later be processed by finalize_parse_data().
Definition at line 66 of file xFileDataNodeTemplate.cxx.
void XFileDataNodeTemplate::add_parse_int | ( | PTA_int | int_list | ) |
Adds the indicated list of ints as a data element encountered in the parser.
It will later be processed by finalize_parse_data().
Definition at line 82 of file xFileDataNodeTemplate.cxx.
void XFileDataNodeTemplate::add_parse_string | ( | const string & | str | ) |
Adds the indicated string as a data element encountered in the parser.
It will later be processed by finalize_parse_data().
Definition at line 98 of file xFileDataNodeTemplate.cxx.
Processes all of the data elements added by add_parse_*(), checks them for syntactic and semantic correctness against the Template definition, and stores the appropriate child data elements.
Returns true on success, false if there is a mismatch.
Definition at line 116 of file xFileDataNodeTemplate.cxx.
XFileDataObject * XFileDataNodeTemplate::get_element | ( | int | n | ) | [protected, virtual] |
Returns the nth nested data element within the object.
Reimplemented from XFileDataObject.
Definition at line 244 of file xFileDataNodeTemplate.cxx.
Referenced by get_element().
XFileDataObject * XFileDataNodeTemplate::get_element | ( | const string & | name | ) | [protected, virtual] |
Returns the nested data element within the object that has the indicated name.
Reimplemented from XFileDataObject.
Definition at line 256 of file xFileDataNodeTemplate.cxx.
References get_element().
int XFileDataNodeTemplate::get_num_elements | ( | ) | const [protected, virtual] |
Returns the number of nested data elements within the object.
This may be, e.g. the size of the array, if it is an array.
Reimplemented from XFileDataObject.
Definition at line 233 of file xFileDataNodeTemplate.cxx.
bool XFileDataNodeTemplate::is_complex_object | ( | ) | const [virtual] |
Returns true if this kind of data object is a complex object that can hold nested data elements, false otherwise.
Reimplemented from XFileDataObject.
Definition at line 54 of file xFileDataNodeTemplate.cxx.
void XFileDataNodeTemplate::write_data | ( | ostream & | out, |
int | indent_level, | ||
const char * | separator | ||
) | const [virtual] |
Writes a suitable representation of this node to an .x file in text mode.
Reimplemented from XFileDataObject.
Definition at line 182 of file xFileDataNodeTemplate.cxx.
References XFileDataObject::i(), and XFileDataObject::is_complex_object().
void XFileDataNodeTemplate::write_text | ( | ostream & | out, |
int | indent_level | ||
) | const [virtual] |
Writes a suitable representation of this node to an .x file in text mode.
Reimplemented from XFileNode.
Definition at line 157 of file xFileDataNodeTemplate.cxx.
References Namable::has_name().
void XFileDataNodeTemplate::zero_fill | ( | ) |
Fills the data node with zero-valued elements appropriate to the template.
Definition at line 42 of file xFileDataNodeTemplate.cxx.
Referenced by XFileDataObject::add_Coords2d(), XFileNode::add_Frame(), XFileNode::add_FrameTransformMatrix(), XFileDataObject::add_IndexedColor(), XFileNode::add_Material(), XFileNode::add_Mesh(), XFileDataObject::add_MeshFace(), XFileNode::add_MeshMaterialList(), XFileNode::add_MeshNormals(), XFileNode::add_MeshTextureCoords(), XFileNode::add_MeshVertexColors(), XFileNode::add_TextureFilename(), and XFileDataObject::add_Vector().