xmsgeom  1.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
TrTriangulatorPoints.h
Go to the documentation of this file.
1 #pragma once
2 //------------------------------------------------------------------------------
8 //------------------------------------------------------------------------------
9 
10 //----- Included files ---------------------------------------------------------
11 
12 #include <xmscore/stl/vector.h> // for VecInt
14 #include <xmscore/misc/boost_defines.h> // BSHP
15 
16 //----- Namespace declaration --------------------------------------------------
17 
18 namespace xms
19 {
20 //----- Constants / Enumerations -----------------------------------------------
21 
22 //----- Classes / Structs ------------------------------------------------------
23 class Observer;
24 
27 {
28 public:
29  TrTriangulatorPoints(const VecPt3d& a_pts, VecInt& a_tris, VecInt2d* a_trisAdjToPts = nullptr);
30  virtual ~TrTriangulatorPoints();
31 
32  virtual void SetObserver(BSHP<Observer> a_);
33 
34  virtual int GetID() const override;
35  virtual Pt3d GetLocation() const override;
36  virtual int GetNPoints() const override;
37  virtual void IncrementPoint() override;
38 
39  virtual void PrepareToReceiveTriangles() override;
40  virtual void FinalizeTriangulation() override;
41  virtual void ReceiveTriangle(int a_id1, int a_id2, int a_id3) override;
42 
43 private:
44  void UpdateAreaTolerance();
45 
46  const VecPt3d& m_pts;
47  int m_idx;
50  double m_areaTol;
51  BSHP<Observer> m_observer;
52 }; // class TrTriangulatorPoints
53 
54 } // namespace
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.
std::vector< int > VecInt
Base class used to derive a class to triangulate points.
virtual Pt3d GetLocation() const override
Get location of current point.
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.
std::vector< Pt3d > VecPt3d
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.
virtual void IncrementPoint() override
Increment the current point index by 1.
std::vector< VecInt > VecInt2d
Class to triangulate simple points.
BSHP< Observer > m_observer
Observer.