25 #include "vnl/vnl_vector_ref.h"
51 template<
typename TCoordRep,
unsigned int NPo
intDimension = 3 >
67 itkStaticConstMacro(PointDimension,
unsigned int, NPointDimension);
76 {
return NPointDimension; }
85 template<
typename TPo
intValueType >
87 template<
typename TPo
intValueType >
90 template<
typename TPo
intValueType >
96 Point & operator=(
const Self & r);
98 Point & operator=(
const ValueType r[NPointDimension]);
106 for (
unsigned int i = 0; i < NPointDimension && same; ++i )
117 for (
unsigned int i = 0; i < NPointDimension && same; ++i )
123 const Self & operator+=(
const VectorType & vec);
126 const Self & operator-=(
const VectorType & vec);
141 vnl_vector_ref< TCoordRep > GetVnlVector();
144 vnl_vector< TCoordRep > GetVnlVector()
const;
148 itkLegacyMacro(vnl_vector_ref< TCoordRep > Get_vnl_vector(
void));
152 itkLegacyMacro(vnl_vector< TCoordRep > Get_vnl_vector(
void)
const);
165 void SetToMidPoint(
const Self &,
const Self &);
193 void SetToBarycentricCombination(
const Self & A,
const Self & B,
double alpha);
211 void SetToBarycentricCombination(
const Self & A,
const Self & B,
const Self & C,
212 double weightA,
double weightB);
227 void SetToBarycentricCombination(
const Self *P,
const double *weights,
unsigned int N);
232 template<
typename TCoordRepB >
235 for (
unsigned int i = 0; i < NPointDimension; i++ )
237 ( *this )[i] =
static_cast< TCoordRep
>( pa[i] );
246 template<
typename TCoordRepB >
251 for (
unsigned int i = 0; i < NPointDimension; i++ )
254 const RealType difference =
static_cast< RealType >( ( *this )[i] ) - component;
255 sum += difference * difference;
263 template<
typename TCoordRepB >
266 const double distance = std::sqrt(
267 static_cast< double >( this->SquaredEuclideanDistanceTo(pa) ) );
269 return static_cast< RealType >( distance );
273 template<
typename T,
unsigned int NPo
intDimension >
275 const Point< T, NPointDimension > & v);
277 template<
typename T,
unsigned int NPo
intDimension >
279 Point< T, NPointDimension > & v);
306 template<
typename TPo
intContainer,
typename TWeightContainer >
320 const PointContainerPointer & points,
321 const WeightContainerType & weights);
325 #ifndef ITK_MANUAL_INSTANTIATION
326 #include "itkPoint.hxx"
void CastFrom(const Point< TCoordRepB, NPointDimension > &pa)
bool operator==(const Self &pt) const
SpacePrecisionType ValueType
ConstNeighborhoodIterator< TImage > operator-(const ConstNeighborhoodIterator< TImage > &it, const typename ConstNeighborhoodIterator< TImage >::OffsetType &ind)
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.
TWeightContainer WeightContainerType
std::ostream & operator<<(std::ostream &os, const Array< TValue > &arr)
PointContainerType::Pointer PointContainerPointer
bool ExactlyEquals(const TInput1 &x1, const TInput2 &x2)
Return the result of an exact comparison between two scalar values of potetially different types...
BaseArray::ConstIterator ConstIterator
BaseArray::Iterator Iterator
ImageBaseType::SpacingType VectorType
Point(const TPointValueType &v)
Simulate a standard C array with copy semnatics.
FixedArray< TCoordRep, NPointDimension > BaseArray
A templated class holding a n-Dimensional vector.
PointContainerType::Element PointType
ConstNeighborhoodIterator< TImage > operator+(const ConstNeighborhoodIterator< TImage > &it, const typename ConstNeighborhoodIterator< TImage >::OffsetType &ind)
Vector< ValueType, NPointDimension > VectorType
ImageBaseType::PointType PointType
bool operator!=(const Self &pt) const
NumericTraits< ValueType >::RealType RealType
Point(const ValueType r[NPointDimension])
~BarycentricCombination()
FixedArray< TCoordRep, NPointDimension > Superclass
Point(const ValueType &v)
static unsigned int GetPointDimension()
TPointContainer PointContainerType
RealType SquaredEuclideanDistanceTo(const Point< TCoordRepB, NPointDimension > &pa) const
RealType EuclideanDistanceTo(const Point< TCoordRepB, NPointDimension > &pa) const
A templated class holding a geometric point in n-Dimensional space.
const ValueType * ConstIterator