IsoSurface Rendering of an AR Representation

rlaramee
Class IsoZvertex

java.lang.Object
  |
  +--rlaramee.Vertex
        |
        +--rlaramee.TriangleVertex
              |
              +--rlaramee.IsoZvertex

public class IsoZvertex
extends TriangleVertex

Description: The idea behind IsoXvertex , IsoYvertex , and IsoZvertex is to save memory. Marching Cubes generates interpolated vertices. Of the x,y,z coordinates of a vertex, only 1 dimension is interpolated. That is, we only interpolate along 1 axis either x,y,z. That being the case, we only need 1 higher precision coordinate. The other 2 can be stored using only a byte value since these other 2 are still the same as the cube coordinates from which the new interpolated vertex is derived. And cube vertices range only from 0-128 so they are stored as byte values (a byte values range is from -128 to 127 inclusive)

start date Wed 12 Apr 2000

Version:
1.0
Author:
Robert S Laramee
See Also:

Field Summary
private  byte xcoordinate
           
private  byte ycoordinate
           
private  short zcoordinate
          need 1 higher precision coord than cube
 
Fields inherited from class rlaramee.TriangleVertex
error, resolution
 
Constructor Summary
IsoZvertex(float[] coordinates, byte edge)
          This constructor when deriving a new cube.
 
Method Summary
 float[] getCoords()
           
 float getXcoord()
           get() methods
 float getYcoord()
          This method must be over-ridden by IsoXvertex, IsoYvertex, and IsoZvertex.
 float getZcoord()
          This method must be over-ridden by IsoXvertex, IsoYvertex, and IsoZvertex.
 void setXcoord(float newX)
           set() methods
 void setYcoord(float newY)
          This method must be over-ridden by IsoXvertex, IsoYvertex, and IsoZvertex.
 void setZcoord(float newZ)
          This method must be over-ridden by IsoXvertex, IsoYvertex, and IsoZvertex.
 java.lang.String toString(Cube cube)
           
 
Methods inherited from class rlaramee.TriangleVertex
fromBlockSpaceToVisAD, getError, getNativeEdge, getNumSharedPolygons, getPolygonList, getResolution, isValid, oldSetPolygonList, onFace, setError, setNativeEdge, setNumSharedPolygons, setPolygonList, setResolution, sharedXaxis, sharedYaxis, sharedZaxis, updateWith
 
Methods inherited from class rlaramee.Vertex
isEqual
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

xcoordinate

private byte xcoordinate

ycoordinate

private byte ycoordinate

zcoordinate

private short zcoordinate
need 1 higher precision coord than cube
Constructor Detail

IsoZvertex

public IsoZvertex(float[] coordinates,
                  byte edge)
This constructor when deriving a new cube.

The vertices do not need to be transformed since they are interpolated from cube vertices that have already been transformed.

Parameters:
coordinates - the x, y, and z coordinates of this TriangleVertex
edge - the cube edge that this vertex lies on
Method Detail

getXcoord

public float getXcoord()
get() methods

We multiply the lower precision coordinates which range from 0 to 128 to the lower half of a byte value, -128 to 0. Multiplying by -1 makes for a simple mapping.

Overrides:
getXcoord in class TriangleVertex
Returns:
the x coordinate of this vertex

getYcoord

public float getYcoord()
Description copied from class: TriangleVertex
This method must be over-ridden by IsoXvertex, IsoYvertex, and IsoZvertex.

Overrides:
getYcoord in class TriangleVertex
Returns:
the y coordinate of this vertex

getZcoord

public float getZcoord()
Description copied from class: TriangleVertex
This method must be over-ridden by IsoXvertex, IsoYvertex, and IsoZvertex.

Overrides:
getZcoord in class TriangleVertex
Returns:
the z coordinate of this vertex

getCoords

public float[] getCoords()
Returns:
the x, y, & z coordinates of this vertex

setXcoord

public void setXcoord(float newX)
set() methods

Overrides:
setXcoord in class TriangleVertex
Parameters:
the - z coordinate of this vertex

setYcoord

public void setYcoord(float newY)
Description copied from class: TriangleVertex
This method must be over-ridden by IsoXvertex, IsoYvertex, and IsoZvertex.

Overrides:
setYcoord in class TriangleVertex
Parameters:
the - y coordinate of this vertex

setZcoord

public void setZcoord(float newZ)
Description copied from class: TriangleVertex
This method must be over-ridden by IsoXvertex, IsoYvertex, and IsoZvertex.

Overrides:
setZcoord in class TriangleVertex
Parameters:
the - z coordinate of this vertex

toString

public java.lang.String toString(Cube cube)
Overrides:
toString in class TriangleVertex
Parameters:
cube - the cube that contains this triangle vertex w/in it's volume
Returns:
the string representation of this triangle vertex

IsoSurface Rendering of an AR Representation