|
bpp-core
2.2.0
|
#include <Bpp/Graphics/Point2D.h>
Inheritance diagram for bpp::Point2D< T >:
Collaboration diagram for bpp::Point2D< T >: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 73 of file Point2D.h.
Referenced by bpp::Point2D< T >::clone().
|
inlinevirtual |
|
inlinevirtual |
Implement the Clonable interface.
Implements bpp::Clonable.
Definition at line 85 of file Point2D.h.
References bpp::Point2D< T >::Point2D().
|
inline |
Get the longitude.
Definition at line 105 of file Point2D.h.
References bpp::Point2D< T >::x_.
Referenced by bpp::CoordsTools::getDistanceBetween().
|
inline |
Get the latitude.
Definition at line 110 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 117 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 136 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 128 of file Point2D.h.
References bpp::Point2D< T >::hasSameCoordsAs().
| void bpp::Point2D< T >::setCoord | ( | const T | x, |
| const T | y | ||
| ) |
Set the two values.
|
inline |
|
inline |
|
private |
Definition at line 60 of file Point2D.h.
Referenced by bpp::Point2D< T >::getX(), bpp::Point2D< T >::hasSameCoordsAs(), and bpp::Point2D< T >::setX().
|
private |
Definition at line 61 of file Point2D.h.
Referenced by bpp::Point2D< T >::getY(), bpp::Point2D< T >::hasSameCoordsAs(), and bpp::Point2D< T >::setY().