domChannel.h 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  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 __domChannel_h__
  14. #define __domChannel_h__
  15. #include <dae/daeDocument.h>
  16. #include <dom/domTypes.h>
  17. #include <dom/domElements.h>
  18. class DAE;
  19. /**
  20. * The channel element declares an output channel of an animation.
  21. */
  22. class domChannel : public daeElement
  23. {
  24. public:
  25. virtual COLLADA_TYPE::TypeEnum getElementType() const { return COLLADA_TYPE::CHANNEL; }
  26. static daeInt ID() { return 653; }
  27. virtual daeInt typeID() const { return ID(); }
  28. protected: // Attributes
  29. /**
  30. * The source attribute indicates the location of the sampler using a URL
  31. * expression. The sampler must be declared within the same document. Required
  32. * attribute.
  33. */
  34. domURIFragmentType attrSource;
  35. /**
  36. * The target attribute indicates the location of the element bound to the
  37. * output of the sampler. This text string is a path-name following a simple
  38. * syntax described in Address Syntax. Required attribute.
  39. */
  40. xsToken attrTarget;
  41. public: //Accessors and Mutators
  42. /**
  43. * Gets the source attribute.
  44. * @return Returns a domURIFragmentType reference of the source attribute.
  45. */
  46. domURIFragmentType &getSource() { return attrSource; }
  47. /**
  48. * Gets the source attribute.
  49. * @return Returns a constant domURIFragmentType reference of the source attribute.
  50. */
  51. const domURIFragmentType &getSource() const { return attrSource; }
  52. /**
  53. * Sets the source attribute.
  54. * @param atSource The new value for the source attribute.
  55. */
  56. void setSource( const domURIFragmentType &atSource ) { attrSource = atSource; _validAttributeArray[0] = true; }
  57. /**
  58. * Sets the source attribute.
  59. * @param atSource The new value for the source attribute.
  60. */
  61. void setSource( xsString atSource ) { attrSource = atSource; _validAttributeArray[0] = true; }
  62. /**
  63. * Gets the target attribute.
  64. * @return Returns a xsToken of the target attribute.
  65. */
  66. xsToken getTarget() const { return attrTarget; }
  67. /**
  68. * Sets the target attribute.
  69. * @param atTarget The new value for the target attribute.
  70. */
  71. void setTarget( xsToken atTarget ) { *(daeStringRef*)&attrTarget = atTarget; _validAttributeArray[1] = true; }
  72. protected:
  73. /**
  74. * Constructor
  75. */
  76. domChannel(DAE& dae) : daeElement(dae), attrSource(dae, *this), attrTarget() {}
  77. /**
  78. * Destructor
  79. */
  80. virtual ~domChannel() {}
  81. /**
  82. * Overloaded assignment operator
  83. */
  84. virtual domChannel &operator=( const domChannel &cpy ) { (void)cpy; return *this; }
  85. public: // STATIC METHODS
  86. /**
  87. * Creates an instance of this class and returns a daeElementRef referencing it.
  88. * @return a daeElementRef referencing an instance of this object.
  89. */
  90. static DLLSPEC daeElementRef create(DAE& dae);
  91. /**
  92. * Creates a daeMetaElement object that describes this element in the meta object reflection framework.
  93. * If a daeMetaElement already exists it will return that instead of creating a new one.
  94. * @return A daeMetaElement describing this COLLADA element.
  95. */
  96. static DLLSPEC daeMetaElement* registerElement(DAE& dae);
  97. };
  98. #endif