nodePathComponent.I 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. // Filename: nodePathComponent.I
  2. // Created by: drose (25Feb02)
  3. //
  4. ////////////////////////////////////////////////////////////////////
  5. //
  6. // PANDA 3D SOFTWARE
  7. // Copyright (c) Carnegie Mellon University. All rights reserved.
  8. //
  9. // All use of this software is subject to the terms of the revised BSD
  10. // license. You should have received a copy of this license along
  11. // with this source code in a file named "LICENSE."
  12. //
  13. ////////////////////////////////////////////////////////////////////
  14. ////////////////////////////////////////////////////////////////////
  15. // Function: NodePathComponent::CData::Constructor
  16. // Access: Public
  17. // Description:
  18. ////////////////////////////////////////////////////////////////////
  19. INLINE NodePathComponent::CData::
  20. CData() {
  21. _length = 1;
  22. }
  23. ////////////////////////////////////////////////////////////////////
  24. // Function: NodePathComponent::CData::Copy Constructor
  25. // Access: Public
  26. // Description:
  27. ////////////////////////////////////////////////////////////////////
  28. INLINE NodePathComponent::CData::
  29. CData(const NodePathComponent::CData &copy) :
  30. _next(copy._next),
  31. _length(copy._length)
  32. {
  33. }
  34. ////////////////////////////////////////////////////////////////////
  35. // Function: NodePathComponent::Copy Constructor
  36. // Access: Private
  37. // Description: NodePathComponents should not be copied.
  38. ////////////////////////////////////////////////////////////////////
  39. INLINE NodePathComponent::
  40. NodePathComponent(const NodePathComponent &copy) {
  41. nassertv(false);
  42. }
  43. ////////////////////////////////////////////////////////////////////
  44. // Function: NodePathComponent::Copy Assignment Operator
  45. // Access: Private
  46. // Description: NodePathComponents should not be copied.
  47. ////////////////////////////////////////////////////////////////////
  48. INLINE void NodePathComponent::
  49. operator = (const NodePathComponent &copy) {
  50. nassertv(false);
  51. }
  52. ////////////////////////////////////////////////////////////////////
  53. // Function: NodePathComponent::Destructor
  54. // Access: Public
  55. // Description:
  56. ////////////////////////////////////////////////////////////////////
  57. INLINE NodePathComponent::
  58. ~NodePathComponent() {
  59. nassertv(_node != (PandaNode *)NULL);
  60. _node->delete_component(this);
  61. }
  62. ////////////////////////////////////////////////////////////////////
  63. // Function: NodePathComponent::get_node
  64. // Access: Public
  65. // Description: Returns the node referenced by this component.
  66. ////////////////////////////////////////////////////////////////////
  67. INLINE PandaNode *NodePathComponent::
  68. get_node() const {
  69. nassertr(_node != (PandaNode *)NULL, _node);
  70. return _node;
  71. }
  72. ////////////////////////////////////////////////////////////////////
  73. // Function: NodePathComponent::has_key
  74. // Access: Public
  75. // Description: Returns true if the key for this component has
  76. // already been generated, false otherwise. Even if
  77. // this returns false, calling get_key() will still
  78. // return a valid key; that will simply cause the key to
  79. // be generated on-the-fly.
  80. ////////////////////////////////////////////////////////////////////
  81. INLINE bool NodePathComponent::
  82. has_key() const {
  83. return (_key != 0);
  84. }
  85. INLINE ostream &operator << (ostream &out, const NodePathComponent &comp) {
  86. comp.output(out);
  87. return out;
  88. }