17INLINE XFileDataObject::
109 set_int_value(int_value);
118set(
double double_value) {
119 set_double_value(double_value);
128set(
const std::string &string_value) {
129 set_string_value(string_value);
138set(
const LVecBase2d &vec) {
139 store_double_array(2, vec.get_data());
148set(
const LVecBase3d &vec) {
149 store_double_array(3, vec.get_data());
158set(
const LVecBase4d &vec) {
159 store_double_array(4, vec.get_data());
168set(
const LMatrix4d &mat) {
169 store_double_array(16, mat.get_data());
179 return get_int_value();
189 return get_double_value();
199 return get_string_value();
209 get_double_array(2, &vec[0]);
220 get_double_array(3, &vec[0]);
231 get_double_array(4, &vec[0]);
242 get_double_array(16, &mat(0, 0));
251 return get_num_elements();
261 nassertr(element !=
nullptr, *
this);
273 nassertr(element !=
nullptr, *
this);
284 nassertr(element !=
nullptr, *
this);
296 nassertr(element !=
nullptr, *
this);
A definition of a single data element appearing within a template record.
The abstract base class for a number of different types of data elements that may be stored in the X ...
const XFileDataDef * get_data_def() const
Returns the data object that this object is represented by, if any, or NULL if there is none.
void set(int int_value)
Stores the indicated integer 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.
LMatrix4d mat4() const
Returns the object's representation as an LMatrix4d.
LVecBase4d vec4() const
Returns the object's representation as an LVecBase4d.
double d() const
Unambiguously returns the object's representation as a double, or 0.0 if the object has no double rep...
int i() const
Unambiguously returns the object's representation as an integer, or 0 if the object has no integer re...
std::string s() const
Unambiguously returns the object's representation as a string, or empty string if the object has no s...
int size() const
Returns the number of nested data objects within this object.
virtual void output_data(std::ostream &out) const
Writes a suitable representation of this node to an .x file in text mode.
LVecBase3d vec3() const
Returns the object's representation as an LVecBase3d.
LVecBase2d vec2() const
Returns the object's representation as an LVecBase2d.
const XFileDataObject & operator[](int n) const
Returns the nth nested object within this object.