ClipperLib Namespace Reference

Classes

class  Clipper
 
class  ClipperBase
 
class  clipperException
 
class  ClipperOffset
 
struct  DoublePoint
 
class  Int128
 
struct  IntersectNode
 
struct  IntPoint
 
struct  IntRect
 
struct  Join
 
struct  LocalMinimum
 
struct  LocMinSorter
 
struct  OutPt
 
struct  OutRec
 
class  PolyNode
 
class  PolyTree
 
struct  TEdge
 

Typedefs

typedef signed long long cInt
 
typedef std::vector< TEdge * > EdgeList
 
typedef std::vector< IntersectNode * > IntersectList
 
typedef std::vector< Join * > JoinList
 
typedef signed long long long64
 
typedef std::vector< IntPoint > Path
 
typedef std::vector< Path > Paths
 
typedef std::vector< PolyNode * > PolyNodes
 
typedef std::vector< OutRec * > PolyOutList
 
typedef unsigned long long ulong64
 

Enumerations

enum  ClipType { ctIntersection , ctUnion , ctDifference , ctXor }
 
enum  Direction { dRightToLeft , dLeftToRight }
 
enum  EdgeSide { esLeft = 1 , esRight = 2 }
 
enum  EndType {
  etClosedPolygon , etClosedLine , etOpenButt , etOpenSquare ,
  etOpenRound
}
 
enum  InitOptions { ioReverseSolution = 1 , ioStrictlySimple = 2 , ioPreserveCollinear = 4 }
 
enum  JoinType { jtSquare , jtRound , jtMiter }
 
enum  NodeType { ntAny , ntOpen , ntClosed }
 
enum  PolyFillType { pftEvenOdd , pftNonZero , pftPositive , pftNegative }
 
enum  PolyType { ptSubject , ptClip }
 

Functions

cInt Abs (cInt val)
 
void AddPolyNodeToPaths (const PolyNode &polynode, NodeType nodetype, Paths &paths)
 
double Area (const OutRec &outRec)
 
double Area (const Path &poly)
 
void CleanPolygon (const Path &in_poly, Path &out_poly, double distance)
 
void CleanPolygon (Path &poly, double distance)
 
void CleanPolygons (const Paths &in_polys, Paths &out_polys, double distance)
 
void CleanPolygons (Paths &polys, double distance)
 
void ClosedPathsFromPolyTree (const PolyTree &polytree, Paths &paths)
 
void DisposeOutPts (OutPt *&pp)
 
double DistanceFromLineSqrd (const IntPoint &pt, const IntPoint &ln1, const IntPoint &ln2)
 
double DistanceSqrd (const IntPoint &pt1, const IntPoint &pt2)
 
OutPt * DupOutPt (OutPt *outPt, bool InsertAfter)
 
bool E2InsertsBeforeE1 (TEdge &e1, TEdge &e2)
 
bool EdgesAdjacent (const IntersectNode &inode)
 
OutPt * ExcludeOp (OutPt *op)
 
TEdge * FindNextLocMin (TEdge *E)
 
bool FirstIsBottomPt (const OutPt *btmPt1, const OutPt *btmPt2)
 
OutPt * GetBottomPt (OutPt *pp)
 
double GetDx (const IntPoint pt1, const IntPoint pt2)
 
void GetHorzDirection (TEdge &HorzEdge, Direction &Dir, cInt &Left, cInt &Right)
 
OutRec * GetLowermostRec (OutRec *outRec1, OutRec *outRec2)
 
TEdge * GetMaximaPair (TEdge *e)
 
TEdge * GetNextInAEL (TEdge *e, Direction dir)
 
bool GetOverlap (const cInt a1, const cInt a2, const cInt b1, const cInt b2, cInt &Left, cInt &Right)
 
bool GetOverlapSegment (IntPoint pt1a, IntPoint pt1b, IntPoint pt2a, IntPoint pt2b, IntPoint &pt1, IntPoint &pt2)
 
DoublePoint GetUnitNormal (const IntPoint &pt1, const IntPoint &pt2)
 
bool HorzSegmentsOverlap (cInt seg1a, cInt seg1b, cInt seg2a, cInt seg2b)
 
void InitEdge (TEdge *e, TEdge *eNext, TEdge *ePrev, const IntPoint &Pt)
 
void InitEdge2 (TEdge &e, PolyType Pt)
 
Int128 Int128Mul (long64 lhs, long64 rhs)
 
bool IntersectListSort (IntersectNode *node1, IntersectNode *node2)
 
void IntersectPoint (TEdge &Edge1, TEdge &Edge2, IntPoint &ip)
 
bool IsHorizontal (TEdge &e)
 
bool IsIntermediate (TEdge *e, const cInt Y)
 
bool IsMaxima (TEdge *e, const cInt Y)
 
bool IsMinima (TEdge *e)
 
bool JoinHorz (OutPt *op1, OutPt *op1b, OutPt *op2, OutPt *op2b, const IntPoint Pt, bool DiscardLeft)
 
void Minkowski (const Path &poly, const Path &path, Paths &solution, bool isSum, bool isClosed)
 
void MinkowskiDiff (const Path &poly1, const Path &poly2, Paths &solution)
 
void MinkowskiSum (const Path &pattern, const Path &path, Paths &solution, bool pathIsClosed)
 
void MinkowskiSum (const Path &pattern, const Paths &paths, Paths &solution, bool pathIsClosed)
 
void OpenPathsFromPolyTree (PolyTree &polytree, Paths &paths)
 
Path & operator<< (Path &poly, const IntPoint &p)
 
Paths & operator<< (Paths &polys, const Path &p)
 
std::ostream & operator<< (std::ostream &s, const IntPoint &p)
 
std::ostream & operator<< (std::ostream &s, const Path &p)
 
std::ostream & operator<< (std::ostream &s, const Paths &p)
 
bool Orientation (const Path &poly)
 
bool Param1RightOfParam2 (OutRec *outRec1, OutRec *outRec2)
 
static OutRec * ParseFirstLeft (OutRec *FirstLeft)
 
int PointCount (OutPt *Pts)
 
int PointInPolygon (const IntPoint &pt, const Path &path)
 
int PointInPolygon (const IntPoint &pt, OutPt *op)
 
bool PointIsVertex (const IntPoint &Pt, OutPt *pp)
 
bool PointsAreClose (IntPoint pt1, IntPoint pt2, double distSqrd)
 
bool Poly2ContainsPoly1 (OutPt *OutPt1, OutPt *OutPt2)
 
void PolyTreeToPaths (const PolyTree &polytree, Paths &paths)
 
bool Pt2IsBetweenPt1AndPt3 (const IntPoint pt1, const IntPoint pt2, const IntPoint pt3)
 
void RangeTest (const IntPoint &Pt, bool &useFullRange)
 
TEdge * RemoveEdge (TEdge *e)
 
void ReverseHorizontal (TEdge &e)
 
void ReversePath (Path &p)
 
void ReversePaths (Paths &p)
 
void ReversePolyPtLinks (OutPt *pp)
 
cInt Round (double val)
 
void SetDx (TEdge &e)
 
void SimplifyPolygon (const Path &in_poly, Paths &out_polys, PolyFillType fillType)
 
void SimplifyPolygons (const Paths &in_polys, Paths &out_polys, PolyFillType fillType)
 
void SimplifyPolygons (Paths &polys, PolyFillType fillType)
 
bool SlopesEqual (const IntPoint pt1, const IntPoint pt2, const IntPoint pt3, bool UseFullInt64Range)
 
bool SlopesEqual (const IntPoint pt1, const IntPoint pt2, const IntPoint pt3, const IntPoint pt4, bool UseFullInt64Range)
 
bool SlopesEqual (const TEdge &e1, const TEdge &e2, bool UseFullInt64Range)
 
bool SlopesNearCollinear (const IntPoint &pt1, const IntPoint &pt2, const IntPoint &pt3, double distSqrd)
 
void Swap (cInt &val1, cInt &val2)
 
void SwapIntersectNodes (IntersectNode &int1, IntersectNode &int2)
 
void SwapPoints (IntPoint &pt1, IntPoint &pt2)
 
void SwapPolyIndexes (TEdge &Edge1, TEdge &Edge2)
 
void SwapSides (TEdge &Edge1, TEdge &Edge2)
 
cInt TopX (TEdge &edge, const cInt currentY)
 
void TranslatePath (const Path &input, Path &output, IntPoint delta)
 
void UpdateOutPtIdxs (OutRec &outrec)
 

Variables

static double const def_arc_tolerance = 0.25
 
static cInt const hiRange = 0x3FFFFFFFFFFFFFFFLL
 
static cInt const loRange = 0x3FFFFFFF
 
static double const pi = 3.141592653589793238
 
static int const Skip = -2
 
static double const two_pi = pi *2
 
static int const Unassigned = -1
 

Typedef Documentation

◆ cInt

typedef signed long long ClipperLib::cInt

◆ EdgeList

typedef std::vector< TEdge* > ClipperLib::EdgeList

◆ IntersectList

typedef std::vector< IntersectNode* > ClipperLib::IntersectList

◆ JoinList

typedef std::vector< Join* > ClipperLib::JoinList

◆ long64

typedef signed long long ClipperLib::long64

◆ Path

typedef std::vector< IntPoint > ClipperLib::Path

◆ Paths

typedef std::vector< Path > ClipperLib::Paths

◆ PolyNodes

typedef std::vector< PolyNode* > ClipperLib::PolyNodes

◆ PolyOutList

typedef std::vector< OutRec* > ClipperLib::PolyOutList

◆ ulong64

typedef unsigned long long ClipperLib::ulong64

Enumeration Type Documentation

◆ ClipType

Enumerator
ctIntersection 
ctUnion 
ctDifference 
ctXor 

◆ Direction

Enumerator
dRightToLeft 
dLeftToRight 

◆ EdgeSide

Enumerator
esLeft 
esRight 

◆ EndType

Enumerator
etClosedPolygon 
etClosedLine 
etOpenButt 
etOpenSquare 
etOpenRound 

◆ InitOptions

Enumerator
ioReverseSolution 
ioStrictlySimple 
ioPreserveCollinear 

◆ JoinType

Enumerator
jtSquare 
jtRound 
jtMiter 

◆ NodeType

Enumerator
ntAny 
ntOpen 
ntClosed 

◆ PolyFillType

Enumerator
pftEvenOdd 
pftNonZero 
pftPositive 
pftNegative 

◆ PolyType

Enumerator
ptSubject 
ptClip 

Function Documentation

◆ Abs()

cInt ClipperLib::Abs ( cInt  val)

◆ AddPolyNodeToPaths()

◆ Area() [1/2]

◆ Area() [2/2]

double ClipperLib::Area ( const Path &  poly)

◆ CleanPolygon() [1/2]

void ClipperLib::CleanPolygon ( const Path &  in_poly,
Path &  out_poly,
double  distance 
)

◆ CleanPolygon() [2/2]

void ClipperLib::CleanPolygon ( Path &  poly,
double  distance 
)

References CleanPolygon().

◆ CleanPolygons() [1/2]

void ClipperLib::CleanPolygons ( const Paths &  in_polys,
Paths &  out_polys,
double  distance 
)

◆ CleanPolygons() [2/2]

void ClipperLib::CleanPolygons ( Paths &  polys,
double  distance 
)

References CleanPolygons().

◆ ClosedPathsFromPolyTree()

void ClipperLib::ClosedPathsFromPolyTree ( const PolyTree &  polytree,
Paths &  paths 
)

◆ DisposeOutPts()

void ClipperLib::DisposeOutPts ( OutPt *&  pp)

◆ DistanceFromLineSqrd()

double ClipperLib::DistanceFromLineSqrd ( const IntPoint &  pt,
const IntPoint &  ln1,
const IntPoint &  ln2 
)

◆ DistanceSqrd()

double ClipperLib::DistanceSqrd ( const IntPoint &  pt1,
const IntPoint &  pt2 
)

◆ DupOutPt()

OutPt * ClipperLib::DupOutPt ( OutPt *  outPt,
bool  InsertAfter 
)

◆ E2InsertsBeforeE1()

bool ClipperLib::E2InsertsBeforeE1 ( TEdge &  e1,
TEdge &  e2 
)

◆ EdgesAdjacent()

◆ ExcludeOp()

OutPt * ClipperLib::ExcludeOp ( OutPt *  op)

◆ FindNextLocMin()

◆ FirstIsBottomPt()

bool ClipperLib::FirstIsBottomPt ( const OutPt *  btmPt1,
const OutPt *  btmPt2 
)

◆ GetBottomPt()

◆ GetDx()

double ClipperLib::GetDx ( const IntPoint  pt1,
const IntPoint  pt2 
)

◆ GetHorzDirection()

void ClipperLib::GetHorzDirection ( TEdge &  HorzEdge,
Direction &  Dir,
cInt &  Left,
cInt &  Right 
)

◆ GetLowermostRec()

◆ GetMaximaPair()

TEdge * ClipperLib::GetMaximaPair ( TEdge *  e)

References IsHorizontal(), and Skip.

◆ GetNextInAEL()

TEdge * ClipperLib::GetNextInAEL ( TEdge *  e,
Direction  dir 
)

References dLeftToRight.

◆ GetOverlap()

bool ClipperLib::GetOverlap ( const cInt  a1,
const cInt  a2,
const cInt  b1,
const cInt  b2,
cInt &  Left,
cInt &  Right 
)

◆ GetOverlapSegment()

bool ClipperLib::GetOverlapSegment ( IntPoint  pt1a,
IntPoint  pt1b,
IntPoint  pt2a,
IntPoint  pt2b,
IntPoint &  pt1,
IntPoint &  pt2 
)

◆ GetUnitNormal()

DoublePoint ClipperLib::GetUnitNormal ( const IntPoint &  pt1,
const IntPoint &  pt2 
)

◆ HorzSegmentsOverlap()

bool ClipperLib::HorzSegmentsOverlap ( cInt  seg1a,
cInt  seg1b,
cInt  seg2a,
cInt  seg2b 
)

References Swap().

◆ InitEdge()

void ClipperLib::InitEdge ( TEdge *  e,
TEdge *  eNext,
TEdge *  ePrev,
const IntPoint &  Pt 
)

References Unassigned.

Referenced by ClipperLib::ClipperBase::AddPath().

◆ InitEdge2()

void ClipperLib::InitEdge2 ( TEdge &  e,
PolyType  Pt 
)

References SetDx().

Referenced by ClipperLib::ClipperBase::AddPath().

◆ Int128Mul()

Int128 ClipperLib::Int128Mul ( long64  lhs,
long64  rhs 
)

◆ IntersectListSort()

bool ClipperLib::IntersectListSort ( IntersectNode *  node1,
IntersectNode *  node2 
)

◆ IntersectPoint()

◆ IsHorizontal()

◆ IsIntermediate()

bool ClipperLib::IsIntermediate ( TEdge *  e,
const cInt  Y 
)

◆ IsMaxima()

bool ClipperLib::IsMaxima ( TEdge *  e,
const cInt  Y 
)

◆ IsMinima()

bool ClipperLib::IsMinima ( TEdge *  e)

◆ JoinHorz()

bool ClipperLib::JoinHorz ( OutPt *  op1,
OutPt *  op1b,
OutPt *  op2,
OutPt *  op2b,
const IntPoint  Pt,
bool  DiscardLeft 
)

◆ Minkowski()

void ClipperLib::Minkowski ( const Path &  poly,
const Path &  path,
Paths &  solution,
bool  isSum,
bool  isClosed 
)

References Orientation(), and ReversePath().

Referenced by MinkowskiDiff(), and MinkowskiSum().

◆ MinkowskiDiff()

void ClipperLib::MinkowskiDiff ( const Path &  poly1,
const Path &  poly2,
Paths &  solution 
)

◆ MinkowskiSum() [1/2]

void ClipperLib::MinkowskiSum ( const Path &  pattern,
const Path &  path,
Paths &  solution,
bool  pathIsClosed 
)

◆ MinkowskiSum() [2/2]

void ClipperLib::MinkowskiSum ( const Path &  pattern,
const Paths &  paths,
Paths &  solution,
bool  pathIsClosed 
)

◆ OpenPathsFromPolyTree()

void ClipperLib::OpenPathsFromPolyTree ( PolyTree &  polytree,
Paths &  paths 
)

◆ operator<<() [1/5]

Path & ClipperLib::operator<< ( Path &  poly,
const IntPoint &  p 
)

◆ operator<<() [2/5]

Paths & ClipperLib::operator<< ( Paths &  polys,
const Path &  p 
)

◆ operator<<() [3/5]

std::ostream & ClipperLib::operator<< ( std::ostream &  s,
const IntPoint &  p 
)

◆ operator<<() [4/5]

std::ostream & ClipperLib::operator<< ( std::ostream &  s,
const Path &  p 
)

◆ operator<<() [5/5]

std::ostream & ClipperLib::operator<< ( std::ostream &  s,
const Paths &  p 
)

◆ Orientation()

bool ClipperLib::Orientation ( const Path &  poly)

References Area().

Referenced by Minkowski().

◆ Param1RightOfParam2()

bool ClipperLib::Param1RightOfParam2 ( OutRec *  outRec1,
OutRec *  outRec2 
)

◆ ParseFirstLeft()

static OutRec * ClipperLib::ParseFirstLeft ( OutRec *  FirstLeft)
static

◆ PointCount()

int ClipperLib::PointCount ( OutPt *  Pts)

◆ PointInPolygon() [1/2]

◆ PointInPolygon() [2/2]

int ClipperLib::PointInPolygon ( const IntPoint &  pt,
OutPt *  op 
)

◆ PointIsVertex()

bool ClipperLib::PointIsVertex ( const IntPoint &  Pt,
OutPt *  pp 
)

◆ PointsAreClose()

bool ClipperLib::PointsAreClose ( IntPoint  pt1,
IntPoint  pt2,
double  distSqrd 
)

◆ Poly2ContainsPoly1()

bool ClipperLib::Poly2ContainsPoly1 ( OutPt *  OutPt1,
OutPt *  OutPt2 
)

◆ PolyTreeToPaths()

void ClipperLib::PolyTreeToPaths ( const PolyTree &  polytree,
Paths &  paths 
)

◆ Pt2IsBetweenPt1AndPt3()

bool ClipperLib::Pt2IsBetweenPt1AndPt3 ( const IntPoint  pt1,
const IntPoint  pt2,
const IntPoint  pt3 
)

◆ RangeTest()

void ClipperLib::RangeTest ( const IntPoint &  Pt,
bool &  useFullRange 
)

◆ RemoveEdge()

TEdge * ClipperLib::RemoveEdge ( TEdge *  e)

◆ ReverseHorizontal()

void ClipperLib::ReverseHorizontal ( TEdge &  e)

◆ ReversePath()

void ClipperLib::ReversePath ( Path &  p)

◆ ReversePaths()

void ClipperLib::ReversePaths ( Paths &  p)

◆ ReversePolyPtLinks()

void ClipperLib::ReversePolyPtLinks ( OutPt *  pp)

◆ Round()

cInt ClipperLib::Round ( double  val)

Referenced by IntersectPoint(), and TopX().

◆ SetDx()

void ClipperLib::SetDx ( TEdge &  e)

Referenced by InitEdge2().

◆ SimplifyPolygon()

void ClipperLib::SimplifyPolygon ( const Path &  in_poly,
Paths &  out_polys,
PolyFillType  fillType 
)

◆ SimplifyPolygons() [1/2]

void ClipperLib::SimplifyPolygons ( const Paths &  in_polys,
Paths &  out_polys,
PolyFillType  fillType 
)

◆ SimplifyPolygons() [2/2]

void ClipperLib::SimplifyPolygons ( Paths &  polys,
PolyFillType  fillType 
)

References SimplifyPolygons().

◆ SlopesEqual() [1/3]

bool ClipperLib::SlopesEqual ( const IntPoint  pt1,
const IntPoint  pt2,
const IntPoint  pt3,
bool  UseFullInt64Range 
)

◆ SlopesEqual() [2/3]

bool ClipperLib::SlopesEqual ( const IntPoint  pt1,
const IntPoint  pt2,
const IntPoint  pt3,
const IntPoint  pt4,
bool  UseFullInt64Range 
)

◆ SlopesEqual() [3/3]

bool ClipperLib::SlopesEqual ( const TEdge &  e1,
const TEdge &  e2,
bool  UseFullInt64Range 
)

◆ SlopesNearCollinear()

bool ClipperLib::SlopesNearCollinear ( const IntPoint &  pt1,
const IntPoint &  pt2,
const IntPoint &  pt3,
double  distSqrd 
)

◆ Swap()

void ClipperLib::Swap ( cInt &  val1,
cInt &  val2 
)

◆ SwapIntersectNodes()

void ClipperLib::SwapIntersectNodes ( IntersectNode &  int1,
IntersectNode &  int2 
)

◆ SwapPoints()

void ClipperLib::SwapPoints ( IntPoint &  pt1,
IntPoint &  pt2 
)

Referenced by GetOverlapSegment().

◆ SwapPolyIndexes()

void ClipperLib::SwapPolyIndexes ( TEdge &  Edge1,
TEdge &  Edge2 
)

◆ SwapSides()

void ClipperLib::SwapSides ( TEdge &  Edge1,
TEdge &  Edge2 
)

◆ TopX()

◆ TranslatePath()

void ClipperLib::TranslatePath ( const Path &  input,
Path &  output,
IntPoint  delta 
)

◆ UpdateOutPtIdxs()

void ClipperLib::UpdateOutPtIdxs ( OutRec &  outrec)

Variable Documentation

◆ def_arc_tolerance

double const ClipperLib::def_arc_tolerance = 0.25
static

◆ hiRange

cInt const ClipperLib::hiRange = 0x3FFFFFFFFFFFFFFFLL
static

Referenced by RangeTest().

◆ loRange

cInt const ClipperLib::loRange = 0x3FFFFFFF
static

Referenced by RangeTest().

◆ pi

double const ClipperLib::pi = 3.141592653589793238
static

◆ Skip

int const ClipperLib::Skip = -2
static

◆ two_pi

double const ClipperLib::two_pi = pi *2
static

◆ Unassigned

int const ClipperLib::Unassigned = -1
static