Panda3D
xFileNode.I
Go to the documentation of this file.
1 /**
2  * PANDA 3D SOFTWARE
3  * Copyright (c) Carnegie Mellon University. All rights reserved.
4  *
5  * All use of this software is subject to the terms of the revised BSD
6  * license. You should have received a copy of this license along
7  * with this source code in a file named "LICENSE."
8  *
9  * @file xFileNode.I
10  * @author drose
11  * @date 2004-10-03
12  */
13 
14 /**
15  *
16  */
17 INLINE XFile *XFileNode::
18 get_x_file() const {
19  return _x_file;
20 }
21 
22 /**
23  * Returns the list of children of this node. This list includes templates as
24  * well as data objects.
25  */
26 INLINE int XFileNode::
28  return _children.size();
29 }
30 
31 /**
32  * Returns the nth child of this node. This list includes templates as well
33  * as data objects.
34  */
35 INLINE XFileNode *XFileNode::
36 get_child(int n) const {
37  nassertr(n >= 0 && n < (int)_children.size(), nullptr);
38  return _children[n];
39 }
40 
41 /**
42  * Returns the list of child objects of this node. This list does not include
43  * template definitions; it is strictly the list of children that are also
44  * data objects (instances of templates).
45  */
46 INLINE int XFileNode::
47 get_num_objects() const {
48  return _objects.size();
49 }
50 
51 /**
52  * Returns the nth child object of this node. This list does not include
53  * template definitions; it is strictly the list of children that are also
54  * data objects (instances of templates).
55  */
57 get_object(int n) const {
58  nassertr(n >= 0 && n < (int)_objects.size(), nullptr);
59  return _objects[n];
60 }
int get_num_children() const
Returns the list of children of this node.
Definition: xFileNode.I:27
int get_num_objects() const
Returns the list of child objects of this node.
Definition: xFileNode.I:47
A single node of an X file.
Definition: xFileNode.h:39
This is an abstract base class for an XFileNode which is also an XFileDataObject.
Definition: xFileDataNode.h:33
This represents the complete contents of an X file (file.x) in memory.
Definition: xFile.h:32
XFileDataNode * get_object(int n) const
Returns the nth child object of this node.
Definition: xFileNode.I:57
XFileNode * get_child(int n) const
Returns the nth child of this node.
Definition: xFileNode.I:36