diff options
author | Sven Gothel <[email protected]> | 2023-09-20 19:51:55 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2023-09-20 19:51:55 +0200 |
commit | 5d6e8a367c03644740187e500c6de5d3ac039d5e (patch) | |
tree | a649f559413c51272ee3f4afff1f68ebfea45477 /src/graphui/classes/com/jogamp/graph/ui/layout/BoxLayout.java | |
parent | bbe845846ffc00807395a5070a7352c6bbe7e4ef (diff) |
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.
Diffstat (limited to 'src/graphui/classes/com/jogamp/graph/ui/layout/BoxLayout.java')
-rw-r--r-- | src/graphui/classes/com/jogamp/graph/ui/layout/BoxLayout.java | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/graphui/classes/com/jogamp/graph/ui/layout/BoxLayout.java b/src/graphui/classes/com/jogamp/graph/ui/layout/BoxLayout.java index 05e3189ae..16e3441a3 100644 --- a/src/graphui/classes/com/jogamp/graph/ui/layout/BoxLayout.java +++ b/src/graphui/classes/com/jogamp/graph/ui/layout/BoxLayout.java @@ -31,11 +31,11 @@ import java.util.List; import com.jogamp.graph.ui.Group; import com.jogamp.graph.ui.Shape; -import com.jogamp.opengl.math.FloatUtil; -import com.jogamp.opengl.math.Vec2f; -import com.jogamp.opengl.math.Vec3f; -import com.jogamp.opengl.math.geom.AABBox; -import com.jogamp.opengl.util.PMVMatrix; +import com.jogamp.math.FloatUtil; +import com.jogamp.math.Vec2f; +import com.jogamp.math.Vec3f; +import com.jogamp.math.geom.AABBox; +import com.jogamp.math.util.PMVMatrix4f; /** * GraphUI Stack {@link Group.Layout}. @@ -171,7 +171,7 @@ public class BoxLayout implements Group.Layout { } @Override - public void layout(final Group g, final AABBox box, final PMVMatrix pmv) { + public void layout(final Group g, final AABBox box, final PMVMatrix4f pmv) { final boolean hasCellWidth = !FloatUtil.isZero(cellSize.x()); final boolean hasCellHeight = !FloatUtil.isZero(cellSize.y()); final boolean isCenteredHoriz = hasCellWidth && alignment.isSet(Alignment.Bit.CenterHoriz); @@ -184,10 +184,10 @@ public class BoxLayout implements Group.Layout { final Shape s = shapes.get(i); // measure size - pmv.glPushMatrix(); - s.setTransform(pmv); - s.getBounds().transformMv(pmv, sbox); - pmv.glPopMatrix(); + pmv.pushMv(); + s.setMvTransform(pmv); + s.getBounds().transform(pmv.getMv(), sbox); + pmv.popMv(); final int x = 0, y = 0; if( TRACE_LAYOUT ) { |