xmsinterp  1.0
InterpLinear.h
Go to the documentation of this file.
1 #pragma once
2 //------------------------------------------------------------------------------
7 //------------------------------------------------------------------------------
8 
9 //----- Included files ---------------------------------------------------------
10 
11 // 3. Standard Library Headers
12 
13 // 4. External Library Headers
14 
15 // 5. Shared Headers
16 #include <xmscore/points/ptsfwd.h>
17 #include <xmscore/stl/vector.h>
21 
22 
23 //----- Forward declarations ---------------------------------------------------
24 
25 //----- Namespace declaration --------------------------------------------------
26 namespace xms
27 {
28 class Observer;
29 
30 //----- Constants / Enumerations -----------------------------------------------
31 
32 //----- Structs / Classes ------------------------------------------------------
33 
37 class InterpLinear : public InterpBase
38 {
39 public:
40  static BSHP<InterpLinear> New();
41  virtual ~InterpLinear();
42 
44  virtual void SetPtsTris(BSHP<VecPt3d> a_, BSHP<VecInt> a_tris) override = 0;
45  virtual void SetScalars(const float* a_scalar, size_t a_n) override = 0;
46  virtual void SetScalars(BSHP<VecFlt> a_scalar) override = 0;
47  virtual float InterpToPt(const Pt3d& a_pt) override = 0;
48  virtual void InterpToPts(const VecPt3d& a_pts,
49  VecFlt& a_scalars) override = 0;
50  virtual void SetPtActivity(DynBitset& a_activity) override = 0;
51  // bitset is number of triangles in length not numtri*3 like the tris array
52  virtual void SetTriActivity(DynBitset& a_activity) override = 0;
53  virtual const BSHP<VecPt3d> GetPts() const override = 0;
54  virtual const BSHP<VecInt> GetTris() const override = 0;
55  virtual const BSHP<VecFlt> GetScalars() const override = 0;
56  virtual DynBitset GetPtActivity() const override = 0;
57  virtual DynBitset GetTriActivity() const override = 0;
58  virtual VecInt GetExtrapolationPointIndexes() const = 0;
59 
60  // find triangle
61  virtual int TriContainingPt(const Pt3d& a_pt) = 0;
62  virtual void TriEnvelopsContainingPt(const Pt3d& a_pt, std::vector<int>& a_tris) = 0;
63  // interpolation
64  virtual bool InterpWeights(const Pt3d& a_pt,
65  VecInt& a_idxs,
66  VecDbl& a_wts) = 0;
67 
68  // interpolation options
69  virtual void SetExtrapVal(double a_val) = 0;
70  virtual void SetTrunc(double a_sMax, double a_sMin) override = 0;
71  virtual void SetUseCloughTocher(bool a_, BSHP<Observer> a_prog) = 0;
72  virtual void SetUseNatNeigh(bool a_,
73  int a_nodalFunc,
74  int a_ndFuncOpt,
75  int a_ndFuncNumNearestPts,
76  bool a_blendWeights,
77  BSHP<Observer> a_prog) = 0;
78 
79  virtual double GetExtrapVal() const = 0;
80  virtual bool GetTruncateInterpolatedValues() const = 0;
81  virtual double GetTruncMin() const = 0;
82  virtual double GetTruncMax() const = 0;
83  virtual bool GetUseCloughTocher() const = 0;
84  virtual bool GetUseNatNeigh() const = 0;
85  virtual int GetNatNeighNodalFunc() const = 0;
86  virtual int GetNatNeighNodalFuncNearestPtsOption() const = 0;
87  virtual int GetNatNeighNodalFuncNumNearestPts() const = 0;
88  virtual bool GetNatNeighBlendWeights() const = 0;
89 
90 
91  virtual std::string ToString() const override = 0;
92 
93 private:
96 
97 protected:
98  InterpLinear();
99 }; // class InterpLinear
100 
101 //----- Function prototypes ----------------------------------------------------
102 }
std::vector< int > VecInt
std::vector< double > VecDbl
std::vector< float > VecFlt
boost::dynamic_bitset< size_t > DynBitset
Class that performs linear interpolation.
Definition: InterpLinear.h:37
#define XM_DISALLOW_COPY_AND_ASSIGN(TypeName)
Base class for interpolation methods.
Definition: InterpBase.h:28
static BSHP< InterpLinear > New()
Creates an TriSearch class.
std::vector< Pt3d > VecPt3d