domPlane.h 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  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 __domPlane_h__
  14. #define __domPlane_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 infinite plane primitive.
  22. */
  23. class domPlane : public daeElement
  24. {
  25. public:
  26. virtual COLLADA_TYPE::TypeEnum getElementType() const { return COLLADA_TYPE::PLANE; }
  27. static daeInt ID() { return 769; }
  28. virtual daeInt typeID() const { return ID(); }
  29. public:
  30. class domEquation;
  31. typedef daeSmartRef<domEquation> domEquationRef;
  32. typedef daeTArray<domEquationRef> domEquation_Array;
  33. /**
  34. * 4 float values that represent the coefficients for the plane’s equation:
  35. * Ax + By + Cz + D = 0
  36. */
  37. class domEquation : public daeElement
  38. {
  39. public:
  40. virtual COLLADA_TYPE::TypeEnum getElementType() const { return COLLADA_TYPE::EQUATION; }
  41. static daeInt ID() { return 770; }
  42. virtual daeInt typeID() const { return ID(); }
  43. protected: // Value
  44. /**
  45. * The domFloat4 value of the text data of this element.
  46. */
  47. domFloat4 _value;
  48. public: //Accessors and Mutators
  49. /**
  50. * Gets the _value array.
  51. * @return Returns a domFloat4 reference of the _value array.
  52. */
  53. domFloat4 &getValue() { return _value; }
  54. /**
  55. * Gets the _value array.
  56. * @return Returns a constant domFloat4 reference of the _value array.
  57. */
  58. const domFloat4 &getValue() const { return _value; }
  59. /**
  60. * Sets the _value array.
  61. * @param val The new value for the _value array.
  62. */
  63. void setValue( const domFloat4 &val ) { _value = val; }
  64. protected:
  65. /**
  66. * Constructor
  67. */
  68. domEquation(DAE& dae) : daeElement(dae), _value() {}
  69. /**
  70. * Destructor
  71. */
  72. virtual ~domEquation() {}
  73. /**
  74. * Overloaded assignment operator
  75. */
  76. virtual domEquation &operator=( const domEquation &cpy ) { (void)cpy; return *this; }
  77. public: // STATIC METHODS
  78. /**
  79. * Creates an instance of this class and returns a daeElementRef referencing it.
  80. * @return a daeElementRef referencing an instance of this object.
  81. */
  82. static DLLSPEC daeElementRef create(DAE& dae);
  83. /**
  84. * Creates a daeMetaElement object that describes this element in the meta object reflection framework.
  85. * If a daeMetaElement already exists it will return that instead of creating a new one.
  86. * @return A daeMetaElement describing this COLLADA element.
  87. */
  88. static DLLSPEC daeMetaElement* registerElement(DAE& dae);
  89. };
  90. protected: // Elements
  91. /**
  92. * 4 float values that represent the coefficients for the plane’s equation:
  93. * Ax + By + Cz + D = 0 @see domEquation
  94. */
  95. domEquationRef elemEquation;
  96. /**
  97. * The extra element may appear any number of times. @see domExtra
  98. */
  99. domExtra_Array elemExtra_array;
  100. public: //Accessors and Mutators
  101. /**
  102. * Gets the equation element.
  103. * @return a daeSmartRef to the equation element.
  104. */
  105. const domEquationRef getEquation() const { return elemEquation; }
  106. /**
  107. * Gets the extra element array.
  108. * @return Returns a reference to the array of extra elements.
  109. */
  110. domExtra_Array &getExtra_array() { return elemExtra_array; }
  111. /**
  112. * Gets the extra element array.
  113. * @return Returns a constant reference to the array of extra elements.
  114. */
  115. const domExtra_Array &getExtra_array() const { return elemExtra_array; }
  116. protected:
  117. /**
  118. * Constructor
  119. */
  120. domPlane(DAE& dae) : daeElement(dae), elemEquation(), elemExtra_array() {}
  121. /**
  122. * Destructor
  123. */
  124. virtual ~domPlane() {}
  125. /**
  126. * Overloaded assignment operator
  127. */
  128. virtual domPlane &operator=( const domPlane &cpy ) { (void)cpy; return *this; }
  129. public: // STATIC METHODS
  130. /**
  131. * Creates an instance of this class and returns a daeElementRef referencing it.
  132. * @return a daeElementRef referencing an instance of this object.
  133. */
  134. static DLLSPEC daeElementRef create(DAE& dae);
  135. /**
  136. * Creates a daeMetaElement object that describes this element in the meta object reflection framework.
  137. * If a daeMetaElement already exists it will return that instead of creating a new one.
  138. * @return A daeMetaElement describing this COLLADA element.
  139. */
  140. static DLLSPEC daeMetaElement* registerElement(DAE& dae);
  141. };
  142. #endif