org.jmol.jvxl.readers

Class JvxlReader

public class JvxlReader extends VolumeFileReader

Field Summary
intcolorDataCount
intedgeDataCount
intfractionPtr
static StringJVXL_VERSION
intnThisValue
StringstrFractionTemp
intsurfaceDataCount
booleanthisInside
Constructor Summary
JvxlReader(SurfaceGenerator sg, BufferedReader br)
Method Summary
intcountData(String str)
protected floatgetNextVoxelValue(StringBuffer sb)
protected voidgotoAndReadVoxelData(boolean isMapData)
protected voidgotoData(int n, int nPoints)
protected voidinitializeVoxelData()
static voidjvxlAddDummyAtomList(VolumeData v, StringBuffer bs)
protected static booleanjvxlCheckAtomLine(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).
static StringjvxlCompressString(String data)
static voidjvxlCreateColorData(JvxlData jvxlData, float[] vertexValues)
protected static voidjvxlCreateHeader(VolumeData v, int nAtoms, Point3f[] atomXyz, int[] atomNo, StringBuffer sb)
protected static voidjvxlCreateHeaderWithoutTitleOrAtoms(VolumeData v, StringBuffer bs)
static intjvxlCreateSurfaceData(JvxlData jvxlData, float[][][] voxelData, float cutoff, boolean isCutoffAbsolute, int nX, int nY, int nZ)
protected static StringjvxlExtraLine(JvxlData jvxlData, int n)
protected static charjvxlFractionAsCharacter(float fraction, int base, int range)
protected static floatjvxlFractionFromCharacter(int ich, int base, int range, float fracOffset)
protected static floatjvxlFractionFromCharacter2(int ich1, int ich2, int base, int range)
static StringjvxlGetDefinitionLine(JvxlData jvxlData, boolean isInfo)
static StringjvxlGetFile(JvxlData jvxlData, String[] title, String msg, boolean includeHeader, int nSurfaces, String state, String comment)
floatjvxlGetNextFraction(int base, int range, float fracOffset)
protected static voidjvxlReadAtoms(BufferedReader br, StringBuffer bs, int atomCount, VolumeData v)
StringjvxlReadData(String type, int nPoints)
voidjvxlReadDefinitionLine(boolean showMsg)
voidjvxlSkipData(int nPoints, boolean doSkipColorData)
voidjvxlSkipDataBlock(int nPoints, boolean isInt)
static StringjvxlUncompressString(String data)
protected static voidjvxlUpdateInfo(JvxlData jvxlData, String[] title, int nBytes)
static voidjvxlUpdateInfoLines(JvxlData jvxlData)
static voidjvxlUpdateSurfaceData(JvxlData jvxlData, float[] vertexValues, int vertexCount, int vertexIncrement, char isNaN)
protected static charjvxlValueAsCharacter(float value, float min, float max, int base, int range)
protected static charjvxlValueAsCharacter2(float value, float min, float max, int base, int range, char[] remainder)
protected static floatjvxlValueFromCharacter2(int ich, int ich2, float min, float max, int base, int range)
protected voidreadAtomCountAndOrigin()
protected StringreadColorData()
protected intreadExtraLine()
protected floatreadSurfacePoint(float cutoff, boolean isCutoffAbsolute, float valueA, float valueB, Point3f pointA, Vector3f edgeVector, float[] fReturn, Point3f ptReturn)
protected voidreadTitleLines()
protected voidreadVolumeData(boolean isMapData)
protected voidreadVoxelData(boolean isMapDataIgnored)
protected static voidsetSurfaceInfo(JvxlData jvxlData, Point4f thePlane, int nSurfaceInts, StringBuffer surfaceData)

Field Detail

colorDataCount

private int colorDataCount

edgeDataCount

private int edgeDataCount

fractionPtr

private int fractionPtr

JVXL_VERSION

private static final String JVXL_VERSION

nThisValue

private int nThisValue

strFractionTemp

private String strFractionTemp

surfaceDataCount

private int surfaceDataCount

thisInside

private boolean thisInside

Constructor Detail

JvxlReader

JvxlReader(SurfaceGenerator sg, BufferedReader br)

Method Detail

countData

private int countData(String str)

getNextVoxelValue

protected float getNextVoxelValue(StringBuffer sb)

gotoAndReadVoxelData

protected void gotoAndReadVoxelData(boolean isMapData)

gotoData

protected void gotoData(int n, int nPoints)

initializeVoxelData

protected void initializeVoxelData()

jvxlAddDummyAtomList

private static void jvxlAddDummyAtomList(VolumeData v, StringBuffer bs)

jvxlCheckAtomLine

protected static boolean jvxlCheckAtomLine(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

jvxlCompressString

private static String jvxlCompressString(String data)

jvxlCreateColorData

public static void jvxlCreateColorData(JvxlData jvxlData, float[] vertexValues)

jvxlCreateHeader

protected static void jvxlCreateHeader(VolumeData v, int nAtoms, Point3f[] atomXyz, int[] atomNo, StringBuffer sb)

jvxlCreateHeaderWithoutTitleOrAtoms

protected static void jvxlCreateHeaderWithoutTitleOrAtoms(VolumeData v, StringBuffer bs)

jvxlCreateSurfaceData

public static int jvxlCreateSurfaceData(JvxlData jvxlData, float[][][] voxelData, float cutoff, boolean isCutoffAbsolute, int nX, int nY, int nZ)

jvxlExtraLine

protected static String jvxlExtraLine(JvxlData jvxlData, int n)

jvxlFractionAsCharacter

protected static char jvxlFractionAsCharacter(float fraction, int base, int range)

jvxlFractionFromCharacter

protected static float jvxlFractionFromCharacter(int ich, int base, int range, float fracOffset)

jvxlFractionFromCharacter2

protected static float jvxlFractionFromCharacter2(int ich1, int ich2, int base, int range)

jvxlGetDefinitionLine

public static String jvxlGetDefinitionLine(JvxlData jvxlData, boolean isInfo)

jvxlGetFile

public static String jvxlGetFile(JvxlData jvxlData, String[] title, String msg, boolean includeHeader, int nSurfaces, String state, String comment)

jvxlGetNextFraction

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

jvxlReadAtoms

protected static void jvxlReadAtoms(BufferedReader br, StringBuffer bs, int atomCount, VolumeData v)

jvxlReadData

private String jvxlReadData(String type, int nPoints)

jvxlReadDefinitionLine

private void jvxlReadDefinitionLine(boolean showMsg)

jvxlSkipData

private void jvxlSkipData(int nPoints, boolean doSkipColorData)

jvxlSkipDataBlock

private void jvxlSkipDataBlock(int nPoints, boolean isInt)

jvxlUncompressString

private static String jvxlUncompressString(String data)

jvxlUpdateInfo

protected static void jvxlUpdateInfo(JvxlData jvxlData, String[] title, int nBytes)

jvxlUpdateInfoLines

public static void jvxlUpdateInfoLines(JvxlData jvxlData)

jvxlUpdateSurfaceData

public static void jvxlUpdateSurfaceData(JvxlData jvxlData, float[] vertexValues, int vertexCount, int vertexIncrement, char isNaN)

jvxlValueAsCharacter

protected static char jvxlValueAsCharacter(float value, float min, float max, int base, int range)

jvxlValueAsCharacter2

protected static char jvxlValueAsCharacter2(float value, float min, float max, int base, int range, char[] remainder)

jvxlValueFromCharacter2

protected static float jvxlValueFromCharacter2(int ich, int ich2, float min, float max, int base, int range)

readAtomCountAndOrigin

protected void readAtomCountAndOrigin()

readColorData

protected String readColorData()

readExtraLine

protected int readExtraLine()

readSurfacePoint

protected float readSurfacePoint(float cutoff, boolean isCutoffAbsolute, float valueA, float valueB, Point3f pointA, Vector3f edgeVector, float[] fReturn, Point3f ptReturn)

readTitleLines

protected void readTitleLines()

readVolumeData

protected void readVolumeData(boolean isMapData)

readVoxelData

protected void readVoxelData(boolean isMapDataIgnored)

setSurfaceInfo

protected static void setSurfaceInfo(JvxlData jvxlData, Point4f thePlane, int nSurfaceInts, StringBuffer surfaceData)