2
0

domParam.h 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  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 __domParam_h__
  14. #define __domParam_h__
  15. #include <dae/daeDocument.h>
  16. #include <dom/domTypes.h>
  17. #include <dom/domElements.h>
  18. class DAE;
  19. /**
  20. * The param element declares parametric information regarding its parent
  21. * element.
  22. */
  23. class domParam : public daeElement
  24. {
  25. public:
  26. virtual COLLADA_TYPE::TypeEnum getElementType() const { return COLLADA_TYPE::PARAM; }
  27. static daeInt ID() { return 610; }
  28. virtual daeInt typeID() const { return ID(); }
  29. protected: // Attributes
  30. /**
  31. * The name attribute is the text string name of this element. Optional attribute.
  32. */
  33. xsNCName attrName;
  34. /**
  35. * The sid attribute is a text string value containing the sub-identifier
  36. * of this element. This value must be unique within the scope of the parent
  37. * element. Optional attribute.
  38. */
  39. xsNCName attrSid;
  40. /**
  41. * The semantic attribute is the user-defined meaning of the parameter. Optional
  42. * attribute.
  43. */
  44. xsNMTOKEN attrSemantic;
  45. /**
  46. * The type attribute indicates the type of the value data. This text string
  47. * must be understood by the application. Required attribute.
  48. */
  49. xsNMTOKEN attrType;
  50. protected: // Value
  51. /**
  52. * The xsString value of the text data of this element.
  53. */
  54. xsString _value;
  55. public: //Accessors and Mutators
  56. /**
  57. * Gets the name attribute.
  58. * @return Returns a xsNCName of the name attribute.
  59. */
  60. xsNCName getName() const { return attrName; }
  61. /**
  62. * Sets the name attribute.
  63. * @param atName The new value for the name attribute.
  64. */
  65. void setName( xsNCName atName ) { *(daeStringRef*)&attrName = atName; _validAttributeArray[0] = true; }
  66. /**
  67. * Gets the sid attribute.
  68. * @return Returns a xsNCName of the sid attribute.
  69. */
  70. xsNCName getSid() const { return attrSid; }
  71. /**
  72. * Sets the sid attribute.
  73. * @param atSid The new value for the sid attribute.
  74. */
  75. void setSid( xsNCName atSid ) { *(daeStringRef*)&attrSid = atSid; _validAttributeArray[1] = true; }
  76. /**
  77. * Gets the semantic attribute.
  78. * @return Returns a xsNMTOKEN of the semantic attribute.
  79. */
  80. xsNMTOKEN getSemantic() const { return attrSemantic; }
  81. /**
  82. * Sets the semantic attribute.
  83. * @param atSemantic The new value for the semantic attribute.
  84. */
  85. void setSemantic( xsNMTOKEN atSemantic ) { *(daeStringRef*)&attrSemantic = atSemantic; _validAttributeArray[2] = true; }
  86. /**
  87. * Gets the type attribute.
  88. * @return Returns a xsNMTOKEN of the type attribute.
  89. */
  90. xsNMTOKEN getType() const { return attrType; }
  91. /**
  92. * Sets the type attribute.
  93. * @param atType The new value for the type attribute.
  94. */
  95. void setType( xsNMTOKEN atType ) { *(daeStringRef*)&attrType = atType; _validAttributeArray[3] = true; }
  96. /**
  97. * Gets the value of this element.
  98. * @return Returns a xsString of the value.
  99. */
  100. xsString getValue() const { return _value; }
  101. /**
  102. * Sets the _value of this element.
  103. * @param val The new value for this element.
  104. */
  105. void setValue( xsString val ) { *(daeStringRef*)&_value = val; }
  106. protected:
  107. /**
  108. * Constructor
  109. */
  110. domParam(DAE& dae) : daeElement(dae), attrName(), attrSid(), attrSemantic(), attrType(), _value() {}
  111. /**
  112. * Destructor
  113. */
  114. virtual ~domParam() {}
  115. /**
  116. * Overloaded assignment operator
  117. */
  118. virtual domParam &operator=( const domParam &cpy ) { (void)cpy; return *this; }
  119. public: // STATIC METHODS
  120. /**
  121. * Creates an instance of this class and returns a daeElementRef referencing it.
  122. * @return a daeElementRef referencing an instance of this object.
  123. */
  124. static DLLSPEC daeElementRef create(DAE& dae);
  125. /**
  126. * Creates a daeMetaElement object that describes this element in the meta object reflection framework.
  127. * If a daeMetaElement already exists it will return that instead of creating a new one.
  128. * @return A daeMetaElement describing this COLLADA element.
  129. */
  130. static DLLSPEC daeMetaElement* registerElement(DAE& dae);
  131. };
  132. #endif