library of assembled shared sources

http://lass.cocamware.com

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

homogenous 2D Point More...

#include <point_2dh.h>


Data Structures

struct  Rebind

Public Types

enum  { dimension = TPoint::dimension }
typedef Point2DH< T > TSelf
typedef Point2D< T > TPoint
typedef Vector3D< 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

 Point2DH ()
 Point2DH (TParam iX, TParam iY, TParam iZ=TNumTraits::one)
 Point2DH (const TPoint &iAffinePoint)
 Point2DH (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 Point2DH< T > & operator+ () const
 A weird way to get back the same object.
const Point2DH< T > operator- () const
Point2DH< T > & operator+= (const Point2DH< T > &iB)
Point2DH< T > & operator-= (const Point2DH< T > &iB)
Point2DH< T > & operator*= (TParam iB)
Point2DH< T > & operator/= (TParam iB)
const bool isZero () const
 Return true if point is origin (0, 0, z).
const bool isInfinite () const
 Return true if point is at infinite distance of origin.
const bool isNaN () const
 Return true if at least one of the components is NaN.
const bool isValid () const
 Return true if point is valid.
const TValue weight () const
 Return weight of point.
const Point2D< T > 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

Related Functions

(Note that these are not member functions.)

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


Detailed Description

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

homogenous 2D Point

Author:
BdG
Date:
2003

Definition at line 62 of file point_2dh.h.


Member Typedef Documentation

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

Definition at line 66 of file point_2dh.h.

template<typename T >
typedef Point2D<T> lass::prim::Point2DH< T >::TPoint

Definition at line 68 of file point_2dh.h.

template<typename T >
typedef Vector3D<T> lass::prim::Point2DH< T >::TVector

Definition at line 69 of file point_2dh.h.

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

Definition at line 71 of file point_2dh.h.

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

Definition at line 72 of file point_2dh.h.

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

Definition at line 73 of file point_2dh.h.

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

Definition at line 74 of file point_2dh.h.

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

Definition at line 75 of file point_2dh.h.


Member Enumeration Documentation

template<typename T >
anonymous enum

Enumerator:
dimension 

Definition at line 77 of file point_2dh.h.


Constructor & Destructor Documentation

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

Definition at line 54 of file point_2dh.inl.

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

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

Definition at line 65 of file point_2dh.inl.

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

Definition at line 75 of file point_2dh.inl.

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

Definition at line 85 of file point_2dh.inl.


Member Function Documentation

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

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

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

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

Wrap index around range.

Definition at line 127 of file point_2dh.inl.

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

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

Wrap index around range.

Definition at line 138 of file point_2dh.inl.

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

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

A weird way to get back the same object.

Definition at line 148 of file point_2dh.inl.

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

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

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

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

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

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

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

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

Definition at line 212 of file point_2dh.inl.

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

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

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

Return true if point is at infinite distance of origin.

test if z == 0.

Definition at line 232 of file point_2dh.inl.

References lass::prim::Point2DH< T >::z, and lass::num::NumTraits< C >::zero.

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

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

Definition at line 222 of file point_2dh.inl.

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

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

Return true if point is valid.

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

Definition at line 242 of file point_2dh.inl.

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

template<typename T >
const Point2DH< T >::TValue lass::prim::Point2DH< T >::weight (  )  const [inline]

Return weight of point.

weight = z.

Definition at line 252 of file point_2dh.inl.

References lass::prim::Point2DH< T >::z.

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

template<typename T >
const Point2D< T > lass::prim::Point2DH< T >::affine (  )  const [inline]

Return rescaled version of point with weight = 1.

Does not influence original poitn.

Definition at line 263 of file point_2dh.inl.

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

Referenced by lass::prim::Line2D< T, EquationPolicy, NormalizingPolicy >::intersect(), and lass::prim::Triangle2D< T >::partialVoronoiArea().

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


Friends And Related Function Documentation

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

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

Definition at line 300 of file point_2dh.inl.

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

Definition at line 310 of file point_2dh.inl.

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

Definition at line 322 of file point_2dh.inl.

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

Definition at line 334 of file point_2dh.inl.

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

Definition at line 346 of file point_2dh.inl.

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

Definition at line 358 of file point_2dh.inl.

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

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

Definition at line 370 of file point_2dh.inl.

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

Definition at line 382 of file point_2dh.inl.

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

Definition at line 394 of file point_2dh.inl.

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

Definition at line 406 of file point_2dh.inl.

References LASS_ENFORCE_STREAM.

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

Definition at line 417 of file point_2dh.inl.

References LASS_ENFORCE_STREAM.

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

Definition at line 429 of file point_2dh.inl.

References LASS_ENFORCE.


Field Documentation

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

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

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


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