Package com.jogamp.graph.ui
Interface Container
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
addShape(Shape s)
void
addShapes(Collection<? extends Shape> shapes)
boolean
contains(Shape s)
boolean
forAll(Shape.Visitor1 v)
Traverses through the graph and applyShape.Visitor1.visit(Shape)
for each, stop if it returns true.boolean
forAll(PMVMatrix pmv, Shape.Visitor2 v)
Traverses through the graph and applyShape.Visitor2.visit(Shape, PMVMatrix)
for each, stop if it returns true.boolean
forOne(PMVMatrix pmv, Shape shape, Runnable action)
Traverses through the graph up untilshape
and applyaction
on it.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.AABBox
getBounds(PMVMatrix pmv, Shape shape)
List<Shape>
getShapes()
boolean
isFrustumCullingEnabled()
Return whetherfrustum culling
is enabled.void
removeAllShapes()
Removes all contained shapes, w/odestroying
them.Shape
removeShape(int idx)
Removes shape at given index, w/odestroying
them.Shape
removeShape(Shape s)
Removes given shape, w/odestroying
them.void
removeShapes(Collection<? extends Shape> shapes)
Removes all given shapes, w/odestroying
them.void
setFrustumCullingEnabled(boolean v)
Enable or disablePMVMatrix.getFrustum()
culling perShape
.
-
-
-
Method Detail
-
addShape
void addShape(Shape s)
-
removeShape
Shape removeShape(Shape s)
Removes given shape, w/odestroying
them.- Returns:
- the removed shape or null if not contained
-
removeShape
Shape removeShape(int idx)
Removes shape at given index, w/odestroying
them.- 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/odestroying
them.
-
removeAllShapes
void removeAllShapes()
Removes all contained shapes, w/odestroying
them.
-
contains
boolean contains(Shape s)
-
setFrustumCullingEnabled
void setFrustumCullingEnabled(boolean v)
Enable or disablePMVMatrix.getFrustum()
culling perShape
. Default is disabled.
-
isFrustumCullingEnabled
boolean isFrustumCullingEnabled()
Return whetherfrustum culling
is enabled.
-
forOne
boolean forOne(PMVMatrix pmv, Shape shape, Runnable action)
Traverses through the graph up untilshape
and applyaction
on it.- Parameters:
pmv
-shape
-action
-- Returns:
- true to signal operation complete, i.e.
shape
found, 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. EachContainer
level 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
-
-