Package net.paulhertz.pixelaudio.curves
Class PALineVertex
java.lang.Object
net.paulhertz.pixelaudio.curves.PALineVertex
- All Implemented Interfaces:
PAVertex2DINF
Stores a line vertex consisting of a single point.
Adapted from IgnoCodeLib Processing library for use with PixelAudio library.
IgnoCodeLib is available in the Processing contributed libraries and at
https://paulhertz.net/ignocodelib/ and https://github.com/Ignotus-mago/IgnoCodeLib3
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intpath segment typeprotected floatx-coordinate of anchor pointprotected floaty-coordinate of anchor point -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionclone()float[]coords()voiddraw(processing.core.PApplet parent) Draws a path to the display.voiddraw(processing.core.PGraphics pg) Draws a path to an offscreen buffer.voidmark(processing.core.PApplet parent) Draws marks at vertices and control points.voidmark(processing.core.PGraphics pg) Draws marks at vertices and control points to an off-screen PGraphics.intvoidsetX(float newX) voidsetY(float newY) floatx()floaty()
-
Field Details
-
x
protected float xx-coordinate of anchor point -
y
protected float yy-coordinate of anchor point -
segmentType
public static final int segmentTypepath segment type- See Also:
-
-
Constructor Details
-
PALineVertex
public PALineVertex(float x, float y) -
PALineVertex
public PALineVertex()
-
-
Method Details
-
x
public float x()- Specified by:
xin interfacePAVertex2DINF- Returns:
- x-coordinate as a float
-
setX
public void setX(float newX) -
y
public float y()- Specified by:
yin interfacePAVertex2DINF- Returns:
- y-coordinate as a float
-
setY
public void setY(float newY) -
segmentType
public int segmentType()- Specified by:
segmentTypein interfacePAVertex2DINF- Returns:
- type of segment, either BezShape.LINE_SEGMENT or BezShape.CURVE_SEGMENT
-
coords
public float[] coords()- Specified by:
coordsin interfacePAVertex2DINF- Returns:
- coordinates as an array of float
-
clone
- Specified by:
clonein interfacePAVertex2DINF- Overrides:
clonein classObject- Returns:
- a deep copy of a Vertex2DINF
-
draw
public void draw(processing.core.PApplet parent) Description copied from interface:PAVertex2DINFDraws a path to the display. It is only valid to call this within a Processing beginShape/endShape pair where an initial vertex has been set with a call to vertex().- Specified by:
drawin interfacePAVertex2DINF- Parameters:
parent- the PApplet that handles drawing
-
draw
public void draw(processing.core.PGraphics pg) Description copied from interface:PAVertex2DINFDraws a path to an offscreen buffer. It is only valid to call this within a Processing beginShape/endShape pair where an initial vertex has been set with a call to vertex().- Specified by:
drawin interfacePAVertex2DINF- Parameters:
pg- a PGraphics instance
-
mark
public void mark(processing.core.PApplet parent) Description copied from interface:PAVertex2DINFDraws marks at vertices and control points.- Specified by:
markin interfacePAVertex2DINF
-
mark
public void mark(processing.core.PGraphics pg) Description copied from interface:PAVertex2DINFDraws marks at vertices and control points to an off-screen PGraphics.- Specified by:
markin interfacePAVertex2DINF
-