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.
20 * @brief This is the implementation file for Point class.
22 * This file contains implementation of Point class.
26 #include <FGrpPoint.h>
29 namespace Tizen { namespace Graphics
39 Point::Point(const Point & rhs)
46 Point::Point(int x_, int y_)
58 Point::operator =(const Point & rhs)
73 Point::operator ==(const Point& rhs) const
75 return ((this->x == rhs.x && this->y == rhs.y) ? true : false);
79 Point::operator !=(const Point& rhs) const
81 return (!operator ==(rhs));
85 Point::operator +(const Point& rhs) const
89 point.x = this->x + rhs.x;
90 point.y = this->y + rhs.y;
96 Point::operator -(const Point& rhs) const
100 point.x = this->x - rhs.x;
101 point.y = this->y - rhs.y;
107 Point::operator +=(const Point& point)
116 Point::operator -=(const Point& point)
125 Point::Equals(const Object& rhs) const
127 const Point* pPoint = dynamic_cast <const Point*>(&rhs);
134 return (*this == *pPoint);
138 Point::GetHashCode(void) const
142 bits ^= this->y * 31;
144 return (((int) bits) ^ ((int) (bits >> 16)));
148 Point::SetPosition(int x, int y)
155 Point::SetPosition(const Point& point)
162 Point::Translate(int x, int y)
168 }} // Tizen::Graphics