java.lang.Object
jpicedt.graphic.model.AbstractElement
jpicedt.graphic.model.PicBezierCubic
- All Implemented Interfaces:
- jpicedt.graphic.toolkit.CustomizerFactory, Element, PicObjectConstants
- public class PicBezierCubic
- extends AbstractElement
- implements jpicedt.graphic.toolkit.CustomizerFactory
A cubic non-rational Bezier curve (= spline), defined by its three
end points and a control point
- Since:
- jPicEdt 1.3.2 to handle cubic splines
- Version:
- >=JDK1.1.x
Fields inherited from interface jpicedt.graphic.model.PicObjectConstants |
CROSSHATCH, CROSSHATCH_FILLED, DASH_OPAQUE, DASH_TRANSPARENT, DASH1, DASH2, DASH3, DASHED, DIMEN, DOT_SEP, DOT_SEP1, DOT_SEP2, DOT_SEP3, DOTTED, DOUBLE_COLOR, DOUBLE_LINE, DOUBLE_SEP, FILL_COLOR, FILL_STYLE, HATCH_ANGLE, HATCH_COLOR, HATCH_SEP, HATCH_WIDTH, HLINES, HLINES_FILLED, INNER, LEFT_ARROW, LINE_COLOR, LINE_STYLE, LINE_WIDTH, MaxAttributeNameIndex, MIDDLE, NONE, OUTER, POLYGON_DOTS, POLYGON_SOLID, POLYGON_STYLE, PS_POINT, RIGHT_ARROW, SHADOW, SHADOW_ANGLE, SHADOW_COLOR, SHADOW_SIZE, SOLID, VLINES, VLINES_FILLED |
Constructor Summary |
PicBezierCubic()
Create a new bezier curve reduced to (0,0) |
PicBezierCubic(PicAttributeSet set)
Create a new bezier curve reduced to (0,0), with the given attribute set |
PicBezierCubic(PicBezierCubic curve)
"cloning" constructor (to be used by clone()) |
PicBezierCubic(PicBezierQuad quad)
Create a new (non-selected) CUBIC bezier curve that has the same shape the given QUAD curve by
using its three control points and the same attribute set |
PicBezierCubic(jpicedt.graphic.PicPoint pt1,
jpicedt.graphic.PicPoint ptCtrl,
jpicedt.graphic.PicPoint pt2,
PicAttributeSet set)
Create a new (non-selected) CUBIC bezier curve that has the same shape the given QUAD curve by
using its three control points. |
PicBezierCubic(jpicedt.graphic.PicPoint pt1,
jpicedt.graphic.PicPoint ptCtrl1,
jpicedt.graphic.PicPoint ptCtrl2,
jpicedt.graphic.PicPoint pt2,
PicAttributeSet set)
Create a new (non-selected) CUBIC bezier curve using the given four points |
Methods inherited from class jpicedt.graphic.model.AbstractElement |
anchorPointsIterator, fireChangedUpdate, getAttribute, getAttributeSet, getBoundingBox, getDrawing, getFirstPointIndex, getLastPointIndex, getParent, getPoint, getPointX, getPointY, getView, removeView, scale, scale, setAttribute, setAttributeSet, setParent, setPoint, setViewFromFactory, toString, translate |
FIRST_PT
public static final int FIRST_PT
- See Also:
- Constant Field Values
P_1
public static final int P_1
- See Also:
- Constant Field Values
P_CTRL1
public static final int P_CTRL1
- See Also:
- Constant Field Values
P_CTRL2
public static final int P_CTRL2
- See Also:
- Constant Field Values
P_2
public static final int P_2
- See Also:
- Constant Field Values
LAST_PT
public static final int LAST_PT
- See Also:
- Constant Field Values
PicBezierCubic
public PicBezierCubic()
- Create a new bezier curve reduced to (0,0)
PicBezierCubic
public PicBezierCubic(PicAttributeSet set)
- Create a new bezier curve reduced to (0,0), with the given attribute set
PicBezierCubic
public PicBezierCubic(jpicedt.graphic.PicPoint pt1,
jpicedt.graphic.PicPoint ptCtrl1,
jpicedt.graphic.PicPoint ptCtrl2,
jpicedt.graphic.PicPoint pt2,
PicAttributeSet set)
- Create a new (non-selected) CUBIC bezier curve using the given four points
- Since:
- jPicEdt 1.3.2
PicBezierCubic
public PicBezierCubic(jpicedt.graphic.PicPoint pt1,
jpicedt.graphic.PicPoint ptCtrl,
jpicedt.graphic.PicPoint pt2,
PicAttributeSet set)
- Create a new (non-selected) CUBIC bezier curve that has the same shape the given QUAD curve by
using its three control points.
How to draw (exactly) a quadratic spline with a cubic spline :
xC(0) = xQ(0)
xC(1) = (xQ(0) + 2 xQ(1))/3
xC(2) = (2xQ(1) + xQ(2))/3
xC(3) = xQ(2)
where xQ(0) = pt1, xQ(1) = ptCtrl and xQ(2) = pt2
- Since:
- PicEdt 1.1 ; Modified jPicEdt 1.3.2 to handle cubic splines
PicBezierCubic
public PicBezierCubic(PicBezierQuad quad)
- Create a new (non-selected) CUBIC bezier curve that has the same shape the given QUAD curve by
using its three control points and the same attribute set
- Since:
- jPicEdt 1.3.2 to handle cubic splines
PicBezierCubic
public PicBezierCubic(PicBezierCubic curve)
- "cloning" constructor (to be used by clone())
- Since:
- PicEdt 1.1 ; Modified jPicEdt 1.3.2 to handle cubic splines
clone
public java.lang.Object clone()
- Overload Object.clone() method
- Specified by:
clone
in interface Element
- Specified by:
clone
in class AbstractElement
- Since:
- PicEdt 1.1
getName
public java.lang.String getName()
- Description copied from class:
AbstractElement
- Returns a non-localised string representing this object's name
This default implementation returns the class name.
- Specified by:
getName
in interface Element
- Overrides:
getName
in class AbstractElement
convertToBezierQuad
public PicBezierQuad[] convertToBezierQuad()
- Convert this Cubic spline to two Quad splines with a LMS optimization
See Numerical Recipes in C : How to approximate a cubic spline with two quad curves ?
First quad :
xQ0' = xC0
xQ1' = (9*xC0 + 21*xC1 + 3*xC2 - xC3)/32
xQ2' = (xC0 + 3*xC1 + 3*xC2 + xC3)/8
Second quad :
xQ0" = xQ2'
xQ1" = (-xC0 + 3*xC1 + 21*xC2 + 9*xC3)/32
xQ2" = xC3
createCustomizer
public jpicedt.graphic.toolkit.AbstractCustomizer createCustomizer()
- Specified by:
createCustomizer
in interface jpicedt.graphic.toolkit.CustomizerFactory