library of assembled shared sources

http://lass.cocamware.com

lass::prim::Point3DH< T > Struct Template Reference

homogenous 3D Point More...

#include <point_3dh.h>


Data Structures

struct  Rebind

Public Types

enum  { dimension = TPoint::dimension }
typedef Point3DH< T > TSelf
typedef Point3D< T > TPoint
typedef Vector4D< T > TVector
typedef TVector::TValue TValue
typedef TVector::TParam TParam
typedef TVector::TReference TReference
typedef TVector::TConstReference TConstReference
typedef TVector::TNumTraits TNumTraits

Public Member Functions

 Point3DH ()
 Point3DH (TParam iX, TParam iY, TParam iZ, TParam iW=TNumTraits::one)
 Point3DH (const TPoint &iAffinePoint)
 Point3DH (const TVector &iPositionVector)
const TVector position () const
TConstReference operator[] (size_t iIndex) const
TReference operator[] (size_t iIndex)
TConstReference at (signed iIndex) const
 Wrap index around range.
TReference at (signed iIndex)
 Wrap index around range.
const Point3DH< T > & operator+ () const
 A weird way to get back the same object.
const Point3DH< T > operator- () const
Point3DH< T > & operator+= (const Point3DH< T > &iB)
Point3DH< T > & operator-= (const Point3DH< T > &iB)
Point3DH< T > & operator*= (TParam iB)
Point3DH< T > & operator/= (TParam iB)
const bool isZero () const
 Return true if point is origin (0, 0, 0, w).
const bool isNaN () const
 Return true if at least one of the components is NaN.
const bool isInfinite () const
 Return true if point is at infinite distance of origin.
const bool isValid () const
 Return true if point is valid.
const TParam weight () const
 Return weight of point.
const TPoint affine () const
 Return rescaled version of point with weight = 1.
void homogenize ()
 Rescale point so that weight is 1.

Data Fields

TValue x
TValue y
TValue z
TValue w

Related Functions

(Note that these are not member functions.)

template<typename T >
bool operator== (const Point3DH< T > &iA, const Point3DH< T > &iB)
template<typename T >
bool operator!= (const Point3DH< T > &iA, const Point3DH< T > &iB)
template<typename T >
Point3DH< T > operator+ (const Point3DH< T > &iA, const Point3DH< T > &iB)
template<typename T >
Point3DH< T > operator- (const Point3DH< T > &iA, const Point3DH< T > &iB)
template<typename T >
Point3DH< T > operator* (const Point3DH< T > &iA, typename Point3DH< T >::TParam iB)
template<typename T >
Point3DH< T > operator/ (const Point3DH< T > &iA, typename Point3DH< T >::TParam iB)
template<typename T >
Point3DH< T > operator* (typename Point3DH< T >::TParam iA, const Point3DH< T > &iB)
template<typename T >
std::ostream & operator<< (std::ostream &ioOStream, const Point3DH< T > &iB)
template<typename T >
io::XmlOStreamoperator<< (io::XmlOStream &oOStream, const Point3DH< T > &iB)
template<typename T >
std::istream & operator>> (std::istream &ioIStream, Point3DH< T > &oB)


Detailed Description

template<typename T>
struct lass::prim::Point3DH< T >

homogenous 3D Point

Author:
BdG
Date:
2003

Definition at line 71 of file point_3dh.h.


Member Typedef Documentation

template<typename T >
typedef Point3DH<T> lass::prim::Point3DH< T >::TSelf

Definition at line 75 of file point_3dh.h.

template<typename T >
typedef Point3D<T> lass::prim::Point3DH< T >::TPoint

Definition at line 77 of file point_3dh.h.

template<typename T >
typedef Vector4D<T> lass::prim::Point3DH< T >::TVector

Definition at line 78 of file point_3dh.h.

template<typename T >
typedef TVector::TValue lass::prim::Point3DH< T >::TValue

Definition at line 80 of file point_3dh.h.

template<typename T >
typedef TVector::TParam lass::prim::Point3DH< T >::TParam

Definition at line 81 of file point_3dh.h.

template<typename T >
typedef TVector::TReference lass::prim::Point3DH< T >::TReference

Definition at line 82 of file point_3dh.h.

template<typename T >
typedef TVector::TConstReference lass::prim::Point3DH< T >::TConstReference

Definition at line 83 of file point_3dh.h.

template<typename T >
typedef TVector::TNumTraits lass::prim::Point3DH< T >::TNumTraits

Definition at line 84 of file point_3dh.h.


Member Enumeration Documentation

template<typename T >
anonymous enum

Enumerator:
dimension 

Definition at line 86 of file point_3dh.h.


Constructor & Destructor Documentation

template<typename T >
lass::prim::Point3DH< T >::Point3DH (  )  [inline]

Definition at line 62 of file point_3dh.inl.

References lass::prim::Point3DH< T >::isZero(), and LASS_ASSERT.

Referenced by lass::prim::Point3DH< T >::operator-().

template<typename T >
lass::prim::Point3DH< T >::Point3DH ( TParam  iX,
TParam  iY,
TParam  iZ,
TParam  iW = TNumTraits::one 
) [inline]

Definition at line 74 of file point_3dh.inl.

template<typename T >
lass::prim::Point3DH< T >::Point3DH ( const TPoint iAffinePoint  )  [inline]

Definition at line 85 of file point_3dh.inl.

template<typename T >
lass::prim::Point3DH< T >::Point3DH ( const TVector iPositionVector  )  [inline, explicit]

Definition at line 96 of file point_3dh.inl.


Member Function Documentation

template<typename T >
const Point3DH< T >::TVector lass::prim::Point3DH< T >::position (  )  const [inline]

template<typename T >
Point3DH< T >::TConstReference lass::prim::Point3DH< T >::operator[] ( size_t  iIndex  )  const [inline]

template<typename T >
Point3DH< T >::TReference lass::prim::Point3DH< T >::operator[] ( size_t  iIndex  )  [inline]

template<typename T >
Point3DH< T >::TConstReference lass::prim::Point3DH< T >::at ( signed  iIndex  )  const [inline]

Wrap index around range.

Definition at line 139 of file point_3dh.inl.

References lass::prim::Point3DH< T >::dimension, lass::num::mod(), and lass::prim::Point3DH< T >::x.

template<typename T >
Point3DH< T >::TReference lass::prim::Point3DH< T >::at ( signed  iIndex  )  [inline]

Wrap index around range.

Definition at line 151 of file point_3dh.inl.

References lass::prim::Point3DH< T >::dimension, lass::num::mod(), and lass::prim::Point3DH< T >::x.

template<typename T >
const Point3DH< T > & lass::prim::Point3DH< T >::operator+ (  )  const [inline]

A weird way to get back the same object.

Definition at line 161 of file point_3dh.inl.

template<typename T >
const Point3DH< T > lass::prim::Point3DH< T >::operator- (  )  const [inline]

template<typename T >
Point3DH< T > & lass::prim::Point3DH< T >::operator+= ( const Point3DH< T > &  iB  )  [inline]

template<typename T >
Point3DH< T > & lass::prim::Point3DH< T >::operator-= ( const Point3DH< T > &  iB  )  [inline]

template<typename T >
Point3DH< T > & lass::prim::Point3DH< T >::operator*= ( TParam  iB  )  [inline]

template<typename T >
Point3DH< T > & lass::prim::Point3DH< T >::operator/= ( TParam  iB  )  [inline]

template<typename T >
const bool lass::prim::Point3DH< T >::isZero (  )  const [inline]

Return true if point is origin (0, 0, 0, w).

w may be 0 but doesn't has to be.

Definition at line 229 of file point_3dh.inl.

References lass::prim::Point3DH< T >::x, lass::prim::Point3DH< T >::y, lass::prim::Point3DH< T >::z, and lass::num::NumTraits< C >::zero.

Referenced by lass::prim::Point3DH< T >::Point3DH().

template<typename T >
const bool lass::prim::Point3DH< T >::isNaN (  )  const [inline]

Return true if at least one of the components is NaN.

Definition at line 239 of file point_3dh.inl.

References lass::prim::Point3DH< T >::w, lass::prim::Point3DH< T >::x, lass::prim::Point3DH< T >::y, and lass::prim::Point3DH< T >::z.

template<typename T >
const bool lass::prim::Point3DH< T >::isInfinite (  )  const [inline]

Return true if point is at infinite distance of origin.

test if w == 0.

Definition at line 249 of file point_3dh.inl.

References lass::prim::Point3DH< T >::w, and lass::num::NumTraits< C >::zero.

template<typename T >
const bool lass::prim::Point3DH< T >::isValid (  )  const [inline]

Return true if point is valid.

test if point != (0, 0, 0, 0)

Definition at line 259 of file point_3dh.inl.

References lass::prim::Point3DH< T >::w, lass::prim::Point3DH< T >::x, lass::prim::Point3DH< T >::y, lass::prim::Point3DH< T >::z, and lass::num::NumTraits< C >::zero.

template<typename T >
const Point3DH< T >::TParam lass::prim::Point3DH< T >::weight (  )  const [inline]

Return weight of point.

weight = w.

Definition at line 271 of file point_3dh.inl.

References lass::prim::Point3DH< T >::w.

Referenced by lass::prim::Aabb3D< T, MinMaxPolicy >::collides(), and lass::prim::Aabb3D< T, MinMaxPolicy >::intersects().

template<typename T >
const Point3D< T > lass::prim::Point3DH< T >::affine (  )  const [inline]

Return rescaled version of point with weight = 1.

Does not influence original poitn.

Definition at line 282 of file point_3dh.inl.

References lass::prim::Point3DH< T >::homogenize(), lass::prim::Point3DH< T >::x, lass::prim::Point3DH< T >::y, and lass::prim::Point3DH< T >::z.

Referenced by lass::prim::Aabb3D< T, MinMaxPolicy >::boundingSphere().

template<typename T >
void lass::prim::Point3DH< T >::homogenize (  )  [inline]


Friends And Related Function Documentation

template<typename T >
bool operator== ( const Point3DH< T > &  iA,
const Point3DH< T > &  iB 
) [related]

template<typename T >
bool operator!= ( const Point3DH< T > &  iA,
const Point3DH< T > &  iB 
) [related]

Definition at line 320 of file point_3dh.inl.

template<typename T >
Point3DH< T > operator+ ( const Point3DH< T > &  iA,
const Point3DH< T > &  iB 
) [related]

Definition at line 330 of file point_3dh.inl.

template<typename T >
Point3DH< T > operator- ( const Point3DH< T > &  iA,
const Point3DH< T > &  iB 
) [related]

Definition at line 342 of file point_3dh.inl.

References lass::prim::Point3DH< T >::position().

template<typename T >
Point3DH< T > operator* ( const Point3DH< T > &  iA,
typename Point3DH< T >::TParam  iB 
) [related]

Definition at line 354 of file point_3dh.inl.

template<typename T >
Point3DH< T > operator/ ( const Point3DH< T > &  iA,
typename Point3DH< T >::TParam  iB 
) [related]

Definition at line 366 of file point_3dh.inl.

template<typename T >
Point3DH< T > operator* ( typename Point3DH< T >::TParam  iA,
const Point3DH< T > &  iB 
) [related]

Definition at line 378 of file point_3dh.inl.

template<typename T >
std::ostream & operator<< ( std::ostream &  ioOStream,
const Point3DH< T > &  iB 
) [related]

Definition at line 390 of file point_3dh.inl.

References LASS_ENFORCE_STREAM.

template<typename T >
io::XmlOStream & operator<< ( io::XmlOStream oOStream,
const Point3DH< T > &  iB 
) [related]

Definition at line 401 of file point_3dh.inl.

References LASS_ENFORCE_STREAM.

template<typename T >
std::istream & operator>> ( std::istream &  ioIStream,
Point3DH< T > &  oB 
) [related]

Definition at line 414 of file point_3dh.inl.

References LASS_ENFORCE_STREAM.


Field Documentation

template<typename T >
TValue lass::prim::Point3DH< T >::x

template<typename T >
TValue lass::prim::Point3DH< T >::y

template<typename T >
TValue lass::prim::Point3DH< T >::z

template<typename T >
TValue lass::prim::Point3DH< T >::w


The documentation for this struct 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