1 /* 2 * Copyright 2006 Sony Computer Entertainment Inc. 3 * 4 * Licensed under the MIT Open Source License, for details please see license.txt or the website 5 * http://www.opensource.org/licenses/mit-license.php 6 * 7 */ 8 9 #ifndef __domInstance_rigid_constraint_h__ 10 #define __domInstance_rigid_constraint_h__ 11 12 #include <dae/daeDocument.h> 13 #include <dom/domTypes.h> 14 #include <dom/domElements.h> 15 16 #include <dom/domExtra.h> 17 class DAE; 18 19 /** 20 * This element allows instancing a rigid_constraint within an instance_physics_model. 21 */ 22 class domInstance_rigid_constraint : public daeElement 23 { 24 public: getElementType()25 virtual COLLADA_TYPE::TypeEnum getElementType() const { return COLLADA_TYPE::INSTANCE_RIGID_CONSTRAINT; } ID()26 static daeInt ID() { return 711; } typeID()27 virtual daeInt typeID() const { return ID(); } 28 protected: // Attributes 29 /** 30 * The constraint attribute indicates which rigid_constraing to instantiate. 31 * Required attribute. 32 */ 33 xsNCName attrConstraint; 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 name attribute is the text string name of this element. Optional attribute. 42 */ 43 xsNCName attrName; 44 45 protected: // Element 46 /** 47 * The extra element may appear any number of times. @see domExtra 48 */ 49 domExtra_Array elemExtra_array; 50 51 public: //Accessors and Mutators 52 /** 53 * Gets the constraint attribute. 54 * @return Returns a xsNCName of the constraint attribute. 55 */ getConstraint()56 xsNCName getConstraint() const { return attrConstraint; } 57 /** 58 * Sets the constraint attribute. 59 * @param atConstraint The new value for the constraint attribute. 60 */ setConstraint(xsNCName atConstraint)61 void setConstraint( xsNCName atConstraint ) { *(daeStringRef*)&attrConstraint = atConstraint; _validAttributeArray[0] = true; } 62 63 /** 64 * Gets the sid attribute. 65 * @return Returns a xsNCName of the sid attribute. 66 */ getSid()67 xsNCName getSid() const { return attrSid; } 68 /** 69 * Sets the sid attribute. 70 * @param atSid The new value for the sid attribute. 71 */ setSid(xsNCName atSid)72 void setSid( xsNCName atSid ) { *(daeStringRef*)&attrSid = atSid; _validAttributeArray[1] = true; } 73 74 /** 75 * Gets the name attribute. 76 * @return Returns a xsNCName of the name attribute. 77 */ getName()78 xsNCName getName() const { return attrName; } 79 /** 80 * Sets the name attribute. 81 * @param atName The new value for the name attribute. 82 */ setName(xsNCName atName)83 void setName( xsNCName atName ) { *(daeStringRef*)&attrName = atName; _validAttributeArray[2] = true; } 84 85 /** 86 * Gets the extra element array. 87 * @return Returns a reference to the array of extra elements. 88 */ getExtra_array()89 domExtra_Array &getExtra_array() { return elemExtra_array; } 90 /** 91 * Gets the extra element array. 92 * @return Returns a constant reference to the array of extra elements. 93 */ getExtra_array()94 const domExtra_Array &getExtra_array() const { return elemExtra_array; } 95 protected: 96 /** 97 * Constructor 98 */ domInstance_rigid_constraint(DAE & dae)99 domInstance_rigid_constraint(DAE& dae) : daeElement(dae), attrConstraint(), attrSid(), attrName(), elemExtra_array() {} 100 /** 101 * Destructor 102 */ ~domInstance_rigid_constraint()103 virtual ~domInstance_rigid_constraint() {} 104 /** 105 * Overloaded assignment operator 106 */ 107 virtual domInstance_rigid_constraint &operator=( const domInstance_rigid_constraint &cpy ) { (void)cpy; return *this; } 108 109 public: // STATIC METHODS 110 /** 111 * Creates an instance of this class and returns a daeElementRef referencing it. 112 * @return a daeElementRef referencing an instance of this object. 113 */ 114 static DLLSPEC daeElementRef create(DAE& dae); 115 /** 116 * Creates a daeMetaElement object that describes this element in the meta object reflection framework. 117 * If a daeMetaElement already exists it will return that instead of creating a new one. 118 * @return A daeMetaElement describing this COLLADA element. 119 */ 120 static DLLSPEC daeMetaElement* registerElement(DAE& dae); 121 }; 122 123 124 #endif 125