java.lang.Object
de.grogra.vecmath.geom.Octree.Cell
- Enclosing class:
- Octree
A
Cell
represents a cell of an Octree
.
The array children
contains
the eight children of this cell, if it is an inner node
of the octree, otherwise it is null
. The children
are equal in size and represent a decomposition of their parent.
A leaf Cell
also includes a list of volumes whose
boundaries are contained in the cell.
- Author:
- Michael Tauer, Ole Kniemeyer
-
Field Summary
FieldsModifier and TypeFieldDescriptionThe eight child nodes of this cell, ornull
if this cell is a leaf of the octree.static final int
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract void
Adds a volume to this cell.abstract void
Clears the list of volumes of this cell.protected abstract Octree.Cell
createChild
(int position) This factory method creates a new cell of the same class as this cell.void
Determines the spatial extent of this cell.abstract Volume
getVolume
(int index, Octree.State state) Returns theindex
th volume of the list of volumes of this cell.abstract int
Returns the number of volumes in this cell.
-
Field Details
-
ROOT_POSITION
public static final int ROOT_POSITION- See Also:
-
children
The eight child nodes of this cell, ornull
if this cell is a leaf of the octree. -
front
-
back
-
top
-
bottom
-
left
-
right
-
-
Constructor Details
-
Cell
public Cell(int position)
-
-
Method Details
-
getVolumeCount
public abstract int getVolumeCount()Returns the number of volumes in this cell. Volumes contained in child cells are not counted.- Returns:
- number of volumes
-
clearVolumes
public abstract void clearVolumes()Clears the list of volumes of this cell. -
getVolume
Returns theindex
th volume of the list of volumes of this cell. The returned volume may only be used up to the next invocation of this method with the samestate
, so that the state is allowed to store information about the volume.- Parameters:
index
- index of volume in liststate
- instance ofState
as returned byOctree.createState()
- Returns:
- volume at
index
-
addVolume
Adds a volume to this cell.v
must be a volume which has been returned previously by the invocation ofgetVolume(int, de.grogra.vecmath.geom.Octree.State)
on the parent cell.- Parameters:
v
- volume of parent cell which has to be added to this cell
-
createChild
This factory method creates a new cell of the same class as this cell. It will be used as child of this cell.- Parameters:
position
- value forposition
- Returns:
- newly created cell
-
getExtent
Determines the spatial extent of this cell.- Parameters:
tree
- the octree to which this cell belongsmin
- the minimum coordinates will be placed in heremax
- the maximum coordinates will be placed in here
-