Class RMPathUtils
java.lang.Object
com.inductiveautomation.rm.graphics.RMPathUtils
Some utility methods for RMPaths.
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final intstatic final intstatic final intstatic final int
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionstatic 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, 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 booleanReturns whether the path has any cubic curves in it.static booleanisPolygonal(RMPath aPath) Returns whether path has any curve segments (QuadTo, CurveTo).static RMPathReturns 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 Details- 
JOIN_OP_ADDpublic static final int JOIN_OP_ADD- See Also:
 
- 
JOIN_OP_SUBTRACTpublic static final int JOIN_OP_SUBTRACT- See Also:
 
- 
JOIN_OP_INTERSECTpublic static final int JOIN_OP_INTERSECT- See Also:
 
- 
JOIN_OP_XORpublic static final int JOIN_OP_XOR- See Also:
 
 
- 
- 
Constructor Details- 
RMPathUtilspublic RMPathUtils()
 
- 
- 
Method Details- 
appendShapeReturns 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.
- 
isPolygonalReturns whether path has any curve segments (QuadTo, CurveTo).
- 
hasCubicsReturns whether the path has any cubic curves in it.
- 
getPathFlattenedReturns a path with only moveto, lineto.
- 
getPathWithFlattendCubicsReturns a copy of the path with cubics demoted to one or more quadratics.
- 
quadraticCurveToThis 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.
- 
getDistanceReturns shortest distance from any point in path to given point.
- 
getDistanceSignedReturns shortest distance from any point in path to given point (negative means inside the path).
- 
joinReturns the combined paths from given paths.
 
-