org.jmol.jvxl.readers
Class VoxelReader
java.lang.Object
org.jmol.jvxl.readers.VoxelReader
- All Implemented Interfaces:
- VertexDataServer
- Direct Known Subclasses:
- VolumeDataReader, VolumeFileReader
public abstract class VoxelReader
- extends java.lang.Object
- implements VertexDataServer
Method Summary |
void |
addTriangleCheck(int iA,
int iB,
int iC,
int check,
boolean isAbsolute)
addTriangleCheck adds a triangle along with a 3-bit check indicating
which edges to draw in mesh mode: 1 (iA-iB) + 2 (iB-iC) + 4 (iC-iA) |
int |
addVertexCopy(javax.vecmath.Point3f vertexXYZ,
float value,
int assocVertex)
addVertexCopy is used by the Marching Squares algorithm to
uniquely identify a new vertex when an edge is crossed in the 2D plane. |
(package private) void |
applyColorScale()
|
private void |
colorData()
|
(package private) void |
colorIsosurface()
|
(package private) boolean |
createIsosurface(boolean justForPlane)
|
(package private) void |
discardTempData(boolean discardAll)
|
(package private) void |
excludeMaximumSet()
|
(package private) void |
excludeMinimumSet()
|
private void |
generateSurfaceData()
|
void |
getCalcPoint(javax.vecmath.Point3f pt)
|
protected short |
getColorIndexFromPalette(float value)
|
(package private) static int |
getColorPhaseIndex(java.lang.String color)
|
(package private) float |
getMaxMappedValue()
|
(package private) float |
getMinMappedValue()
|
private float |
getPhase(javax.vecmath.Point3f pt)
|
int |
getSurfacePointIndex(float cutoff,
boolean isCutoffAbsolute,
int x,
int y,
int z,
javax.vecmath.Point3i offset,
int vA,
int vB,
float valueA,
float valueB,
javax.vecmath.Point3f pointA,
javax.vecmath.Vector3f edgeVector,
boolean isContourType)
getSurfacePointIndex is used by the Marching Cubes algorithm and
must return a unique integer identifier for
a vertex created by the Marching Cube algorithm when it finds an
edge. |
protected void |
gotoAndReadVoxelData(boolean isMapData)
|
protected void |
gotoData(int n,
int nPoints)
|
protected void |
initializeVolumetricData()
|
protected static boolean |
isInside(float voxelValue,
float max,
boolean isAbsolute)
|
(package private) void |
jvxlUpdateInfo()
|
protected java.lang.String |
readColorData()
|
protected float |
readSurfacePoint(float cutoff,
boolean isCutoffAbsolute,
float valueA,
float valueB,
javax.vecmath.Point3f pointA,
javax.vecmath.Vector3f edgeVector,
float[] fReturn,
javax.vecmath.Point3f ptReturn)
|
(package private) abstract void |
readVolumeData(boolean isMapData)
|
(package private) abstract void |
readVolumeParameters()
|
protected abstract void |
readVoxelData(boolean isMapData)
|
(package private) void |
resetIsosurface()
|
void |
selectPocket(boolean doExclude)
|
(package private) void |
setVolumeData(VolumeData v)
|
(package private) void |
updateSurfaceData()
|
(package private) void |
updateTriangles()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
sg
protected SurfaceGenerator sg
meshDataServer
protected MeshDataServer meshDataServer
colorEncoder
protected ColorEncoder colorEncoder
params
protected Parameters params
meshData
protected MeshData meshData
jvxlData
protected JvxlData jvxlData
volumeData
protected VolumeData volumeData
isProgressive
protected boolean isProgressive
isXLowToHigh
protected boolean isXLowToHigh
assocCutoff
private float assocCutoff
ANGSTROMS_PER_BOHR
static final float ANGSTROMS_PER_BOHR
- See Also:
- Constant Field Values
defaultEdgeFractionBase
static final int defaultEdgeFractionBase
- See Also:
- Constant Field Values
defaultEdgeFractionRange
static final int defaultEdgeFractionRange
- See Also:
- Constant Field Values
defaultColorFractionBase
static final int defaultColorFractionBase
- See Also:
- Constant Field Values
defaultColorFractionRange
static final int defaultColorFractionRange
- See Also:
- Constant Field Values
defaultMappedDataMin
static final float defaultMappedDataMin
- See Also:
- Constant Field Values
defaultMappedDataMax
static final float defaultMappedDataMax
- See Also:
- Constant Field Values
defaultCutoff
static final float defaultCutoff
- See Also:
- Constant Field Values
edgeCount
private int edgeCount
volumetricOrigin
protected javax.vecmath.Point3f volumetricOrigin
volumetricVectors
protected javax.vecmath.Vector3f[] volumetricVectors
voxelCounts
protected int[] voxelCounts
voxelData
protected float[][][] voxelData
nBytes
protected int nBytes
nDataPoints
protected int nDataPoints
nPointsX
protected int nPointsX
nPointsY
protected int nPointsY
nPointsZ
protected int nPointsZ
isJvxl
protected boolean isJvxl
isApbsDx
protected boolean isApbsDx
edgeFractionBase
protected int edgeFractionBase
edgeFractionRange
protected int edgeFractionRange
colorFractionBase
protected int colorFractionBase
colorFractionRange
protected int colorFractionRange
jvxlFileHeaderBuffer
protected java.lang.StringBuffer jvxlFileHeaderBuffer
fractionData
protected java.lang.StringBuffer fractionData
jvxlEdgeDataRead
protected java.lang.String jvxlEdgeDataRead
jvxlColorDataRead
protected java.lang.String jvxlColorDataRead
jvxlDataIsColorMapped
protected boolean jvxlDataIsColorMapped
jvxlDataIsPrecisionColor
protected boolean jvxlDataIsPrecisionColor
jvxlDataIs2dContour
protected boolean jvxlDataIs2dContour
jvxlCutoff
protected float jvxlCutoff
jvxlNSurfaceInts
protected int jvxlNSurfaceInts
cJvxlEdgeNaN
protected char cJvxlEdgeNaN
contourVertexCount
protected int contourVertexCount
marchingSquares
protected MarchingSquares marchingSquares
marchingCubes
private MarchingCubes marchingCubes
ptTemp
protected final javax.vecmath.Point3f ptTemp
fReturn
final float[] fReturn
colorPhases
private static final java.lang.String[] colorPhases
VoxelReader
VoxelReader(SurfaceGenerator sg)
setVolumeData
void setVolumeData(VolumeData v)
readVolumeParameters
abstract void readVolumeParameters()
readVolumeData
abstract void readVolumeData(boolean isMapData)
jvxlUpdateInfo
void jvxlUpdateInfo()
createIsosurface
boolean createIsosurface(boolean justForPlane)
resetIsosurface
void resetIsosurface()
discardTempData
void discardTempData(boolean discardAll)
initializeVolumetricData
protected void initializeVolumetricData()
readVoxelData
protected abstract void readVoxelData(boolean isMapData)
throws java.lang.Exception
- Throws:
java.lang.Exception
gotoAndReadVoxelData
protected void gotoAndReadVoxelData(boolean isMapData)
gotoData
protected void gotoData(int n,
int nPoints)
throws java.lang.Exception
- Throws:
java.lang.Exception
readColorData
protected java.lang.String readColorData()
generateSurfaceData
private void generateSurfaceData()
isInside
protected static boolean isInside(float voxelValue,
float max,
boolean isAbsolute)
getSurfacePointIndex
public int getSurfacePointIndex(float cutoff,
boolean isCutoffAbsolute,
int x,
int y,
int z,
javax.vecmath.Point3i offset,
int vA,
int vB,
float valueA,
float valueB,
javax.vecmath.Point3f pointA,
javax.vecmath.Vector3f edgeVector,
boolean isContourType)
- Description copied from interface:
VertexDataServer
- getSurfacePointIndex is used by the Marching Cubes algorithm and
must return a unique integer identifier for
a vertex created by the Marching Cube algorithm when it finds an
edge. If a vertex is discarded, then Integer.MAX_VALUE should be returned.
the 3D coordinate of the point can be calculated using
surfacePoint.scaleAdd(fraction, edgeVector, pointA);
where fraction is generally calculated as:
fraction = (cutoff - valueA) / (valueB - valueA);
if (isCutoffAbsolute && (fraction < 0 || fraction > 1))
fraction = (-cutoff - valueA) / (valueB - valueA);
This method is also used by MarchingCubes to deliver the appropriate
oblique planar coordinate to MarchingSquares for later contouring.
- Specified by:
getSurfacePointIndex
in interface VertexDataServer
vA
- [0:7]vB
- [0:7]edgeVector
- vector from A to B
- Returns:
- new vertex index or Integer.MAX_VALUE
readSurfacePoint
protected float readSurfacePoint(float cutoff,
boolean isCutoffAbsolute,
float valueA,
float valueB,
javax.vecmath.Point3f pointA,
javax.vecmath.Vector3f edgeVector,
float[] fReturn,
javax.vecmath.Point3f ptReturn)
addVertexCopy
public int addVertexCopy(javax.vecmath.Point3f vertexXYZ,
float value,
int assocVertex)
- Description copied from interface:
VertexDataServer
- addVertexCopy is used by the Marching Squares algorithm to
uniquely identify a new vertex when an edge is crossed in the 2D plane.
The implementing method should COPY the Point3f using Point3f.set().
The data consumer can use the association key to group this vertex with others
near the same gridpoint.
- Specified by:
addVertexCopy
in interface VertexDataServer
assocVertex
- unique association vertex or -1
- Returns:
- new vertex index
addTriangleCheck
public void addTriangleCheck(int iA,
int iB,
int iC,
int check,
boolean isAbsolute)
- Description copied from interface:
VertexDataServer
- addTriangleCheck adds a triangle along with a 3-bit check indicating
which edges to draw in mesh mode: 1 (iA-iB) + 2 (iB-iC) + 4 (iC-iA)
- Specified by:
addTriangleCheck
in interface VertexDataServer
colorIsosurface
void colorIsosurface()
applyColorScale
void applyColorScale()
colorData
private void colorData()
getColorPhaseIndex
static int getColorPhaseIndex(java.lang.String color)
getPhase
private float getPhase(javax.vecmath.Point3f pt)
getMinMappedValue
float getMinMappedValue()
getMaxMappedValue
float getMaxMappedValue()
getColorIndexFromPalette
protected short getColorIndexFromPalette(float value)
updateTriangles
void updateTriangles()
updateSurfaceData
void updateSurfaceData()
selectPocket
public void selectPocket(boolean doExclude)
excludeMinimumSet
void excludeMinimumSet()
excludeMaximumSet
void excludeMaximumSet()
getCalcPoint
public void getCalcPoint(javax.vecmath.Point3f pt)