Point2D Class Template Reference
[Utilities]
#include <Point2D.h>
Detailed Description
template<class T_>
class OFELI::Point2D< T_ >
Defines a 2-D point with arbitrary type coordinates.
Operators = and () are overloaded. The actual
Template Argument :
- T_ data type (double, float, ...)
Public Member Functions | |
| double | CrossProduct (const Point2D< double > &lp, const Point2D< double > &rp) |
| Return Cross product of two vectors lp and rp. | |
| Point2D< double > | Director (const Point2D< double > &p) const |
| Return Director (Normalized vector). | |
| bool | isCloseTo (const Point2D< double > &a, double toler=OFELI_TOLERANCE) const |
| Return true if current point is close to instance a (up to tolerance toler). | |
| double | NNorm () const |
| Return squared norm (length) of vector. | |
| double | Norm () const |
| Return norm (length) of vector. | |
| bool | operator!= (const Point2D< T_ > &p) |
| Operator !=. | |
| const T_ & | operator() (size_t i) const |
| Operator() : Constant version. | |
| T_ & | operator() (size_t i) |
| Operator() : Non constant version. | |
| Point2D< T_ > & | operator*= (const T_ &a) |
| Operator *=. | |
| Point2D< T_ > & | operator+= (const T_ &a) |
| Operator +=. | |
| Point2D< T_ > & | operator+= (const Point2D< T_ > &p) |
| Operator +=. | |
| Point2D< T_ > & | operator-= (const T_ &a) |
| Operator -=. | |
| Point2D< T_ > & | operator-= (const Point2D< T_ > &p) |
| Operator -=. | |
| Point2D< T_ > & | operator/= (const T_ &a) |
| Operator /=. | |
| Point2D< T_ > & | operator= (const T_ &a) |
| Operator =. | |
| Point2D< T_ > & | operator= (const Point2D< T_ > &p) |
| Operator =. | |
| bool | operator== (const Point2D< T_ > &p) |
| Operator ==. | |
| const T_ & | operator[] (size_t i) const |
| Operator[] : Constant version. | |
| T_ & | operator[] (size_t i) |
| Operator[] : Non constant version. | |
| Point2D (const Point< T_ > &pt) | |
| Copy constructor from class Point. | |
| Point2D (const Point2D< T_ > &pt) | |
| Copy constructor. | |
| Point2D (T_ *a) | |
| Initialize point coordinates with C-array a. | |
| Point2D (T_ a, T_ b=T_(0)) | |
| Constructor that assigns a, b to x-, y- and y-coordinates respectively. | |
| Point2D () | |
| Default constructor. | |
Public Attributes | |
| T_ | x |
| First coordinate of point. | |
| T_ | y |
| Second coordinate of point. | |
Constructor & Destructor Documentation
| Point2D | ( | T_ | a, | |
| T_ | b = T_(0) | |||
| ) |
Constructor that assigns a, b to x-, y- and y-coordinates respectively.
Default value for b is 0
References Point2D::x, and Point2D::y.
Member Function Documentation
| bool operator!= | ( | const Point2D< T_ > & | p | ) |
Operator !=.
Return false if current instance is equal to p, true otherwise.
References Point2D::x, and Point2D::y.
| const T_& operator() | ( | size_t | i | ) | const |
Operator() : Constant version.
Values i = 1, 2 correspond to x and y respectively
References Point2D::x, and Point2D::y.
| T_& operator() | ( | size_t | i | ) |
Operator() : Non constant version.
Values i = 1, 2 correspond to x and y respectively
References Point2D::x, and Point2D::y.
| Point2D<T_>& operator*= | ( | const T_ & | a | ) |
Operator *=.
Multiply constant by current instance coordinates
References Point2D::x, and Point2D::y.
| Point2D<T_>& operator+= | ( | const T_ & | a | ) |
| Point2D<T_>& operator-= | ( | const T_ & | a | ) |
Operator -=.
Subtract constant from current instance coordinates
References Point2D::x, and Point2D::y.
| Point2D<T_>& operator/= | ( | const T_ & | a | ) |
| Point2D<T_>& operator= | ( | const T_ & | a | ) |
Operator =.
Assign constant a to current instance coordinates
References Point2D::x, and Point2D::y.
| bool operator== | ( | const Point2D< T_ > & | p | ) |
Operator ==.
Return true if current instance is equal to p, false otherwise.
References Point2D::x, and Point2D::y.
| const T_& operator[] | ( | size_t | i | ) | const |
Operator[] : Constant version.
Values i = 0, 1 correspond to x and y respectively
References Point2D::x, and Point2D::y.
| T_& operator[] | ( | size_t | i | ) |
Operator[] : Non constant version.
Values i = 0, 1 correspond to x and y respectively
References Point2D::x, and Point2D::y.