Panda3D
|
00001 // Filename: partBundleNode.I 00002 // Created by: drose (06Mar02) 00003 // 00004 //////////////////////////////////////////////////////////////////// 00005 // 00006 // PANDA 3D SOFTWARE 00007 // Copyright (c) Carnegie Mellon University. All rights reserved. 00008 // 00009 // All use of this software is subject to the terms of the revised BSD 00010 // license. You should have received a copy of this license along 00011 // with this source code in a file named "LICENSE." 00012 // 00013 //////////////////////////////////////////////////////////////////// 00014 00015 00016 //////////////////////////////////////////////////////////////////// 00017 // Function: PartBundleNode::Constructor 00018 // Access: Public 00019 // Description: The PartBundle and its node should be constructed 00020 // together. Generally, the derived classes of 00021 // PartBundleNode will automatically create a PartBundle 00022 // of the appropriate type, and pass it up to this 00023 // constructor. 00024 //////////////////////////////////////////////////////////////////// 00025 INLINE PartBundleNode:: 00026 PartBundleNode(const string &name, PartBundle *bundle) : 00027 PandaNode(name) 00028 { 00029 add_bundle(bundle); 00030 } 00031 00032 //////////////////////////////////////////////////////////////////// 00033 // Function: PartBundleNode::Default Constructor 00034 // Access: Protected 00035 // Description: For internal use only. 00036 //////////////////////////////////////////////////////////////////// 00037 INLINE PartBundleNode:: 00038 PartBundleNode() : PandaNode("") { 00039 } 00040 00041 //////////////////////////////////////////////////////////////////// 00042 // Function: PartBundleNode::Copy Constructor 00043 // Access: Protected 00044 // Description: Use make_copy() or copy_subgraph() to copy one of 00045 // these. 00046 // 00047 // This constructor does not copy the bundle pointers. 00048 //////////////////////////////////////////////////////////////////// 00049 INLINE PartBundleNode:: 00050 PartBundleNode(const PartBundleNode ©) : 00051 PandaNode(copy) 00052 { 00053 } 00054 00055 //////////////////////////////////////////////////////////////////// 00056 // Function: PartBundleNode::get_num_bundles 00057 // Access: Public 00058 // Description: 00059 //////////////////////////////////////////////////////////////////// 00060 INLINE int PartBundleNode:: 00061 get_num_bundles() const { 00062 return _bundles.size(); 00063 } 00064 00065 //////////////////////////////////////////////////////////////////// 00066 // Function: PartBundleNode::get_bundle 00067 // Access: Public 00068 // Description: 00069 //////////////////////////////////////////////////////////////////// 00070 INLINE PartBundle *PartBundleNode:: 00071 get_bundle(int n) const { 00072 nassertr(n >= 0 && n < (int)_bundles.size(), NULL); 00073 return _bundles[n]->get_bundle(); 00074 } 00075 00076 //////////////////////////////////////////////////////////////////// 00077 // Function: PartBundleNode::get_bundle_handle 00078 // Access: Public 00079 // Description: Returns the PartBundleHandle that wraps around the 00080 // actual nth PartBundle. While the PartBundle pointer 00081 // might later change due to a future flatten operation, 00082 // the PartBundleHandle will not. 00083 //////////////////////////////////////////////////////////////////// 00084 INLINE PartBundleHandle *PartBundleNode:: 00085 get_bundle_handle(int n) const { 00086 nassertr(n >= 0 && n < (int)_bundles.size(), NULL); 00087 return _bundles[n]; 00088 }