Class RMPathUtils
- java.lang.Object
- 
- com.inductiveautomation.rm.graphics.RMPathUtils
 
- 
 public class RMPathUtils extends java.lang.ObjectSome utility methods for RMPaths.
- 
- 
Field SummaryFields Modifier and Type Field Description static intJOIN_OP_ADDstatic intJOIN_OP_INTERSECTstatic intJOIN_OP_SUBTRACTstatic intJOIN_OP_XOR
 - 
Constructor SummaryConstructors Constructor Description RMPathUtils()
 - 
Method SummaryAll Methods Static Methods Concrete Methods Modifier and Type Method Description static RMPathappendOval(RMPath aPath, RMRect aRect, float startAngle, float sweep, boolean connect)Adds elements describing an oval in the given rect to this path.static RMPathappendShape(RMPath aPath, java.awt.Shape aShape)Returns a new path from an AWT shape.static doublegetDistance(RMPath aPath, RMPoint aPoint)Returns shortest distance from any point in path to given point.static doublegetDistanceSigned(RMPath aPath, RMPoint aPoint)Returns shortest distance from any point in path to given point (negative means inside the path).static RMPathgetPathFlattened(RMPath aPath)Returns a path with only moveto, lineto.static RMPathgetPathWithFlattendCubics(RMPath aPath)Returns a copy of the path with cubics demoted to one or more quadratics.static booleanhasCubics(RMPath aPath)Returns whether the path has any cubic curves in it.static booleanisPolygonal(RMPath aPath)Returns whether path has any curve segments (QuadTo, CurveTo).static RMPathjoin(java.util.List paths, int aJoinOp)Returns the combined paths from given paths.static voidquadraticCurveTo(RMPath aPath, RMPoint cp1, RMPoint cp2, RMPoint aPoint)This is effectively a curveTo but does it internally with one or more approximated quadratics.
 
- 
- 
- 
Field Detail- 
JOIN_OP_ADDpublic static final int JOIN_OP_ADD - See Also:
- Constant Field Values
 
 - 
JOIN_OP_SUBTRACTpublic static final int JOIN_OP_SUBTRACT - See Also:
- Constant Field Values
 
 - 
JOIN_OP_INTERSECTpublic static final int JOIN_OP_INTERSECT - See Also:
- Constant Field Values
 
 - 
JOIN_OP_XORpublic static final int JOIN_OP_XOR - See Also:
- Constant Field Values
 
 
- 
 - 
Method Detail- 
appendShapepublic static RMPath appendShape(RMPath aPath, java.awt.Shape aShape) Returns a new path from an AWT shape.
 - 
appendOvalpublic static RMPath appendOval(RMPath aPath, RMRect aRect, float startAngle, float sweep, boolean connect) Adds elements describing an oval in the given rect to this path.
 - 
isPolygonalpublic static boolean isPolygonal(RMPath aPath) Returns whether path has any curve segments (QuadTo, CurveTo).
 - 
hasCubicspublic static boolean hasCubics(RMPath aPath) Returns whether the path has any cubic curves in it.
 - 
getPathFlattenedpublic static RMPath getPathFlattened(RMPath aPath) Returns a path with only moveto, lineto.
 - 
getPathWithFlattendCubicspublic static RMPath getPathWithFlattendCubics(RMPath aPath) Returns a copy of the path with cubics demoted to one or more quadratics.
 - 
quadraticCurveTopublic static void quadraticCurveTo(RMPath aPath, RMPoint cp1, RMPoint cp2, RMPoint aPoint) This is effectively a curveTo but does it internally with one or more approximated quadratics. I found a C++ version of this on http://homepages.tig.com.au/~dkl/swf/ - Jeff Martin. It illustrates how to approximate 4-point cubic Beziers with 3-point quadratic Beziers. PostScript (and most apps) use cubics, Flash uses quadratics.
 - 
getDistancepublic static double getDistance(RMPath aPath, RMPoint aPoint) Returns shortest distance from any point in path to given point.
 - 
getDistanceSignedpublic static double getDistanceSigned(RMPath aPath, RMPoint aPoint) Returns shortest distance from any point in path to given point (negative means inside the path).
 - 
joinpublic static RMPath join(java.util.List paths, int aJoinOp) Returns the combined paths from given paths.
 
- 
 
-