LSSTApplications
19.0.0-10-g4a5fae6+3,19.0.0-10-g920eed2,19.0.0-11-g48a0200+2,19.0.0-18-gfc4e62b+16,19.0.0-2-g3b2f90d+2,19.0.0-2-gd671419+6,19.0.0-20-g5a5a17ab+14,19.0.0-21-g2644856+17,19.0.0-24-g0913cb1,19.0.0-24-g878c510+4,19.0.0-25-g6c8df7140+1,19.0.0-25-gb330496+4,19.0.0-3-g2b32d65+6,19.0.0-3-g8227491+15,19.0.0-3-g9c54d0d+15,19.0.0-3-gca68e65+11,19.0.0-3-gcfc5f51+6,19.0.0-3-ge110943+14,19.0.0-3-ge74d124,19.0.0-30-g9c3fd16+5,19.0.0-4-g06f5963+6,19.0.0-4-g10df615,19.0.0-4-g3d16501+17,19.0.0-4-g4a9c019+6,19.0.0-4-g5a8b323,19.0.0-4-g66397f0+1,19.0.0-4-g8557e14,19.0.0-4-g8964aba+16,19.0.0-4-ge404a01+15,19.0.0-5-g40f3a5a,19.0.0-5-g4db63b3,19.0.0-5-gb9eeb60,19.0.0-5-gfb03ce7+16,19.0.0-6-gbaebbfb+15,19.0.0-61-gec4c6e08+5,19.0.0-7-g039c0b5+15,19.0.0-7-gbea9075+4,19.0.0-7-gc567de5+16,19.0.0-72-g37abf38+2,19.0.0-9-g463f923+15,v20.0.0.rc1
LSSTDataManagementBasePackage
|
Go to the documentation of this file.
25 #ifndef LSST_GEOM_POINT_H
26 #define LSST_GEOM_POINT_H
37 template <
typename T,
int N>
133 this->
_vector += offset.asEigen();
140 return (this->
asEigen() -
other.asEigen()).squaredNorm();
146 for (
size_t i = 0; i < N; ++i) {
159 template <
typename Vector>
168 template <
typename T,
int N>
169 class Point :
public PointBase<T, N> {
170 typedef PointBase<T, N> Super;
192 template <
typename U>
210 template <
typename T>
234 template <
typename U>
267 template <
typename T>
291 template <
typename U>
317 template <
typename T,
int N>
376 template <
typename T,
int N>
Point(std::tuple< T, T, T > const &xyz) noexcept(Super::IS_ELEMENT_NOTHROW_COPYABLE)
Construct from std::tuple.
CoordinateExpr< N > ge(Point< T, N > const &other) const noexcept
Point(T val=static_cast< T >(0)) noexcept(Super::IS_ELEMENT_NOTHROW_COPYABLE)
Construct a Point with all elements set to the same scalar value.
CoordinateExpr< N > lt(Point< T, N > const &other) const noexcept
constexpr Angle operator+(Angle a, Angle d) noexcept
Sum of two angles.
Super::EigenVector EigenVector
Extent< double, N > & operator+=(Extent< double, N > &lhs, Extent< int, N > const &rhs) noexcept
Point(Point const &)=default
CoordinateExpr< N > gt(T scalar) const noexcept(Super::IS_ELEMENT_NOTHROW_COPYABLE)
Extent< T, N > operator-(Point< T, N > const &other) const noexcept(Super::IS_ELEMENT_NOTHROW_COPYABLE)
Cast this object to an Extent of the same numeric type and dimensionality.
CoordinateExpr< N > ne(T scalar) const noexcept(Super::IS_ELEMENT_NOTHROW_COPYABLE)
Point(std::tuple< T, T > const &xy) noexcept(Super::IS_ELEMENT_NOTHROW_COPYABLE)
Construct from std::tuple.
void scale(double factor) noexcept(Super::IS_ELEMENT_NOTHROW_COPYABLE)
Cast this object to an Extent of the same numeric type and dimensionality.
Point & operator=(Point &&)=default
void swap(Point &other) noexcept
CoordinateExpr< N > ge(T scalar) const noexcept(Super::IS_ELEMENT_NOTHROW_COPYABLE)
Point & operator=(Point const &)=default
Point & operator=(Point &&)=default
double distanceSquared(PointBase< T, N > const &other) const noexcept(Super::IS_ELEMENT_NOTHROW_COPYABLE)
Cast this object to an Extent of the same numeric type and dimensionality.
PointBase(Eigen::MatrixBase< Vector > const &vector)
Cast this object to an Extent of the same numeric type and dimensionality.
std::size_t hash_value(Extent< T, N > const &extent) noexcept
constexpr Angle operator-(Angle a, Angle d) noexcept
Difference of two angles.
Point(T x, T y) noexcept(Super::IS_ELEMENT_NOTHROW_COPYABLE)
Explicit constructor from a pair of doubles.
Point< double, 2 > Point2D
result_type operator()(argument_type const &x) const noexcept
void swap(Point &other) noexcept
Point< T, N > & operator+=(Extent< T, N > const &other) noexcept(Super::IS_ELEMENT_NOTHROW_ASSIGNABLE)
Cast this object to an Extent of the same numeric type and dimensionality.
Extent< T, N > asExtent() const noexcept(Super::IS_ELEMENT_NOTHROW_COPYABLE)
Cast this object to an Extent of the same numeric type and dimensionality.
bool all(CoordinateExpr< N > const &expr) noexcept
Return true if all elements are true.
Point(T const xy[2]) noexcept(Super::IS_ELEMENT_NOTHROW_COPYABLE)
Construct from a two-element array.
Point(Extent< T, 3 > const &other) noexcept(Super::IS_ELEMENT_NOTHROW_COPYABLE)
Explicit constructor from Extent.
Point(EigenVector const &vector) noexcept(Super::IS_ELEMENT_NOTHROW_COPYABLE)
Construct a Point from an Eigen vector.
Point(T x, T y, T z) noexcept(Super::IS_ELEMENT_NOTHROW_COPYABLE)
Explicit constructor from a sequence of doubles.
PointBase & operator=(PointBase &&)=default
CoordinateExpr< N > le(T scalar) const noexcept(Super::IS_ELEMENT_NOTHROW_COPYABLE)
Point(Extent< T, N > const &other) noexcept(Super::IS_ELEMENT_NOTHROW_COPYABLE)
Explicit constructor from Extent.
PointBase & operator=(PointBase const &)=default
CoordinateExpr< N > eq(Point< T, N > const &other) const noexcept
Point & operator=(Point const &)=default
ItemVariant const * other
Point(Extent< T, 2 > const &other) noexcept(Super::IS_ELEMENT_NOTHROW_COPYABLE)
Explicit constructor from Extent.
bool operator!=(Point< T, N > const &other) const noexcept
Standard inequality comparison.
bool any(CoordinateExpr< N > const &expr) noexcept
Return true if any elements are true.
PointBase(PointBase &&)=default
Point(std::pair< T, T > const &xy) noexcept(Super::IS_ELEMENT_NOTHROW_COPYABLE)
Construct from a std::pair.
Super::EigenVector EigenVector
Extent< double, N > & operator-=(Extent< double, N > &lhs, Extent< int, N > const &rhs) noexcept
PointBase(T val=static_cast< T >(0)) noexcept(Super::IS_ELEMENT_NOTHROW_COPYABLE)
Cast this object to an Extent of the same numeric type and dimensionality.
Point(T val=static_cast< T >(0)) noexcept(Super::IS_ELEMENT_NOTHROW_COPYABLE)
Construct a Point with all elements set to the same scalar value.
std::string toString() const
Cast this object to an Extent of the same numeric type and dimensionality.
A coordinate class intended to represent offsets and dimensions (3-d specialization).
Point< T, N > operator-(Extent< T, N > const &other) const noexcept(Super::IS_ELEMENT_NOTHROW_COPYABLE)
Cast this object to an Extent of the same numeric type and dimensionality.
A base class for image defects.
Point & operator=(Point &&)=default
void swap(Point &other) noexcept
bool operator==(Point< T, N > const &other) const noexcept
Standard equality comparison.
Eigen::Matrix< T, N, 1, Eigen::DontAlign > EigenVector
Point(EigenVector const &vector) noexcept(Super::IS_ELEMENT_NOTHROW_COPYABLE)
Construct a Point from an Eigen vector.
A CRTP base class for coordinate objects.
A coordinate class intended to represent absolute positions.
Point< T, N > operator+(Extent< T, N > const &other) const noexcept(Super::IS_ELEMENT_NOTHROW_COPYABLE)
Cast this object to an Extent of the same numeric type and dimensionality.
Point< double, 3 > Point3D
void shift(Extent< T, N > const &offset) noexcept(Super::IS_ELEMENT_NOTHROW_COPYABLE)
Shift the point by the given offset.
CoordinateExpr< N > ne(Point< T, N > const &other) const noexcept
Point & operator=(Point const &)=default
CoordinateExpr< N > gt(Point< T, N > const &other) const noexcept
Eigen::Vector3d asEigen(sphgeom::Vector3d const &vector) noexcept
Point(Point const &)=default
Point(T const xyz[3]) noexcept(Super::IS_ELEMENT_NOTHROW_COPYABLE)
Construct from a two-element array.
static constexpr bool IS_ELEMENT_NOTHROW_COPYABLE
EigenVector const & asEigen() const noexcept(IS_ELEMENT_NOTHROW_COPYABLE)
Return a fixed-size Eigen representation of the coordinate object.
Point(Point const &)=default
Point< T, N > & operator-=(Extent< T, N > const &other) noexcept(Super::IS_ELEMENT_NOTHROW_ASSIGNABLE)
Cast this object to an Extent of the same numeric type and dimensionality.
Point< double, 2 > PointD
A coordinate class intended to represent offsets and dimensions.
Point(EigenVector const &vector) noexcept(Super::IS_ELEMENT_NOTHROW_COPYABLE)
Construct a Point from an Eigen vector.
A coordinate class intended to represent offsets and dimensions (2-d specialization).
PointBase(PointBase const &)=default
CoordinateExpr< N > lt(T scalar) const noexcept(Super::IS_ELEMENT_NOTHROW_COPYABLE)
CoordinateExpr< N > le(Point< T, N > const &other) const noexcept
Point(T val=static_cast< T >(0)) noexcept(Super::IS_ELEMENT_NOTHROW_COPYABLE)
Construct a Point with all elements set to the same scalar value.
static constexpr bool IS_ELEMENT_NOTHROW_ASSIGNABLE
Super::EigenVector EigenVector
CoordinateExpr< N > eq(T scalar) const noexcept(Super::IS_ELEMENT_NOTHROW_COPYABLE)