Point Class Template Reference
[Utilities]
#include <Point.h>
Detailed Description
template<class T_>
class OFELI::Point< T_ >
Defines a point with arbitrary type coordinates.
Operators = and () are overloaded. The actual
Template Argument :
- T_ data type (double, float, ...)
Public Member Functions | |
| Point< double > | Director (const Point< double > &p) const |
| Return Director (Normalized vector). | |
| bool | isCloseTo (const Point< 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. | |
| void | Normalize () |
| Normalize vector. | |
| bool | operator!= (const Point< T_ > &p) |
| Operator !=. | |
| const T_ & | operator() (size_t i) const |
| Operator() : Constant version. | |
| T_ & | operator() (size_t i) |
| Operator() : Non constant version. | |
| Point< T_ > & | operator*= (const T_ &a) |
| Operator *=. | |
| Point< T_ > & | operator+= (const T_ &a) |
| Operator +=. | |
| Point< T_ > & | operator+= (const Point< T_ > &p) |
| Operator +=. | |
| Point< T_ > & | operator-= (const T_ &a) |
| Operator -=. | |
| Point< T_ > & | operator-= (const Point< T_ > &p) |
| Operator -=. | |
| Point< T_ > & | operator/= (const T_ &a) |
| Operator /=. | |
| Point< T_ > & | operator= (const T_ &a) |
| Operator =. | |
| Point< T_ > & | operator= (const Point< T_ > &p) |
| Operator =. | |
| bool | operator== (const Point< T_ > &p) |
| Operator ==. | |
| const T_ & | operator[] (size_t i) const |
| Operator[] : Constant version. | |
| T_ & | operator[] (size_t i) |
| Operator[] : Non constant version. | |
| Point (const Point< T_ > &pt) | |
| Copy constructor. | |
| Point (T_ *a) | |
| Initialize point coordinates with C-array a. | |
| Point (T_ a, T_ b=T_(0), T_ c=T_(0)) | |
| Constructor that assigns a, b, to x-, y- and z-coordinates respectively. | |
| Point () | |
| Default constructor. | |
Public Attributes | |
| T_ | x |
| First coordinate of point. | |
| T_ | y |
| Second coordinate of point. | |
| T_ | z |
| Third coordinate of point. | |
Constructor & Destructor Documentation
| Point | ( | T_ | a, | |
| T_ | b = T_(0), |
|||
| T_ | c = T_(0) | |||
| ) |
Constructor that assigns a, b, to x-, y- and z-coordinates respectively.
Default values for b and c are 0
Member Function Documentation
| void Normalize | ( | ) |
Normalize vector.
Divide vector components by its 2-norm
| bool operator!= | ( | const Point< T_ > & | p | ) |
Operator !=.
Return false if current instance is equal to p, true otherwise.
| const T_& operator() | ( | size_t | i | ) | const |
Operator() : Constant version.
Values i = 1, 2, 3 correspond to x, y and z respectively
| T_& operator() | ( | size_t | i | ) |
Operator() : Non constant version.
Values i = 1, 2, 3 correspond to x, y and z respectively
| Point<T_>& operator*= | ( | const T_ & | a | ) |
Operator *=.
Multiply constant by current instance coordinates
| Point<T_>& operator+= | ( | const T_ & | a | ) |
Operator +=.
Add constant a to current instance coordinates
| Point<T_>& operator-= | ( | const T_ & | a | ) |
Operator -=.
Subtract constant from current instance coordinates
| Point<T_>& operator/= | ( | const T_ & | a | ) |
Operator /=.
Divide current instance coordinates by a
| Point<T_>& operator= | ( | const T_ & | a | ) |
Operator =.
Assign constant a to current instance coordinates
| bool operator== | ( | const Point< T_ > & | p | ) |
Operator ==.
Return true if current instance is equal to p, false otherwise.
| const T_& operator[] | ( | size_t | i | ) | const |
Operator[] : Constant version.
Values i = 0, 1, 2 correspond to x, y and z respectively
| T_& operator[] | ( | size_t | i | ) |
Operator[] : Non constant version.
Values i = 0, 1, 2 correspond to x, y and z respectively