IsoSurface Rendering of an AR Representation

rlaramee
Class Triangle

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

public class Triangle
extends java.lang.Object

Description: Ultimately, triangles are what is generated and rendered. They are the output. Because we are dealing with an adaptive resolution, we have, in some instances a large, unsubdivided node, and a large triangle. When we make a transition into a higher resolution node we may either:

  1. break the larger triangle into two triangles to accomodate that transition or
  2. merge two triangles into one to accomodate the triangle list
  3. subdivide the larger cube until it is at the same resolution as its neighbor. Then perform the regular marching cubes algorithm on it.

start date Sun 02 May 1999

Version:
1.0
Author:
Robert S Laramee
See Also:

Field Summary
private  boolean debug
           
private  TriangleVertexList triangleVertexList
           
private  int vertex0
          This was change to 3 individual integers in order to save 4 bytes/Triangle -the pointer to the array itself
private  int vertex1
           
private  int vertex2
           
 
Constructor Summary
Triangle(TriangleVertexList tvl)
          constructor(s)
 
Method Summary
 int addVertex(byte i, int index)
           
 int getListIndex(byte vertex)
           
 TriangleVertexList getTriangleVertexList()
           
 TriangleVertex getVertex(byte i)
           
private  boolean isWithin(byte vertexNumber, TriangleVertex tVertex, Cube cube)
          This method checks to see if a vertex is within the spacial bounds of a cube
 boolean isWithin(Cube cube)
          This function checks to see if this triangle is within the spacial bounds of the cube passed (as part of the error check) It's called from OctreeNode.errorCheck()
private  void printError(byte vertex, int axis, Cube cube)
          used in error checking
 int removeVertex(byte vertexNumber)
          Called from OctreeNode.removeTriangles() , this method removes a TriangleVertex from the triangleVertexList
private  boolean setTriangleVertexList(TriangleVertexList tvl)
           
 java.lang.String toString(Cube cube)
           
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

vertex0

private int vertex0
This was change to 3 individual integers in order to save 4 bytes/Triangle -the pointer to the array itself

private int[] vertices; (index into vertex list)


vertex1

private int vertex1

vertex2

private int vertex2

triangleVertexList

private TriangleVertexList triangleVertexList

debug

private boolean debug
Constructor Detail

Triangle

public Triangle(TriangleVertexList tvl)
constructor(s)
Method Detail

getTriangleVertexList

public TriangleVertexList getTriangleVertexList()
Returns:
triangleVertexList -the global triangleVertexList object that makes up an isoSurface

setTriangleVertexList

private boolean setTriangleVertexList(TriangleVertexList tvl)
Parameters:
triangleVertexList - a global triangleVertexList object that makes up an isoSurface
Returns:
TRUE if the call to set() was successful

getVertex

public TriangleVertex getVertex(byte i)
Parameters:
i - either vertex 0, 1, or 2
Returns:
triangleVertex -a TriangleVertex from the global TriangleVertexList object

getListIndex

public int getListIndex(byte vertex)
Parameters:
vertex - either 0,1,2 the 1st, 2nd, or 3rd vertex
Returns:
vertexIndex -the index into the TriangleVertexList of the vertex

addVertex

public int addVertex(byte i,
                     int index)
Parameters:
i - the 0th, 1st, or 2nd vertex
index - -the vertex index in the VertexList

removeVertex

public int removeVertex(byte vertexNumber)
Called from OctreeNode.removeTriangles() , this method removes a TriangleVertex from the triangleVertexList

Parameters:
vertexNumber - the 0th, 1st, or 2nd vertex
index - -the vertex index in the VertexList

isWithin

public boolean isWithin(Cube cube)
This function checks to see if this triangle is within the spacial bounds of the cube passed (as part of the error check) It's called from OctreeNode.errorCheck()

Returns:
TRUE if this Triangle is within the given Cube

isWithin

private boolean isWithin(byte vertexNumber,
                         TriangleVertex tVertex,
                         Cube cube)
This method checks to see if a vertex is within the spacial bounds of a cube

Parameters:
vertexNumber - which vertex we're checking
vertex - the vertex we're checking
cube - the bounding cube

Returns:
TRUE if this Vertex is within the given Cube

printError

private void printError(byte vertex,
                        int axis,
                        Cube cube)
used in error checking

toString

public java.lang.String toString(Cube cube)
Parameters:
cube - the cube that contains this triangle
Returns:
the string representation of the Triangle

IsoSurface Rendering of an AR Representation