diff options
author | Sven Göthel <[email protected]> | 2024-01-07 04:44:01 +0100 |
---|---|---|
committer | Sven Göthel <[email protected]> | 2024-01-07 04:44:01 +0100 |
commit | 259fce6ca0fa4fe92e6dc2266d442c62723eb73c (patch) | |
tree | 4f8df2aab6ada68736e0976e5facc06f5b0dcbc5 /src/graphui/classes/com/jogamp/graph/ui/Container.java | |
parent | 6af37910eac365ed2b5ac957276337fe71f7e56b (diff) |
GraphUI Cleanup: Simplify Shape.draw*() and Container.{add,remove*}Shape[s](); Remove Scene.setDebugBorderBox()
Simplify Shape/Scene
- Split scene.display()/shape.drawImpl0() and scene.displayGLSelect()/shape.drawToSelectImpl0()
Simplify Container (Scene/Group)
- {add,remove*}Shape[s](), i.e. drop unusual removeShape*() and simplify implementation
Scene
- Remove setDebugBorderBox()
Diffstat (limited to 'src/graphui/classes/com/jogamp/graph/ui/Container.java')
-rw-r--r-- | src/graphui/classes/com/jogamp/graph/ui/Container.java | 29 |
1 files changed, 18 insertions, 11 deletions
diff --git a/src/graphui/classes/com/jogamp/graph/ui/Container.java b/src/graphui/classes/com/jogamp/graph/ui/Container.java index dd8fe99f9..545ceec60 100644 --- a/src/graphui/classes/com/jogamp/graph/ui/Container.java +++ b/src/graphui/classes/com/jogamp/graph/ui/Container.java @@ -1,5 +1,5 @@ /** - * Copyright 2023 JogAmp Community. All rights reserved. + * Copyright 2023-2024 JogAmp Community. All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, are * permitted provided that the following conditions are met: @@ -34,6 +34,8 @@ 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.opengl.GL2ES2; +import com.jogamp.graph.curve.opengl.RegionRenderer; import com.jogamp.graph.ui.Shape.Visitor1; /** @@ -53,25 +55,30 @@ public interface Container { void addShape(Shape s); /** - * Removes given shape, w/o {@link Shape#destroy(com.jogamp.opengl.GL2ES2, com.jogamp.graph.curve.opengl.RegionRenderer) destroying} them. + * Removes given shape, w/o {@link Shape#destroy(GL2ES2, RegionRenderer)}. * @return the removed shape or null if not contained */ - Shape removeShape(Shape s); + Shape removeShape(final Shape s); + + /** Removes all given shapes, w/o {@link Shape#destroy(GL2ES2, RegionRenderer)}. */ + void removeShapes(Collection<? extends Shape> shapes); /** - * Removes shape at given index, w/o {@link Shape#destroy(com.jogamp.opengl.GL2ES2, com.jogamp.graph.curve.opengl.RegionRenderer) destroying} them. - * @return the removed shape - * @throws IndexOutOfBoundsException if index is out of bounds, i.e. (index < 0 || index >= size()) + * Removes given shape with {@link Shape#destroy(GL2ES2, RegionRenderer)}, if contained. + * @param gl GL2ES2 context + * @param renderer + * @param s the shape to be removed + * @return true if given Shape is removed and destroyed */ - Shape removeShape(final int idx); + boolean removeShape(final GL2ES2 gl, final RegionRenderer renderer, final Shape s); void addShapes(Collection<? extends Shape> shapes); - /** Removes all given shapes, w/o {@link Shape#destroy(com.jogamp.opengl.GL2ES2, com.jogamp.graph.curve.opengl.RegionRenderer) destroying} them. */ - void removeShapes(Collection<? extends Shape> shapes); + /** Removes all given shapes with {@link Shape#destroy(GL2ES2, RegionRenderer)}. */ + void removeShapes(final GL2ES2 gl, final RegionRenderer renderer, final Collection<? extends Shape> shapes); - /** Removes all contained shapes, w/o {@link Shape#destroy(com.jogamp.opengl.GL2ES2, com.jogamp.graph.curve.opengl.RegionRenderer) destroying} them. */ - void removeAllShapes(); + /** Removes all contained shapes with {@link Shape#destroy(GL2ES2, RegionRenderer)}. */ + void removeAllShapes(final GL2ES2 gl, final RegionRenderer renderer); boolean contains(Shape s); |