Class PACurveMaker
- All Implemented Interfaces:
PAGesture
PACurveMaker is a utility and storage class for gestures and curve modeling, with
point reduction and drawing to on-screen PApplets or off-screen PGraphics. It implements
PAGesture and provides a pair of data structures, dragPoints and dragTimes,
that together capture gestures made with a mouse or similar input device. It is
a core component of the PixelAudio library.
Each point in dragPoints is associated with a corresponding time in dragTimes.
You can use PACurveMaker for data storage in interactive drawing applications, or
implement your own storage with just the features you require. It is a key
data structure for playing digital audio instruments using granular synthesis and sampling
in the net.paulhertz.pixelaudio.granular and net.paulhertz.pixelaudio.sampler packages.
PACUrveMaker makes extensive use of static methods in PACurveUtility and provides
a wide range of graphic objects and properties for dense point arrays,
reduced point arrays, derived Bezier curves (weighted and not weighted),
brushstroke Bezier shapes for drawing to the display, and brushstroke polygons
for point testing with PABezShape.pointInPoly(). It provides some basic timing
data associated with drawing to the screen. You can use PACurveUtility
for drawing all PACurveMaker data formats or you can use the built-in
commands if you use PACurveMaker as a storage class.
PACurveMaker's factory methods take as their principal argument a list of PVectors, dragPoints,
a list of time offsets in milliseconds, dragTimes, and an absolute time in milliseconds, startTimeMs.
The list of points is typically derived from a line drawn by dragging the mouse across the application
window. This line is stored in dragPoints and can be accessed with getDragPoints() or getAllPoints().
dragPoints can be mutated with mutateAllPoints(), preserving its cardinality.
The dense point set in dragPoints can be processed by the
Ramer-Douglas-Peucker algorithm
to derive a a reduced point set, rdpPoints. The algorithm is implemented in PACUrveUtilities. The reduced points
can be turned into a Bezier path, curveShape, where each point in rdpPoints becomes an anchor point
in curveShape. Bezier paths are modeled using PixelAudio's PABezShape class, which includes methods
for drawing attributes, affine transforms, and point testing. For display and interaction, a brushstroke
shape, brushShape, can be created from the curve. An array of PVectors,
eventPoints, can be created from curveShape to facilitate timed event-staging along the curve.
Another array of PVectors, brushPoly, can be used to test points with #PABezShape.pointInPoly().
Each of the geometric data objects--dragPoints, rdpPoints, curveShape, and brushShape--has a method for drawing to the screen in a PApplet or drawing offscreen in a PGraphic. DragPoints and rdpPoints keep their drawing parameters (fill, stroke, weight) in PACurveMaker variables. PABezShapes like curveShape and brushShape can store drawing parameters internally.
There are several properties of PACurveMaker that can affect the appearance of curves. The
value of epsilon determines how closely the reduced point set in rdpPoints
matches the dense point set in dragPoints. Smaller values, down to 1.0, yield a
reduced point set with more points and greater precision. Some of the factory methods allow
you to supply your own value for epsilon, which defaults to 8.0. Weighted curves and
brushstrokes are variations on the smooth Bezier curves that PACurveMaker generates by
default. In the default curves, the rate of change in curvature is the same on either side of
a Bezier anchor point. The weighted curves use a value, bezierBias, to adjust the control
points. The default bias value, PABezShape.LAMBDA, may provide a closer approximation to
rdpPoints. Other values can create extreme curves. It's worth some experimentation. If you
call setDrawWeighted(boolean) with a value of true and then call
calculateDerivedPoints(), curveShape and brushShape will be generated as weighted
Bezier curves. There are several calls to generate weighted Bezier curves. They do not set
local variables, but can be useful for exploring the variations created by different values
of bezierBias. PACurveUtility can also create weighted curves.
eventPoints is a List<PVector> derived from the gestural points captured
during user interaction. dragPoints is reduced to rdpPoints. rdpPoints
is used to derive the Bezier path (PABezShape) curveShape. The polyline representation
of curveShape is eventPoints, where display events tied to the curve can be located.
To reduce confusion, I have created some alias methods in PACurveMaker:
// Alias method for getDragPoints().
public ArrayList<PVector> getAllPoints() {
return this.getDragPoints();
}
// Alias for getRdpPoints().
public ArrayList<PVector> getReducedPoints() {
return getRdpPoints();
}
// Sets epsilon and returns the reduced point set, this.rdpPoints
public ArrayList<PVector> getReducedPoints(float epsilon) {
if (this.epsilon != epsilon || rdpPoints.size() < 1) {
this.setEpsilon(epsilon);
calculateDerivedPoints();
}
return rdpPoints;
}
// Alias for getCurveShape().
public PABezShape getCurve() {
return this.getCurveShape();
}
// Alias for getEventPoints().
public ArrayList<PVector> getCurvePoints() {
return this.getEventPoints();
}
// Alias for getEventPoints(int eventSteps).
public ArrayList<PVector> getCurvePoints(int curveSteps) {
return this.getEventPoints(curveSteps);
}
// Alias for eventSteps
public int getCurveSteps() {
return this.eventSteps;
}
In addition, I note that the primary point sets in PACUrveMaker are dragPoints (getAllPoints()),
rdpPoints (getCurvePoints()), and eventPoints (getCurvePoints()). The full
gesture is conveyed by dragPoints and dragTimes. The indices of rdpPoints are tracked
and stored in ArrayList<Integer> rdpIndices, so that we can map back to the original gesture points
if needed. The points in rdpPoints are also the anchor points in the Bezier path curveShape,
produced from curveShape = PACurveUtility.calculateCurve(rdpPoints);.
public int[] getReducedTimes() {
int[] timeIndices = getRdpIndicesAsInts();
int[] rdpTimes = new int[timeIndices.length];
// the first value in dragTimes is a time stamp, all following numbers are offsets
// one for each point in dragPoints. We only need the offsets.
int[] allTimes = this.getDragOffsetsAsInts();
for (int i = 0; i < timeIndices.length; i++) {
rdpTimes[i] = allTimes[timeIndices[i]];
}
return rdpTimes;
}
Changing epsilon will change the reduced point set, and thus the Bezier curve and event points. rdpIndices must
be recalculated whenever epsilon is changed. This is done in PACurveMaker.calculateDerivedPoints(), which
is called from setEpsilon() and public ArrayList<PVector> getReducedPoints(float epsilon) The new reduced
point time set can be derived from rdpIndices when needed.
NOTES 2025.12.23
As much as possible, PACurveMaker now relies on lazy initialization, though end user can initialize all geometry up from with calculateDerivedPoints(). I have also introduced the interface PAGesture, to clarify how PACurveMaker structures originate in capture gestures from a GUI or other source. A gesture is constructed from
- a list of points and
- a list of time offsets where
- both lists have the same cardinality and
- time offsets increase monotonically. In addition,
- the time list is expected (but not required) to start with a first element 0.
GestureSchedule provides some static methods to help enforce the invariants of gestures.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceSimple Processing-friendly callback interface. -
Field Summary
FieldsModifier and TypeFieldDescriptionintColor for highlighted brush stroke, stored in brushShapeprivate floatA weight applied to calculations of the control points for Bezier curvesintColor for simulated brushstroke fill and stroke, stored in brushShapebooleanusing a custom brush shapeprivate ArrayList<processing.core.PVector>polygon representation of brushShape, for point testing, etc.private PABezShapeA simulated brush stroke derived from curveShape, a closed shape rather than a curved linefloatThe distance in pixels between the edges of the brush stroke, double the distance from the central linefloatweight of stroke for brushStroke, set to 0 for no strokeintColor for Bezier curve derived from drawPoints, stored in bezPoints or weightedBezPointsprivate PABezShapeA path composed of Bezier curves and lines, a continuous curved line derived from rdpPointsfloatweight of curved line curveShapeprivate booleanreduced points changed OR brush params changedprivate booleanbrushShape changed OR polySteps changedprivate booleanreduced points changedprivate booleancurve points changed OR curveSteps changedprivate booleanepsilon changed OR allPoints changedintboolean value that determines whether curve and brush shapes are weightedprivate ArrayList<processing.core.PVector>List of non-repeating points that need to be reduced, typically from a UI gesture such as dragging a mouse, optical flow of a video image, flocks of boids, etc.private int[]List of time data: first element is expected to be 0 and the remaining elements are non-decreasing offsets in millis from the first element.(package private) float[]Cache for float[] version of dragTimesfloatweight of lines drawn between PVectors in allPointsprivate floatA parameter to control the amount of reduction in the RDP algorithmprivate ArrayList<processing.core.PVector>List of points where events such as audio samples can be triggered, derived from the polygon representation of curveShape, accessed with getEventPoints() or getCurvePoints()intcolor of eventPoints markersfloatsize of eventPoints markersintnumber of steps along a polygonized curve, used to produce eventPoints from curveShapebooleanboolean to determine if bezierBias, "weight", is applied to curve calculationsintnumber of steps along a polygonized brushstroke shape, used to produce brushPolyintColor for points reduced by RDP algorithm, stored in drawPointslist of indices of points in dragPoints captured for rdpPointsprivate ArrayList<processing.core.PVector>The reduced points returned by the RDP algorithmfloatweight of lines drawn between PVectors in drawPointsintTime of mouseReleased event, in milliseconds elapsed since timeStampintTime when CurveMaker instance was initialized by mousePressed event, in milliseconds since application startup -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivatePACurveMaker(List<processing.core.PVector> dragPoints, List<Integer> dragTimes, int startTimeMs) Constructor for PACurveMaker, called by all factory methods. -
Method Summary
Modifier and TypeMethodDescriptionvoidApplies a transform state to this curve.voidbrushDraw(processing.core.PApplet parent) Draws the stored brushShape to a PApplet using local properties this.brushColor, this.brushColor, this.brushWeight.voidbrushDraw(processing.core.PApplet parent, int brushColor, int strokeColor, float brushWeight) Draws the stored brushShape to a PApplet using supplied fill color, stroke color, and weight.voidbrushDraw(processing.core.PGraphics pg) Draws the stored brushShape to an offscreen PGraphics using local properties this.brushColor, this.brushColor, this.brushWeight.voidbrushDraw(processing.core.PGraphics pg, int brushColor, int strokeColor, float brushWeight) Draws the stored brushShape to an offscreen PGraphics using supplied fill color, stroke color, and weight.voidbrushDrawDirect(processing.core.PApplet parent) Draws the stored brush shape to a PApplet using its properties as a PABezShape.voidbrushDrawDirect(processing.core.PGraphics pg) Draws the stored brush shape to an offscreen PGraphics using its properties as a PABezShape.buildBrushShape(ArrayList<processing.core.PVector> knotPoints) static PACurveMakerbuildCurveMaker(ArrayList<processing.core.PVector> dragPoints) This factory method can be used when you are only using the curve modeling features of PACurveMaker.static PACurveMakerbuildCurveMaker(ArrayList<processing.core.PVector> dragPoints, float epsilon) This factory method can be used when you are only using the curve modeling features of PACurveMaker.static PACurveMakerbuildCurveMaker(ArrayList<processing.core.PVector> points, float epsilon, float brushSize, int brushColor) This factory method can be used when you are only using the curve modeling features of PACurveMaker.static PACurveMakerbuildCurveMaker(List<processing.core.PVector> dragPoints, List<Integer> dragTimes, int startTimeMs) static PACurveMakerbuildCurveMaker(List<processing.core.PVector> dragPoints, List<Integer> dragTimes, int startTimeMs, float epsilon) static PACurveMakerbuildCurveMaker(List<processing.core.PVector> dragPoints, List<Integer> dragTimes, int startTimeMs, float epsilon, float brushSize, int brushColor) static PACurveMakerbuildCurveMaker(List<processing.core.PVector> dragPoints, List<Integer> dragTimes, int startTimeMs, float epsilon, int dragColor, float dragWeight, int rdpColor, float rdpWeight, int curveColor, float curveWeight, int brushColor, float brushWeight, int activeBrushColor) Creates a PACurveMaker instance set up for lazy initialization.voidCalculates rdpPoints, curveShape, eventPoints, brushShape and brushPoly.voidSets brushIsCustom to false, prepares rebuild of brush from curveShapeArrayList<processing.core.PVector>Returns a copy of points in dragPoints, the original dense point set captured from a gesture.Copies the current dragPoints into a new GestureTransformState as restPoints.voidcurveDraw(processing.core.PApplet parent) Draws a Bezier curve using the 2D Bezier curve data in this.curveShape and the current values of this.curveColor and this.curveWeight.voidcurveDraw(processing.core.PGraphics pg) Draws a Bezier curve using the 2D Bezier curve data in this.curveShape and the current values of this.curveColor and this.curveWeight.voidcurveDrawDirect(processing.core.PApplet parent) Draws a Bezier curve using local drawing properties of curveShape.voidcurveDrawDirect(processing.core.PGraphics pg) Draws a Bezier curve using local drawing properties of this.curveShape as a PABezShape.Returns a string with information about the curve, including values of epsilon, curveSteps, polySteps, timeOffset, and counts of drag points, drag times, reduced points, and curve points.voiddragPointsDraw(processing.core.PApplet parent) Draws a line using the PVector data in allPoints and the current values of this.dragColor and this.dragWeight.voiddragPointsDraw(processing.core.PApplet parent, int lineColor, float lineWeight) Draws a line using the PVector data in dragPoints and a supplied color.voiddragPointsDraw(processing.core.PGraphics pg) Draws dragPoints to a PGraphics using local color and weight, this.dragColor and this.dragWeight.voiddragPointsDraw(processing.core.PGraphics pg, int lineColor, float lineWeight) Draws dragPoints to a PGraphics using supplied color and weight.private voidEnsures that the brush shape is calculated and up-to-date.private voidEnsures that the brush polygon is calculated and up-to-date.private voidEnsures that the curve is calculated and up-to-date.private voidEnsures that the event points are calculated and up-to-date.private voidEnsures that the reduced point set is up to date.voideventPointsDraw(processing.core.PApplet parent) Draws this.eventPoints to a PApplet as circles using local properties this.eventPointsColor and this.eventPointsSize.voideventPointsDraw(processing.core.PApplet parent, int eventPointsColor, float eventPointsSize) Draws this.eventPoints to a PApplet as circles using supplied properties eventPointsColor and eventPointsSize.voideventPointsDraw(processing.core.PApplet parent, int eventSteps, int eventPointsColor, float eventPointsSize) Draws this.eventPoints to a PApplet as circles using supplied properties eventPointsSteps, eventPointsColor and eventPointsSize.voideventPointsDraw(processing.core.PGraphics pg) Draws this.eventPoints to an offscreen PGraphics as circles using local properties this.eventPointsColor and this.eventPointsSize.voideventPointsDraw(processing.core.PGraphics pg, int eventPointsColor, float eventPointsSize) Draws this.eventPoints to an offscreen PGraphics as circles using supplied properties eventPointsColor and eventPointsSize.voideventPointsDraw(processing.core.PGraphics pg, int eventSteps, int eventPointsColor, float eventPointsSize) Draws this.eventPoints to an offscreen PGraphics as circles using supplied properties eventPointsSteps, eventPointsColor and eventPointsSize.intArrayList<processing.core.PVector>Alias method for getDragPoints().Returns the schedule for all points in the gesture.int[]getAllTimes() is a convenient alias for getDragTimes()floatReturns the bias value for adjusting distances between Bezier anchor points and control points.intArrayList<processing.core.PVector>Returns a list of points that comprise a closed polygonal shape that closely folllows the brushstroke.Returns a PABezShape that looks like a brushstroke, created by expanding curveShape, an open Bezier path, into a closed Bezier path.floatReturns the size of the brush in pixels.floatgetCurve()Alias for getCurveShape().intArrayList<processing.core.PVector>Alias for getEventPoints().ArrayList<processing.core.PVector>getCurvePoints(int curveSteps) Alias for getEventPoints(int curveSteps).getCurveSchedule(float epsilon, int curveSteps, boolean arcLengthTime) Returns the schedule for the points along a polyline approximation of the Bezier curve derived from the reduced point set.Returns a PABezShape for the curved line derived from the reduced point set.intAlias for getEventSteps()floatintArrayList<processing.core.PVector>Returns a copy of points in dragPoints, the original dense point set captured from a gesture.int[]floatfloatArrayList<processing.core.PVector>Returns the points along along a polyline approximation of the Bezier pathcurveShape, derived from the reduced point set.ArrayList<processing.core.PVector>getEventPoints(int eventSteps) intfloatintReturns the number of segments in each curve for a polygonal approximation of Bezier pathcurveShape.intReturns the number of divisions of each Bezier curve in the polygonal representation of brushShape.intReturns the indices of the reduced points in the original dragPoints list.int[]Returns the indices of the reduced points in the original dragPoints list as an array of integers.ArrayList<processing.core.PVector>Returns the reduced point set for this PACurveMaker.floatArrayList<processing.core.PVector>Alias for getReducedPoints(this.epsilon).ArrayList<processing.core.PVector>getReducedPoints(float epsilon) Sets epsilon and returns the reduced point set, this.rdpPointsgetReducedSchedule(float epsilon) Returns the schedule for the reduced points in the gesture.int[]Returns the reduced time data for the gesture.longAlias for getTimeStamp()intReturns the time offset for the gesture, typically the time in milliseconds between thetimeStampand the end of the gesture: the duration of the gesture in milliseconds.float[]Returns time offsets as floats.intReturns the timestamp for the gesture.getWeightedBrushShape(float brushSize, float bias) Returns a PABezShape for the weighted curve derived from the reduced point set.getWeightedCurveShape(float bias) Calculates a PABezSHape with distances between control points and anchor points adjusted by bezierBias.booleanReturns whether weighted Bezier curves are drawn.booleanisReady()Checks whether the cached geometry is up to date.voidCall after mutating dragPoints contents or order (or changing dragTimes length).voidCall after changing brush size/weighting/bias.voidCall after changing only curveSteps/eventSteps.voidCall after changing only epsilon-sensitive state (typically point geometry changed).voidMutate the live dragPoints list (and/or its PVectors) and automatically mark cached geometry as dirty afterward.private static int[]normalizeOffsets(int[] t) voidreducedPointsDraw(processing.core.PApplet parent) Draws a line using the PVector data in rdpPoints and the current values of this.rdpColor and this.rdpWeight.voidreducedPointsDraw(processing.core.PApplet parent, int lineColor, float lineWeight) Draws a line using the PVector data in drawPoints, the reduced point set derived from allPoints.voidreducedPointsDraw(processing.core.PGraphics pg) Draws drawPoints to a PGraphics using current values of this.rdpColor and this.rdpWeight.voidreducedPointsDraw(processing.core.PGraphics pg, int lineColor, float lineWeight) Draws rdpPoints to a PGraphics using supplied color and weight.private voidreducePoints(float epsilon) Takes the list of points in allPoints and generates a reduced list in drawPoints.voidRestores this curve from a transform state's rest pose, if present.voidsetActiveBrushColor(int activeBrushColor) voidsetBezierBias(float bias) Sets the bias value for adjusting distances between Bezier anchor points and control points.voidsetBrushColor(int brushColor) voidsetBrushSize(float newSize) Set the distance in pixels between opposite edges of a brushstroke.voidsetBrushWeight(float brushWeight) voidsetCurveColor(int curveColor) voidsetCurveSteps(int curveSteps) Alias for setEventSteps(int).voidsetCurveWeight(float curveWeight) voidsetCustomBrushShape(PABezShape customBrushShape) Replaces the closed PABezShape "brushstroke" with a shape of your own choosing.voidsetDragColor(int dragColor) voidsetDragPoints(ArrayList<processing.core.PVector> dragPoints) Deprecated.voidsetDragTimes(int[] dragTimes) Sets the list of time data for the gesture captured by dragPoints.voidsetDragTimes(List<Integer> dragTimes) Sets the list of time data for the gesture captured by dragPoints.voidsetDragWeight(float dragWeight) voidsetDrawingProperties(int dragColor, float dragWeight, int rdpColor, float rdpWeight, int curveColor, float curveWeight, int brushColor, float brushWeight, int activeBrushColor) Sets various properties used for drawing PACurveMaker graphics.voidsetDrawWeighted(boolean drawBiased) Flag whether to draw weighted Bezier curves, displacing control points from the anchor by a specified bias, bezierBias.voidsetEpsilon(float eps) Sets value of variable epsilon, used in reduced point set calculations.voidsetEventPointsColor(int eventPointsColor) voidsetEventPointsSize(float eventPointsSize) voidsetEventSteps(int steps) If eventPoints is null or if eventSteps differs from the old value, sets a new value for eventSteps and calculates eventPoints.voidsetPolySteps(int steps) Sets the number of divisions of each Bezier curve in the polygonal representation of brushShape.voidsetRdpColor(int rdpColor) voidsetRdpIndices(ArrayList<Integer> rdpIndices) Deprecated.voidsetRdpPoints(ArrayList<processing.core.PVector> rdpPoints) Deprecated.voidsetRdpWeight(float rdpWeight) voidsetTimeOffset(int timeOffset) Sets the time offset for the gesture, typically the time in milliseconds between thetimeStampand the end of the gesture: the duration of the gesture in milliseconds.voidsetTimeStamp(int timeStamp) Sets the timestamp for the gesture.
-
Field Details
-
dragPoints
List of non-repeating points that need to be reduced, typically from a UI gesture such as dragging a mouse, optical flow of a video image, flocks of boids, etc. -
rdpPoints
The reduced points returned by the RDP algorithm -
rdpIndices
list of indices of points in dragPoints captured for rdpPoints -
epsilon
private float epsilonA parameter to control the amount of reduction in the RDP algorithm -
curveShape
A path composed of Bezier curves and lines, a continuous curved line derived from rdpPoints -
eventPoints
List of points where events such as audio samples can be triggered, derived from the polygon representation of curveShape, accessed with getEventPoints() or getCurvePoints() -
eventSteps
public int eventStepsnumber of steps along a polygonized curve, used to produce eventPoints from curveShape -
brushShape
A simulated brush stroke derived from curveShape, a closed shape rather than a curved line -
brushPoly
polygon representation of brushShape, for point testing, etc. -
polySteps
public int polyStepsnumber of steps along a polygonized brushstroke shape, used to produce brushPoly -
timeStamp
public int timeStampTime when CurveMaker instance was initialized by mousePressed event, in milliseconds since application startup -
timeOffset
public int timeOffsetTime of mouseReleased event, in milliseconds elapsed since timeStamp -
dragTimes
private int[] dragTimesList of time data: first element is expected to be 0 and the remaining elements are non-decreasing offsets in millis from the first element. -
dragTimesFloat
float[] dragTimesFloatCache for float[] version of dragTimes -
isDrawWeighted
public boolean isDrawWeightedboolean to determine if bezierBias, "weight", is applied to curve calculations -
bezierBias
private float bezierBiasA weight applied to calculations of the control points for Bezier curves -
brushSize
public float brushSizeThe distance in pixels between the edges of the brush stroke, double the distance from the central line -
dragColor
public int dragColorboolean value that determines whether curve and brush shapes are weighted -
dragWeight
public float dragWeightweight of lines drawn between PVectors in allPoints -
rdpColor
public int rdpColorColor for points reduced by RDP algorithm, stored in drawPoints -
rdpWeight
public float rdpWeightweight of lines drawn between PVectors in drawPoints -
curveColor
public int curveColorColor for Bezier curve derived from drawPoints, stored in bezPoints or weightedBezPoints -
curveWeight
public float curveWeightweight of curved line curveShape -
brushColor
public int brushColorColor for simulated brushstroke fill and stroke, stored in brushShape -
activeBrushColor
public int activeBrushColorColor for highlighted brush stroke, stored in brushShape -
brushWeight
public float brushWeightweight of stroke for brushStroke, set to 0 for no stroke -
eventPointsColor
public int eventPointsColorcolor of eventPoints markers -
eventPointsSize
public float eventPointsSizesize of eventPoints markers -
brushIsCustom
public boolean brushIsCustomusing a custom brush shape -
dirtyReduced
private boolean dirtyReducedepsilon changed OR allPoints changed -
dirtyCurve
private boolean dirtyCurvereduced points changed -
dirtyEvent
private boolean dirtyEventcurve points changed OR curveSteps changed -
dirtyBrush
private boolean dirtyBrushreduced points changed OR brush params changed -
dirtyBrushPoly
private boolean dirtyBrushPolybrushShape changed OR polySteps changed
-
-
Constructor Details
-
PACurveMaker
private PACurveMaker(List<processing.core.PVector> dragPoints, List<Integer> dragTimes, int startTimeMs) Constructor for PACurveMaker, called by all factory methods.- Parameters:
dragPoints- a list of points (PVector) where no two successive points are identicaldragTimes- a list of times in milliseconds, successively offset from first entry of 0startTimeMs- an absolute time in milliseconds, determined by the application, for the gesture to begin
-
-
Method Details
-
buildCurveMaker
public static PACurveMaker buildCurveMaker(List<processing.core.PVector> dragPoints, List<Integer> dragTimes, int startTimeMs) - Parameters:
dragPoints- a list of points (PVector) where no two successive points are identicaldragTimes- a list of times in milliseconds, successively offset from first entry of 0startTimeMs- an absolute time in milliseconds, determined by the application, for the gesture to begin- Returns:
- a PACurveMaker instance, set up for lazy initialization
-
buildCurveMaker
public static PACurveMaker buildCurveMaker(List<processing.core.PVector> dragPoints, List<Integer> dragTimes, int startTimeMs, float epsilon) - Parameters:
dragPoints- a list of points (PVector) where no two successive points are identicaldragTimes- a list of times in milliseconds, successively offset from first entry of 0startTimeMs- an absolute time in milliseconds, determined by the application, for the gesture to beginepsilon- the expected distance between reduced points, lower values typically produce more points- Returns:
- a PACurveMaker instance, set up for lazy initialization
-
buildCurveMaker
public static PACurveMaker buildCurveMaker(List<processing.core.PVector> dragPoints, List<Integer> dragTimes, int startTimeMs, float epsilon, float brushSize, int brushColor) - Parameters:
dragPoints- a list of points (PVector) where no two successive points are identicaldragTimes- a list of times in milliseconds, successively offset from first entry of 0startTimeMs- an absolute time in milliseconds, determined by the application, for the gesture to beginepsilon- the expected distance between reduced points, lower values typically produce more pointsbrushSize- the width in pixels of a simulated brushstroke created from the Bezier path derived from rdpPointsbrushColor- the color assigned to the brushstroke- Returns:
- a PACurveMaker instance, set up for lazy initialization
-
buildCurveMaker
This factory method can be used when you are only using the curve modeling features of PACurveMaker. Entries in the time offsets list dragTimes will be set to 0 and startTimesMs will be set to 0. If you set values for dragTimes and startTimeMs later, dragTimes and dragPoints must be the same size.- Parameters:
dragPoints- a list of points (PVector) where no two successive points are identical- Returns:
- a PACUrveMaker instance
-
buildCurveMaker
public static PACurveMaker buildCurveMaker(ArrayList<processing.core.PVector> dragPoints, float epsilon) This factory method can be used when you are only using the curve modeling features of PACurveMaker. Entries in the time offsets list dragTimes will be set to 0 and startTimesMs will be set to 0. If you set values for dragTimes and startTimeMs later, dragTimes and dragPoints must be the same size.- Parameters:
dragPoints- a list of points (PVector), where no two successive points are identicalepsilon- controls amount of thinning of points to derive the reduced point set rdpPoints from dragPoints- Returns:
- a PACurveMaker instance
-
buildCurveMaker
public static PACurveMaker buildCurveMaker(ArrayList<processing.core.PVector> points, float epsilon, float brushSize, int brushColor) This factory method can be used when you are only using the curve modeling features of PACurveMaker. Entries in the time offsets list dragTimes will be set to 0 and startTimesMs will be set to 0. If you set values for dragTimes and startTimeMs later, dragTimes and dragPoints must be the same size.- Parameters:
points- a list of points (PVector), where no two successive points are identicalepsilon- controls amount of thinning of points to derive the reduced point set rdpPoints from dragPointsbrushSize- the width in pixels of a simulated brushstroke created from the Bezier path derived from rdpPointsbrushColor- the color assigned to the brushstroke- Returns:
- a PACurveMaker instance
-
buildCurveMaker
public static PACurveMaker buildCurveMaker(List<processing.core.PVector> dragPoints, List<Integer> dragTimes, int startTimeMs, float epsilon, int dragColor, float dragWeight, int rdpColor, float rdpWeight, int curveColor, float curveWeight, int brushColor, float brushWeight, int activeBrushColor) Creates a PACurveMaker instance set up for lazy initialization. Sets various properties used for drawing PACurveMaker graphics.- Parameters:
dragPoints-dragTimes-startTimeMs-epsilon-dragColor-dragWeight-rdpColor-rdpWeight-curveColor-curveWeight-brushColor-brushWeight-activeBrushColor-- Returns:
-
setDrawingProperties
public void setDrawingProperties(int dragColor, float dragWeight, int rdpColor, float rdpWeight, int curveColor, float curveWeight, int brushColor, float brushWeight, int activeBrushColor) Sets various properties used for drawing PACurveMaker graphics.- Parameters:
dragColor-dragWeight-rdpColor-rdpWeight-curveColor-curveWeight-brushColor-brushWeight-activeBrushColor-
-
normalizeOffsets
private static int[] normalizeOffsets(int[] t) -
reducePoints
private void reducePoints(float epsilon) Takes the list of points in allPoints and generates a reduced list in drawPoints.- Parameters:
epsilon- controls amount of thinning applied to dragPoints to derive rdpPoints
-
calculateDerivedPoints
public void calculateDerivedPoints()Calculates rdpPoints, curveShape, eventPoints, brushShape and brushPoly. Sets isReady to true on completion. Call calculateDerivedPoints to refresh the drawing objects rdpPoints, curveShape, eventPoints, brushShape, and brushPoly. We can build all the relevant data structures for geometry here, typically on initialization. After that, we can rely on lazy rebuilding, using the "dirty flags". -
isReady
public boolean isReady()Checks whether the cached geometry is up to date. If any of the dirty flags are true, returns false.- Returns:
- true if all cached geometry is up to date, false if any dirty flags are true
-
getDragPoints
Returns a copy of points in dragPoints, the original dense point set captured from a gesture.- Returns:
- ArrayList of PVector, a dense set of points for drawing a line
-
copyAllPoints
Returns a copy of points in dragPoints, the original dense point set captured from a gesture.- Returns:
- ArrayList of PVector, a dense set of points for drawing a line
-
getAllPoints
Alias method for getDragPoints().- Specified by:
getAllPointsin interfacePAGesture- Returns:
- ArrayList of PVector
-
setDragPoints
Deprecated.TODO remove: use mutateAllPoints() to change points. Changes the value of dragPoints and immediately calls calculateDerivedPoints() to refresh all drawing objects.- Parameters:
dragPoints- ArrayList of PVector, a dense set of points for drawing a line
-
mutateAllPoints
Mutate the live dragPoints list (and/or its PVectors) and automatically mark cached geometry as dirty afterward. Typical use: translating/scaling/warping points for animation. IMPORTANT: - If you change the number/order of points, you must also update dragTimes so that (dragTimes.size() == dragPoints.size()). -
createTransformState
Copies the current dragPoints into a new GestureTransformState as restPoints. -
applyTransform
Applies a transform state to this curve. -
restoreTransform
Restores this curve from a transform state's rest pose, if present. -
markDirtyAll
public void markDirtyAll()Call after mutating dragPoints contents or order (or changing dragTimes length). -
markDirtyReduced
public void markDirtyReduced()Call after changing only epsilon-sensitive state (typically point geometry changed). -
markDirtyEventPoints
public void markDirtyEventPoints()Call after changing only curveSteps/eventSteps. -
markDirtyBrush
public void markDirtyBrush()Call after changing brush size/weighting/bias. -
getEpsilon
public float getEpsilon()- Returns:
- the value of epsilon, used to control precision of reduced point set calculations
-
setEpsilon
public void setEpsilon(float eps) Sets value of variable epsilon, used in reduced point set calculations. If the new value is not equal to the old value, will trigger various "dirty flags" to force rebuild of cached values.- Parameters:
eps- value for epsilon
-
getRdpPoints
Returns the reduced point set for this PACurveMaker.- Returns:
- ArrayList of PVector, the reduced point set
-
getReducedPoints
Alias for getReducedPoints(this.epsilon).- Returns:
- a list of PVectors, the reduced point set for this PACurveMaker.
-
getReducedPoints
Sets epsilon and returns the reduced point set, this.rdpPoints- Parameters:
epsilon- parameter for RDP algorithm, determines distance/angle for culling points- Returns:
- a list of PVectors, the reduced point set for this PACurveMaker
-
ensureReduced
private void ensureReduced()Ensures that the reduced point set is up to date. -
setRdpPoints
Deprecated.Sets rdpPoints, generally not something you want to do: let reducePoints() or calculateDerivedPoints() derive rdpPoints from dragPoints instead.- Parameters:
rdpPoints-
-
getRdpIndices
Returns the indices of the reduced points in the original dragPoints list. Can be used to derive the reduced time list from dragTimes when needed.- Returns:
- ArrayList of Integer, the indices of the reduced points
-
getRdpIndicesAsInts
public int[] getRdpIndicesAsInts()Returns the indices of the reduced points in the original dragPoints list as an array of integers.- Returns:
- int[], the indices of the reduced points
-
setRdpIndices
Deprecated.Sets rdpIndices, generally not something you want to do. Call reducePoints() or calculateDerivedPoints instead and stay out of trouble.- Parameters:
rdpIndices-
-
getEventSteps
public int getEventSteps()Returns the number of segments in each curve for a polygonal approximation of Bezier pathcurveShape.- Returns:
- the number of segments for a polygonal approximation of the curve
-
getCurveSteps
public int getCurveSteps()Alias for getEventSteps()- Returns:
- the number of segments for a polygonal approximation of the curve
-
setCurveSteps
public void setCurveSteps(int curveSteps) Alias for setEventSteps(int).- Parameters:
curveSteps-
-
setEventSteps
public void setEventSteps(int steps) If eventPoints is null or if eventSteps differs from the old value, sets a new value for eventSteps and calculates eventPoints.- Parameters:
steps- a new value for eventSteps
-
getEventPoints
Returns the points along along a polyline approximation of the Bezier pathcurveShape, derived from the reduced point set. The number of points is determined by eventSteps.- Returns:
- this.eventPoints, the points along a polyline version of the Bezier curve derived from the reduced point set.
-
getEventPoints
- Parameters:
eventSteps- the number of points along each polyline curve in the PABezShape this.curveShape- Returns:
- this.eventPoints, the points along a polyline version of the Bezier curve derived from the reduced point set.
-
getCurvePoints
Alias for getEventPoints().- Returns:
- this.eventPoints, the points along a polyline version of the Bezier curve derived from the reduced point set.
-
getCurvePoints
Alias for getEventPoints(int curveSteps).- Parameters:
curveSteps-- Returns:
- points along a polyline version of the Bezier curve derived from the reduced point set.
-
ensureEventPoints
private void ensureEventPoints()Ensures that the event points are calculated and up-to-date. -
getCurveShape
Returns a PABezShape for the curved line derived from the reduced point set.- Returns:
- PABezShape for the curved line derived from the reduced point set.
-
getCurve
Alias for getCurveShape().- Returns:
- PABezShape for the curved line derived from the reduced point set.
-
ensureCurve
private void ensureCurve()Ensures that the curve is calculated and up-to-date. -
getWeightedCurveShape
Calculates a PABezSHape with distances between control points and anchor points adjusted by bezierBias. Does not store the returned curve.- Parameters:
bias- a parameter to adjust distances between Bezier anchor points and control points.- Returns:
- a Bezier curve shape whose control points are adjusted using bezierBias.
-
getWeightedCurveShape
Returns a PABezShape for the weighted curve derived from the reduced point set.- Returns:
- a PABezShape for the weighted curve
-
isDrawWeighted
public boolean isDrawWeighted()Returns whether weighted Bezier curves are drawn.- Returns:
- true if weighted Bezier curves are drawn, false otherwise
-
setDrawWeighted
public void setDrawWeighted(boolean drawBiased) Flag whether to draw weighted Bezier curves, displacing control points from the anchor by a specified bias, bezierBias. For example, we use the bias value PABezShape.KAPPA, to draw circles with four equidistant anchor points.- Parameters:
drawBiased-
-
getBezierBias
public float getBezierBias()Returns the bias value for adjusting distances between Bezier anchor points and control points.- Returns:
- the bias value
-
setBezierBias
public void setBezierBias(float bias) Sets the bias value for adjusting distances between Bezier anchor points and control points.- Parameters:
bias- the bias value
-
getBrushSize
public float getBrushSize()Returns the size of the brush in pixels.- Returns:
- the brush size
-
setBrushSize
public void setBrushSize(float newSize) Set the distance in pixels between opposite edges of a brushstroke.- Parameters:
newSize-
-
getBrushShape
Returns a PABezShape that looks like a brushstroke, created by expanding curveShape, an open Bezier path, into a closed Bezier path. Handy for interaction with gesture data. If you replaced the brush with your own PABezShape, you'll get your own shape back.- Returns:
- a PABezShape that looks like a brushstroke, created by expanding curveShape, an open Bezier path, into a closed Bezier path. Handy for interaction with gesture data.
-
ensureBrush
private void ensureBrush()Ensures that the brush shape is calculated and up-to-date. -
getWeightedBrushShape
- Returns:
- a PABezShape modifed by the bezierBias value, equal to PABezShape.LAMBDA by default. Experiment to see how values above and below LAMBDA affect the curves.
-
getWeightedBrushShape
- Parameters:
brushSize-bias-- Returns:
- a PABezShape modifed by the bezierBias value, equal to PABezShape.LAMBDA by default. Experiment to see how values above and below LAMBDA affect the curves.
-
buildBrushShape
- Parameters:
knotPoints- a list of points that will be used to derive anchor points- Returns:
- a closed Bezier path shaped like a stylized brushstroke around the supplied knotPoints
-
setCustomBrushShape
Replaces the closed PABezShape "brushstroke" with a shape of your own choosing. Useful to provide a point of interaction. Rely on dragPoints or curveShape and dragTimes for gestures and timing.- Parameters:
customBrushShape-
-
clearCustomBrushShape
public void clearCustomBrushShape()Sets brushIsCustom to false, prepares rebuild of brush from curveShape -
getBrushPoly
Returns a list of points that comprise a closed polygonal shape that closely folllows the brushstroke.- Returns:
- a list of points that comprise a closed polygonal shape that closely folllows the brushstroke. Useful for point in polygon testing for interaction. If you replaced the brush with your own PABezShape, you'll get a polygonal representation of your own shape.
-
ensureBrushPoly
private void ensureBrushPoly()Ensures that the brush polygon is calculated and up-to-date. -
getPolySteps
public int getPolySteps()Returns the number of divisions of each Bezier curve in the polygonal representation of brushShape.- Returns:
- the number of divisions of each Bezier curve in the polygonal representation of brushShape.
-
setPolySteps
public void setPolySteps(int steps) Sets the number of divisions of each Bezier curve in the polygonal representation of brushShape. If the new value is not equal to the old value, will trigger a rebuild of brushPoly.- Parameters:
steps- the number of divisions of each Bezier curve in the polygonal representation of brushShape. See also setEventSteps().
-
getTimeStamp
public int getTimeStamp()Returns the timestamp for the gesture.- Returns:
- the timestamp
-
setTimeStamp
public void setTimeStamp(int timeStamp) Sets the timestamp for the gesture.- Parameters:
timeStamp- the timestamp
-
getStartTimeMs
public long getStartTimeMs()Alias for getTimeStamp()- Specified by:
getStartTimeMsin interfacePAGesture- Returns:
- absolute gesture start time in milliseconds
-
getTimeOffset
public int getTimeOffset()Returns the time offset for the gesture, typically the time in milliseconds between thetimeStampand the end of the gesture: the duration of the gesture in milliseconds.- Returns:
-
setTimeOffset
public void setTimeOffset(int timeOffset) Sets the time offset for the gesture, typically the time in milliseconds between thetimeStampand the end of the gesture: the duration of the gesture in milliseconds.- Parameters:
timeOffset-
-
getTimeOffsetsMs
public float[] getTimeOffsetsMs()Returns time offsets as floats. First value should be 0, remaining ones are times from 0 in milliseconds.- Specified by:
getTimeOffsetsMsin interfacePAGesture- Returns:
- time offsets as floats. First value should be 0, remaining ones are times from 0 in milliseconds.
-
getDragTimes
public int[] getDragTimes()- Returns:
- the list of time data for the gesture captured by dragPoints: The first offset is expected to be 0 and the remaining elements are offsets in milliseconds.
-
getAllTimes
public int[] getAllTimes()getAllTimes() is a convenient alias for getDragTimes()- Returns:
- a list of time offsets, the first one equal to zero
-
setDragTimes
public void setDragTimes(int[] dragTimes) Sets the list of time data for the gesture captured by dragPoints. The first offset is expected to be 0 and the remaining elements are offsets in milliseconds. The length of dragTimes must match the length of dragPoints.- Parameters:
dragTimes-
-
setDragTimes
Sets the list of time data for the gesture captured by dragPoints.- Parameters:
dragTimes-
-
getReducedTimes
public int[] getReducedTimes()Returns the reduced time data for the gesture. The returned list is the same size as the reduced point set, and contains the time offsets corresponding to the reduced points. The first offset is expected to be 0 and the remaining elements are offsets in milliseconds.- Returns:
- the reduced time data
-
getAllPointsSchedule
Returns the schedule for all points in the gesture.- Specified by:
getAllPointsSchedulein interfacePAGesture- Returns:
- the schedule for all points
-
getReducedSchedule
Returns the schedule for the reduced points in the gesture.- Parameters:
epsilon-- Returns:
-
getCurveSchedule
Returns the schedule for the points along a polyline approximation of the Bezier curve derived from the reduced point set. The number of points is determined by curveSteps.- Parameters:
epsilon-curveSteps-arcLengthTime-- Returns:
-
getDragColor
public int getDragColor() -
setDragColor
public void setDragColor(int dragColor) -
getDragWeight
public float getDragWeight() -
setDragWeight
public void setDragWeight(float dragWeight) -
getRdpColor
public int getRdpColor() -
setRdpColor
public void setRdpColor(int rdpColor) -
getRdpWeight
public float getRdpWeight() -
setRdpWeight
public void setRdpWeight(float rdpWeight) -
getCurveColor
public int getCurveColor() -
setCurveColor
public void setCurveColor(int curveColor) -
getCurveWeight
public float getCurveWeight() -
setCurveWeight
public void setCurveWeight(float curveWeight) -
getBrushColor
public int getBrushColor() -
setBrushColor
public void setBrushColor(int brushColor) -
getBrushWeight
public float getBrushWeight() -
setBrushWeight
public void setBrushWeight(float brushWeight) -
getActiveBrushColor
public int getActiveBrushColor() -
setActiveBrushColor
public void setActiveBrushColor(int activeBrushColor) -
getEventPointsColor
public int getEventPointsColor() -
setEventPointsColor
public void setEventPointsColor(int eventPointsColor) -
getEventPointsSize
public float getEventPointsSize() -
setEventPointsSize
public void setEventPointsSize(float eventPointsSize) -
curveInfo
Returns a string with information about the curve, including values of epsilon, curveSteps, polySteps, timeOffset, and counts of drag points, drag times, reduced points, and curve points.- Returns:
- a string with information about the curve
-
dragPointsDraw
public void dragPointsDraw(processing.core.PApplet parent, int lineColor, float lineWeight) Draws a line using the PVector data in dragPoints and a supplied color.- Parameters:
parent- a PApplet where drawing takes placelineColor- color for the line that is drawn
-
dragPointsDraw
public void dragPointsDraw(processing.core.PApplet parent) Draws a line using the PVector data in allPoints and the current values of this.dragColor and this.dragWeight.- Parameters:
parent- a PApplet where drawing takes place
-
reducedPointsDraw
public void reducedPointsDraw(processing.core.PApplet parent, int lineColor, float lineWeight) Draws a line using the PVector data in drawPoints, the reduced point set derived from allPoints.- Parameters:
parent- a PApplet where drawing takes placelineColor- the color for the line that is drawnlineWeight- the weight of the line that is drawn
-
reducedPointsDraw
public void reducedPointsDraw(processing.core.PApplet parent) Draws a line using the PVector data in rdpPoints and the current values of this.rdpColor and this.rdpWeight.- Parameters:
parent- a PApplet where drawing takes place
-
dragPointsDraw
public void dragPointsDraw(processing.core.PGraphics pg, int lineColor, float lineWeight) Draws dragPoints to a PGraphics using supplied color and weight.- Parameters:
pg- a PGraphics offscreen graphics contextlineColor- color for the line through the dense point setlineWeight- weight (in pixels) of the line through the dense point set
-
dragPointsDraw
public void dragPointsDraw(processing.core.PGraphics pg) Draws dragPoints to a PGraphics using local color and weight, this.dragColor and this.dragWeight.- Parameters:
pg- a PGraphics offscreen graphics context
-
reducedPointsDraw
public void reducedPointsDraw(processing.core.PGraphics pg, int lineColor, float lineWeight) Draws rdpPoints to a PGraphics using supplied color and weight.- Parameters:
pg- a PGraphics offscreen graphics contextlineColor- color for the line through the reduced point setlineWeight- weight (in pixels) of the line through the reduced point set
-
reducedPointsDraw
public void reducedPointsDraw(processing.core.PGraphics pg) Draws drawPoints to a PGraphics using current values of this.rdpColor and this.rdpWeight.- Parameters:
pg- a PGraphics offscreen graphics context
-
curveDraw
public void curveDraw(processing.core.PApplet parent) Draws a Bezier curve using the 2D Bezier curve data in this.curveShape and the current values of this.curveColor and this.curveWeight. The resulting curve will have no fill.- Parameters:
parent- a PApplet instance
-
curveDrawDirect
public void curveDrawDirect(processing.core.PApplet parent) Draws a Bezier curve using local drawing properties of curveShape. If the drawing properties use a fill, the resulting curve will have a fill.- Parameters:
parent- a PApplet instance
-
curveDraw
public void curveDraw(processing.core.PGraphics pg) Draws a Bezier curve using the 2D Bezier curve data in this.curveShape and the current values of this.curveColor and this.curveWeight. The resulting curve will have no fill.- Parameters:
pg- a PGraphics offscreen graphics context
-
curveDrawDirect
public void curveDrawDirect(processing.core.PGraphics pg) Draws a Bezier curve using local drawing properties of this.curveShape as a PABezShape. If the drawing properties use a fill, the resulting curve will have a fill.- Parameters:
pg- a PGraphics offscreen graphics context
-
brushDraw
public void brushDraw(processing.core.PApplet parent, int brushColor, int strokeColor, float brushWeight) Draws the stored brushShape to a PApplet using supplied fill color, stroke color, and weight. If brushWeight == 0, there is no stroke.- Parameters:
parent-brushColor-strokeColor-brushWeight-
-
brushDraw
public void brushDraw(processing.core.PApplet parent) Draws the stored brushShape to a PApplet using local properties this.brushColor, this.brushColor, this.brushWeight.- Parameters:
parent-
-
brushDrawDirect
public void brushDrawDirect(processing.core.PApplet parent) Draws the stored brush shape to a PApplet using its properties as a PABezShape.- Parameters:
parent-
-
brushDraw
public void brushDraw(processing.core.PGraphics pg, int brushColor, int strokeColor, float brushWeight) Draws the stored brushShape to an offscreen PGraphics using supplied fill color, stroke color, and weight. If brushWeight == 0, there is no stroke.- Parameters:
pg-brushColor-strokeColor-brushWeight-
-
brushDraw
public void brushDraw(processing.core.PGraphics pg) Draws the stored brushShape to an offscreen PGraphics using local properties this.brushColor, this.brushColor, this.brushWeight.- Parameters:
pg-
-
brushDrawDirect
public void brushDrawDirect(processing.core.PGraphics pg) Draws the stored brush shape to an offscreen PGraphics using its properties as a PABezShape.- Parameters:
pg- a PGraphics offscreen graphics context
-
eventPointsDraw
public void eventPointsDraw(processing.core.PApplet parent) Draws this.eventPoints to a PApplet as circles using local properties this.eventPointsColor and this.eventPointsSize.- Parameters:
parent-
-
eventPointsDraw
public void eventPointsDraw(processing.core.PApplet parent, int eventPointsColor, float eventPointsSize) Draws this.eventPoints to a PApplet as circles using supplied properties eventPointsColor and eventPointsSize.- Parameters:
parent-eventPointsColor-eventPointsSize-
-
eventPointsDraw
public void eventPointsDraw(processing.core.PApplet parent, int eventSteps, int eventPointsColor, float eventPointsSize) Draws this.eventPoints to a PApplet as circles using supplied properties eventPointsSteps, eventPointsColor and eventPointsSize. EventPointsSteps determines the number of circles. The local value eventPointsSteps is not changed.- Parameters:
parent-eventSteps-eventPointsColor-eventPointsSize-
-
eventPointsDraw
public void eventPointsDraw(processing.core.PGraphics pg) Draws this.eventPoints to an offscreen PGraphics as circles using local properties this.eventPointsColor and this.eventPointsSize.- Parameters:
pg-
-
eventPointsDraw
public void eventPointsDraw(processing.core.PGraphics pg, int eventPointsColor, float eventPointsSize) Draws this.eventPoints to an offscreen PGraphics as circles using supplied properties eventPointsColor and eventPointsSize.- Parameters:
pg-eventPointsColor-eventPointsSize-
-
eventPointsDraw
public void eventPointsDraw(processing.core.PGraphics pg, int eventSteps, int eventPointsColor, float eventPointsSize) Draws this.eventPoints to an offscreen PGraphics as circles using supplied properties eventPointsSteps, eventPointsColor and eventPointsSize. Parameter eventPointsSteps determines the number of circles. The local value eventPointsSteps is not changed.- Parameters:
pg-eventSteps-eventPointsColor-eventPointsSize-
-