#include <atomset.h>
Each atom has an index which starts at 0. This class can accomodate as many atoms as RAM can hold.
Atomic properties that can be/are stored:
Definition at line 42 of file atomset.h.
Public Types | |
enum | ChargeType { None, Mulliken, Stockholder } |
Public Member Functions | |
AtomSet () | |
~AtomSet () | |
The default destructor. | |
void | clear () |
Removes all atoms. | |
void | reserve (const unsigned int size) |
Resizes all the vectors to accomodate the requested number of atoms. | |
void | addAtom (const Point3D< double > &location, const unsigned int atomicNumber, const QColor color, const int index=-1) |
Adds an atom of type atomicNumber with coordinates location and color color at position index. | |
void | addAtom (const Point3D< double > &location, const unsigned int atomicNumber, const int index=-1) |
Adds an atom. | |
void | addAtom (const double x, const double y, const double z, const unsigned int atomicNumber, const QColor color, const int index=-1) |
Adds an atom with cartesian coordinates and a special color. | |
void | addAtom (const double x, const double y, const double z, const unsigned int atomicNumber, const int index=-1) |
Adds an atom with cartesian coordinates. | |
void | removeAtom (const unsigned int index) |
Removes the atom at position index. | |
void | setX (const unsigned int index, const double x) |
Sets the x-coordinate of the atom at position index . | |
void | setY (const unsigned int index, const double y) |
Sets the y-coordinate of the atom at position index . | |
void | setZ (const unsigned int index, const double z) |
Sets the z-coordinate of the atom at position index. | |
void | setColor (const unsigned int index, const QColor color) |
Sets the color of the atom at position index. | |
void | setCharges (const vector< double > &charges, const ChargeType type, const QString scf=QString::null, const QString density=QString::null) |
Sets the charges on all atoms. | |
void | clearCharges (const ChargeType type) |
Clears the charges of a specific type. | |
void | setForces (const unsigned int index, const double dx, const double dy, const double dz) |
Sets the forces on the atom at position index. | |
void | changeBond (const double amount, const unsigned int movingAtom, const unsigned int secondAtom, const bool includeNeighbours=false) |
Changes the bond length between two atoms. | |
void | changeAngle (const double amount, const unsigned int movingAtom, const unsigned int centralAtom, const unsigned int lastAtom, const bool includeNeighbours=false) |
Changes the angle between two bonds. | |
void | changeTorsion (const double amount, const unsigned int movingAtom, const unsigned int secondAtom, const unsigned int thirdAtom, const unsigned int fourthAtom, const bool includeNeighbours=false) |
Changes the torsion angle between two bonds. | |
void | transferCoordinates (const AtomSet *source) |
Copies the coordinates from another AtomSet and resets the properties by default. | |
unsigned int | count () const |
Returns the number of atoms. | |
Point3D< double > | coordinates (const unsigned int index) const |
Returns the coordinates of the atom at position index . | |
double | x (const unsigned int index) const |
Returns the x-coordinate of the atom at position index . | |
double | y (const unsigned int index) const |
Returns the y-coordinate of the atom at position index . | |
double | z (const unsigned int index) const |
Returns the z-coordinate of the atom at position index . | |
unsigned int | atomicNumber (const unsigned int index) const |
Returns the atomic number of the atom at position index . | |
QColor | color (const unsigned int index) const |
Returns the color of the atom at position index . | |
vector< unsigned int > | usedAtomicNumbers () const |
Returns a vector containing a sorted list of the atomic numbers present in the set. | |
void | bonds (vector< unsigned int > *&first, vector< unsigned int > *&second) |
Returns a list of the bonds between the atoms. | |
unsigned int | numberOfBonds (const unsigned int index) const |
Returns the number of bonds an atom has. | |
bool | isLinear () const |
Returns true if the atoms form a linear molecule. | |
bool | isChanged () const |
Returns true if the AtomSet has changed. | |
double | dx (const unsigned int index) const |
Returns the x-component of the force on the atom at position index. | |
double | dy (const unsigned int index) const |
Returns the y-component of the force on the atom at position index. | |
double | dz (const unsigned int index) const |
Returns the z-component of the force on the atom at position index. | |
double | bond (const unsigned int atom1, const unsigned int atom2) const |
Returns the distance between the two atoms. | |
double | angle (const unsigned int atom1, const unsigned int atom2, const unsigned int atom3) const |
Returns the value of the valence angle 1-2-3. | |
double | torsion (const unsigned int atom1, const unsigned int atom2, const unsigned int atom3, const unsigned int atom4) const |
Returns the value of the torsion angle 1-2-3-4. | |
double | charge (const ChargeType type, const unsigned int index) const |
Returns the charge on the atom at position index for a specific charge type. | |
bool | hasCharges (const ChargeType type) const |
Returns whether charges of the specified type are present. | |
QString | chargesSCF (const ChargeType type) const |
Returns the SCF method used to determine the charges. | |
QString | chargesDensity (const ChargeType type) const |
Returns the density used to determine the charges. | |
bool | hasForces () const |
Returns whether forces are present. | |
Point3D< float > | rotationCenter () const |
Returns the optimal center of rotation for the molecule. | |
bool | needsExtendedFormat () |
Returns true if the coordinates need to be written in BRABO's extended format in order to prevent clipping. | |
void | loadCML (const QDomElement *root) |
Reads all atom data from a QDomElement. | |
void | saveCML (QDomElement *root) |
Saves all atom data to a QDomElement. | |
Static Public Member Functions | |
static unsigned int | atomToNum (const QString &atom) |
Returns the atomic number corresponding to the element atom. | |
static QString | numToAtom (const unsigned int atom) |
Returns the element corresponding to the atomic number atom. | |
static float | vanderWaals (const unsigned int atom) |
Returns the Van der Waals radius for the atomic number atom. | |
static QColor | stdColor (const unsigned int atom) |
Returns the standard color for the atomic number atom. | |
Static Public Attributes | |
static const unsigned int | maxElements = 54 |
Private Member Functions | |
void | setChanged (const bool state=true) |
Sets the 'changed' property of the AtomSet. | |
void | setGeometryChanged () |
Indicates the geometry has changed. | |
bool | addBondList (const unsigned int callingAtom, const unsigned int startAtom, const unsigned int endAtom1, const unsigned int endAtom2, std::vector< unsigned int > *result) |
Returns all direct and indirectly bonded atoms to startAtom in result. | |
void | clearProperties () |
Deletes all properties. This includes the forces and charges. | |
void | updateBoxDimensions () |
Calculates the dimensions of the smallest box (in the XYZ coordinate system) including all atoms. | |
void | addBonds (const vector< unsigned int > *atomList1, const vector< unsigned int > *atomList2) |
Calculates all bonds between the atoms in the 2 provided lists and adds them to the bonds1 and bonds2 vectors. | |
Private Attributes | |
unsigned int | numAtoms |
the number of atoms | |
bool | changed |
= true if anything changed | |
vector< Point3D< double > > | coords |
cartesian coordinates of the atoms with the atomic numbers as the ID's | |
vector< QColor > | colors |
colors of the atoms | |
vector< Point3D< double > > * | forces |
forces on the atoms | |
vector< unsigned int > | bonds1 |
the first part of the bonds array | |
vector< unsigned int > | bonds2 |
the second part of the bonds array | |
vector< double > * | chargesMulliken |
Contains the Mulliken charges if present. | |
vector< double > * | chargesStockholder |
Contains the stockholder charges if present. | |
QString | chargesMullikenSCF |
The type of SCF method used for calculating the Mulliken charges (e.g. RHF/6-31G). | |
QString | chargesMullikenDensity |
The density used to calculate the Mulliken charges. | |
QString | chargesStockholderSCF |
The type of SCF method used for calculating the stockholder charges (e.g. RHF/6-31G). | |
QString | chargesStockholderDensity |
The density used to calculate the stockholder charges. | |
Point3D< double > * | boxMax |
The first point of the smallest box surrounding the atoms (have to use pointers because point3d.h cannot be included). | |
Point3D< double > * | boxMin |
The second point of the smallest box surrounding the atoms. | |
bool | dirtyBox |
If true the box needs to be recalculated. |
|
|
|
Definition at line 70 of file atomset.cpp. |
|
The default destructor.
Definition at line 84 of file atomset.cpp. |
|
Removes all atoms.
Definition at line 93 of file atomset.cpp. |
|
Resizes all the vectors to accomodate the requested number of atoms.
Definition at line 106 of file atomset.cpp. |
|
Adds an atom of type atomicNumber with coordinates location and color color at position index. If index is negative (the default) the atom is added at the end.
Definition at line 123 of file atomset.cpp. |
|
Adds an atom.
Definition at line 170 of file atomset.cpp. |
|
Adds an atom with cartesian coordinates and a special color.
Definition at line 177 of file atomset.cpp. |
|
Adds an atom with cartesian coordinates.
Definition at line 184 of file atomset.cpp. |
|
Removes the atom at position index.
Definition at line 191 of file atomset.cpp. |
|
Sets the x-coordinate of the atom at position
Definition at line 217 of file atomset.cpp. |
|
Sets the y-coordinate of the atom at position
Definition at line 229 of file atomset.cpp. |
|
Sets the z-coordinate of the atom at position index.
Definition at line 241 of file atomset.cpp. |
|
Sets the color of the atom at position index.
Definition at line 253 of file atomset.cpp. |
|
Sets the charges on all atoms.
Definition at line 264 of file atomset.cpp. |
|
Clears the charges of a specific type.
Definition at line 303 of file atomset.cpp. |
|
Sets the forces on the atom at position index.
Definition at line 326 of file atomset.cpp. |
|
Changes the bond length between two atoms. This is done by moving movingAtom with respect to secondAtom. If includeNeighbours = true the atoms bonded to movingAtom will be moved by the same amount.
Definition at line 339 of file atomset.cpp. |
|
Changes the angle between two bonds. This is done between the bonds movingAtom-centralAtom and centralAtom-lastAtom by rotating movingAtom with respect to the other atoms. If includeNeighbours = true the atoms bonded to movingAtom will be rotated by the same amount.
Definition at line 386 of file atomset.cpp. |
|
Changes the torsion angle between two bonds. This is done between the bonds movingAtom-secondAtom and thirdAtom-fourthAtom by rotating movingAtom with respect to the central bond secondAtom-thirdAtom. If includeNeighbours = true the atoms bonded to movingAtom will be rotated by the same amount.
Definition at line 435 of file atomset.cpp. |
|
Copies the coordinates from another AtomSet and resets the properties by default. It resembles a limited copy constructor and only works when both sets contain the same amount of atoms. Atom types are not checked.
Definition at line 493 of file atomset.cpp. |
|
Returns the number of atoms.
Definition at line 510 of file atomset.cpp. |
|
Returns the coordinates of the atom at position
Definition at line 517 of file atomset.cpp. |
|
Returns the x-coordinate of the atom at position
Definition at line 527 of file atomset.cpp. |
|
Returns the y-coordinate of the atom at position
Definition at line 537 of file atomset.cpp. |
|
Returns the z-coordinate of the atom at position
Definition at line 547 of file atomset.cpp. |
|
Returns the atomic number of the atom at position
Definition at line 557 of file atomset.cpp. |
|
Returns the color of the atom at position
Definition at line 567 of file atomset.cpp. |
|
Returns a vector containing a sorted list of the atomic numbers present in the set. Only the known atoms are returned. Definition at line 577 of file atomset.cpp. |
|
Returns a list of the bonds between the atoms. Unknown atoms can never have bonds. This routine puts atoms in boxes of 4x4x4 Angstrom and only looks for bonds between neighbouring boxes. Definition at line 600 of file atomset.cpp. |
|
Returns the number of bonds an atom has.
Definition at line 757 of file atomset.cpp. |
|
Returns true if the atoms form a linear molecule.
Definition at line 786 of file atomset.cpp. |
|
Returns true if the AtomSet has changed.
Definition at line 817 of file atomset.cpp. |
|
Returns the x-component of the force on the atom at position index.
Definition at line 824 of file atomset.cpp. |
|
Returns the y-component of the force on the atom at position index.
Definition at line 835 of file atomset.cpp. |
|
Returns the z-component of the force on the atom at position index.
Definition at line 846 of file atomset.cpp. |
|
Returns the distance between the two atoms.
Definition at line 857 of file atomset.cpp. |
|
Returns the value of the valence angle 1-2-3.
Definition at line 865 of file atomset.cpp. |
|
Returns the value of the torsion angle 1-2-3-4.
Definition at line 874 of file atomset.cpp. |
|
Returns the charge on the atom at position index for a specific charge type.
Definition at line 884 of file atomset.cpp. |
|
Returns whether charges of the specified type are present.
Definition at line 907 of file atomset.cpp. |
|
Returns the SCF method used to determine the charges. If no charges of the specified type are available an empty string is returned. Definition at line 918 of file atomset.cpp. |
|
Returns the density used to determine the charges. If no charges of the specified type are available an empty string is returned. Definition at line 931 of file atomset.cpp. |
|
Returns whether forces are present.
Definition at line 944 of file atomset.cpp. |
|
Returns the optimal center of rotation for the molecule.
Definition at line 951 of file atomset.cpp. |
|
Returns true if the coordinates need to be written in BRABO's extended format in order to prevent clipping. This is needed as soon as one coordinate value is at least 100.0 or a negative value at least -10.0. Definition at line 960 of file atomset.cpp. |
|
Reads all atom data from a QDomElement.
Definition at line 971 of file atomset.cpp. |
|
Saves all atom data to a QDomElement. The QDomElement passed as root should be the </molecule> tag. Definition at line 1058 of file atomset.cpp. |
|
Returns the atomic number corresponding to the element atom.
Definition at line 1126 of file atomset.cpp. |
|
Returns the element corresponding to the atomic number atom.
Definition at line 1191 of file atomset.cpp. |
|
Returns the Van der Waals radius for the atomic number atom.
Definition at line 1258 of file atomset.cpp. |
|
Returns the standard color for the atomic number atom.
Definition at line 1326 of file atomset.cpp. |
|
Sets the 'changed' property of the AtomSet.
Definition at line 1399 of file atomset.cpp. |
|
Indicates the geometry has changed.
Definition at line 1406 of file atomset.cpp. |
|
Returns all direct and indirectly bonded atoms to startAtom in result. If any atom of this list (except startAtom) is bonded to endAtom, false is returned (indicates the presence of a ring-structure including the startAtom-endAtom bond. If true is returned the resulting list of bonded atoms is complete -> recursive ! Definition at line 1420 of file atomset.cpp. |
|
Deletes all properties. This includes the forces and charges.
Definition at line 1500 of file atomset.cpp. |
|
Calculates the dimensions of the smallest box (in the XYZ coordinate system) including all atoms.
Definition at line 1525 of file atomset.cpp. |
|
Calculates all bonds between the atoms in the 2 provided lists and adds them to the bonds1 and bonds2 vectors.
Definition at line 1567 of file atomset.cpp. |
|
|
|
the number of atoms
|
|
= true if anything changed
|
|
cartesian coordinates of the atoms with the atomic numbers as the ID's
|
|
colors of the atoms
|
|
forces on the atoms
|
|
the first part of the bonds array
|
|
the second part of the bonds array
|
|
Contains the Mulliken charges if present.
|
|
Contains the stockholder charges if present.
|
|
The type of SCF method used for calculating the Mulliken charges (e.g. RHF/6-31G).
|
|
The density used to calculate the Mulliken charges.
|
|
The type of SCF method used for calculating the stockholder charges (e.g. RHF/6-31G).
|
|
The density used to calculate the stockholder charges.
|
|
The first point of the smallest box surrounding the atoms (have to use pointers because point3d.h cannot be included).
|
|
The second point of the smallest box surrounding the atoms.
|
|
If true the box needs to be recalculated.
|