HE_Mesh
5.1.0
|
Public Member Functions | |
RShape () | |
RShape (final RPath newpath) | |
RShape (final RPath[] newpaths) | |
RShape (final RPoint[][] points) | |
RShape (final RShape s) | |
RShape | getChild (final String target) |
int | countChildren () |
void | addPath () |
void | addChild () |
void | addChild (final RShape s) |
void | addMoveTo (final RPoint p) |
void | addLineTo (final RPoint p) |
void | addQuadTo (final RPoint p1, final RPoint p2) |
void | addBezierTo (final RPoint p1, final RPoint p2, final RPoint p3) |
void | addClose () |
void | polygonize () |
RShape | toShape () |
RPoint[] | getHandles () |
RPoint | getPoint (final float t) |
RPoint[] | getPoints () |
RPoint | getTangent (final float t) |
boolean | contains (final float x, final float y) |
boolean | contains (final RPoint p) |
RPoint[] | getTangents () |
RPoint[][] | getPointsInPaths () |
RPoint[][] | getHandlesInPaths () |
RPoint[][] | getTangentsInPaths () |
RShape[] | splitPaths (final float t) |
void | insertHandle (final float t) |
void | insertHandleInPaths (final float t) |
RShape[] | split (final float t) |
RPoint[] | getIntersections (final RShape other) |
RClosest | getClosest (final RShape other) |
void | adapt (final RShape shp, final float wght, final float lngthOffset) throws RuntimeException |
void | adapt (final RShape shp) throws RuntimeException |
int | getType () |
void | print () |
void | draw (final PGraphics g) |
void | draw (final PApplet g) |
![]() | |
abstract void | draw (PGraphics g) |
abstract void | draw (PApplet g) |
void | draw () |
abstract RPoint | getPoint (float t) |
abstract RPoint | getTangent (float t) |
abstract RPoint[] | getHandles () |
abstract RPoint[] | getPoints () |
abstract RPoint[] | getTangents () |
abstract RPoint[][] | getHandlesInPaths () |
abstract RPoint[][] | getPointsInPaths () |
abstract RPoint[][] | getTangentsInPaths () |
abstract boolean | contains (RPoint p) |
abstract int | getType () |
abstract RShape | toShape () |
void | print () |
void | setFill (boolean _fill) |
void | setFill (int _fillColor) |
void | setFill (String str) |
void | setStroke (boolean _stroke) |
void | setStroke (int _strokeColor) |
void | setStroke (String str) |
void | setStrokeWeight (float value) |
void | setStrokeWeight (String str) |
void | setStrokeCap (String str) |
void | setStrokeJoin (String str) |
void | setStrokeAlpha (int opacity) |
void | setStrokeAlpha (String str) |
void | setFillAlpha (int opacity) |
void | setFillAlpha (String str) |
void | setAlpha (float opacity) |
void | setAlpha (int opacity) |
void | setAlpha (String str) |
RStyle | getStyle () |
void | setStyle (RStyle s) |
void | setName (String str) |
float[] | getCurveLengths () |
float | getCurveLength () |
RPolygon | toPolygon () |
RMesh | toMesh () |
void | transform (RMatrix m) |
void | transform (float x, float y, float w, float h) |
boolean | isIn (PGraphics g) |
boolean | isIn (PApplet g) |
RMatrix | getCenteringTransf (PGraphics g) throws RuntimeException |
RMatrix | getCenteringTransf (PGraphics g, float margin) throws RuntimeException |
void | centerIn (PGraphics g) |
void | centerIn (PGraphics g, float margin) |
void | centerIn (PGraphics g, float margin, float sclDamping, float trnsDamping) throws RuntimeException |
void | rotate (float angle) |
void | scale (float sx, float sy) |
void | scale (float s) |
Static Public Member Functions | |
static RShape | createLine (final float x1, final float y1, final float x2, final float y2) |
static RShape | createRing (final float x, final float y, final float widthBig, final float widthSmall) |
static RShape | createStar (final float x, final float y, final float widthBig, final float widthSmall, final int spikes) |
static RShape | createRectangle (final float x, final float y, final float w, final float h) |
static RShape | createEllipse (final float x, final float y, final float w, final float h) |
static RShape | createCircle (final float x, final float y, final float d) |
Public Attributes | |
int | type = RGeomElem.SHAPE |
RShape[] | children = null |
![]() | |
float | width |
float | height |
String | name = "" |
Protected Member Functions | |
void | calculateCurveLengths () |
![]() | |
void | saveContext (PGraphics g) |
void | saveContext (PApplet p) |
void | saveContext () |
void | restoreContext (PGraphics g) |
void | restoreContext (PApplet p) |
void | restoreContext () |
void | setContext (PGraphics g) |
void | setContext (PApplet p) |
void | setContext () |
void | setStyle (RGeomElem p) |
void | setStyle (String styleString) |
void | calculateCurveLengths () |
void | updateOrigParams () |
Protected Attributes | |
int | currentPath = 0 |
int | currentChild |
![]() | |
float[] | lenCurves |
float | lenCurve = -1F |
RStyle | style = new RStyle() |
Private Member Functions | |
void | drawPaths (final PGraphics g) |
void | drawPaths (final PApplet g) |
float[] | indAndAdvAt (final float t) |
void | appendChild (final RShape nextshape) |
void | append (final RPath nextpath) |
void | drawUsingInternalTesselator (final PGraphics g) |
void | drawUsingInternalTesselator (final PApplet p) |
void | drawUsingBreakShape (final PGraphics g) |
void | drawUsingBreakShape (final PApplet g) |
Related Functions | |
(Note that these are not member functions.) | |
RPath[] | paths = null |
RPoint | getCentroid () |
int | countPaths () |
void | addShape (final RShape s) |
void | addPath (final RPath s) |
void | setPath (final int indPath) |
void | addMoveTo (final float endx, final float endy) |
void | addLineTo (final float endx, final float endy) |
void | addQuadTo (final float cp1x, final float cp1y, final float endx, final float endy) |
void | addBezierTo (final float cp1x, final float cp1y, final float cp2x, final float cp2y, final float endx, final float endy) |
RMesh | toMesh () |
RPolygon | toPolygon () |
RShape | intersection (final RShape p) |
RShape | union (final RShape p) |
RShape | xor (final RShape p) |
RShape | diff (final RShape p) |
![]() | |
boolean | contains (RGeomElem shp) |
boolean | containsBounds (RGeomElem shp) |
boolean | containsHandles (RGeomElem shp) |
boolean | contains (RPoint[] ps) |
boolean | intersects (RGeomElem shp) |
boolean | intersectsBounds (RGeomElem shp) |
boolean | intersectsHandles (RGeomElem shp) |
boolean | intersects (RPoint[] ps) |
void | transform (float x, float y, float w, float h, boolean keepAspectRatio) |
RRectangle | getBounds () |
RPoint[] | getBoundsPoints () |
RPoint | getTopLeft () |
RPoint | getTopRight () |
RPoint | getBottomLeft () |
RPoint | getBottomRight () |
float | getX () |
float | getY () |
float | getOrigHeight () |
float | getOrigWidth () |
float | getWidth () |
float | getHeight () |
RPoint | getCenter () |
RPoint | getCentroid () |
float | getArea () |
RMatrix | getCenteringTransf (PGraphics g, float margin, float sclDamping, float trnsDamping) throws RuntimeException |
void | translate (float tx, float ty) |
void | translate (RPoint t) |
void | rotate (float angle, float vx, float vy) |
void | rotate (float angle, RPoint v) |
void | scale (float sx, float sy, RPoint p) |
void | scale (float sx, float sy, float x, float y) |
void | scale (float s, RPoint p) |
void | scale (float s, float x, float y) |
void | skewX (float angle) |
void | skewY (float angle) |
void | shear (float shx, float shy) |
Additional Inherited Members | |
![]() | |
static final int | SHAPE = 0 |
static final int | SUBSHAPE = 1 |
static final int | COMMAND = 2 |
static final int | POLYGON = 3 |
static final int | CONTOUR = 4 |
static final int | MESH = 5 |
static final int | TRISTRIP = 6 |
static final int | GROUP = 7 |
static final int | UNKNOWN = 8 |
RShape is a reduced interface for creating, holding and drawing complex shapes. Shapes are groups of one or more paths (RPath). Shapes can be selfintersecting and can contain holes. This interface also allows you to transform shapes into polygons by segmenting the curves forming the shape.
RShape Geometry
geomerative.RShape.RShape | ( | ) |
Use this method to create a new empty shape.
geomerative.RShape.RShape | ( | final RPath | newpath | ) |
geomerative.RShape.RShape | ( | final RPath[] | newpaths | ) |
geomerative.RShape.RShape | ( | final RPoint | points[][] | ) |
geomerative.RShape.RShape | ( | final RShape | s | ) |
void geomerative.RShape.adapt | ( | final RShape | shp, |
final float | wght, | ||
final float | lngthOffset | ||
) | throws RuntimeException |
Use this method to adapt a group of of figures to a shape.
RGroup_adapt
shp | the path to which to adapt |
void geomerative.RShape.adapt | ( | final RShape | shp | ) | throws RuntimeException |
void geomerative.RShape.addChild | ( | ) |
void geomerative.RShape.addChild | ( | final RShape | s | ) |
void geomerative.RShape.addClose | ( | ) |
void geomerative.RShape.addLineTo | ( | final RPoint | p | ) |
void geomerative.RShape.addMoveTo | ( | final RPoint | p | ) |
void geomerative.RShape.addPath | ( | ) |
|
private |
|
private |
|
protected |
boolean geomerative.RShape.contains | ( | final float | x, |
final float | y | ||
) |
Use this to return a specific tangent on the curve. It returns true if the point passed as a parameter is inside the shape. Implementation taken from: http://www.ecse.rpi.edu/Homepages/wrf/Research/Short_Notes/pnpoly.html
x | the X coordinate of the point for which to test containment. |
y | the Y coordinate of the point for which to test containment. |
boolean geomerative.RShape.contains | ( | final RPoint | p | ) |
Use this to return a specific tangent on the curve. It returns true if the point passed as a parameter is inside the shape. Implementation taken from: http://www.ecse.rpi.edu/Homepages/wrf/Research/Short_Notes/pnpoly.html
p | the point for which to test containment. |
int geomerative.RShape.countChildren | ( | ) |
|
static |
|
static |
Use this method to create a new elliptical shape.
createEllipse
x | the x position of the ellipse |
y | the y position of the ellipse |
w | the width of the ellipse |
h | the height of the ellipse |
|
static |
Use this method to create a new line.
createRing
x1 | x coordinate of the first point of the line |
y1 | y coordinate of the first point of the line |
x2 | x coordinate of the last point of the line |
y2 | y coordinate of the last point of the line |
|
static |
Use this method to create a new circle shape.
createRectangle
x | the x position of the rectangle |
y | the y position of the rectangle |
w | the width of the rectangle |
h | the height of the rectangle |
|
static |
Use this method to create a new ring polygon.
createRing
x | x coordinate of the center of the shape |
y | y coordinate of the center of the shape |
widthBig | the outer width of the ring polygon |
widthSmall | the inner width of the ring polygon |
|
static |
Use this method to create a new starform polygon.
createStar
widthBig | the outer width of the star polygon |
widthSmall | the inner width of the star polygon |
spikes | the amount of spikes on the star polygon |
void geomerative.RShape.draw | ( | final PGraphics | g | ) |
void geomerative.RShape.draw | ( | final PApplet | g | ) |
|
private |
Use this method to draw the shape.
drawShape
g | PGraphics, the graphics object on which to draw the shape |
|
private |
|
private |
|
private |
|
private |
|
private |
RShape geomerative.RShape.getChild | ( | final String | target | ) |
Use this method to get the closest or intersection points of the shape with another shape passed as argument.
other | the path with which to check for intersections |
RPoint [] geomerative.RShape.getHandles | ( | ) |
RPoint [][] geomerative.RShape.getHandlesInPaths | ( | ) |
Use this method to get the points of intersection between this shape and another shape passed in as a parameter.
other | the path with which to check for intersections |
RPoint geomerative.RShape.getPoint | ( | final float | t | ) |
RPoint [] geomerative.RShape.getPoints | ( | ) |
RPoint [][] geomerative.RShape.getPointsInPaths | ( | ) |
RPoint geomerative.RShape.getTangent | ( | final float | t | ) |
RPoint [] geomerative.RShape.getTangents | ( | ) |
RPoint [][] geomerative.RShape.getTangentsInPaths | ( | ) |
int geomerative.RShape.getType | ( | ) |
Use this method to get the type of element this is.
RShape_getType
|
private |
void geomerative.RShape.insertHandle | ( | final float | t | ) |
Use this to insert a split point into the shape.
insertHandle
t | the parameter of advancement on the curve. t must have values between 0 and 1. |
void geomerative.RShape.insertHandleInPaths | ( | final float | t | ) |
Use this to insert a split point into each command of the shape.
insertHandleInPaths
t | the parameter of advancement on the curve. t must have values between 0 and 1. |
void geomerative.RShape.polygonize | ( | ) |
void geomerative.RShape.print | ( | ) |
RShape [] geomerative.RShape.split | ( | final float | t | ) |
RShape [] geomerative.RShape.splitPaths | ( | final float | t | ) |
RShape geomerative.RShape.toShape | ( | ) |
|
related |
Use this method to add a new bezierTo command to the current path. This will add a cubic bezier from the last point added with the control and ending points passed as arguments.
addArcTo
cp1x | the x coordinate of the first control point of the bezier. |
cp1y | the y coordinate of the first control point of the bezier. |
cp2x | the x coordinate of the second control point of the bezier. |
cp2y | the y coordinate of the second control point of the bezier. |
endx | the x coordinate of the ending point of the bezier. |
endy | the y coordinate of the ending point of the bezier. ( ) ( ) ( ) ( ) ( ) |
|
related |
Use this method to add a new lineTo command to the current path. This will add a line from the last point added to the point passed as argument.
addLineTo
endx | the x coordinate of the ending point of the line. |
endy | the y coordinate of the ending point of the line. ( ) ( ) ( ) ( ) ( ) |
|
related |
Use this method to add a new moveTo command to the shape. The command moveTo acts different to normal commands, in order to make a better analogy to its borthers classes Polygon and Mesh. MoveTo creates a new path in the shape. It's similar to adding a new contour to a polygon.
addMoveTo
endx | the x coordinate of the first point for the new path. |
endy | the y coordinate of the first point for the new path. ( ) ( ) ( ) ( ) ( ) |
|
related |
Use this method to create a new path. The first point of the new path will be set to (0,0). Use addMoveTo ( ) in order to add a new path with a different first point.
addPath
s | the path to be added. ( ) ( ) |
|
related |
Use this method to add a new quadTo command to the current path. This will add a quadratic bezier from the last point added with the control and ending points passed as arguments.
addQuadTo
cp1x | the x coordinate of the control point of the bezier. |
cp1y | the y coordinate of the control point of the bezier. |
endx | the x coordinate of the ending point of the bezier. |
endy | the y coordinate of the ending point of the bezier. ( ) ( ) ( ) ( ) ( ) |
|
related |
Use this method to add a new shape. The paths of the shape we are adding will simply be added to the current shape.
addShape
s | RShape, the shape to be added. ( ) ( ) |
|
related |
Use this method to count the number of paths in the shape.
countPaths ( )
|
related |
Use this method to get the centroid of the element.
RGroup_getCentroid
|
related |
|
related |
Use this method to set the current path.
setPath ( ) ( ) ( ) ( ) ( )
|
related |
Use this method to create a new mesh from a given polygon.
toMesh
|
related |
Use this method to create a new polygon from a given shape.
toPolygon
RShape [] geomerative.RShape.children = null |
|
protected |
|
protected |
int geomerative.RShape.type = RGeomElem.SHAPE |