Package com.reportmill.graphics
Class RMQuadratic
java.lang.Object
com.reportmill.base.RMObject
com.reportmill.graphics.RMLine
com.reportmill.graphics.RMQuadratic
- All Implemented Interfaces:
RMArchiver.Archiving
,Cloneable
- Direct Known Subclasses:
RMBezier
This class models a simple quadratic curve, providing methods for extracting points, distance calculation, bisection,
hit detection and such.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCreates a new quadratic curve.RMQuadratic
(RMPoint startPoint, RMPoint controlPoint, RMPoint endPoint) Creates a new quadratic curve for this gvein start point, control point and end point. -
Method Summary
Modifier and TypeMethodDescriptiondouble
getDistanceQuadratic
(RMPoint aPoint) Returns the minimum distance from the given point to the curve.float
getMaxX()
Returns the max x point of this bezier.float
getMaxY()
Returns the max y point of this bezier.float
getMinX()
Returns the min x point of this bezier.float
getMinY()
Returns the min y point of this bezier.getPoint
(double t) Returns the point on this curve at the parametric location t (defined from 0-1).void
setCurve
(float x1, float y1, float x2, float y2, float x3, float y3) Sets the curve values.void
Sets the curve values.void
subdivide
(RMQuadratic left, RMQuadratic right) Subdivides this curve into the given left and right curves.Methods inherited from class com.reportmill.graphics.RMLine
getDistanceLine, getDistanceToLineSquared, getHead, getHitInfo, getHitInfo, getHitInfo, getTail, setEnd, setStart, toString
Methods inherited from class com.reportmill.base.RMObject
clone, copy, didChange, didUndo, getAnimAttribute, getClassNameShort, initWithArchiver, undoClone, undoCopy, undoEquals
-
Field Details
-
_cp1
-
-
Constructor Details
-
RMQuadratic
public RMQuadratic()Creates a new quadratic curve. -
RMQuadratic
Creates a new quadratic curve for this gvein start point, control point and end point.
-
-
Method Details
-
setCurve
public void setCurve(float x1, float y1, float x2, float y2, float x3, float y3) Sets the curve values. -
setCurve
Sets the curve values. -
getPoint
Returns the point on this curve at the parametric location t (defined from 0-1). -
getDistanceQuadratic
Returns the minimum distance from the given point to the curve. -
subdivide
Subdivides this curve into the given left and right curves. -
getMinX
public float getMinX()Returns the min x point of this bezier. -
getMinY
public float getMinY()Returns the min y point of this bezier. -
getMaxX
public float getMaxX()Returns the max x point of this bezier. -
getMaxY
public float getMaxY()Returns the max y point of this bezier.
-