Class RMBezier
- java.lang.Object
- 
- com.inductiveautomation.rm.graphics.RMLine
- 
- com.inductiveautomation.rm.graphics.RMQuadratic
- 
- com.inductiveautomation.rm.graphics.RMBezier
 
 
 
- 
- All Implemented Interfaces:
- 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.
- 
- 
Constructor SummaryConstructors Constructor Description RMBezier()Creates a new bezier.RMBezier(double x1, double y1, double x2, double y2, double x3, double y3, double x4, double y4)Creates a new bezier from the given start point, control points and end point.RMBezier(RMPoint startPoint, RMPoint controlPoint1, RMPoint controlPoint2, RMPoint endPoint)Creates a new bezier from the given start point, control points and end point.
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description RMMath.RMFuncgetArcLengthFunction()Returns an RMFunc which calculates the arclength of the curve up to t.static voidgetBounds(double x0, double y0, double x1, double y1, double x2, double y2, double x3, double y3, java.awt.geom.Rectangle2D aRect)Returns the bounds of the bezier.voidgetBounds(java.awt.geom.Rectangle2D aRect)Returns the bounds.doublegetDistance(RMPoint aPoint)Returns the minimum distance from the given point to this segment.doublegetDistanceBezier(RMPoint aPoint)Returns the minimum distance from the given point to the curve.RMLinegetHead(double t)Returns a new line from this line's start point to given parametric location t (defined from 0-1) on this line.RMHitInfogetHitInfo(RMBezier aBezier)Returns a hit info for this bezier and given bezier.RMHitInfogetHitInfo(RMLine aLine)Returns the hit info for this bezier and a given line.doublegetMaxX()Returns the max x point of this bezier.doublegetMaxY()Returns the max y point of this bezier.doublegetMinX()Returns the min x point of this bezier.doublegetMinY()Returns the min y point of this bezier.RMPointgetPoint(double t, RMPoint aPoint)Returns a specific point on the curve at the given parametric value (from 0-1).intgetPointCount()Returns the point count of segment.doublegetPointX(int anIndex)Returns the x of point at given index.doublegetPointY(int anIndex)Returns the y of point at given index.RMLinegetTail(double t)Returns a new line from given parametric location t (defined from 0-1) on this line to this line's end point.voidsetCurve(RMPoint p1, RMPoint p2, RMPoint p3, RMPoint p4)Sets 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).voidsubdivide(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.StringtoString()Returns a string representation of this bezier.- 
Methods inherited from class com.inductiveautomation.rm.graphics.RMQuadraticgetArcLength, getBounds, getDistanceQuadratic, getInverseArcLengthFunction, getParameterForLength, setCurve, setCurve, subdivide
 - 
Methods inherited from class com.inductiveautomation.rm.graphics.RMLineclone, getAngle, getArcLength, getArcLength, getBounds, getDistanceLine, getDistanceLineSquared, getDistanceLineSquared, getHitInfo, getLastX, getLastY, getPoint, getTangent
 
- 
 
- 
- 
- 
Field Detail- 
_cp2public RMPoint _cp2 
 
- 
 - 
Constructor Detail- 
RMBezierpublic RMBezier() Creates a new bezier.
 - 
RMBezierpublic RMBezier(RMPoint startPoint, RMPoint controlPoint1, RMPoint controlPoint2, RMPoint endPoint) Creates a new bezier from the given start point, control points and end point.
 - 
RMBezierpublic RMBezier(double x1, double y1, double x2, double y2, double x3, double y3, double x4, double y4)Creates a new bezier from the given start point, control points and end point.
 
- 
 - 
Method Detail- 
setCurvepublic void setCurve(RMPoint p1, RMPoint p2, RMPoint p3, RMPoint p4) Sets the values of the curve.
 - 
getPointpublic RMPoint getPoint(double t, RMPoint aPoint) Returns a specific point on the curve at the given parametric value (from 0-1).- Overrides:
- getPointin class- RMQuadratic
 
 - 
getPointCountpublic int getPointCount() Returns the point count of segment.- Overrides:
- getPointCountin class- RMQuadratic
 
 - 
getPointXpublic double getPointX(int anIndex) Returns the x of point at given index.- Overrides:
- getPointXin class- RMQuadratic
 
 - 
getPointYpublic double getPointY(int anIndex) Returns the y of point at given index.- Overrides:
- getPointYin class- RMQuadratic
 
 - 
getDistancepublic double getDistance(RMPoint aPoint) Returns the minimum distance from the given point to this segment.- Overrides:
- getDistancein class- RMQuadratic
 
 - 
getDistanceBezierpublic double getDistanceBezier(RMPoint aPoint) Returns the minimum distance from the given point to the curve.
 - 
getMinXpublic double getMinX() Returns the min x point of this bezier.- Overrides:
- getMinXin class- RMQuadratic
 
 - 
getMinYpublic double getMinY() Returns the min y point of this bezier.- Overrides:
- getMinYin class- RMQuadratic
 
 - 
getMaxXpublic double getMaxX() Returns the max x point of this bezier.- Overrides:
- getMaxXin class- RMQuadratic
 
 - 
getMaxYpublic double getMaxY() Returns the max y point of this bezier.- Overrides:
- getMaxYin class- RMQuadratic
 
 - 
getBoundspublic void getBounds(java.awt.geom.Rectangle2D aRect) Returns the bounds.- Overrides:
- getBoundsin class- RMQuadratic
 
 - 
getBoundspublic static void getBounds(double x0, double y0, double x1, double y1, double x2, double y2, double x3, double y3, java.awt.geom.Rectangle2D aRect)Returns the bounds of the bezier.
 - 
getHitInfopublic RMHitInfo getHitInfo(RMLine aLine) Returns the hit info for this bezier and a given line.- Overrides:
- getHitInfoin class- RMLine
 
 - 
getHitInfopublic RMHitInfo getHitInfo(RMBezier aBezier) Returns a hit info for this bezier and given bezier.- Overrides:
- getHitInfoin class- RMLine
 
 - 
getHeadpublic RMLine getHead(double t) Returns a new line from this line's start point to given parametric location t (defined from 0-1) on this line.
 - 
getTailpublic RMLine getTail(double t) Returns a new line from given parametric location t (defined from 0-1) on this line to this line's end point.
 - 
subdividepublic 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).
 - 
setEndpublic void setEnd(double t) Reset this curve's end point to the given parametric location (0-1).
 - 
setStartpublic void setStart(double t) Reset this curve's start point to the given parametric location (0-1).
 - 
getArcLengthFunctionpublic RMMath.RMFunc getArcLengthFunction() Returns an RMFunc which calculates the arclength of the curve up to t.- Overrides:
- getArcLengthFunctionin class- RMQuadratic
 
 
- 
 
-