Package com.jogamp.graph.ui
Interface Container
-
- All Known Implementing Classes:
AnimGroup,Group,HUDShape,MediaPlayer,RangedGroup,RangeSlider,Scene,Widget
public interface ContainerContainer interface of UIShapes
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaddShape(Shape s)Adds aShape.voidaddShapes(Collection<? extends Shape> shapes)booleancontains(Shape s)com.jogamp.math.geom.AABBoxgetBounds(com.jogamp.math.util.PMVMatrix4f pmv, Shape shape)ReturnsAABBoxdimension of givenShapefrom this container's perspective, i.e.List<Shape>getRenderedShapes()Returnsadded shapeswhich are rendered and sorted by z-axis in ascending order toward z-near.ShapegetShapeByID(int id)ShapegetShapeByIdx(int id)ShapegetShapeByName(String name)intgetShapeCount()Returns number ofShapes, seegetShapes().List<Shape>getShapes()booleanisCullingEnabled()Return whetherProject-Modelview (PMv) frustum cullingorGroup's Modelview (Mv) frustum clippingis enabled for this container.booleanisOutside(com.jogamp.math.util.PMVMatrix4f pmv, Shape shape)Returns whether the givenShapeis completely outside of this container.booleanisOutside2(com.jogamp.math.Matrix4f mvCont, Shape shape, com.jogamp.math.util.PMVMatrix4f pmvShape)Returns whether the givenShapeis completely outside of this container.booleanisPMvCullingEnabled()Return whetherProject-Modelview (PMv) frustum cullingis enabled for this container.voidremoveAllShapes(GL2ES2 gl, RegionRenderer renderer)Removes all contained shapes withShape.destroy(GL2ES2, RegionRenderer).ShaperemoveShape(Shape s)Removes given shape, w/oShape.destroy(GL2ES2, RegionRenderer).booleanremoveShape(GL2ES2 gl, RegionRenderer renderer, Shape s)Removes given shape withShape.destroy(GL2ES2, RegionRenderer), if contained.voidremoveShapes(GL2ES2 gl, RegionRenderer renderer, Collection<? extends Shape> shapes)Removes all given shapes withShape.destroy(GL2ES2, RegionRenderer).voidremoveShapes(Collection<? extends Shape> shapes)Removes all given shapes, w/oShape.destroy(GL2ES2, RegionRenderer).voidsetPMvCullingEnabled(boolean v)Enable or disableProject-Modelview (PMv) frustumculling perShapefor this container.
-
-
-
Method Detail
-
getShapeCount
int getShapeCount()
Returns number ofShapes, seegetShapes().
-
getRenderedShapes
List<Shape> getRenderedShapes()
Returnsadded shapeswhich are rendered and sorted by z-axis in ascending order toward z-near.The rendered shapes are
visibleand 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) frustumculling perShapefor this container. Default is disabled.
-
isPMvCullingEnabled
boolean isPMvCullingEnabled()
Return whetherProject-Modelview (PMv) frustum cullingis enabled for this container.
-
isCullingEnabled
boolean isCullingEnabled()
Return whetherProject-Modelview (PMv) frustum cullingorGroup's Modelview (Mv) frustum clippingis enabled for this container. Default is disabled.
-
isOutside
boolean isOutside(com.jogamp.math.util.PMVMatrix4f pmv, Shape shape)Returns whether the givenShapeis 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- currentPMVMatrix4fof this containershape- theShapeto 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 givenShapeis 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- theShapeto testpmvShape- currentPMVMatrix4fof the shape to test- See Also:
isOutside(PMVMatrix4f, Shape),Shape#isOutside()
-
-