odeContactCollection.I 3.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. // Filename: odeContactCollection.I
  2. // Created by: pro-rsoft (17Dec08)
  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: OdeContactCollection::Destructor
  16. // Access: Published
  17. // Description:
  18. ////////////////////////////////////////////////////////////////////
  19. INLINE OdeContactCollection::
  20. ~OdeContactCollection() {
  21. }
  22. ////////////////////////////////////////////////////////////////////
  23. // Function: OdeContactCollection::operator +=
  24. // Access: Published
  25. // Description: Appends the other list onto the end of this one.
  26. ////////////////////////////////////////////////////////////////////
  27. INLINE void OdeContactCollection::
  28. operator += (const OdeContactCollection &other) {
  29. add_contacts_from(other);
  30. }
  31. ////////////////////////////////////////////////////////////////////
  32. // Function: OdeContactCollection::operator +
  33. // Access: Published
  34. // Description: Returns a OdeContactCollection representing the
  35. // concatenation of the two lists.
  36. ////////////////////////////////////////////////////////////////////
  37. INLINE OdeContactCollection OdeContactCollection::
  38. operator + (const OdeContactCollection &other) const {
  39. OdeContactCollection a(*this);
  40. a += other;
  41. return a;
  42. }
  43. ////////////////////////////////////////////////////////////////////
  44. // Function: OdeContactCollection::clear
  45. // Access: Published
  46. // Description: Clears the contact collection.
  47. ////////////////////////////////////////////////////////////////////
  48. INLINE void OdeContactCollection::
  49. clear() {
  50. _contacts.clear();
  51. }
  52. ////////////////////////////////////////////////////////////////////
  53. // Function: OdeContactCollection::is_empty
  54. // Access: Published
  55. // Description: Returns true if the collection is empty.
  56. ////////////////////////////////////////////////////////////////////
  57. INLINE bool OdeContactCollection::
  58. is_empty() const {
  59. return _contacts.empty();
  60. }
  61. ////////////////////////////////////////////////////////////////////
  62. // Function: OdeContactCollection::get_num_contacts
  63. // Access: Published
  64. // Description: Returns the number of Contacts in the collection.
  65. // This is the same thing as size().
  66. ////////////////////////////////////////////////////////////////////
  67. INLINE int OdeContactCollection::
  68. get_num_contacts() const {
  69. return _contacts.size();
  70. }
  71. ////////////////////////////////////////////////////////////////////
  72. // Function: OdeContactCollection::size
  73. // Access: Published
  74. // Description: Returns the number of Contacts in the collection.
  75. // This is the same thing as get_num_contacts().
  76. ////////////////////////////////////////////////////////////////////
  77. INLINE int OdeContactCollection::
  78. size() const {
  79. return _contacts.size();
  80. }