bpp-core3
3.0.0
|
#include <Bpp/Graphics/Point2D.h>
Public Member Functions | |
Point2D (const T x=0, const T y=0) | |
Build a new Point2D from two values. More... | |
virtual | ~Point2D () |
Destroy the Point2D object. More... | |
Point2D< T > * | clone () const |
Implement the Clonable interface. More... | |
void | setCoord (const T x, const T y) |
Set the two values. More... | |
void | setX (const T x) |
Set only the longitude. More... | |
void | setY (const T y) |
Set only the latitude. More... | |
const T & | getX () const |
Get the longitude. More... | |
const T & | getY () const |
Get the latitude. More... | |
bool | hasSameCoordsAs (const Point2D< T > &coord) const |
Compares two Point2D objets. More... | |
virtual bool | operator== (const Point2D< T > &coord) const |
The == operator. More... | |
virtual bool | operator!= (const Point2D< T > &coord) const |
The != operator. More... | |
Private Attributes | |
T | x_ |
T | y_ |
The Point2D class.
This is a simple class designed to store the coordinates of a point. The type of the two coordinates is defined as a template.
|
inline |
Build a new Point2D from two values.
The two values are set to 0 if no parametre is given to the constructor.
x | The longitude or abscissa. |
y | The latitude or ordinate. |
Definition at line 39 of file Point2D.h.
Referenced by bpp::Point2D< T >::clone().
|
inlinevirtual |
|
inlinevirtual |
Implement the Clonable interface.
Implements bpp::Clonable.
Definition at line 52 of file Point2D.h.
References bpp::Point2D< T >::Point2D(), and bpp::Point2D< T >::setCoord().
|
inline |
Get the longitude.
Definition at line 72 of file Point2D.h.
References bpp::Point2D< T >::x_.
Referenced by bpp::CoordsTools::getDistanceBetween().
|
inline |
Get the latitude.
Definition at line 77 of file Point2D.h.
References bpp::Point2D< T >::y_.
Referenced by bpp::CoordsTools::getDistanceBetween().
|
inline |
Compares two Point2D objets.
Return true if the coordinates of the 2 Point2D are equals.
Definition at line 84 of file Point2D.h.
References bpp::Point2D< T >::x_, and bpp::Point2D< T >::y_.
Referenced by bpp::Point2D< T >::operator!=(), and bpp::Point2D< T >::operator==().
|
inlinevirtual |
The != operator.
Definition at line 103 of file Point2D.h.
References bpp::Point2D< T >::hasSameCoordsAs().
|
inlinevirtual |
The == operator.
Return true if the coordinates of the 2 Point2Ds are equals. Does the same as the asSameCoords() methode.
Definition at line 95 of file Point2D.h.
References bpp::Point2D< T >::hasSameCoordsAs().
void bpp::Point2D< T >::setCoord | ( | const T | x, |
const T | y | ||
) |
Set the two values.
Referenced by bpp::Point2D< T >::clone().
|
inline |
|
inline |
|
private |
Definition at line 25 of file Point2D.h.
Referenced by bpp::Point2D< T >::getX(), and bpp::Point2D< T >::hasSameCoordsAs().
|
private |
Definition at line 26 of file Point2D.h.
Referenced by bpp::Point2D< T >::getY(), and bpp::Point2D< T >::hasSameCoordsAs().