Package snap.gfx3d
Class BinarySpaceTree
java.lang.Object
snap.gfx3d.BinarySpaceTree
This class is a simple implementation of a Binary Space Partitioning Tree.
By recursively adding nodes (shapes) this separates nodes into nodes in front and nodes not in front.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
static final int
static final int
static final int
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionaddCoplanarNode
(BinarySpaceTree aNode) Adds a node to PlanarNode if planar.boolean
addNode
(BinarySpaceTree aNode) Adds a node.int
compareNodePlanes
(BinarySpaceTree aNode) Compare Node planes.static BinarySpaceTree
createBinarySpaceTree
(List<FacetShape> theShapes) Returns a BinarySpaceNode tree for given list of shapes.getShape()
Returns the shape.void
loadBackToFrontList
(List<FacetShape> sortedList) Loads a list from this node.static void
sortShapesBackToFront
(List<FacetShape> theShapes) Sorts a list of shapes in paint order from back to front.
-
Field Details
-
ORDER_BACK_TO_FRONT
public static final int ORDER_BACK_TO_FRONT- See Also:
-
ORDER_FRONT_TO_BACK
public static final int ORDER_FRONT_TO_BACK- See Also:
-
ORDER_SAME
public static final int ORDER_SAME- See Also:
-
ORDER_INDETERMINATE
public static final int ORDER_INDETERMINATE- See Also:
-
-
Constructor Details
-
BinarySpaceTree
Constructor.
-
-
Method Details
-
getShape
Returns the shape. -
addNode
Adds a node. -
addCoplanarNode
Adds a node to PlanarNode if planar. -
compareNodePlanes
Compare Node planes. -
loadBackToFrontList
Loads a list from this node. -
createBinarySpaceTree
Returns a BinarySpaceNode tree for given list of shapes. -
sortShapesBackToFront
Sorts a list of shapes in paint order from back to front.
-