BALL  1.4.79
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members
BALL::TLine3< T > Class Template Reference

#include <BALL/MATHS/line3.h>

Public Types

Enums
enum  Form { FORM__PARAMETER = 0, FORM__TWO_POINTS = 1 }
 

Public Member Functions

Constructors and Destructors
 TLine3 ()
 
 TLine3 (const TLine3 &line)
 
 TLine3 (const TVector3< T > &point, const TVector3< T > &vector, Form form=FORM__PARAMETER)
 
virtual ~TLine3 ()
 
virtual void clear ()
 
Assignment
void swap (TLine3 &line)
 
void set (const TLine3 &line)
 
void set (const TVector3< T > &point, const TVector3< T > &vector, Form form=FORM__PARAMETER)
 
TLine3operator= (const TLine3 &line)
 
void get (TLine3 &line) const
 
void get (TVector3< T > &point, TVector3< T > &vector, Form form=FORM__PARAMETER) const
 
Accessors
void normalize ()
 
Predicates
bool operator== (const TLine3 &line) const
 
bool operator!= (const TLine3 &line) const
 
bool has (const TVector3< T > &point) 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 > d
 

Detailed Description

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

Generic Line in Three-Dimensional Space.

Definition at line 28 of file line3.h.

Member Enumeration Documentation

template<typename T>
enum BALL::TLine3::Form

form of parameter to describe the line: 0 one Point and one Vector. 1 two Points

Enumerator
FORM__PARAMETER 
FORM__TWO_POINTS 

Definition at line 60 of file line3.h.

Constructor & Destructor Documentation

template<typename T>
BALL::TLine3< T >::TLine3 ( )
inline

Default constructor

Definition at line 73 of file line3.h.

template<typename T>
BALL::TLine3< T >::TLine3 ( const TLine3< T > &  line)
inline

Copy constructor.

Parameters
TLine3the TLine3 object to be copied
boolignored - just for interface consistency

Definition at line 84 of file line3.h.

template<typename T>
BALL::TLine3< T >::TLine3 ( const TVector3< T > &  point,
const TVector3< T > &  vector,
Form  form = FORM__PARAMETER 
)
inline

Detailed constructor. Depending on form, create a new TLine3 object from a point and a vector or from two points.

Parameters
pointassigned to p
vectorassigned to d
formassigns form of parameter 0 one Point and one Vector
1 two Points

Definition at line 102 of file line3.h.

template<typename T>
virtual BALL::TLine3< T >::~TLine3 ( )
inlinevirtual

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

Definition at line 115 of file line3.h.

Member Function Documentation

template<typename T>
virtual void BALL::TLine3< T >::clear ( )
inlinevirtual

Clear method. The values are set to 0.

Definition at line 123 of file line3.h.

template<typename T>
void BALL::TLine3< 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 323 of file line3.h.

template<typename T>
void BALL::TLine3< T >::get ( TLine3< T > &  line) const
inline

Assign to another instance of TLine3. Assigns the vector components to another vector.

Parameters
linethe line to be assigned to

Definition at line 198 of file line3.h.

template<typename T>
void BALL::TLine3< T >::get ( TVector3< T > &  point,
TVector3< T > &  vector,
Form  form = FORM__PARAMETER 
) const
inline

Assign to two instances of TVector3. Type of components depends on form.

Parameters
pointthe first point
vectorthe second point or the vector component
formassigns form of parameter
0 one Point and one Vector
1 two Points

Definition at line 212 of file line3.h.

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

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

Returns
bool, true or false

Definition at line 269 of file line3.h.

template<typename T>
bool BALL::TLine3< T >::isValid ( ) const
inline

Test whether instance is valid. Always returns true.

Returns
bool true

Definition at line 311 of file line3.h.

template<typename T>
void BALL::TLine3< T >::normalize ( )
inline

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

Exceptions
DivisionByZeroif the length of the vector is 0

Definition at line 237 of file line3.h.

template<typename T>
bool BALL::TLine3< T >::operator!= ( const TLine3< T > &  line) const
inline

Inequality operator.

Returns
bool, true if the two lines differ in at least one component, false otherwise

Definition at line 260 of file line3.h.

template<typename T>
TLine3& BALL::TLine3< T >::operator= ( const TLine3< T > &  line)
inline

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

Parameters
linethe vector to assign from

Definition at line 185 of file line3.h.

template<typename T>
bool BALL::TLine3< T >::operator== ( const TLine3< T > &  line) const
inline

Equality operator.

Returns
bool, true if both components are equal, false otherwise

Definition at line 251 of file line3.h.

template<typename T>
void BALL::TLine3< T >::set ( const TLine3< T > &  line)
inline

Assign from another instance of TLine3.

Parameters
linethe TLine3 object to assign from

Definition at line 154 of file line3.h.

template<typename T>
void BALL::TLine3< T >::set ( const TVector3< T > &  point,
const TVector3< T > &  vector,
Form  form = FORM__PARAMETER 
)
inline

Assign from one point and a vector or from two points, depending on form.

Parameters
pointassigned to p
vectorassigned to d
formassigns form of parameter

Definition at line 167 of file line3.h.

template<typename T>
void BALL::TLine3< T >::swap ( TLine3< T > &  line)
inline

Swap the contents of two instances of lines.

Parameters
linethe TLine3 to swap contents with

Definition at line 139 of file line3.h.

Member Data Documentation

template<typename T>
TVector3<T> BALL::TLine3< T >::d

Vector Component.

Definition at line 351 of file line3.h.

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

Point Component.

Definition at line 347 of file line3.h.