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 class
Path2F.Iterator
static class
Path2F.SegmentType
A 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 void
append(Path2F.Iterator path, boolean connect)
Append the given path geometry to this instancevoid
append(Path2F path, boolean connect)
Append the given path geometry to this instanceObject
clone()
void
closePath()
Closes the current sub-path segment by drawing a straight line back to the coordinates of the last moveTo.boolean
contains(float px, float py)
boolean
contains(float rx, float ry, float rw, float rh)
boolean
contains(AABBox r)
Path2F
createTransformedShape(AffineTransform t)
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).AABBox
getBounds2D()
Winding
getWinding()
Compute the general winding of the verticesWindingRule
getWindingRule()
Return theWindingRule
setboolean
intersects(float rx, float ry, float rw, float rh)
boolean
intersects(AABBox r)
boolean
isClosed()
Returns true if the last sub-path is closed, otherwise false.Path2F.Iterator
iterator()
Path2F.Iterator
iterator(AffineTransform t)
void
lineTo(float x, float y)
Add a line segment, intersecting the last point and the given point x/y (P1).void
moveTo(float x, float y)
Start a new position for the next line segment at given point x/y (P1).void
printSegments(PrintStream out)
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).void
reset()
void
setWindingRule(WindingRule rule)
Set theWindingRule
setint
size()
String
toString()
void
transform(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 theWindingRule
set
-
getWindingRule
public WindingRule getWindingRule()
Return theWindingRule
set
-
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
- thePath2F
to 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.Iterator
to 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()
-
-