library of assembled shared sources

http://lass.cocamware.com

lass::prim::impl::Plane3DCartesian< T, NormalizingPolicy > Class Template Reference

implementation of plane 3d with a cartesian equation More...

#include <plane_3d_cartesian.h>

Inheritance diagram for lass::prim::impl::Plane3DCartesian< T, NormalizingPolicy >:

Inheritance graph
[legend]
Collaboration diagram for lass::prim::impl::Plane3DCartesian< T, NormalizingPolicy >:

Collaboration graph
[legend]

Public Types

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

Public Member Functions

 Plane3DCartesian ()
 initializes to an invalid state.
 Plane3DCartesian (const TPoint &iSupport, const TPoint &iPointU, const TPoint &iPointV)
 Construct a plane through three points.
 Plane3DCartesian (const TPoint &iSupport, const TVector &iDirectionU, const TVector &iDirectionV)
 construct a plane through a support point and by two direction vectors.
 Plane3DCartesian (const TVector &iNormal, const TPoint &iSupport)
 Construct a plane through a support point and by a normal vector.
 Plane3DCartesian (const TVector &iNormal, TParam iD)
 Construct a plane by a cartesian equation N.P + d == 0.
const TPoint support () const
 return support point.
void getDirections (TVector &oDirectionU, TVector &oDirectionV) const
 return U and V direction vectors
const TVector directionU () const
 return U direction vector.
const TVector directionV () const
 return V direction vector.
void getReciprocals (TVector &oReciprocalU, TVector &oReciprocalV) const
 return reciprocal vectors for U and V direction vectors
const TVector reciprocalU () const
 return reciprocal for U direction vector.
const TVector reciprocalV () const
 return reciprocal for V direction vector.
void getCartesian (TVector &oNormal, TReference oD) const
const TVectornormal () const
const TParam d () const
const TValue equation (const TPoint &iPoint) const
 Return value of point in equation.
const TValue equation (const TPoint &iPoint, TParam iRelativeTolerance) const
 Return value of point in equation.
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 plane.
const TPoint project (const TPoint &iPoint) const
 project a point orthogonally onto the plane
const TVector project (const TVector &iVector) const
 project a vector orthogonally onto the plane
const TPoint reflect (const TPoint &iPoint) const
 reflect a point orthogonally into the plane.
const TVector reflect (const TVector &iVector) const
 reflect a vector orthogonally into the plane
const TPoint point (TParam iU, TParam iV) const
 return point by filling in the parametric equation: P(u, v) = S + u * U + v * V
const TPoint point (const TUV &iUV) const
 return point by filling in the parametric equation: P(u, v) = S + u * U + v * V
const TUV uv (const TPoint &iPoint) const
 return UV pair of parameters
void flip ()
const bool isValid () const
 return true if plane is a valid plane (no normal or direction vectors that are zero).

Private Attributes

TVector normal_
TValue d_

Detailed Description

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

implementation of plane 3d with a cartesian equation

Author:
Bram de Greve [BdG]
The implementation of this class uses the cartesian equation a * x + b * y + c * z + d == 0.

Warning:
The interface requires to have two direction vectors too, but of course, the cartesian equation does not provide this. So, it has to generate two direction vectors on request. THESE ARE NOT NECESSARELY THE SAME AS THE ONE YOU'VE MIGHT TO USE TO SET THE PLANE. i.e. if you go like this:
  Vector3D<double> directionV(1, 2, 3);
  Vector3D<double> directionV(4, 5, 6);
  Plane3D<double, Cartesian> plane(directionV, directionV);
  plane.getDirections(directionV, directionV);

then at the end, directionV and directionV will probably not be the same as at first. This is because the plane will only create a normal vector based on the direction vectors, and then forget about them. If you ask to get the direction vectors, it has to create new ones.

Definition at line 83 of file plane_3d_cartesian.h.


Member Typedef Documentation

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

Definition at line 87 of file plane_3d_cartesian.h.

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

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

template<typename T , class NormalizingPolicy = Normalized>
typedef Point2D<T> lass::prim::impl::Plane3DCartesian< T, NormalizingPolicy >::TUV

Definition at line 91 of file plane_3d_cartesian.h.

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

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

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

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

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


Member Enumeration Documentation

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

Enumerator:
dimension 

Definition at line 99 of file plane_3d_cartesian.h.


Constructor & Destructor Documentation

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

initializes to an invalid state.

Definition at line 63 of file plane_3d_cartesian.inl.

References lass::prim::impl::Plane3DCartesian< T, NormalizingPolicy >::isValid(), and LASS_ASSERT.

template<typename T , class NP >
lass::prim::impl::Plane3DCartesian< T, NP >::Plane3DCartesian ( const TPoint iSupport,
const TPoint iPointU,
const TPoint iPointV 
) [inline]

Construct a plane through three points.

  • normal vector N is given by the cross product N = U x V.
  • value d is choosen so that the support point is indeed a point of the plane.

Definition at line 77 of file plane_3d_cartesian.inl.

References lass::prim::impl::Plane3DCartesian< T, NormalizingPolicy >::d_, lass::prim::impl::Plane3DImplDetail::generateCartesian(), and lass::prim::impl::Plane3DCartesian< T, NormalizingPolicy >::normal_.

template<typename T , class NP >
lass::prim::impl::Plane3DCartesian< T, NP >::Plane3DCartesian ( const TPoint iSupport,
const TVector iDirectionU,
const TVector iDirectionV 
) [inline]

construct a plane through a support point and by two direction vectors.

  • normal vector N is given by the cross product N = U x V.
  • value d is choosen so that the support point is indeed a point of the plane.

Definition at line 93 of file plane_3d_cartesian.inl.

References lass::prim::impl::Plane3DCartesian< T, NormalizingPolicy >::d_, lass::prim::impl::Plane3DImplDetail::generateCartesian(), and lass::prim::impl::Plane3DCartesian< T, NormalizingPolicy >::normal_.

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

Construct a plane through a support point and by a normal vector.

  • normal vector N is given by the vector iNormal.
  • value d is choosen so that the support point is indeed a point of the plane.

Definition at line 108 of file plane_3d_cartesian.inl.

References lass::prim::impl::Plane3DCartesian< T, NormalizingPolicy >::d_, and lass::prim::impl::Plane3DCartesian< T, NormalizingPolicy >::normal_.

template<typename T , class NP >
lass::prim::impl::Plane3DCartesian< T, NP >::Plane3DCartesian ( const TVector iNormal,
TParam  iD 
) [inline]

Construct a plane by a cartesian equation N.P + d == 0.

  • normal vector N is given by the vector iNormal.
  • value d is given by the value iD.

Definition at line 122 of file plane_3d_cartesian.inl.

References lass::prim::impl::Plane3DCartesian< T, NormalizingPolicy >::d_, and lass::prim::impl::Plane3DCartesian< T, NormalizingPolicy >::normal_.


Member Function Documentation

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

template<typename T , class NP >
void lass::prim::impl::Plane3DCartesian< T, NP >::getDirections ( TVector oDirectionU,
TVector oDirectionV 
) const [inline]

template<typename T , class NP >
const Plane3DCartesian< T, NP >::TVector lass::prim::impl::Plane3DCartesian< T, NP >::directionU (  )  const [inline]

template<typename T , class NP >
const Plane3DCartesian< T, NP >::TVector lass::prim::impl::Plane3DCartesian< T, NP >::directionV (  )  const [inline]

template<typename T , class NP >
void lass::prim::impl::Plane3DCartesian< T, NP >::getReciprocals ( TVector oReciprocalU,
TVector oReciprocalV 
) const [inline]

template<typename T , class NP >
const Plane3DCartesian< T, NP >::TVector lass::prim::impl::Plane3DCartesian< T, NP >::reciprocalU (  )  const [inline]

template<typename T , class NP >
const Plane3DCartesian< T, NP >::TVector lass::prim::impl::Plane3DCartesian< T, NP >::reciprocalV (  )  const [inline]

template<typename T , class NP >
void lass::prim::impl::Plane3DCartesian< T, NP >::getCartesian ( TVector oNormal,
TReference  oD 
) const [inline]

template<typename T , class NP >
const Plane3DCartesian< T, NP >::TVector & lass::prim::impl::Plane3DCartesian< T, NP >::normal (  )  const [inline]

template<typename T , class NP >
const Plane3DCartesian< T, NP >::TParam lass::prim::impl::Plane3DCartesian< T, NP >::d (  )  const [inline]

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

template<typename T , class NP >
const Plane3DCartesian< T, NP >::TValue lass::prim::impl::Plane3DCartesian< T, NP >::equation ( const TPoint iPoint,
TParam  iRelativeTolerance 
) const [inline]

template<typename T , class NP >
const Plane3DCartesian< T, NP >::TVector lass::prim::impl::Plane3DCartesian< 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 272 of file plane_3d_cartesian.inl.

References lass::prim::impl::Plane3DCartesian< T, NormalizingPolicy >::equation(), and lass::prim::impl::Plane3DCartesian< T, NormalizingPolicy >::normal_.

Referenced by lass::prim::impl::Plane3DCartesian< T, NormalizingPolicy >::project(), and lass::prim::impl::Plane3DCartesian< T, NormalizingPolicy >::reflect().

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

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

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 285 of file plane_3d_cartesian.inl.

References lass::prim::dot(), and lass::prim::impl::Plane3DCartesian< T, NormalizingPolicy >::normal_.

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

project a point orthogonally onto the plane

Definition at line 296 of file plane_3d_cartesian.inl.

References lass::prim::impl::Plane3DCartesian< T, NormalizingPolicy >::reject().

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

project a vector orthogonally onto the plane

Definition at line 307 of file plane_3d_cartesian.inl.

References lass::prim::impl::Plane3DCartesian< T, NormalizingPolicy >::reject().

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

reflect a point orthogonally into the plane.

Definition at line 318 of file plane_3d_cartesian.inl.

References lass::prim::impl::Plane3DCartesian< T, NormalizingPolicy >::reject().

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

reflect a vector orthogonally into the plane

Definition at line 329 of file plane_3d_cartesian.inl.

References lass::prim::impl::Plane3DCartesian< T, NormalizingPolicy >::reject().

template<typename T , class NP >
const Plane3DCartesian< T, NP >::TPoint lass::prim::impl::Plane3DCartesian< T, NP >::point ( TParam  iU,
TParam  iV 
) const [inline]

return point by filling in the parametric equation: P(u, v) = S + u * U + v * V

Definition at line 340 of file plane_3d_cartesian.inl.

template<typename T , class NP >
const Plane3DCartesian< T, NP >::TPoint lass::prim::impl::Plane3DCartesian< T, NP >::point ( const TUV iUV  )  const [inline]

template<typename T , class NP >
const Plane3DCartesian< T, NP >::TUV lass::prim::impl::Plane3DCartesian< T, NP >::uv ( const TPoint iPoint  )  const [inline]

template<typename T , class NP >
void lass::prim::impl::Plane3DCartesian< T, NP >::flip (  )  [inline]

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


Field Documentation

template<typename T , class NormalizingPolicy = Normalized>
TVector lass::prim::impl::Plane3DCartesian< T, NormalizingPolicy >::normal_ [private]

template<typename T , class NormalizingPolicy = Normalized>
TValue lass::prim::impl::Plane3DCartesian< T, NormalizingPolicy >::d_ [private]


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

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