29 #ifndef LSST_AFW_GEOM_POINT_H
30 #define LSST_AFW_GEOM_POINT_H
36 namespace lsst {
namespace afw {
namespace geom {
38 template <
typename T,
int N>
124 std::stringstream out;
126 for (
size_t i = 0; i < N; ++i) {
140 template <
typename Vector>
149 template<
typename T,
int N>
150 class Point :
public PointBase<T,N> {
165 template <
typename U>
198 template <
typename U>
217 explicit Point(boost::tuple<T,T>
const & xy) :
251 template <
typename U>
267 explicit Point(boost::tuple<T,T,T>
const & xyz) :
268 Super(
EigenVector(xyz.template get<0>(), xyz.template get<1>(), xyz.template get<2>())) {}
CoordinateExpr< N > gt(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.
double distanceSquared(PointBase< T, N > const &other) const
Point(T x, T y, T z)
Explicit constructor from a sequence of doubles.
Super::EigenVector EigenVector
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(EigenVector const &vector)
Construct a Point from an Eigen vector.
bool operator==(Point< T, N > const &other) const
Standard equality comparison.
CoordinateExpr< N > ge(T scalar) const
A coordinate class intended to represent offsets and dimensions.
CoordinateExpr< N > lt(Point< T, N > const &other) const
Super::EigenVector EigenVector
Point(std::pair< T, T > const &xy)
Construct from a std::pair.
Point< double, 2 > Point2D
Extent< double, N > & operator+=(Extent< double, N > &lhs, Extent< int, N > const &rhs)
A boolean pair class used to express the output of spatial predicates on Point and Extent...
Extent< double, N > & operator-=(Extent< double, N > &lhs, Extent< int, N > const &rhs)
Eigen::Matrix< T, N, 1, Eigen::DontAlign > EigenVector
CoordinateBase< Point< T, N >, T, N > Super
CoordinateExpr< N > ge(Point< T, N > const &other) const
Point< double, 3 > Point3D
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.
Point(boost::tuple< T, T, T > const &xyz)
Construct from boost::tuple.
Point< T, N > operator-(Extent< T, N > const &other) const
const Angle operator+(Angle const a, Angle const d)
Point(boost::tuple< T, T > const &xy)
Construct from boost::tuple.
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.
Point(EigenVector const &vector)
Construct a Point from an Eigen vector.
CoordinateExpr< N > eq(T scalar) const
void shift(Extent< T, N > const &offset)
Shift the point by the given offset.
bool operator!=(Point< T, N > const &other) const
Standard inequality comparison.
std::string toString() const
A coordinate class intended to represent offsets and dimensions (3-d specialization).
CoordinateExpr< N > ne(T scalar) const
A coordinate class intended to represent offsets and dimensions (2-d specialization).
void _swap(CoordinateBase &other)
Point(T val=static_cast< T >(0))
Construct a Point with all elements set to the same scalar value.
EigenVector const & asEigen() const
Return a fixed-size Eigen representation of the coordinate object.
CoordinateExpr< N > le(Point< T, N > const &other) const
CoordinateExpr< N > gt(T scalar) const
Point< T, N > & operator-=(Extent< T, N > const &other)
Extent< T, N > asExtent() const
Cast this object to an Extent of the same numeric type and dimensionality.
Point(EigenVector const &vector)
Construct a Point from an Eigen vector.
CoordinateExpr< N > le(T scalar) const
Point(T x, T y)
Explicit constructor from a pair of doubles.
Point< T, N > & operator+=(Extent< T, N > const &other)
A CRTP base class for coordinate objects, providing partial specializations for 2D and 3D...
Point(Extent< T, 3 > const &other)
Explicit constructor from Extent.
Point(T const xy[2])
Construct from a two-element array.
A coordinate class intended to represent offsets and dimensions.
CoordinateExpr< N > lt(T scalar) const
const Angle operator-(Angle const a, Angle const d)
Point(T const xyz[3])
Construct from a two-element array.
Extent< T, N > operator-(Point< T, N > const &other) const
CoordinateExpr< N > eq(Point< T, N > const &other) const
Point< T, N > operator+(Extent< T, N > const &other) const
CoordinateExpr< N > ne(Point< T, N > const &other) const
Point< double, 2 > PointD