21 #ifndef otbPointSetAndValuesFunction_h
22 #define otbPointSetAndValuesFunction_h
24 #include "itkFunctionBase.h"
25 #include "itkContinuousIndex.h"
26 #include "itkVectorContainer.h"
27 #include "itkPointSet.h"
36 template <
class TPo
intSet,
class TValue,
class TCoordRep =
double>
37 class ITK_EXPORT PointSetAndValuesFunction :
public itk::FunctionBase<itk::Point<TCoordRep, TPointSet::PointDimension>, TValue>
41 typedef PointSetAndValuesFunction Self;
42 typedef itk::FunctionBase<itk::Point<TCoordRep, TPointSet::PointDimension>, TValue> Superclass;
43 typedef itk::SmartPointer<Self> Pointer;
44 typedef itk::SmartPointer<const Self> ConstPointer;
47 itkTypeMacro(PointSetAndValuesFunction, itk::FunctionBase);
49 typedef TPointSet PointSetType;
50 typedef typename PointSetType::ConstPointer PointSetConstPointerType;
51 typedef TValue ValueType;
52 typedef TCoordRep CoordRepType;
53 typedef typename PointSetType::PointType PointType;
55 typedef itk::Index<PointType::PointDimension> IndexType;
56 typedef itk::ContinuousIndex<CoordRepType, PointType::PointDimension> ContinuousIndexType;
58 typedef itk::VectorContainer<unsigned long, ValueType> ValueVectorType;
59 typedef typename ValueVectorType::ConstPointer ValueVectorPointerType;
61 itkSetObjectMacro(ValueVector, ValueVectorType);
62 itkGetObjectMacro(ValueVector, ValueVectorType);
68 virtual void SetPointSet(
const PointSetType* ptr);
74 const PointSetType* GetPointSet()
const
76 return m_PointSet.GetPointer();
81 virtual TValue Evaluate(
const PointType& point)
const = 0;
85 virtual TValue EvaluateAtIndex(
const IndexType& index)
const = 0;
89 virtual TValue EvaluateAtContinuousIndex(
const ContinuousIndexType& index)
const = 0;
93 PointSetAndValuesFunction()
95 m_PointSet = PointSetType::New();
96 m_ValueVector = ValueVectorType::New();
100 virtual ~PointSetAndValuesFunction()
105 virtual void PrintSelf(std::ostream& os, itk::Indent indent)
const;
108 PointSetAndValuesFunction(
const Self&) =
delete;
109 void operator=(
const Self&) =
delete;
112 PointSetConstPointerType m_PointSet;