library of assembled shared sources

http://lass.cocamware.com

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

#include <point_2d.h>

Inheritance diagram for lass::prim::Point2D< T >:

Inheritance graph
[legend]

Data Structures

struct  Rebind

Public Types

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

 Point2D ()
 Point2D (TParam x, TParam y)
template<typename U >
 Point2D (const Point2D< U > &other)
template<typename U >
 Point2D (const Vector2D< U > &position)
template<typename U >
 Point2D (const U &x, const U &y)
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.
Point2D< T > & operator+= (const Vector2D< T > &offset)
Point2D< T > & operator-= (const Vector2D< 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

Related Functions

(Note that these are not member functions.)

template<typename T >
bool operator== (const Point2D< T > &a, const Point2D< T > &b)
template<typename T >
bool operator!= (const Point2D< T > &a, const Point2D< T > &b)
template<typename T >
Point2D< T > operator+ (const Point2D< T > &a, const Vector2D< T > &b)
template<typename T >
Point2D< T > operator+ (const Vector2D< T > &a, const Point2D< T > &b)
template<typename T >
Point2D< T > operator- (const Point2D< T > &a, const Vector2D< T > &b)
template<typename T >
Vector2D< T > operator- (const Point2D< T > &a, const Point2D< T > &b)
template<typename T >
Point2D< T >::TValue distance (const Point2D< T > &a, const Point2D< T > &b)
template<typename T >
Point2D< T >::TValue squaredDistance (const Point2D< T > &a, const Point2D< T > &b)
template<typename T >
Point2D< T > pointwiseMin (const Point2D< T > &a, const Point2D< T > &b)
 return a point with, for each coordinate, the minimum value of a and b
template<typename T >
Point2D< T > pointwiseMax (const Point2D< T > &a, const Point2D< T > &b)
 return a point with, for each coordinate, the maximum value of a and b
template<typename T >
Point2D< T > lerp (const Point2D< T > &a, const Point2D< T > &b, typename Point2D< T >::TParam t)
 interpolate linearly between two points: a + t * (b - a)
template<typename T >
std::ostream & operator<< (std::ostream &stream, const Point2D< T > &b)
template<typename T >
io::XmlOStreamoperator<< (io::XmlOStream &stream, const Point2D< T > &b)
template<typename T >
lass::io::MatlabOStreamoperator<< (lass::io::MatlabOStream &stream, const Point2D< T > &b)
template<typename T >
std::istream & operator>> (std::istream &stream, Point2D< T > &b)
template<typename T >
doubleTriangleArea (const Point2D< T > &a, const Point2D< T > &b, const Point2D< T > &c)
 returns twice signed area of triangle a,b,c
template<typename T >
bool ccw (const Point2D< T > &a, const Point2D< T > &b, const Point2D< T > &c)
 returns true when the line b->c is counter clockwise oriented with respect to a->b
template<typename T >
bool cw (const Point2D< T > &a, const Point2D< T > &b, const Point2D< T > &c)
 returns true when the line b->c is clockwise oriented with respect to a->b
template<typename T >
bool weakCcw (const Point2D< T > &a, const Point2D< T > &b, const Point2D< T > &c)
 returns true when the line b->c is counter clockwise oriented with respect to a->b.
template<typename T >
bool weakCw (const Point2D< T > &a, const Point2D< T > &b, const Point2D< T > &c)
 returns true when the line b->c is counter clockwise oriented with respect to a->b.
template<typename T >
bool inCircle (const Point2D< T > &a, const Point2D< T > &b, const Point2D< T > &c, const Point2D< T > &d)
 returns true when the point d is strictly (within numerical precision) in the circle going through a, b and c.
template<typename T >
Point3D< T >::TValue squaredDistance (const Point3D< T > &a, const Point3D< T > &b)

Detailed Description

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

Definition at line 69 of file point_2d.h.


Member Typedef Documentation

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

Definition at line 73 of file point_2d.h.

template<typename T >
typedef Vector2D<T> lass::prim::Point2D< T >::TVector

Definition at line 75 of file point_2d.h.

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

Definition at line 77 of file point_2d.h.

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

Definition at line 78 of file point_2d.h.

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

Definition at line 79 of file point_2d.h.

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

Definition at line 80 of file point_2d.h.

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

Definition at line 81 of file point_2d.h.


Member Enumeration Documentation

template<typename T >
anonymous enum

Enumerator:
dimension 

Definition at line 83 of file point_2d.h.


Constructor & Destructor Documentation

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

Definition at line 56 of file point_2d.inl.

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

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

Definition at line 66 of file point_2d.inl.

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

Definition at line 76 of file point_2d.inl.

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

Definition at line 86 of file point_2d.inl.

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

Definition at line 96 of file point_2d.inl.


Member Function Documentation

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

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

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

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

Wrap index around range.

Definition at line 137 of file point_2d.inl.

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

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

Wrap index around range.

Definition at line 148 of file point_2d.inl.

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

template<typename T >
Point2D< T > & lass::prim::Point2D< T >::operator+= ( const Vector2D< T > &  offset  )  [inline]

template<typename T >
Point2D< T > & lass::prim::Point2D< T >::operator-= ( const Vector2D< T > &  offset  )  [inline]

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

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

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

Definition at line 188 of file point_2d.inl.

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


Friends And Related Function Documentation

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

Definition at line 200 of file point_2d.inl.

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

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

Definition at line 210 of file point_2d.inl.

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

Definition at line 220 of file point_2d.inl.

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

Definition at line 232 of file point_2d.inl.

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

Definition at line 244 of file point_2d.inl.

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

Definition at line 256 of file point_2d.inl.

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

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

Definition at line 266 of file point_2d.inl.

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

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

Definition at line 275 of file point_2d.inl.

References lass::prim::Vector2D< T >::squaredNorm().

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

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

Definition at line 286 of file point_2d.inl.

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

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

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

Definition at line 297 of file point_2d.inl.

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

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

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

Definition at line 308 of file point_2d.inl.

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

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

Definition at line 318 of file point_2d.inl.

References LASS_ENFORCE_STREAM.

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

Definition at line 329 of file point_2d.inl.

References LASS_ENFORCE_STREAM.

template<typename T >
lass::io::MatlabOStream & operator<< ( lass::io::MatlabOStream stream,
const Point2D< T > &  b 
) [related]

Definition at line 341 of file point_2d.inl.

References LASS_ENFORCE_STREAM.

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

Definition at line 355 of file point_2d.inl.

References LASS_ENFORCE_STREAM.

template<typename T >
T doubleTriangleArea ( const Point2D< T > &  a,
const Point2D< T > &  b,
const Point2D< T > &  c 
) [related]

returns twice signed area of triangle a,b,c

Definition at line 372 of file point_2d.inl.

References lass::prim::perpDot().

template<typename T >
bool ccw ( const Point2D< T > &  a,
const Point2D< T > &  b,
const Point2D< T > &  c 
) [related]

returns true when the line b->c is counter clockwise oriented with respect to a->b

Definition at line 402 of file point_2d.inl.

References lass::prim::doubleTriangleArea(), and lass::stde::T.

template<typename T >
bool cw ( const Point2D< T > &  a,
const Point2D< T > &  b,
const Point2D< T > &  c 
) [related]

returns true when the line b->c is clockwise oriented with respect to a->b

Definition at line 411 of file point_2d.inl.

References lass::prim::doubleTriangleArea(), and lass::stde::T.

template<typename T >
bool weakCcw ( const Point2D< T > &  a,
const Point2D< T > &  b,
const Point2D< T > &  c 
) [related]

returns true when the line b->c is counter clockwise oriented with respect to a->b.

When c is in line of a and b also returns true.

Definition at line 422 of file point_2d.inl.

References lass::prim::doubleTriangleArea(), and lass::stde::T.

template<typename T >
bool weakCw ( const Point2D< T > &  a,
const Point2D< T > &  b,
const Point2D< T > &  c 
) [related]

returns true when the line b->c is counter clockwise oriented with respect to a->b.

When c is in line of a and b also returns true.

Definition at line 432 of file point_2d.inl.

References lass::prim::doubleTriangleArea(), and lass::stde::T.

template<typename T >
bool inCircle ( const Point2D< T > &  a,
const Point2D< T > &  b,
const Point2D< T > &  c,
const Point2D< T > &  d 
) [related]

returns true when the point d is strictly (within numerical precision) in the circle going through a, b and c.

Note:
this test is used for establishing Delaunay neighborhoods and this tests numerical stability determines the overall stability of the Delaunay meshers

Definition at line 444 of file point_2d.inl.

References lass::prim::doubleTriangleArea(), lass::prim::Point2D< T >::position(), lass::prim::Vector2D< T >::squaredNorm(), and lass::stde::T.

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

Definition at line 288 of file point_3d.inl.

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


Field Documentation

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

Definition at line 90 of file point_2d.h.

Referenced by lass::spat::PlanarMesh::along(), lass::prim::Point2D< T >::at(), lass::prim::Aabb2D< T, MinMaxPolicy >::classify(), lass::prim::Aabb2D< T, MinMaxPolicy >::collides(), lass::prim::Aabb2D< T, MinMaxPolicy >::contains(), lass::num::cosineHemisphere(), lass::spat::PlanarMesh::fastAlong(), lass::spat::impl::fastIntersect(), lass::prim::Aabb2D< T, MinMaxPolicy >::grow(), lass::prim::TriangleMesh3D< T, BoundingVolumeHierarchy, SplitHeuristics >::Triangle::intersect(), lass::prim::Aabb2D< T, MinMaxPolicy >::isEmpty(), lass::prim::Point2D< T >::isNaN(), lass::prim::Aabb2D< T, MinMaxPolicy >::isValid(), lass::prim::Point2D< T >::isZero(), lass::prim::Point2D< T >::operator+=(), lass::prim::Point2D< T >::operator-(), lass::prim::Point2D< T >::operator-=(), lass::prim::Aabb2D< T, MinMaxPolicy >::operator<<(), lass::prim::Point2D< T >::operator==(), lass::prim::Point2D< T >::operator[](), lass::prim::impl::Plane3DParametric< T, NormalizingPolicy >::point(), lass::prim::impl::Plane3DCombined< T, NormalizingPolicy >::point(), lass::prim::impl::Plane3DCartesian< T, NormalizingPolicy >::point(), lass::prim::Parallelogram3D< T >::point(), lass::prim::Point2D< T >::pointwiseMax(), lass::prim::Point2D< T >::pointwiseMin(), lass::prim::Point2D< T >::position(), lass::spat::PlanarMesh::snap(), lass::prim::Transformation2D< T >::transform(), lass::io::Image::transformColors(), lass::num::uniformCone(), lass::num::uniformDisk(), and lass::num::uniformSphere().

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


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