org.jmol.jvxl.readers
Class VolumeFileReader

java.lang.Object
  extended by org.jmol.jvxl.readers.SurfaceReader
      extended by org.jmol.jvxl.readers.SurfaceFileReader
          extended by org.jmol.jvxl.readers.VolumeFileReader
All Implemented Interfaces:
VertexDataServer
Direct Known Subclasses:
ApbsReader, CastepDensityReader, CubeReader, JaguarReader, JvxlXmlReader, MapFileReader, PltFormattedReader

abstract class VolumeFileReader
extends SurfaceFileReader


Field Summary
protected  int atomCount
           
protected  javax.vecmath.Point3f[] boundingBox
           
protected  boolean canDownsample
           
protected  int downsampleFactor
           
private  int[] downsampleRemainders
           
protected  boolean endOfData
           
private  int iPlaneRaw
           
protected  boolean isAngstroms
           
private  int nData
           
protected  boolean negativeAtomCount
           
private  int nSkipX
           
private  int nSkipY
           
private  int nSkipZ
           
protected  int nSurfaces
           
private  boolean preProcessPlanes
           
(package private)  boolean readerClosed
           
(package private)  javax.vecmath.Point4f thePlane
           
private  float[][] yzPlanesRaw
           
 
Fields inherited from class org.jmol.jvxl.readers.SurfaceFileReader
binarydoc, br, line, next, os
 
Fields inherited from class org.jmol.jvxl.readers.SurfaceReader
allowSigma, ANGSTROMS_PER_BOHR, anisotropy, center, cJvxlEdgeNaN, colorFractionBase, colorFractionRange, contourVertexCount, dataMax, dataMean, dataMin, defaultCutoff, defaultMappedDataMax, defaultMappedDataMin, eccentricityMatrix, eccentricityMatrixInverse, eccentricityRatio, eccentricityScale, edgeFractionBase, edgeFractionRange, fractionData, hasColorData, haveSurfaceAtoms, isAnisotropic, isEccentric, isJvxl, isProgressive, isQuiet, isXLowToHigh, jvxlColorDataRead, jvxlCutoff, jvxlData, jvxlDataIs2dContour, jvxlDataIsColorMapped, jvxlDataIsPrecisionColor, jvxlEdgeDataRead, jvxlFileHeaderBuffer, jvxlNSurfaceInts, jvxlVoxelBitSet, marchingCubes, marchingSquares, meshData, meshDataServer, minMax, nBytes, nDataPoints, nPointsX, nPointsY, nPointsZ, params, ptTemp, qpc, sg, vertexDataOnly, volumeData, volumetricOrigin, volumetricVectors, voxelCounts, voxelData, xyzMax, xyzMin, yzCount, yzPlanes
 
Constructor Summary
VolumeFileReader(SurfaceGenerator sg, java.io.BufferedReader br)
           
 
Method Summary
protected static boolean checkAtomLine(boolean isXLowToHigh, boolean isAngstroms, java.lang.String strAtomCount, java.lang.String atomLine, java.lang.StringBuffer bs)
          checks an atom line for "ANGSTROMS", possibly overriding the data's natural units, BOHR (similar to Gaussian CUBE files).
protected  void closeReader()
           
private  int countData(java.lang.String str)
           
protected  float getNextVoxelValue()
           
private  void getPlane(float[] plane, boolean doRecord)
           
 float[] getPlane(int x)
           
 float[] getPlaneProcessed(int x)
          Retrieve raw file planes and pass them to the calculation object for processing into new data.
protected  float getSurfacePointAndFraction(float cutoff, boolean isCutoffAbsolute, float valueA, float valueB, javax.vecmath.Point3f pointA, javax.vecmath.Vector3f edgeVector, int x, int y, int z, int vA, int vB, float[] fReturn, javax.vecmath.Point3f ptReturn)
           
 float getValue(int x, int y, int z, int ptyz)
          for readers only
protected  java.util.BitSet getVoxelBitSet(int nPoints)
           
protected  void gotoData(int n, int nPoints)
           
protected  void initializeSurfaceData()
           
protected  float nextVoxel()
           
protected abstract  void readParameters()
           
protected  void readSurfaceData(boolean isMapData)
           
protected  boolean readVolumeData(boolean isMapData)
           
protected  boolean readVolumeParameters(boolean isMapData)
           
private  int readVolumetricHeader()
           
protected  void readVoxelVector(int voxelVectorIndex)
           
protected  float recordData(float value)
           
protected  java.lang.String skipComments(boolean allowBlankLines)
           
protected  void skipData(int nPoints)
           
private  void skipVoxels(int n)
           
 
Methods inherited from class org.jmol.jvxl.readers.SurfaceFileReader
discardTempData, getNextQuotedString, getTokens, parseFloat, parseFloat, parseFloatArray, parseFloatArray, parseInt, parseInt, parseIntNext, readLine, setOutputStream, skipTo
 
Methods inherited from class org.jmol.jvxl.readers.SurfaceReader
addTriangleCheck, addVertexCopy, applyColorScale, colorIsosurface, createIsosurface, excludeMaximumSet, excludeMinimumSet, finalizeMapping, getColorPhaseIndex, getMinMaxMappedValues, getSurfaceAtomIndex, getSurfacePointIndexAndFraction, getValueAtPoint, gotoAndReadVoxelData, initializeMapping, initializeVolumetricData, initPlanes, jvxlUpdateInfo, newVoxelDataCube, postProcessVertices, readAndSetVolumeParameters, readColorData, resetIsosurface, selectPocket, setBoundingBox, setVectorAnisotropy, setVertexAnisotropy, setVolumeData, setVolumetricAnisotropy, setVolumetricOriginAnisotropy, slabIsosurface, updateSurfaceData, updateTriangles
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

endOfData

protected boolean endOfData

negativeAtomCount

protected boolean negativeAtomCount

atomCount

protected int atomCount

nSurfaces

protected int nSurfaces

isAngstroms

protected boolean isAngstroms

canDownsample

protected boolean canDownsample

downsampleRemainders

private int[] downsampleRemainders

preProcessPlanes

private boolean preProcessPlanes

nData

private int nData

readerClosed

boolean readerClosed

thePlane

javax.vecmath.Point4f thePlane

downsampleFactor

protected int downsampleFactor

nSkipX

private int nSkipX

nSkipY

private int nSkipY

nSkipZ

private int nSkipZ

yzPlanesRaw

private float[][] yzPlanesRaw

iPlaneRaw

private int iPlaneRaw

boundingBox

protected javax.vecmath.Point3f[] boundingBox
Constructor Detail

VolumeFileReader

VolumeFileReader(SurfaceGenerator sg,
                 java.io.BufferedReader br)
Method Detail

recordData

protected float recordData(float value)

closeReader

protected void closeReader()
Overrides:
closeReader in class SurfaceFileReader

readVolumeParameters

protected boolean readVolumeParameters(boolean isMapData)
Specified by:
readVolumeParameters in class SurfaceReader

readVolumeData

protected boolean readVolumeData(boolean isMapData)
Specified by:
readVolumeData in class SurfaceReader

readVolumetricHeader

private int readVolumetricHeader()

readParameters

protected abstract void readParameters()
                                throws java.lang.Exception
Throws:
java.lang.Exception

skipComments

protected java.lang.String skipComments(boolean allowBlankLines)
                                 throws java.lang.Exception
Throws:
java.lang.Exception

readVoxelVector

protected void readVoxelVector(int voxelVectorIndex)
                        throws java.lang.Exception
Throws:
java.lang.Exception

initializeSurfaceData

protected void initializeSurfaceData()

readSurfaceData

protected void readSurfaceData(boolean isMapData)
                        throws java.lang.Exception
Specified by:
readSurfaceData in class SurfaceReader
Throws:
java.lang.Exception

getPlane

public float[] getPlane(int x)
Specified by:
getPlane in interface VertexDataServer
Overrides:
getPlane in class SurfaceReader

getPlaneProcessed

public float[] getPlaneProcessed(int x)
Retrieve raw file planes and pass them to the calculation object for processing into new data. Bob Hanson hansonr@stolaf.edu 6/7/2011

Parameters:
x -
Returns:
plane (for testing)

getPlane

private void getPlane(float[] plane,
                      boolean doRecord)

getValue

public float getValue(int x,
                      int y,
                      int z,
                      int ptyz)
Description copied from interface: VertexDataServer
for readers only

Specified by:
getValue in interface VertexDataServer
Overrides:
getValue in class SurfaceReader
Returns:
value[x][y][z]

skipVoxels

private void skipVoxels(int n)
                 throws java.lang.Exception
Throws:
java.lang.Exception

getVoxelBitSet

protected java.util.BitSet getVoxelBitSet(int nPoints)
                                   throws java.lang.Exception
Parameters:
nPoints -
Returns:
JVXL bitset
Throws:
java.lang.Exception

getNextVoxelValue

protected float getNextVoxelValue()
                           throws java.lang.Exception
Throws:
java.lang.Exception

nextVoxel

protected float nextVoxel()
                   throws java.lang.Exception
Throws:
java.lang.Exception

gotoData

protected void gotoData(int n,
                        int nPoints)
                 throws java.lang.Exception
Overrides:
gotoData in class SurfaceReader
Throws:
java.lang.Exception

skipData

protected void skipData(int nPoints)
                 throws java.lang.Exception
Throws:
java.lang.Exception

countData

private int countData(java.lang.String str)

checkAtomLine

protected static boolean checkAtomLine(boolean isXLowToHigh,
                                       boolean isAngstroms,
                                       java.lang.String strAtomCount,
                                       java.lang.String atomLine,
                                       java.lang.StringBuffer bs)
checks an atom line for "ANGSTROMS", possibly overriding the data's natural units, BOHR (similar to Gaussian CUBE files).

Parameters:
isXLowToHigh -
isAngstroms -
strAtomCount -
atomLine -
bs -
Returns:
isAngstroms

getSurfacePointAndFraction

protected float getSurfacePointAndFraction(float cutoff,
                                           boolean isCutoffAbsolute,
                                           float valueA,
                                           float valueB,
                                           javax.vecmath.Point3f pointA,
                                           javax.vecmath.Vector3f edgeVector,
                                           int x,
                                           int y,
                                           int z,
                                           int vA,
                                           int vB,
                                           float[] fReturn,
                                           javax.vecmath.Point3f ptReturn)
Overrides:
getSurfacePointAndFraction in class SurfaceReader
x - TODO
y - TODO
z - TODO
Returns:
fractional distance from A to B