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 classDefaultClipper.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 EdgeactiveEdgesprivate Clipper.PolyFillTypeclipFillTypeprivate Clipper.ClipTypeclipTypeprivate java.util.List<Path.Join>ghostJoinsprivate java.util.List<DefaultClipper.IntersectNode>intersectListprivate java.util.Comparator<DefaultClipper.IntersectNode>intersectNodeComparerprivate java.util.List<Path.Join>joinsprivate static java.util.logging.LoggerLOGGERprivate Path.Maximamaximaprotected java.util.List<Path.OutRec>polyOutsprivate booleanreverseSolutionprivate ClipperBase.Scanbeamscanbeamprivate EdgesortedEdgesprivate booleanstrictlySimpleprivate Clipper.PolyFillTypesubjFillTypeprivate booleanusingPolyTreeClipper.ZFillCallbackzFillFunction-
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 voidaddEdgeToSEL(Edge edge)private voidaddGhostJoin(Path.OutPt Op, Point.LongPoint OffPt)private voidaddJoin(Path.OutPt Op1, Path.OutPt Op2, Point.LongPoint OffPt)private voidaddLocalMaxPoly(Edge e1, Edge e2, Point.LongPoint pt)private Path.OutPtaddLocalMinPoly(Edge e1, Edge e2, Point.LongPoint pt)private Path.OutPtaddOutPt(Edge e, Point.LongPoint pt)private voidappendPolygon(Edge e1, Edge e2)private voidbuildIntersectList(long topY)private voidbuildResult(Paths polyg)private voidbuildResult2(PolyTree polytree)private voidcopyAELToSEL()private Path.OutReccreateOutRec()private voiddeleteFromAEL(Edge e)private voiddeleteFromSEL(Edge e)private booleandoHorzSegmentsOverlap(long seg1a, long seg1b, long seg2a, long seg2b)private voiddoMaxima(Edge e)private voiddoSimplePolygons()private booleanEdgesAdjacent(DefaultClipper.IntersectNode inode)booleanexecute(Clipper.ClipType clipType, Paths solution)booleanexecute(Clipper.ClipType clipType, Paths solution, Clipper.PolyFillType FillType)booleanexecute(Clipper.ClipType clipType, Paths solution, Clipper.PolyFillType subjFillType, Clipper.PolyFillType clipFillType)booleanexecute(Clipper.ClipType clipType, PolyTree polytree)booleanexecute(Clipper.ClipType clipType, PolyTree polytree, Clipper.PolyFillType FillType)booleanexecute(Clipper.ClipType clipType, PolyTree polytree, Clipper.PolyFillType subjFillType, Clipper.PolyFillType clipFillType)private booleanexecuteInternal()private voidfixupFirstLefts1(Path.OutRec OldOutRec, Path.OutRec NewOutRec)private voidfixupFirstLefts2(Path.OutRec OldOutRec, Path.OutRec NewOutRec)private booleanfixupIntersectionOrder()private voidfixupOutPolygon(Path.OutRec outRec)private voidfixupOutPolyline(Path.OutRec outrec)private static voidgetHorzDirection(Edge HorzEdge, Clipper.Direction[] Dir, long[] Left, long[] Right)private Path.OutPtGetLastOutPt(Edge e)private Path.OutRecgetOutRec(int idx)private static booleangetOverlap(long a1, long a2, long b1, long b2, long[] Left, long[] Right)private voidinsertEdgeIntoAEL(Edge edge, Edge startEdge)private voidinsertLocalMinimaIntoAEL(long botY)private voidInsertMaxima(long X)private voidinsertScanbeam(long Y)private voidintersectEdges(Edge e1, Edge e2, Point.LongPoint pt)private voidintersectPoint(Edge edge1, Edge edge2, Point.LongPoint[] ipV)private static booleanisParam1RightOfParam2(Path.OutRec outRec1, Path.OutRec outRec2)private static intisPointInPolygon(Point.LongPoint pt, Path.OutPt op)private voidjoinCommonEdges()private static booleanjoinHorz(Path.OutPt op1, Path.OutPt op1b, Path.OutPt op2, Path.OutPt op2b, Point.LongPoint Pt, boolean DiscardLeft)private booleanjoinPoints(Path.Join j, Path.OutRec outRec1, Path.OutRec outRec2)private static Pathsminkowski(Path pattern, Path path, boolean IsSum, boolean IsClosed)static PathsminkowskiDiff(Path poly1, Path poly2)static PathsminkowskiSum(Path pattern, Path path, boolean pathIsClosed)static PathsminkowskiSum(Path pattern, Paths paths, boolean pathIsClosed)private static booleanpoly2ContainsPoly1(Path.OutPt outPt1, Path.OutPt outPt2)private longpopScanbeam()private voidprocessEdgesAtTopOfScanbeam(long topY)private voidprocessHorizontal(Edge horzEdge)private voidprocessHorizontals()private booleanprocessIntersections(long topY)private voidprocessIntersectList()protected voidreset()private voidsetHoleState(Edge e, Path.OutRec outRec)private voidsetZ(Point.LongPoint pt, Edge e1, Edge e2)static PathssimplifyPolygon(Path poly)static PathssimplifyPolygon(Path poly, Clipper.PolyFillType fillType)static PathssimplifyPolygons(Paths polys)static PathssimplifyPolygons(Paths polys, Clipper.PolyFillType fillType)private voidswapPositionsInAEL(Edge edge1, Edge edge2)private voidswapPositionsInSEL(Edge edge1, Edge edge2)private voidupdateEdgeIntoAEL(Edge[] eV)private voidupdateOutPtIdxs(Path.OutRec outrec)private voidupdateWindingCount(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:
resetin 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)
-
-