domBox.h 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  1. /*
  2. * Copyright 2006 Sony Computer Entertainment Inc.
  3. *
  4. * Licensed under the SCEA Shared Source License, Version 1.0 (the "License"); you may not use this
  5. * file except in compliance with the License. You may obtain a copy of the License at:
  6. * http://research.scea.com/scea_shared_source_license.html
  7. *
  8. * Unless required by applicable law or agreed to in writing, software distributed under the License
  9. * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
  10. * implied. See the License for the specific language governing permissions and limitations under the
  11. * License.
  12. */
  13. #ifndef __domBox_h__
  14. #define __domBox_h__
  15. #include <dae/daeDocument.h>
  16. #include <dom/domTypes.h>
  17. #include <dom/domElements.h>
  18. #include <dom/domExtra.h>
  19. class DAE;
  20. /**
  21. * An axis-aligned, centered box primitive.
  22. */
  23. class domBox : public daeElement
  24. {
  25. public:
  26. virtual COLLADA_TYPE::TypeEnum getElementType() const { return COLLADA_TYPE::BOX; }
  27. static daeInt ID() { return 767; }
  28. virtual daeInt typeID() const { return ID(); }
  29. public:
  30. class domHalf_extents;
  31. typedef daeSmartRef<domHalf_extents> domHalf_extentsRef;
  32. typedef daeTArray<domHalf_extentsRef> domHalf_extents_Array;
  33. /**
  34. * 3 float values that represent the extents of the box
  35. */
  36. class domHalf_extents : public daeElement
  37. {
  38. public:
  39. virtual COLLADA_TYPE::TypeEnum getElementType() const { return COLLADA_TYPE::HALF_EXTENTS; }
  40. static daeInt ID() { return 768; }
  41. virtual daeInt typeID() const { return ID(); }
  42. protected: // Value
  43. /**
  44. * The domFloat3 value of the text data of this element.
  45. */
  46. domFloat3 _value;
  47. public: //Accessors and Mutators
  48. /**
  49. * Gets the _value array.
  50. * @return Returns a domFloat3 reference of the _value array.
  51. */
  52. domFloat3 &getValue() { return _value; }
  53. /**
  54. * Gets the _value array.
  55. * @return Returns a constant domFloat3 reference of the _value array.
  56. */
  57. const domFloat3 &getValue() const { return _value; }
  58. /**
  59. * Sets the _value array.
  60. * @param val The new value for the _value array.
  61. */
  62. void setValue( const domFloat3 &val ) { _value = val; }
  63. protected:
  64. /**
  65. * Constructor
  66. */
  67. domHalf_extents(DAE& dae) : daeElement(dae), _value() {}
  68. /**
  69. * Destructor
  70. */
  71. virtual ~domHalf_extents() {}
  72. /**
  73. * Overloaded assignment operator
  74. */
  75. virtual domHalf_extents &operator=( const domHalf_extents &cpy ) { (void)cpy; return *this; }
  76. public: // STATIC METHODS
  77. /**
  78. * Creates an instance of this class and returns a daeElementRef referencing it.
  79. * @return a daeElementRef referencing an instance of this object.
  80. */
  81. static DLLSPEC daeElementRef create(DAE& dae);
  82. /**
  83. * Creates a daeMetaElement object that describes this element in the meta object reflection framework.
  84. * If a daeMetaElement already exists it will return that instead of creating a new one.
  85. * @return A daeMetaElement describing this COLLADA element.
  86. */
  87. static DLLSPEC daeMetaElement* registerElement(DAE& dae);
  88. };
  89. protected: // Elements
  90. /**
  91. * 3 float values that represent the extents of the box @see domHalf_extents
  92. */
  93. domHalf_extentsRef elemHalf_extents;
  94. /**
  95. * The extra element may appear any number of times. @see domExtra
  96. */
  97. domExtra_Array elemExtra_array;
  98. public: //Accessors and Mutators
  99. /**
  100. * Gets the half_extents element.
  101. * @return a daeSmartRef to the half_extents element.
  102. */
  103. const domHalf_extentsRef getHalf_extents() const { return elemHalf_extents; }
  104. /**
  105. * Gets the extra element array.
  106. * @return Returns a reference to the array of extra elements.
  107. */
  108. domExtra_Array &getExtra_array() { return elemExtra_array; }
  109. /**
  110. * Gets the extra element array.
  111. * @return Returns a constant reference to the array of extra elements.
  112. */
  113. const domExtra_Array &getExtra_array() const { return elemExtra_array; }
  114. protected:
  115. /**
  116. * Constructor
  117. */
  118. domBox(DAE& dae) : daeElement(dae), elemHalf_extents(), elemExtra_array() {}
  119. /**
  120. * Destructor
  121. */
  122. virtual ~domBox() {}
  123. /**
  124. * Overloaded assignment operator
  125. */
  126. virtual domBox &operator=( const domBox &cpy ) { (void)cpy; return *this; }
  127. public: // STATIC METHODS
  128. /**
  129. * Creates an instance of this class and returns a daeElementRef referencing it.
  130. * @return a daeElementRef referencing an instance of this object.
  131. */
  132. static DLLSPEC daeElementRef create(DAE& dae);
  133. /**
  134. * Creates a daeMetaElement object that describes this element in the meta object reflection framework.
  135. * If a daeMetaElement already exists it will return that instead of creating a new one.
  136. * @return A daeMetaElement describing this COLLADA element.
  137. */
  138. static DLLSPEC daeMetaElement* registerElement(DAE& dae);
  139. };
  140. #endif