library of assembled shared sources |
http://lass.cocamware.com |
#include <point_2d.h>
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::XmlOStream & | operator<< (io::XmlOStream &stream, const Point2D< T > &b) |
template<typename T > | |
lass::io::MatlabOStream & | operator<< (lass::io::MatlabOStream &stream, const Point2D< T > &b) |
template<typename T > | |
std::istream & | operator>> (std::istream &stream, Point2D< T > &b) |
template<typename T > | |
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) |
Definition at line 69 of file point_2d.h.
typedef Point2D<T> lass::prim::Point2D< T >::TSelf |
Definition at line 73 of file point_2d.h.
typedef Vector2D<T> lass::prim::Point2D< T >::TVector |
Definition at line 75 of file point_2d.h.
typedef TVector::TValue lass::prim::Point2D< T >::TValue |
Definition at line 77 of file point_2d.h.
typedef TVector::TParam lass::prim::Point2D< T >::TParam |
Definition at line 78 of file point_2d.h.
typedef TVector::TReference lass::prim::Point2D< T >::TReference |
Definition at line 79 of file point_2d.h.
typedef TVector::TConstReference lass::prim::Point2D< T >::TConstReference |
Definition at line 80 of file point_2d.h.
typedef TVector::TNumTraits lass::prim::Point2D< T >::TNumTraits |
Definition at line 81 of file point_2d.h.
anonymous enum |
lass::prim::Point2D< T >::Point2D | ( | ) | [inline] |
Definition at line 56 of file point_2d.inl.
References lass::prim::Point2D< T >::isZero(), and LASS_ASSERT.
lass::prim::Point2D< T >::Point2D | ( | TParam | x, | |
TParam | y | |||
) | [inline] |
Definition at line 66 of file point_2d.inl.
lass::prim::Point2D< T >::Point2D | ( | const Point2D< U > & | other | ) | [inline, explicit] |
Definition at line 76 of file point_2d.inl.
lass::prim::Point2D< T >::Point2D | ( | const Vector2D< U > & | position | ) | [inline, explicit] |
Definition at line 86 of file point_2d.inl.
lass::prim::Point2D< T >::Point2D | ( | const U & | x, | |
const U & | y | |||
) | [inline, explicit] |
Definition at line 96 of file point_2d.inl.
const Point2D< T >::TVector lass::prim::Point2D< T >::position | ( | ) | const [inline] |
Definition at line 106 of file point_2d.inl.
References lass::prim::Point2D< T >::x, and lass::prim::Point2D< T >::y.
Referenced by lass::prim::SimplePolygon2D< T, DegeneratePolicy >::contains(), lass::num::cosineHemisphere(), lass::prim::impl::Line2DParametric< T, NormalizingPolicy >::equation(), lass::prim::impl::Line2DCombined< T, NormalizingPolicy >::equation(), lass::prim::impl::Line2DCartesian< T, NormalizingPolicy >::equation(), lass::prim::impl::Line2DParametric< T, NormalizingPolicy >::getCartesian(), lass::prim::Point2D< T >::inCircle(), lass::prim::Point2D< T >::lerp(), lass::prim::impl::Line2DCartesian< T, NormalizingPolicy >::Line2DCartesian(), lass::prim::impl::Line2DCombined< T, NormalizingPolicy >::Line2DCombined(), lass::prim::TriangleMesh3D< T, BoundingVolumeHierarchy, SplitHeuristics >::loopSubdivision(), and lass::prim::TriangleMesh3D< T, BoundingVolumeHierarchy, SplitHeuristics >::subdivide().
Point2D< T >::TConstReference lass::prim::Point2D< T >::operator[] | ( | size_t | index | ) | const [inline] |
Definition at line 115 of file point_2d.inl.
References lass::prim::Point2D< T >::dimension, LASS_ASSERT, and lass::prim::Point2D< T >::x.
Point2D< T >::TReference lass::prim::Point2D< T >::operator[] | ( | size_t | index | ) | [inline] |
Definition at line 125 of file point_2d.inl.
References lass::prim::Point2D< T >::dimension, LASS_ASSERT, and lass::prim::Point2D< T >::x.
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.
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.
Point2D< T > & lass::prim::Point2D< T >::operator+= | ( | const Vector2D< T > & | offset | ) | [inline] |
Definition at line 157 of file point_2d.inl.
References lass::prim::Vector2D< T >::x, lass::prim::Point2D< T >::x, lass::prim::Vector2D< T >::y, and lass::prim::Point2D< T >::y.
Point2D< T > & lass::prim::Point2D< T >::operator-= | ( | const Vector2D< T > & | offset | ) | [inline] |
Definition at line 168 of file point_2d.inl.
References lass::prim::Vector2D< T >::x, lass::prim::Point2D< T >::x, lass::prim::Vector2D< T >::y, and lass::prim::Point2D< T >::y.
const bool lass::prim::Point2D< T >::isZero | ( | ) | const [inline] |
Definition at line 178 of file point_2d.inl.
References lass::prim::Point2D< T >::x, lass::prim::Point2D< T >::y, and lass::num::NumTraits< C >::zero.
Referenced by lass::prim::LineSegment2D< T, ParameterPolicy >::LineSegment2D(), lass::prim::Point2D< T >::Point2D(), and lass::prim::Ray2D< T, NormalizingPolicy, ParameterPolicy >::Ray2D().
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.
Definition at line 200 of file point_2d.inl.
References lass::prim::Point2D< T >::x, and lass::prim::Point2D< T >::y.
Definition at line 210 of file point_2d.inl.
Point2D< T > operator+ | ( | const Point2D< T > & | a, | |
const Vector2D< T > & | b | |||
) | [related] |
Definition at line 220 of file point_2d.inl.
Point2D< T > operator+ | ( | const Vector2D< T > & | a, | |
const Point2D< T > & | b | |||
) | [related] |
Definition at line 232 of file point_2d.inl.
Point2D< T > operator- | ( | const Point2D< T > & | a, | |
const Vector2D< T > & | b | |||
) | [related] |
Definition at line 244 of file point_2d.inl.
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.
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.
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.
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().
std::ostream & operator<< | ( | std::ostream & | stream, | |
const Point2D< T > & | b | |||
) | [related] |
io::XmlOStream & operator<< | ( | io::XmlOStream & | stream, | |
const Point2D< T > & | b | |||
) | [related] |
lass::io::MatlabOStream & operator<< | ( | lass::io::MatlabOStream & | stream, | |
const Point2D< T > & | b | |||
) | [related] |
std::istream & operator>> | ( | std::istream & | stream, | |
Point2D< T > & | b | |||
) | [related] |
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().
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.
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.
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.
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.
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.
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.
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().
TValue lass::prim::Point2D< T >::y |
Definition at line 91 of file point_2d.h.
Referenced by lass::spat::PlanarMesh::along(), 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::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::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().
Generated on Mon Nov 10 14:22:14 2008 for Library of Assembled Shared Sources by 1.5.7.1 |