v0.14.0
Classes | Namespaces | Macros | Enumerations | Functions | Variables
clipper.cpp File Reference
#include "clipper.hpp"
#include <cmath>
#include <vector>
#include <algorithm>
#include <stdexcept>
#include <cstring>
#include <cstdlib>
#include <ostream>
#include <functional>

Go to the source code of this file.

Classes

struct  ClipperLib::TEdge
 
struct  ClipperLib::IntersectNode
 
struct  ClipperLib::LocalMinimum
 
struct  ClipperLib::OutRec
 
struct  ClipperLib::OutPt
 
struct  ClipperLib::Join
 
struct  ClipperLib::LocMinSorter
 
class  ClipperLib::Int128
 

Namespaces

 ClipperLib
 

Macros

#define HORIZONTAL   (-1.0E+40)
 
#define TOLERANCE   (1.0e-20)
 
#define NEAR_ZERO(val)   (((val) > -TOLERANCE) && ((val) < TOLERANCE))
 

Enumerations

enum  ClipperLib::Direction { ClipperLib::dRightToLeft, ClipperLib::dLeftToRight }
 
enum  ClipperLib::NodeType { ClipperLib::ntAny, ClipperLib::ntOpen, ClipperLib::ntClosed }
 

Functions

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

Variables

static const double ClipperLib::pi = 3.141592653589793238
 
static const double ClipperLib::two_pi = pi *2
 
static const double ClipperLib::def_arc_tolerance = 0.25
 
static const int ClipperLib::Unassigned = -1
 
static const int ClipperLib::Skip = -2
 

Macro Definition Documentation

◆ HORIZONTAL

#define HORIZONTAL   (-1.0E+40)

Definition at line 98 of file clipper.cpp.

◆ NEAR_ZERO

#define NEAR_ZERO (   val)    (((val) > -TOLERANCE) && ((val) < TOLERANCE))

Definition at line 100 of file clipper.cpp.

◆ TOLERANCE

#define TOLERANCE   (1.0e-20)

Definition at line 99 of file clipper.cpp.