#include <rect.h>
Public Member Functions | |
constexpr | PointBase (T x1, T y1) |
bool | operator== (const ConcretePoint &p) const |
bool | operator!= (const ConcretePoint &p) const |
ConcretePoint | operator+ (const ConcretePoint &delta) const |
ConcretePoint | operator- (const ConcretePoint &delta) const |
ConcretePoint | operator/ (int divisor) const |
ConcretePoint | operator* (int multiplier) const |
ConcretePoint | operator/ (double divisor) const |
ConcretePoint | operator* (double multiplier) const |
void | operator+= (const ConcretePoint &delta) |
void | operator-= (const ConcretePoint &delta) |
uint | sqrDist (const ConcretePoint &p) const |
String | toString () const |
Public Attributes | |
T | x |
T | y |
Simple class for handling both 2D position and size.
|
inline |
Create a point with position defined by x1
and y1
.
|
inline |
Determine whether the position of two points is the same.
|
inline |
Determine whether the position of two points is not the same.
|
inline |
Create a point by adding the delta
value to a point.
|
inline |
Create a point by subtracting the delta
value from a point.
|
inline |
Create a point by dividing a point by the (int) divisor
value.
|
inline |
Create a point by multiplying a point by the (int) multiplier
value.
|
inline |
Create a point by dividing a point by the (double) divisor
value.
|
inline |
Create a point by multiplying a point by the (double) multiplier
value.
|
inline |
Change a point's position by adding delta
to its x and y coordinates.
|
inline |
Change a point's position by subtracting delta
from its x and y arguments.
|
inline |
Return the square of the distance between this point and the point p
.
p | The other point. |
p
.
|
inline |
Return string representation of the point.
T Common::PointBase< T, ConcretePoint >::x |
The horizontal position of the point.
T Common::PointBase< T, ConcretePoint >::y |
The vertical position of the point.