28 #ifndef LSST_AFW_GEOM_POINT_H 29 #define LSST_AFW_GEOM_POINT_H 41 template <
typename T,
int N>
134 for (
size_t i = 0; i < N; ++i) {
147 template <
typename Vector>
148 explicit PointBase(Eigen::MatrixBase<Vector>
const &vector) : Super(vector) {}
156 template <
typename T,
int N>
180 template <
typename U>
184 explicit Point(EigenVector
const &vector) : Super(vector) {}
197 template <
typename T>
221 template <
typename U>
225 explicit Point(EigenVector
const &vector) : Super(vector) {}
231 explicit Point(T
x, T y) : Super(EigenVector(x, y)) {}
234 explicit Point(T
const xy[2]) : Super(EigenVector(xy[0], xy[1])) {}
250 template <
typename T>
274 template <
typename U>
278 explicit Point(EigenVector
const &vector) : Super(vector) {}
284 explicit Point(T
x, T y, T z) : Super(EigenVector(x, y, z)) {}
287 explicit Point(T
const xyz[3]) : Super(EigenVector(xyz[0], xyz[1], xyz[2])) {}
291 : Super(EigenVector(
std::get<0>(xyz),
std::get<1>(xyz),
std::get<2>(xyz))) {}
Point(T val=static_cast< T >(0))
Construct a Point with all elements set to the same scalar value.
Point(T x, T y, T z)
Explicit constructor from a sequence of doubles.
CoordinateExpr< N > le(Point< T, N > const &other) const
Point< T, N > operator+(Extent< T, N > const &other) const
CoordinateExpr< N > gt(T scalar) const
std::string toString() const
Super::EigenVector EigenVector
Point(std::tuple< T, T, T > const &xyz)
Construct from std::tuple.
PointBase(T val=static_cast< T >(0))
bool all(CoordinateExpr< N > const &expr)
Return true if all elements are true.
void scale(double factor)
Point< T, N > & operator+=(Extent< T, N > const &other)
Point(EigenVector const &vector)
Construct a Point from an Eigen vector.
Point< T, N > operator-(Extent< T, N > const &other) const
CoordinateBase< Point< T, N >, T, N > Super
A coordinate class intended to represent offsets and dimensions.
CoordinateExpr< N > ge(T scalar) const
Extent< T, N > asExtent() const
Cast this object to an Extent of the same numeric type and dimensionality.
bool operator==(Point< T, N > const &other) const
Standard equality comparison.
Super::EigenVector EigenVector
Point(std::pair< T, T > const &xy)
Construct from a std::pair.
CoordinateExpr< N > gt(Point< T, N > const &other) const
Point(std::tuple< T, T > const &xy)
Construct from std::tuple.
Point< double, 2 > PointD
CoordinateExpr< N > lt(T scalar) const
PointBase(PointBase const &)=default
Point< T, N > & operator-=(Extent< T, N > const &other)
PointBase(Eigen::MatrixBase< Vector > const &vector)
A CRTP base class for coordinate objects.
A coordinate class intended to represent absolute positions.
Point(Extent< T, 2 > const &other)
Explicit constructor from Extent.
Super::EigenVector EigenVector
Point(T val=static_cast< T >(0))
Construct a Point with all elements set to the same scalar value.
bool any(CoordinateExpr< N > const &expr)
Return true if any elements are true.
Point(Extent< T, N > const &other)
Explicit constructor from Extent.
EigenVector const & asEigen() const
Return a fixed-size Eigen representation of the coordinate object.
A base class for image defects.
Point(EigenVector const &vector)
Construct a Point from an Eigen vector.
CoordinateExpr< N > eq(Point< T, N > const &other) const
Point< double, 2 > Point2D
void shift(Extent< T, N > const &offset)
Shift the point by the given offset.
CoordinateExpr< N > eq(T scalar) const
double distanceSquared(PointBase< T, N > const &other) const
A coordinate class intended to represent offsets and dimensions (3-d specialization).
CoordinateExpr< N > ne(Point< T, N > const &other) const
Extent< T, N > operator-(Point< T, N > const &other) const
A coordinate class intended to represent offsets and dimensions (2-d specialization).
Eigen::Matrix< T, N, 1, Eigen::DontAlign > EigenVector
void _swap(CoordinateBase &other)
Point(T val=static_cast< T >(0))
Construct a Point with all elements set to the same scalar value.
CoordinateExpr< N > le(T scalar) const
bool operator!=(Point< T, N > const &other) const
Standard inequality comparison.
CoordinateExpr< N > ge(Point< T, N > const &other) const
Point(EigenVector const &vector)
Construct a Point from an Eigen vector.
Point(T x, T y)
Explicit constructor from a pair of doubles.
CoordinateExpr< N > lt(Point< T, N > const &other) const
Point(Extent< T, 3 > const &other)
Explicit constructor from Extent.
Point< double, 3 > Point3D
Point(T const xy[2])
Construct from a two-element array.
PointBase & operator=(PointBase const &)=default
CoordinateExpr< N > ne(T scalar) const
Point(T const xyz[3])
Construct from a two-element array.