Commit 31332c39 authored by jean-pierre charras's avatar jean-pierre charras
Browse files

polygon: update clipper lib.

parent 1dd0adf7
Loading
Loading
Loading
Loading
+307 −203

File changed.

Preview size limit exceeded, changes collapsed.

+13 −11
Original line number Original line Diff line number Diff line
/*******************************************************************************
/*******************************************************************************
*                                                                              *
*                                                                              *
* Author    :  Angus Johnson                                                   *
* Author    :  Angus Johnson                                                   *
* Version   :  4.8.5                                                           *
* Version   :  4.9.6                                                           *
* Date      :  15 July 2012                                                    *
* Date      :  9 November 2012                                                 *
* Website   :  http://www.angusj.com                                           *
* Website   :  http://www.angusj.com                                           *
* Copyright :  Angus Johnson 2010-2012                                         *
* Copyright :  Angus Johnson 2010-2012                                         *
*                                                                              *
*                                                                              *
@@ -78,13 +78,13 @@ enum JoinType { jtSquare, jtRound, jtMiter };
bool Orientation(const Polygon &poly);
bool Orientation(const Polygon &poly);
double Area(const Polygon &poly);
double Area(const Polygon &poly);
void OffsetPolygons(const Polygons &in_polys, Polygons &out_polys,
void OffsetPolygons(const Polygons &in_polys, Polygons &out_polys,
  double delta, JoinType jointype = jtSquare, double MiterLimit = 2);
  double delta, JoinType jointype = jtSquare, double MiterLimit = 2, bool CheckInputs = true);
void SimplifyPolygon(const Polygon &in_poly, Polygons &out_polys);
void SimplifyPolygon(const Polygon &in_poly, Polygons &out_polys, PolyFillType fillType = pftEvenOdd);
void SimplifyPolygons(const Polygons &in_polys, Polygons &out_polys);
void SimplifyPolygons(const Polygons &in_polys, Polygons &out_polys, PolyFillType fillType = pftEvenOdd);
void SimplifyPolygons(Polygons &polys);
void SimplifyPolygons(Polygons &polys, PolyFillType fillType = pftEvenOdd);


void ReversePoints(Polygon& p);
void ReversePolygon(Polygon& p);
void ReversePoints(Polygons& p);
void ReversePolygons(Polygons& p);


//used internally ...
//used internally ...
enum EdgeSide { esNeither = 0, esLeft = 1, esRight = 2, esBoth = 3 };
enum EdgeSide { esNeither = 0, esLeft = 1, esRight = 2, esBoth = 3 };
@@ -98,6 +98,8 @@ struct TEdge {
  long64 xtop;
  long64 xtop;
  long64 ytop;
  long64 ytop;
  double dx;
  double dx;
  long64 deltaX;
  long64 deltaY;
  long64 tmpX;
  long64 tmpX;
  PolyType polyType;
  PolyType polyType;
  EdgeSide side;
  EdgeSide side;
@@ -257,7 +259,7 @@ private:
  void DoEdge2(TEdge *edge1, TEdge *edge2, const IntPoint &pt);
  void DoEdge2(TEdge *edge1, TEdge *edge2, const IntPoint &pt);
  void DoBothEdges(TEdge *edge1, TEdge *edge2, const IntPoint &pt);
  void DoBothEdges(TEdge *edge1, TEdge *edge2, const IntPoint &pt);
  void IntersectEdges(TEdge *e1, TEdge *e2,
  void IntersectEdges(TEdge *e1, TEdge *e2,
    const IntPoint &pt, IntersectProtects protects);
    const IntPoint &pt, const IntersectProtects protects);
  OutRec* CreateOutRec();
  OutRec* CreateOutRec();
  void AddOutPt(TEdge *e, const IntPoint &pt);
  void AddOutPt(TEdge *e, const IntPoint &pt);
  void DisposeBottomPt(OutRec &outRec);
  void DisposeBottomPt(OutRec &outRec);
@@ -276,12 +278,12 @@ private:
  void FixupOutPolygon(OutRec &outRec);
  void FixupOutPolygon(OutRec &outRec);
  bool IsHole(TEdge *e);
  bool IsHole(TEdge *e);
  void FixHoleLinkage(OutRec *outRec);
  void FixHoleLinkage(OutRec *outRec);
  void CheckHoleLinkages1(OutRec *outRec1, OutRec *outRec2);
  void CheckHoleLinkages2(OutRec *outRec1, OutRec *outRec2);
  void AddJoin(TEdge *e1, TEdge *e2, int e1OutIdx = -1, int e2OutIdx = -1);
  void AddJoin(TEdge *e1, TEdge *e2, int e1OutIdx = -1, int e2OutIdx = -1);
  void ClearJoins();
  void ClearJoins();
  void AddHorzJoin(TEdge *e, int idx);
  void AddHorzJoin(TEdge *e, int idx);
  void ClearHorzJoins();
  void ClearHorzJoins();
  bool JoinPoints(const JoinRec *j, OutPt *&p1, OutPt *&p2);
  void FixupJoinRecs(JoinRec *j, OutPt *pt, unsigned startIdx);
  void JoinCommonEdges(bool fixHoleLinkages);
  void JoinCommonEdges(bool fixHoleLinkages);
};
};