• 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 __domLines_h__
10 #define __domLines_h__
11 
12 #include <dae/daeDocument.h>
13 #include <dom/domTypes.h>
14 #include <dom/domElements.h>
15 
16 #include <dom/domP.h>
17 #include <dom/domExtra.h>
18 #include <dom/domInputLocalOffset.h>
19 class DAE;
20 
21 /**
22  * The lines element provides the information needed to bind vertex attributes
23  * together and then  organize those vertices into individual lines. Each
24  * line described by the mesh has two vertices.  The first line is formed
25  * from first and second vertices. The second line is formed from the  third
26  * and fourth vertices and so on.
27  */
28 class domLines : public daeElement
29 {
30 public:
getElementType()31 	virtual COLLADA_TYPE::TypeEnum getElementType() const { return COLLADA_TYPE::LINES; }
ID()32 	static daeInt ID() { return 618; }
typeID()33 	virtual daeInt typeID() const { return ID(); }
34 protected:  // Attributes
35 /**
36  *  The name attribute is the text string name of this element. Optional attribute.
37  */
38 	xsNCName attrName;
39 /**
40  *  The count attribute indicates the number of line primitives. Required
41  * attribute.
42  */
43 	domUint attrCount;
44 /**
45  *  The material attribute declares a symbol for a material. This symbol is
46  * bound to a material at  the time of instantiation. If the material attribute
47  * is not specified then the lighting and  shading results are application
48  * defined. Optional attribute.
49  */
50 	xsNCName attrMaterial;
51 
52 protected:  // Elements
53 /**
54  * The input element may occur any number of times. This input is a local
55  * input with the offset  and set attributes. @see domInput
56  */
57 	domInputLocalOffset_Array elemInput_array;
58 /**
59  *  The p element may occur once.  @see domP
60  */
61 	domPRef elemP;
62 /**
63  *  The extra element may appear any number of times.  @see domExtra
64  */
65 	domExtra_Array elemExtra_array;
66 
67 public:	//Accessors and Mutators
68 	/**
69 	 * Gets the name attribute.
70 	 * @return Returns a xsNCName of the name attribute.
71 	 */
getName()72 	xsNCName getName() const { return attrName; }
73 	/**
74 	 * Sets the name attribute.
75 	 * @param atName The new value for the name attribute.
76 	 */
setName(xsNCName atName)77 	void setName( xsNCName atName ) { *(daeStringRef*)&attrName = atName; _validAttributeArray[0] = true; }
78 
79 	/**
80 	 * Gets the count attribute.
81 	 * @return Returns a domUint of the count attribute.
82 	 */
getCount()83 	domUint getCount() const { return attrCount; }
84 	/**
85 	 * Sets the count attribute.
86 	 * @param atCount The new value for the count attribute.
87 	 */
setCount(domUint atCount)88 	void setCount( domUint atCount ) { attrCount = atCount; _validAttributeArray[1] = true; }
89 
90 	/**
91 	 * Gets the material attribute.
92 	 * @return Returns a xsNCName of the material attribute.
93 	 */
getMaterial()94 	xsNCName getMaterial() const { return attrMaterial; }
95 	/**
96 	 * Sets the material attribute.
97 	 * @param atMaterial The new value for the material attribute.
98 	 */
setMaterial(xsNCName atMaterial)99 	void setMaterial( xsNCName atMaterial ) { *(daeStringRef*)&attrMaterial = atMaterial; _validAttributeArray[2] = true; }
100 
101 	/**
102 	 * Gets the input element array.
103 	 * @return Returns a reference to the array of input elements.
104 	 */
getInput_array()105 	domInputLocalOffset_Array &getInput_array() { return elemInput_array; }
106 	/**
107 	 * Gets the input element array.
108 	 * @return Returns a constant reference to the array of input elements.
109 	 */
getInput_array()110 	const domInputLocalOffset_Array &getInput_array() const { return elemInput_array; }
111 	/**
112 	 * Gets the p element.
113 	 * @return a daeSmartRef to the p element.
114 	 */
getP()115 	const domPRef getP() const { return elemP; }
116 	/**
117 	 * Gets the extra element array.
118 	 * @return Returns a reference to the array of extra elements.
119 	 */
getExtra_array()120 	domExtra_Array &getExtra_array() { return elemExtra_array; }
121 	/**
122 	 * Gets the extra element array.
123 	 * @return Returns a constant reference to the array of extra elements.
124 	 */
getExtra_array()125 	const domExtra_Array &getExtra_array() const { return elemExtra_array; }
126 protected:
127 	/**
128 	 * Constructor
129 	 */
domLines(DAE & dae)130 	domLines(DAE& dae) : daeElement(dae), attrName(), attrCount(), attrMaterial(), elemInput_array(), elemP(), elemExtra_array() {}
131 	/**
132 	 * Destructor
133 	 */
~domLines()134 	virtual ~domLines() {}
135 	/**
136 	 * Overloaded assignment operator
137 	 */
138 	virtual domLines &operator=( const domLines &cpy ) { (void)cpy; return *this; }
139 
140 public: // STATIC METHODS
141 	/**
142 	 * Creates an instance of this class and returns a daeElementRef referencing it.
143 	 * @return a daeElementRef referencing an instance of this object.
144 	 */
145 	static DLLSPEC daeElementRef create(DAE& dae);
146 	/**
147 	 * Creates a daeMetaElement object that describes this element in the meta object reflection framework.
148 	 * If a daeMetaElement already exists it will return that instead of creating a new one.
149 	 * @return A daeMetaElement describing this COLLADA element.
150 	 */
151 	static DLLSPEC daeMetaElement* registerElement(DAE& dae);
152 };
153 
154 
155 #endif
156