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. --- src/graphui/classes/jogamp/graph/ui/TreeTool.java | 32 +++++++++++----------- .../classes/jogamp/graph/ui/shapes/Label0.java | 8 +++--- 2 files changed, 20 insertions(+), 20 deletions(-) (limited to 'src/graphui/classes/jogamp/graph/ui') diff --git a/src/graphui/classes/jogamp/graph/ui/TreeTool.java b/src/graphui/classes/jogamp/graph/ui/TreeTool.java index c5701d6e2..d43c6c7f7 100644 --- a/src/graphui/classes/jogamp/graph/ui/TreeTool.java +++ b/src/graphui/classes/jogamp/graph/ui/TreeTool.java @@ -36,7 +36,7 @@ import com.jogamp.graph.ui.Scene; import com.jogamp.graph.ui.Shape; import com.jogamp.graph.ui.Shape.Visitor1; import com.jogamp.graph.ui.Shape.Visitor2; -import com.jogamp.opengl.util.PMVMatrix; +import com.jogamp.math.util.PMVMatrix4f; /** Generic static {@link Shape} tree traversal tools, utilized by {@link Scene} and {@link Container} implementations. */ public class TreeTool { @@ -48,24 +48,24 @@ public class TreeTool { * @param action * @return true to signal operation complete, i.e. {@code shape} found, otherwise false */ - public static boolean forOne(final List shapes, final PMVMatrix pmv, final Shape shape, final Runnable action) { + public static boolean forOne(final List shapes, final PMVMatrix4f pmv, final Shape shape, final Runnable action) { for(int i=0; i shapes, final PMVMatrix pmv, final Visitor2 v) { + public static boolean forAll(final List shapes, final PMVMatrix4f pmv, final Visitor2 v) { for(int i=0; i sortComp, final List shapes, final PMVMatrix pmv, final Visitor2 v) { + public static boolean forSortedAll(final Comparator sortComp, final List shapes, final PMVMatrix4f pmv, final Visitor2 v) { final Object[] shapesS = shapes.toArray(); Arrays.sort(shapesS, (Comparator)sortComp); for(int i=0; i