00001 
00002 
00008 #if !defined(__geom_ISS_Interpolate_h__)
00009 #define __geom_ISS_Interpolate_h__
00010 
00011 #if defined(DEBUG_geom) && !defined(DEBUG_ISS_Interpolate)
00012 #define DEBUG_ISS_Interpolate
00013 #endif
00014 
00015 #include "ISS_SimplexQuery.h"
00016 #include "ISS_VertexField.h"
00017 
00018 BEGIN_NAMESPACE_GEOM
00019 
00021 
00029 template<class ISS, 
00030          typename F = typename ISS::Number>
00031 class ISS_Interpolate {
00032   
00033   
00034   
00035 
00036 private:
00037 
00039   typedef ISS IssType;
00041   typedef typename IssType::SizeType SizeType;
00042 
00043   
00044   
00045   
00046 
00047 public:
00048 
00050   typedef typename IssType::Number Number;
00052   typedef typename IssType::Vertex Vertex;
00053 
00054   
00055   
00056   
00057 
00059   typedef F Field;
00061   typedef ads::Array<1,Field,false> FieldContainer;
00063 
00067   typedef typename FieldContainer::parameter_type 
00068   FieldParameterType;
00070 
00074   typedef typename FieldContainer::void_pointer FieldVoidPointer;
00075 
00076   
00077   
00078   
00079 
00080 private:
00081 
00083   ISS_SimplexQuery<ISS> _simplexQuery;
00085   ISS_VertexField<ISS,Field> _vertexField;
00086 
00087   
00088   
00089   
00090 
00091 private:
00092 
00094   ISS_Interpolate();
00095 
00097   ISS_Interpolate&
00098   operator=(const ISS_Interpolate&);
00099 
00100 public:
00101 
00102   
00105 
00107 
00111   template <bool A2>
00112   ISS_Interpolate(const IssType& iss,
00113                   const ads::Array<1,Field,A2>& fields) :
00114     _simplexQuery(iss),
00115     _vertexField(iss, fields)
00116   {}
00117 
00119 
00124   ISS_Interpolate(const IssType& iss,
00125                   const SizeType num_vertices, 
00126                   FieldVoidPointer fields) :
00127     _simplexQuery(iss),
00128     _vertexField(iss, num_vertices, fields)
00129   {}
00130 
00132   ISS_Interpolate(const ISS_Interpolate& other) :
00133     _simplexQuery(other._simplexQuery),
00134     _vertexField(other._vertexField)
00135   {}
00136 
00138   ~ISS_Interpolate()
00139   {}
00140 
00142   
00145 
00147   FieldParameterType
00148   operator()(const Vertex& x) const {
00149     return _vertexField.interpolate
00150       (_simplexQuery.computeMinimumDistanceIndex(x), x);
00151   }
00152 
00154 };
00155 
00156 END_NAMESPACE_GEOM
00157 
00158 #endif