public abstract class BasicStrokeLineVisitor extends SimplePathVisitor
BasicStroke
. The current
implementation supports everything except dashes. This class draws a series
of quads for each line segment, joins corners and endpoints as appropriate.CURVE_STEPS
Constructor and Description |
---|
BasicStrokeLineVisitor() |
Modifier and Type | Method and Description |
---|---|
void |
beginPoly(int windingRule)
Starts the polygon or polyline.
|
void |
closeLine()
Specifies that the preceding subpath should be closed by appending a line
segment back to the point corresponding to the most recent call to
#moveTo(float[]) . |
void |
cubicTo(float[] previousVertex,
float[] control)
Specifies a cubic parametric curve to be drawn.
|
void |
endPoly()
Signifies that the polygon or polyline has ended.
|
void |
lineTo(float[] vertex)
Specifies the end point of a line to be drawn from the most recently
specified point.
|
void |
moveTo(float[] vertex)
Specifies the starting location for a new subpath.
|
void |
quadTo(float[] previousVertex,
float[] control)
Specifies a quadratic parametric curve is to be drawn.
|
void |
setStroke(BasicStroke stroke)
Sets the stroke to be used when drawing a path.
|
getNumCurveSteps, setNumCurveSteps
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
setGLContext
public void setStroke(BasicStroke stroke)
PathVisitor
public void beginPoly(int windingRule)
PathVisitor
windingRule
- The winding rule for the polygon.public void endPoly()
PathVisitor
public void moveTo(float[] vertex)
PathVisitor
vertex
- An array where the first two values are the x,y coordinates of the
start of the subpath.public void lineTo(float[] vertex)
PathVisitor
vertex
- An array where the first two values are the x,y coordinates of the
next point in the subpath.public void closeLine()
PathVisitor
#moveTo(float[])
.public void quadTo(float[] previousVertex, float[] control)
PathVisitor
(t=[0..1])
using the previous point (CP), the first control
point (P1), and the final interpolated control point (P2). The parametric
control equation for this curve is:
P(t) = B(2,0)*CP + B(2,1)*P1 + B(2,2)*P2 0 <= t <= 1 B(n,m) = mth coefficient of nth degree Bernstein polynomial = C(n,m) * t^(m) * (1 - t)^(n-m) C(n,m) = Combinations of n things, taken m at a time = n! / (m! * (n-m)!)
quadTo
in interface PathVisitor
quadTo
in class SimplePathVisitor
previousVertex
- The first control point. The same as the most recent specified
vertex.control
- The control point and the second vertex, in order.public void cubicTo(float[] previousVertex, float[] control)
PathVisitor
(t=[0..1])
using the previous point (CP), the first control
point (P1), the second control point (P2), and the final interpolated
control point (P3). The parametric control equation for this curve is:
P(t) = B(3,0)*CP + B(3,1)*P1 + B(3,2)*P2 + B(3,3)*P3 0 <= t <= 1 B(n,m) = mth coefficient of nth degree Bernstein polynomial = C(n,m) * t^(m) * (1 - t)^(n-m) C(n,m) = Combinations of n things, taken m at a time = n! / (m! * (n-m)!)This form of curve is commonly known as a Bézier curve.
cubicTo
in interface PathVisitor
cubicTo
in class SimplePathVisitor
previousVertex
- The first control point. The same as the most recent specified
vertex.control
- The two control points and the second vertex, in order.Copyright © 2010-2013. All Rights Reserved.