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
,java.lang.Cloneable
public class RMBezier extends RMQuadratic
This class models a simple bezier curve, providing methods for extracting points, distance calculation, bisection, hit detection and such.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.awt.geom.Rectangle2D
getBounds2D()
Returns the bounding box of the shape.double
getDistanceBezier(RMPoint aPoint)
Returns the minimum distance from the given point to the curve.RMHitInfo
getHitInfo(RMBezier aBezier)
Returns a hit info for this bezier and given bezier.RMHitInfo
getHitInfo(RMLine aLine)
Returns the hit info for this bezier and a given line.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.RMPoint
getPoint(double t)
Returns a specific point on the curve at the given parametric value (from 0-1).void
setCurve(RMPoint p1, RMPoint p2, RMPoint p3, RMPoint p4)
Sets the values of the curve.void
setEnd(double t)
Reset this curve's end point to the given parametric location (0-1).void
setStart(double t)
Reset this curve's start point to the given parametric location (0-1).void
subdivide(RMBezier left, RMBezier right, double t)
Returns a bezier curve from this curve's start point to the given parametric location (0-1).java.lang.String
toString()
Returns a string representation of this bezier.-
Methods inherited from class com.reportmill.graphics.RMQuadratic
getDistanceQuadratic, setCurve, setCurve, subdivide
-
Methods inherited from class com.reportmill.graphics.RMLine
getDistanceLine, getDistanceToLineSquared, getHead, getHitInfo, getTail
-
Methods inherited from class com.reportmill.base.RMObject
clone, copy, didChange, didUndo, getAnimAttribute, getClassNameShort, initWithArchiver, undoClone, undoCopy, undoEquals
-
-
-
-
Field Detail
-
_cp2
public RMPoint _cp2
-
-
Method Detail
-
setCurve
public void setCurve(RMPoint p1, RMPoint p2, RMPoint p3, RMPoint p4)
Sets the values of the curve.
-
getPoint
public RMPoint getPoint(double t)
Returns a specific point on the curve at the given parametric value (from 0-1).- Overrides:
getPoint
in classRMQuadratic
-
getDistanceBezier
public double getDistanceBezier(RMPoint aPoint)
Returns the minimum distance from the given point to the curve.
-
getMinX
public float getMinX()
Returns the min x point of this bezier.- Overrides:
getMinX
in classRMQuadratic
-
getMinY
public float getMinY()
Returns the min y point of this bezier.- Overrides:
getMinY
in classRMQuadratic
-
getMaxX
public float getMaxX()
Returns the max x point of this bezier.- Overrides:
getMaxX
in classRMQuadratic
-
getMaxY
public float getMaxY()
Returns the max y point of this bezier.- Overrides:
getMaxY
in classRMQuadratic
-
getBounds2D
public java.awt.geom.Rectangle2D getBounds2D()
Returns the bounding box of the shape.
-
getHitInfo
public RMHitInfo getHitInfo(RMLine aLine)
Returns the hit info for this bezier and a given line.- Overrides:
getHitInfo
in classRMLine
-
getHitInfo
public RMHitInfo getHitInfo(RMBezier aBezier)
Returns a hit info for this bezier and given bezier.- Overrides:
getHitInfo
in classRMLine
-
subdivide
public void subdivide(RMBezier left, RMBezier right, double t)
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).
-
-