HE_Mesh  5.1.0
geomerative.RGeomElem Class Referenceabstract
+ Inheritance diagram for geomerative.RGeomElem:

Public Member Functions

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

float width
 
float height
 
String name = ""
 

Static Public Attributes

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 Member Functions

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

float[] lenCurves
 
float lenCurve = -1F
 
RStyle style = new RStyle()
 

Related Functions

(Note that these are not member functions.)

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)
 

Detailed Description

RGeomElem is an interface to any geometric element that can be drawn and transformed, such as shapes, polygons or meshes.

Member Function Documentation

void geomerative.RGeomElem.calculateCurveLengths ( )
protected
void geomerative.RGeomElem.centerIn ( PGraphics  g)
void geomerative.RGeomElem.centerIn ( PGraphics  g,
float  margin 
)
void geomerative.RGeomElem.centerIn ( PGraphics  g,
float  margin,
float  sclDamping,
float  trnsDamping 
) throws RuntimeException
abstract boolean geomerative.RGeomElem.contains ( RPoint  p)
abstract
abstract void geomerative.RGeomElem.draw ( PGraphics  g)
abstract
abstract void geomerative.RGeomElem.draw ( PApplet  g)
abstract
void geomerative.RGeomElem.draw ( )
RMatrix geomerative.RGeomElem.getCenteringTransf ( PGraphics  g) throws RuntimeException
RMatrix geomerative.RGeomElem.getCenteringTransf ( PGraphics  g,
float  margin 
) throws RuntimeException
float geomerative.RGeomElem.getCurveLength ( )

Use this to return the length of the curve. getCurveLength

Returns
float, the arclength of the path.
float [] geomerative.RGeomElem.getCurveLengths ( )

Use this to return arclengths of each command on the curve. getCurveLength

Returns
float[], the arclengths of each command on the curve.
abstract RPoint [] geomerative.RGeomElem.getHandles ( )
abstract
abstract RPoint [][] geomerative.RGeomElem.getHandlesInPaths ( )
abstract
abstract RPoint geomerative.RGeomElem.getPoint ( float  t)
abstract
abstract RPoint [] geomerative.RGeomElem.getPoints ( )
abstract
abstract RPoint [][] geomerative.RGeomElem.getPointsInPaths ( )
abstract
RStyle geomerative.RGeomElem.getStyle ( )
abstract RPoint geomerative.RGeomElem.getTangent ( float  t)
abstract
abstract RPoint [] geomerative.RGeomElem.getTangents ( )
abstract
abstract RPoint [][] geomerative.RGeomElem.getTangentsInPaths ( )
abstract
abstract int geomerative.RGeomElem.getType ( )
abstract
boolean geomerative.RGeomElem.isIn ( PGraphics  g)

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. RShape_isIn Geometry

Parameters
gthe graphics object
Returns
boolean, whether the shape is in or not the graphics object
boolean geomerative.RGeomElem.isIn ( PApplet  g)
void geomerative.RGeomElem.print ( )
void geomerative.RGeomElem.restoreContext ( PGraphics  g)
protected
void geomerative.RGeomElem.restoreContext ( PApplet  p)
protected
void geomerative.RGeomElem.restoreContext ( )
protected
void geomerative.RGeomElem.rotate ( float  angle)
void geomerative.RGeomElem.saveContext ( PGraphics  g)
protected
void geomerative.RGeomElem.saveContext ( PApplet  p)
protected
void geomerative.RGeomElem.saveContext ( )
protected
void geomerative.RGeomElem.scale ( float  sx,
float  sy 
)
void geomerative.RGeomElem.scale ( float  s)
void geomerative.RGeomElem.setAlpha ( float  opacity)
void geomerative.RGeomElem.setAlpha ( int  opacity)
void geomerative.RGeomElem.setAlpha ( String  str)
void geomerative.RGeomElem.setContext ( PGraphics  g)
protected
void geomerative.RGeomElem.setContext ( PApplet  p)
protected
void geomerative.RGeomElem.setContext ( )
protected
void geomerative.RGeomElem.setFill ( boolean  _fill)
void geomerative.RGeomElem.setFill ( int  _fillColor)
void geomerative.RGeomElem.setFill ( String  str)
void geomerative.RGeomElem.setFillAlpha ( int  opacity)
void geomerative.RGeomElem.setFillAlpha ( String  str)
void geomerative.RGeomElem.setName ( String  str)
void geomerative.RGeomElem.setStroke ( boolean  _stroke)
void geomerative.RGeomElem.setStroke ( int  _strokeColor)
void geomerative.RGeomElem.setStroke ( String  str)
void geomerative.RGeomElem.setStrokeAlpha ( int  opacity)
void geomerative.RGeomElem.setStrokeAlpha ( String  str)
void geomerative.RGeomElem.setStrokeCap ( String  str)
void geomerative.RGeomElem.setStrokeJoin ( String  str)
void geomerative.RGeomElem.setStrokeWeight ( float  value)
void geomerative.RGeomElem.setStrokeWeight ( String  str)
void geomerative.RGeomElem.setStyle ( RStyle  s)
void geomerative.RGeomElem.setStyle ( RGeomElem  p)
protected
void geomerative.RGeomElem.setStyle ( String  styleString)
protected
RMesh geomerative.RGeomElem.toMesh ( )
RPolygon geomerative.RGeomElem.toPolygon ( )
abstract RShape geomerative.RGeomElem.toShape ( )
abstract
void geomerative.RGeomElem.transform ( RMatrix  m)
void geomerative.RGeomElem.transform ( float  x,
float  y,
float  w,
float  h 
)
void geomerative.RGeomElem.updateOrigParams ( )
protected

Friends And Related Function Documentation

boolean contains ( RGeomElem  shp)
related

Use this method to test if the shape contains all the points of another shape. contains

Returns
boolean, true if the shape contains all the points of the other shape ( ) ( )
boolean contains ( RPoint[]  ps)
related

Use this method to test if the shape contains an array of points. contains

Returns
boolean, true if the shape contains all the points ( ) ( ) ( )
boolean containsBounds ( RGeomElem  shp)
related

Use this method to test if the shape contains the bounding box of another shape. contains

Returns
boolean, true if the shape contains the bounding box of the other shape ( ) ( )
boolean containsHandles ( RGeomElem  shp)
related

Use this method to test if the shape contains the handles of another shape. This method is faster than contains(), but the results might not be perfect. contains

Returns
boolean, true if the shape contains all the handles of the other shape ( ) ( )
float getArea ( )
related

Use this method to get the area of an element. RGroup_getArea

Returns
float, the area point of the element ( ) ( ) ( )
RPoint getBottomLeft ( )
related

Use this method to get the bottom left position of the element. getX ( ) ( ) ( ) ( ) ( ) ( )

RPoint getBottomRight ( )
related

Use this method to get the bottom right position of the element. getX ( ) ( ) ( ) ( ) ( ) ( )

RRectangle getBounds ( )
related

Use this method to get the bounding box of the element. getBounds

Returns
RRectangle, the bounding box of the element in the form of a four-point contour ( )
RPoint [] getBoundsPoints ( )
related

Use this method to get the points of the bounding box of the element. getBounds

Returns
RRectangle, the bounding box of the element in the form of a four-point contour ( )
RPoint getCenter ( )
related

Use this method to get the center point of the element. RGroup_getCenter

Returns
RPoint, the center point of the element ( )
RMatrix getCenteringTransf ( PGraphics  g,
float  margin,
float  sclDamping,
float  trnsDamping 
) throws RuntimeException
related

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. RGeomElem_getCenteringTransf

Returns
RMatrix, the transformation matrix
Parameters
gthe canvas to which to fit and center the path
marginthe margin to take into account when fitting
sclDampinga value from 0 to 1. The damping coefficient for the scale, if the value is 0, then no scaling is applied.
trnsDampinga value from 0 to 1. The damping coefficient for the translation, if the value is 0, then no translation is applied. ( )
RPoint getCentroid ( )
related

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

Returns
RPoint, the centroid point of the element ( ) ( )
float getHeight ( )
related

Use this method to get the height of the element. getHeight

Returns
float, the height of the element ( )
float getOrigHeight ( )
related

Use this method to get the original height of the element. getOrigHeight

Returns
float, the original height of the element before applying any transformations ( )
float getOrigWidth ( )
related

Use this method to get the original width of the element. getOrigWidth

Returns
float, the original width of the element before applying any transformations ( )
RPoint getTopLeft ( )
related

Use this method to get the top left position of the element. getX ( ) ( ) ( ) ( ) ( ) ( )

RPoint getTopRight ( )
related

Use this method to get the top right position of the element. getX ( ) ( ) ( ) ( ) ( ) ( )

float getWidth ( )
related

Use this method to get the width of the element. getWidth

Returns
float, the width of the element ( )
float getX ( )
related

Use this method to get the x (left side) position of the element. getX

Returns
float, the x coordinate of the element ( ) ( ) ( ) ( )
float getY ( )
related

Use this method to get the y position of the element. getY

Returns
float, the y coordinate of the element ( ) ( ) ( ) ( )
boolean intersects ( RGeomElem  shp)
related

Use this method to test if the shape intersects another shape. intersects

Returns
boolean, true if the shape intersects all the points of the other shape ( ) ( )
boolean intersects ( RPoint[]  ps)
related

Use this method to test if the shape intersects an array of points. intersects

Returns
boolean, true if the shape intersects all the points ( ) ( ) ( )
boolean intersectsBounds ( RGeomElem  shp)
related

Use this method to test if the shape intersects the bounding box of another shape. intersects

Returns
boolean, true if the shape intersects the bounding box of the other shape ( ) ( )
boolean intersectsHandles ( RGeomElem  shp)
related

Use this method to test if the shape intersects the handles of another shape. This method is faster than intersects(), but the results might not be perfect. intersects

Returns
boolean, true if the shape intersects all the handles of the other shape ( ) ( )
void rotate ( float  angle,
float  vx,
float  vy 
)
related

Apply a rotation to the element, given an angle and optionally a rotation center. RPoint_rotate Geometry

Parameters
anglethe angle of rotation to be applied
vxthe x coordinate of the center of rotation
vythe y coordinate of the center of rotation ( ) ( ) ( )
void rotate ( float  angle,
RPoint  v 
)
related

Apply a rotation to the element, given an angle and optionally a rotation center. RPoint_rotate Geometry

Parameters
anglethe angle of rotation to be applied
vthe position vector of the center of rotation ( ) ( ) ( )
void scale ( float  sx,
float  sy,
RPoint  p 
)
related

Apply a scale to the element, given scaling factors and optionally a scaling center. RPoint_scale Geometry

Parameters
sxthe scaling coefficient over the x axis
sythe scaling coefficient over the y axis
pthe position vector of the center of the scaling ( ) ( ) ( )
void scale ( float  sx,
float  sy,
float  x,
float  y 
)
related

Apply a scale to the element, given scaling factors and optionally a scaling center. RPoint_scale Geometry

Parameters
sxthe scaling coefficient over the x axis
sythe scaling coefficient over the y axis
xx coordinate of the position vector of the center of the scaling
yy coordinate of the position vector of the center of the scaling ( ) ( ) ( )
void scale ( float  s,
RPoint  p 
)
related

Apply a scale to the element, given scaling factors and optionally a scaling center. RPoint_scale Geometry

Parameters
sthe scaling coefficient for a uniform scaling
pthe position vector of the center of the scaling ( ) ( ) ( )
void scale ( float  s,
float  x,
float  y 
)
related

Apply a scale to the element, given scaling factors and optionally a scaling center. RPoint_scale Geometry

Parameters
sthe scaling coefficient for a uniform scaling
xx coordinate of the position vector of the center of the scaling
yy coordinate of the position vector of the center of the scaling ( ) ( ) ( )
void shear ( float  shx,
float  shy 
)
related

Apply a shear to the element, given shearing factors RMatrix_translate

Parameters
shxx coordinate shearing
shyy coordinate shearing Geometry ( ) ( ) ( )
void skewX ( float  angle)
related

Apply a horizontal skew to the element, given skewing angle RMatrix_skewing

Parameters
angleskewing angle Geometry ( ) ( ) ( )
void skewY ( float  angle)
related

Apply a vertical skew to the element, given skewing angle RMatrix_skewing

Parameters
angleskewing angle Geometry ( ) ( ) ( )
void transform ( float  x,
float  y,
float  w,
float  h,
boolean  keepAspectRatio 
)
related

Transform the geometric object to fit in a rectangle defined by the parameters passed. getBounds ( )

void translate ( float  tx,
float  ty 
)
related

Apply a translation to the element, given translation coordinates. RGeomElem_translate Geometry

Parameters
txthe coefficient of x translation
tythe coefficient of y translation ( ) ( ) ( )
void translate ( RPoint  t)
related

Apply a translation to the element, given a point. RGeomElem_translate Geometry

Parameters
tthe translation vector to be applied ( ) ( ) ( )

Member Data Documentation

final int geomerative.RGeomElem.COMMAND = 2
static
final int geomerative.RGeomElem.CONTOUR = 4
static
final int geomerative.RGeomElem.GROUP = 7
static
float geomerative.RGeomElem.height

Shape document height.

float geomerative.RGeomElem.lenCurve = -1F
protected
float [] geomerative.RGeomElem.lenCurves
protected
final int geomerative.RGeomElem.MESH = 5
static
String geomerative.RGeomElem.name = ""
final int geomerative.RGeomElem.POLYGON = 3
static
final int geomerative.RGeomElem.SHAPE = 0
static
RStyle geomerative.RGeomElem.style = new RStyle()
protected
final int geomerative.RGeomElem.SUBSHAPE = 1
static
final int geomerative.RGeomElem.TRISTRIP = 6
static
final int geomerative.RGeomElem.UNKNOWN = 8
static
float geomerative.RGeomElem.width

Shape document width.


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