25#include "vnl/vnl_vector_ref.h"
52template <
typename TCoordRep,
unsigned int VPo
intDimension = 3>
69 static constexpr unsigned int PointDimension = VPointDimension;
80 return VPointDimension;
91 template <
typename TPo
intValueType>
97 template <
typename TPo
intValueType>
98 Point(
const TPointValueType r[VPointDimension])
106#if defined(ITK_LEGACY_REMOVE)
111 template <
typename TPo
intValueType>
112 explicit Point(
const TPointValueType & v)
122 template <
typename TPo
intValueType>
123 Point(
const TPointValueType & v)
126 Point(
const ValueType & v)
133 explicit Point(
const std::array<ValueType, VPointDimension> & stdArray)
175 vnl_vector_ref<TCoordRep>
179 vnl_vector<TCoordRep>
263 template <
typename TCoordRepB>
267 for (
unsigned int i = 0; i < VPointDimension; ++i)
269 (*this)[i] =
static_cast<TCoordRep
>(pa[i]);
278 template <
typename TCoordRepB>
284 for (
unsigned int i = 0; i < VPointDimension; ++i)
286 const auto component =
static_cast<RealType>(pa[i]);
288 sum += difference * difference;
296 template <
typename TCoordRepB>
300 const double distance = std::sqrt(
static_cast<double>(this->SquaredEuclideanDistanceTo(pa)));
302 return static_cast<RealType>(distance);
306template <
typename T,
unsigned int VPo
intDimension>
310template <
typename T,
unsigned int VPo
intDimension>
340template <
typename TPo
intContainer,
typename TWeightContainer>
356template <
typename TCoordRep,
unsigned int VPo
intDimension>
365template <
typename TValue,
typename... TVariadic>
367MakePoint(
const TValue firstValue,
const TVariadic... otherValues)
369 static_assert(std::conjunction_v<std::is_same<TVariadic, TValue>...>,
370 "The other values should have the same type as the first value.");
372 constexpr unsigned int dimension{ 1 +
sizeof...(TVariadic) };
373 const std::array<TValue, dimension> stdArray{ { firstValue, otherValues... } };
379#ifndef ITK_MANUAL_INSTANTIATION
380# 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.
void swap(FixedArray &other)
const ValueType * ConstIterator
A templated class holding a geometric point in n-Dimensional space.
typename NumericTraits< ValueType >::RealType RealType
typename BaseArray::Iterator Iterator
RealType EuclideanDistanceTo(const Point< TCoordRepB, VPointDimension > &pa) const
Self operator-(const VectorType &vec) const
Self operator+(const VectorType &vec) const
vnl_vector< TCoordRep > GetVnlVector() const
void SetToMidPoint(const Self &, const Self &)
Point(const TPointValueType r[VPointDimension])
Point(const TPointValueType &v)
Point(std::nullptr_t)=delete
const Self & operator+=(const VectorType &vec)
bool operator==(const Self &pt) const
typename BaseArray::ConstIterator ConstIterator
Point(const Point< TPointValueType, VPointDimension > &r)
ITK_UNEQUAL_OPERATOR_MEMBER_FUNCTION(Self)
const Self & operator-=(const VectorType &vec)
VectorType GetVectorFromOrigin() const
Point(const std::array< ValueType, VPointDimension > &stdArray)
VectorType operator-(const Self &pnt) const
Point & operator=(const ValueType r[VPointDimension])
vnl_vector_ref< TCoordRep > GetVnlVector()
void SetToBarycentricCombination(const Self &A, const Self &B, double alpha)
void SetToBarycentricCombination(const Self &A, const Self &B, const Self &C, double weightForA, double weightForB)
Point(const ValueType &v)
RealType SquaredEuclideanDistanceTo(const Point< TCoordRepB, VPointDimension > &pa) const
void CastFrom(const Point< TCoordRepB, VPointDimension > &pa)
void SetToBarycentricCombination(const Self *P, const double *weights, unsigned int N)
static unsigned int GetPointDimension()
Point(const ValueType r[VPointDimension])
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)