Package geomerative
Class RStrip
- java.lang.Object
-
- geomerative.RStrip
-
public class RStrip extends java.lang.Object
RStrip is a reduced interface for creating, holding and drawing triangle strips. Triangle strips are ordered lists of points (RPoint) which define the vertices of a mesh.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addVertex(float x, float y)
void
addVertex(RPoint p)
Use this method to add new vertices to the strip.int
countVertices()
Use this method to count the number of vertices in the strip.void
draw(processing.core.PGraphics g)
Use this method to draw the strip.RContour
getBounds()
Use this method to get the bounding box of the strip.RPoint[]
getHandles()
Use this to get the vertices of the strip.RPoint[]
getPoints()
Use this to get the vertices of the strip.void
transform(RMatrix m)
Use this method to transform the strip.
-
-
-
Field Detail
-
type
public int type
-
vertices
public RPoint[] vertices
Array of RPoint objects holding the vertices of the strip.
-
-
Constructor Detail
-
RStrip
public RStrip(RStrip s)
Use this method to create a new strip.- Parameters:
s
- the object of which to make a copy
-
RStrip
public RStrip()
-
-
Method Detail
-
countVertices
public int countVertices()
Use this method to count the number of vertices in the strip.- Returns:
- int, the number vertices in the strip
-
draw
public void draw(processing.core.PGraphics g)
Use this method to draw the strip.- Parameters:
g
- PGraphics, the graphics object on which to draw the strip
-
addVertex
public void addVertex(RPoint p)
Use this method to add new vertices to the strip.
-
addVertex
public void addVertex(float x, float y)
-
getBounds
public RContour getBounds()
Use this method to get the bounding box of the strip.- Returns:
- RContour, the bounding box of the strip in the form of a four-point contour
-
getHandles
public RPoint[] getHandles()
Use this to get the vertices of the strip. It returns the points as an array of RPoint.- Returns:
- RPoint[], the vertices returned in an array.
-
getPoints
public RPoint[] getPoints()
Use this to get the vertices of the strip. It returns the points as an array of RPoint.- Returns:
- RPoint[], the vertices returned in an array.
-
transform
public void transform(RMatrix m)
Use this method to transform the strip.- Parameters:
m
- RMatrix, the matrix of the affine transformation to apply to the strip
-
-