2
0

domSampler.h 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  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 __domSampler_h__
  14. #define __domSampler_h__
  15. #include <dae/daeDocument.h>
  16. #include <dom/domTypes.h>
  17. #include <dom/domElements.h>
  18. #include <dom/domInputLocal.h>
  19. class DAE;
  20. /**
  21. * The sampler element declares an N-dimensional function used for animation.
  22. * Animation function curves are represented by 1-D sampler elements in COLLADA.
  23. * The sampler defines sampling points and how to interpolate between them.
  24. */
  25. class domSampler : public daeElement
  26. {
  27. public:
  28. virtual COLLADA_TYPE::TypeEnum getElementType() const { return COLLADA_TYPE::SAMPLER; }
  29. static daeInt ID() { return 654; }
  30. virtual daeInt typeID() const { return ID(); }
  31. protected: // Attribute
  32. /**
  33. * The id attribute is a text string containing the unique identifier of
  34. * this element. This value must be unique within the instance document.
  35. * Optional attribute.
  36. */
  37. xsID attrId;
  38. protected: // Element
  39. /**
  40. * The input element must occur at least one time. These inputs are local
  41. * inputs. @see domInput
  42. */
  43. domInputLocal_Array elemInput_array;
  44. public: //Accessors and Mutators
  45. /**
  46. * Gets the id attribute.
  47. * @return Returns a xsID of the id attribute.
  48. */
  49. xsID getId() const { return attrId; }
  50. /**
  51. * Sets the id attribute.
  52. * @param atId The new value for the id attribute.
  53. */
  54. void setId( xsID atId ) { *(daeStringRef*)&attrId = atId; _validAttributeArray[0] = true;
  55. if( _document != NULL ) _document->changeElementID( this, attrId );
  56. }
  57. /**
  58. * Gets the input element array.
  59. * @return Returns a reference to the array of input elements.
  60. */
  61. domInputLocal_Array &getInput_array() { return elemInput_array; }
  62. /**
  63. * Gets the input element array.
  64. * @return Returns a constant reference to the array of input elements.
  65. */
  66. const domInputLocal_Array &getInput_array() const { return elemInput_array; }
  67. protected:
  68. /**
  69. * Constructor
  70. */
  71. domSampler(DAE& dae) : daeElement(dae), attrId(), elemInput_array() {}
  72. /**
  73. * Destructor
  74. */
  75. virtual ~domSampler() {}
  76. /**
  77. * Overloaded assignment operator
  78. */
  79. virtual domSampler &operator=( const domSampler &cpy ) { (void)cpy; return *this; }
  80. public: // STATIC METHODS
  81. /**
  82. * Creates an instance of this class and returns a daeElementRef referencing it.
  83. * @return a daeElementRef referencing an instance of this object.
  84. */
  85. static DLLSPEC daeElementRef create(DAE& dae);
  86. /**
  87. * Creates a daeMetaElement object that describes this element in the meta object reflection framework.
  88. * If a daeMetaElement already exists it will return that instead of creating a new one.
  89. * @return A daeMetaElement describing this COLLADA element.
  90. */
  91. static DLLSPEC daeMetaElement* registerElement(DAE& dae);
  92. };
  93. #endif