geomerative index |
Name | RPath
Examples |
    None available
Description | RPath is a reduced interface for creating, holding and drawing contours. Paths are ordered lists of commands (RCommand) which define the outlines of Shapes. Paths can be self-intersecting.
Constructors |
    RPath();
    RPath(x, y);
    RPath(p);
    RPath(s);
    RPath(c);
    RGeomElem();
Parameters |
x |  | float, the x coordinate of the first point of the path
y |  | float, the y coordinate of the first point of the path
RPath |  | s, the object from which to make the copy
RPoint |  | p, the first point of the path
Fields |
commands |  | Array of RCommand objects holding the commands of the path.
Methods |
addBezierTo ( ) |  | Use this method to add a new cubic bezier to the path. The first point of the bezier will be the last point added to the path.
addLineTo ( ) |  | Use this method to add a new line to the path. The first point of the line will be the last point added to the path.
addQuadTo ( ) |  | Use this method to add a new quadratic bezier to the path. The first point of the bezier will be the last point added to the path.
contains ( ) |  | Use this to return a specific tangent on the curve. It returns true if the point passed as a parameter is inside the path. Implementation taken from: http://www.ecse.rpi.edu/Homepages/wrf/Research/Short_Notes/pnpoly.html
countCommands ( ) |  | Use this method to count the number of commands in the contour.
draw ( ) |  | Use this method to draw the path.
getArea ( ) |  | Use this method to get the area of an element.
getBounds ( ) |  | Use this method to get the bounding box of the element.
getCenter ( ) |  | Use this method to get the center point of the element.
getCenteringTransf ( ) |  | Use this method to get the transformation matrix in order to fit and center the element on the canvas. Scaling and translation damping parameters are available, in order to create animations.
getCentroid ( ) |  | Use this method to get the centroid of the element.
getCurveLength ( ) |  | Use this to return the points on the curve. It returns the points in the way of an array of RPoint.
getCurveLengths ( ) |  | Use this to return the points on the curve. It returns the points in the way of an array of RPoint.
getHandles ( ) |  | Use this to return the start, control and end points of the path. It returns the points in the way of an array of RPoint.
getHandlesInPaths ( ) |  | Use this to return the handles of each path of the path. It returns the handles in the way of an array of array of RPoint.
getHeight ( ) |  | Use this method to get the height of the element.
getPoint ( ) |  | Use this to return a specific point on the curve. It returns the RPoint for a given advancement parameter t on the curve.
getPoints ( ) |  | Use this to return the points on the curve. It returns the points in the way of an array of RPoint.
getPointsInPaths ( ) |  | Use this to return the points of each path of the path. It returns the points in the way of an array of array of RPoint.
getTangent ( ) |  | Use this to return a specific tangent on the curve. It returns the RPoint tangent for a given advancement parameter t on the curve.
getTangents ( ) |  | Use this to return the tangents on the curve. It returns the vectors in the way of an array of RPoint.
getTangentsInPaths ( ) |  | Use this to return the tangents of each path of the path. It returns the tangents in the way of an array of array of RPoint.
getType ( ) |  | Use this method to get the type of element this is.
getWidth ( ) |  | Use this method to get the width of the element.
getX ( ) |  | Use this method to get the x (left side position) of the element.
getY ( ) |  | Use this method to get the y (left side position) of the element.
insertHandle ( ) |  | Use this to insert a split point into the path.
insertHandleInPaths ( ) |  | Use this to insert a split point into each command of the path.
isIn ( ) |  | Use this method to know if the shape is inside a graphics object. This might be useful if we want to delete objects that go offscreen.
rotate ( ) |  | Use this to apply a rotation to the point.
scale ( ) |  | Use this to scale the point.
split ( ) |  | Use this to split a path into two separate new paths.
transform ( ) |  | Transform the geometric object to fit in a rectangle defined by the parameters passed.
translate ( ) |  | Use this to apply a translation to the point.
Usage | Geometry
Related | RCommand RPolygon