|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectgeomerative.RGeomElem
geomerative.RCommand
public class RCommand
Field Summary | |
---|---|
static int |
ADAPTATIVE
|
RPoint[] |
controlPoints
|
static int |
CUBICBEZIERTO
|
RPoint |
endPoint
|
static int |
LINETO
|
static int |
QUADBEZIERTO
|
static float |
segmentAngleTol
|
static int |
segmentType
|
RPoint |
startPoint
|
int |
type
|
static int |
UNIFORMLENGTH
|
static int |
UNIFORMSTEP
|
Fields inherited from class geomerative.RGeomElem |
---|
COMMAND, CONTOUR, GROUP, height, MESH, name, POLYGON, SHAPE, SUBSHAPE, TRISTRIP, UNKNOWN, width |
Constructor Summary | |
---|---|
RCommand()
Create an empty command |
|
RCommand(float spx,
float spy,
float epx,
float epy)
Create a LINETO command object with specific start and end point coordinates. |
|
RCommand(float spx,
float spy,
float cp1x,
float cp1y,
float epx,
float epy)
Create a QUADBEZIERTO command object with specific start, control and end point coordinates. |
|
RCommand(float spx,
float spy,
float cp1x,
float cp1y,
float cp2x,
float cp2y,
float epx,
float epy)
Create a CUBICBEZIERTO command object with specific start, controls and end point coordinates. |
|
RCommand(RCommand c)
Make a copy of another RCommand object. |
|
RCommand(RCommand c,
RPoint sp)
Make a copy of another RCommand object with a specific start point. |
|
RCommand(RPoint sp,
RPoint ep)
Create a LINETO command object with specific start and end points. |
|
RCommand(RPoint sp,
RPoint cp1,
RPoint ep)
Create a QUADBEZIERTO command object with specific start, control and end points. |
|
RCommand(RPoint sp,
RPoint cp1,
RPoint cp2,
RPoint ep)
Create a CUBICBEZIERTO command object with specific start, controls and end point coordinates. |
Method Summary | |
---|---|
static float |
closestAdvFrom(RCommand c,
RPoint p)
|
RClosest |
closestPoints(RCommand other)
|
boolean |
contains(RPoint p)
|
int |
countControlPoints()
Use this to return the number of control points of the curve. |
static RClosest |
cubicCubicClosest(RCommand c1,
RCommand c2)
|
static RPoint[] |
cubicCubicIntersection(RCommand c1,
RCommand c2)
|
void |
draw(processing.core.PApplet a)
Use this method to draw the command. |
void |
draw(processing.core.PGraphics g)
Use this method to draw the command. |
int |
getCommandType()
Use this to return the command type. |
float |
getCurveLength()
Use this to return arc length of a curve. |
float |
getCurveLength(float t)
Use this to return arc length of a curve. |
RPoint[] |
getHandles()
Use this to return the start, control and end points of the curve. |
RPoint[][] |
getHandlesInPaths()
|
RPoint |
getPoint(float t)
Use this to return a specific point on the curve. |
RPoint[] |
getPoints()
Use this to return the points on the curve. |
RPoint[][] |
getPointsInPaths()
|
RPoint |
getTangent(float t)
Use this to return a specific tangent on the curve. |
RPoint[] |
getTangents()
|
RPoint[] |
getTangents(int segments)
Use this to return the tangents on the curve. |
RPoint[][] |
getTangentsInPaths()
|
int |
getType()
|
RPoint[] |
intersectionPoints(RCommand other)
|
static RClosest |
lineCubicClosest(RCommand c1,
RCommand c2)
|
static RPoint[] |
lineCubicIntersection(RCommand c1,
RCommand c2)
|
static RClosest |
lineLineClosest(RCommand c1,
RCommand c2)
|
static RPoint[] |
lineLineIntersection(RCommand c1,
RCommand c2)
|
static RClosest |
lineQuadClosest(RCommand c1,
RCommand c2)
|
static RPoint[] |
lineQuadIntersection(RCommand c1,
RCommand c2)
|
static RClosest |
quadCubicClosest(RCommand c1,
RCommand c2)
|
static RPoint[] |
quadCubicIntersection(RCommand c1,
RCommand c2)
|
static RClosest |
quadQuadClosest(RCommand c1,
RCommand c2)
|
static RPoint[] |
quadQuadIntersection(RCommand c1,
RCommand c2)
|
static void |
setSegmentAngle(float segmentAngleTolerance)
Use this to set the segmentator angle tolerance for the ADAPTATIVE segmentator and set the segmentator to ADAPTATIVE. |
static void |
setSegmentator(int segmentatorType)
Use this to set the segmentator type. |
static void |
setSegmentGraphic(processing.core.PGraphics g)
Use this to set the segmentator graphic context. |
static void |
setSegmentLength(float segmentLngth)
Use this to set the segmentator length for the UNIFORMLENGTH segmentator and set the segmentator to UNIFORMLENGTH. |
static void |
setSegmentOffset(float segmentOffst)
Use this to set the segmentator offset for the UNIFORMLENGTH segmentator and set the segmentator to UNIFORMLENGTH. |
static void |
setSegmentStep(float segmentStps)
Use this to set the segmentator step for the UNIFORMSTEP segmentator and set the segmentator to UNIFORMSTEP. |
RCommand[] |
split(float t)
Returns two commands resulting of splitting the command. |
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, 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, toMesh, toPolygon, transform, 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 RPoint[] controlPoints
public RPoint startPoint
public RPoint endPoint
public static final int LINETO
public static final int QUADBEZIERTO
public static final int CUBICBEZIERTO
public static final int ADAPTATIVE
public static final int UNIFORMLENGTH
public static final int UNIFORMSTEP
public static int segmentType
public static float segmentAngleTol
Constructor Detail |
---|
public RCommand()
public RCommand(RCommand c)
c
- the object of which to make the copypublic RCommand(RCommand c, RPoint sp)
c
- the object of which to make the copysp
- the start point of the command to be createdpublic RCommand(RPoint sp, RPoint ep)
sp
- the start point of the command to be createdep
- the end point of the command to be createdpublic RCommand(float spx, float spy, float epx, float epy)
spx
- the x coordinate of the start point of the command to be createdspy
- the y coordinate of the start point of the command to be createdepx
- the x coordinate of the end point of the command to be createdepy
- the y coordinate of the end point of the command to be createdpublic RCommand(RPoint sp, RPoint cp1, RPoint ep)
sp
- the start point of the command to be createdcp1
- the first control point of the command to be createdep
- the end point of the command to be createdpublic RCommand(float spx, float spy, float cp1x, float cp1y, float epx, float epy)
spx
- the x coordinate of the start point of the command to be createdspy
- the y coordinate of the start point of the command to be createdcp1x
- the x coordinate of the first control point of the command to be createdcp1y
- the y coordinate of the first control point of the command to be createdepx
- the x coordinate of the end point of the command to be createdepy
- the y coordinate of the end point of the command to be createdpublic RCommand(RPoint sp, RPoint cp1, RPoint cp2, RPoint ep)
sp
- the start point of the command to be createdcp1
- the first control point of the command to be createdcp2
- the second control point of the command to be createdep
- the end point of the command to be createdpublic RCommand(float spx, float spy, float cp1x, float cp1y, float cp2x, float cp2y, float epx, float epy)
spx
- the x coordinate of the start point of the command to be createdspy
- the y coordinate of the start point of the command to be createdcp1x
- the x coordinate of the first control point of the command to be createdcp1y
- the y coordinate of the first control point of the command to be createdcp2x
- the x coordinate of the second control point of the command to be createdcp2y
- the y coordinate of the second control point of the command to be createdepx
- the x coordinate of the end point of the command to be createdepy
- the y coordinate of the end point of the command to be createdMethod Detail |
---|
public RShape toShape()
toShape
in class RGeomElem
public int getType()
getType
in class RGeomElem
public static void setSegmentator(int segmentatorType)
public static void setSegmentGraphic(processing.core.PGraphics g)
g
- graphics object too which to adapt the segmentation of the command.public static void setSegmentAngle(float segmentAngleTolerance)
segmentAngleTolerance
- an angle from 0 to PI/2 it defines the maximum angle between segments.public static void setSegmentLength(float segmentLngth)
segmentLngth
- the length of each resulting segment.public static void setSegmentOffset(float segmentOffst)
segmentOffst
- the offset of the first point on the path.public static void setSegmentStep(float segmentStps)
segmentStps
- if a float from +0.0 to 1.0 is passed it's considered as the step, else it's considered as the number of steps. When a value of 0.0 is used the steps will be calculated automatically depending on an estimation of the length of the curve. The special value -1 is the same as 0.0 but also turning of the segmentation of lines (faster segmentation).public int countControlPoints()
public int getCommandType()
public RPoint[] getPoints()
getPoints
in class RGeomElem
public RPoint getPoint(float t)
getPoint
in class RGeomElem
t
- float, the parameter of advancement on the curve. t must have values between 0 and 1.
public RPoint[] getTangents(int segments)
segments
- int, the number of segments in which to divide the curve.
public RPoint[] getTangents()
getTangents
in class RGeomElem
public RPoint getTangent(float t)
getTangent
in class RGeomElem
t
- float, the parameter of advancement on the curve. t must have values between 0 and 1.
public float getCurveLength(float t)
t
- float, the parameter of advancement on the curve. t must have values between 0 and 1.
public float getCurveLength()
getCurveLength
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 void draw(processing.core.PGraphics g)
draw
in class RGeomElem
g
- PGraphics, the graphics object on which to draw the commandpublic void draw(processing.core.PApplet a)
draw
in class RGeomElem
a
- the applet object on which to draw the commandpublic RPoint[] getHandles()
getHandles
in class RGeomElem
public RCommand[] split(float t)
t
- the advancement on the curve where command should be splitted.
public RPoint[] intersectionPoints(RCommand other)
public static RPoint[] lineLineIntersection(RCommand c1, RCommand c2)
public static RPoint[] lineQuadIntersection(RCommand c1, RCommand c2)
public static RPoint[] lineCubicIntersection(RCommand c1, RCommand c2)
public static RPoint[] quadQuadIntersection(RCommand c1, RCommand c2)
public static RPoint[] quadCubicIntersection(RCommand c1, RCommand c2)
public static RPoint[] cubicCubicIntersection(RCommand c1, RCommand c2)
public RClosest closestPoints(RCommand other)
public static float closestAdvFrom(RCommand c, RPoint p)
public static RClosest lineLineClosest(RCommand c1, RCommand c2)
public static RClosest lineQuadClosest(RCommand c1, RCommand c2)
public static RClosest lineCubicClosest(RCommand c1, RCommand c2)
public static RClosest quadQuadClosest(RCommand c1, RCommand c2)
public static RClosest quadCubicClosest(RCommand c1, RCommand c2)
public static RClosest cubicCubicClosest(RCommand c1, RCommand c2)
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |