org.jmol.adapter.smarter
public abstract class AtomSetCollectionReader extends Object
Constructor and Description |
---|
AtomSetCollectionReader() |
Modifier and Type | Method and Description |
---|---|
protected void |
addJmolScript(String script) |
void |
addPrimitiveLatticeVector(int i,
float[] xyz,
int i0) |
protected void |
addSites(Map<String,Map<String,Object>> htSites) |
protected void |
addSiteScript(String script) |
protected void |
appendLoadNote(String info) |
void |
applySymmetryAndSetTrajectory() |
private boolean |
checkFilter(Atom atom,
String f) |
boolean |
checkFilter(String key) |
boolean |
checkLastModel()
sets continuing and doProcessLines
|
protected boolean |
checkLine() |
void |
checkLineForScript() |
protected void |
checkLineForScript(String line) |
private boolean |
checkUnitCell(int n) |
private void |
checkUnitCellOffset() |
void |
clearUnitCell() |
protected int |
cloneLastAtomSet(int atomCount,
Point3f[] pts) |
protected void |
discardLinesUntilBlank() |
protected String |
discardLinesUntilContains(String containsMatch) |
protected String |
discardLinesUntilContains(String s1,
String s2) |
protected String |
discardLinesUntilNonBlank() |
protected String |
discardLinesUntilStartsWith(String startsWith) |
boolean |
doGetModel(int modelNumber) |
boolean |
doGetVibration(int vibrationNumber) |
protected void |
fillDataBlock(String[][] data,
int minLineLen)
fills an array with a pre-defined number of lines of token data,
skipping blank lines in the process
|
protected void |
fillDataBlock(String[][] data,
int col0,
int colWidth,
int minLineLen)
fills an array with a predefined number of lines of data that is
arranged in fixed FORTRAN-like column format
|
protected float[] |
fillFloatArray(String s,
int width,
float[] data)
fills a float array with string data from a file
|
protected void |
fillFrequencyData(int iAtom0,
int atomCount,
int modelAtomCount,
boolean[] ignore,
boolean isWide,
int col0,
int colWidth,
int[] atomIndexes,
int minLineLen)
Extracts a block of frequency data from a file.
|
protected boolean |
filterAtom(Atom atom,
int iAtom) |
private boolean |
filterReject(String f,
String code,
String atomCode) |
protected void |
finalizeReader() |
private Object |
finish() |
static String |
getElementSymbol(int elementNumber) |
protected static ArrayList<Integer> |
getFortranFormatLengths(String s)
get all integers after letters
negative entries are spaces (1Xn)
|
protected static String[] |
getStrings(String sinfo,
int nFields,
int width) |
protected SymmetryInterface |
getSymmetry() |
protected String[] |
getTokens() |
static String[] |
getTokens(String s) |
protected static String[] |
getTokens(String s,
int iStart) |
protected static float[] |
getTokensFloat(String s,
float[] f,
int n) |
private void |
initialize() |
private void |
initializeCartesianToFractional() |
protected void |
initializeReader() |
protected void |
initializeSymmetry() |
boolean |
isLastModel(int modelNumber)
after reading a model, Q: Is this the last model?
|
protected void |
newAtomSet(String name) |
protected float |
parseFloat() |
float |
parseFloat(String s) |
protected float |
parseFloat(String s,
int iStart,
int iEnd) |
protected int |
parseInt() |
int |
parseInt(String s) |
protected int |
parseInt(String s,
int iStart) |
protected int |
parseInt(String s,
int iStart,
int iEnd) |
protected void |
parseStringInfestedFloatArray(String s,
float[] data) |
protected String |
parseToken() |
protected String |
parseToken(String s) |
protected String |
parseToken(String s,
int iStart,
int iEnd) |
protected String |
parseTokenNext(String s) |
protected static String |
parseTrimmed(String s,
int iStart) |
protected static String |
parseTrimmed(String s,
int iStart,
int iEnd) |
protected void |
processBinaryDocument(BinaryDocument doc) |
protected void |
processXml(Object DOMNode) |
protected Vector3f[] |
read3Vectors(boolean isBohr)
read three vectors, as for unit cube definitions
allows for non-numeric data preceding the number block
|
(package private) Object |
readData() |
protected Object |
readData(Object node) |
String |
readLine() |
protected String |
readLines(int nLines) |
protected void |
set2D() |
void |
setAtomCoord(Atom atom) |
void |
setAtomCoord(Atom atom,
float x,
float y,
float z) |
private void |
setError(Throwable e) |
protected void |
setFilter(String filter0) |
void |
setFractionalCoordinates(boolean TF) |
void |
setIsPDB() |
void |
setMOData(Map<String,Object> moData) |
protected void |
setPdb() |
void |
setSpaceGroupName(String name) |
void |
setSymmetryOperator(String xyz) |
void |
setTransform(float x1,
float y1,
float z1,
float x2,
float y2,
float z2,
float x3,
float y3,
float z3) |
void |
setUnitCell(float a,
float b,
float c,
float alpha,
float beta,
float gamma) |
void |
setUnitCellItem(int i,
float x) |
(package private) void |
setup(String fileName,
Map<String,Object> htParams,
Object reader) |
public static final float ANGSTROMS_PER_BOHR
public boolean isBinary
public AtomSetCollection atomSetCollection
protected BufferedReader reader
protected BinaryDocument doc
protected String readerName
public String line
public String prevline
protected int[] next
protected long ptLine
public int[] latticeCells
public boolean doProcessLines
public boolean iHaveUnitCell
public boolean iHaveSymmetryOperators
public boolean continuing
protected JmolViewer viewer
protected boolean doApplySymmetry
protected boolean ignoreFileSymmetryOperators
protected boolean isTrajectory
public boolean applySymmetryToBonds
protected boolean doCheckUnitCell
protected boolean getHeader
protected boolean isSequential
protected int templateAtomCount
public int modelNumber
protected int vibrationNumber
public int desiredVibrationNumber
protected BitSet bsModels
protected boolean havePartialChargeFilter
public String calculationType
protected String spaceGroup
protected boolean ignoreFileUnitCell
protected boolean ignoreFileSpaceGroupName
protected float[] notionalUnitCell
protected int desiredModelNumber
protected SymmetryInterface symmetry
protected OutputStream os
protected boolean iHaveFractionalCoordinates
protected boolean doPackUnitCell
protected String supercell
private StringBuffer loadNote
private boolean doConvertToFractional
private boolean merging
private boolean fileCoordinatesAreFractional
private float symmetryRange
private int[] firstLastStep
private int lastModelNumber
private int desiredSpaceGroupIndex
private Point3f fileScaling
private Point3f fileOffset
private Point3f fileOffsetFractional
private Point3f unitCellOffset
private boolean unitCellOffsetFractional
String fileName
protected int stateScriptVersionInt
public boolean haveModel
private String previousSpaceGroup
private float[] previousUnitCell
private int nMatrixElements
protected Matrix3f matUnitCellOrientation
protected BitSet bsFilter
protected String filter
private boolean haveAtomFilter
private boolean filterAltLoc
private boolean filterGroup3
private boolean filterChain
private boolean filterAtomType
private boolean filterElement
protected boolean filterHetero
private boolean filterEveryNth
private int filterN
private int nFiltered
private boolean doSetOrientation
protected boolean addVibrations
protected boolean useAltNames
public boolean readMolecularOrbitals
private String filter1
private String filter2
private Matrix3f matrixRotate
private String previousScript
private String siteScript
protected void processXml(Object DOMNode)
DOMNode
- protected void processBinaryDocument(BinaryDocument doc) throws Exception
doc
- Exception
protected boolean checkLine() throws Exception
Exception
public boolean checkLastModel()
public boolean isLastModel(int modelNumber)
modelNumber
- protected void appendLoadNote(String info)
public void setIsPDB()
protected void setPdb()
private Object finish()
private void setError(Throwable e)
private void initialize()
public boolean doGetModel(int modelNumber)
protected void initializeSymmetry()
protected void newAtomSet(String name)
protected int cloneLastAtomSet(int atomCount, Point3f[] pts) throws Exception
Exception
public void setSpaceGroupName(String name)
public void setSymmetryOperator(String xyz)
private void initializeCartesianToFractional()
public void clearUnitCell()
public void setUnitCellItem(int i, float x)
public void setUnitCell(float a, float b, float c, float alpha, float beta, float gamma)
public void addPrimitiveLatticeVector(int i, float[] xyz, int i0)
private boolean checkUnitCell(int n)
private void checkUnitCellOffset()
protected SymmetryInterface getSymmetry()
public void setFractionalCoordinates(boolean TF)
protected void setFilter(String filter0)
public boolean checkFilter(String key)
protected boolean filterAtom(Atom atom, int iAtom)
atom
- iAtom
- protected void set2D()
public boolean doGetVibration(int vibrationNumber)
public void setTransform(float x1, float y1, float z1, float x2, float y2, float z2, float x3, float y3, float z3)
public void setAtomCoord(Atom atom, float x, float y, float z)
public void setAtomCoord(Atom atom)
public void applySymmetryAndSetTrajectory() throws Exception
Exception
public static String getElementSymbol(int elementNumber)
protected void fillDataBlock(String[][] data, int col0, int colWidth, int minLineLen) throws Exception
data
- col0
- colWidth
- minLineLen
- minLinelen
- TODOException
protected void fillDataBlock(String[][] data, int minLineLen) throws Exception
data
- minLineLen
- TODOException
protected float[] fillFloatArray(String s, int width, float[] data) throws Exception
s
- string data containing floatswidth
- column width or 0 to read tokensdata
- result data to be filledException
protected void fillFrequencyData(int iAtom0, int atomCount, int modelAtomCount, boolean[] ignore, boolean isWide, int col0, int colWidth, int[] atomIndexes, int minLineLen) throws Exception
iAtom0
- the first atom to be assigned a frequencyatomCount
- the number of atoms to be assignedmodelAtomCount
- the number of atoms in each modelignore
- the frequencies to ignore because the user has selected only
certain vibrations to be read or for whatever reason; length
serves to set the number of frequencies to be readisWide
- when TRUE, this is a table that has X Y Z for each mode within the
same row; when FALSE, this is a table that has X Y Z for each mode
on a separate line.col0
- the column in which data startscolWidth
- the width of the data columnsatomIndexes
- an array either null or indicating exactly which atoms get the
frequencies (used by CrystalReader)minLineLen
- TODOException
protected String discardLinesUntilStartsWith(String startsWith) throws Exception
Exception
protected String discardLinesUntilContains(String containsMatch) throws Exception
Exception
protected String discardLinesUntilContains(String s1, String s2) throws Exception
Exception
protected String discardLinesUntilNonBlank() throws Exception
Exception
protected void checkLineForScript(String line)
public void checkLineForScript()
protected void addJmolScript(String script)
protected void addSiteScript(String script)
protected void parseStringInfestedFloatArray(String s, float[] data)
protected String[] getTokens()
protected static float[] getTokensFloat(String s, float[] f, int n)
protected float parseFloat()
public float parseFloat(String s)
protected float parseFloat(String s, int iStart, int iEnd)
protected int parseInt()
public int parseInt(String s)
protected int parseInt(String s, int iStart)
protected int parseInt(String s, int iStart, int iEnd)
protected String parseToken()
protected static ArrayList<Integer> getFortranFormatLengths(String s)
s
-