ActiveLib
Loading...
Searching...
No Matches
Faceter.h
1
6#ifndef ACTIVE_GEOMETRY_FACETER
7#define ACTIVE_GEOMETRY_FACETER
8
9#include "Active/Geometry/Arc.h"
10#include "Active/Geometry/PolyEdge.h"
11
12namespace active::geometry {
13
15 class Faceter {
16 public:
17
18 // MARK: - Constructors
19
28 Faceter(const Point& orig, const PolyPoint& end, bool isStart = false, bool isEnd = true, double toler = 0.002);
35 Faceter(const Point& orig, const PolyPoint& end, double step);
40 Faceter(const Faceter& source);
45
46 // MARK: - Operators
47
51 void operator++ ();
57
58 // MARK: - Functions (const)
59
64 Point getVertex() const;
69 bool isAtStart() const { return (m_currentStep == 0); }
74 bool isAtEnd() const { return (m_currentStep == (m_endStep - m_startStep)); }
78 double getRemainder() const { return m_remainder; }
79
80 private:
81 bool m_isAlong;
82 PolyEdge m_edge;
83 double m_step;
84 double m_remainder;
85 Arc m_arc;
86 double m_incAngle;
87 double m_incHeight;
88 vertex_index m_currentStep;
89 vertex_index m_startStep;
90 vertex_index m_endStep;
91 };
92
93}
94
95#endif //ACTIVE_GEOMETRY_FACETER
Class to represent an arc.
Definition Arc.h:25
A class to divide an arc into facets.
Definition Faceter.h:15
void operator++()
Definition Faceter.cpp:116
bool isAtStart() const
Definition Faceter.h:69
bool isAtEnd() const
Definition Faceter.h:74
double getRemainder() const
Definition Faceter.h:78
Point getVertex() const
Definition Faceter.cpp:140
Faceter(const Point &orig, const PolyPoint &end, bool isStart=false, bool isEnd=true, double toler=0.002)
Definition Faceter.cpp:25
~Faceter()
Definition Faceter.h:44
Definition Point.h:36
Definition PolyEdge.h:25
Definition PolyPoint.h:24
Definition Anchor2D.h:11
int32_t vertex_index
Index of a vertex, e.g. within a polygon.
Definition Point.h:22
@ end
On the end of an edge.