|
|
|
The abstract base class for a number of different types of data elements that may be stored in the X file.
More...
#include "xFileDataObject.h"
List of all members.
Public Member Functions |
|
| XFileDataObject (const XFileDataDef *data_def=NULL) |
| XFileDataObject & | add_Coords2d (XFile *x_file, const LVecBase2d &coords) |
| | Appends a new Coords2d instance.
|
| XFileDataObject & | add_double (double double_value) |
| | Appends a new floating-point value to the data object, if it makes sense to do so.
|
| virtual bool | add_element (XFileDataObject *element) |
| | Adds the indicated element as a nested data element, if this data object type supports it.
|
| XFileDataObject & | add_IndexedColor (XFile *x_file, int index, const LColor &color) |
| | Appends a new IndexedColor instance.
|
| XFileDataObject & | add_int (int int_value) |
| | Appends a new integer value to the data object, if it makes sense to do so.
|
| XFileDataObject & | add_MeshFace (XFile *x_file) |
| | Appends a new MeshFace instance.
|
| XFileDataObject & | add_string (const string &string_value) |
| | Appends a new string value to the data object, if it makes sense to do so.
|
| XFileDataObject & | add_Vector (XFile *x_file, const LVecBase3d &vector) |
| | Appends a new Vector instance.
|
| double | d () const |
| | Unambiguously returns the object's representation as a double, or 0.0 if the object has no double representation.
|
|
virtual TypeHandle | force_init_type () |
| const XFileDataDef * | get_data_def () const |
| | Returns the data object that this object is represented by, if any, or NULL if there is none.
|
|
virtual TypeHandle | get_type () const |
| virtual string | get_type_name () const |
| | Returns a string that represents the type of object this data object represents.
|
| int | i () const |
| | Unambiguously returns the object's representation as an integer, or 0 if the object has no integer representation.
|
| 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.
|
| LMatrix4d | mat4 () const |
| | Returns the object's representation as an LMatrix4d.
|
| void | operator= (const string &string_value) |
| | Stores the indicated string value into the object, if it makes sense to do so.
|
| void | operator= (const LVecBase2d &vec) |
| | Stores the indicated Vec2 value into the object, if it makes sense to do so.
|
| void | operator= (const LVecBase3d &vec) |
| | Stores the indicated Vec3 value into the object, if it makes sense to do so.
|
| void | operator= (const LVecBase4d &vec) |
| | Stores the indicated Vec4 value into the object, if it makes sense to do so.
|
| void | operator= (const LMatrix4d &mat) |
| | Stores the indicated Matrix value into the object, if it makes sense to do so.
|
| void | operator= (int int_value) |
| | Stores the indicated integer value into the object, if it makes sense to do so.
|
| void | operator= (double double_value) |
| | Stores the indicated floating-point value into the object, if it makes sense to do so.
|
| const XFileDataObject & | operator[] (const string &name) const |
| | Returns the named nested object within this object.
|
| XFileDataObject & | operator[] (const string &name) |
| | Returns the named nested object within this object.
|
| const XFileDataObject & | operator[] (int n) const |
| | Returns the nth nested object within this object.
|
| XFileDataObject & | operator[] (int n) |
| | Returns the nth nested object within this object.
|
| virtual void | output_data (ostream &out) const |
| | Writes a suitable representation of this node to an .x file in text mode.
|
| string | s () const |
| | Unambiguously returns the object's representation as a string, or empty string if the object has no string representation.
|
| void | set (const LVecBase4d &vec) |
| | Stores the indicated Vec4 value into the object, if it makes sense to do so.
|
| void | set (const string &string_value) |
| | Stores the indicated string value into the object, if it makes sense to do so.
|
| void | set (double double_value) |
| | Stores the indicated floating-point value into the object, if it makes sense to do so.
|
| void | set (const LVecBase3d &vec) |
| | Stores the indicated Vec3 value into the object, if it makes sense to do so.
|
| void | set (const LVecBase2d &vec) |
| | Stores the indicated Vec2 value into the object, if it makes sense to do so.
|
| void | set (int int_value) |
| | Stores the indicated integer value into the object, if it makes sense to do so.
|
| void | set (const LMatrix4d &mat) |
| | Stores the indicated Matrix value into the object, if it makes sense to do so.
|
| int | size () const |
| | Returns the number of nested data objects within this object.
|
| LVecBase2d | vec2 () const |
| | Returns the object's representation as an LVecBase2d.
|
| LVecBase3d | vec3 () const |
| | Returns the object's representation as an LVecBase3d.
|
| LVecBase4d | vec4 () const |
| | Returns the object's representation as an LVecBase4d.
|
| 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.
|
Static Public Member Functions |
|
static TypeHandle | get_class_type () |
|
static void | init_type () |
Protected Member Functions |
| void | get_double_array (int num_elements, double *values) const |
| | Fills the indicated array of doubles with the values from the nested elements within this object.
|
| virtual double | get_double_value () const |
| | Returns the object's representation as a double, if it has one.
|
| virtual XFileDataObject * | get_element (const string &name) |
| | Returns the nested data element within the object that has the indicated name.
|
| virtual XFileDataObject * | get_element (int n) |
| | Returns the nth nested data element within the object.
|
| virtual int | get_int_value () const |
| | Returns the object's representation as an integer, if it has one.
|
| virtual int | get_num_elements () const |
| | Returns the number of nested data elements within the object.
|
| virtual string | get_string_value () const |
| | Returns the object's representation as a string, if it has one.
|
| virtual void | set_double_value (double double_value) |
| | Sets the object's value as a floating-point number, if this is legal.
|
| virtual void | set_int_value (int int_value) |
| | Sets the object's value as an integer, if this is legal.
|
| virtual void | set_string_value (const string &string_value) |
| | Sets the object's value as a string, if this is legal.
|
| void | store_double_array (int num_elements, const double *values) |
| | Stores the indicated array of doubles in the nested elements within this object.
|
Protected Attributes |
|
const XFileDataDef * | _data_def |
Detailed Description
The abstract base class for a number of different types of data elements that may be stored in the X file.
Definition at line 33 of file xFileDataObject.h.
Member Function Documentation
Appends a new floating-point value to the data object, if it makes sense to do so.
Normally, this is valid only for a DataObjectArray, or in certain special cases for a DataNodeTemplate.
Definition at line 84 of file xFileDataObject.cxx.
References add_element(), and get_data_def().
| XFileDataObject & XFileDataObject::add_string |
( |
const string & |
string_value | ) |
|
Appends a new string value to the data object, if it makes sense to do so.
Normally, this is valid only for a DataObjectArray, or in certain special cases for a DataNodeTemplate.
Definition at line 100 of file xFileDataObject.cxx.
References add_element(), and get_data_def().
| double XFileDataObject::d |
( |
| ) |
const [inline] |
| const XFileDataDef * XFileDataObject::get_data_def |
( |
| ) |
const [inline] |
| void XFileDataObject::get_double_array |
( |
int |
num_elements, |
|
|
double * |
values |
|
) |
| const [protected] |
| double XFileDataObject::get_double_value |
( |
| ) |
const [protected, virtual] |
| XFileDataObject * XFileDataObject::get_element |
( |
int |
n | ) |
[protected, virtual] |
| XFileDataObject * XFileDataObject::get_element |
( |
const string & |
name | ) |
[protected, virtual] |
| int XFileDataObject::get_int_value |
( |
| ) |
const [protected, virtual] |
| int XFileDataObject::get_num_elements |
( |
| ) |
const [protected, virtual] |
| string XFileDataObject::get_string_value |
( |
| ) |
const [protected, virtual] |
| string XFileDataObject::get_type_name |
( |
| ) |
const [virtual] |
| int XFileDataObject::i |
( |
| ) |
const [inline] |
| bool XFileDataObject::is_complex_object |
( |
| ) |
const [virtual] |
| LMatrix4d XFileDataObject::mat4 |
( |
| ) |
const [inline] |
| void XFileDataObject::operator= |
( |
const string & |
string_value | ) |
[inline] |
Stores the indicated string value into the object, if it makes sense to do so.
It is an error to call this on an object that cannot accept a string value.
Definition at line 72 of file xFileDataObject.I.
| void XFileDataObject::operator= |
( |
const LVecBase3d & |
vec | ) |
[inline] |
Stores the indicated Vec3 value into the object, if it makes sense to do so.
It is an error to call this on an object that does not store three floating-point values.
Definition at line 98 of file xFileDataObject.I.
| void XFileDataObject::operator= |
( |
const LVecBase4d & |
vec | ) |
[inline] |
Stores the indicated Vec4 value into the object, if it makes sense to do so.
It is an error to call this on an object that does not store four floating-point values.
Definition at line 111 of file xFileDataObject.I.
| void XFileDataObject::operator= |
( |
int |
int_value | ) |
[inline] |
Stores the indicated integer value into the object, if it makes sense to do so.
It is an error to call this on an object that cannot accept an integer value.
Definition at line 46 of file xFileDataObject.I.
| void XFileDataObject::operator= |
( |
const LMatrix4d & |
mat | ) |
[inline] |
Stores the indicated Matrix value into the object, if it makes sense to do so.
It is an error to call this on an object that does not store sixteen floating-point values.
Definition at line 124 of file xFileDataObject.I.
| void XFileDataObject::operator= |
( |
double |
double_value | ) |
[inline] |
Stores the indicated floating-point value into the object, if it makes sense to do so.
It is an error to call this on an object that cannot accept a floating-point value.
Definition at line 59 of file xFileDataObject.I.
| void XFileDataObject::operator= |
( |
const LVecBase2d & |
vec | ) |
[inline] |
Stores the indicated Vec2 value into the object, if it makes sense to do so.
It is an error to call this on an object that does not store two floating-point values.
Definition at line 85 of file xFileDataObject.I.
| const XFileDataObject & XFileDataObject::operator[] |
( |
int |
n | ) |
const [inline] |
Returns the nth nested object within this object.
Call get_num_children() to determine the number of nested objects.
Definition at line 332 of file xFileDataObject.I.
References get_element().
| const XFileDataObject & XFileDataObject::operator[] |
( |
const string & |
name | ) |
const [inline] |
Returns the named nested object within this object.
It is an error if the named object does not exist. Call find_child() instead if there is any doubt.
Definition at line 346 of file xFileDataObject.I.
References get_element().
Returns the nth nested object within this object.
Call get_num_children() to determine the number of nested objects.
Definition at line 360 of file xFileDataObject.I.
References get_element().
| XFileDataObject & XFileDataObject::operator[] |
( |
const string & |
name | ) |
[inline] |
Returns the named nested object within this object.
It is an error if the named object does not exist. Call find_child() instead if there is any doubt.
Definition at line 374 of file xFileDataObject.I.
References get_element().
| void XFileDataObject::output_data |
( |
ostream & |
out | ) |
const [virtual] |
| string XFileDataObject::s |
( |
| ) |
const [inline] |
Unambiguously returns the object's representation as a string, or empty string if the object has no string representation.
See also get_data_def() to determine what kind of representation this object has.
Definition at line 253 of file xFileDataObject.I.
References get_string_value().
| void XFileDataObject::set |
( |
const LVecBase4d & |
vec | ) |
[inline] |
| void XFileDataObject::set |
( |
const LMatrix4d & |
mat | ) |
[inline] |
| void XFileDataObject::set |
( |
const LVecBase2d & |
vec | ) |
[inline] |
| void XFileDataObject::set |
( |
double |
double_value | ) |
[inline] |
Stores the indicated floating-point value into the object, if it makes sense to do so.
It is an error to call this on an object that cannot accept a floating-point value.
Definition at line 149 of file xFileDataObject.I.
References set_double_value().
| void XFileDataObject::set |
( |
const string & |
string_value | ) |
[inline] |
Stores the indicated string value into the object, if it makes sense to do so.
It is an error to call this on an object that cannot accept a string value.
Definition at line 162 of file xFileDataObject.I.
References set_string_value().
| void XFileDataObject::set |
( |
int |
int_value | ) |
[inline] |
| void XFileDataObject::set |
( |
const LVecBase3d & |
vec | ) |
[inline] |
| void XFileDataObject::set_double_value |
( |
double |
double_value | ) |
[protected, virtual] |
| void XFileDataObject::set_int_value |
( |
int |
int_value | ) |
[protected, virtual] |
| void XFileDataObject::set_string_value |
( |
const string & |
string_value | ) |
[protected, virtual] |
| int XFileDataObject::size |
( |
| ) |
const [inline] |
Returns the number of nested data objects within this object.
Definition at line 320 of file xFileDataObject.I.
References get_num_elements().
Referenced by XFileMesh::fill_colors(), XFileMesh::fill_material_list(), XFileMesh::fill_mesh(), XFileMesh::fill_normals(), XFileMesh::fill_skin_weights(), XFileMesh::fill_uvs(), XFileMesh::make_x_colors(), XFileMesh::make_x_material_list(), XFileMesh::make_x_mesh(), XFileMesh::make_x_normals(), and XFileMesh::make_x_uvs().
| void XFileDataObject::store_double_array |
( |
int |
num_elements, |
|
|
const double * |
values |
|
) |
| [protected] |
| LVecBase2d XFileDataObject::vec2 |
( |
| ) |
const [inline] |
| LVecBase3d XFileDataObject::vec3 |
( |
| ) |
const [inline] |
| LVecBase4d XFileDataObject::vec4 |
( |
| ) |
const [inline] |
| void XFileDataObject::write_data |
( |
ostream & |
out, |
|
|
int |
indent_level, |
|
|
const char * |
separator |
|
) |
| const [virtual] |
The documentation for this class was generated from the following files:
| | |