Avogadro
1.1.0
|
Representation of an atom. More...
#include <avogadro/atom.h>
Public Member Functions | |
Atom (QObject *parent=0) | |
~Atom () | |
Set atomic information | |
These functions are used to set atomic information. | |
void | setPos (const Eigen::Vector3d &vec) |
void | setPos (const Eigen::Vector3d *vec) |
void | setAtomicNumber (int num) |
void | setPartialCharge (double charge) const |
void | setFormalCharge (int charge) |
void | setGroupIndex (unsigned int index) |
void | setForceVector (const Eigen::Vector3d &force) |
void | setCustomLabel (const QString &label) |
void | setCustomColorName (const QString &name) |
void | setCustomRadius (const double radius) |
Get atomic information | |
These functions are used to get atomic information. | |
Molecule * | molecule () const |
const Eigen::Vector3d * | pos () const |
int | atomicNumber () const |
QList< unsigned long > | bonds () const |
QList< unsigned long > | neighbors () const |
Bond * | bond (const Atom *other) const |
double | valence () const |
unsigned int | groupIndex () const |
bool | isHydrogen () const |
double | partialCharge () const |
int | formalCharge () const |
QString | customLabel () const |
QString | customColorName () const |
double | customRadius () const |
const Eigen::Vector3d | forceVector () const |
unsigned long | residueId () const |
Residue * | residue () const |
OpenBabel conversion functions | |
These functions are used convert between Avogadro and OpenBabel atoms. | |
OpenBabel::OBAtom | OBAtom () |
bool | setOBAtom (OpenBabel::OBAtom *obatom) |
Operators | |
Overloaded operators. | |
Atom & | operator= (const Atom &other) |
Protected Member Functions | |
void | addBond (unsigned long bond) |
void | addBond (Bond *bond) |
void | removeBond (Bond *bond) |
void | removeBond (unsigned long bond) |
void | setResidue (unsigned long id) |
void | setResidue (const Residue *residue) |
Protected Attributes | |
AtomPrivate *const | d_ptr |
Molecule * | m_molecule |
int | m_atomicNumber |
QList< unsigned long > | m_bonds |
Representation of an atom.
The Atom class is a Primitive subclass that provides an Atom object. All atoms must be owned by a Molecule. It should also be removed by the Molecule that owns it.
Avogadro::Atom::Atom | ( | QObject * | parent = 0 | ) |
Constructor.
parent | the parent object, which should be a molecule. |
References QObject::parent().
Destructor.
void Avogadro::Atom::addBond | ( | unsigned long | bond | ) | [protected] |
Adds a reference to a bond to the atom.
References bond(), QList::indexOf(), and QList::push_back().
Referenced by addBond(), Avogadro::Molecule::operator=(), Avogadro::Bond::setAtoms(), Avogadro::Bond::setBegin(), and Avogadro::Bond::setEnd().
void Avogadro::Atom::addBond | ( | Bond * | bond | ) | [protected] |
Adds a reference to a bond to the atom.
References addBond(), and Avogadro::Primitive::id().
int Avogadro::Atom::atomicNumber | ( | ) | const [inline] |
Referenced by formalCharge(), and Avogadro::Molecule::OBMol().
Bond * Avogadro::Atom::bond | ( | const Atom * | other | ) | const |
Use this function to get the bond between this Atom and another.
other | The other Atom to test for bonding. |
References Avogadro::Molecule::bond().
Referenced by addBond(), formalCharge(), and neighbors().
QList<unsigned long> Avogadro::Atom::bonds | ( | ) | const [inline] |
Referenced by Avogadro::Molecule::bond(), and Avogadro::Molecule::removeAtom().
const Eigen::Vector3d Avogadro::Atom::forceVector | ( | ) | const |
int Avogadro::Atom::formalCharge | ( | ) | const |
References atomicNumber(), bond(), Avogadro::Molecule::bondById(), and Avogadro::Bond::order().
unsigned int Avogadro::Atom::groupIndex | ( | ) | const |
The index of the atom in group of atoms of the same element in Molecule
References Avogadro::Molecule::calculateGroupIndices().
bool Avogadro::Atom::isHydrogen | ( | ) | const [inline] |
Referenced by Avogadro::Molecule::removeHydrogens().
Molecule* Avogadro::Atom::molecule | ( | ) | const [inline] |
QList< unsigned long > Avogadro::Atom::neighbors | ( | ) | const |
References bond(), Avogadro::Molecule::bondById(), Avogadro::Bond::otherAtom(), QList::push_back(), and QList::size().
Referenced by Avogadro::Molecule::removeHydrogens().
References Avogadro::Molecule::atomPos(), QByteArray::data(), QObject::dynamicPropertyNames(), m_atomicNumber, QString::number(), QObject::property(), OpenBabel::OBAtom::SetAtomicNum(), OpenBabel::OBPairData::SetAttribute(), OpenBabel::OBAtom::SetData(), OpenBabel::OBAtom::SetFormalCharge(), OpenBabel::OBAtom::SetPartialCharge(), OpenBabel::OBPairData::SetValue(), OpenBabel::OBAtom::SetVector(), and QString::toAscii().
Referenced by Avogadro::Molecule::OBMol(), and Avogadro::Animation::setFrame().
double Avogadro::Atom::partialCharge | ( | ) | const |
References Avogadro::Molecule::calculatePartialCharges(), and m_atomicNumber.
Referenced by Avogadro::Molecule::dipoleMoment().
const Eigen::Vector3d * Avogadro::Atom::pos | ( | ) | const |
References Avogadro::Molecule::atomPos().
Referenced by Avogadro::Molecule::computeGeomInfo(), Avogadro::Molecule::dipoleMoment(), Avogadro::Bond::length(), Avogadro::NeighborList::nbrs(), Avogadro::Cube::setLimits(), Avogadro::ZMatrix::update(), and Avogadro::GLWidget::updateGeometry().
void Avogadro::Atom::removeBond | ( | Bond * | bond | ) | [protected] |
Removes the reference of the bond to the atom.
References Avogadro::Primitive::id().
Referenced by Avogadro::Bond::setBegin(), and Avogadro::Bond::setEnd().
void Avogadro::Atom::removeBond | ( | unsigned long | bond | ) | [protected] |
Removes the reference of the bond to the atom.
References Avogadro::Primitive::index(), QList::indexOf(), and QList::removeAt().
Residue * Avogadro::Atom::residue | ( | ) | const |
References Avogadro::Molecule::residueById().
unsigned long Avogadro::Atom::residueId | ( | ) | const |
void Avogadro::Atom::setAtomicNumber | ( | int | num | ) |
Set the atomic number of the atom.
References m_atomicNumber, and Avogadro::Primitive::update().
Referenced by Avogadro::ZMatrix::update().
void Avogadro::Atom::setCustomColorName | ( | const QString & | name | ) |
Set the custom color for the atom using color name
References QObject::name().
void Avogadro::Atom::setCustomLabel | ( | const QString & | label | ) |
Set the custom label for the atom
void Avogadro::Atom::setCustomRadius | ( | const double | radius | ) |
Set the custom radius for the atom
void Avogadro::Atom::setForceVector | ( | const Eigen::Vector3d & | force | ) |
Set the force vector on the atom (e.g., used to display vibrations)
Referenced by Avogadro::Molecule::setOBMol().
void Avogadro::Atom::setFormalCharge | ( | int | charge | ) |
Set the formal charge of the atom.
void Avogadro::Atom::setGroupIndex | ( | unsigned int | index | ) |
Set the number of the atom in group of atoms of the same element.
References Avogadro::Primitive::index().
Referenced by Avogadro::Molecule::calculateGroupIndices().
bool Avogadro::Atom::setOBAtom | ( | OpenBabel::OBAtom * | obatom | ) |
Copies the data from an OpenBabel::OBAtom to the atom.
References OpenBabel::OBAtom::GetAllData(), OpenBabel::OBAtom::GetAtomicNum(), OpenBabel::OBPairData::GetAttribute(), OpenBabel::OBAtom::GetFormalCharge(), OpenBabel::OBAtom::GetPartialCharge(), OpenBabel::OBPairData::GetValue(), m_atomicNumber, OpenBabel::OBGenericDataType::PairData, QObject::property(), Avogadro::Molecule::setAtomPos(), QObject::setProperty(), OpenBabel::OBAtom::x(), OpenBabel::OBAtom::y(), and OpenBabel::OBAtom::z().
Referenced by Avogadro::Molecule::addHydrogens(), and Avogadro::Molecule::setOBMol().
void Avogadro::Atom::setPartialCharge | ( | double | charge | ) | const |
Set the partial charge of the atom.
Referenced by Avogadro::Molecule::addHydrogens(), and Avogadro::Molecule::calculatePartialCharges().
void Avogadro::Atom::setPos | ( | const Eigen::Vector3d & | vec | ) |
Sets the position of the atom.
vec | Position of the atom. |
References Avogadro::Molecule::setAtomPos().
Referenced by Avogadro::ZMatrix::update().
void Avogadro::Atom::setPos | ( | const Eigen::Vector3d * | vec | ) | [inline] |
void Avogadro::Atom::setResidue | ( | unsigned long | id | ) | [protected] |
Set the Residue that this Atom is a part of.
References Avogadro::Primitive::id().
Referenced by Avogadro::Residue::addAtom(), and Avogadro::Residue::removeAtom().
void Avogadro::Atom::setResidue | ( | const Residue * | residue | ) | [protected] |
Set the Residue that this Atom is a part of.
References Avogadro::Primitive::id().
double Avogadro::Atom::valence | ( | ) | const [inline] |
The valence of the atom. FIXME - don't think this will cut it...
int Avogadro::Atom::m_atomicNumber [protected] |
Parent molecule - should always be valid.
Referenced by Avogadro::Molecule::addAtom(), OBAtom(), partialCharge(), setAtomicNumber(), and setOBAtom().