|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectgeomerative.RGeomElem
geomerative.RMesh
public class RMesh
RMesh is a reduced interface for creating, holding and drawing meshes. Meshes are a group of tiangle strips (RStrip).
Field Summary | |
---|---|
RStrip[] |
strips
Array of RStrip objects holding the contours of the polygon. |
int |
type
|
Fields inherited from class geomerative.RGeomElem |
---|
COMMAND, CONTOUR, GROUP, height, MESH, name, POLYGON, SHAPE, SUBSHAPE, TRISTRIP, UNKNOWN, width |
Constructor Summary | |
---|---|
RMesh()
Create a new empty mesh. |
|
RMesh(RMesh m)
Copy a mesh. |
Method Summary | |
---|---|
void |
addPoint(float x,
float y)
Add a new point to the current strip. |
void |
addPoint(int indStrip,
float x,
float y)
Add a new point to the given strip. |
void |
addPoint(int indStrip,
RPoint p)
Add a new point to the given strip. |
void |
addPoint(RPoint p)
Add a new point to the current strip. |
void |
addStrip()
|
void |
addStrip(RStrip s)
Add a new strip. |
boolean |
contains(RPoint p)
|
int |
countStrips()
Use this method to count the number of strips in the mesh. |
void |
draw(processing.core.PApplet g)
|
void |
draw(processing.core.PGraphics g)
Use this method to draw the mesh. |
RPoint[] |
getHandles()
Use this to get the vertices of the mesh. |
RPoint[][] |
getHandlesInPaths()
|
RPoint |
getPoint(float t)
|
RPoint[] |
getPoints()
Use this to get the vertices of the mesh. |
RPoint[][] |
getPointsInPaths()
|
RPoint |
getTangent(float t)
|
RPoint[] |
getTangents()
|
RPoint[][] |
getTangentsInPaths()
|
int |
getType()
Use this method to get the type of element this is. |
void |
setCurrent(int indStrip)
Use this method to set the current strip to which append points. |
RMesh |
toMesh()
|
RPolygon |
toPolygon()
|
RShape |
toShape()
|
void |
transform(RMatrix m)
Use this method to transform the mesh. |
Methods inherited from class geomerative.RGeomElem |
---|
centerIn, centerIn, centerIn, contains, contains, containsBounds, containsHandles, draw, getArea, getBottomLeft, getBottomRight, getBounds, getBoundsPoints, getCenter, getCenteringTransf, getCenteringTransf, getCenteringTransf, getCentroid, getCurveLength, getCurveLengths, getHeight, getOrigHeight, getOrigWidth, getStyle, getTopLeft, getTopRight, getWidth, getX, getY, intersects, intersects, intersectsBounds, intersectsHandles, isIn, isIn, print, rotate, rotate, rotate, scale, scale, scale, scale, scale, scale, setAlpha, setAlpha, setAlpha, setFill, setFill, setFill, setFillAlpha, setFillAlpha, setName, setStroke, setStroke, setStroke, setStrokeAlpha, setStrokeAlpha, setStrokeCap, setStrokeJoin, setStrokeWeight, setStrokeWeight, setStyle, shear, skewX, skewY, transform, transform, translate, translate |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public int type
public RStrip[] strips
Constructor Detail |
---|
public RMesh()
public RMesh(RMesh m)
m
- the object of which to make a copyMethod Detail |
---|
public int countStrips()
public void addStrip(RStrip s)
s
- the strip to be addedpublic void addStrip()
public void setCurrent(int indStrip)
public void addPoint(RPoint p)
p
- the point to be addedpublic void addPoint(float x, float y)
x
- the x coordinate of the point to be addedy
- the y coordinate of the point to be addedpublic void addPoint(int indStrip, RPoint p)
indStrip
- the index of the strip to which the point will be addedp
- the point to be addedpublic void addPoint(int indStrip, float x, float y)
indStrip
- the index of the strip to which the point will be addedx
- the x coordinate of the point to be addedy
- the y coordinate of the point to be addedpublic void draw(processing.core.PGraphics g)
draw
in class RGeomElem
g
- PGraphics, the graphics object on which to draw the meshpublic void draw(processing.core.PApplet g)
draw
in class RGeomElem
public RPoint[] getHandles()
getHandles
in class RGeomElem
public RPoint[] getPoints()
getPoints
in class RGeomElem
public RPoint getPoint(float t)
getPoint
in class RGeomElem
public RPoint getTangent(float t)
getTangent
in class RGeomElem
public RPoint[] getTangents()
getTangents
in class RGeomElem
public RPoint[][] getPointsInPaths()
getPointsInPaths
in class RGeomElem
public RPoint[][] getHandlesInPaths()
getHandlesInPaths
in class RGeomElem
public RPoint[][] getTangentsInPaths()
getTangentsInPaths
in class RGeomElem
public boolean contains(RPoint p)
contains
in class RGeomElem
public int getType()
getType
in class RGeomElem
public void transform(RMatrix m)
transform
in class RGeomElem
m
- RMatrix, the matrix of the affine transformation to apply to the meshpublic RMesh toMesh()
toMesh
in class RGeomElem
public RPolygon toPolygon() throws java.lang.RuntimeException
toPolygon
in class RGeomElem
java.lang.RuntimeException
public RShape toShape() throws java.lang.RuntimeException
toShape
in class RGeomElem
java.lang.RuntimeException
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |