xmsinterp  1.0
InterpIdw.h
Go to the documentation of this file.
1 #pragma once
2 //------------------------------------------------------------------------------
7 //------------------------------------------------------------------------------
8 
9 //----- Included files ---------------------------------------------------------
12 #include <xmscore/points/ptsfwd.h>
13 #include <xmscore/stl/vector.h>
15 
16 //----- Forward declarations ---------------------------------------------------
17 
18 //----- Namespace declaration --------------------------------------------------
19 namespace xms
20 {
21 class Observer;
22 
23 //----- Constants / Enumerations -----------------------------------------------
24 
25 //----- Structs / Classes ------------------------------------------------------
28 class InterpIdw : public InterpBase
29 {
30 public:
31  static BSHP<InterpIdw> New();
32  virtual ~InterpIdw();
33 
35  enum WeightEnum { CLASSIC, MODIFIED };
37  enum NodalFuncEnum { CONSTANT, GRAD_PLANE, QUADRATIC };
38 
40 
41  virtual void SetPtsTris(BSHP<VecPt3d> a_, BSHP<VecInt> a_tris) override = 0;
42  virtual void SetScalars(const float* a_scalar, size_t a_n) override = 0;
43  virtual void SetScalars(BSHP<VecFlt> a_scalar) override = 0;
44  virtual void SetPts(BSHP<VecPt3d> a_, bool a_2d) = 0;
45  virtual float InterpToPt(const Pt3d& a_pt) override = 0;
46  // this method will run parallel
47  virtual void InterpToPts(const VecPt3d& a_pts,
48  VecFlt& a_scalars) override = 0;
49  virtual void SetPtActivity(DynBitset& a_activity) override = 0;
50  // bitset is number of triangles in length not numtri*3 like the tris array
51  virtual void SetTriActivity(DynBitset& a_activity) override = 0;
52  virtual const BSHP<VecPt3d> GetPts() const override = 0;
53  virtual const BSHP<VecInt> GetTris() const override = 0;
54  virtual const BSHP<VecFlt> GetScalars() const override = 0;
55  virtual DynBitset GetPtActivity() const override = 0;
56  virtual DynBitset GetTriActivity() const override = 0;
57  virtual void SetTrunc(double a_sMax, double a_sMin) override = 0;
58 
59  virtual bool GetTruncateInterpolatedValues() const = 0;
60  virtual double GetTruncMin() const = 0;
61  virtual double GetTruncMax() const = 0;
62  virtual double GetPower() const = 0;
63  virtual int GetSearchOptsNumNearestPts() const = 0;
64  virtual bool GetSearchOptsUseQuadrantSearch() const = 0;
65  virtual WeightEnum GetWeightCalcMethod() const = 0;
66  virtual NodalFuncEnum GetNodalFunctionType() const = 0;
67  virtual int GetNodalFunctionNumNearestPts() const = 0;
68  virtual bool GetNodalFunctionUseQuadrantSearch() const = 0;
69 
70 
71  // various IDW options
72  virtual void SetObserver(BSHP<Observer> a_) = 0;
73  virtual void SetPower(double a_) = 0;
74  virtual void SetSearchOpts(int a_nNearestPoints, bool a_quad_oct_Search) = 0;
75  virtual void SetWeightCalcMethod(WeightEnum a_) = 0;
76  virtual void SetNodalFunction(NodalFuncEnum a_,
77  int a_nNearests,
78  bool a_quad_oct,
79  BSHP<Observer> a_prog) = 0;
80 
81  virtual void SetSaveWeights(bool a_) = 0; // used by pilot points
82 
83  virtual void InterpWeights(
84  const Pt3d& a_pt, // interp weights from the points to the passed in a_pt
85  VecInt& a_idx,
86  VecDbl& a_wt) const = 0;
87 
88  virtual void SetMultiThreading(bool a_) = 0;
89 
90  virtual std::string ToString() const override = 0;
91 
92 private:
95 
96 protected:
97  InterpIdw();
98 };
99 //----- Function prototypes ----------------------------------------------------
100 }
std::vector< int > VecInt
std::vector< double > VecDbl
std::vector< float > VecFlt
static BSHP< InterpIdw > New()
Creates an InterpIdw class.
Definition: InterpIdw.cpp:284
Class that performs inverse distance weighted interpolation.
Definition: InterpIdw.h:28
virtual ~InterpIdw()
Destructor.
Definition: InterpIdw.cpp:298
boost::dynamic_bitset< size_t > DynBitset
InterpIdw()
Constructor.
Definition: InterpIdw.cpp:292
#define XM_DISALLOW_COPY_AND_ASSIGN(TypeName)
WeightEnum
Weight calculation method enumeration.
Definition: InterpIdw.h:35
Base class for interpolation methods.
Definition: InterpBase.h:28
NodalFuncEnum
Nodal fuction type enumeration.
Definition: InterpIdw.h:37
std::vector< Pt3d > VecPt3d