public abstract class SimplePathVisitor extends Object implements PathVisitor
Modifier and Type | Field and Description |
---|---|
static int |
CURVE_STEPS
Just a guess.
|
Constructor and Description |
---|
SimplePathVisitor() |
Modifier and Type | Method and Description |
---|---|
void |
cubicTo(float[] previousVertex,
float[] control)
Specifies a cubic parametric curve to be drawn.
|
int |
getNumCurveSteps()
Gets the number of steps to take in a quadratic or cubic curve spline.
|
void |
quadTo(float[] previousVertex,
float[] control)
Specifies a quadratic parametric curve is to be drawn.
|
void |
setNumCurveSteps(int steps)
Sets the number of steps to take in a quadratic or cubic curve spline.
|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
beginPoly, closeLine, endPoly, lineTo, moveTo, setGLContext, setStroke
public static final int CURVE_STEPS
public void setNumCurveSteps(int steps)
public int getNumCurveSteps()
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
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
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.