HE_Mesh  5.1.0
geomerative.RGroup Class Reference
+ Inheritance diagram for geomerative.RGroup:

Public Member Functions

 RGroup ()
 
 RGroup (RGroup grp)
 
void print ()
 
void draw (PGraphics g)
 
void draw (PApplet a)
 
RMesh toMesh () throws RuntimeException
 
RPolygon toPolygon () throws RuntimeException
 
RShape toShape () throws RuntimeException
 
RPoint[] getHandles ()
 
RPoint getPoint (float t)
 
RPoint[] getPoints ()
 
RPoint getTangent (float t)
 
RPoint[] getTangents ()
 
RPoint[][] getPointsInPaths ()
 
RPoint[][] getHandlesInPaths ()
 
RPoint[][] getTangentsInPaths ()
 
boolean contains (RPoint p)
 
int getType ()
 
RGroup[] split (float t)
 
RGroup[] splitPaths (float t)
 
void insertHandleInPaths (float t)
 
void adapt (RGroup grp, float wght, float lngthOffset) throws RuntimeException
 
void adapt (RGroup grp) throws RuntimeException
 
void adapt (RShape shp)
 
void adapt (RShape shp, float wght, float lngthOffset)
 
void polygonize ()
 
- Public Member Functions inherited from geomerative.RGeomElem
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)
 

Public Attributes

int type = RGeomElem.GROUP
 
- Public Attributes inherited from geomerative.RGeomElem
float width
 
float height
 
String name = ""
 

Protected Member Functions

void calculateCurveLengths ()
 
- Protected Member Functions inherited from geomerative.RGeomElem
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 ()
 

Private Member Functions

float[] indAndAdvAt (float t)
 
void append (RGeomElem elem)
 
void extract (int i) throws RuntimeException
 

Related Functions

(Note that these are not member functions.)

RGeomElem[] elements
 
RPoint getCentroid ()
 
int countElements ()
 
void addElement (RGeomElem elem)
 
void addGroup (RGroup grupo)
 
void removeElement (int i) throws RuntimeException
 
RGroup toMeshGroup () throws RuntimeException
 
RGroup toPolygonGroup () throws RuntimeException
 
RGroup toShapeGroup () throws RuntimeException
 

Additional Inherited Members

- Static Public Attributes inherited from geomerative.RGeomElem
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
 
- Protected Attributes inherited from geomerative.RGeomElem
float[] lenCurves
 
float lenCurve = -1F
 
RStyle style = new RStyle()
 

Detailed Description

RGroup is a holder for a group of geometric elements that can be drawn and transformed, such as shapes, polygons or meshes. geometry

Constructor & Destructor Documentation

geomerative.RGroup.RGroup ( )

Use this method to create a new empty group. RGroup

geomerative.RGroup.RGroup ( RGroup  grp)

Use this method to create a copy of a group. RGroup

Member Function Documentation

void geomerative.RGroup.adapt ( RGroup  grp,
float  wght,
float  lngthOffset 
) throws RuntimeException

Use this method to adapt a group of of figures to a group. RGroup_adapt

Parameters
grpthe path to which to adapt
void geomerative.RGroup.adapt ( RGroup  grp) throws RuntimeException
void geomerative.RGroup.adapt ( RShape  shp)
void geomerative.RGroup.adapt ( RShape  shp,
float  wght,
float  lngthOffset 
)
void geomerative.RGroup.append ( RGeomElem  elem)
private
void geomerative.RGroup.calculateCurveLengths ( )
protected
boolean geomerative.RGroup.contains ( 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 group.

Parameters
pthe point for which to test containment..
Returns
boolean, true if the point is in the path.
void geomerative.RGroup.draw ( PGraphics  g)

Use this method to draw the group. This will draw each element at a time, without worrying about intersections or holes. This is the main difference between having a shape with multiple paths and having a group with multiple shapes. RGroup_draw

Parameters
gPGraphics, the graphics object on which to draw the group
void geomerative.RGroup.draw ( PApplet  a)
void geomerative.RGroup.extract ( int  i) throws RuntimeException
private
RPoint [] geomerative.RGroup.getHandles ( )

Use this to return the points of the group. It returns the points as an array of RPoint. RGroup_getHandles

Returns
RPoint[], the points returned in an array.
RPoint [][] geomerative.RGroup.getHandlesInPaths ( )
RPoint geomerative.RGroup.getPoint ( float  t)
RPoint [] geomerative.RGroup.getPoints ( )

Use this to return the points of the group. It returns the points as an array of RPoint. RGroup_getPoints

Returns
RPoint[], the points returned in an array.
RPoint [][] geomerative.RGroup.getPointsInPaths ( )

Use this to return the points of each path of the group. It returns the points as an array of arrays of RPoint. RGroup_getPoints

Returns
RPoint[], the points returned in an array.
RPoint geomerative.RGroup.getTangent ( float  t)
RPoint [] geomerative.RGroup.getTangents ( )

Use this to return the points of the group. It returns the points as an array of RPoint. RGroup_getPoints

Returns
RPoint[], the points returned in an array.
RPoint [][] geomerative.RGroup.getTangentsInPaths ( )
int geomerative.RGroup.getType ( )

Use this method to get the type of element this is. RPolygon_getType

Returns
int, will allways return RGeomElem.POLYGON
float [] geomerative.RGroup.indAndAdvAt ( float  t)
private
void geomerative.RGroup.insertHandleInPaths ( float  t)

Use this to insert a split point into each command of the group. insertHandleInPaths

Parameters
tfloat, the parameter of advancement on the curve. t must have values between 0 and 1.
void geomerative.RGroup.polygonize ( )
void geomerative.RGroup.print ( )
RGroup [] geomerative.RGroup.split ( float  t)
RGroup [] geomerative.RGroup.splitPaths ( float  t)
RMesh geomerative.RGroup.toMesh ( ) throws RuntimeException
RPolygon geomerative.RGroup.toPolygon ( ) throws RuntimeException
RShape geomerative.RGroup.toShape ( ) throws RuntimeException

Friends And Related Function Documentation

void addElement ( RGeomElem  elem)
related

Use this method to add a new element. RGroup_addElement

Parameters
elemRGeomElem, any kind of RGeomElem to add. It accepts the classes RShape, RPolygon and RMesh. ( )
void addGroup ( RGroup  grupo)
related

Use this method to add a new element. RGroup_addGroup

Parameters
grupoRGroup, A group of elements to add to this group. ( )
int countElements ( )
related

Use this method to count the number of elements in the group. RGroup_countElements

Returns
int, the number elements in the group. ( ) ( )
RGeomElem [] elements
related

Array of RGeomElem objects holding the elements of the group. When accessing theses elements we must cast them to their class in order to get all the functionalities of each representation. e.g. RShape s = group.elements[i].toShape() If the element cannot be converted to the target class it will throw a RuntimeException, to ignore these, use try-catch syntax. RGroup_elements

( ) ( ) ( )

RPoint getCentroid ( )
related

Use this method to get the centroid of the element. RGroup_getCentroid

Returns
RPoint, the centroid point of the element ( ) ( )
void removeElement ( int  i) throws RuntimeException
related

Use this method to remove an element. RGroup_removeElement

Parameters
iint, the index of the element to remove from the group. ( )
RGroup toMeshGroup ( ) throws RuntimeException
related

Use this method to get a new group whose elements are the corresponding meshes of the elements in the current group. This can be used for increasing performance in exchange of losing abstraction. RGroup_toMeshGroup

Returns
RGroup, the new group made of RMeshes ( ) ( )
RGroup toPolygonGroup ( ) throws RuntimeException
related

Use this method to get a new group whose elements are the corresponding polygons of the elements in the current group. At this moment there is no implementation for transforming a mesh to a polygon so applying this method to groups holding mesh elements will generate an exception. RGroup_toPolygonGroup

Returns
RGroup, the new group made of RPolygons ( ) ( )
RGroup toShapeGroup ( ) throws RuntimeException
related

Use this method to get a new group whose elements are all the corresponding shapes of the elements in the current group. At this moment there is no implementation for transforming a mesh or a polygon to a shape so applying this method to groups holding mesh or polygon elements will generate an exception. RGroup_toShapeGroup

Returns
RGroup, the new group made of RShapes ( ) ( )

Member Data Documentation

int geomerative.RGroup.type = RGeomElem.GROUP

The documentation for this class was generated from the following file: