IsoSurface Rendering of an AR Representation

rlaramee
Class OctreeARnode

java.lang.Object
  |
  +--rlaramee.OctreeARnode

public class OctreeARnode
extends java.lang.Object

Description: Adaptive Resolution octree nodes have more responsibilities than a "plain" octree node. Conceptually, AR octree nodes represent nodes that occur at a transition in resolution within an isosurface. So, an AR octree node has one or more finer resolution neighbors and this AR node and its finer neighbor(s) share triangle vertices on either this node's edge or face (or both).

Ultimately an IsoSurfaceAdaptive object should be made up of only OctreeARnode objects.

This class contains methods that octree nodes need in order to identify/find and collaborate with their AR neighbors e.g. octree nodes at a different resolution than themselves. One reason we added this class is because the OctreeNode class got too big. At one point, it was over 3,000 lines. Another reason is because this makes for better design and is clearer conceptually.

start date Mon 23 Apr '01

Version:
1.0
Author:
Robert S Laramee
See Also:
OctreeNode.java

Field Summary
private  ChainGang chainGang
           
private  java.util.Vector edgeVertexList
           
private  java.util.Vector facialVertexList
          This sharedVertexList is examined when octree nodes on the IsoSurfaceAdaptive list is traversed.
private  OctreeInternalNode octreeInternalNode
          each AR octree node collaborates with an internal octree node
 
Constructor Summary
OctreeARnode(OctreeInternalNode octreeInternalNode)
          constuctor
 
Method Summary
 boolean addEdgeVertex(SharedEdgeVertex newSharedVertex)
          We make the OctreeInternalNode.addEdgeVertex() a little bit more sophisticated in that the edge vertices are maintained in edge order .
 boolean addFacialVertex(SharedFacialVertex newSharedVertex)
           
 void addTriangleEdge(TriangleEdge triangleEdge)
          This method is called from IsoSurface.addARverticesToNeighbor()
 void assembleChainGang()
          This method is called from IsoSurfaceAdaptive.processResolution() .
private  byte assembleTriangleFan(IsoSurface surface, Chain chain, TriangleVertex startVertex, TriangleVertex farVertex, TriangleVertex endVertex)
           
private  SharedFacialVertex createFacialVertex(TriangleVertex vertex, byte octant, byte face)
          This method is called from OctreeARnode.onCoarseFace() .
private  SharedEdgeVertex createSharedVertex(TriangleVertex vertex, byte octant, byte direction, byte edge)
          This method is called from OctreeARnode.onCoarseEdge() .
 byte faceWithMaxChains()
          This method is called from IsoSurfaceAdaptive.processResolution() .
private  Triangle findTriangleOnFace(byte face, boolean[] verticesOnFace)
          This method is called from OctreeInternalNode.generateTriangleFans() It identifies if one of an octree node's triangles has an edge on the given face.
private  byte generateTriangleFan(IsoSurface surface, Chain chain, Triangle triangle, boolean[] verticesOnFace)
          Called from OctreeInternalNode.generateTriangleFans()
 byte generateTriangleFans(IsoSurface surface)
          This is called from IsoSurfaceAdaptive.processResolution() For each chain that the AR octree node has, a fan of triangles is generated, provided that a matching native triangle is found.
 ChainGang getChainGang()
          Called from OctreeInternalNode.generateTriangleFans()
 java.util.Vector getEdgeVertexList()
           
 java.util.Vector getFacialVertexList()
           
private  OctreeInternalNode getInternalNode()
           
private  java.util.Vector getTriangleList()
           
 OctreeNode[] mapAdjacentChildrenCoarseToFineDir(OctreeNode node, byte fromCoarseToFineDir)
          Deprecated. -coarser octree nodes do not inspect finer resolution neighbors
 byte maxChainsPerFace()
          This method is called from IsoSurfaceAdaptive.processResolution() .
 SharedEdgeVertex onCoarseEdge(TriangleVertex fineVertex, byte fineOctant, byte direction)
          This method determines whether or not a triangle vertex lies on the edge of a coarser neighboring octree node.
 SharedFacialVertex onCoarseFace(TriangleVertex fineVertex, byte fineOctant, byte direction)
          Do not think that if a triangle vertex is not on it's coarser neighbors edge, that it must be on it's neighbor's face.
private  void setChainGang()
           
 boolean setEdgeVertexList(java.util.Vector newList)
           
 boolean setFacialVertexList(java.util.Vector newList)
           
private  void setInternalNode(OctreeInternalNode oin)
          Only internal octree nodes can be AR i.e.
 java.lang.String toString()
          print out a node's information
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, wait, wait, wait
 

Field Detail

octreeInternalNode

private OctreeInternalNode octreeInternalNode
each AR octree node collaborates with an internal octree node

facialVertexList

private java.util.Vector facialVertexList
This sharedVertexList is examined when octree nodes on the IsoSurfaceAdaptive list is traversed.

edgeVertexList

private java.util.Vector edgeVertexList

chainGang

private ChainGang chainGang
Constructor Detail

OctreeARnode

public OctreeARnode(OctreeInternalNode octreeInternalNode)
constuctor
Parameters:
node - an octree node that has been identified as an adaptive resolution node
Method Detail

setInternalNode

private void setInternalNode(OctreeInternalNode oin)
Only internal octree nodes can be AR i.e. the finest resolution octree nodes are never AR nodes.

Parameters:
an - internal octree node

getInternalNode

private OctreeInternalNode getInternalNode()
Returns:
this adaptive node's native internal octree node

getEdgeVertexList

public java.util.Vector getEdgeVertexList()
Returns:
this OctreeNode's shared edgeVertexList

setEdgeVertexList

public boolean setEdgeVertexList(java.util.Vector newList)
Parameters:
newList - a shared EdgeVertexList for this octree node
Returns:
TRUE if the call to set() was successful

getFacialVertexList

public java.util.Vector getFacialVertexList()
Returns:
this OctreeNode's shared facialVertexList

setFacialVertexList

public boolean setFacialVertexList(java.util.Vector newList)
Parameters:
newList - a shared facialVertexList for this octree node
Returns:
TRUE if the call to set() was successful

getTriangleList

private java.util.Vector getTriangleList()
Returns:
the list of triangles in this octree node

getChainGang

public ChainGang getChainGang()
Called from OctreeInternalNode.generateTriangleFans()

Returns:
the chain gang that belongs to this AR octree node

setChainGang

private void setChainGang()

assembleChainGang

public void assembleChainGang()
This method is called from IsoSurfaceAdaptive.processResolution() .

See Also:
ChainGang.assemble()

maxChainsPerFace

public byte maxChainsPerFace()
This method is called from IsoSurfaceAdaptive.processResolution() .

See Also:
ChainGang.maxChainsPerFace()

faceWithMaxChains

public byte faceWithMaxChains()
This method is called from IsoSurfaceAdaptive.processResolution() .

See Also:
ChainGang.faceWithMaxChains()

generateTriangleFans

public byte generateTriangleFans(IsoSurface surface)
This is called from IsoSurfaceAdaptive.processResolution() For each chain that the AR octree node has, a fan of triangles is generated, provided that a matching native triangle is found.

Parameters:
surface - a reference to the isosurface
Returns:
the number of new triangles that were added to the surface

generateTriangleFan

private byte generateTriangleFan(IsoSurface surface,
                                 Chain chain,
                                 Triangle triangle,
                                 boolean[] verticesOnFace)
Called from OctreeInternalNode.generateTriangleFans()

Parameters:
surface - a reference to the isosurface
chain - a chain of triangle edges on the side of an AR octree node/cub
triangle - one of this internal octree node's native triangles
verticesOnFace - identifies which 2 of the triangle vertices are on the same face as the given chain.
Returns:
the number of triangles in the fan

assembleTriangleFan

private byte assembleTriangleFan(IsoSurface surface,
                                 Chain chain,
                                 TriangleVertex startVertex,
                                 TriangleVertex farVertex,
                                 TriangleVertex endVertex)
Parameters:
surface - a reference to the isosurface
chain - a chain of triangle edges
startVertex - the coarse triangle vertex that starts the chain
farVertex - the coarse triangle vertex that is connected to each triangle in the fan
endVertex - the coarse triangle vertex that ends the chain

findTriangleOnFace

private Triangle findTriangleOnFace(byte face,
                                    boolean[] verticesOnFace)
This method is called from OctreeInternalNode.generateTriangleFans() It identifies if one of an octree node's triangles has an edge on the given face.

Parameters:
face - one of 6 faces of a cube
verticesOnFace - identifies those triangle vertices that lie on the given face
Returns:
the triangle whose edge lies on this face

addEdgeVertex

public boolean addEdgeVertex(SharedEdgeVertex newSharedVertex)
We make the OctreeInternalNode.addEdgeVertex() a little bit more sophisticated in that the edge vertices are maintained in edge order . Rather than sorting the list when it's done, we'll just maintain them in edge order at add time.

Parameters:
newSharedVertex - one to add to the list
Returns:
TRUE if it was actually added to the list, FALSE if it was already on the list.

addFacialVertex

public boolean addFacialVertex(SharedFacialVertex newSharedVertex)
Parameters:
newSharedVertex - one to add to the list
Returns:
TRUE if it was actually added to the list, FALSE if it was already on the list.

addTriangleEdge

public void addTriangleEdge(TriangleEdge triangleEdge)
This method is called from IsoSurface.addARverticesToNeighbor()

See Also:
ChainGang.addTriangleEdge()

onCoarseEdge

public SharedEdgeVertex onCoarseEdge(TriangleVertex fineVertex,
                                     byte fineOctant,
                                     byte direction)
This method determines whether or not a triangle vertex lies on the edge of a coarser neighboring octree node. It's called from IsoSurface.processCoarserNeighbor() .

Distinguishing shared edge intersections is going to depend on the calling octree node's octant and direction. There's a figure called, ARnodeIdentifier that is a useful visual aid. It was used in order to write this method. It's in the ~sdb/rlaramee/ARfig directory.

             P3_____e2______P2   This is the cube representation
             /|            /|    used write the method.
           e10|          e11|    It is the same as the VTK's except 
   y     P7______e6____P6/  |    for the orientation of the 
   ^      |   e3        |   e1   y,z axes.
   |      |   |         |   |    
   |      e7  |         e5  |
   |--->  | P0|_____e0__|___|P1
  /    x  |  /          |  /
 /        | e8          | e9
z         |/_____e4_____|/
         P4             P5
 

Parameters:
fineVertex - the finer resolution triangle vertex that may lie on a neighbor's edge
fineOctant - the octant that the calling finer resolution octree node neigbor is in
direction - the direction from the finer resolution node TO the coarser resolution node
Returns:
a SharedEdgeVertex object if this fine vertex lies on a coarse edge, otherwise return null;

createSharedVertex

private SharedEdgeVertex createSharedVertex(TriangleVertex vertex,
                                            byte octant,
                                            byte direction,
                                            byte edge)
This method is called from OctreeARnode.onCoarseEdge() .

Parameters:
vertex - the finer resolution triangle vertex that may lie on a neighbor's edge
octant - the octant that the calling finer resolution octree node neigbor is in
direction - the direction from the finer resolution node TO the coarser resolution node
Returns:
SharedEdgeVertex object if this fine vertex lies on a coarse edge, otherwise return null

createFacialVertex

private SharedFacialVertex createFacialVertex(TriangleVertex vertex,
                                              byte octant,
                                              byte face)
This method is called from OctreeARnode.onCoarseFace() .

Parameters:
vertex - the finer resolution triangle vertex that may lie on a neighbor's edge
octant - the octant that the calling finer resolution octree node neigbor is in
face - the face on the coarser node i.e. this node that has the facial vertex
Returns:
SharedFacialVertex object if this fine vertex lies on a coarse edge, otherwise return null

onCoarseFace

public SharedFacialVertex onCoarseFace(TriangleVertex fineVertex,
                                       byte fineOctant,
                                       byte direction)
Do not think that if a triangle vertex is not on it's coarser neighbors edge, that it must be on it's neighbor's face. This is not true. The triangle vertex could be on some other neighbor's edge or face. This is called from IsoSurface.processCoarserNeighbor() if OctreeARnode.onCoarseEdge() returns null.

Identifying facial intersections is going to depend on the calling octree node's octant and direction. There's a figure called, ARnodeIdentifier that is a useful visual aid. It was used in order to write this method. It's in the ~sdb/rlaramee/ARfig directory.

Parameters:
fineEdge - the finer resolution neighboring octree node edge that may be
fineOctant - the octant that the calling finer resolution octree node neigbor is in
direction - the direction from the finer resolution cube to the coaser resolution neighbor.
Returns:
TRUE if the given edge is on the coarser neighbor's face

mapAdjacentChildrenCoarseToFineDir

public OctreeNode[] mapAdjacentChildrenCoarseToFineDir(OctreeNode node,
                                                       byte fromCoarseToFineDir)
Deprecated. -coarser octree nodes do not inspect finer resolution neighbors

This was called from OctreeNode.getEdgeVerticesOfFinerNeighbors() a method which is not used anymore.

For a given direction, an octreeNode only has 4 face neighbors at a finer resolution. The given direction is the direction from the coarse neigbor to the neighbor with the finer resolution children .

This method was double checked. The long names are a result of how easy it is to get confused writing this method.

Parameters:
fromCoarseToFineDir - the direction the coarse neighbor is looking in
node - the octree node calling this method
Returns:
fourChildren -the four child nodes adjacent to an octree node from the given direction

toString

public java.lang.String toString()
print out a node's information

Overrides:
toString in class java.lang.Object
Returns:
a string representation of this octree node

IsoSurface Rendering of an AR Representation