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 __domPlane_h__ 10#define __domPlane_h__ 11 12#include <dae/daeDocument.h> 13#include <dom/domTypes.h> 14#include <dom/domElements.h> 15 16#include <dom/domExtra.h> 17class DAE; 18 19/** 20 * An infinite plane primitive. 21 */ 22class domPlane : public daeElement 23{ 24public: 25 virtual COLLADA_TYPE::TypeEnum getElementType() const { return COLLADA_TYPE::PLANE; } 26 static daeInt ID() { return 769; } 27 virtual daeInt typeID() const { return ID(); } 28public: 29 class domEquation; 30 31 typedef daeSmartRef<domEquation> domEquationRef; 32 typedef daeTArray<domEquationRef> domEquation_Array; 33 34/** 35 * 4 float values that represent the coefficients for the plane’s equation: 36 * Ax + By + Cz + D = 0 37 */ 38 class domEquation : public daeElement 39 { 40 public: 41 virtual COLLADA_TYPE::TypeEnum getElementType() const { return COLLADA_TYPE::EQUATION; } 42 static daeInt ID() { return 770; } 43 virtual daeInt typeID() const { return ID(); } 44 45 protected: // Value 46 /** 47 * The domFloat4 value of the text data of this element. 48 */ 49 domFloat4 _value; 50 51 public: //Accessors and Mutators 52 /** 53 * Gets the _value array. 54 * @return Returns a domFloat4 reference of the _value array. 55 */ 56 domFloat4 &getValue() { return _value; } 57 /** 58 * Gets the _value array. 59 * @return Returns a constant domFloat4 reference of the _value array. 60 */ 61 const domFloat4 &getValue() const { return _value; } 62 /** 63 * Sets the _value array. 64 * @param val The new value for the _value array. 65 */ 66 void setValue( const domFloat4 &val ) { _value = val; } 67 68 protected: 69 /** 70 * Constructor 71 */ 72 domEquation(DAE& dae) : daeElement(dae), _value() {} 73 /** 74 * Destructor 75 */ 76 virtual ~domEquation() {} 77 /** 78 * Overloaded assignment operator 79 */ 80 virtual domEquation &operator=( const domEquation &cpy ) { (void)cpy; return *this; } 81 82 public: // STATIC METHODS 83 /** 84 * Creates an instance of this class and returns a daeElementRef referencing it. 85 * @return a daeElementRef referencing an instance of this object. 86 */ 87 static DLLSPEC daeElementRef create(DAE& dae); 88 /** 89 * Creates a daeMetaElement object that describes this element in the meta object reflection framework. 90 * If a daeMetaElement already exists it will return that instead of creating a new one. 91 * @return A daeMetaElement describing this COLLADA element. 92 */ 93 static DLLSPEC daeMetaElement* registerElement(DAE& dae); 94 }; 95 96 97 98protected: // Elements 99/** 100 * 4 float values that represent the coefficients for the plane’s equation: 101 * Ax + By + Cz + D = 0 @see domEquation 102 */ 103 domEquationRef elemEquation; 104/** 105 * The extra element may appear any number of times. @see domExtra 106 */ 107 domExtra_Array elemExtra_array; 108 109public: //Accessors and Mutators 110 /** 111 * Gets the equation element. 112 * @return a daeSmartRef to the equation element. 113 */ 114 const domEquationRef getEquation() const { return elemEquation; } 115 /** 116 * Gets the extra element array. 117 * @return Returns a reference to the array of extra elements. 118 */ 119 domExtra_Array &getExtra_array() { return elemExtra_array; } 120 /** 121 * Gets the extra element array. 122 * @return Returns a constant reference to the array of extra elements. 123 */ 124 const domExtra_Array &getExtra_array() const { return elemExtra_array; } 125protected: 126 /** 127 * Constructor 128 */ 129 domPlane(DAE& dae) : daeElement(dae), elemEquation(), elemExtra_array() {} 130 /** 131 * Destructor 132 */ 133 virtual ~domPlane() {} 134 /** 135 * Overloaded assignment operator 136 */ 137 virtual domPlane &operator=( const domPlane &cpy ) { (void)cpy; return *this; } 138 139public: // STATIC METHODS 140 /** 141 * Creates an instance of this class and returns a daeElementRef referencing it. 142 * @return a daeElementRef referencing an instance of this object. 143 */ 144 static DLLSPEC daeElementRef create(DAE& dae); 145 /** 146 * Creates a daeMetaElement object that describes this element in the meta object reflection framework. 147 * If a daeMetaElement already exists it will return that instead of creating a new one. 148 * @return A daeMetaElement describing this COLLADA element. 149 */ 150 static DLLSPEC daeMetaElement* registerElement(DAE& dae); 151}; 152 153 154#endif 155