v0.14.0
clipper.hpp
Go to the documentation of this file.
1 /*******************************************************************************
2 * *
3 * Author : Angus Johnson *
4 * Version : 6.4.0 *
5 * Date : 2 July 2015 *
6 * Website : http://www.angusj.com *
7 * Copyright : Angus Johnson 2010-2015 *
8 * *
9 * License: *
10 * Use, modification & distribution is subject to Boost Software License Ver 1. *
11 * http://www.boost.org/LICENSE_1_0.txt *
12 * *
13 * Attributions: *
14 * The code in this library is an extension of Bala Vatti's clipping algorithm: *
15 * "A generic solution to polygon clipping" *
16 * Communications of the ACM, Vol 35, Issue 7 (July 1992) pp 56-63. *
17 * http://portal.acm.org/citation.cfm?id=129906 *
18 * *
19 * Computer graphics and geometric modeling: implementation and algorithms *
20 * By Max K. Agoston *
21 * Springer; 1 edition (January 4, 2005) *
22 * http://books.google.com/books?q=vatti+clipping+agoston *
23 * *
24 * See also: *
25 * "Polygon Offsetting by Computing Winding Numbers" *
26 * Paper no. DETC2005-85513 pp. 565-575 *
27 * ASME 2005 International Design Engineering Technical Conferences *
28 * and Computers and Information in Engineering Conference (IDETC/CIE2005) *
29 * September 24-28, 2005 , Long Beach, California, USA *
30 * http://www.me.berkeley.edu/~mcmains/pubs/DAC05OffsetPolygon.pdf *
31 * *
32 *******************************************************************************/
33 
34 #ifndef clipper_hpp
35 #define clipper_hpp
36 
37 #define CLIPPER_VERSION "6.2.6"
38 
39 //use_int32: When enabled 32bit ints are used instead of 64bit ints. This
40 //improve performance but coordinate values are limited to the range +/- 46340
41 //#define use_int32
42 
43 //use_xyz: adds a Z member to IntPoint. Adds a minor cost to perfomance.
44 //#define use_xyz
45 
46 //use_lines: Enables line clipping. Adds a very minor cost to performance.
47 #define use_lines
48 
49 //use_deprecated: Enables temporary support for the obsolete functions
50 //#define use_deprecated
51 
52 #include <vector>
53 #include <list>
54 #include <set>
55 #include <stdexcept>
56 #include <cstring>
57 #include <cstdlib>
58 #include <ostream>
59 #include <functional>
60 #include <queue>
61 
62 namespace ClipperLib {
63 
66 //By far the most widely used winding rules for polygon filling are
67 //EvenOdd & NonZero (GDI, GDI+, XLib, OpenGL, Cairo, AGG, Quartz, SVG, Gr32)
68 //Others rules include Positive, Negative and ABS_GTR_EQ_TWO (only in OpenGL)
69 //see http://glprogramming.com/red/chapter11.html
71 
72 #ifdef use_int32
73  typedef int cInt;
74  static cInt const loRange = 0x7FFF;
75  static cInt const hiRange = 0x7FFF;
76 #else
77  typedef signed long long cInt;
78  static cInt const loRange = 0x3FFFFFFF;
79  static cInt const hiRange = 0x3FFFFFFFFFFFFFFFLL;
80  typedef signed long long long64; //used by Int128 class
81  typedef unsigned long long ulong64;
82 
83 #endif
84 
85 struct IntPoint {
88 #ifdef use_xyz
89  cInt Z;
90  IntPoint(cInt x = 0, cInt y = 0, cInt z = 0): X(x), Y(y), Z(z) {};
91 #else
92  IntPoint(cInt x = 0, cInt y = 0): X(x), Y(y) {};
93 #endif
94 
95  friend inline bool operator== (const IntPoint& a, const IntPoint& b)
96  {
97  return a.X == b.X && a.Y == b.Y;
98  }
99  friend inline bool operator!= (const IntPoint& a, const IntPoint& b)
100  {
101  return a.X != b.X || a.Y != b.Y;
102  }
103 };
104 //------------------------------------------------------------------------------
105 
106 typedef std::vector< IntPoint > Path;
107 typedef std::vector< Path > Paths;
108 
109 inline Path& operator <<(Path& poly, const IntPoint& p) {poly.push_back(p); return poly;}
110 inline Paths& operator <<(Paths& polys, const Path& p) {polys.push_back(p); return polys;}
111 
112 std::ostream& operator <<(std::ostream &s, const IntPoint &p);
113 std::ostream& operator <<(std::ostream &s, const Path &p);
114 std::ostream& operator <<(std::ostream &s, const Paths &p);
115 
117 {
118  double X;
119  double Y;
120  DoublePoint(double x = 0, double y = 0) : X(x), Y(y) {}
121  DoublePoint(IntPoint ip) : X((double)ip.X), Y((double)ip.Y) {}
122 };
123 //------------------------------------------------------------------------------
124 
125 #ifdef use_xyz
126 typedef void (*ZFillCallback)(IntPoint& e1bot, IntPoint& e1top, IntPoint& e2bot, IntPoint& e2top, IntPoint& pt);
127 #endif
128 
132 
133 class PolyNode;
134 typedef std::vector< PolyNode* > PolyNodes;
135 
136 class PolyNode
137 {
138 public:
139  PolyNode();
140  virtual ~PolyNode(){};
141  Path Contour;
144  PolyNode* GetNext() const;
145  bool IsHole() const;
146  bool IsOpen() const;
147  int ChildCount() const;
148 private:
149  unsigned Index; //node index in Parent.Childs
150  bool m_IsOpen;
153  PolyNode* GetNextSiblingUp() const;
154  void AddChild(PolyNode& child);
155  friend class Clipper; //to access Index
156  friend class ClipperOffset;
157 };
158 
159 class PolyTree: public PolyNode
160 {
161 public:
163  PolyNode* GetFirst() const;
164  void Clear();
165  int Total() const;
166 private:
168  friend class Clipper; //to access AllNodes
169 };
170 
171 bool Orientation(const Path &poly);
172 double Area(const Path &poly);
173 int PointInPolygon(const IntPoint &pt, const Path &path);
174 
175 void SimplifyPolygon(const Path &in_poly, Paths &out_polys, PolyFillType fillType = pftEvenOdd);
176 void SimplifyPolygons(const Paths &in_polys, Paths &out_polys, PolyFillType fillType = pftEvenOdd);
177 void SimplifyPolygons(Paths &polys, PolyFillType fillType = pftEvenOdd);
178 
179 void CleanPolygon(const Path& in_poly, Path& out_poly, double distance = 1.415);
180 void CleanPolygon(Path& poly, double distance = 1.415);
181 void CleanPolygons(const Paths& in_polys, Paths& out_polys, double distance = 1.415);
182 void CleanPolygons(Paths& polys, double distance = 1.415);
183 
184 void MinkowskiSum(const Path& pattern, const Path& path, Paths& solution, bool pathIsClosed);
185 void MinkowskiSum(const Path& pattern, const Paths& paths, Paths& solution, bool pathIsClosed);
186 void MinkowskiDiff(const Path& poly1, const Path& poly2, Paths& solution);
187 
188 void PolyTreeToPaths(const PolyTree& polytree, Paths& paths);
189 void ClosedPathsFromPolyTree(const PolyTree& polytree, Paths& paths);
190 void OpenPathsFromPolyTree(PolyTree& polytree, Paths& paths);
191 
192 void ReversePath(Path& p);
193 void ReversePaths(Paths& p);
194 
196 
197 //enums that are used internally ...
198 enum EdgeSide { esLeft = 1, esRight = 2};
199 
200 //forward declarations (for stuff used internally) ...
201 struct TEdge;
202 struct IntersectNode;
203 struct LocalMinimum;
204 struct OutPt;
205 struct OutRec;
206 struct Join;
207 
208 typedef std::vector < OutRec* > PolyOutList;
209 typedef std::vector < TEdge* > EdgeList;
210 typedef std::vector < Join* > JoinList;
211 typedef std::vector < IntersectNode* > IntersectList;
212 
213 //------------------------------------------------------------------------------
214 
215 //ClipperBase is the ancestor to the Clipper class. It should not be
216 //instantiated directly. This class simply abstracts the conversion of sets of
217 //polygon coordinates into edge objects that are stored in a LocalMinima list.
219 {
220 public:
221  ClipperBase();
222  virtual ~ClipperBase();
223  virtual bool AddPath(const Path &pg, PolyType PolyTyp, bool Closed);
224  bool AddPaths(const Paths &ppg, PolyType PolyTyp, bool Closed);
225  virtual void Clear();
226  IntRect GetBounds();
228  void PreserveCollinear(bool value) {m_PreserveCollinear = value;};
229 protected:
230  void DisposeLocalMinimaList();
231  TEdge* AddBoundsToLML(TEdge *e, bool IsClosed);
232  virtual void Reset();
233  TEdge* ProcessBound(TEdge* E, bool IsClockwise);
234  void InsertScanbeam(const cInt Y);
235  bool PopScanbeam(cInt &Y);
236  bool LocalMinimaPending();
237  bool PopLocalMinima(cInt Y, const LocalMinimum *&locMin);
238  OutRec* CreateOutRec();
239  void DisposeAllOutRecs();
240  void DisposeOutRec(PolyOutList::size_type index);
241  void SwapPositionsInAEL(TEdge *edge1, TEdge *edge2);
242  void DeleteFromAEL(TEdge *e);
243  void UpdateEdgeIntoAEL(TEdge *&e);
244 
245  typedef std::vector<LocalMinimum> MinimaList;
246  MinimaList::iterator m_CurrentLM;
248 
255 
256  typedef std::priority_queue<cInt> ScanbeamList;
258 };
259 //------------------------------------------------------------------------------
260 
261 class Clipper : public virtual ClipperBase
262 {
263 public:
264  Clipper(int initOptions = 0);
265  bool Execute(ClipType clipType,
266  Paths &solution,
267  PolyFillType fillType = pftEvenOdd);
268  bool Execute(ClipType clipType,
269  Paths &solution,
270  PolyFillType subjFillType,
271  PolyFillType clipFillType);
272  bool Execute(ClipType clipType,
273  PolyTree &polytree,
274  PolyFillType fillType = pftEvenOdd);
275  bool Execute(ClipType clipType,
276  PolyTree &polytree,
277  PolyFillType subjFillType,
278  PolyFillType clipFillType);
279  bool ReverseSolution() { return m_ReverseOutput; };
280  void ReverseSolution(bool value) {m_ReverseOutput = value;};
281  bool StrictlySimple() {return m_StrictSimple;};
282  void StrictlySimple(bool value) {m_StrictSimple = value;};
283  //set the callback function for z value filling on intersections (otherwise Z is 0)
284 #ifdef use_xyz
285  void ZFillFunction(ZFillCallback zFillFunc);
286 #endif
287 protected:
288  virtual bool ExecuteInternal();
289 private:
294  typedef std::list<cInt> MaximaList;
303 #ifdef use_xyz
304  ZFillCallback m_ZFill; //custom callback
305 #endif
306  void SetWindingCount(TEdge& edge);
307  bool IsEvenOddFillType(const TEdge& edge) const;
308  bool IsEvenOddAltFillType(const TEdge& edge) const;
309  void InsertLocalMinimaIntoAEL(const cInt botY);
310  void InsertEdgeIntoAEL(TEdge *edge, TEdge* startEdge);
311  void AddEdgeToSEL(TEdge *edge);
312  bool PopEdgeFromSEL(TEdge *&edge);
313  void CopyAELToSEL();
314  void DeleteFromSEL(TEdge *e);
315  void SwapPositionsInSEL(TEdge *edge1, TEdge *edge2);
316  bool IsContributing(const TEdge& edge) const;
317  bool IsTopHorz(const cInt XPos);
318  void DoMaxima(TEdge *e);
319  void ProcessHorizontals();
320  void ProcessHorizontal(TEdge *horzEdge);
321  void AddLocalMaxPoly(TEdge *e1, TEdge *e2, const IntPoint &pt);
322  OutPt* AddLocalMinPoly(TEdge *e1, TEdge *e2, const IntPoint &pt);
323  OutRec* GetOutRec(int idx);
324  void AppendPolygon(TEdge *e1, TEdge *e2);
325  void IntersectEdges(TEdge *e1, TEdge *e2, IntPoint &pt);
326  OutPt* AddOutPt(TEdge *e, const IntPoint &pt);
327  OutPt* GetLastOutPt(TEdge *e);
328  bool ProcessIntersections(const cInt topY);
329  void BuildIntersectList(const cInt topY);
330  void ProcessIntersectList();
331  void ProcessEdgesAtTopOfScanbeam(const cInt topY);
332  void BuildResult(Paths& polys);
333  void BuildResult2(PolyTree& polytree);
334  void SetHoleState(TEdge *e, OutRec *outrec);
335  void DisposeIntersectNodes();
336  bool FixupIntersectionOrder();
337  void FixupOutPolygon(OutRec &outrec);
338  void FixupOutPolyline(OutRec &outrec);
339  bool IsHole(TEdge *e);
340  bool FindOwnerFromSplitRecs(OutRec &outRec, OutRec *&currOrfl);
341  void FixHoleLinkage(OutRec &outrec);
342  void AddJoin(OutPt *op1, OutPt *op2, const IntPoint offPt);
343  void ClearJoins();
344  void ClearGhostJoins();
345  void AddGhostJoin(OutPt *op, const IntPoint offPt);
346  bool JoinPoints(Join *j, OutRec* outRec1, OutRec* outRec2);
347  void JoinCommonEdges();
348  void DoSimplePolygons();
349  void FixupFirstLefts1(OutRec* OldOutRec, OutRec* NewOutRec);
350  void FixupFirstLefts2(OutRec* InnerOutRec, OutRec* OuterOutRec);
351  void FixupFirstLefts3(OutRec* OldOutRec, OutRec* NewOutRec);
352 #ifdef use_xyz
353  void SetZ(IntPoint& pt, TEdge& e1, TEdge& e2);
354 #endif
355 };
356 //------------------------------------------------------------------------------
357 
359 {
360 public:
361  ClipperOffset(double miterLimit = 2.0, double roundPrecision = 0.25);
362  ~ClipperOffset();
363  void AddPath(const Path& path, JoinType joinType, EndType endType);
364  void AddPaths(const Paths& paths, JoinType joinType, EndType endType);
365  void Execute(Paths& solution, double delta);
366  void Execute(PolyTree& solution, double delta);
367  void Clear();
368  double MiterLimit;
369  double ArcTolerance;
370 private:
374  std::vector<DoublePoint> m_normals;
379 
380  void FixOrientations();
381  void DoOffset(double delta);
382  void OffsetPoint(int j, int& k, JoinType jointype);
383  void DoSquare(int j, int k);
384  void DoMiter(int j, int k, double r);
385  void DoRound(int j, int k);
386 };
387 //------------------------------------------------------------------------------
388 
389 class clipperException : public std::exception
390 {
391  public:
392  clipperException(const char* description): m_descr(description) {}
393  virtual ~clipperException() throw() {}
394  virtual const char* what() const throw() {return m_descr.c_str();}
395  private:
396  std::string m_descr;
397 };
398 //------------------------------------------------------------------------------
399 
400 } //ClipperLib namespace
401 
402 #endif //clipper_hpp
403 
404 
ClipperLib::OpenPathsFromPolyTree
void OpenPathsFromPolyTree(PolyTree &polytree, Paths &paths)
Definition: clipper.cpp:4620
ClipperLib::loRange
static const cInt loRange
Definition: clipper.hpp:78
ClipperLib::clipperException
Definition: clipper.hpp:389
ClipperLib::IntPoint::IntPoint
IntPoint(cInt x=0, cInt y=0)
Definition: clipper.hpp:92
ClipperLib::ClipperOffset::DoSquare
void DoSquare(int j, int k)
Definition: clipper.cpp:4204
ClipperLib::PolyNode::IsHole
bool IsHole() const
Definition: clipper.cpp:258
ClipperLib::ClipperBase::PopScanbeam
bool PopScanbeam(cInt &Y)
Definition: clipper.cpp:1377
ClipperLib::Path
std::vector< IntPoint > Path
Definition: clipper.hpp:106
ClipperLib::ioStrictlySimple
@ ioStrictlySimple
Definition: clipper.hpp:129
ClipperLib::Clipper::FindOwnerFromSplitRecs
bool FindOwnerFromSplitRecs(OutRec &outRec, OutRec *&currOrfl)
ClipperLib::Clipper::AddLocalMaxPoly
void AddLocalMaxPoly(TEdge *e1, TEdge *e2, const IntPoint &pt)
Definition: clipper.cpp:1920
ClipperLib::Paths
std::vector< Path > Paths
Definition: clipper.hpp:107
ClipperLib::PolyOutList
std::vector< OutRec * > PolyOutList
Definition: clipper.hpp:206
ClipperLib::PolyNode::~PolyNode
virtual ~PolyNode()
Definition: clipper.hpp:140
ClipperLib::Clipper::JoinCommonEdges
void JoinCommonEdges()
Definition: clipper.cpp:3708
ClipperLib::Clipper::IntersectEdges
void IntersectEdges(TEdge *e1, TEdge *e2, IntPoint &pt)
Definition: clipper.cpp:2142
ClipperLib::Clipper::InsertEdgeIntoAEL
void InsertEdgeIntoAEL(TEdge *edge, TEdge *startEdge)
Definition: clipper.cpp:3348
ClipperLib::Clipper::DisposeIntersectNodes
void DisposeIntersectNodes()
Definition: clipper.cpp:2880
ClipperLib::Clipper::m_ClipFillType
PolyFillType m_ClipFillType
Definition: clipper.hpp:298
ClipperLib::ClipperOffset::m_miterLim
double m_miterLim
Definition: clipper.hpp:376
ClipperLib::ClipperBase::PreserveCollinear
void PreserveCollinear(bool value)
Definition: clipper.hpp:228
ClipperLib::jtSquare
@ jtSquare
Definition: clipper.hpp:130
ClipperLib::ClipperBase::m_UseFullRange
bool m_UseFullRange
Definition: clipper.hpp:249
ClipperLib::ClipperOffset::m_lowest
IntPoint m_lowest
Definition: clipper.hpp:377
ClipperLib::ClipperOffset::m_polyNodes
PolyNode m_polyNodes
Definition: clipper.hpp:378
ClipperLib::Clipper::DoSimplePolygons
void DoSimplePolygons()
Definition: clipper.cpp:4250
ClipperLib::PolyTree
Definition: clipper.hpp:159
ClipperLib::PolyNode::AddChild
void AddChild(PolyNode &child)
Definition: clipper.cpp:229
ClipperLib::OutPt
Definition: clipper.cpp:148
ClipperLib::PolyNode::Childs
PolyNodes Childs
Definition: clipper.hpp:142
ClipperLib::etClosedPolygon
@ etClosedPolygon
Definition: clipper.hpp:131
ClipperLib::EndType
EndType
Definition: clipper.hpp:131
ClipperLib::ClipperOffset::AddPath
void AddPath(const Path &path, JoinType joinType, EndType endType)
Definition: clipper.cpp:3838
ClipperLib::IntersectList
std::vector< IntersectNode * > IntersectList
Definition: clipper.hpp:211
ClipperLib::ClipperBase::ProcessBound
TEdge * ProcessBound(TEdge *E, bool IsClockwise)
Definition: clipper.cpp:964
ClipperLib::Clipper::FixupFirstLefts2
void FixupFirstLefts2(OutRec *InnerOutRec, OutRec *OuterOutRec)
Definition: clipper.cpp:3670
ClipperLib::Clipper::DoMaxima
void DoMaxima(TEdge *e)
Definition: clipper.cpp:2989
ClipperLib::ClipperBase::m_HasOpenPaths
bool m_HasOpenPaths
Definition: clipper.hpp:252
ClipperLib::PolyTree::Total
int Total() const
Definition: clipper.cpp:206
ClipperLib::ClipperOffset::ArcTolerance
double ArcTolerance
Definition: clipper.hpp:369
ClipperLib::PolyNodes
std::vector< PolyNode * > PolyNodes
Definition: clipper.hpp:133
ClipperLib::Clipper::SetWindingCount
void SetWindingCount(TEdge &edge)
Definition: clipper.cpp:1660
ClipperLib::Clipper::Execute
bool Execute(ClipType clipType, Paths &solution, PolyFillType fillType=pftEvenOdd)
Definition: clipper.cpp:1532
ClipperLib::ctXor
@ ctXor
Definition: clipper.hpp:64
ClipperLib::PolyFillType
PolyFillType
Definition: clipper.hpp:70
ClipperLib::Clipper::AddEdgeToSEL
void AddEdgeToSEL(TEdge *edge)
Definition: clipper.cpp:1936
ClipperLib::OutRec
Definition: clipper.cpp:138
ClipperLib::ClipperBase
Definition: clipper.hpp:218
ClipperLib::Clipper::m_Maxima
MaximaList m_Maxima
Definition: clipper.hpp:295
ClipperLib::pftPositive
@ pftPositive
Definition: clipper.hpp:70
ClipperLib::cInt
signed long long cInt
Definition: clipper.hpp:77
E
ClipperLib::ptSubject
@ ptSubject
Definition: clipper.hpp:65
ClipperLib::Clipper::ClearGhostJoins
void ClearGhostJoins()
Definition: clipper.cpp:1996
ClipperLib::Clipper::SwapPositionsInSEL
void SwapPositionsInSEL(TEdge *edge1, TEdge *edge2)
Definition: clipper.cpp:2594
ClipperLib::Clipper::ClearJoins
void ClearJoins()
Definition: clipper.cpp:1988
ClipperLib::Clipper::InsertLocalMinimaIntoAEL
void InsertLocalMinimaIntoAEL(const cInt botY)
Definition: clipper.cpp:2014
ClipperLib::ClipperOffset::Execute
void Execute(Paths &solution, double delta)
Definition: clipper.cpp:3916
ClipperLib::Clipper::ProcessHorizontal
void ProcessHorizontal(TEdge *horzEdge)
Definition: clipper.cpp:2672
ClipperLib::Clipper::BuildIntersectList
void BuildIntersectList(const cInt topY)
Definition: clipper.cpp:2888
ClipperLib::Area
double Area(const Path &poly)
Definition: clipper.cpp:427
ClipperLib::DoublePoint::X
double X
Definition: clipper.hpp:118
ClipperLib::ClipperBase::m_edges
EdgeList m_edges
Definition: clipper.hpp:250
ClipperLib::ctUnion
@ ctUnion
Definition: clipper.hpp:64
ClipperLib::ClipperBase::InsertScanbeam
void InsertScanbeam(const cInt Y)
Definition: clipper.cpp:1371
ClipperLib::Orientation
bool Orientation(const Path &poly)
Definition: clipper.cpp:421
ClipperLib::Clipper::ProcessIntersections
bool ProcessIntersections(const cInt topY)
Definition: clipper.cpp:2859
ClipperLib::CleanPolygon
void CleanPolygon(const Path &in_poly, Path &out_poly, double distance=1.415)
Definition: clipper.cpp:4419
ClipperLib::Clipper::AddOutPt
OutPt * AddOutPt(TEdge *e, const IntPoint &pt)
Definition: clipper.cpp:2499
sdf.r
int r
Definition: sdf.py:8
ClipperLib::ClipperBase::AddPath
virtual bool AddPath(const Path &pg, PolyType PolyTyp, bool Closed)
Definition: clipper.cpp:1081
ClipperLib::ClipperOffset::m_sin
double m_sin
Definition: clipper.hpp:375
ClipperLib::clipperException::m_descr
std::string m_descr
Definition: clipper.hpp:396
ClipperLib::PolyNode::m_jointype
JoinType m_jointype
Definition: clipper.hpp:151
ClipperLib::ClipperBase::LocalMinimaPending
bool LocalMinimaPending()
Definition: clipper.cpp:1501
ClipperLib::ClipperBase::DeleteFromAEL
void DeleteFromAEL(TEdge *e)
Definition: clipper.cpp:1403
ClipperLib::ClipperBase::DisposeAllOutRecs
void DisposeAllOutRecs()
Definition: clipper.cpp:1387
ClipperLib::Clipper::m_Joins
JoinList m_Joins
Definition: clipper.hpp:290
ClipperLib::IntPoint::operator==
friend bool operator==(const IntPoint &a, const IntPoint &b)
Definition: clipper.hpp:95
ClipperLib::PolyNode::m_endtype
EndType m_endtype
Definition: clipper.hpp:152
ClipperLib::ctDifference
@ ctDifference
Definition: clipper.hpp:64
ClipperLib::ClipperBase::Reset
virtual void Reset()
Definition: clipper.cpp:1283
ClipperLib::ClipperBase::m_ActiveEdges
TEdge * m_ActiveEdges
Definition: clipper.hpp:254
ClipperLib::ClipperBase::m_PreserveCollinear
bool m_PreserveCollinear
Definition: clipper.hpp:251
ClipperLib::ClipperBase::UpdateEdgeIntoAEL
void UpdateEdgeIntoAEL(TEdge *&e)
Definition: clipper.cpp:1478
ClipperLib::Clipper::IsTopHorz
bool IsTopHorz(const cInt XPos)
ClipperLib::ClipperOffset::m_destPoly
Path m_destPoly
Definition: clipper.hpp:373
ClipperLib::Clipper::ReverseSolution
void ReverseSolution(bool value)
Definition: clipper.hpp:280
ClipperLib::IntPoint::Y
cInt Y
Definition: clipper.hpp:87
ClipperLib::PolyNode::Contour
Path Contour
Definition: clipper.hpp:140
ClipperLib::ClipperOffset::DoMiter
void DoMiter(int j, int k, double r)
Definition: clipper.cpp:4217
ClipperLib::ioPreserveCollinear
@ ioPreserveCollinear
Definition: clipper.hpp:129
ClipperLib::ulong64
unsigned long long ulong64
Definition: clipper.hpp:81
ClipperLib::Clipper::Clipper
Clipper(int initOptions=0)
Definition: clipper.cpp:1510
ClipperLib::operator<<
Path & operator<<(Path &poly, const IntPoint &p)
Definition: clipper.hpp:109
ClipperLib::ptClip
@ ptClip
Definition: clipper.hpp:65
ClipperLib::PolyTree::~PolyTree
~PolyTree()
Definition: clipper.hpp:162
ClipperLib::hiRange
static const cInt hiRange
Definition: clipper.hpp:79
ClipperLib::ClipperBase::DisposeOutRec
void DisposeOutRec(PolyOutList::size_type index)
Definition: clipper.cpp:1394
ClipperLib::ClipperBase::PreserveCollinear
bool PreserveCollinear()
Definition: clipper.hpp:227
ClipperLib::Clipper::FixupFirstLefts1
void FixupFirstLefts1(OutRec *OldOutRec, OutRec *NewOutRec)
Definition: clipper.cpp:3654
ClipperLib::MinkowskiSum
void MinkowskiSum(const Path &pattern, const Path &path, Paths &solution, bool pathIsClosed)
Definition: clipper.cpp:4543
ClipperLib::Join
Definition: clipper.cpp:155
a
constexpr double a
Definition: approx_sphere.cpp:30
ClipperLib::etOpenSquare
@ etOpenSquare
Definition: clipper.hpp:131
ClipperLib::ClipperBase::Clear
virtual void Clear()
Definition: clipper.cpp:1269
ClipperLib::Clipper::AddGhostJoin
void AddGhostJoin(OutPt *op, const IntPoint offPt)
Definition: clipper.cpp:2004
ClipperLib::MinkowskiDiff
void MinkowskiDiff(const Path &poly1, const Path &poly2, Paths &solution)
Definition: clipper.cpp:4580
delta
static constexpr double delta
Definition: prism_elements_from_surface.cpp:18
ClipperLib::Clipper::FixupOutPolyline
void FixupOutPolyline(OutRec &outrec)
Definition: clipper.cpp:3145
ClipperLib::ClipperOffset::m_delta
double m_delta
Definition: clipper.hpp:375
ClipperLib::Clipper::ReverseSolution
bool ReverseSolution()
Definition: clipper.hpp:279
ClipperLib::JoinType
JoinType
Definition: clipper.hpp:130
double
ClipperLib::ClipperBase::GetBounds
IntRect GetBounds()
Definition: clipper.cpp:1331
ClipperLib::PolyNode::ChildCount
int ChildCount() const
Definition: clipper.cpp:223
ClipperLib::Clipper::IsContributing
bool IsContributing(const TEdge &edge) const
Definition: clipper.cpp:1777
ClipperLib::ClipperBase::MinimaList
std::vector< LocalMinimum > MinimaList
Definition: clipper.hpp:245
ClipperLib::PolyNode
Definition: clipper.hpp:136
ClipperLib::ClosedPathsFromPolyTree
void ClosedPathsFromPolyTree(const PolyTree &polytree, Paths &paths)
Definition: clipper.cpp:4612
ClipperLib::ClipperBase::~ClipperBase
virtual ~ClipperBase()
Definition: clipper.cpp:926
ClipperLib::DoublePoint::Y
double Y
Definition: clipper.hpp:119
ClipperLib::TEdge
Definition: clipper.cpp:102
ClipperLib::pftNegative
@ pftNegative
Definition: clipper.hpp:70
ClipperLib::ClipperBase::ClipperBase
ClipperBase()
Definition: clipper.cpp:919
ClipperLib::SimplifyPolygons
void SimplifyPolygons(const Paths &in_polys, Paths &out_polys, PolyFillType fillType=pftEvenOdd)
Definition: clipper.cpp:4334
ClipperLib::DoublePoint::DoublePoint
DoublePoint(double x=0, double y=0)
Definition: clipper.hpp:120
ClipperLib::ClipperOffset::FixOrientations
void FixOrientations()
Definition: clipper.cpp:3890
ClipperLib::ReversePath
void ReversePath(Path &p)
Definition: clipper.cpp:4312
ClipperLib::ClipperOffset::MiterLimit
double MiterLimit
Definition: clipper.hpp:368
ClipperLib::PolyType
PolyType
Definition: clipper.hpp:65
ClipperLib::Clipper::GetLastOutPt
OutPt * GetLastOutPt(TEdge *e)
Definition: clipper.cpp:2538
ClipperLib::PolyNode::GetNext
PolyNode * GetNext() const
Definition: clipper.cpp:238
ClipperLib::InitOptions
InitOptions
Definition: clipper.hpp:129
ClipperLib::IntRect
Definition: clipper.hpp:195
ClipperLib::ClipperBase::CreateOutRec
OutRec * CreateOutRec()
Definition: clipper.cpp:1416
ClipperLib::ClipperOffset::m_destPolys
Paths m_destPolys
Definition: clipper.hpp:371
ClipperLib::esRight
@ esRight
Definition: clipper.hpp:198
ClipperLib::Clipper::MaximaList
std::list< cInt > MaximaList
Definition: clipper.hpp:294
ClipperLib::PolyNode::Parent
PolyNode * Parent
Definition: clipper.hpp:143
ClipperLib::ClipperBase::DisposeLocalMinimaList
void DisposeLocalMinimaList()
Definition: clipper.cpp:1315
ClipperLib::IntPoint::X
cInt X
Definition: clipper.hpp:86
ClipperLib::Clipper::DeleteFromSEL
void DeleteFromSEL(TEdge *e)
Definition: clipper.cpp:2116
ClipperLib::Clipper::FixupFirstLefts3
void FixupFirstLefts3(OutRec *OldOutRec, OutRec *NewOutRec)
Definition: clipper.cpp:3695
ClipperLib::Clipper::m_SubjFillType
PolyFillType m_SubjFillType
Definition: clipper.hpp:299
ClipperLib::ClipperBase::AddBoundsToLML
TEdge * AddBoundsToLML(TEdge *e, bool IsClosed)
ClipperLib::IntRect::bottom
cInt bottom
Definition: clipper.hpp:195
ClipperLib::etOpenButt
@ etOpenButt
Definition: clipper.hpp:131
ClipperLib::jtMiter
@ jtMiter
Definition: clipper.hpp:130
ClipperLib::Clipper::FixupIntersectionOrder
bool FixupIntersectionOrder()
Definition: clipper.cpp:2966
ClipperLib::Clipper::FixHoleLinkage
void FixHoleLinkage(OutRec &outrec)
Definition: clipper.cpp:1581
ClipperLib::ClipperBase::m_CurrentLM
MinimaList::iterator m_CurrentLM
Definition: clipper.hpp:246
ClipperLib::ClipperBase::AddPaths
bool AddPaths(const Paths &ppg, PolyType PolyTyp, bool Closed)
Definition: clipper.cpp:1260
ClipperLib::ClipperBase::ScanbeamList
std::priority_queue< cInt > ScanbeamList
Definition: clipper.hpp:256
ClipperLib::Clipper::AddLocalMinPoly
OutPt * AddLocalMinPoly(TEdge *e1, TEdge *e2, const IntPoint &pt)
Definition: clipper.cpp:1877
ClipperLib::PolyTree::GetFirst
PolyNode * GetFirst() const
Definition: clipper.cpp:197
ClipperLib::ClipperBase::PopLocalMinima
bool PopLocalMinima(cInt Y, const LocalMinimum *&locMin)
Definition: clipper.cpp:1322
ClipperLib::CleanPolygons
void CleanPolygons(const Paths &in_polys, Paths &out_polys, double distance=1.415)
Definition: clipper.cpp:4485
ClipperLib::ClipperOffset::Clear
void Clear()
Definition: clipper.cpp:3829
ClipperLib::ClipperOffset::DoRound
void DoRound(int j, int k)
Definition: clipper.cpp:4225
ClipperLib::DoublePoint
Definition: clipper.hpp:116
ClipperLib::ClipperOffset::OffsetPoint
void OffsetPoint(int j, int &k, JoinType jointype)
Definition: clipper.cpp:4160
ClipperLib::Clipper::m_ReverseOutput
bool m_ReverseOutput
Definition: clipper.hpp:300
ClipperLib::JoinList
std::vector< Join * > JoinList
Definition: clipper.hpp:210
ClipperLib::PolyTree::AllNodes
PolyNodes AllNodes
Definition: clipper.hpp:167
ClipperLib::PointInPolygon
int PointInPolygon(const IntPoint &pt, const Path &path)
Definition: clipper.cpp:476
ClipperLib::Clipper::m_GhostJoins
JoinList m_GhostJoins
Definition: clipper.hpp:291
ClipperLib::PolyNode::PolyNode
PolyNode()
Definition: clipper.cpp:218
ClipperLib::LocalMinimum
Definition: clipper.cpp:128
ClipperLib::pftEvenOdd
@ pftEvenOdd
Definition: clipper.hpp:70
ClipperLib::Clipper::m_IntersectList
IntersectList m_IntersectList
Definition: clipper.hpp:292
ClipperLib::ioReverseSolution
@ ioReverseSolution
Definition: clipper.hpp:129
ClipperLib::ClipperOffset::m_srcPoly
Path m_srcPoly
Definition: clipper.hpp:372
ClipperLib::PolyTreeToPaths
void PolyTreeToPaths(const PolyTree &polytree, Paths &paths)
Definition: clipper.cpp:4604
ClipperLib::PolyNode::IsOpen
bool IsOpen() const
Definition: clipper.cpp:271
ClipperLib::EdgeSide
EdgeSide
Definition: clipper.hpp:198
ClipperLib::IntRect::top
cInt top
Definition: clipper.hpp:195
ClipperLib::Clipper::FixupOutPolygon
void FixupOutPolygon(OutRec &outrec)
Definition: clipper.cpp:3172
ClipperLib::PolyTree::Clear
void Clear()
Definition: clipper.cpp:188
ClipperLib::Clipper::m_ExecuteLocked
bool m_ExecuteLocked
Definition: clipper.hpp:297
ClipperLib::Clipper::StrictlySimple
bool StrictlySimple()
Definition: clipper.hpp:281
ClipperLib::clipperException::what
virtual const char * what() const
Definition: clipper.hpp:394
j
FTensor::Index< 'j', 3 > j
Definition: matrix_function.cpp:19
ClipperLib::EdgeList
std::vector< TEdge * > EdgeList
Definition: clipper.hpp:209
ClipperLib::ClipperOffset::ClipperOffset
ClipperOffset(double miterLimit=2.0, double roundPrecision=0.25)
Definition: clipper.cpp:3815
ClipperLib::IntRect::left
cInt left
Definition: clipper.hpp:195
ClipperLib::Clipper::StrictlySimple
void StrictlySimple(bool value)
Definition: clipper.hpp:282
ClipperLib::Clipper::IsEvenOddAltFillType
bool IsEvenOddAltFillType(const TEdge &edge) const
Definition: clipper.cpp:1769
ClipperLib::DoublePoint::DoublePoint
DoublePoint(IntPoint ip)
Definition: clipper.hpp:121
ClipperLib::Clipper::ExecuteInternal
virtual bool ExecuteInternal()
Definition: clipper.cpp:1596
ClipperLib::pftNonZero
@ pftNonZero
Definition: clipper.hpp:70
ClipperLib::Clipper::PopEdgeFromSEL
bool PopEdgeFromSEL(TEdge *&edge)
Definition: clipper.cpp:1956
ClipperLib::ClipperOffset::DoOffset
void DoOffset(double delta)
Definition: clipper.cpp:3987
ClipperLib
Definition: clipper.hpp:62
ClipperLib::Clipper::m_UsingPolyTree
bool m_UsingPolyTree
Definition: clipper.hpp:301
ClipperLib::Clipper::m_SortedEdges
TEdge * m_SortedEdges
Definition: clipper.hpp:296
ClipperLib::ClipperOffset::~ClipperOffset
~ClipperOffset()
Definition: clipper.cpp:3823
ClipperLib::long64
signed long long long64
Definition: clipper.hpp:80
ClipperLib::jtRound
@ jtRound
Definition: clipper.hpp:130
ClipperLib::Clipper::m_ClipType
ClipType m_ClipType
Definition: clipper.hpp:293
ClipperLib::Clipper::GetOutRec
OutRec * GetOutRec(int idx)
Definition: clipper.cpp:2394
ClipperLib::Clipper::CopyAELToSEL
void CopyAELToSEL()
Definition: clipper.cpp:1965
ClipperLib::PolyNode::GetNextSiblingUp
PolyNode * GetNextSiblingUp() const
Definition: clipper.cpp:247
ClipperLib::ClipperOffset::m_cos
double m_cos
Definition: clipper.hpp:375
ClipperLib::esLeft
@ esLeft
Definition: clipper.hpp:198
ClipperLib::etClosedLine
@ etClosedLine
Definition: clipper.hpp:131
ClipperLib::Clipper::BuildResult2
void BuildResult2(PolyTree &polytree)
Definition: clipper.cpp:3249
ClipperLib::PolyNode::Index
unsigned Index
Definition: clipper.hpp:149
ClipperLib::IntRect::right
cInt right
Definition: clipper.hpp:195
ClipperLib::Clipper::IsHole
bool IsHole(TEdge *e)
ClipperLib::ctIntersection
@ ctIntersection
Definition: clipper.hpp:64
ClipperLib::ClipperOffset::m_StepsPerRad
double m_StepsPerRad
Definition: clipper.hpp:376
ClipperLib::ClipperBase::SwapPositionsInAEL
void SwapPositionsInAEL(TEdge *edge1, TEdge *edge2)
Definition: clipper.cpp:1431
ClipperLib::Clipper
Definition: clipper.hpp:261
ClipperLib::ClipperOffset::m_normals
std::vector< DoublePoint > m_normals
Definition: clipper.hpp:374
ClipperLib::Clipper::IsEvenOddFillType
bool IsEvenOddFillType(const TEdge &edge) const
Definition: clipper.cpp:1761
ClipperLib::Clipper::JoinPoints
bool JoinPoints(Join *j, OutRec *outRec1, OutRec *outRec2)
Definition: clipper.cpp:3487
ClipperLib::Clipper::ProcessHorizontals
void ProcessHorizontals()
Definition: clipper.cpp:2548
ClipperLib::ClipperOffset::m_sinA
double m_sinA
Definition: clipper.hpp:375
ClipperLib::clipperException::~clipperException
virtual ~clipperException()
Definition: clipper.hpp:393
ClipperLib::ClipperOffset::AddPaths
void AddPaths(const Paths &paths, JoinType joinType, EndType endType)
Definition: clipper.cpp:3883
ClipperLib::ReversePaths
void ReversePaths(Paths &p)
Definition: clipper.cpp:4318
ClipperLib::ClipperOffset
Definition: clipper.hpp:358
ClipperLib::Clipper::SetHoleState
void SetHoleState(TEdge *e, OutRec *outrec)
Definition: clipper.cpp:2337
ClipperLib::ClipperBase::m_Scanbeam
ScanbeamList m_Scanbeam
Definition: clipper.hpp:257
ClipperLib::Clipper::AppendPolygon
void AppendPolygon(TEdge *e1, TEdge *e2)
Definition: clipper.cpp:2403
ClipperLib::ClipperBase::m_PolyOuts
PolyOutList m_PolyOuts
Definition: clipper.hpp:253
ClipperLib::PolyNode::m_IsOpen
bool m_IsOpen
Definition: clipper.hpp:150
k
FTensor::Index< 'k', 3 > k
Definition: matrix_function.cpp:20
ClipperLib::Clipper::m_StrictSimple
bool m_StrictSimple
Definition: clipper.hpp:302
ClipperLib::Clipper::ProcessEdgesAtTopOfScanbeam
void ProcessEdgesAtTopOfScanbeam(const cInt topY)
Definition: clipper.cpp:3041
ClipperLib::ClipType
ClipType
Definition: clipper.hpp:64
ClipperLib::etOpenRound
@ etOpenRound
Definition: clipper.hpp:131
ClipperLib::Clipper::ProcessIntersectList
void ProcessIntersectList()
Definition: clipper.cpp:2938
ClipperLib::IntPoint::operator!=
friend bool operator!=(const IntPoint &a, const IntPoint &b)
Definition: clipper.hpp:99
ClipperLib::ClipperBase::m_MinimaList
MinimaList m_MinimaList
Definition: clipper.hpp:247
ClipperLib::Clipper::BuildResult
void BuildResult(Paths &polys)
Definition: clipper.cpp:3228
ClipperLib::clipperException::clipperException
clipperException(const char *description)
Definition: clipper.hpp:392
ClipperLib::Clipper::AddJoin
void AddJoin(OutPt *op1, OutPt *op2, const IntPoint offPt)
Definition: clipper.cpp:1978
ClipperLib::IntPoint
Definition: clipper.hpp:85
ClipperLib::SimplifyPolygon
void SimplifyPolygon(const Path &in_poly, Paths &out_polys, PolyFillType fillType=pftEvenOdd)
Definition: clipper.cpp:4325