Panda3D
Public Member Functions | Static Public Member Functions | Protected Member Functions

XFileDataNode Class Reference

This is an abstract base class for an XFileNode which is also an XFileDataObject. More...

#include "xFileDataNode.h"

Inheritance diagram for XFileDataNode:
XFileNode XFileDataObject TypedObject Namable ReferenceCount ReferenceCount MemoryBase MemoryBase MemoryBase MemoryBase XFileDataNodeReference XFileDataNodeTemplate

List of all members.

Public Member Functions

 XFileDataNode (XFile *x_file, const string &name, XFileTemplate *xtemplate)
virtual TypeHandle force_init_type ()
const XFileDataNodeget_data_child (int n) const
 Since the children of an XFileDataNode are syntactically constrained to themselves be XFileDataNodes, this is a convenience function that returns the same thing as XFileNode::get_child(), but it is cast to a type XFileDataNode and dereferenced.
XFileTemplateget_template () const
 Returns the template used to define this data object.
const string & get_template_name () const
 A convenience function to return the name of the template used to define this data object.
virtual TypeHandle get_type () const
virtual string get_type_name () const
 Returns a string that represents the type of object this data object represents.
virtual bool is_object () const
 Returns true if this node represents a data object that is the instance of some template, or false otherwise.
virtual bool is_standard_object (const string &template_name) const
 Returns true if this node represents an instance of the standard template with the indicated name, or false otherwise.

Static Public Member Functions

static TypeHandle get_class_type ()
static void init_type ()

Protected Member Functions

 PT (XFileTemplate) _template

Detailed Description

This is an abstract base class for an XFileNode which is also an XFileDataObject.

That is to say, objects that inherit from this class may be added to the toplevel X file graph as nodes, and they also may be containers for data elements.

Specifically, this is the base class of both XFileDataNodeTemplate and XFileDataNodeReference.

Definition at line 36 of file xFileDataNode.h.


Member Function Documentation

const XFileDataNode & XFileDataNode::get_data_child ( int  n) const [inline]

Since the children of an XFileDataNode are syntactically constrained to themselves be XFileDataNodes, this is a convenience function that returns the same thing as XFileNode::get_child(), but it is cast to a type XFileDataNode and dereferenced.

Definition at line 26 of file xFileDataNode.I.

References XFileNode::get_child().

XFileTemplate * XFileDataNode::get_template ( ) const [inline]

Returns the template used to define this data object.

Since the only classes to inherit from XFileDataNode are XFileDataNodeTemplate and XFileDataNodeReference, both of which represent a class that is defined by a template, it makes sense to put this common method here in the base class.

Reimplemented in XFileDataNodeReference.

Definition at line 42 of file xFileDataNode.I.

const string & XFileDataNode::get_template_name ( ) const [inline]

A convenience function to return the name of the template used to define this data object.

Definition at line 53 of file xFileDataNode.I.

Referenced by XFileMaterial::fill_material(), XFileMesh::fill_material_list(), and XFileMesh::fill_mesh_child().

string XFileDataNode::get_type_name ( ) const [virtual]

Returns a string that represents the type of object this data object represents.

Reimplemented from XFileDataObject.

Definition at line 76 of file xFileDataNode.cxx.

bool XFileDataNode::is_object ( ) const [virtual]

Returns true if this node represents a data object that is the instance of some template, or false otherwise.

This also returns true for references to objects (which are generally treated just like the objects themselves).

If this returns true, the node must be of type XFileDataNode (it is either an XFileDataNodeTemplate or an XFileDataNodeReference).

Reimplemented from XFileNode.

Definition at line 47 of file xFileDataNode.cxx.

bool XFileDataNode::is_standard_object ( const string &  template_name) const [virtual]

Returns true if this node represents an instance of the standard template with the indicated name, or false otherwise.

If this returns true, the object must be of type XFileDataNode.

Reimplemented from XFileNode.

Definition at line 60 of file xFileDataNode.cxx.

Referenced by XFileMaterial::fill_material(), XFileMesh::fill_material_list(), and XFileMesh::fill_mesh_child().


The documentation for this class was generated from the following files:
 All Classes Functions Variables Enumerations