49#ifndef LASS_GUARDIAN_OF_INCLUSION_PRIM_POINT_2DH_H
50#define LASS_GUARDIAN_OF_INCLUSION_PRIM_POINT_2DH_H
66 typedef Point2DH<T> TSelf;
68 typedef Point2D<T> TPoint;
71 typedef typename TVector::TValue TValue;
72 typedef typename TVector::TParam TParam;
73 typedef typename TVector::TReference TReference;
74 typedef typename TVector::TConstReference TConstReference;
75 typedef typename TVector::TNumTraits TNumTraits;
77 enum { dimension = TPoint::dimension };
79 template <
typename U>
struct Rebind
81 typedef Point2DH<U> Type;
89 Point2DH(TParam iX, TParam iY, TParam iZ = TNumTraits::one);
90 Point2DH(
const TPoint& iAffinePoint);
91 explicit Point2DH(
const TVector& iPositionVector);
93 const TVector position()
const;
94 TConstReference operator[](
size_t iIndex)
const;
95 TReference operator[](
size_t iIndex);
96 TConstReference
at(
signed iIndex)
const;
97 TReference
at(
signed iIndex);
100 const Point2DH<T> operator-()
const;
102 Point2DH<T>& operator+=(
const Point2DH<T>& iB);
103 Point2DH<T>& operator-=(
const Point2DH<T>& iB);
104 Point2DH<T>& operator*=(TParam iB);
105 Point2DH<T>& operator/=(TParam iB);
123template<
typename T>
Point2DH<T> operator+(
const Point2D<T>& iA,
const Point2D<T>& iB);
130template<
typename T> std::ostream& operator<<(std::ostream& oOStream,
const Point2DH<T>& iB);
132template<
typename T> std::istream& operator>>(std::istream& ioIStream,
Point2DH<T>& oB);
Output stream for writing a selection of geometric primitives to XML files.
#define LASS_SIMD_ALIGN
if LASS_SIMD_ALIGNMENT is set, use LASS_SIMD_ALIGN to align some structures on SIMD alignment boundar...
set of geometrical primitives
Library for Assembled Shared Sources.
void homogenize()
Rescale point so that weight is 1.
bool isValid() const
Return true if point is valid.
TReference at(signed iIndex)
Wrap index around range.
TConstReference at(signed iIndex) const
Wrap index around range.
bool isNaN() const
Return true if at least one of the components is NaN.
bool isZero() const
Return true if point is origin (0, 0, z).
bool isInfinite() const
Return true if point is at infinite distance of origin.
const Point2D< T > affine() const
Return rescaled version of point with weight = 1.
const Point2DH< T > & operator+() const
A weird way to get back the same object.
const TValue weight() const
Return weight of point.