domP.h 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  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 __domP_h__
  14. #define __domP_h__
  15. #include <dae/daeDocument.h>
  16. #include <dom/domTypes.h>
  17. #include <dom/domElements.h>
  18. class DAE;
  19. /**
  20. * The p element represents primitive data for the primitive types (lines,
  21. * linestrips, polygons, polylist, triangles, trifans, tristrips). The p
  22. * element contains indices that reference into the parent's source elements
  23. * referenced by the input elements.
  24. */
  25. class domP : public daeElement
  26. {
  27. public:
  28. virtual COLLADA_TYPE::TypeEnum getElementType() const { return COLLADA_TYPE::P; }
  29. static daeInt ID() { return 617; }
  30. virtual daeInt typeID() const { return ID(); }
  31. protected: // Value
  32. /**
  33. * The domListOfUInts value of the text data of this element.
  34. */
  35. domListOfUInts _value;
  36. public: //Accessors and Mutators
  37. /**
  38. * Gets the _value array.
  39. * @return Returns a domListOfUInts reference of the _value array.
  40. */
  41. domListOfUInts &getValue() { return _value; }
  42. /**
  43. * Gets the _value array.
  44. * @return Returns a constant domListOfUInts reference of the _value array.
  45. */
  46. const domListOfUInts &getValue() const { return _value; }
  47. /**
  48. * Sets the _value array.
  49. * @param val The new value for the _value array.
  50. */
  51. void setValue( const domListOfUInts &val ) { _value = val; }
  52. protected:
  53. /**
  54. * Constructor
  55. */
  56. domP(DAE& dae) : daeElement(dae), _value() {}
  57. /**
  58. * Destructor
  59. */
  60. virtual ~domP() {}
  61. /**
  62. * Overloaded assignment operator
  63. */
  64. virtual domP &operator=( const domP &cpy ) { (void)cpy; return *this; }
  65. public: // STATIC METHODS
  66. /**
  67. * Creates an instance of this class and returns a daeElementRef referencing it.
  68. * @return a daeElementRef referencing an instance of this object.
  69. */
  70. static DLLSPEC daeElementRef create(DAE& dae);
  71. /**
  72. * Creates a daeMetaElement object that describes this element in the meta object reflection framework.
  73. * If a daeMetaElement already exists it will return that instead of creating a new one.
  74. * @return A daeMetaElement describing this COLLADA element.
  75. */
  76. static DLLSPEC daeMetaElement* registerElement(DAE& dae);
  77. };
  78. #endif