2 // Open Service Platform
3 // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
5 // Licensed under the Apache License, Version 2.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://www.apache.org/licenses/LICENSE-2.0/
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.h
20 * @brief This is the header file for the %FloatPoint3 class.
22 * This header file contains the declarations of the %FloatPoint3 class.
26 #ifndef _FGRP_FLOAT_POINT3_H_
27 #define _FGRP_FLOAT_POINT3_H_
29 #include <FBaseObject.h>
31 namespace Tizen { namespace Graphics
36 namespace Tizen { namespace Graphics
40 * @brief This class encapsulates a 3-dimensional point.
44 * The %FloatPoint3 class provides a float precision, three-dimensional point class.
47 class _OSP_EXPORT_ FloatPoint3
48 : public Tizen::Base::Object
52 * This is the default constructor for this class. @n
53 * This constructor initializes the instance to a 3-dimensional zero point.
60 * This is the copy constructor for the %FloatPoint3 class. @n
61 * This constructor initializes the instance of %FloatPoint3 with the attributes of the specified instance of %FloatPoint3.
65 * @param[in] rhs An instance of %FloatPoint3
67 FloatPoint3(const FloatPoint3& rhs);
70 * This constructor initializes the instance of %FloatPoint3 with the attributes of the specified instance of %FloatVector4.
74 * @param[in] vector An instance of %FloatVector4
75 * @remarks The normalized vector can only be converted to point. Therefore, when the input vector is not normalized then the point is converted from the normal vector of the input instance.
77 explicit FloatPoint3(const FloatVector4& vector);
80 * This constructor initializes the instance of %FloatPoint3 with the attributes of the specified instance of the array.
84 * @param[in] point The point with 3 float values
86 explicit FloatPoint3(const float point[3]);
89 * This constructor initializes the instance of %FloatPoint3 with floating point numbers for each coordinate.
93 * @param[in] x x component of point instance
94 * @param[in] y y component of point instance
95 * @param[in] z z component of point instance
97 FloatPoint3(float x, float y, float z);
100 * This destructor overrides Tizen::Base::Object::~Object().
104 virtual ~FloatPoint3(void);
107 * Checks whether the current instance and the specified instance of %FloatPoint3 are equal.
111 * @return @c true if all members of the current point instance are equal to the corresponding point members in the specified instance, @n
113 * @param[in] rhs An instance of %FloatPoint3
115 bool operator ==(const FloatPoint3& rhs) const;
118 * Checks whether the current instance and the specified instance of %FloatPoint3 are not equal.
122 * @return @c true if all point members of the current instance are not equal to the corresponding point members in the specified instance, @n
124 * @param[in] rhs An instance of %FloatPoint3
126 inline bool operator !=(const FloatPoint3& rhs) const
128 return !(*this == rhs);
132 * Assigns the values of the specified instance to the current instance of %FloatPoint3.
136 * @return The reference to this instance
137 * @param[in] rhs An instance of %FloatPoint3
139 FloatPoint3& operator =(const FloatPoint3& rhs);
142 * Multiplies the value to each point members of current instance of %FloatPoint3.
146 * @return A new instance of %FloatPoint3 containing the resulting value of the operation
147 * @param[in] value A @c float value to multiply
149 FloatPoint3 operator *(float value) const;
152 * Divides each point members of current instance of %FloatPoint3 with the specified value.
156 * @return A new instance of %FloatPoint3 containing the resulting value of the operation
157 * @param[in] value A @c float value to divide
159 FloatPoint3 operator /(float value) const;
162 * Adds the value of the specified instance and the current instance of %FloatPoint3.
166 * @return A new instance of %FloatPoint3 containing the resulting value of the operation
167 * @param[in] rhs An instance of %FloatPoint3
169 FloatPoint3 operator +(const FloatPoint3& rhs) const;
172 * Subtracts the value of the specified instance from the current instance of %FloatPoint3.
176 * @return A new instance of %FloatPoint3 containing the resulting value of the operation
177 * @param[in] rhs An instance of %FloatPoint3
179 FloatPoint3 operator -(const FloatPoint3& rhs) const;
182 * Adds the value of the specified instance to the current instance of %FloatPoint3.
186 * @return The reference to %FloatPoint3 containing the resulting value of the operation
187 * @param[in] rhs An instance of %FloatPoint3
189 FloatPoint3& operator +=(const FloatPoint3& rhs);
192 * Subtracts the value of the specified instance from the current instance of %FloatPoint3.
196 * @return The reference to %FloatPoint3 containing the resulting value of the operation
197 * @param[in] rhs An instance of %FloatPoint3
199 FloatPoint3& operator -=(const FloatPoint3& rhs);
202 * Checks whether the current instance of %FloatPoint3 equals the specified instance of %FloatPoint3.
206 * @return @c true if the values of the current instance is equal to the value of the specified instance, @n
208 * @param[in] obj An instance of %FloatPoint3
209 * @remarks This method overrides Tizen::Base::Object::Equals(). This method uses the values of the Point components to compare the two instances.
211 virtual bool Equals(const Tizen::Base::Object& obj) const;
214 * Gets the hash value of the current instance of %FloatPoint3.
218 * @return The hash value of the current instance
219 * @remarks Two equal instances must return the same hash value. For better performance,
220 * the used hash function must generate a random distribution for all inputs.
222 virtual int GetHashCode(void) const;
225 * x component of the current instance of %FloatPoint3.
232 * y component of the current instance of %FloatPoint3.
239 * z component of the current instance of %FloatPoint3.
246 friend class _FloatPoint3Impl;
247 class _FloatPoint3Impl* __pImpl;
252 * Gets the instance of %FloatPoint3 resulting from the product of the value and the specified instance of %FloatPoint3.
256 * @return A new instance of %FloatPoint3 containing the resulting value of the operation
257 * @param[in] value A @c float value to multiply
258 * @param[in] rhs An instance of %FloatPoint3
260 _OSP_EXPORT_ FloatPoint3 operator *(const float& value, const FloatPoint3& rhs);
263 * Gets the instance of %FloatPoint3 resulting from the divide of the value and the specified instance of %FloatPoint3.
267 * @return A new instance of %FloatPoint3 containing the resulting value of the operation
268 * @param[in] value A @c float value to divide
269 * @param[in] rhs An instance of %FloatPoint3
271 _OSP_EXPORT_ FloatPoint3 operator /(const float& value, const FloatPoint3& rhs);
273 }} // Tizen::Graphics
275 #endif //_FGRP_FLOAT_POINT3_H_