• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 __domForce_field_h__
10 #define __domForce_field_h__
11 
12 #include <dae/daeDocument.h>
13 #include <dom/domTypes.h>
14 #include <dom/domElements.h>
15 
16 #include <dom/domAsset.h>
17 #include <dom/domTechnique.h>
18 #include <dom/domExtra.h>
19 class DAE;
20 
21 /**
22  * A general container for force-fields. At the moment, it only has techniques
23  * and extra elements.
24  */
25 class domForce_field : public daeElement
26 {
27 public:
getElementType()28 	virtual COLLADA_TYPE::TypeEnum getElementType() const { return COLLADA_TYPE::FORCE_FIELD; }
ID()29 	static daeInt ID() { return 790; }
typeID()30 	virtual daeInt typeID() const { return ID(); }
31 protected:  // Attributes
32 /**
33  *  The id attribute is a text string containing the unique identifier of
34  * this element. This value  must be unique within the instance document.
35  * Optional attribute.
36  */
37 	xsID attrId;
38 /**
39  *  The name attribute is the text string name of this element. Optional attribute.
40  */
41 	xsNCName attrName;
42 
43 protected:  // Elements
44 /**
45  *  The force_field element may contain an asset element.  @see domAsset
46  */
47 	domAssetRef elemAsset;
48 /**
49  *  This element must contain at least one non-common profile technique.
50  * @see domTechnique
51  */
52 	domTechnique_Array elemTechnique_array;
53 /**
54  *  The extra element may appear any number of times.  @see domExtra
55  */
56 	domExtra_Array elemExtra_array;
57 
58 public:	//Accessors and Mutators
59 	/**
60 	 * Gets the id attribute.
61 	 * @return Returns a xsID of the id attribute.
62 	 */
getId()63 	xsID getId() const { return attrId; }
64 	/**
65 	 * Sets the id attribute.
66 	 * @param atId The new value for the id attribute.
67 	 */
setId(xsID atId)68 	void setId( xsID atId ) { *(daeStringRef*)&attrId = atId; _validAttributeArray[0] = true;
69 		if( _document != NULL ) _document->changeElementID( this, attrId );
70 	}
71 
72 	/**
73 	 * Gets the name attribute.
74 	 * @return Returns a xsNCName of the name attribute.
75 	 */
getName()76 	xsNCName getName() const { return attrName; }
77 	/**
78 	 * Sets the name attribute.
79 	 * @param atName The new value for the name attribute.
80 	 */
setName(xsNCName atName)81 	void setName( xsNCName atName ) { *(daeStringRef*)&attrName = atName; _validAttributeArray[1] = true; }
82 
83 	/**
84 	 * Gets the asset element.
85 	 * @return a daeSmartRef to the asset element.
86 	 */
getAsset()87 	const domAssetRef getAsset() const { return elemAsset; }
88 	/**
89 	 * Gets the technique element array.
90 	 * @return Returns a reference to the array of technique elements.
91 	 */
getTechnique_array()92 	domTechnique_Array &getTechnique_array() { return elemTechnique_array; }
93 	/**
94 	 * Gets the technique element array.
95 	 * @return Returns a constant reference to the array of technique elements.
96 	 */
getTechnique_array()97 	const domTechnique_Array &getTechnique_array() const { return elemTechnique_array; }
98 	/**
99 	 * Gets the extra element array.
100 	 * @return Returns a reference to the array of extra elements.
101 	 */
getExtra_array()102 	domExtra_Array &getExtra_array() { return elemExtra_array; }
103 	/**
104 	 * Gets the extra element array.
105 	 * @return Returns a constant reference to the array of extra elements.
106 	 */
getExtra_array()107 	const domExtra_Array &getExtra_array() const { return elemExtra_array; }
108 protected:
109 	/**
110 	 * Constructor
111 	 */
domForce_field(DAE & dae)112 	domForce_field(DAE& dae) : daeElement(dae), attrId(), attrName(), elemAsset(), elemTechnique_array(), elemExtra_array() {}
113 	/**
114 	 * Destructor
115 	 */
~domForce_field()116 	virtual ~domForce_field() {}
117 	/**
118 	 * Overloaded assignment operator
119 	 */
120 	virtual domForce_field &operator=( const domForce_field &cpy ) { (void)cpy; return *this; }
121 
122 public: // STATIC METHODS
123 	/**
124 	 * Creates an instance of this class and returns a daeElementRef referencing it.
125 	 * @return a daeElementRef referencing an instance of this object.
126 	 */
127 	static DLLSPEC daeElementRef create(DAE& dae);
128 	/**
129 	 * Creates a daeMetaElement object that describes this element in the meta object reflection framework.
130 	 * If a daeMetaElement already exists it will return that instead of creating a new one.
131 	 * @return A daeMetaElement describing this COLLADA element.
132 	 */
133 	static DLLSPEC daeMetaElement* registerElement(DAE& dae);
134 };
135 
136 
137 #endif
138