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

TLine3< T > Class Template Reference
[Generic Line in Three-Dimensional Space.]

Generic Line in Three-Dimensional Space. More...

#include <line3.h>

List of all members.

Public Types

Enums
enum  Form { FORM__PARAMETER = 0, FORM__TWO_POINTS = 1 }
 form of parameter to describe the line: 0 one Point and one Vector. More...

Public Member Functions

Constructors and Destructors
 TLine3 () throw ()
 Default constructor.
 TLine3 (const TLine3 &line) throw ()
 Copy constructor.
 TLine3 (const TVector3< T > &point, const TVector3< T > &vector, Form form=FORM__PARAMETER) throw ()
 Detailed constructor.
virtual ~TLine3 () throw ()
 Destructor.
virtual void clear () throw ()
 Clear method.
Assignment
void swap (TLine3 &line) throw ()
 Swap the contents of two instances of lines.
void set (const TLine3 &line) throw ()
 Assign from another instance of TLine3.
void set (const TVector3< T > &point, const TVector3< T > &vector, Form form=FORM__PARAMETER) throw ()
 Assign from one point and a vector or from two points, depending on form.
TLine3operator= (const TLine3 &line) throw ()
 Assignment operator.
void get (TLine3 &line) const throw ()
 Assign to another instance of TLine3.
void get (TVector3< T > &point, TVector3< T > &vector, Form form=FORM__PARAMETER) const throw ()
 Assign to two instances of TVector3.
Accessors
void normalize () throw ()
 Normalize the vector component.
Predicates
bool operator== (const TLine3 &line) const throw ()
 Equality operator.
bool operator!= (const TLine3 &line) const throw ()
 Inequality operator.
bool has (const TVector3< T > &point) const throw ()
 Test whether a given point is a member of the line.
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
 Point Component.
TVector3< T > d
 Vector Component.


Detailed Description

template<typename T>
class TLine3< T >

Generic Line in Three-Dimensional Space.


Member Enumeration Documentation

template<typename T>
enum TLine3::Form
 

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

1 two Points


Constructor & Destructor Documentation

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

Copy constructor.

Parameters:
TLine3 the TLine3 object to be copied
bool ignored - just for interface consistency

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

Detailed constructor.

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

Parameters:
point assigned to p
vector assigned to d
form assigns form of parameter 0 one Point and one Vector
1 two Points

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

Destructor.

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


Member Function Documentation

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

Clear method.

The values are set to 0.

template<typename T>
void TLine3< 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 TLine3< T >::get TVector3< T > &  point,
TVector3< T > &  vector,
Form  form = FORM__PARAMETER
const throw ()
 

Assign to two instances of TVector3.

Type of components depends on form.

Parameters:
point the first point
vector the second point or the vector component
form assigns form of parameter
0 one Point and one Vector
1 two Points

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

Assign to another instance of TLine3.

Assigns the vector components to another vector.

Parameters:
line the line to be assigned to

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

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

Returns:
bool, true or false

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

Test whether instance is valid.

Always returns true.

Returns:
bool true

template<typename T>
void TLine3< T >::normalize  )  throw ()
 

Normalize the vector component.

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

Exceptions:
DivisionByZero if the length of the vector is 0

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

Inequality operator.

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

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

Assignment operator.

Assign the components from another instance of line.

Parameters:
line the vector to assign from

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

Equality operator.

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

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

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

Parameters:
point assigned to p
vector assigned to d
form assigns form of parameter

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

Assign from another instance of TLine3.

Parameters:
line the TLine3 object to assign from

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

Swap the contents of two instances of lines.

Parameters:
line the TLine3 to swap contents with


Member Data Documentation

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

Vector Component.

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

Point Component.