partBundleNode.I 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. // Filename: partBundleNode.I
  2. // Created by: drose (23Feb99)
  3. //
  4. ////////////////////////////////////////////////////////////////////
  5. //
  6. // PANDA 3D SOFTWARE
  7. // Copyright (c) 2001, Disney Enterprises, Inc. All rights reserved
  8. //
  9. // All use of this software is subject to the terms of the Panda 3d
  10. // Software license. You should have received a copy of this license
  11. // along with this source code; you will also find a current copy of
  12. // the license at http://www.panda3d.org/license.txt .
  13. //
  14. // To contact the maintainers of this program write to
  15. // [email protected] .
  16. //
  17. ////////////////////////////////////////////////////////////////////
  18. ////////////////////////////////////////////////////////////////////
  19. // Function: PartBundleNode::Constructor
  20. // Access: Public
  21. // Description: The PartBundle and its node should be constructed
  22. // together. Generally, the derived classes of
  23. // PartBundleNode will automatically create a PartBundle
  24. // of the appropriate type, and pass it up to this
  25. // constructor.
  26. ////////////////////////////////////////////////////////////////////
  27. INLINE PartBundleNode::
  28. PartBundleNode(const string &name, PartBundle *bundle) :
  29. NamedNode(name),
  30. _bundle(bundle)
  31. {
  32. _bundle->_node = this;
  33. }
  34. ////////////////////////////////////////////////////////////////////
  35. // Function: PartBundleNode::Default Constructor
  36. // Access: Protected
  37. // Description: For internal use only.
  38. ////////////////////////////////////////////////////////////////////
  39. INLINE PartBundleNode::
  40. PartBundleNode(void)
  41. {
  42. }
  43. ////////////////////////////////////////////////////////////////////
  44. // Function: PartBundleNode::Copy Constructor
  45. // Access: Protected
  46. // Description: Use make_copy() or copy_subgraph() to copy one of
  47. // these. Copying a PartBundleNode will always force a
  48. // deep copy of the PartGroup hierarchy.
  49. ////////////////////////////////////////////////////////////////////
  50. INLINE PartBundleNode::
  51. PartBundleNode(const PartBundleNode &copy) :
  52. NamedNode(copy),
  53. _bundle(DCAST(PartBundle, copy._bundle->copy_subgraph()))
  54. {
  55. _bundle->_node = this;
  56. }
  57. ////////////////////////////////////////////////////////////////////
  58. // Function: PartBundleNode::get_bundle
  59. // Access: Public
  60. // Description:
  61. ////////////////////////////////////////////////////////////////////
  62. INLINE PartBundle *PartBundleNode::
  63. get_bundle() const {
  64. return _bundle;
  65. }