Package com.jogamp.graph.ui
Interface Container
-
- All Known Implementing Classes:
AnimGroup
,Group
,HUDShape
,MediaPlayer
,RangedGroup
,RangeSlider
,Scene
,Widget
public interface Container
Container interface of UIShape
s
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
addShape(Shape s)
Adds aShape
.void
addShapes(Collection<? extends Shape> shapes)
boolean
contains(Shape s)
com.jogamp.math.geom.AABBox
getBounds(com.jogamp.math.util.PMVMatrix4f pmv, Shape shape)
ReturnsAABBox
dimension of givenShape
from this container's perspective, i.e.List<Shape>
getRenderedShapes()
Returnsadded shapes
which are rendered and sorted by z-axis in ascending order toward z-near.Shape
getShapeByID(int id)
Shape
getShapeByIdx(int id)
Shape
getShapeByName(String name)
int
getShapeCount()
Returns number ofShape
s, seegetShapes()
.List<Shape>
getShapes()
boolean
isCullingEnabled()
Return whetherProject-Modelview (PMv) frustum culling
orGroup's Modelview (Mv) frustum clipping
is enabled for this container.boolean
isOutside(com.jogamp.math.util.PMVMatrix4f pmv, Shape shape)
Returns whether the givenShape
is completely outside of this container.boolean
isOutside2(com.jogamp.math.Matrix4f mvCont, Shape shape, com.jogamp.math.util.PMVMatrix4f pmvShape)
Returns whether the givenShape
is completely outside of this container.boolean
isPMvCullingEnabled()
Return whetherProject-Modelview (PMv) frustum culling
is enabled for this container.void
removeAllShapes(GL2ES2 gl, RegionRenderer renderer)
Removes all contained shapes withShape.destroy(GL2ES2, RegionRenderer)
.Shape
removeShape(Shape s)
Removes given shape, w/oShape.destroy(GL2ES2, RegionRenderer)
.boolean
removeShape(GL2ES2 gl, RegionRenderer renderer, Shape s)
Removes given shape withShape.destroy(GL2ES2, RegionRenderer)
, if contained.void
removeShapes(GL2ES2 gl, RegionRenderer renderer, Collection<? extends Shape> shapes)
Removes all given shapes withShape.destroy(GL2ES2, RegionRenderer)
.void
removeShapes(Collection<? extends Shape> shapes)
Removes all given shapes, w/oShape.destroy(GL2ES2, RegionRenderer)
.void
setPMvCullingEnabled(boolean v)
Enable or disableProject-Modelview (PMv) frustum
culling perShape
for this container.
-
-
-
Method Detail
-
getShapeCount
int getShapeCount()
Returns number ofShape
s, seegetShapes()
.
-
getRenderedShapes
List<Shape> getRenderedShapes()
Returnsadded shapes
which are rendered and sorted by z-axis in ascending order toward z-near.The rendered shapes are
visible
and not deemed outside of this container due toculling
.Only rendered shapes are considered for picking/activation.
The returned list is data-race free, i.e. won't be mutated by the rendering thread as it gets completely replace at each rendering loop using a local volatile reference.
Only when disposing the container, the list gets cleared, hence shall be used in the loop.
-
removeShape
Shape removeShape(Shape s)
Removes given shape, w/oShape.destroy(GL2ES2, RegionRenderer)
.- Returns:
- the removed shape or null if not contained
-
removeShapes
void removeShapes(Collection<? extends Shape> shapes)
Removes all given shapes, w/oShape.destroy(GL2ES2, RegionRenderer)
.
-
removeShape
boolean removeShape(GL2ES2 gl, RegionRenderer renderer, Shape s)
Removes given shape withShape.destroy(GL2ES2, RegionRenderer)
, if contained.- Parameters:
gl
- GL2ES2 contextrenderer
-s
- the shape to be removed- Returns:
- true if given Shape is removed and destroyed
-
addShapes
void addShapes(Collection<? extends Shape> shapes)
-
removeShapes
void removeShapes(GL2ES2 gl, RegionRenderer renderer, Collection<? extends Shape> shapes)
Removes all given shapes withShape.destroy(GL2ES2, RegionRenderer)
.
-
removeAllShapes
void removeAllShapes(GL2ES2 gl, RegionRenderer renderer)
Removes all contained shapes withShape.destroy(GL2ES2, RegionRenderer)
.
-
contains
boolean contains(Shape s)
-
getShapeByIdx
Shape getShapeByIdx(int id)
-
getShapeByID
Shape getShapeByID(int id)
-
getBounds
com.jogamp.math.geom.AABBox getBounds(com.jogamp.math.util.PMVMatrix4f pmv, Shape shape)
-
setPMvCullingEnabled
void setPMvCullingEnabled(boolean v)
Enable or disableProject-Modelview (PMv) frustum
culling perShape
for this container. Default is disabled.
-
isPMvCullingEnabled
boolean isPMvCullingEnabled()
Return whetherProject-Modelview (PMv) frustum culling
is enabled for this container.
-
isCullingEnabled
boolean isCullingEnabled()
Return whetherProject-Modelview (PMv) frustum culling
orGroup's Modelview (Mv) frustum clipping
is enabled for this container. Default is disabled.
-
isOutside
boolean isOutside(com.jogamp.math.util.PMVMatrix4f pmv, Shape shape)
Returns whether the givenShape
is completely outside of this container.Note: If method returns false, the box may only be partially inside, i.e. intersects with this container
- Parameters:
pmv
- currentPMVMatrix4f
of this containershape
- theShape
to test- See Also:
isOutside2(Matrix4f, Shape, PMVMatrix4f)
,Shape#isOutside()
-
isOutside2
boolean isOutside2(com.jogamp.math.Matrix4f mvCont, Shape shape, com.jogamp.math.util.PMVMatrix4f pmvShape)
Returns whether the givenShape
is completely outside of this container.Note: If method returns false, the box may only be partially inside, i.e. intersects with this container
- Parameters:
mvCont
- copy of the model-view {@link Matrix4f) of this containershape
- theShape
to testpmvShape
- currentPMVMatrix4f
of the shape to test- See Also:
isOutside(PMVMatrix4f, Shape)
,Shape#isOutside()
-
-