|
JavaView© v3.95.000 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectvgp.volume.mc.PnMarchingCubes
Implementation of the marching cubes algorithm. This class will generate an isosurface to a given scalar field.
You may pass the scalar field as an dimX*dimY*dimZ sized array of double values. Because of the limited memory of a machine, it is also possible to specify a function which is called repeatedly from the algorithm to obtain the data of the scalar field. However, if the evaluation of the function costs much time, you may want to enable buffering, which reduces the number of callback calls for the same point in space from 8 to 1. The memory used for buffering is O(dimX*dimY).
Usage:
Construct new MarchingCube object
call setVectorGrid()
call setData() or setFunction()
call startAlgorithm()
| Constructor Summary | |
PnMarchingCubes()
Construct a new MarchingCubes object. |
|
| Method Summary | |
boolean |
getOrientate()
Return a flag, whether the alforithm should produce an oriented surface. |
boolean |
getWeighted()
|
void |
setData(PdVector data)
Set the data of the scalar field. |
void |
setFunction(PnFunction function,
boolean bufferData)
Set function to obtain the data of the scalar field. |
void |
setOrientate(boolean orientate)
Set flag, whether the algorithm should produce an oriented surface. |
void |
setVectorGrid(int dimX,
int dimY,
int dimZ,
PdVector origin,
PdVector baseX,
PdVector baseY,
PdVector baseZ)
Set the dimension and distortion of the bounding box. |
void |
setVectorGrid(PdVector corner1,
PdVector corner2,
int numX,
int numY,
int numZ)
Set the dimension and bounding box of the vector grid. |
void |
setWeighted(boolean weighted)
Set whether the position of new vertices should be weighted on the function values of the corners of the cube. |
PgElementSet |
startAlgorithm(double threshold)
Start the algorithm. |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public PnMarchingCubes()
| Method Detail |
public void setVectorGrid(PdVector corner1,
PdVector corner2,
int numX,
int numY,
int numZ)
corner1 - on corner of the bounding boxcorner2 - opposite corner of the bounding boxnumX - number of sampled points in x directionnumY - number of sampled points in y directionnumZ - number of sampled points in z direction
public void setVectorGrid(int dimX,
int dimY,
int dimZ,
PdVector origin,
PdVector baseX,
PdVector baseY,
PdVector baseZ)
This method should be called before setData() or setDataProducer().
dimX - number of sampled points in x directiondimY - number of sampled points in y directiondimZ - number of sampled points in z directionorigin - corner of the bounding boxbaseX - distance vector between two sample points in x directionbaseY - distance vector between two sample points in y directionbaseZ - distance vector between two sample points in z directionpublic void setData(PdVector data)
data - function values of the sample points
public void setFunction(PnFunction function,
boolean bufferData)
function - instance of PnFunctionbufferData - whether the obtained data from the function
should be bufferedpublic void setWeighted(boolean weighted)
public boolean getWeighted()
public void setOrientate(boolean orientate)
orientate - whether to produce an oriented surface (default: true)public boolean getOrientate()
public PgElementSet startAlgorithm(double threshold)
threshold - iso value for evaluation
|
JavaView© v3.95.000 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||