2 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
4 // Licensed under the Apache License, Version 2.0 (the License);
5 // you may not use this file except in compliance with the License.
6 // You may obtain a copy of the License at
8 // http://www.apache.org/licenses/LICENSE-2.0
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
17 #ifndef HERE_GRAPHIC_FLOATPOINT_H
18 #define HERE_GRAPHIC_FLOATPOINT_H
20 #include "common/HereMaps_global.h"
21 #include "base/BaseObject.h"
23 TIZEN_MAPS_BEGIN_NAMESPACE
27 class EXPORT_API FloatPoint : public Object
31 * This is the default constructor for this class. @n
32 * This constructor initializes an instance of %FloatPoint with the values (0.f, 0.f).
39 * This is the copy constructor for the %FloatPoint class.
43 * @param[in] rhs An instance of %FloatPoint
45 FloatPoint(const FloatPoint& rhs);
48 * Initializes an instance of %FloatPoint with the specified location.
52 * @param[in] x The x-coordinate
53 * @param[in] y The y-coordinate
55 FloatPoint(float x, float y);
58 * This is the destructor for this class.
62 virtual ~FloatPoint(void);
65 * This is the default assignment operator for this class.
69 * @param[in] rhs An instance of %FloatPoint
71 FloatPoint& operator=(const FloatPoint& rhs);
74 * Checks whether the current instance and the specified instance of %FloatPoint are equal.
78 * @return @c true if the two instances of %FloatPoint are at the same location, @n
80 * @param[in] rhs An instance of %FloatPoint
82 bool operator==(const FloatPoint& rhs) const;
85 * Checks whether the current instance and the specified instance of %FloatPoint are not equal.
89 * @return @c true if the two instances of %FloatPoint are at different locations, @n
91 * @param[in] rhs An instance of %FloatPoint
93 bool operator!=(const FloatPoint& rhs) const;
96 * Adds the value of the specified instance of %FloatPoint and the current instance.
100 * @return A new instance of %FloatPoint containing the resulting value of the operation
101 * @param[in] rhs An instance of %FloatPoint
103 FloatPoint operator+(const FloatPoint& rhs) const;
106 * Subtracts the value of the specified instance of %FloatPoint from the current instance.
110 * @return A new instance of %FloatPoint containing the resulting value of the operation
111 * @param[in] rhs An instance of %FloatPoint
113 FloatPoint operator-(const FloatPoint& rhs) const;
116 * Adds the value of the specified instance of %FloatPoint to the current instance.
120 * @param[in] point An instance of %FloatPoint
122 FloatPoint& operator+=(const FloatPoint& point);
125 * Subtracts the value of the specified instance of %FloatPoint from the current instance.
129 * @param[in] point An instance of %FloatPoint
131 FloatPoint& operator-=(const FloatPoint& point);
134 * Checks whether the value of the specified instance of %FloatPoint equals the value of the current instance.
138 * @return @c true if the value of the specified instance equals the value of the current instance, @n
140 * @param[in] rhs An instance of %FloatPoint
141 * @remarks The %FloatPoint class has a semantic value, which means that the
142 * Equals() method checks whether the two instances have the same
145 virtual bool Equals(const Object& rhs) const;
148 * Gets the hash value of the current instance.
152 * @return The hash value of the current instance
153 * @remarks Two equal instances must return the same hash value. @n For better performance,
154 * the used hash function must generate a random distribution for all inputs.
156 virtual long GetHashCode(void) const;
159 * Sets the x and y coordinates for the current instance of %FloatPoint.
163 * @param[in] x The new x-coordinate
164 * @param[in] y The new y-coordinate
166 void SetPosition(float x, float y);
169 * Sets the current instance of %FloatPoint.
173 * @param[in] point An instance of %FloatPoint
175 void SetPosition(const FloatPoint& point);
178 * Translates this %FloatPoint to the indicated distance.
182 * @param[in] deltaX The distance to move this point along the x-axis
183 * @param[in] deltaY The distance to move this point along the y-axis
185 void Translate(float deltaX, float deltaY);
189 * The x-coordinate of the point.
196 * The y-coordinate of the point.
203 friend class _FloatPointImpl;
206 // This variable is for internal use only.
207 // Using this variable can cause behavioral, security-related, and consistency-related issues in the application.
211 class _FloatPointImpl* __pImpl;
215 TIZEN_MAPS_END_NAMESPACE
217 #endif /* HERE_GRAPHIC_FLOATPOINT_H */