|
IsoSurface Rendering of an AR Representation | |||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--rlaramee.Octree
Description: An OctTree is our data structure for storing and organizing the volume data in an adaptive resolution representation. Each level of an octree represents a different level of resolution.
Octree Optimization Tests:
Implemented
-----------
Bugs ----
start date Fri 30 April 1999
Field Summary | |
private int |
bottomNodes
# of nodes to reach bottom |
private static int |
direction
default direction |
private byte |
finestLevel
|
private OctreeNode[] |
octreeNodeArray
|
private int |
octreeNodeArrayIndex
|
private int |
representation
TRUE if this is an AR octree |
private OctreeNode |
root
|
private int |
size
total # of nodes added |
private int |
throwAwayCount
number of nodes not added to the tree |
Constructor Summary | |
Octree(int representation)
constructor |
Method Summary | |
void |
addNodeFromBottom(OctreeNode octreeNode)
addNodeFromBottom() adds a node onto the Octree. |
void |
addNodeFromTop(OctreeNode newNode)
addNodeFromTop() adds a node onto the Octree. |
boolean |
addToOctreeNodeArray(OctreeNode octreeNode)
Can an octree node already be in the octree node array? This node may already have children, so look for them in the octreeNodeArray. |
private int |
computeArrayIndexByCoord(OctreeNode octreeNode)
The Octree has something that acts like a node caching mechanism. |
int |
computeArrayIndexByOctant(OctreeNode octreeNode)
core dumb = 293,557,248 bytes, 16 Apr 00 |
private int |
computeArrayIndexOfOneLevelByOctant(OctreeNode octreeNode)
This method assumes that the octree nodes being read in are already sorted in DFS order. |
private int |
computeArrayIndexOfOneLevelByOctant(OctreeNode octreeNode,
int bottomLevel,
int currentOffset)
Unlike the procedure above, this method does not assume that the octree nodes being added to the tree are already DFS sorted. |
boolean |
deleteNodes()
This method is called from Gridded3DMRSet.makeIsoSurface() in order to free up memory |
boolean |
deleteNodesDeprecated()
Deprecated. -the method does not work, the way the octree is being traversed, there is no way to avoid a null pointer exception. |
void |
errorCheck()
The purpose of this function is look for errors in the octree nodes (coordinate and data values) and their corresponding triangles. |
private int |
getColumnHeight(int level)
|
private int |
getColumnScale(int level)
|
static int |
getDirection()
getDirection() and setDirection() are used in order to remember from which direction we called OctreeNode.getNext() |
byte |
getFinestLevel()
|
private int |
getLayerDepth(int level)
|
private int |
getLayerScale(int level)
|
static int |
getLengthOfOneDimension(int level)
|
OctreeNode |
getNextByIndex()
This can be called from MarchingCubes.execute() for debugging purposes. |
int |
getNumBottomNodes()
|
static int |
getNumNodesAtLevel(int level)
|
OctreeNode |
getOctreeNodeAtArrayIndex(int i)
We don't want to issue an out of bounds warning because a child node maybe looking for a parent node that is not above the bottom level of storage in the octree node array |
int |
getRepresentation()
|
OctreeNode |
getRoot()
|
private int |
getRowLength(int level)
|
private int |
getRowScale(int level)
1 cube at level 7 has a row length of 128 (in block space) |
int |
getSize()
|
int |
getThrowAwayCount()
|
private int |
levelOffsetByCoord(int level)
|
private int |
levelOffsetByOctant(int level)
|
void |
printArray()
Print each level in the octree node array starting at the top, level 7, down to the bottom, level 3. |
static void |
setDirection(int newDir)
getDirection() and setDirection() are used in order to remember from which direction we called OctreeNode.getNext() |
boolean |
setFinestLevel(byte newLevel)
|
void |
setNumBottomNodes()
Increases the number of leaf nodes in the octree by 1 |
private boolean |
setOctreeNodeToArrayIndex(int i,
OctreeNode newNode)
|
void |
setRepresentation(int newRep)
|
void |
setSize()
Increases the size of the octree by 1 |
void |
setThrowAwayCount()
Increases the number of leaf nodes not added to the octree by 1 Called from BinaryCubeReader.throwAway() |
private int |
thisLevelOffsetByCoord(int level,
int xCoord,
int yCoord,
int zCoord)
There's a lot of extra code here for legibility purposes. |
private int |
thisLevelOffsetByOctant(int level,
int bottomLevel,
int octant)
The cube array is ordered by octants within levels. |
Methods inherited from class java.lang.Object |
|
Field Detail |
private static int direction
private OctreeNode root
private int size
private int bottomNodes
private int octreeNodeArrayIndex
private byte finestLevel
private int representation
private int throwAwayCount
private OctreeNode[] octreeNodeArray
Constructor Detail |
public Octree(int representation)
representation
- either multi-resolution or adaptive resolutionMethod Detail |
public int getSize()
public void setSize()
public int getNumBottomNodes()
public void setNumBottomNodes()
public void setThrowAwayCount()
public int getThrowAwayCount()
public int getRepresentation()
public void setRepresentation(int newRep)
newARlevel
- the new AR representation thresholdpublic byte getFinestLevel()
public boolean setFinestLevel(byte newLevel)
the
- finest level of resolution the octree node currently
being added to the octree belongs inpublic static int getDirection()
public static void setDirection(int newDir)
direction
- the direction we are currently traversing the
octree in: either
Constant.FROMLEFT ,
Constant.FROMTOP ,
Constant.FROMBOTTOM public OctreeNode getRoot()
public OctreeNode getOctreeNodeAtArrayIndex(int i)
i
- an octree node array indexprivate boolean setOctreeNodeToArrayIndex(int i, OctreeNode newNode)
i
- an octree node array indexnewNode
- the octree node at that array indexpublic boolean deleteNodes()
public boolean deleteNodesDeprecated()
octant
- the octant in which to delete the nodespublic void addNodeFromTop(OctreeNode newNode)
newNode
- an octree nodepublic void addNodeFromBottom(OctreeNode octreeNode)
IF the parent node is in the array THEN use the parent pointer to set the parent's new child ELSE create the parent node AND set its octree node array pointer THEN use the parent pointer to set the parent's new childReject the root node or nodes with an invalid level.
octreeNode
- an octree nodepublic boolean addToOctreeNodeArray(OctreeNode octreeNode)
octreeNode
- the octree node to addpublic int computeArrayIndexByOctant(OctreeNode octreeNode)
octreeNode
- the node whose array index we are computinglevel
- the level of the octreeNodeprivate int computeArrayIndexOfOneLevelByOctant(OctreeNode octreeNode)
octreeNode
- the octree node whose index we are computingprivate int computeArrayIndexOfOneLevelByOctant(OctreeNode octreeNode, int bottomLevel, int currentOffset)
octreeNode
- the node whose array index we are computingbottomLevel
- the level of the original octree node from
computeArrayIndexByOctant()currentOffset
- the offset into the array of cubes thus farprivate int computeArrayIndexByCoord(OctreeNode octreeNode)
octree level number of nodes ------------ --------------- 7 1 -the root 6 8 (2 x 2 x 2) -the root's 8 children 5 64 (4 x 4 x 4) 4 512 (8 x 8 x 8) 3 4,096 (16 x 16 x 16) -------------------------------- 6 4,681 total 2 32,768 (32 x 32 x 32) -------------------------------- 7 37,449 -with level 2
octree
- nodeprivate int thisLevelOffsetByOctant(int level, int bottomLevel, int octant)
all of the cubes that lie in octant 1 at level 5 are in and are children
of child 0 at level 6 are in array indices
[ (0 * (64^3 - 1)) +
(1 * 32^3 to 2 * (32^3 - 1) ]
etc.
dimensions in dimensions in level block space coordinate space level scale ----- ------------- ----------------- ----------- 7 1 x 1 x 1 128 x 128 x 128 128^3 6 2 x 2 x 2 64 x 64 x 64 64^3 5 4 x 4 x 4 32 x 32 x 32 32^3 4 8 x 8 x 8 16 x 16 x 16 16^3 3 16 x 16 x 16 8 x 8 x 8 8^3 2 32 x 32 x 32 4 x 4 x 4 4^3 1 64 x 64 x 64 2 x 2 x 2 2^3 0 128 x 128 x 128 1 x 1 x 1 1^3
level
- level in the octreebottomLevel
- the level of the original octree node from
computeArrayIndexByOctant()octant
- the octant at that levelprivate int thisLevelOffsetByCoord(int level, int xCoord, int yCoord, int zCoord)
level
- the level of the cube (and node)xCoord
- the x block coordinate index of the cubeyCoord
- the y block coordinate index of the cubezCoord
- the z block coordinate index of the cubeprivate int levelOffsetByOctant(int level)
level
- a level of the octreeprivate int levelOffsetByCoord(int level)
level
- a level of the octreepublic static int getNumNodesAtLevel(int level)
level
- a level in the octreepublic static int getLengthOfOneDimension(int level)
level
- a level in an octreethe
- number of cubes along 1 x,y,z dimension in that levelprivate int getRowScale(int level)
level 1 cube length ----- ------------- 7 128 6 64 5 32 4 16 3 8 2 4 1 2 0 1
level
- a level in the octreeprivate int getColumnScale(int level)
level
- a level in the octreeprivate int getLayerScale(int level)
level
- a level in the octreeprivate int getRowLength(int level)
level
- a level in the octreeprivate int getColumnHeight(int level)
level
- a level in the octreeprivate int getLayerDepth(int level)
level
- a level in the octreepublic OctreeNode getNextByIndex()
public void errorCheck()
public void printArray()
|
IsoSurface Rendering of an AR Representation | |||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |