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 > eq(T scalar) const
bool all(CoordinateExpr< N > const &expr)
Return true if all elements are true.
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.
A coordinate class intended to represent offsets and dimensions.
Extent< T, N > asExtent() const
Cast this object to an Extent of the same numeric type and dimensionality.
Point(T x, T y, T z)
Explicit constructor from a sequence of doubles.
PointBase(Eigen::MatrixBase< Vector > const &vector)
Point(T val=static_cast< T >(0))
Construct a Point with all elements set to the same scalar value.
Point(std::pair< T, T > const &xy)
Construct from a std::pair.
Point(boost::tuple< T, T, T > const &xyz)
Construct from boost::tuple.
Super::EigenVector EigenVector
PointBase(T val=static_cast< T >(0))
Point(boost::tuple< T, T > const &xy)
Construct from boost::tuple.
CoordinateExpr< N > ge(T scalar) const
Extent< double, N > & operator+=(Extent< double, N > &lhs, Extent< int, N > const &rhs)
Point(EigenVector const &vector)
Construct a Point from an Eigen vector.
A boolean pair class used to express the output of spatial predicates on Point and Extent...
void _swap(CoordinateBase &other)
Extent< double, N > & operator-=(Extent< double, N > &lhs, Extent< int, N > const &rhs)
Super::EigenVector EigenVector
CoordinateExpr< N > gt(Point< T, N > const &other) const
A CRTP base class for coordinate objects.
A coordinate class intended to represent absolute positions.
Super::EigenVector EigenVector
const Angle operator+(Angle const a, Angle const d)
bool any(CoordinateExpr< N > const &expr)
Return true if any elements are true.
Point(Extent< T, 3 > const &other)
Explicit constructor from Extent.
Point(T const xy[2])
Construct from a two-element array.
void scale(double factor)
EigenVector const & asEigen() const
Return a fixed-size Eigen representation of the coordinate object.
Point(EigenVector const &vector)
Construct a Point from an Eigen vector.
A coordinate class intended to represent offsets and dimensions (3-d specialization).
CoordinateExpr< N > gt(T scalar) const
CoordinateExpr< N > le(T scalar) const
A coordinate class intended to represent offsets and dimensions (2-d specialization).
void shift(Extent< T, N > const &offset)
Shift the point by the given offset.
Point< double, 3 > Point3D
Point(EigenVector const &vector)
Construct a Point from an Eigen vector.
Point< T, N > operator+(Extent< T, N > const &other) const
Extent< T, N > operator-(Point< T, N > const &other) const
CoordinateExpr< N > ge(Point< T, N > const &other) const
CoordinateBase< Point< T, N >, T, N > Super
double distanceSquared(PointBase< T, N > const &other) const
Point< T, N > operator-(Extent< T, N > const &other) const
Point(T x, T y)
Explicit constructor from a pair of doubles.
Eigen::Matrix< T, N, 1, Eigen::DontAlign > EigenVector
CoordinateExpr< N > lt(T scalar) const
Point< double, 2 > Point2D
Point< double, 2 > PointD
bool operator!=(Point< T, N > const &other) const
Standard inequality comparison.
CoordinateExpr< N > lt(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(Extent< T, N > const &other)
Explicit constructor from Extent.
Point< T, N > & operator-=(Extent< T, N > const &other)
CoordinateExpr< N > le(Point< T, N > const &other) const
A CRTP base class for coordinate objects, providing partial specializations for 2D and 3D...
A coordinate class intended to represent offsets and dimensions.
CoordinateExpr< N > eq(Point< T, N > const &other) const
const Angle operator-(Angle const a, Angle const d)
Point(Extent< T, 2 > const &other)
Explicit constructor from Extent.
CoordinateExpr< N > ne(T scalar) const
bool operator==(Point< T, N > const &other) const
Standard equality comparison.
Point< T, N > & operator+=(Extent< T, N > const &other)
std::string toString() const
CoordinateExpr< N > ne(Point< T, N > const &other) const