|
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 | +--java.util.AbstractCollection | +--java.util.AbstractList | +--java.util.Vector | +--rlaramee.IsoSurface
Description: An IsoSurface is the output of the Marching Cubes rendering algorithm. The IsoSurface is a set of triangles.
start date Sun 02 May 1999
Field Summary | |
private Interpolator |
interpolator
|
private IsoSurfaceAdaptive |
isoSurfaceAdaptive
|
private float |
isoValue
number of octree nodes/cubes in isosurface |
private MarchingCubes |
MC
passed in order to use the generateTopologicalIndex() and getEdges() methods from the compareEdges() method |
private int |
numCubes
number of octree nodes/cubes in isosurface |
private TriangleVertexList |
triangleVertexList
|
Fields inherited from class java.util.Vector |
capacityIncrement, elementCount, elementData, serialVersionUID |
Fields inherited from class java.util.AbstractList |
modCount |
Constructor Summary | |
IsoSurface(float isoVal,
MarchingCubes mc)
constructor |
Method Summary | |
private void |
addARverticesToNeighbor(OctreeNode coarseNode,
SharedVertex[] vertices)
This method is called from IsoSurface.processCoarserNeighbor() |
void |
addNode(OctreeNode node)
addNode() adds a node, that has a triangle list, onto the IsoSurface. |
private boolean |
addSecondPassNode(OctreeNode coarseNode,
boolean firstPass)
|
private void |
addSingletons(OctreeNode coarseNode,
SharedVertex[] vertices,
boolean[] addSingleton)
This method is called from IsoSurface.addARverticesToNeighbor() |
void |
addTriangle(Triangle triangle)
addTriangle() adds a triangle onto the IsoSurface. |
Triangle |
addTriangleToSurface(OctreeNode node,
int[] listIndices)
This is called from IsoSurface.computeTriangle() and OctreeARnode.assembleTriangleFan() |
int[] |
addVerticesToVertexList(OctreeNode node,
TriangleVertex[] vertices)
This is called from IsoSurface.computeTriangle() and OctreeARnode.assembleTriangleFan() |
private int |
compareVertices(OctreeNode octreeNode,
TriangleVertex newVertex)
This method searches the given octree node's list of triangle vertices to see if one is the same as the given triangle vertex. |
private void |
computeTriangle(OctreeNode node,
byte[] edges,
byte[] uniqueEdges,
boolean firstPass)
Here's a edge to vertex pair mapping. |
void |
computeTriangles(OctreeNode node,
byte[] edges,
boolean firstPass)
The computeTriangles() method creates a new triangle for each set of 3 edge intersections in the cube. |
private TriangleVertex |
computeVertex(OctreeNode node,
byte edge)
This method is called from IsoSurface.computeTriangle() . |
private boolean |
findARoctreeNodes(OctreeNode octreeNode,
byte[] directions,
TriangleVertex[] vertices,
boolean firstPass)
Note: IsoSurface.findARoctreeNodes() is called from IsoSurface.computeTriangle() |
int |
getActualNumVertices()
This method is called from Gridded3DMRSet.makeIsoSurface() |
float[] |
getActualVisADcoords(int dimension)
"Actual" means get each unique vertex out of the vertex list i.e. |
(package private) float[] |
getError()
This hastily written method will return the error values associated with the surface points -PJR |
Interpolator |
getInterpolator()
|
private IsoSurfaceAdaptive |
getIsoSurfaceAdaptive()
|
float |
getIsoValue()
|
MarchingCubes |
getMarchingCubes()
|
private int |
getNumCubes()
|
int |
getNumPolygons()
|
Triangle |
getTriangle(int n)
getTriangle() returns triangle, n , in the IsoSurface. |
TriangleVertexList |
getVertexList()
|
private int |
inspectNeighbors(byte[] directions,
OctreeNode octreeNode,
TriangleVertex triangleVertex)
|
private boolean |
isNew(byte[] uniqueEdges,
byte edge)
|
void |
print()
Used for testing |
void |
processAdaptiveSurface()
This is called from MarchingCubes.execute() (at the end) |
private boolean |
processCoarserNeighbor(OctreeNode fineNode,
OctreeNode coarseNode,
byte direction,
TriangleVertex[] vertices)
Called from IsoSurface.findARoctreeNodes() |
private int |
searchTriangle(Triangle triangle,
TriangleVertex newVertex)
This is called from IsoSurface.compareVertices() |
void |
setInterpolator(Interpolator i)
|
private void |
setIsoSurfaceAdaptive(IsoSurfaceAdaptive newSurface)
|
void |
setIsoValue(float newVal)
|
void |
setMarchingCubes(MarchingCubes mc)
|
private void |
setNumCubes()
Set the number of cubes containing this isosurface. |
private void |
setTriangleVertexList(TriangleVertexList tvl)
|
private int |
sharedVertex(OctreeNode octreeNode,
TriangleVertex triangleVertex)
Note: IsoSurface.sharedVertex() is called from IsoSurface.computeTriangle() |
private int |
updateTriangleVertexList(OctreeNode node,
TriangleVertex newVertex)
This method updates the TriangleVertexList object. |
Methods inherited from class java.util.Vector |
add, add, addAll, addAll, addElement, capacity, clear, clone, contains, containsAll, copyInto, elementAt, elements, ensureCapacity, ensureCapacityHelper, equals, firstElement, get, hashCode, indexOf, indexOf, insertElementAt, isEmpty, lastElement, lastIndexOf, lastIndexOf, readObject, remove, remove, removeAll, removeAllElements, removeElement, removeElementAt, removeRange, retainAll, set, setElementAt, setSize, size, subList, toArray, toArray, toString, trimToSize, writeObject |
Methods inherited from class java.util.AbstractList |
iterator, listIterator, listIterator |
Methods inherited from class java.lang.Object |
|
Methods inherited from interface java.util.List |
iterator, listIterator, listIterator |
Field Detail |
private float isoValue
private Interpolator interpolator
private TriangleVertexList triangleVertexList
private int numCubes
private MarchingCubes MC
private IsoSurfaceAdaptive isoSurfaceAdaptive
Constructor Detail |
public IsoSurface(float isoVal, MarchingCubes mc)
Method Detail |
private int getNumCubes()
private void setNumCubes()
public MarchingCubes getMarchingCubes()
public void setMarchingCubes(MarchingCubes mc)
mc
- this IsoSurface object's MarchingCubes objectpublic Interpolator getInterpolator()
public void setInterpolator(Interpolator i)
this
- surface's interpolatorprivate IsoSurfaceAdaptive getIsoSurfaceAdaptive()
private void setIsoSurfaceAdaptive(IsoSurfaceAdaptive newSurface)
newSurface
- the adaptive resolution portion of the isosurfaceprivate boolean addSecondPassNode(OctreeNode coarseNode, boolean firstPass)
coarseNode
- one to add to the secondPassListfirstPass
- is TRUE if we are performing MC on the first pass
through the octreepublic void processAdaptiveSurface()
public float getIsoValue()
public void setIsoValue(float newVal)
isoValue
- this IsoSurface object's isovaluepublic TriangleVertexList getVertexList()
private void setTriangleVertexList(TriangleVertexList tvl)
the
- list of unique TriangleVertex objects
that make up this IsoSurfacepublic void computeTriangles(OctreeNode node, byte[] edges, boolean firstPass)
node
- the octree node (and bounding cube) that contains the
trianglesedges
- the list of edge intersectionsfirstPass
- is TRUE if we are to check for AR octree nodesprivate void computeTriangle(OctreeNode node, byte[] edges, byte[] uniqueEdges, boolean firstPass)
P7_____________P6 This is the cube representation /| /| used to write the computeTriangle() / | / | method. It is the same as the VTK's. P4/___________P5/ | | | | | z | | | | ^ y | | | | | / | P3|_________|___|P2 | / | / | / |/ | / | / ---> |/____________|/ x P0 P1[Note: there's room for optimization in this procedure]
octreeNode
- the node (and bounding cube) that contains the
trianglesedges
- the list of edge intersectionsuniqueEdges
- a list of edges that have already been processedfirstPass
- is TRUE if we performing MC on the first pass
through the octree (not on the 2nd pass list)public Triangle addTriangleToSurface(OctreeNode node, int[] listIndices)
node
- the octree node that will host these triangle
verticeslistIndices
- 3 triangle vertex list indices determine where
in the triangle vertex list these indices residepublic int[] addVerticesToVertexList(OctreeNode node, TriangleVertex[] vertices)
node
- the octree node that will host these triangle vertices
We pass this octree node here to so it can search
itself and it's neighbors for a shared vertex
(and not the whole triangle vertex list)vertices
- a set of 3 triangle vertices to add to the
triangle vertex listprivate boolean isNew(byte[] uniqueEdges, byte edge)
uniqueEdges
- a list of unique cube edgesedge
- a single cube edgeprivate boolean findARoctreeNodes(OctreeNode octreeNode, byte[] directions, TriangleVertex[] vertices, boolean firstPass)
Basic algorithm:
octreeNode
- the octree node whose neighbors are searchededge
- the directions in which to search of an AR nodevertices
- a set of 3 new triangle vertices that belong
to the given octree nodefirstPass
- is TRUE if we performing MC on the first pass
throught the octreeprivate boolean processCoarserNeighbor(OctreeNode fineNode, OctreeNode coarseNode, byte direction, TriangleVertex[] vertices)
Again we have to check for shared edge vertices and facial vertices on the coarser neighbor. We put the coarser neighbor on the AR isosurface if we find any shared vertices on either the edges or the face of the neighbor independent of any vertices generated by the coarse neighbor.
This is because we cannot predict what the final state of coarser neighbor will be until all of its finer resolution neighbors have been processed.
fineNode
- the finer resolution octree nodecoarseNode
- the coarser resolution neighboring octree nodedirection
- the direction FROM the fine node
TO the coarse node.vertices
- a set of 3 new triangle vertices that may be
be shared with the coarse neighbor nodeprivate void addARverticesToNeighbor(OctreeNode coarseNode, SharedVertex[] vertices)
coarseNode
- the coarser resolution octree node that we'll
add AR triangle vertices toovertices
- a possible set of 3 shared triangle vertices that
might be added to the given octree nodeprivate void addSingletons(OctreeNode coarseNode, SharedVertex[] vertices, boolean[] addSingleton)
coarseNode
- the coarser resolution octree node that we'll
add AR triangle vertices toovertices
- a possible set of 3 shared triangle vertices that
might be added to the given octree nodeaddSingleton
- indicates shared trianlge vertices that are not
part of an edge but still are on either a face
or an edge of their neighborprivate int sharedVertex(OctreeNode octreeNode, TriangleVertex triangleVertex)
sharedVertex() looks at the given node's neighbors to see if the given vertex has already been computed in an effort to find a shared vertex.
Since we are traversing the cubes in order 0,1,2,...7 we search the 3 neighbors whose triangles have already been computed.
octreeNode
- the octree node whose neighbors are searchedtriangleVertex
- the vertex that may be sharedprivate int inspectNeighbors(byte[] directions, OctreeNode octreeNode, TriangleVertex triangleVertex)
directions
- an array of directions in which to search for a
face neighboroctreeNode
- the octree node whose neighbors are searchedtriangleVertex
- the vertex that may be sharedprivate int updateTriangleVertexList(OctreeNode node, TriangleVertex newVertex)
IF one of the neighbors already has NOT THEN add this new vertex to the TriangleVertexList
node
- the OctreeNode with the new TriangleVertexnewVertex
- the new (possibly shared) TriangleVertexprivate TriangleVertex computeVertex(OctreeNode node, byte edge)
Note: the way we pass the vertices makes the interpolator's job easier. We'll always pass the vertex with the lesser coordinate value (along the axis of interpolation) first.
node
- an octree node and hence bounding cube that contains
the trianglesedge
- an edge intersectionprivate int compareVertices(OctreeNode octreeNode, TriangleVertex newVertex)
octreeNode
- the octree node whose triangles are searchedtriangleVertex
- the vertex that may be sharedprivate int searchTriangle(Triangle triangle, TriangleVertex newVertex)
triangle
- the triangle we are searching for a matching vertexvertex
- the vertex whose match we are searching forpublic void addTriangle(Triangle triangle)
triangle
- a new trianglepublic void addNode(OctreeNode node)
node
- an octreeNodepublic Triangle getTriangle(int n)
n
- triangle numbercanvas
- the painting canvaspublic float[] getActualVisADcoords(int dimension)
Note, there may be some invalid vertices in the triangleVertexList This is a result of "removing" vertices from the list by setting their values to -1. The reason for this is when we want to remove an OctreeNode's triangles from the list, however, since triangle is simply a set of three integer indexes into the list, we cannot use the Vector.removeElement() method because the vector is resized causing an average of half of the integer index values to be wrong. Therefore we just set the vertices we want to remove to -1, and exclude them from the Gridded3DMRSet object's TriangleStripArray .
This method is called from Gridded3DMRSet.make_isoSurface()
dimension
- the dimension (x,y,z) of the coordinate valuesfloat[] getError()
public int getActualNumVertices()
dimension
- the dimension (x,y,z) of the coordinate valuespublic int getNumPolygons()
public void print()
|
IsoSurface Rendering of an AR Representation | |||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |