xmsgrid  1.0
GmTriSearch.h
Go to the documentation of this file.
1 #pragma once
2 //------------------------------------------------------------------------------
7 //------------------------------------------------------------------------------
8 
9 //----- Included files ---------------------------------------------------------
10 #include <boost/dynamic_bitset.hpp>
12 #include <xmscore/points/ptsfwd.h>
13 #include <xmscore/stl/vector.h>
15 #include <xmscore/misc/DynBitset.h>
16 
17 //----- Forward declarations ---------------------------------------------------
18 
19 //----- Namespace declaration --------------------------------------------------
20 namespace xms
21 {
22 class Observer;
23 
24 //----- Constants / Enumerations -----------------------------------------------
25 
26 //----- Structs / Classes ------------------------------------------------------
30 {
31 public:
32  static BSHP<GmTriSearch> New();
33  virtual ~GmTriSearch();
34 
36  // setup
37  virtual void TrisToSearch(BSHP<std::vector<Pt3d>> a_pts, BSHP<std::vector<int>> a_tris) = 0;
38  virtual void SetPtActivity(DynBitset& a_activity) = 0;
39  // bitset is number of triangles in length not numtri*3 like the tris array
40  virtual void SetTriActivity(DynBitset& a_activity) = 0;
41  virtual DynBitset GetPtActivity() const = 0;
42  virtual DynBitset GetTriActivity() const = 0;
43  // find triangle
44  virtual int TriContainingPt(const Pt3d& a_pt) = 0;
45  virtual void TriEnvelopsContainingPt(const Pt3d& a_pt, std::vector<int>& a_tris) = 0;
46  virtual void TriEnvelopesOverlap(const Pt3d& a_pMin,
47  const Pt3d& a_pMax,
48  std::vector<int>& a_tris) = 0;
49  // interpolation
50  virtual bool InterpWeights(const Pt3d& a_pt,
51  std::vector<int>& a_idxs,
52  std::vector<double>& a_wts) = 0;
53  virtual bool InterpWeightsTriangleIdx(const Pt3d& a_pt,
54  int& a_triangleIdx,
55  std::vector<int>& a_idxs,
56  std::vector<double>& a_wts) = 0;
57  virtual const BSHP<VecPt3d> GetPoints() const = 0;
58  virtual const BSHP<VecInt> GetTriangles() const = 0;
59 
60  virtual std::string ToString() const = 0;
61 
62 private:
65 
66 protected:
67  GmTriSearch();
68 };
69 //----- Function prototypes ----------------------------------------------------
70 }
static BSHP< GmTriSearch > New()
Creates an TriSearch class.
Spatial index for searching triangles.
Definition: GmTriSearch.h:29
boost::dynamic_bitset< size_t > DynBitset
#define XM_DISALLOW_COPY_AND_ASSIGN(TypeName)
#define BSHP
XMS Namespace.
Definition: geoms.cpp:34
GmTriSearch()
Constructor.
virtual ~GmTriSearch()
Destructor.