domSphere.h 4.3 KB

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