partBundleNode.h 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. // Filename: partBundleNode.h
  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. #ifndef PARTBUNDLENODE_H
  19. #define PARTBUNDLENODE_H
  20. #include <pandabase.h>
  21. #include "partBundle.h"
  22. #include <namedNode.h>
  23. ////////////////////////////////////////////////////////////////////
  24. // Class : PartBundleNode
  25. // Description : This is a node that contains a pointer to an
  26. // PartBundle. Like AnimBundleNode, it exists solely to
  27. // make it easy to store PartBundles in the scene graph.
  28. ////////////////////////////////////////////////////////////////////
  29. class EXPCL_PANDA PartBundleNode : public NamedNode {
  30. public:
  31. INLINE PartBundleNode(const string &name, PartBundle *bundle);
  32. protected:
  33. INLINE PartBundleNode();
  34. INLINE PartBundleNode(const PartBundleNode &copy);
  35. public:
  36. virtual bool safe_to_flatten() const;
  37. PUBLISHED:
  38. INLINE PartBundle *get_bundle() const;
  39. private:
  40. PT(PartBundle) _bundle;
  41. public:
  42. virtual void write_datagram(BamWriter* manager, Datagram &me);
  43. virtual int complete_pointers(TypedWritable **p_list,
  44. BamReader *manager);
  45. protected:
  46. void fillin(DatagramIterator& scan, BamReader* manager);
  47. public:
  48. virtual TypeHandle get_type() const {
  49. return get_class_type();
  50. }
  51. virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
  52. static TypeHandle get_class_type() {
  53. return _type_handle;
  54. }
  55. static void init_type() {
  56. NamedNode::init_type();
  57. register_type(_type_handle, "PartBundleNode",
  58. NamedNode::get_class_type());
  59. }
  60. private:
  61. static TypeHandle _type_handle;
  62. };
  63. #include "partBundleNode.I"
  64. #endif