25#include "vnl/vnl_vector_ref.h"
52template <
typename TCoordinate,
unsigned int VPo
intDimension = 3>
65#ifndef ITK_FUTURE_LEGACY_REMOVE
66 using CoordRepType ITK_FUTURE_DEPRECATED(
67 "ITK 6 discourages using `CoordRepType`. Please use `CoordinateType` instead!") =
CoordinateType;
73 static constexpr unsigned int PointDimension = VPointDimension;
84 return VPointDimension;
95 template <
typename TPo
intValueType>
101 template <
typename TPo
intValueType>
102 Point(
const TPointValueType r[VPointDimension])
110#if defined(ITK_LEGACY_REMOVE)
115 template <
typename TPo
intValueType>
116 explicit Point(
const TPointValueType & v)
126 template <
typename TPo
intValueType>
127 Point(
const TPointValueType & v)
130 Point(
const ValueType & v)
137 explicit Point(
const std::array<ValueType, VPointDimension> & stdArray)
179 vnl_vector_ref<TCoordinate>
183 vnl_vector<TCoordinate>
267 template <
typename TCoordinateB>
271 for (
unsigned int i = 0; i < VPointDimension; ++i)
273 (*this)[i] =
static_cast<TCoordinate
>(pa[i]);
282 template <
typename TCoordinateB>
288 for (
unsigned int i = 0; i < VPointDimension; ++i)
290 const auto component =
static_cast<RealType>(pa[i]);
292 sum += difference * difference;
300 template <
typename TCoordinateB>
304 const double distance = std::sqrt(
static_cast<double>(this->SquaredEuclideanDistanceTo(pa)));
306 return static_cast<RealType>(distance);
310template <
typename T,
unsigned int VPo
intDimension>
314template <
typename T,
unsigned int VPo
intDimension>
344template <
typename TPo
intContainer,
typename TWeightContainer>
360template <
typename TCoordinate,
unsigned int VPo
intDimension>
369template <
typename TValue,
typename... TVariadic>
371MakePoint(
const TValue firstValue,
const TVariadic... otherValues)
373 static_assert(std::conjunction_v<std::is_same<TVariadic, TValue>...>,
374 "The other values should have the same type as the first value.");
376 constexpr unsigned int dimension{ 1 +
sizeof...(TVariadic) };
377 const std::array<TValue, dimension> stdArray{ { firstValue, otherValues... } };
383#ifndef ITK_MANUAL_INSTANTIATION
384# include "itkPoint.hxx"
Computes the barycentric combination of an array of N points.
static PointType Evaluate(const PointContainerPointer &points, const WeightContainerType &weights)
typename PointContainerType::Element PointType
TWeightContainer WeightContainerType
TPointContainer PointContainerType
typename PointContainerType::Pointer PointContainerPointer
Simulate a standard C array with copy semantics.
const ValueType * ConstIterator
A templated class holding a geometric point in n-Dimensional space.
const Self & operator+=(const VectorType &vec)
typename BaseArray::ConstIterator ConstIterator
vnl_vector_ref< TCoordinate > GetVnlVector()
static unsigned int GetPointDimension()
Point(std::nullptr_t)=delete
void CastFrom(const Point< TCoordinateB, VPointDimension > &pa)
VectorType GetVectorFromOrigin() const
Point(const std::array< ValueType, VPointDimension > &stdArray)
Point(const TPointValueType r[VPointDimension])
typename NumericTraits< ValueType >::RealType RealType
RealType EuclideanDistanceTo(const Point< TCoordinateB, VPointDimension > &pa) const
void SetToMidPoint(const Self &, const Self &)
VectorType operator-(const Self &pnt) const
ITK_UNEQUAL_OPERATOR_MEMBER_FUNCTION(Self)
Point(const ValueType r[VPointDimension])
Point(const ValueType &v)
void SetToBarycentricCombination(const Self &A, const Self &B, const Self &C, double weightForA, double weightForB)
void SetToBarycentricCombination(const Self &A, const Self &B, double alpha)
Point(const TPointValueType &v)
typename BaseArray::Iterator Iterator
TCoordinate CoordinateType
RealType SquaredEuclideanDistanceTo(const Point< TCoordinateB, VPointDimension > &pa) const
Self operator+(const VectorType &vec) const
vnl_vector< TCoordinate > GetVnlVector() const
Point & operator=(const ValueType r[VPointDimension])
void SetToBarycentricCombination(const Self *P, const double *weights, unsigned int N)
bool operator==(const Self &pt) const
const Self & operator-=(const VectorType &vec)
Point(const Point< TPointValueType, VPointDimension > &r)
Self operator-(const VectorType &vec) const
A templated class holding a n-Dimensional vector.
SmartPointer< Self > Pointer
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
void swap(Array< T > &a, Array< T > &b) noexcept
std::istream & operator>>(std::istream &is, Point< T, VPointDimension > &vct)
ITKCommon_EXPORT std::ostream & operator<<(std::ostream &out, typename AnatomicalOrientation::CoordinateEnum value)
bool operator==(const Index< VDimension > &one, const Index< VDimension > &two)
auto MakePoint(const TValue firstValue, const TVariadic... otherValues)