domTargetableFloat.h 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  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 __domTargetableFloat_h__
  14. #define __domTargetableFloat_h__
  15. #include <dae/daeDocument.h>
  16. #include <dom/domTypes.h>
  17. #include <dom/domElements.h>
  18. class DAE;
  19. /**
  20. * The TargetableFloat type is used to represent elements which contain a
  21. * single float value which can be targeted for animation.
  22. */
  23. class domTargetableFloat_complexType
  24. {
  25. protected: // Attribute
  26. /**
  27. * The sid attribute is a text string value containing the sub-identifier
  28. * of this element. This value must be unique within the scope of the parent
  29. * element. Optional attribute.
  30. */
  31. xsNCName attrSid;
  32. protected: // Value
  33. /**
  34. * The domFloat value of the text data of this element.
  35. */
  36. domFloat _value;
  37. public: //Accessors and Mutators
  38. /**
  39. * Gets the sid attribute.
  40. * @return Returns a xsNCName of the sid attribute.
  41. */
  42. xsNCName getSid() const { return attrSid; }
  43. /**
  44. * Sets the sid attribute.
  45. * @param atSid The new value for the sid attribute.
  46. */
  47. void setSid( xsNCName atSid ) { *(daeStringRef*)&attrSid = atSid;}
  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. domTargetableFloat_complexType(DAE& dae, daeElement* elt) : attrSid(), _value() {}
  63. /**
  64. * Destructor
  65. */
  66. virtual ~domTargetableFloat_complexType() {}
  67. /**
  68. * Overloaded assignment operator
  69. */
  70. virtual domTargetableFloat_complexType &operator=( const domTargetableFloat_complexType &cpy ) { (void)cpy; return *this; }
  71. };
  72. /**
  73. * An element of type domTargetableFloat_complexType.
  74. */
  75. class domTargetableFloat : public daeElement, public domTargetableFloat_complexType
  76. {
  77. public:
  78. virtual COLLADA_TYPE::TypeEnum getElementType() const { return COLLADA_TYPE::TARGETABLEFLOAT; }
  79. static daeInt ID() { return 4; }
  80. virtual daeInt typeID() const { return ID(); }
  81. public: //Accessors and Mutators
  82. /**
  83. * Gets the sid attribute.
  84. * @return Returns a xsNCName of the sid attribute.
  85. */
  86. xsNCName getSid() const { return attrSid; }
  87. /**
  88. * Sets the sid attribute.
  89. * @param atSid The new value for the sid attribute.
  90. */
  91. void setSid( xsNCName atSid ) { *(daeStringRef*)&attrSid = atSid; _validAttributeArray[0] = true; }
  92. protected:
  93. /**
  94. * Constructor
  95. */
  96. domTargetableFloat(DAE& dae) : daeElement(dae), domTargetableFloat_complexType(dae, this) {}
  97. /**
  98. * Destructor
  99. */
  100. virtual ~domTargetableFloat() {}
  101. /**
  102. * Overloaded assignment operator
  103. */
  104. virtual domTargetableFloat &operator=( const domTargetableFloat &cpy ) { (void)cpy; return *this; }
  105. public: // STATIC METHODS
  106. /**
  107. * Creates an instance of this class and returns a daeElementRef referencing it.
  108. * @return a daeElementRef referencing an instance of this object.
  109. */
  110. static DLLSPEC daeElementRef create(DAE& dae);
  111. /**
  112. * Creates a daeMetaElement object that describes this element in the meta object reflection framework.
  113. * If a daeMetaElement already exists it will return that instead of creating a new one.
  114. * @return A daeMetaElement describing this COLLADA element.
  115. */
  116. static DLLSPEC daeMetaElement* registerElement(DAE& dae);
  117. };
  118. #endif