• 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 __domSampler_h__
10 #define __domSampler_h__
11 
12 #include <dae/daeDocument.h>
13 #include <dom/domTypes.h>
14 #include <dom/domElements.h>
15 
16 #include <dom/domInputLocal.h>
17 class DAE;
18 
19 /**
20  * The sampler element declares an N-dimensional function used for animation.
21  * Animation function curves  are represented by 1-D sampler elements in COLLADA.
22  * The sampler defines sampling points and how to  interpolate between them.
23  */
24 class domSampler : public daeElement
25 {
26 public:
getElementType()27 	virtual COLLADA_TYPE::TypeEnum getElementType() const { return COLLADA_TYPE::SAMPLER; }
ID()28 	static daeInt ID() { return 654; }
typeID()29 	virtual daeInt typeID() const { return ID(); }
30 protected:  // Attribute
31 /**
32  *  The id attribute is a text string containing the unique identifier of
33  * this element. This value  must be unique within the instance document.
34  * Optional attribute.
35  */
36 	xsID attrId;
37 
38 protected:  // Element
39 /**
40  * The input element must occur at least one time. These inputs are local
41  * inputs. @see domInput
42  */
43 	domInputLocal_Array elemInput_array;
44 
45 public:	//Accessors and Mutators
46 	/**
47 	 * Gets the id attribute.
48 	 * @return Returns a xsID of the id attribute.
49 	 */
getId()50 	xsID getId() const { return attrId; }
51 	/**
52 	 * Sets the id attribute.
53 	 * @param atId The new value for the id attribute.
54 	 */
setId(xsID atId)55 	void setId( xsID atId ) { *(daeStringRef*)&attrId = atId; _validAttributeArray[0] = true;
56 		if( _document != NULL ) _document->changeElementID( this, attrId );
57 	}
58 
59 	/**
60 	 * Gets the input element array.
61 	 * @return Returns a reference to the array of input elements.
62 	 */
getInput_array()63 	domInputLocal_Array &getInput_array() { return elemInput_array; }
64 	/**
65 	 * Gets the input element array.
66 	 * @return Returns a constant reference to the array of input elements.
67 	 */
getInput_array()68 	const domInputLocal_Array &getInput_array() const { return elemInput_array; }
69 protected:
70 	/**
71 	 * Constructor
72 	 */
domSampler(DAE & dae)73 	domSampler(DAE& dae) : daeElement(dae), attrId(), elemInput_array() {}
74 	/**
75 	 * Destructor
76 	 */
~domSampler()77 	virtual ~domSampler() {}
78 	/**
79 	 * Overloaded assignment operator
80 	 */
81 	virtual domSampler &operator=( const domSampler &cpy ) { (void)cpy; return *this; }
82 
83 public: // STATIC METHODS
84 	/**
85 	 * Creates an instance of this class and returns a daeElementRef referencing it.
86 	 * @return a daeElementRef referencing an instance of this object.
87 	 */
88 	static DLLSPEC daeElementRef create(DAE& dae);
89 	/**
90 	 * Creates a daeMetaElement object that describes this element in the meta object reflection framework.
91 	 * If a daeMetaElement already exists it will return that instead of creating a new one.
92 	 * @return A daeMetaElement describing this COLLADA element.
93 	 */
94 	static DLLSPEC daeMetaElement* registerElement(DAE& dae);
95 };
96 
97 
98 #endif
99