Main Page | Modules | Namespace List | Class Hierarchy | Class List | Namespace Members | Class Members

TPlane3< T > Class Template Reference
[Plane in three-dimensional space.]

Threedimensional plane. More...

#include <plane3.h>

List of all members.

Public Member Functions

Constructors and Destructors
 TPlane3 () throw ()
 Default constructor.
 TPlane3 (const TPlane3 &plane) throw ()
 Copy constructor.
 TPlane3 (const TVector3< T > &point, const TVector3< T > &normal) throw ()
 Detailed constructor.
 TPlane3 (const TVector3< T > &a, const TVector3< T > &b, const TVector3< T > &c) throw ()
 Detailed constructor.
 TPlane3 (const T &a, const T &b, const T &c, const T &d) throw (Exception::DivisionByZero)
 Constructor.
virtual ~TPlane3 () throw ()
 Destructor.
virtual void clear () throw ()
 Clear method.
Assignment
void swap (TPlane3 &plane) throw ()
void set (const TPlane3 &plane) throw ()
 Swap the contents of two instances of planes.
void set (const TVector3< T > &point, const TVector3< T > &normal) throw ()
 Assign from a point and a normal.
void set (const TVector3< T > &a, const TVector3< T > &b, const TVector3< T > &c) throw ()
 Assign from three points.
TPlane3operator= (const TPlane3 &plane) throw ()
 Assignment operator.
void get (TPlane3 &plane) const throw ()
 Assign to another instance of Plane3.
void get (TVector3< T > &point, TVector3< T > &normal) const throw ()
 Assign to a point and a normal.
Accessors
void normalize () throw (Exception::DivisionByZero)
 Normalize the the normal of the plane.
void hessify () throw ()
 Hessify the plane.
Predicates
bool operator== (const TPlane3 &plane) const throw ()
 Equality operator.
bool operator!= (const TPlane3 &plane) const throw ()
 Inequality operator.
bool has (const TVector3< T > &point) const throw ()
 Test whether a given point is a member of the plane.
bool has (const TLine3< T > &line) const throw ()
 Test whether a given line is a member of the plane.
Debugging and Diagnostics
bool isValid () const throw ()
 Test whether instance is valid.
void dump (std::ostream &s=std::cout, Size depth=0) const throw ()
 Internal state dump.

Public Attributes

Attributes
TVector3< T > p
 The point.
TVector3< T > n
 The normal.


Detailed Description

template<typename T>
class TPlane3< T >

Threedimensional plane.

A plane is defined by a point and its normal.


Constructor & Destructor Documentation

template<typename T>
TPlane3< T >::TPlane3  )  throw ()
 

Default constructor.

This method creates a new TPlane3 object. The two components are initialized to (T)0.

template<typename T>
TPlane3< T >::TPlane3 const TPlane3< T > &  plane  )  throw ()
 

Copy constructor.

Create a new TPlane3 object from another.

Parameters:
plane the TPlane3 object to be copied

template<typename T>
TPlane3< T >::TPlane3 const TVector3< T > &  point,
const TVector3< T > &  normal
throw ()
 

Detailed constructor.

Create a new instances of TPlane3 from a point and the normal.

Parameters:
point assigned to p
normal assigned to n

template<typename T>
TPlane3< T >::TPlane3 const TVector3< T > &  a,
const TVector3< T > &  b,
const TVector3< T > &  c
throw ()
 

Detailed constructor.

Create a new instance of TPlane3 from three points.

Parameters:
a assigned to p
a,b,c are used to calculate the normal n

template<typename T>
TPlane3< T >::TPlane3 const T &  a,
const T &  b,
const T &  c,
const T &  d
throw (Exception::DivisionByZero)
 

Constructor.

Create a new TPlane3 object from four T values. Form: COORDINATE (ax + by + cz + d = 0)

Parameters:
a,b,c are used to calculate the normal n and the point p

template<typename T>
virtual TPlane3< T >::~TPlane3  )  throw () [virtual]
 

Destructor.

Destructs the TPlane3 object. As there are no dynamic data structures, nothing happens.


Member Function Documentation

template<typename T>
virtual void TPlane3< T >::clear  )  throw () [virtual]
 

Clear method.

The values are set to 0.

template<typename T>
void TPlane3< T >::dump std::ostream &  s = std::cout,
Size  depth = 0
const throw ()
 

Internal state dump.

Dump the current internal state of {*this} to the output ostream s with dumping depth depth .

Parameters:
s - output stream where to output the internal state of {*this}
depth - the dumping depth

template<typename T>
void TPlane3< T >::get TVector3< T > &  point,
TVector3< T > &  normal
const throw ()
 

Assign to a point and a normal.

Parameters:
point the point to be assigned to
normal the normal to be assigned to

template<typename T>
void TPlane3< T >::get TPlane3< T > &  plane  )  const throw ()
 

Assign to another instance of Plane3.

Assigns the components to another plane.

Parameters:
plane the plane to be assigned to

template<typename T>
bool TPlane3< T >::has const TLine3< T > &  line  )  const throw ()
 

Test whether a given line is a member of the plane.

Parameters:
line the line to be tested
Returns:
bool, true or false

template<typename T>
bool TPlane3< T >::has const TVector3< T > &  point  )  const throw ()
 

Test whether a given point is a member of the plane.

Parameters:
point the point to be tested
Returns:
bool, true or false

template<typename T>
void TPlane3< T >::hessify  )  throw ()
 

Hessify the plane.

The normal is scaled with its length: $\{x|y|z\} *= \sqrt{x^2 + y^2 + z^2}$. If the dot product of the point with the normal is less then zero, the normal is negated.

template<typename T>
bool TPlane3< T >::isValid  )  const throw ()
 

Test whether instance is valid.

always retruns true

Returns:
bool true

template<typename T>
void TPlane3< T >::normalize  )  throw (Exception::DivisionByZero)
 

Normalize the the normal of the plane.

The normal is scaled with its length: $\{x|y|z\} *= \sqrt{x^2 + y^2 + z^2}$.

Exceptions:
DivisionByZero if the length of the normal is 0

template<typename T>
bool TPlane3< T >::operator!= const TPlane3< T > &  plane  )  const throw ()
 

Inequality operator.

Returns:
bool, false if all components are equal, true otherwise

template<typename T>
TPlane3& TPlane3< T >::operator= const TPlane3< T > &  plane  )  throw ()
 

Assignment operator.

Assign the components from another instance of plane.

Parameters:
plane the plane to assign from

template<typename T>
bool TPlane3< T >::operator== const TPlane3< T > &  plane  )  const throw ()
 

Equality operator.

Returns:
bool, true if all components are equal, false otherwise

template<typename T>
void TPlane3< T >::set const TVector3< T > &  a,
const TVector3< T > &  b,
const TVector3< T > &  c
throw ()
 

Assign from three points.

Parameters:
a the first point
b the second point
c the third point

template<typename T>
void TPlane3< T >::set const TVector3< T > &  point,
const TVector3< T > &  normal
throw ()
 

Assign from a point and a normal.

Parameters:
point the new point
normal the new normal

template<typename T>
void TPlane3< T >::set const TPlane3< T > &  plane  )  throw ()
 

Swap the contents of two instances of planes.

Parameters:
vector the plane to swap contents with
bool ignored - just for interface consistency