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