library of assembled shared sources

http://lass.cocamware.com

lass::prim::Line3D< T, NormalizingPolicy > Class Template Reference

3D Line More...

#include <line_3d.h>

Collaboration diagram for lass::prim::Line3D< T, NormalizingPolicy >:

Collaboration graph
[legend]

Data Structures

struct  Rebind
 rebind to other value type More...

Public Types

enum  { dimension = TPoint::dimension }
typedef Line3D< T,
NormalizingPolicy > 
TSelf
typedef NormalizingPolicy TNormalizingPolicy
typedef Point3D< T > TPoint
typedef TPoint::TVector TVector
typedef TPoint::TValue TValue
typedef TPoint::TParam TParam
typedef TPoint::TReference TReference
typedef TPoint::TConstReference TConstReference
typedef TPoint::TNumTraits TNumTraits

Public Member Functions

 Line3D ()
 Line3D (const TPoint &iSupport, const TPoint &iPoint)
 Line3D (const TPoint &iSupport, const TVector &iDirection)
const TPointsupport () const
TPointsupport ()
const TVectordirection () const
 Return direction of line.
void setDirection (const TVector &iDirection)
 Set direction and normalize it if that's the policy.
void lookAt (const TPoint &iLookAt)
 Set direction from support to look-at point.
const TVector reject (const TPoint &iPoint) const
 return the vector that, if added to the projection of iPoint, you get iPoint again.
const TVector reject (const TVector &iVector) const
 return the part of iVector that is orthogonal to the line.
const TPoint project (const TPoint &iPoint) const
 project a point orthogonally onto the line
const TVector project (const TVector &iVector) const
 project a vector orthogonally onto the line
const TPoint reflect (const TPoint &iPoint) const
 reflect a point orthogonally into the line.
const TVector reflect (const TVector &iVector) const
 reflect a vector orthogonally to the line
const TPoint point (TParam iT) const
 Return point on line by it's parameter.
const TValue t (const TPoint &iPoint) const
 Return parameter of point on the line that is the projection of the given point.
void flip ()
const bool isValid () const
 Return true if line is valid (direction isn't a zero vector).

Private Attributes

TPoint support_
TVector direction_

Related Functions

(Note that these are not member functions.)

template<typename T , class NP >
std::ostream & operator<< (std::ostream &ioOStream, const Line3D< T, NP > &iLine)
template<typename T , class NP >
io::XmlOStreamoperator<< (io::XmlOStream &ioOStream, const Line3D< T, NP > &iLine)

Detailed Description

template<typename T, class NormalizingPolicy = Normalized>
class lass::prim::Line3D< T, NormalizingPolicy >

3D Line

Author:
Bram de Greve [BdG]
Date:
3003

Definition at line 73 of file line_3d.h.


Member Typedef Documentation

template<typename T , class NormalizingPolicy = Normalized>
typedef Line3D<T, NormalizingPolicy> lass::prim::Line3D< T, NormalizingPolicy >::TSelf

Definition at line 77 of file line_3d.h.

template<typename T , class NormalizingPolicy = Normalized>
typedef NormalizingPolicy lass::prim::Line3D< T, NormalizingPolicy >::TNormalizingPolicy

Definition at line 78 of file line_3d.h.

template<typename T , class NormalizingPolicy = Normalized>
typedef Point3D<T> lass::prim::Line3D< T, NormalizingPolicy >::TPoint

Definition at line 80 of file line_3d.h.

template<typename T , class NormalizingPolicy = Normalized>
typedef TPoint::TVector lass::prim::Line3D< T, NormalizingPolicy >::TVector

Definition at line 81 of file line_3d.h.

template<typename T , class NormalizingPolicy = Normalized>
typedef TPoint::TValue lass::prim::Line3D< T, NormalizingPolicy >::TValue

Definition at line 83 of file line_3d.h.

template<typename T , class NormalizingPolicy = Normalized>
typedef TPoint::TParam lass::prim::Line3D< T, NormalizingPolicy >::TParam

Definition at line 84 of file line_3d.h.

template<typename T , class NormalizingPolicy = Normalized>
typedef TPoint::TReference lass::prim::Line3D< T, NormalizingPolicy >::TReference

Definition at line 85 of file line_3d.h.

template<typename T , class NormalizingPolicy = Normalized>
typedef TPoint::TConstReference lass::prim::Line3D< T, NormalizingPolicy >::TConstReference

Definition at line 86 of file line_3d.h.

template<typename T , class NormalizingPolicy = Normalized>
typedef TPoint::TNumTraits lass::prim::Line3D< T, NormalizingPolicy >::TNumTraits

Definition at line 87 of file line_3d.h.


Member Enumeration Documentation

template<typename T , class NormalizingPolicy = Normalized>
anonymous enum

Enumerator:
dimension 

Definition at line 89 of file line_3d.h.


Constructor & Destructor Documentation

template<typename T , class NP >
lass::prim::Line3D< T, NP >::Line3D (  )  [inline]

template<typename T , class NP >
lass::prim::Line3D< T, NP >::Line3D ( const TPoint iSupport,
const TPoint iPoint 
) [inline]

template<typename T , class NP >
lass::prim::Line3D< T, NP >::Line3D ( const TPoint iSupport,
const TVector iDirection 
) [inline]


Member Function Documentation

template<typename T , class NP >
const Line3D< T, NP >::TPoint & lass::prim::Line3D< T, NP >::support (  )  const [inline]

Definition at line 94 of file line_3d.inl.

References lass::prim::Line3D< T, NormalizingPolicy >::support_.

template<typename T , class NP >
Line3D< T, NP >::TPoint & lass::prim::Line3D< T, NP >::support (  )  [inline]

Definition at line 103 of file line_3d.inl.

References lass::prim::Line3D< T, NormalizingPolicy >::support_.

template<typename T , class NP >
const Line3D< T, NP >::TVector & lass::prim::Line3D< T, NP >::direction (  )  const [inline]

Return direction of line.

Definition at line 114 of file line_3d.inl.

References lass::prim::Line3D< T, NormalizingPolicy >::direction_.

template<typename T , class NP >
void lass::prim::Line3D< T, NP >::setDirection ( const TVector iDirection  )  [inline]

Set direction and normalize it if that's the policy.

Definition at line 124 of file line_3d.inl.

References lass::prim::Line3D< T, NormalizingPolicy >::direction_.

template<typename T , class NP >
void lass::prim::Line3D< T, NP >::lookAt ( const TPoint iLookAt  )  [inline]

Set direction from support to look-at point.

Definition at line 135 of file line_3d.inl.

References lass::prim::Line3D< T, NormalizingPolicy >::direction_, and lass::prim::Line3D< T, NormalizingPolicy >::support_.

template<typename T , class NP >
const Line3D< T, NP >::TVector lass::prim::Line3D< T, NP >::reject ( const TPoint iPoint  )  const [inline]

return the vector that, if added to the projection of iPoint, you get iPoint again.

iPoint == (almost) project(iPoint) + reject(iPoint)

Definition at line 148 of file line_3d.inl.

References lass::prim::Line3D< T, NormalizingPolicy >::support_.

template<typename T , class NP >
const Line3D< T, NP >::TVector lass::prim::Line3D< T, NP >::reject ( const TVector iVector  )  const [inline]

return the part of iVector that is orthogonal to the line.

it's the vector that, if added to the projection of iVector, you get iVector again. iVector == (almost) project(iVector) + reject(iVector).

Definition at line 161 of file line_3d.inl.

References lass::prim::Line3D< T, NormalizingPolicy >::project().

template<typename T , class NP >
const Line3D< T, NP >::TPoint lass::prim::Line3D< T, NP >::project ( const TPoint iPoint  )  const [inline]

template<typename T , class NP >
const Line3D< T, NP >::TVector lass::prim::Line3D< T, NP >::project ( const TVector iVector  )  const [inline]

project a vector orthogonally onto the line

Definition at line 184 of file line_3d.inl.

References lass::prim::Line3D< T, NormalizingPolicy >::direction_, and lass::prim::dot().

template<typename T , class NP >
const Line3D< T, NP >::TPoint lass::prim::Line3D< T, NP >::reflect ( const TPoint iPoint  )  const [inline]

reflect a point orthogonally into the line.

Definition at line 195 of file line_3d.inl.

References lass::prim::Line3D< T, NormalizingPolicy >::support_.

template<typename T , class NP >
const Line3D< T, NP >::TVector lass::prim::Line3D< T, NP >::reflect ( const TVector iVector  )  const [inline]

reflect a vector orthogonally to the line

Definition at line 206 of file line_3d.inl.

References lass::prim::Line3D< T, NormalizingPolicy >::project(), and lass::stde::T.

template<typename T , class NP >
const Line3D< T, NP >::TPoint lass::prim::Line3D< T, NP >::point ( TParam  iT  )  const [inline]

Return point on line by it's parameter.

Returns:
support + t * direction

Definition at line 218 of file line_3d.inl.

References lass::prim::Line3D< T, NormalizingPolicy >::direction_, and lass::prim::Line3D< T, NormalizingPolicy >::support_.

template<typename T , class NP >
const Line3D< T, NP >::TValue lass::prim::Line3D< T, NP >::t ( const TPoint iPoint  )  const [inline]

Return parameter of point on the line that is the projection of the given point.

Definition at line 229 of file line_3d.inl.

References lass::prim::Line3D< T, NormalizingPolicy >::direction_, lass::prim::dot(), and lass::prim::Line3D< T, NormalizingPolicy >::support_.

template<typename T , class NormalizingPolicy = Normalized>
void lass::prim::Line3D< T, NormalizingPolicy >::flip (  ) 

template<typename T , class NP >
const bool lass::prim::Line3D< T, NP >::isValid (  )  const [inline]

Return true if line is valid (direction isn't a zero vector).

Definition at line 239 of file line_3d.inl.

References lass::prim::Line3D< T, NormalizingPolicy >::direction_, and lass::prim::Vector3D< T >::isZero().


Friends And Related Function Documentation

template<typename T , class NP >
std::ostream & operator<< ( std::ostream &  ioOStream,
const Line3D< T, NP > &  iLine 
) [related]

Definition at line 249 of file line_3d.inl.

References LASS_ENFORCE.

template<typename T , class NP >
io::XmlOStream & operator<< ( io::XmlOStream ioOStream,
const Line3D< T, NP > &  iLine 
) [related]

Definition at line 260 of file line_3d.inl.

References LASS_ENFORCE_STREAM.


Field Documentation

template<typename T , class NormalizingPolicy = Normalized>
TPoint lass::prim::Line3D< T, NormalizingPolicy >::support_ [private]

template<typename T , class NormalizingPolicy = Normalized>
TVector lass::prim::Line3D< T, NormalizingPolicy >::direction_ [private]


The documentation for this class was generated from the following files:

Generated on Mon Nov 10 14:22:13 2008 for Library of Assembled Shared Sources by doxygen 1.5.7.1
SourceForge.net Logo