Package com.jogamp.graph.geom.plane
Class Path2F
- java.lang.Object
-
- com.jogamp.graph.geom.plane.Path2F
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classPath2F.Iteratorstatic classPath2F.SegmentTypeA Path2D segment type
-
Constructor Summary
Constructors Constructor Description Path2F()Path2F(Path2F path)Path2F(WindingRule rule)Path2F(WindingRule rule, int initialCapacity)Path2F(WindingRule rule, int initialTypeCapacity, int initialPointCapacity)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidappend(Path2F.Iterator path, boolean connect)Append the given path geometry to this instancevoidappend(Path2F path, boolean connect)Append the given path geometry to this instanceObjectclone()voidclosePath()Closes the current sub-path segment by drawing a straight line back to the coordinates of the last moveTo.booleancontains(float px, float py)booleancontains(float rx, float ry, float rw, float rh)booleancontains(AABBox r)Path2FcreateTransformedShape(AffineTransform t)voidcubicTo(float x1, float y1, float x2, float y2, float x3, float y3)Add a cubic Bézier curve segment, intersecting the last point and the second given point x3/y3 (P3).AABBoxgetBounds2D()WindinggetWinding()Compute the general winding of the verticesWindingRulegetWindingRule()Return theWindingRulesetbooleanintersects(float rx, float ry, float rw, float rh)booleanintersects(AABBox r)booleanisClosed()Returns true if the last sub-path is closed, otherwise false.Path2F.Iteratoriterator()Path2F.Iteratoriterator(AffineTransform t)voidlineTo(float x, float y)Add a line segment, intersecting the last point and the given point x/y (P1).voidmoveTo(float x, float y)Start a new position for the next line segment at given point x/y (P1).voidprintSegments(PrintStream out)voidquadTo(float x1, float y1, float x2, float y2)Add a quadratic curve segment, intersecting the last point and the second given point x2/y2 (P2).voidreset()voidsetWindingRule(WindingRule rule)Set theWindingRulesetintsize()StringtoString()voidtransform(AffineTransform t)
-
-
-
Constructor Detail
-
Path2F
public Path2F()
-
Path2F
public Path2F(WindingRule rule)
-
Path2F
public Path2F(WindingRule rule, int initialCapacity)
-
Path2F
public Path2F(WindingRule rule, int initialTypeCapacity, int initialPointCapacity)
-
Path2F
public Path2F(Path2F path)
-
-
Method Detail
-
setWindingRule
public void setWindingRule(WindingRule rule)
Set theWindingRuleset
-
getWindingRule
public WindingRule getWindingRule()
Return theWindingRuleset
-
moveTo
public void moveTo(float x, float y)Start a new position for the next line segment at given point x/y (P1).- Parameters:
x- point (P1)y- point (P1)
-
lineTo
public void lineTo(float x, float y)Add a line segment, intersecting the last point and the given point x/y (P1).- Parameters:
x- final point (P1)y- final point (P1)
-
quadTo
public void quadTo(float x1, float y1, float x2, float y2)Add a quadratic curve segment, intersecting the last point and the second given point x2/y2 (P2).- Parameters:
x1- quadratic parametric control point (P1)y1- quadratic parametric control point (P1)x2- final interpolated control point (P2)y2- final interpolated control point (P2)
-
cubicTo
public void cubicTo(float x1, float y1, float x2, float y2, float x3, float y3)Add a cubic Bézier curve segment, intersecting the last point and the second given point x3/y3 (P3).- Parameters:
x1- Bézier control point (P1)y1- Bézier control point (P1)x2- Bézier control point (P2)y2- Bézier control point (P2)x3- final interpolated control point (P3)y3- final interpolated control point (P3)
-
closePath
public void closePath()
Closes the current sub-path segment by drawing a straight line back to the coordinates of the last moveTo. If the path is already closed then this method has no effect.
-
size
public final int size()
-
isClosed
public final boolean isClosed()
Returns true if the last sub-path is closed, otherwise false.
-
getWinding
public Winding getWinding()
Compute the general winding of the vertices- Parameters:
vertices- array of Vertices- Returns:
- CCW or CW
Winding
-
append
public void append(Path2F path, boolean connect)
Append the given path geometry to this instance- Parameters:
path- thePath2Fto append to this instanceconnect- pass true to turn an initial moveTo segment into a lineTo segment to connect the new geometry to the existing path, otherwise pass false.
-
append
public void append(Path2F.Iterator path, boolean connect)
Append the given path geometry to this instance- Parameters:
path- thePath2F.Iteratorto append to this instanceconnect- pass true to turn an initial moveTo segment into a lineTo segment to connect the new geometry to the existing path, otherwise pass false.
-
printSegments
public void printSegments(PrintStream out)
-
reset
public void reset()
-
transform
public void transform(AffineTransform t)
-
createTransformedShape
public Path2F createTransformedShape(AffineTransform t)
-
getBounds2D
public final AABBox getBounds2D()
-
contains
public boolean contains(float px, float py)
-
contains
public boolean contains(float rx, float ry, float rw, float rh)
-
intersects
public boolean intersects(float rx, float ry, float rw, float rh)
-
contains
public boolean contains(AABBox r)
-
intersects
public boolean intersects(AABBox r)
-
iterator
public Path2F.Iterator iterator()
-
iterator
public Path2F.Iterator iterator(AffineTransform t)
-
clone
public Object clone()
-
-