animBundleNode.h 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. // Filename: animBundleNode.h
  2. // Created by: drose (22Feb99)
  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 ANIMBUNDLENODE_H
  19. #define ANIMBUNDLENODE_H
  20. #include <pandabase.h>
  21. #include "animBundle.h"
  22. #include <namedNode.h>
  23. ////////////////////////////////////////////////////////////////////
  24. // Class : AnimBundleNode
  25. // Description : This is a node that contains a pointer to an
  26. // AnimBundle. Its primary raison d'être is to allow
  27. // the AnimBundles to be stored in the scene graph, so
  28. // they may conveniently be loaded as egg files, for
  29. // instance.
  30. ////////////////////////////////////////////////////////////////////
  31. class EXPCL_PANDA AnimBundleNode : public NamedNode {
  32. PUBLISHED:
  33. INLINE AnimBundleNode(AnimBundle *bundle);
  34. INLINE AnimBundleNode(const AnimBundleNode &copy);
  35. INLINE void operator = (const AnimBundleNode &copy);
  36. virtual Node *make_copy() const;
  37. INLINE AnimBundle *get_bundle() const;
  38. private:
  39. PT(AnimBundle) _bundle;
  40. public:
  41. static void register_with_read_factory(void);
  42. virtual void write_datagram(BamWriter* manager, Datagram &me);
  43. virtual int complete_pointers(TypedWritable **p_list,
  44. BamReader *manager);
  45. static TypedWritable *make_AnimBundleNode(const FactoryParams &params);
  46. protected:
  47. INLINE AnimBundleNode(void);
  48. void fillin(DatagramIterator& scan, BamReader* manager);
  49. public:
  50. virtual TypeHandle get_type() const {
  51. return get_class_type();
  52. }
  53. virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
  54. static TypeHandle get_class_type() {
  55. return _type_handle;
  56. }
  57. static void init_type() {
  58. NamedNode::init_type();
  59. register_type(_type_handle, "AnimBundleNode",
  60. NamedNode::get_class_type());
  61. }
  62. private:
  63. static TypeHandle _type_handle;
  64. };
  65. #include "animBundleNode.I"
  66. #endif