45 INLINE
XFile *get_x_file()
const;
68 virtual void write_text(std::ostream &out,
int indent_level)
const;
75 size_t &index,
size_t &sub_index)
const;
90 double power,
const LRGBColor &specular_color,
91 const LRGBColor &emissive_color);
116 static void init_type() {
118 ReferenceCount::init_type();
120 TypedObject::get_class_type(),
121 ReferenceCount::get_class_type());
124 return get_class_type();
126 virtual TypeHandle force_init_type() {init_type();
return get_class_type();}
XFileDataNode * add_MeshTextureCoords(const std::string &name)
Creates a new MeshTextureCoords instance, as a child of this node.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
static void init_type()
This function is declared non-inline to work around a compiler bug in g++ 2.96.
This is our own Panda specialization on the default STL map.
XFileDataNode * add_MeshNormals(const std::string &name)
Creates a new MeshNormals instance, as a child of this node.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
XFileDataNode * add_Frame(const std::string &name)
Creates a new Frame instance, as a child of this node.
virtual bool matches(const XFileNode *other) const
Returns true if the node, particularly a template node, is structurally equivalent to the other node ...
int get_num_children() const
Returns the list of children of this node.
void register_type(TypeHandle &type_handle, const std::string &name)
This inline function is just a convenient way to call TypeRegistry::register_type(),...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
XFileDataNode * add_Material(const std::string &name, const LColor &face_color, double power, const LRGBColor &specular_color, const LRGBColor &emissive_color)
Creates a new Material instance, as a child of this node.
virtual void write_text(std::ostream &out, int indent_level) const
Writes a suitable representation of this node to an .x file in text mode.
This is an implementation of the Windows GUID object, used everywhere as a world-unique identifier fo...
virtual bool is_object() const
Returns true if this node represents a data object that is the instance of some template,...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
void add_child(XFileNode *node)
Adds the indicated node as a child of this node.
This is an abstract class that all classes which use TypeHandle, and also provide virtual functions t...
This is a nested reference to an instance of a template object, declared via the syntax:
XFileDataNode * add_TextureFilename(const std::string &name, const Filename &filename)
Creates a new TextureFilename instance, as a child of this node.
XFileDataNode * add_Mesh(const std::string &name)
Creates a new Mesh instance, as a child of this node.
virtual bool is_template_def() const
Returns true if this node represents the definition of some template.
A definition of a single data element appearing within a template record.
virtual bool has_guid() const
Returns true if this node has a GUID associated.
int find_child_index(const std::string &name) const
Returns the index number of the child with the indicated name, if any, or -1 if none.
This is a node which contains all of the data elements defined by a template.
This is our own Panda specialization on the default STL vector.
int get_num_objects() const
Returns the list of child objects of this node.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
A single node of an X file.
A base class for all things which can have a name.
virtual const WindowsGuid & get_guid() const
If has_guid() returned true, returns the particular GUID associated with this node.
The name of a file, such as a texture file or an Egg file.
virtual bool is_standard_object(const std::string &template_name) const
Returns true if this node represents an instance of the standard template with the indicated name,...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
static std::string make_nice_name(const std::string &str)
Transforms the indicated egg name to a name that is acceptable for a node in the X File format.
virtual bool is_reference() const
Returns true if this node represents an indirect reference to an object defined previously in the fil...
XFileDataNode * add_FrameTransformMatrix(const LMatrix4d &mat)
Creates a new FrameTransformMatrix instance, as a child of this node.
A container for a pvector of the above objects.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
virtual bool repack_data(XFileDataObject *object, const XFileParseDataList &parse_data_list, PrevData &prev_data, size_t &index, size_t &sub_index) const
This is called on the template that defines an object, once the data for the object has been parsed.
A base class for all things that want to be reference-counted.
XFileNode * find_descendent(const std::string &name) const
Returns the first child or descendent found with the indicated name after a depth-first search,...
XFileDataNode * add_MeshVertexColors(const std::string &name)
Creates a new MeshVertexColors instance, as a child of this node.
XFileNode * find_child(const std::string &name) const
Returns the child with the indicated name, if any, or NULL if none.
virtual void clear()
Removes all children from the node, and otherwise resets it to its initial state.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
This is an abstract base class for an XFileNode which is also an XFileDataObject.
virtual bool fill_zero_data(XFileDataObject *object) const
This is similar to repack_data(), except it is used to fill the initial values for a newly-created te...
This represents the complete contents of an X file (file.x) in memory.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
XFileDataNode * get_object(int n) const
Returns the nth child object of this node.
XFileDataNode * add_MeshMaterialList(const std::string &name)
Creates a new MeshMaterialList instance, as a child of this node.
TypeHandle is the identifier used to differentiate C++ class types.
The abstract base class for a number of different types of data elements that may be stored in the X ...
XFileNode * get_child(int n) const
Returns the nth child of this node.