xmsgrid  1.0
TrTriangulatorPoints.h
Go to the documentation of this file.
1 #pragma once
2 //------------------------------------------------------------------------------
7 //------------------------------------------------------------------------------
8 
9 //----- Included files ---------------------------------------------------------
10 
11 #include <xmscore/stl/vector.h> // for VecInt
13 #include <xmscore/misc/boost_defines.h> // BSHP
14 
15 //----- Namespace declaration --------------------------------------------------
16 
17 namespace xms
18 {
19 //----- Constants / Enumerations -----------------------------------------------
20 
21 //----- Classes / Structs ------------------------------------------------------
22 class Observer;
23 
26 {
27 public:
28  TrTriangulatorPoints(const VecPt3d& a_pts, VecInt& a_tris, VecInt2d* a_trisAdjToPts = nullptr);
29  virtual ~TrTriangulatorPoints();
30 
31  virtual void SetObserver(BSHP<Observer> a_);
32 
33  virtual int GetID() const override;
34  virtual Pt3d GetLocation() const override;
35  virtual int GetNPoints() const override;
36  virtual void IncrementPoint() override;
37 
38  virtual void PrepareToReceiveTriangles() override;
39  virtual void FinalizeTriangulation() override;
40  virtual void ReceiveTriangle(int a_id1, int a_id2, int a_id3) override;
41 
42 private:
43  void UpdateAreaTolerance();
44 
45  const VecPt3d& m_pts;
46  int m_idx;
49  double m_areaTol;
50  BSHP<Observer> m_observer;
51 }; // class TrTriangulatorPoints
52 
53 } // namespace
std::vector< int > VecInt
virtual int GetID() const override
Return the current point index (0-based).
double m_areaTol
tolerance for area to be greater than 0.0
virtual void ReceiveTriangle(int a_id1, int a_id2, int a_id3) override
Receive a triangle consisting of the 3 points.
virtual void PrepareToReceiveTriangles() override
Called just before triangles are created.
VecInt2d * m_trisAdjToPts
Triangles adjacent to points.
TrTriangulatorPoints(const VecPt3d &a_pts, VecInt &a_tris, VecInt2d *a_trisAdjToPts=nullptr)
Triangulate Pt3ds returning triangles in a single 1D vector.
int m_idx
Current point index.
Base class used to derive a class to triangulate points.
virtual Pt3d GetLocation() const override
Get location of current point.
std::vector< VecInt > VecInt2d
const VecPt3d & m_pts
The points.
virtual void FinalizeTriangulation() override
Called after all triangles have been received.
void UpdateAreaTolerance()
calculates the area tolerance
virtual void SetObserver(BSHP< Observer > a_)
Set the observer to use for feedback while processing.
VecInt & m_tris
The triangles as 0-based indices into m_pts.
virtual int GetNPoints() const override
Return the number of points to be triangulated.
XMS Namespace.
Definition: geoms.cpp:34
virtual void IncrementPoint() override
Increment the current point index by 1.
Class to triangulate simple points.
std::vector< Pt3d > VecPt3d
BSHP< Observer > m_observer
Observer.