Package com.reportmill.graphics
Class RMBezier
java.lang.Object
com.reportmill.base.RMObject
com.reportmill.graphics.RMLine
com.reportmill.graphics.RMQuadratic
com.reportmill.graphics.RMBezier
- All Implemented Interfaces:
RMArchiver.Archiving,Cloneable
This class models a simple bezier curve, providing methods for extracting points, distance calculation, bisection,
hit detection and such.
-
Field Summary
FieldsFields inherited from class com.reportmill.graphics.RMQuadratic
_cp1 -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the bounding box of the shape.doublegetDistanceBezier(RMPoint aPoint) Returns the minimum distance from the given point to the curve.getHitInfo(RMBezier aBezier) Returns a hit info for this bezier and given bezier.getHitInfo(RMLine aLine) Returns the hit info for this bezier and a given line.floatgetMaxX()Returns the max x point of this bezier.floatgetMaxY()Returns the max y point of this bezier.floatgetMinX()Returns the min x point of this bezier.floatgetMinY()Returns the min y point of this bezier.getPoint(double t) Returns a specific point on the curve at the given parametric value (from 0-1).voidSets the values of the curve.voidsetEnd(double t) Reset this curve's end point to the given parametric location (0-1).voidsetStart(double t) Reset this curve's start point to the given parametric location (0-1).voidReturns a bezier curve from this curve's start point to the given parametric location (0-1).toString()Returns a string representation of this bezier.Methods inherited from class com.reportmill.graphics.RMQuadratic
getDistanceQuadratic, setCurve, setCurve, subdivideMethods inherited from class com.reportmill.graphics.RMLine
getDistanceLine, getDistanceToLineSquared, getHead, getHitInfo, getTailMethods inherited from class com.reportmill.base.RMObject
clone, copy, didChange, didUndo, getAnimAttribute, getClassNameShort, initWithArchiver, undoClone, undoCopy, undoEquals
-
Field Details
-
_cp2
-
-
Constructor Details
-
RMBezier
public RMBezier()Creates a new bezier. -
RMBezier
Creates a new bezier from the given start point, control points and end point.
-
-
Method Details
-
setCurve
Sets the values of the curve. -
getPoint
Returns a specific point on the curve at the given parametric value (from 0-1).- Overrides:
getPointin classRMQuadratic
-
getDistanceBezier
Returns the minimum distance from the given point to the curve. -
getMinX
public float getMinX()Returns the min x point of this bezier.- Overrides:
getMinXin classRMQuadratic
-
getMinY
public float getMinY()Returns the min y point of this bezier.- Overrides:
getMinYin classRMQuadratic
-
getMaxX
public float getMaxX()Returns the max x point of this bezier.- Overrides:
getMaxXin classRMQuadratic
-
getMaxY
public float getMaxY()Returns the max y point of this bezier.- Overrides:
getMaxYin classRMQuadratic
-
getBounds2D
Returns the bounding box of the shape. -
getHitInfo
Returns the hit info for this bezier and a given line.- Overrides:
getHitInfoin classRMLine
-
getHitInfo
Returns a hit info for this bezier and given bezier.- Overrides:
getHitInfoin classRMLine
-
subdivide
Returns a bezier curve from this curve's start point to the given parametric location (0-1). -
setEnd
public void setEnd(double t) Reset this curve's end point to the given parametric location (0-1). -
setStart
public void setStart(double t) Reset this curve's start point to the given parametric location (0-1). -
toString
Returns a string representation of this bezier.
-