library of assembled shared sources

http://lass.cocamware.com

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

3D Point More...

#include <point_3d.h>


Data Structures

struct  Rebind

Public Types

enum  { dimension = TVector::dimension }
typedef Point3D< T > TSelf
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

 Point3D ()
 Point3D (TParam x, TParam y, TParam z)
template<typename U >
 Point3D (const Point3D< U > &other)
template<typename U >
 Point3D (const Vector3D< U > &position)
template<typename U >
 Point3D (const U &x, const U &y, const U &z)
const TVector position () const
TConstReference operator[] (size_t index) const
TReference operator[] (size_t index)
TConstReference at (signed index) const
 Wrap index around range.
TReference at (signed index)
 Wrap index around range.
Point3D< T > & operator+= (const Vector3D< T > &offset)
Point3D< T > & operator-= (const Vector3D< T > &offset)
const bool isZero () const
const bool isNaN () const
 Return true if at least one of the components is NaN.

Data Fields

TValue x
TValue y
TValue z

Related Functions

(Note that these are not member functions.)

template<typename T >
bool operator== (const Point3D< T > &a, const Point3D< T > &b)
template<typename T >
bool operator!= (const Point3D< T > &a, const Point3D< T > &b)
template<typename T >
Point3D< T > operator+ (const Point3D< T > &a, const Vector3D< T > &b)
template<typename T >
Point3D< T > operator- (const Point3D< T > &a, const Vector3D< T > &b)
template<typename T >
Point3D< T > operator+ (const Vector3D< T > &a, const Point3D< T > &b)
template<typename T >
Vector3D< T > operator- (const Point3D< T > &a, const Point3D< T > &b)
template<typename T >
Point3D< T >::TValue distance (const Point3D< T > &a, const Point3D< T > &b)
 return the distance between two points
template<typename T >
Point3D< T > pointwiseMin (const Point3D< T > &a, const Point3D< T > &b)
 return a point with, for each coordinate, the minimum value of a and b
template<typename T >
Point3D< T > lerp (const Point3D< T > &a, const Point3D< T > &b, typename Point3D< T >::TParam t)
 interpolate linearly between two points: a + t * (b - a)
template<typename T >
Point3D< T > pointwiseMax (const Point3D< T > &a, const Point3D< T > &b)
 return a point with, for each coordinate, the maximum value of a and b
template<typename T >
std::ostream & operator<< (std::ostream &stream, const Point3D< T > &b)
template<typename T >
io::XmlOStreamoperator<< (io::XmlOStream &stream, const Point3D< T > &b)
template<typename T >
std::istream & operator>> (std::istream &stream, Point3D< T > &b)


Detailed Description

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

3D Point

Author:
BdG
Date:
2003

Definition at line 70 of file point_3d.h.


Member Typedef Documentation

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

Definition at line 74 of file point_3d.h.

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

Definition at line 76 of file point_3d.h.

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

Definition at line 78 of file point_3d.h.

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

Definition at line 79 of file point_3d.h.

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

Definition at line 80 of file point_3d.h.

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

Definition at line 81 of file point_3d.h.

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

Definition at line 82 of file point_3d.h.


Member Enumeration Documentation

template<typename T >
anonymous enum

Enumerator:
dimension 

Definition at line 84 of file point_3d.h.


Constructor & Destructor Documentation

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

Definition at line 62 of file point_3d.inl.

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

template<typename T >
lass::prim::Point3D< T >::Point3D ( TParam  x,
TParam  y,
TParam  z 
) [inline]

Definition at line 73 of file point_3d.inl.

template<typename T >
template<typename U >
lass::prim::Point3D< T >::Point3D ( const Point3D< U > &  other  )  [inline, explicit]

Definition at line 84 of file point_3d.inl.

template<typename T >
template<typename U >
lass::prim::Point3D< T >::Point3D ( const Vector3D< U > &  position  )  [inline, explicit]

Definition at line 95 of file point_3d.inl.

template<typename T >
template<typename U >
lass::prim::Point3D< T >::Point3D ( const U &  x,
const U &  y,
const U &  z 
) [inline, explicit]

Definition at line 106 of file point_3d.inl.


Member Function Documentation

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

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

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

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

Wrap index around range.

Definition at line 148 of file point_3d.inl.

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

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

Wrap index around range.

Definition at line 159 of file point_3d.inl.

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

template<typename T >
Point3D<T>& lass::prim::Point3D< T >::operator+= ( const Vector3D< T > &  offset  ) 

template<typename T >
Point3D<T>& lass::prim::Point3D< T >::operator-= ( const Vector3D< T > &  offset  ) 

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

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

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

Definition at line 200 of file point_3d.inl.

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


Friends And Related Function Documentation

template<typename T >
bool operator== ( const Point3D< T > &  a,
const Point3D< T > &  b 
) [related]

template<typename T >
bool operator!= ( const Point3D< T > &  a,
const Point3D< T > &  b 
) [related]

Definition at line 222 of file point_3d.inl.

template<typename T >
Point3D< T > operator+ ( const Point3D< T > &  a,
const Vector3D< T > &  b 
) [related]

Definition at line 232 of file point_3d.inl.

template<typename T >
Point3D< T > operator- ( const Point3D< T > &  a,
const Vector3D< T > &  b 
) [related]

Definition at line 244 of file point_3d.inl.

template<typename T >
Point3D< T > operator+ ( const Vector3D< T > &  a,
const Point3D< T > &  b 
) [related]

Definition at line 256 of file point_3d.inl.

template<typename T >
Vector3D< T > operator- ( const Point3D< T > &  a,
const Point3D< T > &  b 
) [related]

template<typename T >
Point3D< T >::TValue distance ( const Point3D< T > &  a,
const Point3D< T > &  b 
) [related]

return the distance between two points

Definition at line 279 of file point_3d.inl.

References lass::prim::Vector3D< T >::norm().

template<typename T >
Point3D< T > pointwiseMin ( const Point3D< T > &  a,
const Point3D< T > &  b 
) [related]

return a point with, for each coordinate, the minimum value of a and b

Definition at line 300 of file point_3d.inl.

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

template<typename T >
Point3D< T > lerp ( const Point3D< T > &  a,
const Point3D< T > &  b,
typename Point3D< T >::TParam  t 
) [related]

interpolate linearly between two points: a + t * (b - a)

Definition at line 311 of file point_3d.inl.

References lass::prim::lerp(), and lass::prim::Point3D< T >::position().

template<typename T >
Point3D< T > pointwiseMax ( const Point3D< T > &  a,
const Point3D< T > &  b 
) [related]

return a point with, for each coordinate, the maximum value of a and b

Definition at line 322 of file point_3d.inl.

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

template<typename T >
std::ostream & operator<< ( std::ostream &  stream,
const Point3D< T > &  b 
) [related]

Definition at line 332 of file point_3d.inl.

References LASS_ENFORCE_STREAM.

template<typename T >
io::XmlOStream & operator<< ( io::XmlOStream stream,
const Point3D< T > &  b 
) [related]

Definition at line 343 of file point_3d.inl.

References LASS_ENFORCE_STREAM.

template<typename T >
std::istream & operator>> ( std::istream &  stream,
Point3D< T > &  b 
) [related]

Definition at line 354 of file point_3d.inl.

References LASS_ENFORCE_STREAM.


Field Documentation

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

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

template<typename T >
TValue lass::prim::Point3D< 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