domMatrix.h 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  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 __domMatrix_h__
  14. #define __domMatrix_h__
  15. #include <dae/daeDocument.h>
  16. #include <dom/domTypes.h>
  17. #include <dom/domElements.h>
  18. class DAE;
  19. /**
  20. * Matrix transformations embody mathematical changes to points within a coordinate
  21. * systems or the coordinate system itself. The matrix element contains a
  22. * 4-by-4 matrix of floating-point values.
  23. */
  24. class domMatrix : public daeElement
  25. {
  26. public:
  27. virtual COLLADA_TYPE::TypeEnum getElementType() const { return COLLADA_TYPE::MATRIX; }
  28. static daeInt ID() { return 630; }
  29. virtual daeInt typeID() const { return ID(); }
  30. protected: // Attribute
  31. /**
  32. * The sid attribute is a text string value containing the sub-identifier
  33. * of this element. This value must be unique within the scope of the parent
  34. * element. Optional attribute.
  35. */
  36. xsNCName attrSid;
  37. protected: // Value
  38. /**
  39. * The domFloat4x4 value of the text data of this element.
  40. */
  41. domFloat4x4 _value;
  42. public: //Accessors and Mutators
  43. /**
  44. * Gets the sid attribute.
  45. * @return Returns a xsNCName of the sid attribute.
  46. */
  47. xsNCName getSid() const { return attrSid; }
  48. /**
  49. * Sets the sid attribute.
  50. * @param atSid The new value for the sid attribute.
  51. */
  52. void setSid( xsNCName atSid ) { *(daeStringRef*)&attrSid = atSid; _validAttributeArray[0] = true; }
  53. /**
  54. * Gets the _value array.
  55. * @return Returns a domFloat4x4 reference of the _value array.
  56. */
  57. domFloat4x4 &getValue() { return _value; }
  58. /**
  59. * Gets the _value array.
  60. * @return Returns a constant domFloat4x4 reference of the _value array.
  61. */
  62. const domFloat4x4 &getValue() const { return _value; }
  63. /**
  64. * Sets the _value array.
  65. * @param val The new value for the _value array.
  66. */
  67. void setValue( const domFloat4x4 &val ) { _value = val; }
  68. protected:
  69. /**
  70. * Constructor
  71. */
  72. domMatrix(DAE& dae) : daeElement(dae), attrSid(), _value() {}
  73. /**
  74. * Destructor
  75. */
  76. virtual ~domMatrix() {}
  77. /**
  78. * Overloaded assignment operator
  79. */
  80. virtual domMatrix &operator=( const domMatrix &cpy ) { (void)cpy; return *this; }
  81. public: // STATIC METHODS
  82. /**
  83. * Creates an instance of this class and returns a daeElementRef referencing it.
  84. * @return a daeElementRef referencing an instance of this object.
  85. */
  86. static DLLSPEC daeElementRef create(DAE& dae);
  87. /**
  88. * Creates a daeMetaElement object that describes this element in the meta object reflection framework.
  89. * If a daeMetaElement already exists it will return that instead of creating a new one.
  90. * @return A daeMetaElement describing this COLLADA element.
  91. */
  92. static DLLSPEC daeMetaElement* registerElement(DAE& dae);
  93. };
  94. #endif