• 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 __domMatrix_h__
10 #define __domMatrix_h__
11 
12 #include <dae/daeDocument.h>
13 #include <dom/domTypes.h>
14 #include <dom/domElements.h>
15 
16 class DAE;
17 
18 /**
19  * Matrix transformations embody mathematical changes to points within a coordinate
20  * systems or the  coordinate system itself. The matrix element contains a
21  * 4-by-4 matrix of floating-point values.
22  */
23 class domMatrix : public daeElement
24 {
25 public:
getElementType()26 	virtual COLLADA_TYPE::TypeEnum getElementType() const { return COLLADA_TYPE::MATRIX; }
ID()27 	static daeInt ID() { return 630; }
typeID()28 	virtual daeInt typeID() const { return ID(); }
29 protected:  // Attribute
30 /**
31  *  The sid attribute is a text string value containing the sub-identifier
32  * of this element.  This value must be unique within the scope of the parent
33  * element. Optional attribute.
34  */
35 	xsNCName attrSid;
36 
37 protected:  // Value
38 	/**
39 	 * The domFloat4x4 value of the text data of this element.
40 	 */
41 	domFloat4x4 _value;
42 
43 public:	//Accessors and Mutators
44 	/**
45 	 * Gets the sid attribute.
46 	 * @return Returns a xsNCName of the sid attribute.
47 	 */
getSid()48 	xsNCName getSid() const { return attrSid; }
49 	/**
50 	 * Sets the sid attribute.
51 	 * @param atSid The new value for the sid attribute.
52 	 */
setSid(xsNCName atSid)53 	void setSid( xsNCName atSid ) { *(daeStringRef*)&attrSid = atSid; _validAttributeArray[0] = true; }
54 
55 	/**
56 	 * Gets the _value array.
57 	 * @return Returns a domFloat4x4 reference of the _value array.
58 	 */
getValue()59 	domFloat4x4 &getValue() { return _value; }
60 	/**
61 	 * Gets the _value array.
62 	 * @return Returns a constant domFloat4x4 reference of the _value array.
63 	 */
getValue()64 	const domFloat4x4 &getValue() const { return _value; }
65 	/**
66 	 * Sets the _value array.
67 	 * @param val The new value for the _value array.
68 	 */
setValue(const domFloat4x4 & val)69 	void setValue( const domFloat4x4 &val ) { _value = val; }
70 
71 protected:
72 	/**
73 	 * Constructor
74 	 */
domMatrix(DAE & dae)75 	domMatrix(DAE& dae) : daeElement(dae), attrSid(), _value() {}
76 	/**
77 	 * Destructor
78 	 */
~domMatrix()79 	virtual ~domMatrix() {}
80 	/**
81 	 * Overloaded assignment operator
82 	 */
83 	virtual domMatrix &operator=( const domMatrix &cpy ) { (void)cpy; return *this; }
84 
85 public: // STATIC METHODS
86 	/**
87 	 * Creates an instance of this class and returns a daeElementRef referencing it.
88 	 * @return a daeElementRef referencing an instance of this object.
89 	 */
90 	static DLLSPEC daeElementRef create(DAE& dae);
91 	/**
92 	 * Creates a daeMetaElement object that describes this element in the meta object reflection framework.
93 	 * If a daeMetaElement already exists it will return that instead of creating a new one.
94 	 * @return A daeMetaElement describing this COLLADA element.
95 	 */
96 	static DLLSPEC daeMetaElement* registerElement(DAE& dae);
97 };
98 
99 
100 #endif
101