Class RMQuadratic
java.lang.Object
com.inductiveautomation.rm.graphics.RMLine
com.inductiveautomation.rm.graphics.RMQuadratic
- All Implemented Interfaces:
- 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 SummaryFields
- 
Constructor SummaryConstructorsConstructorDescriptionCreates a new quadratic curve.RMQuadratic(double x1, double y1, double x2, double y2, double x3, double y3) Creates a new quadratic curve for this gvein start point, control point and end point.RMQuadratic(RMPoint startPoint, RMPoint controlPoint, RMPoint endPoint) Creates a new quadratic curve for this gvein start point, control point and end point.
- 
Method SummaryModifier and TypeMethodDescriptionfloatgetArcLength(float start, float end) Returns the arc length of the segment up to parametric value tReturns an RMFunc which calculates the arclength of the curve up to tstatic voidgetBounds(double x0, double y0, double x1, double y1, double x2, double y2, Rectangle2D aRect) Returns the bounds of the bezier.voidgetBounds(Rectangle2D aRect) Returns the bounds.doublegetDistance(RMPoint aPoint) Returns the minimum distance from the given point to this segment.doublegetDistanceQuadratic(RMPoint aPoint) Returns the minimum distance from the given point to the curve.Returns an RMFunc which calculates t for a percentage length along the curve.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.floatgetParameterForLength(float l) Returns parametric point t that corresponds to a given length along the curve.Returns the point on this curve at the parametric location t (defined from 0-1).intReturns 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.voidsetCurve(double x1, double y1, double x2, double y2, double x3, double y3) Sets the curve values.voidSets the curve values.voidsubdivide(RMQuadratic left, RMQuadratic right) Subdivides this curve into the given left and right curves.Methods inherited from class com.inductiveautomation.rm.graphics.RMLineclone, getAngle, getArcLength, getArcLength, getBounds, getDistanceLine, getDistanceLineSquared, getDistanceLineSquared, getHead, getHitInfo, getHitInfo, getHitInfo, getLastX, getLastY, getPoint, getTail, getTangent, setEnd, setStart, toString
- 
Field Details- 
_cp1
 
- 
- 
Constructor Details- 
RMQuadraticpublic RMQuadratic()Creates a new quadratic curve.
- 
RMQuadraticCreates a new quadratic curve for this gvein start point, control point and end point.
- 
RMQuadraticpublic RMQuadratic(double x1, double y1, double x2, double y2, double x3, double y3) Creates a new quadratic curve for this gvein start point, control point and end point.
 
- 
- 
Method Details- 
setCurvepublic void setCurve(double x1, double y1, double x2, double y2, double x3, double y3) Sets the curve values.
- 
setCurveSets the curve values.
- 
getPointReturns the point on this curve at the parametric location t (defined from 0-1).
- 
getDistanceReturns the minimum distance from the given point to this segment.- Overrides:
- getDistancein class- RMLine
 
- 
getDistanceQuadraticReturns the minimum distance from the given point to the curve.
- 
getPointCountpublic int getPointCount()Returns the point count of segment.- Overrides:
- getPointCountin class- RMLine
 
- 
getPointXpublic double getPointX(int anIndex) Returns the x of point at given index.
- 
getPointYpublic double getPointY(int anIndex) Returns the y of point at given index.
- 
subdivideSubdivides this curve into the given left and right curves.
- 
getMinXpublic double getMinX()Returns the min x point of this bezier.
- 
getMinYpublic double getMinY()Returns the min y point of this bezier.
- 
getMaxXpublic double getMaxX()Returns the max x point of this bezier.
- 
getMaxYpublic double getMaxY()Returns the max y point of this bezier.
- 
getBoundsReturns the bounds.
- 
getBoundspublic static void getBounds(double x0, double y0, double x1, double y1, double x2, double y2, Rectangle2D aRect) Returns the bounds of the bezier.
- 
getArcLengthpublic float getArcLength(float start, float end) Returns the arc length of the segment up to parametric value t- Overrides:
- getArcLengthin class- RMLine
 
- 
getArcLengthFunctionReturns an RMFunc which calculates the arclength of the curve up to t
- 
getParameterForLengthpublic float getParameterForLength(float l) Returns parametric point t that corresponds to a given length along the curve. l is in the range [0-1] (ie. percentage of total arclength)- Overrides:
- getParameterForLengthin class- RMLine
 
- 
getInverseArcLengthFunctionReturns an RMFunc which calculates t for a percentage length along the curve.
 
-