2 // Open Service Platform
3 // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
5 // Licensed under the Flora License, Version 1.0 (the License);
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
9 // http://floralicense.org/license/
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an AS IS BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
19 * @file FGrpFloatPoint3.cpp
20 * @brief This is the implementation for %FloatPoint3 class.
23 #include <FGrpFloatPoint3.h>
24 #include <FGrpFloatVector4.h>
25 #include <FBaseFloat.h>
26 #include <FBaseSysLog.h>
28 namespace Tizen { namespace Graphics
30 FloatPoint3::FloatPoint3(void)
38 FloatPoint3::FloatPoint3(const FloatPoint3& rhs)
46 FloatPoint3::FloatPoint3(const FloatVector4& vector)
49 FloatVector4 normalizedVector = vector.GetNormal();
51 x = normalizedVector.x;
52 y = normalizedVector.y;
53 z = normalizedVector.z;
56 FloatPoint3::FloatPoint3(const float point[3])
64 FloatPoint3::FloatPoint3(float x, float y, float z)
72 FloatPoint3::~FloatPoint3(void)
77 FloatPoint3::operator ==(const FloatPoint3& rhs) const
84 return (x == rhs.x && y == rhs.y && z == rhs.z);
88 FloatPoint3::operator =(const FloatPoint3& rhs)
101 FloatPoint3::operator *(float value) const
103 return FloatPoint3(x * value, y * value, z * value);
107 FloatPoint3::operator /(float value) const
109 return FloatPoint3(x / value, y / value, z / value);
113 FloatPoint3::operator +(const FloatPoint3& rhs) const
115 return FloatPoint3(x + rhs.x, y + rhs.y, z + rhs.z);
119 FloatPoint3::operator -(const FloatPoint3& rhs) const
121 return FloatPoint3(x - rhs.x, y - rhs.y, z - rhs.z);
125 FloatPoint3::operator +=(const FloatPoint3& rhs)
135 FloatPoint3::operator -=(const FloatPoint3& rhs)
145 FloatPoint3::Equals(const Tizen::Base::Object& obj) const
147 const FloatPoint3* pVector = dynamic_cast <const FloatPoint3*>(&obj);
154 return (*this == *pVector);
158 FloatPoint3::GetHashCode(void) const
160 return (Tizen::Base::Float::GetHashCode(x) +
161 Tizen::Base::Float::GetHashCode(y) +
162 Tizen::Base::Float::GetHashCode(z));
166 operator *(const float& value, const FloatPoint3& rhs)
172 operator /(const float& value, const FloatPoint3& rhs)
177 }} // Tizen::Graphics