22 #include "itkNumericTraits.h"
25 #include <vnl/vnl_vector_ref.h>
44 template<
class TCoordRep,
unsigned int NPo
intDimension=3>
57 typedef typename NumericTraits< ValueType >::RealType
RealType;
69 {
return NPointDimension; }
78 template<
class TPo
intValueType >
92 { same = ((*this)[i] == pt[i]); }
102 { same = ((*this)[i] == pt[i]); }
195 double weightA,
double weightB );
214 template <
typename TCoordRepB >
217 for(
unsigned int i=0; i<NPointDimension; i++ )
219 (*this)[i] =
static_cast<TCoordRep
>( pa[i] );
227 template <
typename TCoordRepB >
230 RealType sum = NumericTraits< RealType >::Zero;
231 for(
unsigned int i=0; i<NPointDimension; i++ )
234 const RealType difference =
static_cast< RealType >( (*this)[i] ) - component;
235 sum += difference * difference;
243 template <
typename TCoordRepB >
246 const double distance = vcl_sqrt(
248 return static_cast<RealType>( distance );
253 template<
class T,
unsigned int NPo
intDimension >
255 const Point<T,NPointDimension> & v);
257 template<
class T,
unsigned int NPo
intDimension >
259 Point<T,NPointDimension> & v);
283 template<
class TPo
intContainer,
class TWeightContainer >
304 #define ITK_TEMPLATE_Point(_, EXPORT, x, y) namespace itk { \
305 _(2(class EXPORT Point< ITK_TEMPLATE_2 x >)) \
306 _(1(EXPORT std::ostream& operator<<(std::ostream&, \
307 const Point< ITK_TEMPLATE_2 x >&))) \
308 _(1(EXPORT std::istream& operator>>(std::istream&, \
309 Point< ITK_TEMPLATE_2 x >&))) \
310 namespace Templates { typedef Point< ITK_TEMPLATE_2 x > Point##y; } \
313 #if ITK_TEMPLATE_EXPLICIT
314 # include "Templates/itkPoint+-.h"