Avogadro  1.1.0
Public Member Functions | Protected Member Functions | Protected Attributes
Avogadro::Atom Class Reference

Representation of an atom. More...

#include <avogadro/atom.h>

Inheritance diagram for Avogadro::Atom:
Inheritance graph

List of all members.

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.

Moleculemolecule () const
const Eigen::Vector3d * pos () const
int atomicNumber () const
QList< unsigned long > bonds () const
QList< unsigned long > neighbors () const
Bondbond (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
Residueresidue () const
OpenBabel conversion functions

These functions are used convert between Avogadro and OpenBabel atoms.

OpenBabel::OBAtom OBAtom ()
bool setOBAtom (OpenBabel::OBAtom *obatom)

Overloaded operators.

Atomoperator= (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
int m_atomicNumber
QList< unsigned long > m_bonds

Detailed Description

Representation of an atom.

Marcus D. Hanwell

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.

Constructor & Destructor Documentation

Avogadro::Atom::Atom ( QObject parent = 0)


parentthe parent object, which should be a molecule.

References QObject::parent().


Member Function Documentation

void Avogadro::Atom::addBond ( unsigned long  bond) [protected]
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]
Atomic number of the atom.
Replaces GetAtomicNum()

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.

otherThe other Atom to test for bonding.
Pointer to the bond between the two atoms, or 0.

References Avogadro::Molecule::bond().

Referenced by addBond(), formalCharge(), and neighbors().

QList<unsigned long> Avogadro::Atom::bonds ( ) const [inline]
List of bond ids to the atom.

Referenced by Avogadro::Molecule::bond(), and Avogadro::Molecule::removeAtom().

const Eigen::Vector3d Avogadro::Atom::forceVector ( ) const
The force vector on this atom (if any)
Formal charge of the atom (default = 0)

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]
True if the atom is a hydrogen.

Referenced by Avogadro::Molecule::removeHydrogens().

Molecule* Avogadro::Atom::molecule ( ) const [inline]
A pointer to the Molecule that the Atom belongs to.
QList< unsigned long > Avogadro::Atom::neighbors ( ) const
List of neighbor ids to the atom (atoms bonded to that atom).

References bond(), Avogadro::Molecule::bondById(), Avogadro::Bond::otherAtom(), QList::push_back(), and QList::size().

Referenced by Avogadro::Molecule::removeHydrogens().

Partial charge of the atom.

References Avogadro::Molecule::calculatePartialCharges(), and m_atomicNumber.

Referenced by Avogadro::Molecule::dipoleMoment().

const Eigen::Vector3d * Avogadro::Atom::pos ( ) const
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().

A pointer to the Residue that the Atom is a part of.

References Avogadro::Molecule::residueById().

unsigned long Avogadro::Atom::residueId ( ) const
The Id of the Residue that the Atom is a part of.

Set the atomic number of the atom.

This will emit an updated signal

References m_atomicNumber, and Avogadro::Primitive::update().

Referenced by Avogadro::ZMatrix::update().

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().

void Avogadro::Atom::setPartialCharge ( double  charge) const

Set the partial charge of the atom.

This is not calculated by the atom, instead call Molecule::calculatePartialCharges()

Referenced by Avogadro::Molecule::addHydrogens(), and Avogadro::Molecule::calculatePartialCharges().

void Avogadro::Atom::setPos ( const Eigen::Vector3d &  vec)

Sets the position of the atom.

vecPosition of the atom.

References Avogadro::Molecule::setAtomPos().

Referenced by Avogadro::ZMatrix::update().

void Avogadro::Atom::setPos ( const Eigen::Vector3d *  vec) [inline]

Sets the position of the atom.

vecPosition of the atom.

References setPos().

Referenced by setPos().

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...

Member Data Documentation

Parent molecule - should always be valid.

Referenced by Avogadro::Molecule::addAtom(), OBAtom(), partialCharge(), setAtomicNumber(), and setOBAtom().

The documentation for this class was generated from the following files: