xmsextractor  1.0
XmUGridTriangles2d.h
Go to the documentation of this file.
1 #pragma once
2 //------------------------------------------------------------------------------
8 //------------------------------------------------------------------------------
9 
10 //----- Included files ---------------------------------------------------------
11 
12 // 3. Standard library headers
13 
14 // 4. External library headers
15 
16 // 5. Shared code headers
17 #include <xmscore/misc/base_macros.h>
18 #include <xmscore/misc/boost_defines.h>
19 #include <xmscore/misc/DynBitset.h>
20 #include <xmscore/stl/vector.h>
21 
22 //----- Forward declarations ---------------------------------------------------
23 
24 //----- Namespace declaration --------------------------------------------------
25 
27 namespace xms
28 {
29 //----- Forward declarations ---------------------------------------------------
30 class GmTriSearch;
31 class XmUGrid;
32 
33 //----- Constants / Enumerations -----------------------------------------------
34 
35 //----- Structs / Classes ------------------------------------------------------
36 
39 {
40 public:
41  static BSHP<XmUGridTriangles2d> New();
42  virtual ~XmUGridTriangles2d();
43 
47  virtual void BuildTriangles(const XmUGrid& a_ugrid, bool a_addTriangleCenters) = 0;
50  virtual void BuildEarcutTriangles(const XmUGrid& a_ugrid) = 0;
53  virtual void SetCellActivity(const DynBitset& a_cellActivity) = 0;
54 
57  virtual const VecPt3d& GetPoints() const = 0;
60  virtual const VecInt& GetTriangles() const = 0;
63  virtual BSHP<VecPt3d> GetPointsPtr() = 0;
66  virtual BSHP<VecInt> GetTrianglesPtr() = 0;
67 
71  virtual int GetCellCentroid(int a_cellIdx) const = 0;
72 
78  virtual int GetIntersectedCell(const Pt3d& a_point, VecInt& a_idxs, VecDbl& a_weights) = 0;
79 
80 protected:
82 
83 private:
84  XM_DISALLOW_COPY_AND_ASSIGN(XmUGridTriangles2d)
85 };
86 
87 //----- Function prototypes ----------------------------------------------------
88 
89 } // namespace xms
virtual const VecPt3d & GetPoints() const =0
Get the generated triangle points.
XmUGridTriangles2d()
Default contructor.
Class to store XmUGrid triangles. Tracks where midpoints and triangles came from. ...
virtual void BuildEarcutTriangles(const XmUGrid &a_ugrid)=0
Generate triangles for the UGrid using earcut algorithm.
virtual ~XmUGridTriangles2d()
Destructor.
static BSHP< XmUGridTriangles2d > New()
Build an instance of XmUGridTriangles2d.
virtual void SetCellActivity(const DynBitset &a_cellActivity)=0
Set triangle activity based on each triangles cell.
virtual int GetCellCentroid(int a_cellIdx) const =0
Get the centroid of a cell.
XMS Namespace.
virtual BSHP< VecPt3d > GetPointsPtr()=0
Get the generated triangle points as a shared pointer.
virtual void BuildTriangles(const XmUGrid &a_ugrid, bool a_addTriangleCenters)=0
Generate triangles for the UGrid.
virtual BSHP< VecInt > GetTrianglesPtr()=0
Get the generated triangles as a shared pointer.
virtual const VecInt & GetTriangles() const =0
Get the generated triangles.
virtual int GetIntersectedCell(const Pt3d &a_point, VecInt &a_idxs, VecDbl &a_weights)=0
Get the cell index and interpolation values intersected by a point.