Panda3D
partBundleNode.I
1 // Filename: partBundleNode.I
2 // Created by: drose (06Mar02)
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: PartBundleNode::Constructor
18 // Access: Public
19 // Description: The PartBundle and its node should be constructed
20 // together. Generally, the derived classes of
21 // PartBundleNode will automatically create a PartBundle
22 // of the appropriate type, and pass it up to this
23 // constructor.
24 ////////////////////////////////////////////////////////////////////
25 INLINE PartBundleNode::
26 PartBundleNode(const string &name, PartBundle *bundle) :
27  PandaNode(name)
28 {
29  add_bundle(bundle);
30 }
31 
32 ////////////////////////////////////////////////////////////////////
33 // Function: PartBundleNode::Default Constructor
34 // Access: Protected
35 // Description: For internal use only.
36 ////////////////////////////////////////////////////////////////////
37 INLINE PartBundleNode::
38 PartBundleNode() : PandaNode("") {
39 }
40 
41 ////////////////////////////////////////////////////////////////////
42 // Function: PartBundleNode::Copy Constructor
43 // Access: Protected
44 // Description: Use make_copy() or copy_subgraph() to copy one of
45 // these.
46 //
47 // This constructor does not copy the bundle pointers.
48 ////////////////////////////////////////////////////////////////////
49 INLINE PartBundleNode::
50 PartBundleNode(const PartBundleNode &copy) :
51  PandaNode(copy)
52 {
53 }
54 
55 ////////////////////////////////////////////////////////////////////
56 // Function: PartBundleNode::get_num_bundles
57 // Access: Public
58 // Description:
59 ////////////////////////////////////////////////////////////////////
60 INLINE int PartBundleNode::
61 get_num_bundles() const {
62  return _bundles.size();
63 }
64 
65 ////////////////////////////////////////////////////////////////////
66 // Function: PartBundleNode::get_bundle
67 // Access: Public
68 // Description:
69 ////////////////////////////////////////////////////////////////////
70 INLINE PartBundle *PartBundleNode::
71 get_bundle(int n) const {
72  nassertr(n >= 0 && n < (int)_bundles.size(), NULL);
73  return _bundles[n]->get_bundle();
74 }
75 
76 ////////////////////////////////////////////////////////////////////
77 // Function: PartBundleNode::get_bundle_handle
78 // Access: Public
79 // Description: Returns the PartBundleHandle that wraps around the
80 // actual nth PartBundle. While the PartBundle pointer
81 // might later change due to a future flatten operation,
82 // the PartBundleHandle will not.
83 ////////////////////////////////////////////////////////////////////
85 get_bundle_handle(int n) const {
86  nassertr(n >= 0 && n < (int)_bundles.size(), NULL);
87  return _bundles[n];
88 }
A basic node of the scene graph or data graph.
Definition: pandaNode.h:72
This is a trivial class returned by PartBundleNode::get_bundle().
This is a node that contains a pointer to an PartBundle.
PartBundleHandle * get_bundle_handle(int n) const
Returns the PartBundleHandle that wraps around the actual nth PartBundle.
This is the root of a MovingPart hierarchy.
Definition: partBundle.h:49