nodeConnection.I 4.5 KB

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