Template version so the implementation is in the header file. Only static constants are assigned in the cpp file. At the moment partial specialisation is added for the types float, double and unsigned int.
|
Public Member Functions |
| Point3D () |
| The default constructor.
|
| Point3D (const T x, const T y, const T z) |
| Point3D (const Point3D &p) |
| The copy constructor.
|
| ~Point3D () |
| The default destructor.
|
T | x () const |
| Returns the x-coordinate.
|
T | y () const |
| Returns the y-coordinate.
|
T | z () const |
| Returns the z-coordinate.
|
unsigned int | id () const |
| Returns the ID.
|
bool | operator== (const Point3D< double > &p) const |
| partial specialization of equality testing for type double
|
bool | operator== (const Point3D< float > &p) const |
| partial specialization of equality testing for type float
|
bool | operator== (const Point3D< unsigned int > &p) const |
| partial specialization of equality testing for type unsigned int
|
void | setValues (const T x, const T y, const T z) |
| Sets the values of all coordinates. By default this is cartesian input.
|
void | setCartesian (const T x, const T y, const T z) |
| Sets the values of all coordinates from cartesian input.
|
void | setPolar (const T theta, const T phi, const T r) |
| Sets the values of all coordinates from spherical polar input.
|
void | setID (const unsigned int id) |
| Sets the ID.
|
void | add (const Point3D &p) |
| Adds the point p .
|
Static Public Attributes |
static const T | PI |
| The value of Pi.
|
static const T | DEGTORAD |
| A conversion factor from degrees to radians.
|
static const T | RADTODEG |
| A conversion factor from radians to degrees.
|
static const T | TOLERANCE |
| A tolerance for differences in floating point values to be still considered equal.
|
Private Attributes |
T | xCoord |
T | yCoord |
T | zCoord |
| Coordinate values.
|
unsigned int | ID |
| ID of the point.
|