IsoSurface Rendering of an AR Representation

rlaramee
Class ChainGang

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

public class ChainGang
extends java.lang.Object

Description: This class encapsulates all the AR chain processing. Finer resolution nodes search their coarser resolution neighbors for triangle edges that lie on the faces and edges of their coarser neighbors. When a shared trianlge edge is found, it is added to a list of triangle edges. The triangle edges are then assembled into chains. A group of chains belonging to an OctreeARnode is called a chain gang. Their maybe multiple chains on each face of a cube.

start date Wed 16 May 2001

Version:
1.0
Author:
Robert S Laramee
See Also:

Field Summary
private  Chain[] chainGang
          the list of triangle edges is re-assembled into a chain gang
private  java.util.ArrayList triangleEdges
          a list of triangle edges
 
Constructor Summary
ChainGang()
          For now, we reserve one chain for each side of the cube.
 
Method Summary
 void addTriangleEdge(TriangleEdge triangleEdge)
          This method is called from OctreeARnode.addTriangleEdge()
 void assemble()
          This method is called from OctreeARnode.assembleChainGang() .
 byte faceWithMaxChains()
           
 Chain getChain(byte face)
          Also called from OctreeInternalNode.generateTriangleFans()
private  TriangleEdge getChainLink(TriangleEdge link)
          This method is called from OctreeARnode.assembleChainGang() .
private  TriangleEdge getChainStarter(byte face)
          This method is called from OctreeARnode.assembleChainGang() .
 java.util.ArrayList getTriangleEdges()
           
 byte maxChainsPerFace()
          For our first version, there can only be one chain on a face.
private  void setChain(byte face, Chain newChain)
           
private  void setChainLink(TriangleEdge link, byte face)
           
 boolean setTriangleEdges(java.util.ArrayList newList)
           
 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

triangleEdges

private java.util.ArrayList triangleEdges
a list of triangle edges

chainGang

private Chain[] chainGang
the list of triangle edges is re-assembled into a chain gang
Constructor Detail

ChainGang

public ChainGang()
For now, we reserve one chain for each side of the cube. The mapping from index to side is:
  index  side
  -----  ----
   0     Constant.RIGHT (x directions)
   1     Constant.LEFT
   2     Constant.UP    (y directions)
   3     Constant.DOWN
   4     Constant.FRONT (z directions)
   5     Constant.BACK
  
For now, we'll leave the triangle edges that don't "fit" onto a chain on the triangle edge list

Must watch out for MR and AR chains

Method Detail

getTriangleEdges

public java.util.ArrayList getTriangleEdges()
Returns:
this OctreeNode's triangle edge list

setTriangleEdges

public boolean setTriangleEdges(java.util.ArrayList newList)
Parameters:
newList - a triangle edge list for this octree node
Returns:
TRUE if the call to set() was successful

addTriangleEdge

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

Parameters:
triangleEdge - the triangle edge we are adding to this AR octree node

getChain

public Chain getChain(byte face)
Also called from OctreeInternalNode.generateTriangleFans()

Parameters:
face - one of 6 faces on the cube:
Returns:
-the chain on the given face

setChain

private void setChain(byte face,
                      Chain newChain)
Parameters:
face - one of 6 faces on the cube:
newChain - a new Chain object

setChainLink

private void setChainLink(TriangleEdge link,
                          byte face)
Parameters:
link - a link in one of the chains
face - the AR octree node's face that the link is on

assemble

public void assemble()
This method is called from OctreeARnode.assembleChainGang() .

It is called after the first pass through the AR data and all of the AR octree nodes have been identified. It's job is to re-assemble the list of triangle edges that belong to this node into chains of edges that lie on the faces of this node.


getChainLink

private TriangleEdge getChainLink(TriangleEdge link)
This method is called from OctreeARnode.assembleChainGang() . Given a triangle edge, it searches the remaining triangle edges for one that can be linked to this one. If a link is found, it is removed from the remaining triangle edges.

Parameters:
edge - a triangle edge
Returns:
the first (and only) triangle edge that links with the given edge

getChainStarter

private TriangleEdge getChainStarter(byte face)
This method is called from OctreeARnode.assembleChainGang() . It starts at the beginning of the list of triangle edges and removes the first occurance of a triangle edge that contains a shared edge vertex.

Parameters:
face - the cube face on which to check for a chain starter
Returns:
the first triangle edge that contains a shared edge vertex

maxChainsPerFace

public byte maxChainsPerFace()
For our first version, there can only be one chain on a face. IF there are leftover triangle edges on the same face as a chain THEN we'll just return 2

Returns:
the number of chains on the face with the greatest number of chains

faceWithMaxChains

public byte faceWithMaxChains()
Returns:
the face (of a cube) that has the most Chain objects on it

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