xmsgeom  1.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
GmTriSearch.h
Go to the documentation of this file.
1 #pragma once
2 //------------------------------------------------------------------------------
8 //------------------------------------------------------------------------------
9 
10 //----- Included files ---------------------------------------------------------
11 #include <boost/dynamic_bitset.hpp>
13 #include <xmscore/points/ptsfwd.h>
14 #include <xmscore/stl/vector.h>
16 #include <xmscore/misc/DynBitset.h>
17 
18 //----- Forward declarations ---------------------------------------------------
19 
20 //----- Namespace declaration --------------------------------------------------
21 namespace xms
22 {
23 class Observer;
24 
25 //----- Constants / Enumerations -----------------------------------------------
26 
27 //----- Structs / Classes ------------------------------------------------------
31 {
32 public:
33  static BSHP<GmTriSearch> New();
34  virtual ~GmTriSearch();
35 
37  // setup
38  virtual void TrisToSearch(BSHP<std::vector<Pt3d>> a_pts, BSHP<std::vector<int>> a_tris) = 0;
39  virtual void SetPtActivity(DynBitset& a_activity) = 0;
40  // bitset is number of triangles in length not numtri*3 like the tris array
41  virtual void SetTriActivity(DynBitset& a_activity) = 0;
42  virtual DynBitset GetPtActivity() = 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 
58  virtual std::string ToString() const = 0;
59 
60 private:
63 
64 protected:
65  GmTriSearch();
66 };
67 //----- Function prototypes ----------------------------------------------------
68 }
static BSHP< GmTriSearch > New()
Creates an TriSearch class.
Spatial index for searching triangles.
Definition: GmTriSearch.h:30
boost::dynamic_bitset< size_t > DynBitset
#define XM_DISALLOW_COPY_AND_ASSIGN(TypeName)
#define BSHP
GmTriSearch()
Constructor.
virtual ~GmTriSearch()
Destructor.