nodeAttributes.I 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. // Filename: nodeAttributes.I
  2. // Created by: drose (21Mar00)
  3. //
  4. ////////////////////////////////////////////////////////////////////
  5. ////////////////////////////////////////////////////////////////////
  6. // Function: NodeAttributes::size
  7. // Access: Public
  8. // Description:
  9. ////////////////////////////////////////////////////////////////////
  10. INLINE_GRAPH NodeAttributes::size_type NodeAttributes::
  11. size() const {
  12. return _attributes.size();
  13. }
  14. ////////////////////////////////////////////////////////////////////
  15. // Function: NodeAttributes::begin
  16. // Access: Public
  17. // Description:
  18. ////////////////////////////////////////////////////////////////////
  19. INLINE_GRAPH NodeAttributes::iterator NodeAttributes::
  20. begin() {
  21. return _attributes.begin();
  22. }
  23. ////////////////////////////////////////////////////////////////////
  24. // Function: NodeAttributes::end
  25. // Access: Public
  26. // Description:
  27. ////////////////////////////////////////////////////////////////////
  28. INLINE_GRAPH NodeAttributes::iterator NodeAttributes::
  29. end() {
  30. return _attributes.end();
  31. }
  32. ////////////////////////////////////////////////////////////////////
  33. // Function: NodeAttributes::begin
  34. // Access: Public
  35. // Description:
  36. ////////////////////////////////////////////////////////////////////
  37. INLINE_GRAPH NodeAttributes::const_iterator NodeAttributes::
  38. begin() const {
  39. return _attributes.begin();
  40. }
  41. ////////////////////////////////////////////////////////////////////
  42. // Function: NodeAttributes::end
  43. // Access: Public
  44. // Description:
  45. ////////////////////////////////////////////////////////////////////
  46. INLINE_GRAPH NodeAttributes::const_iterator NodeAttributes::
  47. end() const {
  48. return _attributes.end();
  49. }
  50. ////////////////////////////////////////////////////////////////////
  51. // Function: NodeAttributes::insert
  52. // Access: Public
  53. // Description:
  54. ////////////////////////////////////////////////////////////////////
  55. INLINE_GRAPH NodeAttributes::iterator NodeAttributes::
  56. insert(NodeAttributes::iterator position,
  57. const NodeAttributes::value_type &x) {
  58. return _attributes.insert(position, x);
  59. }
  60. ////////////////////////////////////////////////////////////////////
  61. // Function: NodeAttributes::erase
  62. // Access: Public
  63. // Description:
  64. ////////////////////////////////////////////////////////////////////
  65. INLINE_GRAPH void NodeAttributes::
  66. erase(NodeAttributes::iterator position) {
  67. _attributes.erase(position);
  68. }
  69. ////////////////////////////////////////////////////////////////////
  70. // Function: NodeAttributes::apply_in_place
  71. // Access: Public
  72. // Description: Modifies the current NodeAttributes object to reflect
  73. // the application of the indicated transitions.
  74. ////////////////////////////////////////////////////////////////////
  75. INLINE_GRAPH void NodeAttributes::
  76. apply_in_place(const NodeTransitionCache &trans) {
  77. apply_from(*this, trans);
  78. }
  79. ////////////////////////////////////////////////////////////////////
  80. // Function: NodeAttributes::apply
  81. // Access: Public
  82. // Description: Allocates and returns a new NodeAttributes object
  83. // that represents the application of this
  84. // NodeAttributes to the indicated transition cache.
  85. // This NodeAttributes object is not changed.
  86. ////////////////////////////////////////////////////////////////////
  87. INLINE_GRAPH NodeAttributes *NodeAttributes::
  88. apply(const NodeTransitionCache &trans) const {
  89. NodeAttributes *na = new NodeAttributes;
  90. na->apply_from(*this, trans);
  91. return na;
  92. }
  93. INLINE_GRAPH ostream &operator << (ostream &out, const NodeAttributes &nas) {
  94. nas.output(out);
  95. return out;
  96. }