From 5d6e8a367c03644740187e500c6de5d3ac039d5e Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Wed, 20 Sep 2023 19:51:55 +0200 Subject: Bug 1452 - Decouple math functionality to 'com.jogamp.math' to be toolkit agnostic (PMVMatrix, Matrix4f, Vec4f, ..) Math functionality (PMVMatrix, Matrix4f, Vec4f, ..) - shall be used toolkit agnostic, e.g. independent from OpenGL - shall be reused within our upcoming Vulkan implementation - may also move outside of JOGL, i.e. GlueGen or within its own package to be reused for other purposed. The 'com.jogamp.opengl.util.PMVMatrix' currently also used to feed in GLUniformData via the toolkit agnostic SyncAction and SyncBuffer shall also be split to a toolkit agnostic variant. An OpenGL PMVMatrix specialization implementing GLMatrixFunc can still exist, being derived from the toolkit agnostic base implementation. +++ Initial commit .. compile clean, passing most unit tests. --- .../classes/com/jogamp/graph/ui/Container.java | 23 +++++++++++----------- 1 file changed, 11 insertions(+), 12 deletions(-) (limited to 'src/graphui/classes/com/jogamp/graph/ui/Container.java') diff --git a/src/graphui/classes/com/jogamp/graph/ui/Container.java b/src/graphui/classes/com/jogamp/graph/ui/Container.java index 845d41c0c..bc1e6d94f 100644 --- a/src/graphui/classes/com/jogamp/graph/ui/Container.java +++ b/src/graphui/classes/com/jogamp/graph/ui/Container.java @@ -32,10 +32,9 @@ import java.util.Comparator; import java.util.List; import com.jogamp.graph.ui.Shape.Visitor2; +import com.jogamp.math.geom.AABBox; +import com.jogamp.math.util.PMVMatrix4f; import com.jogamp.graph.ui.Shape.Visitor1; -import com.jogamp.opengl.fixedfunc.GLMatrixFunc; -import com.jogamp.opengl.math.geom.AABBox; -import com.jogamp.opengl.util.PMVMatrix; /** * Container interface of UI {@link Shape}s @@ -71,9 +70,9 @@ public interface Container { boolean contains(Shape s); - AABBox getBounds(final PMVMatrix pmv, Shape shape); + AABBox getBounds(final PMVMatrix4f pmv, Shape shape); - /** Enable or disable {@link PMVMatrix#getFrustum()} culling per {@link Shape}. Default is disabled. */ + /** Enable or disable {@link PMVMatrix4f#getFrustum()} culling per {@link Shape}. Default is disabled. */ void setFrustumCullingEnabled(final boolean v); /** Return whether {@link #setFrustumCullingEnabled(boolean) frustum culling} is enabled. */ @@ -86,7 +85,7 @@ public interface Container { * @param action * @return true to signal operation complete, i.e. {@code shape} found, otherwise false */ - boolean forOne(final PMVMatrix pmv, final Shape shape, final Runnable action); + boolean forOne(final PMVMatrix4f pmv, final Shape shape, final Runnable action); /** * Traverses through the graph and apply {@link Visitor1#visit(Shape)} for each, stop if it returns true. @@ -96,21 +95,21 @@ public interface Container { boolean forAll(Visitor1 v); /** - * Traverses through the graph and apply {@link Visitor2#visit(Shape, PMVMatrix)} for each, stop if it returns true. + * Traverses through the graph and apply {@link Visitor2#visit(Shape, PMVMatrix4f)} for each, stop if it returns true. * @param pmv * @param v - * @return true to signal operation complete and to stop traversal, i.e. {@link Visitor2#visit(Shape, PMVMatrix)} returned true, otherwise false + * @return true to signal operation complete and to stop traversal, i.e. {@link Visitor2#visit(Shape, PMVMatrix4f)} returned true, otherwise false */ - boolean forAll(final PMVMatrix pmv, Visitor2 v); + boolean forAll(final PMVMatrix4f pmv, Visitor2 v); /** - * Traverses through the graph and apply {@link Visitor#visit(Shape, PMVMatrix)} for each, stop if it returns true. + * Traverses through the graph and apply {@link Visitor#visit(Shape, PMVMatrix4f)} for each, stop if it returns true. * * Each {@link Container} level is sorted using {@code sortComp} * @param sortComp * @param pmv * @param v - * @return true to signal operation complete and to stop traversal, i.e. {@link Visitor2#visit(Shape, PMVMatrix)} returned true, otherwise false + * @return true to signal operation complete and to stop traversal, i.e. {@link Visitor2#visit(Shape, PMVMatrix4f)} returned true, otherwise false */ - boolean forSortedAll(final Comparator sortComp, final PMVMatrix pmv, final Visitor2 v); + boolean forSortedAll(final Comparator sortComp, final PMVMatrix4f pmv, final Visitor2 v); } \ No newline at end of file -- cgit v1.2.3