• 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 __domInstance_geometry_h__
10 #define __domInstance_geometry_h__
11 
12 #include <dae/daeDocument.h>
13 #include <dom/domTypes.h>
14 #include <dom/domElements.h>
15 
16 #include <dom/domBind_material.h>
17 #include <dom/domExtra.h>
18 class DAE;
19 
20 /**
21  * The instance_geometry element declares the instantiation of a COLLADA geometry
22  * resource.
23  */
24 class domInstance_geometry : public daeElement
25 {
26 public:
getElementType()27 	virtual COLLADA_TYPE::TypeEnum getElementType() const { return COLLADA_TYPE::INSTANCE_GEOMETRY; }
ID()28 	static daeInt ID() { return 695; }
typeID()29 	virtual daeInt typeID() const { return ID(); }
30 protected:  // Attributes
31 /**
32  *  The url attribute refers to resource.  This may refer to a local resource
33  * using a relative URL  fragment identifier that begins with the “#”
34  * character. The url attribute may refer to an external  resource using an
35  * absolute or relative URL.
36  */
37 	xsAnyURI attrUrl;
38 /**
39  *  The sid attribute is a text string value containing the sub-identifier
40  * of this element. This  value must be unique within the scope of the parent
41  * element. Optional attribute.
42  */
43 	xsNCName attrSid;
44 /**
45  *  The name attribute is the text string name of this element. Optional attribute.
46  */
47 	xsNCName attrName;
48 
49 protected:  // Elements
50 /**
51  *  Bind a specific material to a piece of geometry, binding varying and uniform
52  * parameters at the  same time.  @see domBind_material
53  */
54 	domBind_materialRef elemBind_material;
55 /**
56  *  The extra element may appear any number of times.  @see domExtra
57  */
58 	domExtra_Array elemExtra_array;
59 
60 public:	//Accessors and Mutators
61 	/**
62 	 * Gets the url attribute.
63 	 * @return Returns a xsAnyURI reference of the url attribute.
64 	 */
getUrl()65 	xsAnyURI &getUrl() { return attrUrl; }
66 	/**
67 	 * Gets the url attribute.
68 	 * @return Returns a constant xsAnyURI reference of the url attribute.
69 	 */
getUrl()70 	const xsAnyURI &getUrl() const { return attrUrl; }
71 	/**
72 	 * Sets the url attribute.
73 	 * @param atUrl The new value for the url attribute.
74 	 */
setUrl(const xsAnyURI & atUrl)75 	void setUrl( const xsAnyURI &atUrl ) { attrUrl = atUrl; _validAttributeArray[0] = true; }
76 	/**
77 	 * Sets the url attribute.
78 	 * @param atUrl The new value for the url attribute.
79 	 */
setUrl(xsString atUrl)80 	void setUrl( xsString atUrl ) { attrUrl = atUrl; _validAttributeArray[0] = true; }
81 
82 	/**
83 	 * Gets the sid attribute.
84 	 * @return Returns a xsNCName of the sid attribute.
85 	 */
getSid()86 	xsNCName getSid() const { return attrSid; }
87 	/**
88 	 * Sets the sid attribute.
89 	 * @param atSid The new value for the sid attribute.
90 	 */
setSid(xsNCName atSid)91 	void setSid( xsNCName atSid ) { *(daeStringRef*)&attrSid = atSid; _validAttributeArray[1] = true; }
92 
93 	/**
94 	 * Gets the name attribute.
95 	 * @return Returns a xsNCName of the name attribute.
96 	 */
getName()97 	xsNCName getName() const { return attrName; }
98 	/**
99 	 * Sets the name attribute.
100 	 * @param atName The new value for the name attribute.
101 	 */
setName(xsNCName atName)102 	void setName( xsNCName atName ) { *(daeStringRef*)&attrName = atName; _validAttributeArray[2] = true; }
103 
104 	/**
105 	 * Gets the bind_material element.
106 	 * @return a daeSmartRef to the bind_material element.
107 	 */
getBind_material()108 	const domBind_materialRef getBind_material() const { return elemBind_material; }
109 	/**
110 	 * Gets the extra element array.
111 	 * @return Returns a reference to the array of extra elements.
112 	 */
getExtra_array()113 	domExtra_Array &getExtra_array() { return elemExtra_array; }
114 	/**
115 	 * Gets the extra element array.
116 	 * @return Returns a constant reference to the array of extra elements.
117 	 */
getExtra_array()118 	const domExtra_Array &getExtra_array() const { return elemExtra_array; }
119 protected:
120 	/**
121 	 * Constructor
122 	 */
domInstance_geometry(DAE & dae)123 	domInstance_geometry(DAE& dae) : daeElement(dae), attrUrl(dae, *this), attrSid(), attrName(), elemBind_material(), elemExtra_array() {}
124 	/**
125 	 * Destructor
126 	 */
~domInstance_geometry()127 	virtual ~domInstance_geometry() {}
128 	/**
129 	 * Overloaded assignment operator
130 	 */
131 	virtual domInstance_geometry &operator=( const domInstance_geometry &cpy ) { (void)cpy; return *this; }
132 
133 public: // STATIC METHODS
134 	/**
135 	 * Creates an instance of this class and returns a daeElementRef referencing it.
136 	 * @return a daeElementRef referencing an instance of this object.
137 	 */
138 	static DLLSPEC daeElementRef create(DAE& dae);
139 	/**
140 	 * Creates a daeMetaElement object that describes this element in the meta object reflection framework.
141 	 * If a daeMetaElement already exists it will return that instead of creating a new one.
142 	 * @return A daeMetaElement describing this COLLADA element.
143 	 */
144 	static DLLSPEC daeMetaElement* registerElement(DAE& dae);
145 };
146 
147 
148 #endif
149