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, CubeReader, JaguarReader, JvxlXmlReader, MapFileReader, PltFormattedReader

abstract class VolumeFileReader
extends SurfaceFileReader


Field Summary
protected  int atomCount
           
protected  Point3f[] boundingBox
           
protected  boolean canDownsample
           
private  int downsampleFactor
           
private  int[] downsampleRemainders
           
protected  boolean endOfData
           
protected  boolean isAngstroms
           
protected  boolean negativeAtomCount
           
private  int nSkipX
           
private  int nSkipY
           
private  int nSkipZ
           
protected  int nSurfaces
           
(package private)  boolean readerClosed
           
(package private)  Point4f thePlane
           
private  int yzCount
           
private  float[][] yzPlanes
           
 
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, isAnisotropic, isEccentric, isJvxl, isProgressive, isXLowToHigh, jvxlColorDataRead, jvxlCutoff, jvxlData, jvxlDataIs2dContour, jvxlDataIsColorMapped, jvxlDataIsPrecisionColor, jvxlEdgeDataRead, jvxlFileHeaderBuffer, jvxlNSurfaceInts, jvxlVoxelBitSet, mappingPlane, marchingSquares, meshData, meshDataServer, minMax, nBytes, nDataPoints, nPointsX, nPointsY, nPointsZ, params, ptTemp, sg, vertexDataOnly, volumeData, volumetricOrigin, volumetricVectors, voxelCounts, voxelData, xyzMax, xyzMin
 
Constructor Summary
VolumeFileReader(SurfaceGenerator sg, BufferedReader br)
           
 
Method Summary
protected static boolean checkAtomLine(boolean isXLowToHigh, boolean isAngstroms, String strAtomCount, String atomLine, 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(String str)
           
protected  float getNextVoxelValue()
           
 void getPlane(int x)
           
 float getValue(int x, int y, int z, int ptyz)
          for readers only
protected  BitSet getVoxelBitSet(int nPoints)
           
protected  void gotoData(int n, int nPoints)
           
protected  float nextVoxel()
           
protected abstract  void readParameters()
           
protected  void readSurfaceData(boolean isMapData)
           
protected  boolean readVolumeData(boolean isMapData)
           
protected  boolean readVolumeParameters()
           
private  int readVolumetricHeader()
           
protected  void readVoxelVector(int voxelVectorIndex)
           
protected  float recordData(float value)
           
protected  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, getSurfacePointAndFraction, getSurfacePointIndexAndFraction, getValueAtPoint, gotoAndReadVoxelData, initializeMapping, initializeVolumetricData, jvxlUpdateInfo, readAndSetVolumeParameters, readColorData, readTheVolumeData, resetIsosurface, selectPocket, setBoundingBox, setMappingPlane, 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

readerClosed

boolean readerClosed

thePlane

Point4f thePlane

downsampleFactor

private int downsampleFactor

nSkipX

private int nSkipX

nSkipY

private int nSkipY

nSkipZ

private int nSkipZ

yzPlanes

private float[][] yzPlanes

yzCount

private int yzCount

boundingBox

protected Point3f[] boundingBox
Constructor Detail

VolumeFileReader

VolumeFileReader(SurfaceGenerator sg,
                 BufferedReader br)
Method Detail

recordData

protected float recordData(float value)

closeReader

protected void closeReader()
Overrides:
closeReader in class SurfaceFileReader

readVolumeParameters

protected boolean readVolumeParameters()
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 Exception
Throws:
Exception

skipComments

protected String skipComments(boolean allowBlankLines)
                       throws Exception
Throws:
Exception

readVoxelVector

protected void readVoxelVector(int voxelVectorIndex)
                        throws Exception
Throws:
Exception

readSurfaceData

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

getPlane

public void getPlane(int x)
Specified by:
getPlane in interface VertexDataServer
Overrides:
getPlane in class SurfaceReader

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 Exception
Throws:
Exception

getVoxelBitSet

protected BitSet getVoxelBitSet(int nPoints)
                         throws Exception
Throws:
Exception

getNextVoxelValue

protected float getNextVoxelValue()
                           throws Exception
Throws:
Exception

nextVoxel

protected float nextVoxel()
                   throws Exception
Throws:
Exception

gotoData

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

skipData

protected void skipData(int nPoints)
                 throws Exception
Throws:
Exception

countData

private int countData(String str)

checkAtomLine

protected static boolean checkAtomLine(boolean isXLowToHigh,
                                       boolean isAngstroms,
                                       String strAtomCount,
                                       String atomLine,
                                       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