IsoSurface Rendering of an AR Representation

rlaramee
Class IsoSurfaceAdaptive

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

public class IsoSurfaceAdaptive
extends java.lang.Object

Description: The adapative isosurface consists of all coarser octree nodes and their cubes that share vertices either on their (own) edges or faces with finer resolution neighbors. The IsoSurface object contains and IsoSurfaceAdaptive which it does not need to use in an MR octree representation -only the different AR representations.

start date Mon 26 Mar 01

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

Field Summary
private  int num3rdPassNodes
          the number of nodes added to the 2nd pass list while processing the 2nd pass list (not on the first pass)
private  int[] numPolygonsRemoved
          counts how many polygons have been removed from the surface
private  int NUMRESOLUTIONS
           
private  java.util.ArrayList res128nodes
          These are all AR nodes in the AR isosurface.
private  java.util.ArrayList res16nodes
           
private  java.util.ArrayList res2nodes
           
private  java.util.ArrayList res32nodes
           
private  java.util.ArrayList res4nodes
           
private  java.util.ArrayList res64nodes
           
private  java.util.ArrayList res8nodes
           
private  IsoSurface surface
          The IsoSurface object represents the uniform resolution portion of the isoSurface
private  int[] totalNumEdgeVertices
          statistics.
private  int[] totalNumFacialVertices
           
private  int[] totalNumIncompleteARs
          good error checking idea
private  int[] totalNumMissingVertexCases
           
private  int[] totalNumSubdivides
           
private  int[] totalNumTrianglesDeleted
           
 
Constructor Summary
IsoSurfaceAdaptive(IsoSurface isoSurface)
          constructor
 
Method Summary
 boolean addAdaptiveNode(OctreeNode coarseNode, boolean firstPass)
           
private  java.util.ArrayList getAdaptiveNodes(short resolution)
           
private  int getNum3rdPassNodes()
          For now this is for keeping statistics
private  IsoSurface getSurface()
           
private  int getTotalNumEdgeVertices(short resolution)
           
private  int getTotalNumFacialVertices(short resolution)
           
private  int getTotalNumIncompleteARs(short resolution)
           
private  int getTotalNumMissingVertexCases(short resolution)
           
private  int getTotalNumSubdivides(short resolution)
           
private  int getTotalNumTrianglesDeleted(short resolution)
           
private  boolean mc8children(OctreeNode parentNode)
          This method is called from MarchingCubes.processSubdivide()
private  void printDebuggingMessage(OctreeNode coarseNode)
           
 void printStatistics()
          Print some information about the AR isosurface.
private  boolean process2ndPass()
          
 boolean processAdaptiveSurface()
          We have access to the marching cubes object needed to generate triangles and the isovalue through the IsoSurface object
private  boolean processEdgeList(OctreeNode coarseNode)
           
private  boolean processResolution(short resolution)
          This is a new part of the MC algorithm.
private  boolean processSubdivide(OctreeNode coarseNode, byte coarseToFineDir)
          Part of the subdivision process is to delete the previously generated coarser resolution triangles from the isosurface.
private  void recordResolutionStats(OctreeNode node)
          Keep statistics about The total number of facial vertices The total number of edge vertices The number of missing vertex cases
private  void setNum3rdPassNodes()
          This counts the number of nodes that were added to the second pass list while processing the second pass list
private  void setSurface(IsoSurface isoSurface)
           
private  void setTotalNumEdgeVertices(short resolution, int newVertices)
           
private  void setTotalNumFacialVertices(short resolution, int newVertices)
           
private  void setTotalNumIncompleteARs(short resolution)
           
private  void setTotalNumMissingVertexCases(short resolution)
           
private  void setTotalNumSubdivides(short resolution)
           
private  void setTotalNumTrianglesDeleted(byte n, short resolution)
           
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

surface

private IsoSurface surface
The IsoSurface object represents the uniform resolution portion of the isoSurface

res128nodes

private java.util.ArrayList res128nodes
These are all AR nodes in the AR isosurface. They represent a transition from one resolution to another. The res128nodes represent the transition from 256^3 to 128^3 resolution. The nodes themselves are 128^3 resolution though they contain vertices along their edges or on their faces from 256^3 resolution neighbors

res64nodes

private java.util.ArrayList res64nodes

res32nodes

private java.util.ArrayList res32nodes

res16nodes

private java.util.ArrayList res16nodes

res8nodes

private java.util.ArrayList res8nodes

res4nodes

private java.util.ArrayList res4nodes

res2nodes

private java.util.ArrayList res2nodes

NUMRESOLUTIONS

private final int NUMRESOLUTIONS

totalNumEdgeVertices

private int[] totalNumEdgeVertices
statistics. these are all arrays because we keep stats for each resolution

totalNumFacialVertices

private int[] totalNumFacialVertices

totalNumSubdivides

private int[] totalNumSubdivides

totalNumMissingVertexCases

private int[] totalNumMissingVertexCases

totalNumTrianglesDeleted

private int[] totalNumTrianglesDeleted

totalNumIncompleteARs

private int[] totalNumIncompleteARs
good error checking idea

numPolygonsRemoved

private int[] numPolygonsRemoved
counts how many polygons have been removed from the surface

num3rdPassNodes

private int num3rdPassNodes
the number of nodes added to the 2nd pass list while processing the 2nd pass list (not on the first pass)
Constructor Detail

IsoSurfaceAdaptive

public IsoSurfaceAdaptive(IsoSurface isoSurface)
constructor

Parameters:
the - isosurface of which this adaptive portion is a part of
Method Detail

getSurface

private IsoSurface getSurface()
Returns:
the isosurface of which this adaptive object is a portion of

setSurface

private void setSurface(IsoSurface isoSurface)
Parameters:
the - isosurface of which this adaptive object is a portion of

getAdaptiveNodes

private java.util.ArrayList getAdaptiveNodes(short resolution)
Parameters:
resolution - the resolution of adaptive nodes to return
Returns:
the list of AR nodes at the given resolution

getTotalNumEdgeVertices

private int getTotalNumEdgeVertices(short resolution)
Returns:
the total number of triangle edge vertices at the given resolution

setTotalNumEdgeVertices

private void setTotalNumEdgeVertices(short resolution,
                                     int newVertices)
Parameters:
resolution - the resolution of nodes we're adding the new vertices too
newVertices - the total number of triangle edge vertices at the given resolution

getTotalNumFacialVertices

private int getTotalNumFacialVertices(short resolution)
Returns:
the total number of triangle facial vertices at the given resolution

setTotalNumFacialVertices

private void setTotalNumFacialVertices(short resolution,
                                       int newVertices)
Parameters:
resolution - the resolution we're adding the total to
newVertices - the total number of new triangle edge vertices at the given resolution

getTotalNumSubdivides

private int getTotalNumSubdivides(short resolution)
Returns:
the total number of subdivided nodes at the given resolution

setTotalNumSubdivides

private void setTotalNumSubdivides(short resolution)
Parameters:
the - total number of subdivided nodes at the given resolution

getTotalNumMissingVertexCases

private int getTotalNumMissingVertexCases(short resolution)
Returns:
the total number of missing vertex cases at the given resolution

setTotalNumMissingVertexCases

private void setTotalNumMissingVertexCases(short resolution)
Parameters:
the - total number of missing vertex cases at the given resolution

getTotalNumIncompleteARs

private int getTotalNumIncompleteARs(short resolution)
Returns:
the total number of incomplete AR cases at the given resolution

setTotalNumIncompleteARs

private void setTotalNumIncompleteARs(short resolution)
Parameters:
the - total number of incomplete AR cases at the given resolution

getTotalNumTrianglesDeleted

private int getTotalNumTrianglesDeleted(short resolution)
Returns:
the total number of triangles deleted at the given resolution

setTotalNumTrianglesDeleted

private void setTotalNumTrianglesDeleted(byte n,
                                         short resolution)
Parameters:
n - the number, n, of triangles that have just been deleted
the - total number of incomplete AR cases at the given resolution

getNum3rdPassNodes

private int getNum3rdPassNodes()
For now this is for keeping statistics

Returns:
the number of nodes that were added to the second pass list while processing the second pass list

setNum3rdPassNodes

private void setNum3rdPassNodes()
This counts the number of nodes that were added to the second pass list while processing the second pass list

addAdaptiveNode

public boolean addAdaptiveNode(OctreeNode coarseNode,
                               boolean firstPass)
Parameters:
coarseNode - an octree node to add to the AR surface
firstPass - is TRUE if we are performing MC on the first pass through the octree
Returns:
TRUE if it was actually added to the list, FALSE if it was already on the list.

processAdaptiveSurface

public boolean processAdaptiveSurface()
We have access to the marching cubes object needed to generate triangles and the isovalue through the IsoSurface object
Returns:
TRUE if the process ended successfully

process2ndPass

private boolean process2ndPass()

Returns:
TRUE if the process ended successfully

processResolution

private boolean processResolution(short resolution)
This is a new part of the MC algorithm. All the coarser resolution octree nodes that share triangle vertices with finer resolution nodes get put on a second pass list. This is because we can't predict how many shared vertices they will have on their edges or faces as a result of finer resolution neighbors generating triangles. Therefore, after the first pass through the data with the MC algorithm, we make a second pass through these coarser nodes. It is here where we attempt to process these shared vertices.

The first version of the algorithm is:

 Count the number of chains on each face of the AR octree node
 IF there are 2 or more chains on the same face THEN 
    subdivide
 ELSE 
    FOR EACH CHAIN
       Match a chain with a native triangle vertex
       out put a fan of triangles
 
This is something we may want to include too:

 IF there are any facial vertices THEN 
    grab the first one and subdivide.

 

We also have to decide when to apply inconsistent interpolation updates

Parameters:
resolution - the resolution of AR nodes to process

processSubdivide

private boolean processSubdivide(OctreeNode coarseNode,
                                 byte coarseToFineDir)
Part of the subdivision process is to delete the previously generated coarser resolution triangles from the isosurface.

Parameters:
coarseNode - the octree node with the 8 new children as a result of subdividing.
coarseToFineDir - the direction from the coarse node to the fine adjacent node (causing the subdivide)
Returns:
TRUE if the triangles were generated successfully

mc8children

private boolean mc8children(OctreeNode parentNode)
This method is called from MarchingCubes.processSubdivide()

It performs the MC algorithm on 8 child nodes.

Parameters:
parentNode - the octree node with the 8 new children as a result of subdividing.
Returns:
TRUE if the triangles were generated successfully

processEdgeList

private boolean processEdgeList(OctreeNode coarseNode)
Parameters:
coarseNode - the octree node whose edges need inspecting
Returns:
TRUE if the triangles were generated successfully

printStatistics

public void printStatistics()
Print some information about the AR isosurface.

recordResolutionStats

private void recordResolutionStats(OctreeNode node)
Keep statistics about
  1. The total number of facial vertices
  2. The total number of edge vertices
  3. The number of missing vertex cases

printDebuggingMessage

private void printDebuggingMessage(OctreeNode coarseNode)
Parameters:
coarseNode - the node we are printing

IsoSurface Rendering of an AR Representation