marchingcubes
Class MCCube

java.lang.Object
  |
  +--marchingcubes.MCCube

public class MCCube
extends java.lang.Object


Field Summary
protected  boolean amb
           
protected static int[] ambigous
           
static double DEFAULT_SEEK_VALUE
           
protected  marchingcubes.MCVector3[] e
           
protected  boolean hidden
           
protected  java.lang.String id
           
protected  marchingcubes.MCMatrix4 modelView
           
protected  java.util.Vector neighbours
           
protected static double seekValue
           
static double SIZE
           
protected  marchingcubes.MCVertex[] v
           
 
Constructor Summary
MCCube(java.lang.String id)
          contructor of a MCCube object
MCCube(java.lang.String id, marchingcubes.MCVertex[] v)
          constructor of a MCCube object
MCCube(java.lang.String id, marchingcubes.MCVertex v0, marchingcubes.MCVertex v1, marchingcubes.MCVertex v2, marchingcubes.MCVertex v3, marchingcubes.MCVertex v4, marchingcubes.MCVertex v5, marchingcubes.MCVertex v6, marchingcubes.MCVertex v7)
          constructor of a MCCube object
 
Method Summary
 int caseNumber()
          computes the case number of the cube
 void computeEdges()
          computes interpolated values along each edge of the cube (null if interpolated value doesn't belong to the edge)
 void display()
          performs all display operations depending on rendering parameters
static boolean isAmbigous(int n)
          indicates if a number corresponds to an ambigous case
 java.lang.String toString()
          returns a string representation of the cube (its name) (useful to add cubes to combo-boxes)
static marchingcubes.MCVector3 translate(int position)
          returns the translation corresponding to a neighbour at a specified position (north/south: along z axis, etc.)
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

SIZE

public static final double SIZE
See Also:
Constant Field Values

DEFAULT_SEEK_VALUE

public static final double DEFAULT_SEEK_VALUE
See Also:
Constant Field Values

seekValue

protected static double seekValue

neighbours

protected java.util.Vector neighbours

v

protected marchingcubes.MCVertex[] v

e

protected marchingcubes.MCVector3[] e

modelView

protected marchingcubes.MCMatrix4 modelView

id

protected java.lang.String id

hidden

protected boolean hidden

amb

protected boolean amb

ambigous

protected static int[] ambigous
Constructor Detail

MCCube

public MCCube(java.lang.String id)
contructor of a MCCube object

Parameters:
id - identifier of the cube

MCCube

public MCCube(java.lang.String id,
              marchingcubes.MCVertex v0,
              marchingcubes.MCVertex v1,
              marchingcubes.MCVertex v2,
              marchingcubes.MCVertex v3,
              marchingcubes.MCVertex v4,
              marchingcubes.MCVertex v5,
              marchingcubes.MCVertex v6,
              marchingcubes.MCVertex v7)
constructor of a MCCube object

Parameters:
id - identifier of the cube
v0 - first vertex
v1 - second vertex
v2 - third vertex
v3 - fourth vertex
v4 - fifth vertex
v5 - sixth vertex
v6 - seventh vertex
v7 - eighth vertex

MCCube

public MCCube(java.lang.String id,
              marchingcubes.MCVertex[] v)
constructor of a MCCube object

Parameters:
id - identifier of the cube
v - array containing the vertexes
Method Detail

isAmbigous

public static boolean isAmbigous(int n)
indicates if a number corresponds to an ambigous case

Parameters:
n - number of the case to test
Returns:
true if the case if ambigous

caseNumber

public int caseNumber()
computes the case number of the cube

Returns:
the number of the case corresponding to the cube

translate

public static marchingcubes.MCVector3 translate(int position)
returns the translation corresponding to a neighbour at a specified position (north/south: along z axis, etc.)

Parameters:
position - a direction
Returns:
the translation vector

computeEdges

public void computeEdges()
computes interpolated values along each edge of the cube (null if interpolated value doesn't belong to the edge)


display

public void display()
performs all display operations depending on rendering parameters


toString

public java.lang.String toString()
returns a string representation of the cube (its name) (useful to add cubes to combo-boxes)

Overrides:
toString in class java.lang.Object
Returns:
the name of the cube