36 _nested_elements.push_back(element);
44 write_data(std::ostream &out,
int indent_level,
const char *separator)
const {
45 if (!_nested_elements.empty()) {
46 bool indented =
false;
47 for (
size_t i = 0;
i < _nested_elements.size() - 1;
i++) {
50 _nested_elements.size() > 16) {
57 object->write_data(out, indent_level,
",");
65 out << *
object <<
", ";
76 object->write_data(out, indent_level, separator);
82 out << *
object << separator <<
"\n";
91 int XFileDataObjectArray::
92 get_num_elements()
const {
93 return _nested_elements.size();
101 nassertr(n >= 0 && n < (
int)_nested_elements.size(),
nullptr);
102 return _nested_elements[n];
int i() const
Unambiguously returns the object's representation as an integer, or 0 if the object has no integer re...
virtual bool add_element(XFileDataObject *element)
Adds the indicated element as a nested data element, if this data object type supports it.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
virtual void write_data(std::ostream &out, int indent_level, const char *separator) const
Writes a suitable representation of this node to an .x file in text mode.
std::ostream & indent(std::ostream &out, int indent_level)
A handy function for doing text formatting.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
virtual bool is_complex_object() const
Returns true if this kind of data object is a complex object that can hold nested data elements,...
virtual bool is_complex_object() const
Returns true if this kind of data object is a complex object that can hold nested data elements,...
TypeHandle is the identifier used to differentiate C++ class types.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
The abstract base class for a number of different types of data elements that may be stored in the X ...