JvxlXmlReader
Date: 2019-10-22

org.jmol.jvxl.readers

## Class JvxlXmlReader

- java.lang.Object
- - org.jmol.jvxl.readers.SurfaceReader
  - - org.jmol.jvxl.readers.SurfaceFileReader
    - - org.jmol.jvxl.readers.VolumeFileReader
      - - org.jmol.jvxl.readers.JvxlXmlReader

- All Implemented Interfaces:
    VertexDataServer
  Direct Known Subclasses:
    JvxlReader

      public class JvxlXmlReader
      extends VolumeFileReader

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected javajs.util.BS` | `bsVoxelBitSet`
    `protected int` | `colorDataCount`
    `private int` | `colorPtr`
    `protected int` | `edgeDataCount`
    `private int` | `excludedTriangleCount`
    `private int` | `excludedVertexCount`
    `private int` | `fractionPtr`
    `protected boolean` | `haveContourData`
    `(package private) boolean` | `haveReadColorData`
    `private boolean` | `includeValueNaN`
    `private int` | `invalidatedVertexCount`
    `protected boolean` | `isXmlFile`
    `protected java.lang.String` | `JVXL_VERSION`
    `private java.lang.String` | `jvxlColorEncodingRead`
    `private java.lang.String` | `strFractionTemp`
    `protected int` | `surfaceDataCount`
    `(package private) java.lang.String` | `tempDataXml`
    `protected boolean` | `thisInside`
    `private int` | `valueCount`
    `private float` | `valueMin`
    `private float` | `valueRange`
    `private XmlReader` | `xr`

    - ### Fields inherited from class org.jmol.jvxl.readers.VolumeFileReader

      `ac, boundingBox, canDownsample, downsampleFactor, downsampleRemainders, endOfData, isAngstroms, nData, negativeAtomCount, nSkipX, nSkipY, nSkipZ, nSurfaces, readerClosed`

    - ### Fields inherited from class org.jmol.jvxl.readers.SurfaceFileReader

      `binarydoc, br, line, next, out`

    - ### 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, isPeriodic, isProgressive, isQuiet, isXLowToHigh, jvxlColorDataRead, jvxlCutoff, jvxlData, jvxlDataIs2dContour, jvxlDataIsColorDensity, 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

    Constructors
    Constructor and Description
    `JvxlXmlReader()`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `private static int` | `getColor(java.lang.String c)`
    `private java.lang.String` | `getData(java.lang.String sdata, java.lang.String name)`
    `protected void` | `getEncodedVertexData()` retrieve Jvxl 2.0 format vertex/triangle/edge/color data found within element
    `private static java.lang.String` | `getEncoding(java.lang.String data)`
    `private float` | `getNextValue()`
    `protected float` | `getSurfacePointAndFraction(float cutoff, boolean isCutoffAbsolute, float valueA, float valueB, javajs.util.T3 pointA, javajs.util.V3 edgeVector, int x, int y, int z, int vA, int vB, float[] fReturn, javajs.util.T3 ptReturn)`
    `protected javajs.util.BS` | `getVoxelBitSet(int nPoints)`
    `protected boolean` | `gotoAndReadVoxelData(boolean isMapData)`
    `protected void` | `gotoData(int n, int nPoints)`
    `(package private) void` | `init2(SurfaceGenerator sg, java.io.BufferedReader br)`
    `(package private) void` | `init2JXR(SurfaceGenerator sg, java.io.BufferedReader br)`
    `protected void` | `jvxlDecodeContourData(JvxlData jvxlData, java.lang.String data)`
    `(package private) void` | `jvxlDecodeTriangleData(java.lang.String tdata, java.lang.String edgeData, java.lang.String colorData)` decode triangle data found within element as created with jvxlEncodeTriangleData (see above)
    `javajs.util.P3[]` | `jvxlDecodeVertexData(java.lang.String data, boolean asArray)` decode vertex data found within element as created by jvxlEncodeVertexData (see above)
    `private float` | `jvxlGetNextFraction(int base, int range, float fracOffset)`
    `protected java.lang.String` | `jvxlReadFractionData(java.lang.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 void` | `postProcessVertices()`
    `protected java.lang.String` | `readColorData()`
    `protected void` | `readParameters()`
    `protected void` | `readSurfaceData(boolean isMapDataIgnored)`
    `protected void` | `readSurfaceDataJXR()`
    `protected boolean` | `readSurfaceDataXML()`
    `protected void` | `readVector(int voxelVectorIndex)`
    `protected boolean` | `readVolumeData(boolean isMapData)`
    `private void` | `setValueMinMax()`

    - ### Methods inherited from class org.jmol.jvxl.readers.VolumeFileReader

      `checkAtomLine, closeReader, getNextVoxelValue, getPlane, getPlaneNCI, getSPFv, getValue, init2VFR, initializeSurfaceData, nextVoxel, readSurfaceDataVFR, readVolumeDataVFR, readVolumeParameters, readVoxelVector, recordData, skipComments, skipData, skipDataVFR, swapXZ`

    - ### Methods inherited from class org.jmol.jvxl.readers.SurfaceFileReader

      `closeReaderSFR, discardTempData, getQuotedStringNext, getTokens, init, init2SFR, newBinaryDocument, parseFloat, parseFloatArray, parseFloatArrayStr, parseFloatRange, parseFloatStr, parseInt, parseIntNext, parseIntStr, rd, setOutputChannel, setStream, skipTo`

    - ### Methods inherited from class org.jmol.jvxl.readers.SurfaceReader

      `addTriangleCheck, addVC, addVertexCopy, applyColorScale, colorIsosurface, createIsosurface, discardTempDataSR, excludeMaximumSet, excludeMinimumSet, finalizeMapping, getColorPhaseIndex, getMinMaxMappedValues, getPlaneSR, getSPF, getSurfaceAtomIndex, getSurfacePointIndexAndFraction, getValue2, getValueAtPoint, initializeMapping, initializeVolumetricData, initPlanes, initSR, jvxlUpdateInfo, newVoxelDataCube, readAndSetVolumeParameters, resetIsosurface, selectPocket, setBBox, setVectorAnisotropy, setVertexAnisotropy, setVolumeDataV, 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

    - #### JVXL_VERSION

          protected java.lang.String JVXL_VERSION

    - #### surfaceDataCount

          protected int surfaceDataCount

    - #### edgeDataCount

          protected int edgeDataCount

    - #### colorDataCount

          protected int colorDataCount

    - #### excludedTriangleCount

          private int excludedTriangleCount

    - #### excludedVertexCount

          private int excludedVertexCount

    - #### invalidatedVertexCount

          private int invalidatedVertexCount

    - #### haveContourData

          protected boolean haveContourData

    - #### xr

          private XmlReader xr

    - #### isXmlFile

          protected boolean isXmlFile

    - #### thisInside

          protected boolean thisInside

    - #### tempDataXml

          java.lang.String tempDataXml

    - #### bsVoxelBitSet

          protected javajs.util.BS bsVoxelBitSet

    - #### includeValueNaN

          private boolean includeValueNaN

    - #### valueCount

          private int valueCount

    - #### valueMin

          private float valueMin

    - #### valueRange

          private float valueRange

    - #### fractionPtr

          private int fractionPtr

    - #### colorPtr

          private int colorPtr

    - #### strFractionTemp

          private java.lang.String strFractionTemp

    - #### haveReadColorData

          boolean haveReadColorData

    - #### jvxlColorEncodingRead

          private java.lang.String jvxlColorEncodingRead

  - ### Constructor Detail

    - #### JvxlXmlReader

          JvxlXmlReader()

  - ### Method Detail

    - #### init2

          void init2(SurfaceGenerator sg,
                     java.io.BufferedReader br)

      Overrides:
        `init2` in class `VolumeFileReader`

    - #### init2JXR

          void init2JXR(SurfaceGenerator sg,
                        java.io.BufferedReader br)

    - #### readVolumeData

          protected boolean readVolumeData(boolean isMapData)

      Overrides:
        `readVolumeData` in class `VolumeFileReader`

    - #### gotoAndReadVoxelData

          protected boolean gotoAndReadVoxelData(boolean isMapData)

      Overrides:
        `gotoAndReadVoxelData` in class `SurfaceReader`

    - #### readParameters

          protected void readParameters()
                                 throws java.lang.Exception

      Specified by:
        `readParameters` in class `VolumeFileReader`
      Throws:
        `java.lang.Exception`

    - #### readVector

          protected void readVector(int voxelVectorIndex)
                             throws java.lang.Exception

      Throws:
        `java.lang.Exception`

    - #### gotoData

          protected void gotoData(int n,
                                  int nPoints)
                           throws java.lang.Exception

      Overrides:
        `gotoData` in class `VolumeFileReader`
      Throws:
        `java.lang.Exception`

    - #### jvxlSkipData

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

      Throws:
        `java.lang.Exception`

    - #### jvxlReadSurfaceInfo

          protected void jvxlReadSurfaceInfo()
                                      throws java.lang.Exception

      Throws:
        `java.lang.Exception`

    - #### jvxlSetColorRanges

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

    - #### readSurfaceData

          protected void readSurfaceData(boolean isMapDataIgnored)
                                  throws java.lang.Exception

      Overrides:
        `readSurfaceData` in class `VolumeFileReader`
      Throws:
        `java.lang.Exception`

    - #### readSurfaceDataXML

          protected boolean readSurfaceDataXML()
                                        throws java.lang.Exception

      Throws:
        `java.lang.Exception`

    - #### readSurfaceDataJXR

          protected void readSurfaceDataJXR()
                                     throws java.lang.Exception

      Throws:
        `java.lang.Exception`

    - #### jvxlReadFractionData

          protected java.lang.String jvxlReadFractionData(java.lang.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 javajs.util.BS getVoxelBitSet(int nPoints)
                                           throws java.lang.Exception

      Overrides:
        `getVoxelBitSet` in class `VolumeFileReader`
      Returns:
        JVXL bitset
      Throws:
        `java.lang.Exception`

    - #### getSurfacePointAndFraction

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

      Overrides:
        `getSurfacePointAndFraction` in class `VolumeFileReader`

    - #### getNextValue

          private float getNextValue()

    - #### setValueMinMax

          private void setValueMinMax()

    - #### jvxlGetNextFraction

          private float jvxlGetNextFraction(int base,
                                            int range,
                                            float fracOffset)

    - #### readColorData

          protected java.lang.String readColorData()

      Overrides:
        `readColorData` in class `SurfaceReader`

    - #### getColor

          private static int getColor(java.lang.String c)

    - #### getEncodedVertexData

          protected void getEncodedVertexData()
                                       throws java.lang.Exception

      retrieve Jvxl 2.0 format vertex/triangle/edge/color data found within element
      Throws:
        `java.lang.Exception`

    - #### getData

          private java.lang.String getData(java.lang.String sdata,
                                           java.lang.String name)
                                    throws java.lang.Exception

      Throws:
        `java.lang.Exception`

    - #### getEncoding

          private static java.lang.String getEncoding(java.lang.String data)

    - #### jvxlDecodeVertexData

          public javajs.util.P3[] jvxlDecodeVertexData(java.lang.String data,
                                                       boolean asArray)
                                                throws java.lang.Exception

      decode vertex data found within element as created by jvxlEncodeVertexData (see above)
      Parameters:
        `data` - tag and contents
        `asArray` - or just addVertexCopy
      Returns:
        Point3f[] if desired
      Throws:
        `java.lang.Exception`

    - #### jvxlDecodeTriangleData

          void jvxlDecodeTriangleData(java.lang.String tdata,
                                      java.lang.String edgeData,
                                      java.lang.String colorData)
                               throws java.lang.Exception

      decode triangle data found within element as created with jvxlEncodeTriangleData (see above)
      Parameters:
        `tdata` - tag and contents
        `edgeData` -
        `colorData` -
      Throws:
        `java.lang.Exception`

    - #### jvxlDecodeContourData

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

      Throws:
        `java.lang.Exception`

    - #### postProcessVertices

          protected void postProcessVertices()

      Overrides:
        `postProcessVertices` in class `SurfaceReader`