# Class JvxlXmlReader

java.lang.Object
org.jmol.jvxl.readers.SurfaceReader
org.jmol.jvxl.readers.JvxlXmlReader

All Implemented Interfaces:
  `VertexDataServer`

Direct Known Subclasses:
  `JvxlReader`

public class JvxlXmlReader extends SurfaceReader

## Field Summary

Fields
Modifier and Type
Field
Description
`protected int`
`ac`
`protected GenericBinaryDocument`
`binarydoc`
`protected P3[]`
`boundingBox`
`protected BufferedReader`
`br`
`protected BS`
`bsVoxelBitSet`
`protected boolean`
`canDownsample`
`protected int`
`colorDataCount`
`protected int`
`downsampleFactor`
`protected int[]`
`downsampleRemainders`
`protected int`
`edgeDataCount`
`protected boolean`
`endOfData`
`protected boolean`
`haveContourData`
`protected boolean`
`isAngstroms`
`protected boolean`
`isXmlFile`
`protected String`
`JVXL_VERSION`
`protected String`
`line`
`protected int`
`nData`
`protected boolean`
`negativeAtomCount`
`protected int[]`
`next`
`protected int`
`nSkipX`
`protected int`
`nSkipY`
`protected int`
`nSkipZ`
`protected int`
`nSurfaces`
`protected OC`
`out`
`protected boolean`
`readerClosed`
`protected int`
`surfaceDataCount`
`protected boolean`
`thisInside`

### Fields inherited from class SurfaceReader

`allowSigma, anisotropy, center, cJvxlEdgeNaN, colorFractionBase, colorFractionRange, contourVertexCount, dataMax, dataMean, dataMin, eccentricityMatrix, eccentricityMatrixInverse, eccentricityRatio, eccentricityScale, edgeFractionBase, edgeFractionRange, fractionData, haveSurfaceAtoms, isAnisotropic, isEccentric, isJvxl, isPeriodic, isProgressive, isQuiet, isXLowToHigh, jvxlColorDataRead, jvxlCutoff, jvxlCutoffRange, jvxlData, jvxlDataIs2dContour, jvxlDataIsColorDensity, jvxlDataIsColorMapped, jvxlDataIsPrecisionColor, jvxlEdgeDataRead, jvxlFileHeaderBuffer, jvxlNSurfaceInts, jvxlVoxelBitSet, marchingCubes, marchingSquares, meshData, meshDataServer, minMax, nBytes, nDataPoints, nPointsX, nPointsY, nPointsZ, params, ptTemp, qpc, sg, volumetricOrigin, volumetricVectors, voxelCounts, voxelData, xyzMax, xyzMin, yzCount, yzPlanes`

## Method Summary

Modifier and Type
Method
Description
`protected static boolean`
`checkAtomLine(boolean isXLowToHigh, boolean isAngstroms, String strAtomCount, String atomLine, SB bs)`
checks an atom line for "ANGSTROMS", possibly overriding the data's natural units, BOHR (similar to Gaussian CUBE files).
`protected void`
`closeReader()`
`protected void`
`closeReaderSFR()`
`protected void`
`getEncodedVertexData()`
retrieve Jvxl 2.0 format vertex/triangle/edge/color data found within <jvxlSurfaceData> element
`protected float`
`getJVXLCutoff()`
`protected float`
`getNextVoxelValue()`
`float[]`
`getPlane(int x)`
`float[]`
`getPlaneNCI(int x)`
Retrieve raw file planes and pass them to the calculation object for processing into new data.
`protected String`
`getQuotedStringNext()`
`protected float`
`getSPFv(float cutoff, boolean isCutoffAbsolute, float valueA, float valueB, T3 pointA, V3 edgeVector, int x, int y, int z, int vA, int vB, float[] fReturn, T3 ptReturn)`
`protected float`
`getSurfacePointAndFraction(float cutoff, boolean isCutoffAbsolute, float valueA, float valueB, T3 pointA, V3 edgeVector, int x, int y, int z, int vA, int vB, float[] fReturn, T3 ptReturn)`
`protected String[]`
`getTokens()`
`float`
`getValue(int x, int y, int z, int ptyz)`
for readers only
`void`
`getVertexColorData()`
`protected BS`
`getVoxelBitSet(int nPoints)`
`protected boolean`
`gotoAndReadVoxelData(boolean isMapData)`
`protected void`
`gotoData(int n, int nPoints)`
`protected void`
`jvxlDecodeContourData(JvxlData jvxlData, String data)`
`P3[]`
`jvxlDecodeVertexData(String data, boolean asArray)`
decode vertex data found within <jvxlVertexData> element as created by jvxlEncodeVertexData (see above)
`protected String`
`jvxlReadFractionData(String type, int nPoints)`
"edge" data includes two parts -- a compressed bitset indicating exactly which edges, in order or processing by Jmol, are crossed by the surface, and a set of fractions indicating how far along that edge (good to 1 part in 8100) that surface crosses that edge.
`protected void`
`jvxlReadSurfaceInfo()`
`protected void`
`jvxlSetColorRanges(float dataMin, float dataMax, float red, float blue, boolean insideOut)`
`protected void`
`jvxlSkipData(int nPoints, boolean doSkipColorData)`
`protected float`
`nextVoxel()`
`protected float`
`parseFloat()`
`protected float[]`
`parseFloatArray(float[] a, String strStart, String strEnd)`
`protected float[]`
`parseFloatArrayStr(String s)`
`protected float`
`parseFloatRange(String s, int iStart, int iEnd)`
`protected float`
`parseFloatStr(String s)`
`protected int`
`parseInt()`
`protected int`
`parseIntNext(String s)`
`protected int`
`parseIntStr(String s)`
`protected void`
`postProcessVertices()`
`protected String`
`rd()`
`protected String`
`readColorData()`
`protected void`
`readParameters()`
`protected void`
`readSurfaceData(boolean isMapDataIgnored)`
`protected void`
`readSurfaceDataJXR()`
`protected void`
`readSurfaceDataVFR(boolean isMapData)`
`protected boolean`
`readSurfaceDataXML()`
`protected void`
`readVector(int voxelVectorIndex)`
`protected boolean`
`readVolumeData(boolean isMapData)`
//////////reading the format///////////
`protected boolean`
`readVolumeDataVFR(boolean isMapData)`
`protected boolean`
`readVolumeParameters(boolean isMapData)`
`protected void`
`readVoxelVector(int voxelVectorIndex)`
`protected float`
`recordData(float value)`
`protected void`
`setOutputChannel(OC out)`
`protected void`
`setStream(String fileName, boolean isBigEndian)`
`protected String`
`skipComments(boolean allowBlankLines)`
`protected void`
`skipData(int nPoints)`
`protected void`
`skipDataVFR(int nPoints)`
`protected void`
`skipTo(String info, String what)`
`protected void`
`swapXZ()`

### Methods inherited from class SurfaceReader

`addTriangleCheck, addVC, addVertexCopy, discardTempDataSR, finalizeMapping, getMinMaxMappedValues, getPlaneSR, getSPF, getSurfaceAtomIndex, getSurfacePointIndexAndFraction, getValue2, getValueAtPoint, newVoxelDataCube, selectPocket, setBBox, setVectorAnisotropy, setVertexAnisotropy, setVolumeDataV, setVolumetricAnisotropy, setVolumetricOriginAnisotropy, slabIsosurface`

### Methods inherited from class Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Field Details

### JVXL_VERSION

protected String JVXL_VERSION

### surfaceDataCount

protected int surfaceDataCount

### edgeDataCount

protected int edgeDataCount

### colorDataCount

protected int colorDataCount

### haveContourData

protected boolean haveContourData

### isXmlFile

protected boolean isXmlFile

### thisInside

protected boolean thisInside

### bsVoxelBitSet

protected BS bsVoxelBitSet

### endOfData

protected boolean endOfData

### negativeAtomCount

protected boolean negativeAtomCount

### ac

protected int ac

### nSurfaces

protected int nSurfaces

### isAngstroms

protected boolean isAngstroms

### canDownsample

protected boolean canDownsample

### downsampleRemainders

protected int[] downsampleRemainders

### nData

protected int nData

### readerClosed

protected boolean readerClosed

### downsampleFactor

protected int downsampleFactor

### nSkipX

protected int nSkipX

### nSkipY

protected int nSkipY

### nSkipZ

protected int nSkipZ

### boundingBox

protected P3[] boundingBox

### br

protected BufferedReader br

### binarydoc

protected GenericBinaryDocument binarydoc

### out

protected OC out

### line

protected String line

### next

protected int[] next

## Method Details

### readVolumeData

protected boolean readVolumeData(boolean isMapData)
//////////reading the format///////////

### gotoAndReadVoxelData

protected boolean gotoAndReadVoxelData(boolean isMapData)

Overrides:
  `gotoAndReadVoxelData` in class `SurfaceReader`

### getVertexColorData

public void getVertexColorData() throws Exception

Throws:
  `Exception`

### readParameters

protected void readParameters() throws Exception

Throws:
  `Exception`

### getJVXLCutoff

protected float getJVXLCutoff()

### readVector

protected void readVector(int voxelVectorIndex) throws Exception

Throws:
  `Exception`

### gotoData

protected void gotoData(int n, int nPoints) throws Exception

Parameters:
  `n` -
  `nPoints` -
Throws:
  `Exception`

### jvxlSkipData

protected void jvxlSkipData(int nPoints, boolean doSkipColorData) throws Exception

Throws:
  `Exception`

### jvxlReadSurfaceInfo

protected void jvxlReadSurfaceInfo() throws Exception

Throws:
  `Exception`

### jvxlSetColorRanges

protected void jvxlSetColorRanges(float dataMin, float dataMax, float red, float blue, boolean insideOut)

### readSurfaceData

protected void readSurfaceData(boolean isMapDataIgnored) throws Exception

Throws:
  `Exception`

### readSurfaceDataXML

protected boolean readSurfaceDataXML() throws Exception

Throws:
  `Exception`

### readSurfaceDataJXR

protected void readSurfaceDataJXR() throws Exception

Throws:
  `Exception`

### jvxlReadFractionData

protected String jvxlReadFractionData(String type, int nPoints)
"edge" data includes two parts -- a compressed bitset indicating exactly which edges, in order or processing by Jmol, are crossed by the surface, and a set of fractions indicating how far along that edge (good to 1 part in 8100) that surface crosses that edge. We are just reading he fractions here. "color" data comprises the corresponding sequence of data mapping values, again stored to a precision of 1 part in 8100, relative to a range of values.

Parameters:
  `type` -
  `nPoints` -
Returns:
  data

### getVoxelBitSet

protected BS getVoxelBitSet(int nPoints) throws Exception

Parameters:
  `nPoints` -
Returns:
  JVXL bitset
Throws:
  `Exception`

### getSurfacePointAndFraction

protected float getSurfacePointAndFraction(float cutoff, boolean isCutoffAbsolute, float valueA, float valueB, T3 pointA, V3 edgeVector, int x, int y, int z, int vA, int vB, float[] fReturn, T3 ptReturn)

### readColorData

protected String readColorData()

Overrides:
  `readColorData` in class `SurfaceReader`

### getEncodedVertexData

protected void getEncodedVertexData() throws Exception
retrieve Jvxl 2.0 format vertex/triangle/edge/color data found within <jvxlSurfaceData> element

Throws:
  `Exception`

### jvxlDecodeVertexData

public P3[] jvxlDecodeVertexData(String data, boolean asArray) throws Exception
decode vertex data found within <jvxlVertexData> element as created by jvxlEncodeVertexData (see above)

Parameters:
  `data` - tag and contents
  `asArray` - or just addVertexCopy
Returns:
  Point3f[] if desired
Throws:
  `Exception`

### jvxlDecodeContourData

protected void jvxlDecodeContourData(JvxlData jvxlData, String data) throws Exception

Throws:
  `Exception`

### postProcessVertices

protected void postProcessVertices()

Overrides:
  `postProcessVertices` in class `SurfaceReader`

### recordData

protected float recordData(float value)

### closeReader

protected void closeReader()

### readVolumeParameters

protected boolean readVolumeParameters(boolean isMapData)

Specified by:
  `readVolumeParameters` in class `SurfaceReader`

### readVolumeDataVFR

protected boolean readVolumeDataVFR(boolean isMapData)

### skipComments

protected String skipComments(boolean allowBlankLines) throws Exception

Throws:
  `Exception`

### readVoxelVector

protected void readVoxelVector(int voxelVectorIndex) throws Exception

Throws:
  `Exception`

### readSurfaceDataVFR

protected void readSurfaceDataVFR(boolean isMapData) throws Exception

Throws:
  `Exception`

### getPlane

public float[] getPlane(int x)

Specified by:
  `getPlane` in interface `VertexDataServer`
Overrides:
  `getPlane` in class `SurfaceReader`

### getPlaneNCI

public float[] getPlaneNCI(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)

### 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`
Parameters:
  `x` -
  `y` -
  `z` -
  `ptyz` -
Returns:
  value[x][y][z]

### getNextVoxelValue

protected float getNextVoxelValue() throws Exception

Throws:
  `Exception`

### nextVoxel

protected float nextVoxel() throws Exception

Throws:
  `Exception`

### skipData

protected void skipData(int nPoints) throws Exception

Throws:
  `Exception`

### skipDataVFR

protected void skipDataVFR(int nPoints) throws Exception

Throws:
  `Exception`

### checkAtomLine

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

### getSPFv

protected float getSPFv(float cutoff, boolean isCutoffAbsolute, float valueA, float valueB, T3 pointA, V3 edgeVector, int x, int y, int z, int vA, int vB, float[] fReturn, T3 ptReturn)

### swapXZ

protected void swapXZ()

### setStream

protected void setStream(String fileName, boolean isBigEndian)

### setOutputChannel

protected void setOutputChannel(OC out)

Overrides:
  `setOutputChannel` in class `SurfaceReader`
Parameters:
  `out` -

### closeReaderSFR

protected void closeReaderSFR()

### getTokens

protected String[] getTokens()

### parseFloat

protected float parseFloat()

### parseFloatStr

protected float parseFloatStr(String s)

### parseFloatRange

protected float parseFloatRange(String s, int iStart, int iEnd)

### parseInt

protected int parseInt()

### parseIntStr

protected int parseIntStr(String s)

### parseIntNext

protected int parseIntNext(String s)

### parseFloatArrayStr

protected float[] parseFloatArrayStr(String s)

### parseFloatArray

protected float[] parseFloatArray(float[] a, String strStart, String strEnd)

### getQuotedStringNext

protected String getQuotedStringNext()

### skipTo

protected void skipTo(String info, String what) throws Exception

Throws:
  `Exception`

### rd

protected String rd() throws Exception

Throws:
  `Exception`