|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jcae.mesh.oemm.OEMM
public class OEMM
This class represents an empty OEMM. An OEMM is a pointer-based octree, but cells do not contain any data. Only its spatial structure is considered, and it is assumed that the whole tree can reside in memory. This class defines the octree structure and how to traverse it. References: External Memory Management and Simplification of Huge Meshes, by P. Cignoni, C. Montani, C. Rocchini and R. Scopigno.
Nested Class Summary | |
---|---|
static class |
OEMM.Node
This class represents octants of an OEMM. |
Field Summary | |
---|---|
OEMM.Node[] |
leaves
Array of leaves. |
static int |
MAXLEVEL
Maximal tree depth. |
protected OEMM.Node |
root
Root cell. |
double[] |
x0
Double/integer conversion. |
Constructor Summary | |
---|---|
OEMM(int l)
Create an empty OEMM with a given depth. |
|
OEMM(java.lang.String dir)
Create an empty OEMM. |
Method Summary | |
---|---|
OEMM.Node |
build(int[] ijk)
Builds an octant containing a given point if it does not already exist. |
int |
cellSizeByHeight(int h)
Returns size of cells at a given height. |
boolean |
checkBoundingBox(double[] bbox)
Checks whether a bounding box lies within current OEMM. |
void |
clearNodes()
Remove all cells from a tree. |
void |
double2int(double[] p,
int[] ijk)
Converts from double coordinates to integer coordinates. |
double[] |
getCoords(boolean onlyLeaves)
Returns coordinates of all cell corners. |
int |
getDepth()
|
java.lang.String |
getDirectory()
Returns top-level directory. |
java.lang.String |
getFileName()
Returns file name containing OEMM data structure. |
int |
getNumberOfLeaves()
Returns number of leaves. |
protected static int |
indexSubOctree(int size,
int[] ijk)
Returns local index of cell containing a given point. |
void |
insert(OEMM.Node current)
Inserts an octant into the tree structure if it does not already exist. |
void |
int2double(int[] ijk,
double[] p)
Converts from integer coordinates to double coordinates. |
protected void |
mergeChildren(OEMM.Node node)
Merges all children of a given cell. |
protected int |
minCellSize()
Returns size of deepest cell. |
void |
printInfos()
Prints tree stats. |
OEMM.Node |
search(int[] ijk)
Returns the octant of an OEMM structure containing a given point. |
static OEMM.Node |
searchAdjacentNode(OEMM.Node fromNode,
int[] ijk)
Returns the adjacent node located at a given point with the same size. |
void |
setBoundingBox(double[] bbox)
Sets object bounding box. |
void |
setDirectory(java.lang.String dir)
Sets top-level directory. |
boolean |
walk(TraversalProcedure proc)
Traverses the whole OEMM structure. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int MAXLEVEL
public double[] x0
I[i] = (D[i] - x0[i]) * x0[3];and inverse conversion is
D[i] = x0[i] + I[i] / x0[3];
protected transient OEMM.Node root
public transient OEMM.Node[] leaves
Constructor Detail |
---|
public OEMM(java.lang.String dir)
public OEMM(int l)
Method Detail |
---|
public final void clearNodes()
public final void setBoundingBox(double[] bbox)
x0
.
bbox
- bounding boxpublic final boolean checkBoundingBox(double[] bbox)
bbox
- bounding box
true
if bounding box lies within current OEMM,
false
otherwise.public final java.lang.String getDirectory()
public final void setDirectory(java.lang.String dir)
dir
- top-level directorypublic final java.lang.String getFileName()
OEMM
data structure.
public final int getNumberOfLeaves()
protected final int minCellSize()
public final int cellSizeByHeight(int h)
h
- cell height
public final void printInfos()
public final void double2int(double[] p, int[] ijk)
p
- double coordinates.ijk
- integer coordinates.public final void int2double(int[] ijk, double[] p)
ijk
- integer coordinates.p
- double coordinates.public final boolean walk(TraversalProcedure proc)
proc
- procedure called on each octant.
true
if the whole structure has been traversed,
false
if traversal aborted.protected static final int indexSubOctree(int size, int[] ijk)
size
- size of child cellsijk
- integer coordinates of desired pointpublic final OEMM.Node build(int[] ijk)
ijk
- integer coordinates of an interior node
public final void insert(OEMM.Node current)
current
- node being inserted.public final OEMM.Node search(int[] ijk)
ijk
- integer coordinates of an interior node
protected final void mergeChildren(OEMM.Node node)
node
- cell to be mergedpublic static final OEMM.Node searchAdjacentNode(OEMM.Node fromNode, int[] ijk)
fromNode
- start nodeijk
- integer coordinates of lower-left corner
public double[] getCoords(boolean onlyLeaves)
onlyLeaves
- if set to true
, only leaf cells are
considered, otherwise all cells are considered.
public int getDepth()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |