#include <BALL/MATHS/plane3.h>
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) throw (Exception::DivisionByZero) | |
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) |
TPlane3 & | operator= (const TPlane3 &plane) |
void | get (TPlane3 &plane) const |
void | get (TVector3< T > &point, TVector3< T > &normal) const |
Accessors | |
void | normalize () throw (Exception::DivisionByZero) |
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 |
Threedimensional plane. A plane is defined by a point and its normal.
BALL::TPlane3< T >::TPlane3 | ( | ) | [inline] |
Default constructor. This method creates a new TPlane3 object. The two components are initialized to (T)0
.
BALL::TPlane3< T >::TPlane3 | ( | const TPlane3< T > & | plane | ) | [inline] |
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.
point | assigned to p | |
normal | assigned to n |
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.
a | assigned to p | |
a,b,c | are used to calculate the normal n |
BALL::TPlane3< T >::TPlane3 | ( | const T & | a, | |
const T & | b, | |||
const T & | c, | |||
const T & | d | |||
) | throw (Exception::DivisionByZero) [inline] |
Constructor. Create a new TPlane3 object from four T
values. Form: COORDINATE (ax + by + cz + d = 0)
a,b,c | are used to calculate the normal n and the point p |
References BALL::Constants::c, BALL::Maths::isZero(), BALL::TPlane3< T >::n, and BALL::TPlane3< T >::p.
virtual BALL::TPlane3< T >::~TPlane3 | ( | ) | [inline, virtual] |
Destructor. Destructs the TPlane3 object. As there are no dynamic data structures, nothing happens.
virtual void BALL::TPlane3< T >::clear | ( | ) | [inline, virtual] |
Clear method. The values are set to 0.
References BALL::TPlane3< T >::n, and BALL::TPlane3< T >::p.
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 .
s | - output stream where to output the internal state of {*this} | |
depth | - the dumping depth |
References BALL_DUMP_DEPTH, BALL_DUMP_HEADER, BALL_DUMP_STREAM_PREFIX, BALL_DUMP_STREAM_SUFFIX, BALL::TPlane3< T >::n, and BALL::TPlane3< T >::p.
void BALL::TPlane3< T >::get | ( | TVector3< T > & | point, | |
TVector3< T > & | normal | |||
) | const [inline] |
Assign to a point and a normal.
point | the point to be assigned to | |
normal | the normal to be assigned to |
References BALL::TPlane3< T >::n, and BALL::TPlane3< T >::p.
void BALL::TPlane3< T >::get | ( | TPlane3< T > & | plane | ) | const [inline] |
Assign to another instance of Plane3. Assigns the components to another plane.
plane | the plane to be assigned to |
References BALL::TPlane3< T >::n, and BALL::TPlane3< T >::p.
bool BALL::TPlane3< T >::has | ( | const TLine3< T > & | line | ) | const [inline] |
Test whether a given line is a member of the plane.
line | the line to be tested |
References BALL::TLine3< T >::d, BALL::TPlane3< T >::has(), BALL::Maths::isZero(), BALL::TPlane3< T >::n, and BALL::TLine3< T >::p.
bool BALL::TPlane3< T >::has | ( | const TVector3< T > & | point | ) | const [inline] |
Test whether a given point is a member of the plane.
point | the point to be tested |
References BALL::Maths::isZero(), BALL::TPlane3< T >::n, and BALL::TPlane3< T >::p.
Referenced by BALL::TPlane3< T >::has().
void BALL::TPlane3< T >::hessify | ( | ) | [inline] |
Hessify the plane. The normal is scaled with its length: . If the dot product of the point with the normal is less then zero, the normal is negated.
References BALL::Maths::isLess(), BALL::TPlane3< T >::n, BALL::TPlane3< T >::normalize(), and BALL::TPlane3< T >::p.
bool BALL::TPlane3< T >::isValid | ( | ) | const [inline] |
Test whether instance is valid. always retruns true
void BALL::TPlane3< T >::normalize | ( | ) | throw (Exception::DivisionByZero) [inline] |
Normalize the the normal of the plane. The normal is scaled with its length: .
DivisionByZero | if the length of the normal is 0 |
References BALL::TPlane3< T >::n.
Referenced by BALL::TPlane3< T >::hessify().
bool BALL::TPlane3< T >::operator!= | ( | const TPlane3< T > & | plane | ) | const [inline] |
Inequality operator.
References BALL::TPlane3< T >::n, and BALL::TPlane3< T >::p.
TPlane3& BALL::TPlane3< T >::operator= | ( | const TPlane3< T > & | plane | ) | [inline] |
Assignment operator. Assign the components from another instance of plane.
plane | the plane to assign from |
References BALL::TPlane3< T >::n, and BALL::TPlane3< T >::p.
bool BALL::TPlane3< T >::operator== | ( | const TPlane3< T > & | plane | ) | const [inline] |
Equality operator.
References BALL::TPlane3< T >::n, and BALL::TPlane3< T >::p.
void BALL::TPlane3< T >::set | ( | const TVector3< T > & | a, | |
const TVector3< T > & | b, | |||
const TVector3< T > & | c | |||
) | [inline] |
Assign from three points.
a | the first point | |
b | the second point | |
c | the third point |
References BALL::Constants::c, BALL::TPlane3< T >::n, and BALL::TPlane3< T >::p.
void BALL::TPlane3< T >::set | ( | const TVector3< T > & | point, | |
const TVector3< T > & | normal | |||
) | [inline] |
Assign from a point and a normal.
point | the new point | |
normal | the new normal |
References BALL::TPlane3< T >::n, and BALL::TPlane3< T >::p.
void BALL::TPlane3< T >::set | ( | const TPlane3< T > & | plane | ) | [inline] |
Swap the contents of two instances of planes.
vector | the plane to swap contents with | |
bool | ignored - just for interface consistency |
References BALL::TPlane3< T >::n, and BALL::TPlane3< T >::p.
void BALL::TPlane3< T >::swap | ( | TPlane3< T > & | plane | ) | [inline] |
References BALL::TPlane3< T >::n, and BALL::TPlane3< T >::p.
TVector3<T> BALL::TPlane3< T >::n |
The normal
Referenced by BALL::TPlane3< T >::clear(), BALL::TPlane3< T >::dump(), BALL::TPlane3< T >::get(), BALL::GetAngle(), BALL::GetIntersection(), BALL::TPlane3< T >::has(), BALL::TPlane3< T >::hessify(), BALL::isOrthogonal(), BALL::isParallel(), BALL::TPlane3< T >::normalize(), BALL::TPlane3< T >::operator!=(), BALL::TPlane3< T >::operator=(), BALL::TPlane3< T >::operator==(), BALL::operator>>(), BALL::TPlane3< T >::set(), BALL::TPlane3< T >::swap(), and BALL::TPlane3< T >::TPlane3().
TVector3<T> BALL::TPlane3< T >::p |
The point
Referenced by BALL::TPlane3< T >::clear(), BALL::TPlane3< T >::dump(), BALL::TPlane3< T >::get(), BALL::GetIntersection(), BALL::TPlane3< T >::has(), BALL::TPlane3< T >::hessify(), BALL::TPlane3< T >::operator!=(), BALL::TPlane3< T >::operator=(), BALL::TPlane3< T >::operator==(), BALL::operator>>(), BALL::TPlane3< T >::set(), BALL::TPlane3< T >::swap(), and BALL::TPlane3< T >::TPlane3().