00001 // Filename: partBundleNode.I 00002 // Created by: drose (06Mar02) 00003 // 00004 //////////////////////////////////////////////////////////////////// 00005 // 00006 // PANDA 3D SOFTWARE 00007 // Copyright (c) 2001, Disney Enterprises, Inc. All rights reserved 00008 // 00009 // All use of this software is subject to the terms of the Panda 3d 00010 // Software license. You should have received a copy of this license 00011 // along with this source code; you will also find a current copy of 00012 // the license at http://www.panda3d.org/license.txt . 00013 // 00014 // To contact the maintainers of this program write to 00015 // panda3d@yahoogroups.com . 00016 // 00017 //////////////////////////////////////////////////////////////////// 00018 00019 00020 //////////////////////////////////////////////////////////////////// 00021 // Function: PartBundleNode::Constructor 00022 // Access: Public 00023 // Description: The PartBundle and its node should be constructed 00024 // together. Generally, the derived classes of 00025 // PartBundleNode will automatically create a PartBundle 00026 // of the appropriate type, and pass it up to this 00027 // constructor. 00028 //////////////////////////////////////////////////////////////////// 00029 INLINE PartBundleNode:: 00030 PartBundleNode(const string &name, PartBundle *bundle) : 00031 PandaNode(name), 00032 _bundle(bundle) 00033 { 00034 _bundle->_node = this; 00035 } 00036 00037 //////////////////////////////////////////////////////////////////// 00038 // Function: PartBundleNode::Default Constructor 00039 // Access: Protected 00040 // Description: For internal use only. 00041 //////////////////////////////////////////////////////////////////// 00042 INLINE PartBundleNode:: 00043 PartBundleNode() : PandaNode("") { 00044 } 00045 00046 //////////////////////////////////////////////////////////////////// 00047 // Function: PartBundleNode::Copy Constructor 00048 // Access: Protected 00049 // Description: Use make_copy() or copy_subgraph() to copy one of 00050 // these. 00051 // 00052 // If the supplied PartBundle is non-null, it is 00053 // assigned to the new node; otherwise, a copy is made 00054 // of the complete PartGroup hierarchy. 00055 //////////////////////////////////////////////////////////////////// 00056 INLINE PartBundleNode:: 00057 PartBundleNode(const PartBundleNode ©, PartBundle *bundle) : 00058 PandaNode(copy) 00059 { 00060 if (bundle != (PartBundle *)NULL) { 00061 _bundle = bundle; 00062 } else { 00063 _bundle = DCAST(PartBundle, copy._bundle->copy_subgraph()); 00064 } 00065 _bundle->_node = this; 00066 } 00067 00068 //////////////////////////////////////////////////////////////////// 00069 // Function: PartBundleNode::get_bundle 00070 // Access: Public 00071 // Description: 00072 //////////////////////////////////////////////////////////////////// 00073 INLINE PartBundle *PartBundleNode:: 00074 get_bundle() const { 00075 return _bundle; 00076 }