aboutsummaryrefslogtreecommitdiffstats
path: root/src/graphui/classes/com/jogamp/graph/ui/GraphShape.java
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2023-04-18 05:15:16 +0200
committerSven Gothel <[email protected]>2023-04-18 05:15:16 +0200
commitc65c750e032118f229050ff8e834961264ed0591 (patch)
tree8500286ca6086eb21a9b275ccd586185090b1500 /src/graphui/classes/com/jogamp/graph/ui/GraphShape.java
parentcd845589eea6c7773007e013bd5f2f37242cbe1a (diff)
Graph + GraphUI: Consolidate Vertex: Drop SVertex and factory, use Vec[234]f instead of float[] and remove unused VectorUtil methods
After Matrix4f consolidation and proving same or better performance on non array types, this enhances code readability, simplifies API, reduces bugs and may improve performance. GraphUI: - Have RoundButton as a functional class to make a round or rectangular backdrop, i.e. impl. addShapeToRegion() via reused addRoundShapeToRegion()
Diffstat (limited to 'src/graphui/classes/com/jogamp/graph/ui/GraphShape.java')
-rw-r--r--src/graphui/classes/com/jogamp/graph/ui/GraphShape.java12
1 files changed, 4 insertions, 8 deletions
diff --git a/src/graphui/classes/com/jogamp/graph/ui/GraphShape.java b/src/graphui/classes/com/jogamp/graph/ui/GraphShape.java
index 4d2202145..89e77d2fe 100644
--- a/src/graphui/classes/com/jogamp/graph/ui/GraphShape.java
+++ b/src/graphui/classes/com/jogamp/graph/ui/GraphShape.java
@@ -34,10 +34,9 @@ import com.jogamp.graph.curve.OutlineShape;
import com.jogamp.graph.curve.Region;
import com.jogamp.graph.curve.opengl.GLRegion;
import com.jogamp.graph.curve.opengl.RegionRenderer;
-import com.jogamp.graph.geom.Vertex;
-import com.jogamp.graph.geom.Vertex.Factory;
import com.jogamp.opengl.GL2ES2;
import com.jogamp.opengl.GLProfile;
+import com.jogamp.opengl.math.Vec4f;
import com.jogamp.opengl.util.texture.TextureSequence;
/**
@@ -51,8 +50,6 @@ import com.jogamp.opengl.util.texture.TextureSequence;
* @see Scene
*/
public abstract class GraphShape extends Shape {
- protected final Factory<? extends Vertex> vertexFactory;
-
protected final int renderModes;
protected GLRegion region = null;
protected float oshapeSharpness = OutlineShape.DEFAULT_SHARPNESS;
@@ -66,7 +63,6 @@ public abstract class GraphShape extends Shape {
*/
public GraphShape(final int renderModes) {
super();
- this.vertexFactory = OutlineShape.getDefaultVertexFactory();
this.renderModes = renderModes;
}
@@ -122,7 +118,7 @@ public abstract class GraphShape extends Shape {
}
@Override
- protected final void drawImpl0(final GL2ES2 gl, final RegionRenderer renderer, final int[] sampleCount, final float[] rgba) {
+ protected final void drawImpl0(final GL2ES2 gl, final RegionRenderer renderer, final int[] sampleCount, final Vec4f rgba) {
if( null != rgba ) {
renderer.getRenderState().setColorStatic(rgba);
}
@@ -157,10 +153,10 @@ public abstract class GraphShape extends Shape {
}
}
- private final float[] dbgColor = {0.3f, 0.3f, 0.3f, 0.5f};
+ private final Vec4f dbgColor = new Vec4f(0.3f, 0.3f, 0.3f, 0.5f);
protected void addDebugOutline() {
- final OutlineShape shape = new OutlineShape(vertexFactory);
+ final OutlineShape shape = new OutlineShape();
final float x1 = box.getMinX();
final float x2 = box.getMaxX();
final float y1 = box.getMinY();