Package geomerative
Class RContour
- java.lang.Object
-
- geomerative.RGeomElem
-
- geomerative.RContour
-
public class RContour extends RGeomElem
RContour is a reduced interface for creating, holding and drawing contours. Contours are ordered lists of points (RPoint) which define the outlines of polygons. Contours can be self-intersecting.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addClose()
void
addPoint(float x, float y)
void
addPoint(RPoint p)
Use this method to add new points to the contour.void
addPoints(RPoint[] morePoints)
Efficiently add an array of points to the contour.void
addPoints(java.util.List morePoints)
Efficiently add a list of points to the contour.boolean
contains(RPoint p)
int
countPoints()
Use this method to count the number of points in the contour.void
draw(processing.core.PApplet g)
void
draw(processing.core.PGraphics g)
Use this method to draw the contour.RPoint[]
getHandles()
Use this to return the points of the contour.RPoint[][]
getHandlesInPaths()
RPoint
getPoint(float t)
RPoint[]
getPoints()
Use this to return the points of the contour.RPoint[][]
getPointsInPaths()
RPoint
getTangent(float t)
RPoint[]
getTangents()
RPoint[][]
getTangentsInPaths()
int
getType()
Use this method to get the type of element this is.boolean
isHole()
Use this method to know if the contour is a hole.void
print()
RMesh
toMesh()
RPolygon
toPolygon()
RShape
toShape()
-
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, 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, transform, translate, translate
-
-
-
-
Field Detail
-
type
public int type
-
points
public RPoint[] points
Array of RPoint objects holding the points of the contour.
-
-
Method Detail
-
countPoints
public int countPoints()
Use this method to count the number of points in the contour.- Returns:
- int, the number points in the contour
-
draw
public void draw(processing.core.PGraphics g)
Use this method to draw the contour.
-
addPoint
public void addPoint(RPoint p)
Use this method to add new points to the contour.
-
addPoint
public void addPoint(float x, float y)
-
addPoints
public void addPoints(RPoint[] morePoints)
Efficiently add an array of points to the contour.
-
addPoints
public void addPoints(java.util.List morePoints)
Efficiently add a list of points to the contour.
-
getHandles
public RPoint[] getHandles()
Use this to return the points of the contour. It returns the points in the way of an array of RPoint.- Specified by:
getHandles
in classRGeomElem
- Returns:
- RPoint[], the points returned in an array.
-
getPoints
public RPoint[] getPoints()
Use this to return the points of the contour. It returns the points in the way of an array of RPoint.
-
getTangent
public RPoint getTangent(float t)
- Specified by:
getTangent
in classRGeomElem
-
getTangents
public RPoint[] getTangents()
- Specified by:
getTangents
in classRGeomElem
-
getPointsInPaths
public RPoint[][] getPointsInPaths()
- Specified by:
getPointsInPaths
in classRGeomElem
-
getHandlesInPaths
public RPoint[][] getHandlesInPaths()
- Specified by:
getHandlesInPaths
in classRGeomElem
-
getTangentsInPaths
public RPoint[][] getTangentsInPaths()
- Specified by:
getTangentsInPaths
in classRGeomElem
-
isHole
public boolean isHole()
Use this method to know if the contour is a hole. Remember to use the method update() on the polygon before using this method.- Returns:
- boolean, true if it is a hole
-
addClose
public void addClose()
-
toShape
public RShape toShape() throws java.lang.RuntimeException
-
-