25 #ifndef LSST_GEOM_POINT_H 26 #define LSST_GEOM_POINT_H 37 template <
typename T,
int N>
130 for (
size_t i = 0; i < N; ++i) {
143 template <
typename Vector>
144 explicit PointBase(Eigen::MatrixBase<Vector>
const &vector) : Super(vector) {}
152 template <
typename T,
int N>
176 template <
typename U>
180 explicit Point(EigenVector
const &vector) : Super(vector) {}
193 template <
typename T>
217 template <
typename U>
221 explicit Point(EigenVector
const &vector) : Super(vector) {}
227 explicit Point(T
x, T
y) : Super(EigenVector(x, y)) {}
230 explicit Point(T
const xy[2]) : Super(EigenVector(xy[0], xy[1])) {}
246 template <
typename T>
270 template <
typename U>
274 explicit Point(EigenVector
const &vector) : Super(vector) {}
280 explicit Point(T
x, T
y, T
z) : Super(EigenVector(x, y, z)) {}
283 explicit Point(T
const xyz[3]) : Super(EigenVector(xyz[0], xyz[1], xyz[2])) {}
287 : Super(EigenVector(
std::get<0>(xyz),
std::get<1>(xyz),
std::get<2>(xyz))) {}
293 template <
typename T,
int N>
Point(std::pair< T, T > const &xy)
Construct from a std::pair.
A CRTP base class for coordinate objects.
Point(T const xyz[3])
Construct from a two-element array.
Point(T val=static_cast< T >(0))
Construct a Point with all elements set to the same scalar value.
void shift(Extent< T, N > const &offset)
Shift the point by the given offset.
Point(EigenVector const &vector)
Construct a Point from an Eigen vector.
std::size_t hash_value(Point< T, N > const &point)
Point< T, N > operator+(Extent< T, N > const &other) const
CoordinateExpr< N > gt(Point< T, N > const &other) const
Point(T x, T y)
Explicit constructor from a pair of doubles.
Super::EigenVector EigenVector
Extent< T, N > asExtent() const
Cast this object to an Extent of the same numeric type and dimensionality.
A coordinate class intended to represent absolute positions.
CoordinateExpr< N > ne(T scalar) const
A coordinate class intended to represent offsets and dimensions (2-d specialization).
Point(T const xy[2])
Construct from a two-element array.
std::string toString() const
void scale(double factor)
CoordinateExpr< N > gt(T scalar) const
Point(EigenVector const &vector)
Construct a Point from an Eigen vector.
double distanceSquared(PointBase< T, N > const &other) const
Point< double, 2 > Point2D
A coordinate class intended to represent offsets and dimensions (3-d specialization).
PointBase(T val=static_cast< T >(0))
CoordinateExpr< N > ge(T scalar) const
CoordinateExpr< N > ne(Point< T, N > const &other) const
bool all(CoordinateExpr< N > const &expr)
Return true if all elements are true.
Eigen::Matrix< int, N, 1, Eigen::DontAlign > EigenVector
A base class for image defects.
void _swap(CoordinateBase &other)
bool operator!=(Point< T, N > const &other) const
Standard inequality comparison.
PointBase & operator=(PointBase const &)=default
Point(std::tuple< T, T, T > const &xyz)
Construct from std::tuple.
Super::EigenVector EigenVector
A coordinate class intended to represent offsets and dimensions.
CoordinateExpr< N > eq(Point< T, N > const &other) const
CoordinateExpr< N > ge(Point< T, N > const &other) const
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.
Super::EigenVector EigenVector
Point(EigenVector const &vector)
Construct a Point from an Eigen vector.
Point< double, 3 > Point3D
Point< T, N > & operator-=(Extent< T, N > const &other)
Point(Extent< T, 2 > const &other)
Explicit constructor from Extent.
bool operator==(Point< T, N > const &other) const
Standard equality comparison.
CoordinateExpr< N > le(Point< T, N > const &other) const
CoordinateExpr< N > lt(T scalar) const
Point(Extent< T, N > const &other)
Explicit constructor from Extent.
ItemVariant const * other
EigenVector const & asEigen() const
Return a fixed-size Eigen representation of the coordinate object.
Extent< T, N > operator-(Point< T, N > const &other) const
PointBase(Eigen::MatrixBase< Vector > const &vector)
Point(Extent< T, 3 > const &other)
Explicit constructor from Extent.
Point(std::tuple< T, T > const &xy)
Construct from std::tuple.
Point< T, N > & operator+=(Extent< T, N > const &other)
CoordinateExpr< N > lt(Point< T, N > const &other) const
CoordinateExpr< N > le(T scalar) const
CoordinateExpr< N > eq(T scalar) const
Point(T val=static_cast< T >(0))
Construct a Point with all elements set to the same scalar value.
PointBase(PointBase const &)=default
Point< T, N > operator-(Extent< T, N > const &other) const
Point< double, 2 > PointD
bool any(CoordinateExpr< N > const &expr)
Return true if any elements are true.