Changeset 1502 for code/trunk/src/util/MultiTypeMath.h
- Timestamp:
- Jun 1, 2008, 3:54:20 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk/src/util/MultiTypeMath.h
r1064 r1502 63 63 inline MultiTypeMath(const orxonox::Vector2& value) { this->setValue(value); } 64 64 inline MultiTypeMath(const orxonox::Vector3& value) { this->setValue(value); } 65 inline MultiTypeMath(const orxonox::Vector4& value) { this->setValue(value); } 65 66 inline MultiTypeMath(const orxonox::ColourValue& value) { this->setValue(value); } 66 67 inline MultiTypeMath(const orxonox::Quaternion& value) { this->setValue(value); } … … 68 69 inline MultiTypeMath(const orxonox::Degree& value) { this->setValue(value); } 69 70 inline MultiTypeMath(const MultiTypeMath& mtm) { this->setValue(mtm); } 71 inline MultiTypeMath(const MultiTypeString& mts) { this->setValue(mts); } 72 inline MultiTypeMath(const MultiTypePrimitive& mtp) { this->setValue(mtp); } 70 73 virtual inline ~MultiTypeMath() {} 71 74 … … 73 76 inline MultiTypeMath& operator=(const orxonox::Vector2& value) { this->setValue(value); return *this; } 74 77 inline MultiTypeMath& operator=(const orxonox::Vector3& value) { this->setValue(value); return *this; } 78 inline MultiTypeMath& operator=(const orxonox::Vector4& value) { this->setValue(value); return *this; } 75 79 inline MultiTypeMath& operator=(const orxonox::ColourValue& value) { this->setValue(value); return *this; } 76 80 inline MultiTypeMath& operator=(const orxonox::Quaternion& value) { this->setValue(value); return *this; } … … 78 82 inline MultiTypeMath& operator=(const orxonox::Degree& value) { this->setValue(value); return *this; } 79 83 inline MultiTypeMath& operator=(const MultiTypeMath& mtm) { this->setValue(mtm); return *this; } 84 inline MultiTypeMath& operator=(const MultiTypeString& mts) { this->setValue(mts); return *this; } 85 inline MultiTypeMath& operator=(const MultiTypePrimitive mtp) { this->setValue(mtp); return *this; } 80 86 81 87 using MultiTypeString::operator==; 82 88 inline bool operator==(const orxonox::Vector2& value) const { return (this->vector2_ == value); } 83 89 inline bool operator==(const orxonox::Vector3& value) const { return (this->vector3_ == value); } 90 inline bool operator==(const orxonox::Vector4& value) const { return (this->vector4_ == value); } 84 91 inline bool operator==(const orxonox::ColourValue& value) const { return (this->colourvalue_ == value); } 85 92 inline bool operator==(const orxonox::Quaternion& value) const { return (this->quaternion_ == value); } … … 87 94 inline bool operator==(const orxonox::Degree& value) const { return (this->degree_ == value); } 88 95 bool operator==(const MultiTypeMath& mtm) const; 96 bool operator==(const MultiTypeString& mts) const; 97 bool operator==(const MultiTypePrimitive& mtp) const; 89 98 90 99 using MultiTypeString::operator!=; 91 100 inline bool operator!=(const orxonox::Vector2& value) const { return (this->vector2_ != value); } 92 101 inline bool operator!=(const orxonox::Vector3& value) const { return (this->vector3_ != value); } 102 inline bool operator!=(const orxonox::Vector4& value) const { return (this->vector4_ != value); } 93 103 inline bool operator!=(const orxonox::ColourValue& value) const { return (this->colourvalue_ != value); } 94 104 inline bool operator!=(const orxonox::Quaternion& value) const { return (this->quaternion_ != value); } … … 96 106 inline bool operator!=(const orxonox::Degree& value) const { return (this->degree_ != value); } 97 107 bool operator!=(const MultiTypeMath& mtm) const; 108 bool operator!=(const MultiTypeString& mts) const; 109 bool operator!=(const MultiTypePrimitive& mtp) const; 98 110 99 111 virtual operator void*() const; … … 114 126 virtual operator orxonox::Vector2() const; 115 127 virtual operator orxonox::Vector3() const; 128 virtual operator orxonox::Vector4() const; 116 129 virtual operator orxonox::ColourValue() const; 117 130 virtual operator orxonox::Quaternion() const; … … 122 135 inline void setValue(const orxonox::Vector2& value) { this->type_ = MT_vector2; this->vector2_ = value; } 123 136 inline void setValue(const orxonox::Vector3& value) { this->type_ = MT_vector3; this->vector3_ = value; } 137 inline void setValue(const orxonox::Vector4& value) { this->type_ = MT_vector4; this->vector4_ = value; } 124 138 inline void setValue(const orxonox::ColourValue& value) { this->type_ = MT_colourvalue; this->colourvalue_ = value; } 125 139 inline void setValue(const orxonox::Quaternion& value) { this->type_ = MT_quaternion; this->quaternion_ = value; } … … 127 141 inline void setValue(const orxonox::Degree& value) { this->type_ = MT_degree; this->degree_ = value; } 128 142 void setValue(const MultiTypeMath& mtm); 143 void setValue(const MultiTypeString& mts); 144 void setValue(const MultiTypePrimitive& mtp); 129 145 130 146 inline orxonox::Vector2 getVector2() const { return this->vector2_; } 131 147 inline orxonox::Vector3 getVector3() const { return this->vector3_; } 148 inline orxonox::Vector4 getVector4() const { return this->vector4_; } 132 149 inline orxonox::ColourValue getColourValue() const { return this->colourvalue_; } 133 150 inline orxonox::Quaternion getQuaternion() const { return this->quaternion_; } … … 137 154 inline orxonox::Vector2& getVector2() { return this->vector2_; } 138 155 inline orxonox::Vector3& getVector3() { return this->vector3_; } 156 inline orxonox::Vector4& getVector4() { return this->vector4_; } 139 157 inline orxonox::ColourValue& getColourValue() { return this->colourvalue_; } 140 158 inline orxonox::Quaternion& getQuaternion() { return this->quaternion_; } … … 145 163 inline void getValue(orxonox::Vector2* variable) const { (*variable) = orxonox::Vector2 (this->vector2_); } 146 164 inline void getValue(orxonox::Vector3* variable) const { (*variable) = orxonox::Vector3 (this->vector3_); } 165 inline void getValue(orxonox::Vector4* variable) const { (*variable) = orxonox::Vector4 (this->vector4_); } 147 166 inline void getValue(orxonox::ColourValue* variable) const { (*variable) = orxonox::ColourValue (this->colourvalue_); } 148 167 inline void getValue(orxonox::Quaternion* variable) const { (*variable) = orxonox::Quaternion (this->quaternion_); } … … 155 174 virtual bool fromString(const std::string value); 156 175 176 virtual bool assimilate(const MultiTypeMath& mtm, const MultiTypeMath& defvalue = MultiTypeMath()); 177 157 178 protected: 158 179 orxonox::Vector2 vector2_; 159 180 orxonox::Vector3 vector3_; 181 orxonox::Vector4 vector4_; 160 182 orxonox::ColourValue colourvalue_; 161 183 orxonox::Quaternion quaternion_;
Note: See TracChangeset
for help on using the changeset viewer.