Class DefaultClipper
- java.lang.Object
-
- com.itextpdf.text.pdf.parser.clipper.ClipperBase
-
- com.itextpdf.text.pdf.parser.clipper.DefaultClipper
-
- All Implemented Interfaces:
Clipper
public class DefaultClipper extends ClipperBase
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private class
DefaultClipper.IntersectNode
-
Nested classes/interfaces inherited from class com.itextpdf.text.pdf.parser.clipper.ClipperBase
ClipperBase.LocalMinima, ClipperBase.Scanbeam
-
Nested classes/interfaces inherited from interface com.itextpdf.text.pdf.parser.clipper.Clipper
Clipper.ClipType, Clipper.Direction, Clipper.EndType, Clipper.JoinType, Clipper.PolyFillType, Clipper.PolyType, Clipper.ZFillCallback
-
-
Field Summary
Fields Modifier and Type Field Description private Edge
activeEdges
private Clipper.PolyFillType
clipFillType
private Clipper.ClipType
clipType
private java.util.List<Path.Join>
ghostJoins
private java.util.List<DefaultClipper.IntersectNode>
intersectList
private java.util.Comparator<DefaultClipper.IntersectNode>
intersectNodeComparer
private java.util.List<Path.Join>
joins
private static java.util.logging.Logger
LOGGER
private Path.Maxima
maxima
protected java.util.List<Path.OutRec>
polyOuts
private boolean
reverseSolution
private ClipperBase.Scanbeam
scanbeam
private Edge
sortedEdges
private boolean
strictlySimple
private Clipper.PolyFillType
subjFillType
private boolean
usingPolyTree
Clipper.ZFillCallback
zFillFunction
-
Fields inherited from class com.itextpdf.text.pdf.parser.clipper.ClipperBase
currentLM, hasOpenPaths, minimaList, preserveCollinear, useFullRange
-
Fields inherited from interface com.itextpdf.text.pdf.parser.clipper.Clipper
PRESERVE_COLINEAR, REVERSE_SOLUTION, STRICTLY_SIMPLE
-
-
Constructor Summary
Constructors Constructor Description DefaultClipper()
DefaultClipper(int InitOptions)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private void
addEdgeToSEL(Edge edge)
private void
addGhostJoin(Path.OutPt Op, Point.LongPoint OffPt)
private void
addJoin(Path.OutPt Op1, Path.OutPt Op2, Point.LongPoint OffPt)
private void
addLocalMaxPoly(Edge e1, Edge e2, Point.LongPoint pt)
private Path.OutPt
addLocalMinPoly(Edge e1, Edge e2, Point.LongPoint pt)
private Path.OutPt
addOutPt(Edge e, Point.LongPoint pt)
private void
appendPolygon(Edge e1, Edge e2)
private void
buildIntersectList(long topY)
private void
buildResult(Paths polyg)
private void
buildResult2(PolyTree polytree)
private void
copyAELToSEL()
private Path.OutRec
createOutRec()
private void
deleteFromAEL(Edge e)
private void
deleteFromSEL(Edge e)
private boolean
doHorzSegmentsOverlap(long seg1a, long seg1b, long seg2a, long seg2b)
private void
doMaxima(Edge e)
private void
doSimplePolygons()
private boolean
EdgesAdjacent(DefaultClipper.IntersectNode inode)
boolean
execute(Clipper.ClipType clipType, Paths solution)
boolean
execute(Clipper.ClipType clipType, Paths solution, Clipper.PolyFillType FillType)
boolean
execute(Clipper.ClipType clipType, Paths solution, Clipper.PolyFillType subjFillType, Clipper.PolyFillType clipFillType)
boolean
execute(Clipper.ClipType clipType, PolyTree polytree)
boolean
execute(Clipper.ClipType clipType, PolyTree polytree, Clipper.PolyFillType FillType)
boolean
execute(Clipper.ClipType clipType, PolyTree polytree, Clipper.PolyFillType subjFillType, Clipper.PolyFillType clipFillType)
private boolean
executeInternal()
private void
fixupFirstLefts1(Path.OutRec OldOutRec, Path.OutRec NewOutRec)
private void
fixupFirstLefts2(Path.OutRec OldOutRec, Path.OutRec NewOutRec)
private boolean
fixupIntersectionOrder()
private void
fixupOutPolygon(Path.OutRec outRec)
private void
fixupOutPolyline(Path.OutRec outrec)
private static void
getHorzDirection(Edge HorzEdge, Clipper.Direction[] Dir, long[] Left, long[] Right)
private Path.OutPt
GetLastOutPt(Edge e)
private Path.OutRec
getOutRec(int idx)
private static boolean
getOverlap(long a1, long a2, long b1, long b2, long[] Left, long[] Right)
private void
insertEdgeIntoAEL(Edge edge, Edge startEdge)
private void
insertLocalMinimaIntoAEL(long botY)
private void
InsertMaxima(long X)
private void
insertScanbeam(long Y)
private void
intersectEdges(Edge e1, Edge e2, Point.LongPoint pt)
private void
intersectPoint(Edge edge1, Edge edge2, Point.LongPoint[] ipV)
private static boolean
isParam1RightOfParam2(Path.OutRec outRec1, Path.OutRec outRec2)
private static int
isPointInPolygon(Point.LongPoint pt, Path.OutPt op)
private void
joinCommonEdges()
private static boolean
joinHorz(Path.OutPt op1, Path.OutPt op1b, Path.OutPt op2, Path.OutPt op2b, Point.LongPoint Pt, boolean DiscardLeft)
private boolean
joinPoints(Path.Join j, Path.OutRec outRec1, Path.OutRec outRec2)
private static Paths
minkowski(Path pattern, Path path, boolean IsSum, boolean IsClosed)
static Paths
minkowskiDiff(Path poly1, Path poly2)
static Paths
minkowskiSum(Path pattern, Path path, boolean pathIsClosed)
static Paths
minkowskiSum(Path pattern, Paths paths, boolean pathIsClosed)
private static boolean
poly2ContainsPoly1(Path.OutPt outPt1, Path.OutPt outPt2)
private long
popScanbeam()
private void
processEdgesAtTopOfScanbeam(long topY)
private void
processHorizontal(Edge horzEdge)
private void
processHorizontals()
private boolean
processIntersections(long topY)
private void
processIntersectList()
protected void
reset()
private void
setHoleState(Edge e, Path.OutRec outRec)
private void
setZ(Point.LongPoint pt, Edge e1, Edge e2)
static Paths
simplifyPolygon(Path poly)
static Paths
simplifyPolygon(Path poly, Clipper.PolyFillType fillType)
static Paths
simplifyPolygons(Paths polys)
static Paths
simplifyPolygons(Paths polys, Clipper.PolyFillType fillType)
private void
swapPositionsInAEL(Edge edge1, Edge edge2)
private void
swapPositionsInSEL(Edge edge1, Edge edge2)
private void
updateEdgeIntoAEL(Edge[] eV)
private void
updateOutPtIdxs(Path.OutRec outrec)
private void
updateWindingCount(Edge edge)
-
Methods inherited from class com.itextpdf.text.pdf.parser.clipper.ClipperBase
addPath, addPaths, clear, isPreserveCollinear, parseFirstLeft, popLocalMinima
-
-
-
-
Field Detail
-
polyOuts
protected final java.util.List<Path.OutRec> polyOuts
-
clipType
private Clipper.ClipType clipType
-
scanbeam
private ClipperBase.Scanbeam scanbeam
-
maxima
private Path.Maxima maxima
-
activeEdges
private Edge activeEdges
-
sortedEdges
private Edge sortedEdges
-
intersectList
private final java.util.List<DefaultClipper.IntersectNode> intersectList
-
intersectNodeComparer
private final java.util.Comparator<DefaultClipper.IntersectNode> intersectNodeComparer
-
clipFillType
private Clipper.PolyFillType clipFillType
-
subjFillType
private Clipper.PolyFillType subjFillType
-
joins
private final java.util.List<Path.Join> joins
-
ghostJoins
private final java.util.List<Path.Join> ghostJoins
-
usingPolyTree
private boolean usingPolyTree
-
zFillFunction
public Clipper.ZFillCallback zFillFunction
-
reverseSolution
private final boolean reverseSolution
-
strictlySimple
private final boolean strictlySimple
-
LOGGER
private static final java.util.logging.Logger LOGGER
-
-
Method Detail
-
getHorzDirection
private static void getHorzDirection(Edge HorzEdge, Clipper.Direction[] Dir, long[] Left, long[] Right)
-
getOverlap
private static boolean getOverlap(long a1, long a2, long b1, long b2, long[] Left, long[] Right)
-
isParam1RightOfParam2
private static boolean isParam1RightOfParam2(Path.OutRec outRec1, Path.OutRec outRec2)
-
isPointInPolygon
private static int isPointInPolygon(Point.LongPoint pt, Path.OutPt op)
-
joinHorz
private static boolean joinHorz(Path.OutPt op1, Path.OutPt op1b, Path.OutPt op2, Path.OutPt op2b, Point.LongPoint Pt, boolean DiscardLeft)
-
joinPoints
private boolean joinPoints(Path.Join j, Path.OutRec outRec1, Path.OutRec outRec2)
-
poly2ContainsPoly1
private static boolean poly2ContainsPoly1(Path.OutPt outPt1, Path.OutPt outPt2)
-
simplifyPolygon
public static Paths simplifyPolygon(Path poly, Clipper.PolyFillType fillType)
-
simplifyPolygons
public static Paths simplifyPolygons(Paths polys, Clipper.PolyFillType fillType)
-
insertScanbeam
private void insertScanbeam(long Y)
-
InsertMaxima
private void InsertMaxima(long X)
-
addEdgeToSEL
private void addEdgeToSEL(Edge edge)
-
addGhostJoin
private void addGhostJoin(Path.OutPt Op, Point.LongPoint OffPt)
-
addJoin
private void addJoin(Path.OutPt Op1, Path.OutPt Op2, Point.LongPoint OffPt)
-
addLocalMaxPoly
private void addLocalMaxPoly(Edge e1, Edge e2, Point.LongPoint pt)
-
addLocalMinPoly
private Path.OutPt addLocalMinPoly(Edge e1, Edge e2, Point.LongPoint pt)
-
addOutPt
private Path.OutPt addOutPt(Edge e, Point.LongPoint pt)
-
GetLastOutPt
private Path.OutPt GetLastOutPt(Edge e)
-
buildIntersectList
private void buildIntersectList(long topY)
-
buildResult
private void buildResult(Paths polyg)
-
buildResult2
private void buildResult2(PolyTree polytree)
-
copyAELToSEL
private void copyAELToSEL()
-
createOutRec
private Path.OutRec createOutRec()
-
deleteFromAEL
private void deleteFromAEL(Edge e)
-
deleteFromSEL
private void deleteFromSEL(Edge e)
-
doHorzSegmentsOverlap
private boolean doHorzSegmentsOverlap(long seg1a, long seg1b, long seg2a, long seg2b)
-
doMaxima
private void doMaxima(Edge e)
-
doSimplePolygons
private void doSimplePolygons()
-
EdgesAdjacent
private boolean EdgesAdjacent(DefaultClipper.IntersectNode inode)
-
execute
public boolean execute(Clipper.ClipType clipType, Paths solution, Clipper.PolyFillType FillType)
-
execute
public boolean execute(Clipper.ClipType clipType, PolyTree polytree)
-
execute
public boolean execute(Clipper.ClipType clipType, PolyTree polytree, Clipper.PolyFillType FillType)
-
execute
public boolean execute(Clipper.ClipType clipType, Paths solution)
-
execute
public boolean execute(Clipper.ClipType clipType, Paths solution, Clipper.PolyFillType subjFillType, Clipper.PolyFillType clipFillType)
-
execute
public boolean execute(Clipper.ClipType clipType, PolyTree polytree, Clipper.PolyFillType subjFillType, Clipper.PolyFillType clipFillType)
-
executeInternal
private boolean executeInternal()
-
fixupFirstLefts1
private void fixupFirstLefts1(Path.OutRec OldOutRec, Path.OutRec NewOutRec)
-
fixupFirstLefts2
private void fixupFirstLefts2(Path.OutRec OldOutRec, Path.OutRec NewOutRec)
-
fixupIntersectionOrder
private boolean fixupIntersectionOrder()
-
fixupOutPolyline
private void fixupOutPolyline(Path.OutRec outrec)
-
fixupOutPolygon
private void fixupOutPolygon(Path.OutRec outRec)
-
getOutRec
private Path.OutRec getOutRec(int idx)
-
insertLocalMinimaIntoAEL
private void insertLocalMinimaIntoAEL(long botY)
-
intersectEdges
private void intersectEdges(Edge e1, Edge e2, Point.LongPoint pt)
-
intersectPoint
private void intersectPoint(Edge edge1, Edge edge2, Point.LongPoint[] ipV)
-
joinCommonEdges
private void joinCommonEdges()
-
popScanbeam
private long popScanbeam()
-
processEdgesAtTopOfScanbeam
private void processEdgesAtTopOfScanbeam(long topY)
-
processHorizontal
private void processHorizontal(Edge horzEdge)
-
processHorizontals
private void processHorizontals()
-
processIntersections
private boolean processIntersections(long topY)
-
processIntersectList
private void processIntersectList()
-
reset
protected void reset()
- Overrides:
reset
in classClipperBase
-
setHoleState
private void setHoleState(Edge e, Path.OutRec outRec)
-
setZ
private void setZ(Point.LongPoint pt, Edge e1, Edge e2)
-
updateEdgeIntoAEL
private void updateEdgeIntoAEL(Edge[] eV)
-
updateOutPtIdxs
private void updateOutPtIdxs(Path.OutRec outrec)
-
updateWindingCount
private void updateWindingCount(Edge edge)
-
-