org.jmol.modelset
Class Atom

java.lang.Object
  extended by javax.vecmath.Tuple3f
      extended by javax.vecmath.Point3f
          extended by org.jmol.util.Point3fi
              extended by org.jmol.modelset.Atom
All Implemented Interfaces:
Serializable, Cloneable, JmolNode

public final class Atom
extends Point3fi
implements JmolNode

See Also:
Serialized Form

Field Summary
(package private)  char alternateLocationID
           
private  short atomicAndIsotopeNumber
           
 byte atomID
           
(package private)  int atomSite
           
private  BitSet atomSymmetry
           
(package private)  Bond[] bonds
           
(package private)  int clickabilityFlags
           
(package private)  short colixAtom
           
private static byte FLAG_MASK
           
private  byte formalChargeAndFlags
           
(package private)  Group group
           
private static byte IS_HETERO_FLAG
           
 short madAtom
           
(package private)  int nBackbonesDisplayed
           
(package private)  int nBondsDisplayed
           
(package private)  byte paletteID
           
static int RADIUS_MAX
           
(package private)  int shapeVisibilityFlags
           
private  float userDefinedVanDerWaalRadius
           
private  byte valence
           
private static byte VIBRATION_VECTOR_FLAG
           
 
Fields inherited from class org.jmol.util.Point3fi
index, modelIndex, screenDiameter, screenX, screenY, screenZ
 
Fields inherited from class javax.vecmath.Tuple3f
x, y, z
 
Constructor Summary
Atom(int modelIndex, int atomIndex, float x, float y, float z, float radius, BitSet atomSymmetry, int atomSite, short atomicAndIsotopeNumber, int formalCharge, boolean isHetero, char alternateLocationID)
           
 
Method Summary
 void addDisplayedBackbone(int backboneVisibilityFlag, boolean isVisible)
           
(package private)  void addDisplayedBond(int stickVisibilityFlag, boolean isVisible)
           
static float atomPropertyFloat(Viewer viewer, Atom atom, int tokWhat)
          called by isosurface and int comparator via atomProperty() and also by getBitsetProperty()
static int atomPropertyInt(Atom atom, int tokWhat)
          called by isosurface and int comparator via atomProperty() and also by getBitsetProperty()
static String atomPropertyString(Atom atom, int tokWhat)
           
static Tuple3f atomPropertyTuple(Atom atom, int tok)
           
 short calculateMad(Viewer viewer, RadiusData rd)
           
(package private)  void clearBonds()
           
 void delete(BitSet bsBonds)
           
(package private)  void deleteBond(Bond bond)
           
private  void deleteBond(int i)
           
 boolean equals(Object obj)
           
 Atom findAromaticNeighbor(int notAtomIndex)
           
 float getADPMinMax(boolean isMax)
           
 char getAlternateLocationID()
           
 short getAtomicAndIsotopeNumber()
           
 byte getAtomID()
           
 String getAtomName()
           
 int getAtomNumber()
           
 int getAtomSite()
           
 BitSet getAtomSymmetry()
           
 String getAtomType()
           
 int getBfactor100()
           
 Bond getBond(Atom atomOther)
           
 int getBondedAtomIndex(int bondIndex)
           
 float getBondingRadiusFloat()
           
 Bond[] getBonds()
           
 int getCellTranslation(int cellNNN, int[] cellRange, int nOps)
          Looks for a match in the cellRange list for this atom within the specified translation set select symop=0NNN for this
(package private)  Chain getChain()
           
 char getChainID()
           
 int getClickabilityFlags()
           
 short getColix()
           
 int getCovalentBondCount()
           
 int getCovalentHydrogenCount()
           
 float getCovalentRadiusFloat()
           
 boolean getCrossLinkLeadAtomIndexes(List vReturn)
           
(package private)  int getCurrentBondCount()
           
 float getDimensionValue(int dimension)
           
 JmolEdge[] getEdges()
           
 short getElementNumber()
           
 String getElementSymbol()
           
 String getElementSymbol(boolean withIsotope)
           
 Object[] getEllipsoid()
           
 int getFormalCharge()
           
private  Point3f getFractionalCoord(boolean asAbsolute)
           
private  float getFractionalCoord(char ch, boolean asAbsolute)
           
 Point3f getFractionalUnitCoord(boolean asCartesian)
           
private  float getFractionalUnitCoord(char ch)
           
 float getFractionalUnitDistance(Point3f pt, Point3f ptTemp1, Point3f ptTemp2)
           
 Group getGroup()
           
 String getGroup1(char c0)
           
 String getGroup3(boolean allowNull)
           
 short getGroupID()
           
 int getGroupIndex()
           
 float getGroupParameter(int tok)
           
 String getGroupType()
           
(package private)  String getIdentity(boolean allInfo)
           
(package private)  String getIdentityXYZ(boolean allInfo)
           
 int getImplicitHydrogenCount()
           
 int getIndex()
           
 String getInfo()
           
(package private)  String getInfoXYZ(boolean useChimeFormat)
           
 char getInsertionCode()
           
 short getIsotopeNumber()
           
 int getModelFileIndex()
           
 int getModelFileNumber()
           
 int getModelIndex()
           
 int getModelNumber()
           
(package private)  String getModelNumberForLabel()
           
 int getMoleculeNumber()
           
 int getMonomerIndex()
           
 int getNBackbonesDisplayed()
           
 int getOccupancy100()
           
 int getOffsetResidueAtom(String name, int offset)
           
 byte getPaletteID()
           
 float getPartialCharge()
           
 int getPolymerIndexInModel()
           
 int getPolymerLength()
           
 byte getProteinStructureSubType()
           
 String getProteinStructureTag()
           
 byte getProteinStructureType()
           
 float getRadius()
           
 int getRasMolRadius()
           
 int getResno()
           
 int getSelectedGroupCountWithinChain()
           
 int getSelectedGroupIndexWithinChain()
           
 int getSelectedMonomerCountWithinPolymer()
           
 int getSelectedMonomerIndexWithinPolymer()
           
(package private)  int getSeqcode()
           
(package private)  String getSeqcodeString()
           
(package private)  int getSeqNumber()
           
 int getShapeVisibilityFlags()
           
 int getStrucNo()
           
 String getStructureId()
           
 int getSurfaceDistance100()
           
(package private)  String getSymmetryOperatorList()
           
 int getSymmetryTranslation(int symop, int[] cellRange, int nOps)
          Given a symmetry operation number, the set of cells in the model, and the number of operations, this method returns either 0 or the cell number (555, 666) of the translated symmetry operation corresponding to this atom.
(package private)  int getTargetValence()
           
 int getValence()
           
 float getVanderwaalsRadiusFloat(Viewer viewer, int iType)
           
private  int getVdwType(int iType)
           
 float getVibrationCoord(char ch)
           
 Vector3f getVibrationVector()
           
(package private)  float getVolume(Viewer viewer, int iType)
           
 int hashCode()
           
 boolean hasVibration()
           
(package private)  boolean isAlternateLocationMatch(String strPattern)
           
 boolean isBonded(Atom atomOther)
           
 boolean isCarbohydrate()
           
 boolean isClickable()
           
 boolean isCrossLinked(JmolNode node)
           
(package private)  boolean isCursorOnTopOf(int xCursor, int yCursor, int minRadius, Atom competitor)
           
 boolean isDeleted()
           
 boolean isDna()
           
(package private)  boolean isGroup3(String group3)
           
 boolean isHetero()
           
 boolean isInFrame()
           
 boolean isLeadAtom()
           
 boolean isNucleic()
           
 boolean isProtein()
           
 boolean isPurine()
           
 boolean isPyrimidine()
           
 boolean isRna()
           
 boolean isShapeVisible(int shapeVisibilityFlag)
           
 boolean isTranslucent()
           
 boolean isVisible(int flags)
          determine if an atom or its PDB group is visible
(package private)  boolean isWithinStructure(byte type)
           
 void setAtomicAndIsotopeNumber(int n)
           
 void setBonds(Bond[] bonds)
           
 void setClickable(int flag)
           
 void setColixAtom(short colixAtom)
           
(package private)  void setFormalCharge(int charge)
           
(package private)  void setFractionalCoord(int tok, float fValue, boolean asAbsolute)
           
(package private)  void setFractionalCoord(Point3f ptNew, boolean asAbsolute)
           
(package private)  void setFractionalCoord(Point3f pt, Point3f ptNew, boolean asAbsolute)
           
(package private)  void setGroup(Group group)
           
 void setGroupBits(BitSet bs)
           
 void setMadAtom(Viewer viewer, RadiusData rd)
           
 void setPaletteID(byte paletteID)
           
 boolean setRadius(float radius)
           
 void setShapeVisibility(int shapeVisibilityFlag, boolean isVisible)
           
 void setShapeVisibilityFlags(int flag)
           
 void setTranslucent(boolean isTranslucent, float translucentLevel)
           
 void setValence(int nBonds)
           
(package private)  void setVibrationVector()
           
 String toString()
           
 
Methods inherited from class javax.vecmath.Point3f
distance, distanceL1, distanceLinf, distanceSquared, project
 
Methods inherited from class javax.vecmath.Tuple3f
absolute, absolute, add, add, clamp, clamp, clampMax, clampMax, clampMin, clampMin, clone, epsilonEquals, equals, get, get, getX, getY, getZ, interpolate, interpolate, negate, negate, scale, scale, scaleAdd, scaleAdd, set, set, set, set, setX, setY, setZ, sub, sub
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.jmol.api.JmolNode
set
 

Field Detail

VIBRATION_VECTOR_FLAG

private static final byte VIBRATION_VECTOR_FLAG
See Also:
Constant Field Values

IS_HETERO_FLAG

private static final byte IS_HETERO_FLAG
See Also:
Constant Field Values

FLAG_MASK

private static final byte FLAG_MASK
See Also:
Constant Field Values

RADIUS_MAX

public static final int RADIUS_MAX
See Also:
Constant Field Values

group

Group group

atomSymmetry

private BitSet atomSymmetry

atomSite

int atomSite

userDefinedVanDerWaalRadius

private float userDefinedVanDerWaalRadius

atomicAndIsotopeNumber

private short atomicAndIsotopeNumber

formalChargeAndFlags

private byte formalChargeAndFlags

valence

private byte valence

alternateLocationID

char alternateLocationID

atomID

public byte atomID

madAtom

public short madAtom

colixAtom

short colixAtom

paletteID

byte paletteID

bonds

Bond[] bonds

nBondsDisplayed

int nBondsDisplayed

nBackbonesDisplayed

int nBackbonesDisplayed

clickabilityFlags

int clickabilityFlags

shapeVisibilityFlags

int shapeVisibilityFlags
Constructor Detail

Atom

public Atom(int modelIndex,
            int atomIndex,
            float x,
            float y,
            float z,
            float radius,
            BitSet atomSymmetry,
            int atomSite,
            short atomicAndIsotopeNumber,
            int formalCharge,
            boolean isHetero,
            char alternateLocationID)
Method Detail

getAtomID

public byte getAtomID()

getBonds

public Bond[] getBonds()

setBonds

public void setBonds(Bond[] bonds)

getNBackbonesDisplayed

public int getNBackbonesDisplayed()

setShapeVisibilityFlags

public final void setShapeVisibilityFlags(int flag)

setShapeVisibility

public final void setShapeVisibility(int shapeVisibilityFlag,
                                     boolean isVisible)

isBonded

public boolean isBonded(Atom atomOther)

getBond

public Bond getBond(Atom atomOther)

addDisplayedBond

void addDisplayedBond(int stickVisibilityFlag,
                      boolean isVisible)

addDisplayedBackbone

public void addDisplayedBackbone(int backboneVisibilityFlag,
                                 boolean isVisible)

deleteBond

void deleteBond(Bond bond)

deleteBond

private void deleteBond(int i)

clearBonds

void clearBonds()

getBondedAtomIndex

public int getBondedAtomIndex(int bondIndex)
Specified by:
getBondedAtomIndex in interface JmolNode

setMadAtom

public void setMadAtom(Viewer viewer,
                       RadiusData rd)

calculateMad

public short calculateMad(Viewer viewer,
                          RadiusData rd)

getADPMinMax

public float getADPMinMax(boolean isMax)

getRasMolRadius

public int getRasMolRadius()

getCovalentBondCount

public int getCovalentBondCount()
Specified by:
getCovalentBondCount in interface JmolNode

getCovalentHydrogenCount

public int getCovalentHydrogenCount()
Specified by:
getCovalentHydrogenCount in interface JmolNode

getEdges

public JmolEdge[] getEdges()
Specified by:
getEdges in interface JmolNode

setColixAtom

public void setColixAtom(short colixAtom)

setPaletteID

public void setPaletteID(byte paletteID)

setTranslucent

public void setTranslucent(boolean isTranslucent,
                           float translucentLevel)

isTranslucent

public boolean isTranslucent()

getElementNumber

public short getElementNumber()
Specified by:
getElementNumber in interface JmolNode

getIsotopeNumber

public short getIsotopeNumber()
Specified by:
getIsotopeNumber in interface JmolNode

getAtomicAndIsotopeNumber

public short getAtomicAndIsotopeNumber()
Specified by:
getAtomicAndIsotopeNumber in interface JmolNode

setAtomicAndIsotopeNumber

public void setAtomicAndIsotopeNumber(int n)

getElementSymbol

public String getElementSymbol(boolean withIsotope)

getElementSymbol

public String getElementSymbol()

getAlternateLocationID

public char getAlternateLocationID()

isAlternateLocationMatch

boolean isAlternateLocationMatch(String strPattern)

isHetero

public boolean isHetero()

hasVibration

public boolean hasVibration()

setFormalCharge

void setFormalCharge(int charge)

setVibrationVector

void setVibrationVector()

getFormalCharge

public int getFormalCharge()
Specified by:
getFormalCharge in interface JmolNode

getOccupancy100

public int getOccupancy100()

getBfactor100

public int getBfactor100()

setRadius

public boolean setRadius(float radius)

delete

public void delete(BitSet bsBonds)

isDeleted

public boolean isDeleted()
Specified by:
isDeleted in interface JmolNode

setValence

public void setValence(int nBonds)

getValence

public int getValence()
Specified by:
getValence in interface JmolNode

getImplicitHydrogenCount

public int getImplicitHydrogenCount()
Specified by:
getImplicitHydrogenCount in interface JmolNode

getTargetValence

int getTargetValence()

getDimensionValue

public float getDimensionValue(int dimension)

getVanderwaalsRadiusFloat

public float getVanderwaalsRadiusFloat(Viewer viewer,
                                       int iType)

getVdwType

private int getVdwType(int iType)
Parameters:
iType -
Returns:
if VDW_AUTO, will return VDW_AUTO_JMOL, VDW_AUTO_RASMOL, or VDW_AUTO_BABEL based on the model type

getCovalentRadiusFloat

public float getCovalentRadiusFloat()

getBondingRadiusFloat

public float getBondingRadiusFloat()

getVolume

float getVolume(Viewer viewer,
                int iType)

getCurrentBondCount

int getCurrentBondCount()

getColix

public short getColix()

getPaletteID

public byte getPaletteID()

getRadius

public float getRadius()

getIndex

public int getIndex()
Specified by:
getIndex in interface JmolNode

getAtomSite

public int getAtomSite()
Specified by:
getAtomSite in interface JmolNode

getAtomSymmetry

public BitSet getAtomSymmetry()

setGroup

void setGroup(Group group)

getGroup

public Group getGroup()

setGroupBits

public void setGroupBits(BitSet bs)
Specified by:
setGroupBits in interface JmolNode

getAtomName

public String getAtomName()
Specified by:
getAtomName in interface JmolNode

getAtomType

public String getAtomType()

getAtomNumber

public int getAtomNumber()

isInFrame

public boolean isInFrame()

getShapeVisibilityFlags

public int getShapeVisibilityFlags()

isShapeVisible

public boolean isShapeVisible(int shapeVisibilityFlag)

getPartialCharge

public float getPartialCharge()

getEllipsoid

public Object[] getEllipsoid()

getSymmetryTranslation

public int getSymmetryTranslation(int symop,
                                  int[] cellRange,
                                  int nOps)
Given a symmetry operation number, the set of cells in the model, and the number of operations, this method returns either 0 or the cell number (555, 666) of the translated symmetry operation corresponding to this atom. atomSymmetry is a bitset that is created in adapter.smarter.AtomSetCollection It is arranged as follows: |--overall--|---cell1---|---cell2---|---cell3---|... |012..nOps-1|012..nOps-1|012..nOp-1s|012..nOps-1|... If a bit is set, it means that the atom was created using that operator operating on the base file set and translated for that cell. If any bit is set in any of the cell blocks, then the same bit will also be set in the overall block. This allows for rapid determination of special positions and also of atom membership in any operation set. Note that it is not necessarily true that an atom is IN the designated cell, because one can load {nnn mmm 0}, and then, for example, the {-x,-y,-z} operator sends atoms from 555 to 444. Still, those atoms would be marked as cell 555 here, because no translation was carried out. That is, the numbers 444 in symop=3444 do not refer to a cell, per se. What they refer to is the file-designated operator plus a translation of {-1 -1 -1/1}.

Parameters:
symop - = 0, 1, 2, 3, ....
cellRange - = {444, 445, 446, 454, 455, 456, .... }
nOps - = 2 for x,y,z;-x,-y,-z, for example
Returns:
cell number such as 565

getCellTranslation

public int getCellTranslation(int cellNNN,
                              int[] cellRange,
                              int nOps)
Looks for a match in the cellRange list for this atom within the specified translation set select symop=0NNN for this

Parameters:
cellNNN -
cellRange -
nOps -
Returns:
matching cell number, if applicable

getSymmetryOperatorList

String getSymmetryOperatorList()

getModelIndex

public int getModelIndex()
Specified by:
getModelIndex in interface JmolNode

getMoleculeNumber

public int getMoleculeNumber()

getFractionalCoord

private float getFractionalCoord(char ch,
                                 boolean asAbsolute)

getFractionalUnitCoord

private float getFractionalUnitCoord(char ch)

getFractionalCoord

private Point3f getFractionalCoord(boolean asAbsolute)

getFractionalUnitCoord

public Point3f getFractionalUnitCoord(boolean asCartesian)

getFractionalUnitDistance

public float getFractionalUnitDistance(Point3f pt,
                                       Point3f ptTemp1,
                                       Point3f ptTemp2)

setFractionalCoord

void setFractionalCoord(int tok,
                        float fValue,
                        boolean asAbsolute)

setFractionalCoord

void setFractionalCoord(Point3f ptNew,
                        boolean asAbsolute)

setFractionalCoord

void setFractionalCoord(Point3f pt,
                        Point3f ptNew,
                        boolean asAbsolute)

isCursorOnTopOf

boolean isCursorOnTopOf(int xCursor,
                        int yCursor,
                        int minRadius,
                        Atom competitor)

getInfo

public String getInfo()

getInfoXYZ

String getInfoXYZ(boolean useChimeFormat)

getIdentityXYZ

String getIdentityXYZ(boolean allInfo)

getIdentity

String getIdentity(boolean allInfo)

getGroupIndex

public int getGroupIndex()

getGroup3

public String getGroup3(boolean allowNull)
Specified by:
getGroup3 in interface JmolNode

getGroup1

public String getGroup1(char c0)
Specified by:
getGroup1 in interface JmolNode

isGroup3

boolean isGroup3(String group3)

isProtein

public boolean isProtein()
Specified by:
isProtein in interface JmolNode

isCarbohydrate

public boolean isCarbohydrate()

isNucleic

public boolean isNucleic()
Specified by:
isNucleic in interface JmolNode

isDna

public boolean isDna()
Specified by:
isDna in interface JmolNode

isRna

public boolean isRna()
Specified by:
isRna in interface JmolNode

isPurine

public boolean isPurine()
Specified by:
isPurine in interface JmolNode

isPyrimidine

public boolean isPyrimidine()
Specified by:
isPyrimidine in interface JmolNode

getSeqcode

int getSeqcode()

getResno

public int getResno()
Specified by:
getResno in interface JmolNode

isClickable

public boolean isClickable()

getClickabilityFlags

public int getClickabilityFlags()

setClickable

public void setClickable(int flag)

isVisible

public boolean isVisible(int flags)
determine if an atom or its PDB group is visible

Parameters:
flags - TODO
Returns:
true if the atom is in the "select visible" set

isLeadAtom

public boolean isLeadAtom()
Specified by:
isLeadAtom in interface JmolNode

getGroupParameter

public float getGroupParameter(int tok)

getChainID

public char getChainID()
Specified by:
getChainID in interface JmolNode

getSurfaceDistance100

public int getSurfaceDistance100()

getVibrationVector

public Vector3f getVibrationVector()

getVibrationCoord

public float getVibrationCoord(char ch)

getPolymerLength

public int getPolymerLength()

getPolymerIndexInModel

public int getPolymerIndexInModel()

getMonomerIndex

public int getMonomerIndex()

getSelectedGroupCountWithinChain

public int getSelectedGroupCountWithinChain()

getSelectedGroupIndexWithinChain

public int getSelectedGroupIndexWithinChain()

getSelectedMonomerCountWithinPolymer

public int getSelectedMonomerCountWithinPolymer()

getSelectedMonomerIndexWithinPolymer

public int getSelectedMonomerIndexWithinPolymer()

getChain

Chain getChain()

getModelNumberForLabel

String getModelNumberForLabel()

getModelNumber

public int getModelNumber()

getModelFileIndex

public int getModelFileIndex()

getModelFileNumber

public int getModelFileNumber()

getGroupType

public String getGroupType()
Specified by:
getGroupType in interface JmolNode

getProteinStructureType

public byte getProteinStructureType()

getProteinStructureSubType

public byte getProteinStructureSubType()

getStrucNo

public int getStrucNo()

getStructureId

public String getStructureId()

getProteinStructureTag

public String getProteinStructureTag()

getGroupID

public short getGroupID()

getSeqcodeString

String getSeqcodeString()

getSeqNumber

int getSeqNumber()

getInsertionCode

public char getInsertionCode()

equals

public boolean equals(Object obj)
Overrides:
equals in class Tuple3f

hashCode

public int hashCode()
Overrides:
hashCode in class Tuple3f

findAromaticNeighbor

public Atom findAromaticNeighbor(int notAtomIndex)

atomPropertyInt

public static int atomPropertyInt(Atom atom,
                                  int tokWhat)
called by isosurface and int comparator via atomProperty() and also by getBitsetProperty()

Parameters:
atom -
tokWhat -
Returns:
int value or Integer.MIN_VALUE

atomPropertyFloat

public static float atomPropertyFloat(Viewer viewer,
                                      Atom atom,
                                      int tokWhat)
called by isosurface and int comparator via atomProperty() and also by getBitsetProperty()

Parameters:
viewer -
atom -
tokWhat -
Returns:
float value or value*100 (asInt=true) or throw an error if not found

atomPropertyString

public static String atomPropertyString(Atom atom,
                                        int tokWhat)

atomPropertyTuple

public static Tuple3f atomPropertyTuple(Atom atom,
                                        int tok)

isWithinStructure

boolean isWithinStructure(byte type)

getOffsetResidueAtom

public int getOffsetResidueAtom(String name,
                                int offset)
Specified by:
getOffsetResidueAtom in interface JmolNode

isCrossLinked

public boolean isCrossLinked(JmolNode node)
Specified by:
isCrossLinked in interface JmolNode

getCrossLinkLeadAtomIndexes

public boolean getCrossLinkLeadAtomIndexes(List vReturn)
Specified by:
getCrossLinkLeadAtomIndexes in interface JmolNode

toString

public String toString()
Overrides:
toString in class Tuple3f