BALL  1.4.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines
BALL::TPlane3< T > Class Template Reference

#include <BALL/MATHS/plane3.h>

List of all members.

Public Member Functions

Constructors and Destructors
 TPlane3 ()
 TPlane3 (const TPlane3 &plane)
 TPlane3 (const TVector3< T > &point, const TVector3< T > &normal)
 TPlane3 (const TVector3< T > &a, const TVector3< T > &b, const TVector3< T > &c)
 TPlane3 (const T &a, const T &b, const T &c, const T &d)
virtual ~TPlane3 ()
virtual void clear ()
Assignment
void swap (TPlane3 &plane)
void set (const TPlane3 &plane)
void set (const TVector3< T > &point, const TVector3< T > &normal)
void set (const TVector3< T > &a, const TVector3< T > &b, const TVector3< T > &c)
TPlane3operator= (const TPlane3 &plane)
void get (TPlane3 &plane) const
void get (TVector3< T > &point, TVector3< T > &normal) const
Accessors
void normalize ()
void hessify ()
Predicates
bool operator== (const TPlane3 &plane) const
bool operator!= (const TPlane3 &plane) const
bool has (const TVector3< T > &point) const
bool has (const TLine3< T > &line) const
Debugging and Diagnostics
bool isValid () const
void dump (std::ostream &s=std::cout, Size depth=0) const

Public Attributes

Attributes
TVector3< T > p
TVector3< T > n

Detailed Description

template<typename T>
class BALL::TPlane3< T >

Threedimensional plane. A plane is defined by a point and its normal.

Definition at line 52 of file plane3.h.


Constructor & Destructor Documentation

template<typename T>
BALL::TPlane3< T >::TPlane3 ( ) [inline]

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

Definition at line 66 of file plane3.h.

template<typename T>
BALL::TPlane3< T >::TPlane3 ( const TPlane3< T > &  plane) [inline]

Copy constructor. Create a new TPlane3 object from another.

Parameters:
planethe TPlane3 object to be copied

Definition at line 77 of file plane3.h.

template<typename T>
BALL::TPlane3< T >::TPlane3 ( const TVector3< T > &  point,
const TVector3< T > &  normal 
) [inline]

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

Parameters:
pointassigned to p
normalassigned to n

Definition at line 89 of file plane3.h.

template<typename T>
BALL::TPlane3< T >::TPlane3 ( const TVector3< T > &  a,
const TVector3< T > &  b,
const TVector3< T > &  c 
) [inline]

Detailed constructor. Create a new instance of TPlane3 from three points.

Parameters:
aassigned to p
a,b,care used to calculate the normal n

Definition at line 101 of file plane3.h.

template<typename T>
BALL::TPlane3< T >::TPlane3 ( const T &  a,
const T &  b,
const T &  c,
const T &  d 
) [inline]

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

Parameters:
a,b,care used to calculate the normal n and the point p
Exceptions:
Exception::DivisionByZeroif a == b == c == 0

Definition at line 114 of file plane3.h.

template<typename T>
virtual BALL::TPlane3< T >::~TPlane3 ( ) [inline, virtual]

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

Definition at line 139 of file plane3.h.


Member Function Documentation

template<typename T>
virtual void BALL::TPlane3< T >::clear ( ) [inline, virtual]

Clear method. The values are set to 0.

Definition at line 147 of file plane3.h.

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

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

Definition at line 344 of file plane3.h.

template<typename T>
void BALL::TPlane3< T >::get ( TPlane3< T > &  plane) const [inline]

Assign to another instance of Plane3. Assigns the components to another plane.

Parameters:
planethe plane to be assigned to

Definition at line 223 of file plane3.h.

template<typename T>
void BALL::TPlane3< T >::get ( TVector3< T > &  point,
TVector3< T > &  normal 
) const [inline]

Assign to a point and a normal.

Parameters:
pointthe point to be assigned to
normalthe normal to be assigned to

Definition at line 234 of file plane3.h.

template<typename T>
bool BALL::TPlane3< T >::has ( const TVector3< T > &  point) const [inline]

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

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

Definition at line 307 of file plane3.h.

template<typename T>
bool BALL::TPlane3< T >::has ( const TLine3< T > &  line) const [inline]

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

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

Definition at line 317 of file plane3.h.

template<typename T>
void BALL::TPlane3< T >::hessify ( ) [inline]

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.

Definition at line 269 of file plane3.h.

template<typename T>
bool BALL::TPlane3< T >::isValid ( ) const [inline]

Test whether instance is valid. always retruns true

Returns:
bool true

Definition at line 332 of file plane3.h.

template<typename T>
void BALL::TPlane3< T >::normalize ( ) [inline]

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:
Exception::DivisionByZeroif the length of the normal is 0

Definition at line 251 of file plane3.h.

template<typename T>
bool BALL::TPlane3< T >::operator!= ( const TPlane3< T > &  plane) const [inline]

Inequality operator.

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

Definition at line 297 of file plane3.h.

template<typename T>
TPlane3& BALL::TPlane3< T >::operator= ( const TPlane3< T > &  plane) [inline]

Assignment operator. Assign the components from another instance of plane.

Parameters:
planethe plane to assign from

Definition at line 210 of file plane3.h.

template<typename T>
bool BALL::TPlane3< T >::operator== ( const TPlane3< T > &  plane) const [inline]

Equality operator.

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

Definition at line 288 of file plane3.h.

template<typename T>
void BALL::TPlane3< T >::set ( const TPlane3< T > &  plane) [inline]

Swap the contents of two instances of planes.

Parameters:
vectorthe plane to swap contents with
boolignored - just for interface consistency

Definition at line 176 of file plane3.h.

template<typename T>
void BALL::TPlane3< T >::set ( const TVector3< T > &  point,
const TVector3< T > &  normal 
) [inline]

Assign from a point and a normal.

Parameters:
pointthe new point
normalthe new normal

Definition at line 187 of file plane3.h.

template<typename T>
void BALL::TPlane3< T >::set ( const TVector3< T > &  a,
const TVector3< T > &  b,
const TVector3< T > &  c 
) [inline]

Assign from three points.

Parameters:
athe first point
bthe second point
cthe third point

Definition at line 199 of file plane3.h.

template<typename T>
void BALL::TPlane3< T >::swap ( TPlane3< T > &  plane) [inline]

Definition at line 161 of file plane3.h.


Member Data Documentation

template<typename T>
TVector3<T> BALL::TPlane3< T >::n

The normal

Definition at line 370 of file plane3.h.

template<typename T>
TVector3<T> BALL::TPlane3< T >::p

The point

Definition at line 366 of file plane3.h.

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines