Package snap.geom
Class SegmentPath
java.lang.Object
snap.geom.Shape
snap.geom.SegmentPath
A Shape containing a list of Segment shapes (Line, Quad, Cubic) to facilitate complex shape operations like
constructive area geometry (CAG) operations (add, subtract, intersect paths).
-
Field Summary
Fields inherited from class snap.geom.Shape
_bounds, WIND_EVEN_ODD, WIND_NON_ZERO
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds the given segment.void
Adds the given segment.boolean
contains
(double aX, double aY) Returns whether this SegmentPath contains given point.boolean
containsEndPoint
(double x, double y) Returns whether given SegmentPath contains given point.boolean
containsSegMid
(Segment aSeg) Returns whether this SegmentPath contains given point.getFirstSegInside
(SegmentPath aShape) Returns the first Segment from this SegmentList outside of given SegmentPath.getFirstSegOutside
(SegmentPath aShape) Returns the first Segment from this SegmentList outside of given SegmentPath.getPathIter
(Transform aTrans) Returns a path iterator.getSeg
(int anIndex) Returns the individual segment at given index.int
Returns the number of segments.Returns the segments from list for end point of given seg.getSegs()
Returns the list of segments.boolean
Returns whether segment list contains segment (regardless of direction).boolean
Returns whether this SegmentPath has any intersecting segments.void
Makes the SegmentPath not intersecting by turning intersection areas into separate cycles.removeSeg
(int anIndex) Removes a given segment.boolean
Splits the segments in this SegmentPath wherever it intersects itself.void
splitIntersectingSegmentsAtIntersectionPoints
(SegmentPath aSegmentPath) Splits the segments for this and given SegmentPath for every intersection of the two.Methods inherited from class snap.geom.Shape
addShapes, contains, contains, contains, containsSeg, copyFor, copyFor, copyForBounds, crossesSeg, getArcLength, getBounds, getBoundsImpl, getCrossings, getDistance, getFlattenedShape, getFlattenedShape, getHeight, getNotSelfIntersectingShape, getSvgString, getWidth, getX, getY, intersectShapes, intersectsSeg, intersectsShape, intersectsShape, intersectsXY, isClosed, isFlat, isMultiCycle, isSingleCycle, shapeChanged, subtractShapes, toString
-
Constructor Details
-
SegmentPath
public SegmentPath()Constructor. -
SegmentPath
Constructor for given shape.
-
-
Method Details
-
getSegs
Returns the list of segments. -
getSegCount
public int getSegCount()Returns the number of segments. -
getSeg
Returns the individual segment at given index. -
addSeg
Adds the given segment. -
addSeg
Adds the given segment. -
removeSeg
Removes a given segment. -
contains
public boolean contains(double aX, double aY) Returns whether this SegmentPath contains given point. -
containsSegMid
Returns whether this SegmentPath contains given point. -
containsEndPoint
public boolean containsEndPoint(double x, double y) Returns whether given SegmentPath contains given point. -
hasSeg
Returns whether segment list contains segment (regardless of direction). -
getFirstSegOutside
Returns the first Segment from this SegmentList outside of given SegmentPath. -
getFirstSegInside
Returns the first Segment from this SegmentList outside of given SegmentPath. -
getSegmentsThatStartOrEndAtSegmentEndPoint
Returns the segments from list for end point of given seg. -
isSelfIntersecting
public boolean isSelfIntersecting()Returns whether this SegmentPath has any intersecting segments.- Overrides:
isSelfIntersecting
in classShape
-
makeNotSelfIntersecting
public void makeNotSelfIntersecting()Makes the SegmentPath not intersecting by turning intersection areas into separate cycles. -
splitIntersectingSegmentsAtIntersectionPoints
public boolean splitIntersectingSegmentsAtIntersectionPoints()Splits the segments in this SegmentPath wherever it intersects itself. -
splitIntersectingSegmentsAtIntersectionPoints
Splits the segments for this and given SegmentPath for every intersection of the two. -
getPathIter
Returns a path iterator.- Specified by:
getPathIter
in classShape
-