diff options
Diffstat (limited to 'src/jogl/classes/com/jogamp/graph/curve')
3 files changed, 21 insertions, 43 deletions
diff --git a/src/jogl/classes/com/jogamp/graph/curve/OutlineShape.java b/src/jogl/classes/com/jogamp/graph/curve/OutlineShape.java index fc8d41660..7b487347a 100644 --- a/src/jogl/classes/com/jogamp/graph/curve/OutlineShape.java +++ b/src/jogl/classes/com/jogamp/graph/curve/OutlineShape.java @@ -34,6 +34,7 @@ import java.util.Comparator; import com.jogamp.graph.curve.tess.Triangulation; import com.jogamp.graph.curve.tess.Triangulator; import com.jogamp.graph.geom.Outline; +import com.jogamp.graph.geom.SVertex; import com.jogamp.graph.geom.Triangle; import com.jogamp.graph.geom.Vertex; import com.jogamp.graph.geom.plane.AffineTransform; @@ -187,7 +188,18 @@ public final class OutlineShape implements Comparable<OutlineShape> { private final float[] tmpV2 = new float[3]; private final float[] tmpV3 = new float[3]; - /** Create a new Outline based Shape + /** Returns the default Vertex.Factory. */ + public static Vertex.Factory<? extends Vertex> getDefaultVertexFactory() { return SVertex.factory(); } + + /** + * Create a new Outline based Shape using {@link #getDefaultVertexFactory()} + */ + public OutlineShape() { + this(getDefaultVertexFactory()); + } + + /** + * Create a new Outline based Shape */ public OutlineShape(final Vertex.Factory<? extends Vertex> factory) { this.vertexFactory = factory; diff --git a/src/jogl/classes/com/jogamp/graph/curve/opengl/RegionRenderer.java b/src/jogl/classes/com/jogamp/graph/curve/opengl/RegionRenderer.java index 28be06eee..b24cc3230 100644 --- a/src/jogl/classes/com/jogamp/graph/curve/opengl/RegionRenderer.java +++ b/src/jogl/classes/com/jogamp/graph/curve/opengl/RegionRenderer.java @@ -47,8 +47,6 @@ import com.jogamp.opengl.util.PMVMatrix; import com.jogamp.common.os.Platform; import com.jogamp.common.util.IntObjectHashMap; import com.jogamp.graph.curve.Region; -import com.jogamp.graph.geom.SVertex; -import com.jogamp.graph.geom.Vertex; /** * OpenGL {@link Region} renderer @@ -164,7 +162,7 @@ public final class RegionRenderer { * @see #enable(GL2ES2, boolean) */ public static RegionRenderer create(final GLCallback enableCallback, final GLCallback disableCallback) { - return new RegionRenderer(null, enableCallback, disableCallback); + return new RegionRenderer(enableCallback, disableCallback); } /** @@ -175,30 +173,6 @@ public final class RegionRenderer { * For example, instances {@link #defaultBlendEnable} and {@link #defaultBlendDisable} * can be utilized to enable and disable {@link GL#GL_BLEND}. * </p> - * @param pointFactory optional {@link Vertex.Factory} to be used for the {@link RenderState} composition, - * If null, SVertex.factory() will be used. - * @param enableCallback optional {@link GLCallback}, if not <code>null</code> will be issued at - * {@link #init(GL2ES2) init(gl)} and {@link #enable(GL2ES2, boolean) enable(gl, true)}. - * @param disableCallback optional {@link GLCallback}, if not <code>null</code> will be issued at - * {@link #enable(GL2ES2, boolean) enable(gl, false)}. - * @return an instance of Region Renderer - * @see #enable(GL2ES2, boolean) - */ - public static RegionRenderer create(final Vertex.Factory<? extends Vertex> pointFactory, - final GLCallback enableCallback, final GLCallback disableCallback) { - return new RegionRenderer(pointFactory, enableCallback, disableCallback); - } - - /** - * Create a hardware accelerated RegionRenderer including its {@link RenderState} composition. - * <p> - * The optional {@link GLCallback}s <code>enableCallback</code> and <code>disableCallback</code> - * maybe used to issue certain tasks at {@link #enable(GL2ES2, boolean)}.<br/> - * For example, instances {@link #defaultBlendEnable} and {@link #defaultBlendDisable} - * can be utilized to enable and disable {@link GL#GL_BLEND}. - * </p> - * @param pointFactory optional {@link Vertex.Factory} to be used for the {@link RenderState} composition. - * If null, SVertex.factory() will be used. * @param sharedPMVMatrix optional shared {@link PMVMatrix} to be used for the {@link RenderState} composition. * @param enableCallback optional {@link GLCallback}, if not <code>null</code> will be issued at * {@link #init(GL2ES2) init(gl)} and {@link #enable(GL2ES2, boolean) enable(gl, true)}. @@ -207,9 +181,9 @@ public final class RegionRenderer { * @return an instance of Region Renderer * @see #enable(GL2ES2, boolean) */ - public static RegionRenderer create(final Vertex.Factory<? extends Vertex> pointFactory, final PMVMatrix sharedPMVMatrix, + public static RegionRenderer create(final PMVMatrix sharedPMVMatrix, final GLCallback enableCallback, final GLCallback disableCallback) { - return new RegionRenderer(pointFactory, sharedPMVMatrix, enableCallback, disableCallback); + return new RegionRenderer(sharedPMVMatrix, enableCallback, disableCallback); } private final RenderState rs; @@ -242,18 +216,17 @@ public final class RegionRenderer { ////////////////////////////////////// - protected RegionRenderer(final Vertex.Factory<? extends Vertex> pointFactory, - final GLCallback enableCallback, final GLCallback disableCallback) + protected RegionRenderer(final GLCallback enableCallback, final GLCallback disableCallback) { - this.rs = new RenderState(pointFactory, null); + this.rs = new RenderState(null); this.enableCallback = enableCallback; this.disableCallback = disableCallback; } - protected RegionRenderer(final Vertex.Factory<? extends Vertex> pointFactory, final PMVMatrix sharedPMVMatrix, + protected RegionRenderer(final PMVMatrix sharedPMVMatrix, final GLCallback enableCallback, final GLCallback disableCallback) { - this.rs = new RenderState(pointFactory, sharedPMVMatrix); + this.rs = new RenderState(sharedPMVMatrix); this.enableCallback = enableCallback; this.disableCallback = disableCallback; } diff --git a/src/jogl/classes/com/jogamp/graph/curve/opengl/RenderState.java b/src/jogl/classes/com/jogamp/graph/curve/opengl/RenderState.java index 6e1886c73..9dc72f617 100644 --- a/src/jogl/classes/com/jogamp/graph/curve/opengl/RenderState.java +++ b/src/jogl/classes/com/jogamp/graph/curve/opengl/RenderState.java @@ -38,8 +38,6 @@ import jogamp.common.os.PlatformPropsImpl; import jogamp.graph.curve.opengl.shader.UniformNames; import com.jogamp.graph.curve.Region; -import com.jogamp.graph.geom.SVertex; -import com.jogamp.graph.geom.Vertex; import com.jogamp.opengl.util.GLArrayDataServer; import com.jogamp.opengl.util.PMVMatrix; import com.jogamp.opengl.util.glsl.ShaderProgram; @@ -92,7 +90,6 @@ public class RenderState { return (RenderState) gl.getContext().getAttachedObject(thisKey); } - private final Vertex.Factory<? extends Vertex> vertexFactory; private final PMVMatrix pmvMatrix; private final float[] weight; private final FloatBuffer weightBuffer; @@ -187,13 +184,11 @@ public class RenderState { /** * Create a RenderState, a composition of RegionRenderer - * @param vertexFactory used Vertex.Factory, if null SVertex.factory() will be used. * @param sharedPMVMatrix optional shared PMVMatrix, if null using a local instance */ - /* pp */ RenderState(final Vertex.Factory<? extends Vertex> vertexFactory, final PMVMatrix sharedPMVMatrix) { + /* pp */ RenderState(final PMVMatrix sharedPMVMatrix) { this.id = getNextID(); this.sp = null; - this.vertexFactory = null != vertexFactory ? vertexFactory : SVertex.factory(); this.pmvMatrix = null != sharedPMVMatrix ? sharedPMVMatrix : new PMVMatrix(); this.weight = new float[1]; this.weightBuffer = FloatBuffer.wrap(weight); @@ -233,8 +228,6 @@ public class RenderState { return true; } - public final Vertex.Factory<? extends Vertex> getVertexFactory() { return vertexFactory; } - public final PMVMatrix getMatrix() { return pmvMatrix; } public static boolean isWeightValid(final float v) { |