Package com.jogamp.graph.ui
Interface Container
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaddShape(Shape s)voidaddShapes(Collection<? extends Shape> shapes)booleancontains(Shape s)booleanforAll(Shape.Visitor1 v)Traverses through the graph and applyShape.Visitor1.visit(Shape)for each, stop if it returns true.booleanforAll(PMVMatrix pmv, Shape.Visitor2 v)Traverses through the graph and applyShape.Visitor2.visit(Shape, PMVMatrix)for each, stop if it returns true.booleanforOne(PMVMatrix pmv, Shape shape, Runnable action)Traverses through the graph up untilshapeand applyactionon it.booleanforSortedAll(Comparator<Shape> sortComp, PMVMatrix pmv, Shape.Visitor2 v)Traverses through the graph and applyVisitor#visit(Shape, PMVMatrix)for each, stop if it returns true.AABBoxgetBounds(PMVMatrix pmv, Shape shape)List<Shape>getShapes()booleanisFrustumCullingEnabled()Return whetherfrustum cullingis enabled.voidremoveAllShapes()Removes all contained shapes, w/odestroyingthem.ShaperemoveShape(int idx)Removes shape at given index, w/odestroyingthem.ShaperemoveShape(Shape s)Removes given shape, w/odestroyingthem.voidremoveShapes(Collection<? extends Shape> shapes)Removes all given shapes, w/odestroyingthem.voidsetFrustumCullingEnabled(boolean v)Enable or disablePMVMatrix.getFrustum()culling perShape.
-
-
-
Method Detail
-
addShape
void addShape(Shape s)
-
removeShape
Shape removeShape(Shape s)
Removes given shape, w/odestroyingthem.- Returns:
- the removed shape or null if not contained
-
removeShape
Shape removeShape(int idx)
Removes shape at given index, w/odestroyingthem.- Returns:
- the removed shape
- Throws:
IndexOutOfBoundsException- if index is out of bounds, i.e. (index < 0 || index >= size())
-
addShapes
void addShapes(Collection<? extends Shape> shapes)
-
removeShapes
void removeShapes(Collection<? extends Shape> shapes)
Removes all given shapes, w/odestroyingthem.
-
removeAllShapes
void removeAllShapes()
Removes all contained shapes, w/odestroyingthem.
-
contains
boolean contains(Shape s)
-
setFrustumCullingEnabled
void setFrustumCullingEnabled(boolean v)
Enable or disablePMVMatrix.getFrustum()culling perShape. Default is disabled.
-
isFrustumCullingEnabled
boolean isFrustumCullingEnabled()
Return whetherfrustum cullingis enabled.
-
forOne
boolean forOne(PMVMatrix pmv, Shape shape, Runnable action)
Traverses through the graph up untilshapeand applyactionon it.- Parameters:
pmv-shape-action-- Returns:
- true to signal operation complete, i.e.
shapefound, otherwise false
-
forAll
boolean forAll(Shape.Visitor1 v)
Traverses through the graph and applyShape.Visitor1.visit(Shape)for each, stop if it returns true.- Parameters:
v-- Returns:
- true to signal operation complete and to stop traversal, i.e.
Shape.Visitor1.visit(Shape)returned true, otherwise false
-
forAll
boolean forAll(PMVMatrix pmv, Shape.Visitor2 v)
Traverses through the graph and applyShape.Visitor2.visit(Shape, PMVMatrix)for each, stop if it returns true.- Parameters:
pmv-v-- Returns:
- true to signal operation complete and to stop traversal, i.e.
Shape.Visitor2.visit(Shape, PMVMatrix)returned true, otherwise false
-
forSortedAll
boolean forSortedAll(Comparator<Shape> sortComp, PMVMatrix pmv, Shape.Visitor2 v)
Traverses through the graph and applyVisitor#visit(Shape, PMVMatrix)for each, stop if it returns true. EachContainerlevel is sorted usingsortComp- Parameters:
sortComp-pmv-v-- Returns:
- true to signal operation complete and to stop traversal, i.e.
Shape.Visitor2.visit(Shape, PMVMatrix)returned true, otherwise false
-
-