Point3D< T > Class Template Reference

#include <point3d.h>

List of all members.


Detailed Description

template<class T>
class Point3D< T >

This class represents a 3D point.

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.

Definition at line 39 of file point3d.h.

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.
x () const
 Returns the x-coordinate.
y () const
 Returns the y-coordinate.
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

xCoord
yCoord
zCoord
 Coordinate values.
unsigned int ID
 ID of the point.


Constructor & Destructor Documentation

template<class T>
Point3D< T >::Point3D  ) 
 

The default constructor.

Definition at line 97 of file point3d.h.

template<class T>
Point3D< T >::Point3D const T  x,
const T  y,
const T  z
 

Definition at line 104 of file point3d.h.

template<class T>
Point3D< T >::Point3D const Point3D< T > &  p  ) 
 

The copy constructor.

Definition at line 111 of file point3d.h.

template<class T>
Point3D< T >::~Point3D  ) 
 

The default destructor.

Definition at line 121 of file point3d.h.


Member Function Documentation

template<class T>
T Point3D< T >::x  )  const
 

Returns the x-coordinate.

Definition at line 128 of file point3d.h.

template<class T>
T Point3D< T >::y  )  const
 

Returns the y-coordinate.

Definition at line 135 of file point3d.h.

template<class T>
T Point3D< T >::z  )  const
 

Returns the z-coordinate.

Definition at line 142 of file point3d.h.

template<class T>
unsigned int Point3D< T >::id  )  const
 

Returns the ID.

Definition at line 149 of file point3d.h.

template<class T>
bool Point3D< T >::operator== const Point3D< double > &  p  )  const [inline]
 

partial specialization of equality testing for type double

Definition at line 52 of file point3d.h.

template<class T>
bool Point3D< T >::operator== const Point3D< float > &  p  )  const [inline]
 

partial specialization of equality testing for type float

Definition at line 59 of file point3d.h.

template<class T>
bool Point3D< T >::operator== const Point3D< unsigned int > &  p  )  const [inline]
 

partial specialization of equality testing for type unsigned int

Definition at line 66 of file point3d.h.

template<class T>
void Point3D< T >::setValues const T  x,
const T  y,
const T  z
 

Sets the values of all coordinates. By default this is cartesian input.

Definition at line 156 of file point3d.h.

template<class T>
void Point3D< T >::setCartesian const T  x,
const T  y,
const T  z
 

Sets the values of all coordinates from cartesian input.

Definition at line 165 of file point3d.h.

template<class T>
void Point3D< T >::setPolar const T  theta,
const T  phi,
const T  r
 

Sets the values of all coordinates from spherical polar input.

The angles are assumed to be in degrees.

Definition at line 172 of file point3d.h.

template<class T>
void Point3D< T >::setID const unsigned int  id  ) 
 

Sets the ID.

Definition at line 180 of file point3d.h.

template<class T>
void Point3D< T >::add const Point3D< T > &  p  ) 
 

Adds the point p.

Definition at line 187 of file point3d.h.


Member Data Documentation

template<class T>
const T Point3D< T >::PI [static]
 

The value of Pi.

Definition at line 80 of file point3d.h.

template<class T>
const T Point3D< T >::DEGTORAD [static]
 

A conversion factor from degrees to radians.

Definition at line 81 of file point3d.h.

template<class T>
const T Point3D< T >::RADTODEG [static]
 

A conversion factor from radians to degrees.

Definition at line 82 of file point3d.h.

template<class T>
const T Point3D< T >::TOLERANCE [static]
 

A tolerance for differences in floating point values to be still considered equal.

Definition at line 83 of file point3d.h.

template<class T>
T Point3D< T >::xCoord [private]
 

Definition at line 87 of file point3d.h.

template<class T>
T Point3D< T >::yCoord [private]
 

Definition at line 87 of file point3d.h.

template<class T>
T Point3D< T >::zCoord [private]
 

Coordinate values.

Definition at line 87 of file point3d.h.

template<class T>
unsigned int Point3D< T >::ID [private]
 

ID of the point.

Definition at line 88 of file point3d.h.


Generated on Fri May 19 14:31:58 2006 for Brabosphere by  doxygen 1.4.6-NO