25 #include "vnl/vnl_vector_ref.h"
51 template<
typename TCoordRep,
unsigned int NPo
intDimension = 3 >
67 static constexpr
unsigned int PointDimension = NPointDimension;
76 {
return NPointDimension; }
90 template<
typename TPo
intValueType >
94 template<
typename TPo
intValueType >
99 template<
typename TPo
intValueType >
105 Point & operator=(
const ValueType r[NPointDimension]);
113 for (
unsigned int i = 0; i < NPointDimension && same; ++i )
124 for (
unsigned int i = 0; i < NPointDimension && same; ++i )
130 const Self & operator+=(
const VectorType & vec);
133 const Self & operator-=(
const VectorType & vec);
148 vnl_vector_ref< TCoordRep > GetVnlVector();
151 vnl_vector< TCoordRep > GetVnlVector()
const;
164 void SetToMidPoint(
const Self &,
const Self &);
192 void SetToBarycentricCombination(
const Self & A,
const Self & B,
double alpha);
210 void SetToBarycentricCombination(
const Self & A,
const Self & B,
const Self & C,
211 double weightA,
double weightB);
226 void SetToBarycentricCombination(
const Self *P,
const double *weights,
unsigned int N);
231 template<
typename TCoordRepB >
234 for (
unsigned int i = 0; i < NPointDimension; i++ )
236 ( *this )[i] =
static_cast< TCoordRep
>( pa[i] );
245 template<
typename TCoordRepB >
250 for (
unsigned int i = 0; i < NPointDimension; i++ )
252 const auto component =
static_cast< RealType >( pa[i] );
253 const RealType difference =
static_cast< RealType >( ( *this )[i] ) - component;
254 sum += difference * difference;
262 template<
typename TCoordRepB >
265 const double distance = std::sqrt(
266 static_cast< double >( this->SquaredEuclideanDistanceTo(pa) ) );
268 return static_cast< RealType >( distance );
272 template<
typename T,
unsigned int NPo
intDimension >
274 const Point< T, NPointDimension > & v);
276 template<
typename T,
unsigned int NPo
intDimension >
278 Point< T, NPointDimension > & v);
305 template<
typename TPo
intContainer,
typename TWeightContainer >
324 template<
typename TCoordRep,
unsigned int NPo
intDimension>
332 #ifndef ITK_MANUAL_INSTANTIATION
333 #include "itkPoint.hxx"
void swap(FixedArray &other)
void CastFrom(const Point< TCoordRepB, NPointDimension > &pa)
bool operator==(const Self &pt) const
typename NumericTraits< ValueType >::RealType RealType
ConstNeighborhoodIterator< TImage > operator-(const ConstNeighborhoodIterator< TImage > &it, const typename ConstNeighborhoodIterator< TImage >::OffsetType &ind)
Define numeric traits for std::vector.
Point(const TPointValueType r[NPointDimension])
std::istream & operator>>(std::istream &is, Point< T, NPointDimension > &v)
Point(const Point< TPointValueType, NPointDimension > &r)
Computes the barycentric combination of an array of N points.
std::ostream & operator<<(std::ostream &os, const Array< TValue > &arr)
bool ExactlyEquals(const TInput1 &x1, const TInput2 &x2)
Return the result of an exact comparison between two scalar values of potetially different types...
Point(const TPointValueType &v)
typename PointContainerType::Pointer PointContainerPointer
Simulate a standard C array with copy semnatics.
void swap(Array< T > &a, Array< T > &b)
A templated class holding a n-Dimensional vector.
ConstNeighborhoodIterator< TImage > operator+(const ConstNeighborhoodIterator< TImage > &it, const typename ConstNeighborhoodIterator< TImage >::OffsetType &ind)
bool operator!=(const Self &pt) const
Point(const ValueType r[NPointDimension])
Point(const ValueType &v)
static unsigned int GetPointDimension()
RealType SquaredEuclideanDistanceTo(const Point< TCoordRepB, NPointDimension > &pa) const
ImageBaseType::SpacingType VectorType
RealType EuclideanDistanceTo(const Point< TCoordRepB, NPointDimension > &pa) const
A templated class holding a geometric point in n-Dimensional space.
const ValueType * ConstIterator
TPointContainer PointContainerType
TWeightContainer WeightContainerType
typename PointContainerType::Element PointType