nodeConnection.I 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  1. // Filename: nodeConnection.I
  2. // Created by: drose (07May01)
  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: NodeConnection::Constructor
  20. // Access: Public
  21. // Description:
  22. ////////////////////////////////////////////////////////////////////
  23. INLINE_GRAPH NodeConnection::
  24. NodeConnection(TypeHandle graph_type) : _graph_type(graph_type) {
  25. }
  26. ////////////////////////////////////////////////////////////////////
  27. // Function: NodeConnection::Destructor
  28. // Access: Public
  29. // Description:
  30. ////////////////////////////////////////////////////////////////////
  31. INLINE_GRAPH NodeConnection::
  32. ~NodeConnection() {
  33. }
  34. ////////////////////////////////////////////////////////////////////
  35. // Function: NodeConnection::Copy Constructor
  36. // Access: Private
  37. // Description: The copy constructor is private. Copying
  38. // NodeConnections is not a good idea.
  39. ////////////////////////////////////////////////////////////////////
  40. INLINE_GRAPH NodeConnection::
  41. NodeConnection(const NodeConnection &copy) {
  42. }
  43. ////////////////////////////////////////////////////////////////////
  44. // Function: NodeConnection::Copy Assignment Operator
  45. // Access: Private
  46. // Description: The assignment constructor is private. Copying
  47. // NodeConnections is not a good idea.
  48. ////////////////////////////////////////////////////////////////////
  49. INLINE_GRAPH void NodeConnection::
  50. operator = (const NodeConnection &copy) {
  51. }
  52. ////////////////////////////////////////////////////////////////////
  53. // Function: NodeConnection::is_empty
  54. // Access: Public
  55. // Description: Returns true if the NodeConnection has no arcs, false
  56. // otherwise.
  57. ////////////////////////////////////////////////////////////////////
  58. INLINE_GRAPH bool NodeConnection::
  59. is_empty() const {
  60. return _up.empty() && _down.empty();
  61. }
  62. ////////////////////////////////////////////////////////////////////
  63. // Function: NodeConnection::get_graph_type
  64. // Access: Public
  65. // Description: Returns the type of graph represented by this
  66. // NodeConnection. A node can coexist simultaneously in
  67. // several different graphs of different types; each
  68. // type requires a NodeConnection object to be stored
  69. // with the node.
  70. ////////////////////////////////////////////////////////////////////
  71. INLINE_GRAPH TypeHandle NodeConnection::
  72. get_graph_type() const {
  73. return _graph_type;
  74. }
  75. ////////////////////////////////////////////////////////////////////
  76. // Function: NodeConnection::set_graph_type
  77. // Access: Public
  78. // Description: Changes the type of graph represented by this
  79. // NodeConnection. It is legal to do this only when the
  80. // NodeConnection is empty, i.e. is_empty() returns
  81. // true.
  82. ////////////////////////////////////////////////////////////////////
  83. INLINE_GRAPH void NodeConnection::
  84. set_graph_type(TypeHandle graph_type) {
  85. nassertv(is_empty());
  86. _graph_type = graph_type;
  87. }
  88. ////////////////////////////////////////////////////////////////////
  89. // Function: NodeConnection::get_up
  90. // Access: Public
  91. // Description: Returns the list of arcs pointing to the node's
  92. // parent(s).
  93. ////////////////////////////////////////////////////////////////////
  94. INLINE_GRAPH UpRelationPointers &NodeConnection::
  95. get_up() {
  96. return _up;
  97. }
  98. ////////////////////////////////////////////////////////////////////
  99. // Function: NodeConnection::get_up
  100. // Access: Public
  101. // Description: Returns the list of arcs pointing to the node's
  102. // parent(s).
  103. ////////////////////////////////////////////////////////////////////
  104. INLINE_GRAPH const UpRelationPointers &NodeConnection::
  105. get_up() const {
  106. return _up;
  107. }
  108. ////////////////////////////////////////////////////////////////////
  109. // Function: NodeConnection::get_down
  110. // Access: Public
  111. // Description: Returns the list of arcs pointing to the node's
  112. // child(ren).
  113. ////////////////////////////////////////////////////////////////////
  114. INLINE_GRAPH DownRelationPointers &NodeConnection::
  115. get_down() {
  116. return _down;
  117. }
  118. ////////////////////////////////////////////////////////////////////
  119. // Function: NodeConnection::get_down
  120. // Access: Public
  121. // Description: Returns the list of arcs pointing to the node's
  122. // child(ren).
  123. ////////////////////////////////////////////////////////////////////
  124. INLINE_GRAPH const DownRelationPointers &NodeConnection::
  125. get_down() const {
  126. return _down;
  127. }