multiNodeTransition.h 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. // Filename: multiNodeTransition.h
  2. // Created by: drose (23Mar00)
  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 MULTINODETRANSITION_H
  19. #define MULTINODETRANSITION_H
  20. #include <pandabase.h>
  21. #include "multiTransition.h"
  22. #include "pointerNameClass.h"
  23. #include "node.h"
  24. #include "pt_Node.h"
  25. #include <pointerTo.h>
  26. class NodeAttribute;
  27. class NodeRelation;
  28. // We need to define this temporary macro so we can pass a parameter
  29. // containing a comma through the macro.
  30. #define MULTITRANSITION_NODE MultiTransition<PT_Node, PointerNameClass>
  31. EXPORT_TEMPLATE_CLASS(EXPCL_PANDA, EXPTP_PANDA, MULTITRANSITION_NODE);
  32. ////////////////////////////////////////////////////////////////////
  33. // Class : MultiNodeTransition
  34. // Description : This is a particular instantiation of MultiTransition
  35. // on PT_Node. It is its own class in an attempt to
  36. // cut down on code bloat; if a particular transition
  37. // wants to be a MultiTransition on some kind of
  38. // Node, it should inherit from MultiNodeTransition
  39. // (rather than instantiating a whole new kind of
  40. // MultiTransition).
  41. ////////////////////////////////////////////////////////////////////
  42. class EXPCL_PANDA MultiNodeTransition :
  43. public MultiTransition<PT_Node, PointerNameClass> {
  44. protected:
  45. INLINE_GRAPH MultiNodeTransition() {};
  46. INLINE_GRAPH MultiNodeTransition(const MultiNodeTransition &copy) :
  47. MultiTransition<PT_Node, PointerNameClass>(copy) {};
  48. INLINE_GRAPH void operator = (const MultiNodeTransition &copy)
  49. {MultiTransition<PT_Node, PointerNameClass>::operator = (copy);};
  50. public:
  51. virtual TypeHandle get_type() const {
  52. return get_class_type();
  53. }
  54. virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
  55. static TypeHandle get_class_type() {
  56. return _type_handle;
  57. }
  58. static void init_type() {
  59. MultiTransition<PT_Node, PointerNameClass>::init_type();
  60. register_type(_type_handle, "MultiNodeTransition",
  61. MultiTransition<PT_Node, PointerNameClass>::
  62. get_class_type());
  63. }
  64. private:
  65. static TypeHandle _type_handle;
  66. };
  67. #endif