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< IntPointPath
 
typedef std::vector< PathPaths
 
typedef std::vector< PolyNode * > PolyNodes
 
typedef std::vector< OutRec * > PolyOutList
 
typedef unsigned long long ulong64
 

Enumerations

Functions

cInt Abs (cInt val)
 
void AddPolyNodeToPaths (const PolyNode &polynode, NodeType nodetype, Paths &paths)
 
double Area (const Path &poly)
 
double Area (const OutRec &outRec)
 
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)
 
OutPtDupOutPt (OutPt *outPt, bool InsertAfter)
 
bool E2InsertsBeforeE1 (TEdge &e1, TEdge &e2)
 
bool EdgesAdjacent (const IntersectNode &inode)
 
OutPtExcludeOp (OutPt *op)
 
TEdgeFindNextLocMin (TEdge *E)
 
bool FirstIsBottomPt (const OutPt *btmPt1, const OutPt *btmPt2)
 
OutPtGetBottomPt (OutPt *pp)
 
double GetDx (const IntPoint pt1, const IntPoint pt2)
 
void GetHorzDirection (TEdge &HorzEdge, Direction &Dir, cInt &Left, cInt &Right)
 
OutRecGetLowermostRec (OutRec *outRec1, OutRec *outRec2)
 
TEdgeGetMaximaPair (TEdge *e)
 
TEdgeGetNextInAEL (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)
 
Pathoperator<< (Path &poly, const IntPoint &p)
 
Pathsoperator<< (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 OutRecParseFirstLeft (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)
 
TEdgeRemoveEdge (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 TEdge &e1, const TEdge &e2, bool UseFullInt64Range)
 
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 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

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

Enumeration Type Documentation

Enumerator
ctIntersection 
ctUnion 
ctDifference 
ctXor 
Enumerator
dRightToLeft 
dLeftToRight 
Enumerator
esLeft 
esRight 
Enumerator
etClosedPolygon 
etClosedLine 
etOpenButt 
etOpenSquare 
etOpenRound 
Enumerator
ioReverseSolution 
ioStrictlySimple 
ioPreserveCollinear 
Enumerator
jtSquare 
jtRound 
jtMiter 
Enumerator
ntAny 
ntOpen 
ntClosed 
Enumerator
pftEvenOdd 
pftNonZero 
pftPositive 
pftNegative 
Enumerator
ptSubject 
ptClip 

Function Documentation

cInt ClipperLib::Abs ( cInt  val)
inline
void ClipperLib::AddPolyNodeToPaths ( const PolyNode polynode,
NodeType  nodetype,
Paths paths 
)
double ClipperLib::Area ( const Path poly)
void ClipperLib::CleanPolygon ( const Path in_poly,
Path out_poly,
double  distance 
)
void ClipperLib::CleanPolygon ( Path poly,
double  distance 
)

References CleanPolygon().

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

References CleanPolygon().

Referenced by CleanPolygons().

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

References CleanPolygons().

void ClipperLib::ClosedPathsFromPolyTree ( const PolyTree polytree,
Paths paths 
)
void ClipperLib::DisposeOutPts ( OutPt *&  pp)
double ClipperLib::DistanceFromLineSqrd ( const IntPoint pt,
const IntPoint ln1,
const IntPoint ln2 
)
double ClipperLib::DistanceSqrd ( const IntPoint pt1,
const IntPoint pt2 
)
inline
OutPt* ClipperLib::DupOutPt ( OutPt outPt,
bool  InsertAfter 
)
bool ClipperLib::E2InsertsBeforeE1 ( TEdge e1,
TEdge e2 
)
inline
OutPt* ClipperLib::ExcludeOp ( OutPt op)
bool ClipperLib::FirstIsBottomPt ( const OutPt btmPt1,
const OutPt btmPt2 
)
double ClipperLib::GetDx ( const IntPoint  pt1,
const IntPoint  pt2 
)
inline
TEdge* ClipperLib::GetNextInAEL ( TEdge e,
Direction  dir 
)
bool ClipperLib::GetOverlap ( const cInt  a1,
const cInt  a2,
const cInt  b1,
const cInt  b2,
cInt Left,
cInt Right 
)

Referenced by JoinHorz().

bool ClipperLib::GetOverlapSegment ( IntPoint  pt1a,
IntPoint  pt1b,
IntPoint  pt2a,
IntPoint  pt2b,
IntPoint pt1,
IntPoint pt2 
)
DoublePoint ClipperLib::GetUnitNormal ( const IntPoint pt1,
const IntPoint pt2 
)
bool ClipperLib::HorzSegmentsOverlap ( cInt  seg1a,
cInt  seg1b,
cInt  seg2a,
cInt  seg2b 
)
void ClipperLib::InitEdge ( TEdge e,
TEdge eNext,
TEdge ePrev,
const IntPoint Pt 
)
inline
Int128 ClipperLib::Int128Mul ( long64  lhs,
long64  rhs 
)
bool ClipperLib::IntersectListSort ( IntersectNode node1,
IntersectNode node2 
)
bool ClipperLib::IsIntermediate ( TEdge e,
const cInt  Y 
)
inline
bool ClipperLib::IsMaxima ( TEdge e,
const cInt  Y 
)
inline
bool ClipperLib::IsMinima ( TEdge e)
inline
void ClipperLib::Minkowski ( const Path poly,
const Path path,
Paths solution,
bool  isSum,
bool  isClosed 
)

References Orientation(), and ReversePath().

Referenced by MinkowskiDiff(), and MinkowskiSum().

void ClipperLib::MinkowskiDiff ( const Path poly1,
const Path poly2,
Paths solution 
)
void ClipperLib::MinkowskiSum ( const Path pattern,
const Path path,
Paths solution,
bool  pathIsClosed 
)
void ClipperLib::MinkowskiSum ( const Path pattern,
const Paths paths,
Paths solution,
bool  pathIsClosed 
)
void ClipperLib::OpenPathsFromPolyTree ( PolyTree polytree,
Paths paths 
)
Path& ClipperLib::operator<< ( Path poly,
const IntPoint p 
)
inline
Paths& ClipperLib::operator<< ( Paths polys,
const Path p 
)
inline

References operator<<().

std::ostream & ClipperLib::operator<< ( std::ostream &  s,
const IntPoint p 
)
std::ostream & ClipperLib::operator<< ( std::ostream &  s,
const Path p 
)
std::ostream & ClipperLib::operator<< ( std::ostream &  s,
const Paths p 
)
bool ClipperLib::Orientation ( const Path poly)

References Area().

Referenced by ClipperLib::ClipperOffset::AddPaths(), and Minkowski().

int ClipperLib::PointInPolygon ( const IntPoint pt,
const Path path 
)
int ClipperLib::PointInPolygon ( const IntPoint pt,
OutPt op 
)
bool ClipperLib::PointIsVertex ( const IntPoint Pt,
OutPt pp 
)
bool ClipperLib::PointsAreClose ( IntPoint  pt1,
IntPoint  pt2,
double  distSqrd 
)
bool ClipperLib::Poly2ContainsPoly1 ( OutPt OutPt1,
OutPt OutPt2 
)
void ClipperLib::PolyTreeToPaths ( const PolyTree polytree,
Paths paths 
)
bool ClipperLib::Pt2IsBetweenPt1AndPt3 ( const IntPoint  pt1,
const IntPoint  pt2,
const IntPoint  pt3 
)
void ClipperLib::RangeTest ( const IntPoint Pt,
bool &  useFullRange 
)
TEdge* ClipperLib::RemoveEdge ( TEdge e)
void ClipperLib::ReversePath ( Path p)
void ClipperLib::ReversePaths ( Paths p)

References ReversePath().

void ClipperLib::ReversePolyPtLinks ( OutPt pp)
cInt ClipperLib::Round ( double  val)
inline
void ClipperLib::SimplifyPolygon ( const Path in_poly,
Paths out_polys,
PolyFillType  fillType 
)
void ClipperLib::SimplifyPolygons ( const Paths in_polys,
Paths out_polys,
PolyFillType  fillType 
)
void ClipperLib::SimplifyPolygons ( Paths polys,
PolyFillType  fillType 
)

References SimplifyPolygons().

bool ClipperLib::SlopesEqual ( const TEdge e1,
const TEdge e2,
bool  UseFullInt64Range 
)
bool ClipperLib::SlopesEqual ( const IntPoint  pt1,
const IntPoint  pt2,
const IntPoint  pt3,
bool  UseFullInt64Range 
)
bool ClipperLib::SlopesEqual ( const IntPoint  pt1,
const IntPoint  pt2,
const IntPoint  pt3,
const IntPoint  pt4,
bool  UseFullInt64Range 
)
bool ClipperLib::SlopesNearCollinear ( const IntPoint pt1,
const IntPoint pt2,
const IntPoint pt3,
double  distSqrd 
)
void ClipperLib::Swap ( cInt val1,
cInt val2 
)
void ClipperLib::SwapIntersectNodes ( IntersectNode int1,
IntersectNode int2 
)
void ClipperLib::SwapPoints ( IntPoint pt1,
IntPoint pt2 
)

Referenced by GetOverlapSegment().

void ClipperLib::SwapPolyIndexes ( TEdge Edge1,
TEdge Edge2 
)
inline
void ClipperLib::SwapSides ( TEdge Edge1,
TEdge Edge2 
)
inline
void ClipperLib::TranslatePath ( const Path input,
Path output,
IntPoint  delta 
)

Variable Documentation

double const ClipperLib::def_arc_tolerance = 0.25
static
cInt const ClipperLib::hiRange = 0x3FFFFFFFFFFFFFFFLL
static

Referenced by RangeTest().

cInt const ClipperLib::loRange = 0x3FFFFFFF
static

Referenced by RangeTest().

double const ClipperLib::pi = 3.141592653589793238
static
int const ClipperLib::Skip = -2
static
double const ClipperLib::two_pi = pi *2
static