Avogadro
1.1.0
|
A fragment containing atoms and bonds. More...
#include <avogadro/fragment.h>
Public Member Functions | |
Fragment (QObject *parent=0) | |
Fragment (Type type, QObject *parent=0) | |
~Fragment () | |
QString | name () const |
void | setName (QString name) |
void | addAtom (unsigned long id) |
void | removeAtom (unsigned long id) |
QList< unsigned long > | atoms () const |
void | addBond (unsigned long id) |
void | removeBond (unsigned long id) |
QList< unsigned long > | bonds () const |
Protected Attributes | |
Molecule * | m_molecule |
QString | m_name |
QList< unsigned long > | m_atoms |
QList< unsigned long > | m_bonds |
A fragment containing atoms and bonds.
The Fragment class is a Primitive subclass that provides a generic way of addressing fragments. This is intended to be suitable for rings, residues, molecule fragments etc. That is anything that needs to address a subset of atoms/bonds in a Molecule.
Avogadro::Fragment::Fragment | ( | QObject * | parent = 0 | ) |
Avogadro::Fragment::Fragment | ( | Type | type, |
QObject * | parent = 0 |
||
) | [explicit] |
Consttructor. This class is further inherited by Residue.
References QObject::parent().
Destructor.
void Avogadro::Fragment::addAtom | ( | unsigned long | id | ) |
Reimplemented in Avogadro::Residue.
References QList::contains(), m_atoms, and QList::push_back().
Referenced by Avogadro::Molecule::rings().
void Avogadro::Fragment::addBond | ( | unsigned long | id | ) |
References QList::contains(), m_bonds, and QList::push_back().
Referenced by Avogadro::Molecule::setOBMol().
QList< unsigned long > Avogadro::Fragment::atoms | ( | ) | const |
References m_atoms.
Referenced by Avogadro::Protein::chainAtoms(), Avogadro::Molecule::OBMol(), Avogadro::Molecule::operator+=(), and Avogadro::Molecule::operator=().
QList< unsigned long > Avogadro::Fragment::bonds | ( | ) | const |
QString Avogadro::Fragment::name | ( | ) | const [inline] |
Reimplemented from QObject.
Referenced by Avogadro::Molecule::OBMol(), Avogadro::Molecule::operator+=(), and Avogadro::Molecule::operator=().
void Avogadro::Fragment::removeAtom | ( | unsigned long | id | ) |
Remove the Atom from the Fragment.
Reimplemented in Avogadro::Residue.
References Avogadro::Primitive::index(), QList::indexOf(), m_atoms, and QList::removeAt().
void Avogadro::Fragment::removeBond | ( | unsigned long | id | ) |
Remove the Bond from the Fragment.
References Avogadro::Primitive::index(), QList::indexOf(), m_bonds, and QList::removeAt().
void Avogadro::Fragment::setName | ( | QString | name | ) | [inline] |
Set the name of the fragment.
Referenced by Avogadro::Molecule::operator+=(), Avogadro::Molecule::operator=(), and Avogadro::Molecule::setOBMol().
QList<unsigned long> Avogadro::Fragment::m_atoms [protected] |
The name of the Fragment.
Referenced by Avogadro::Residue::addAtom(), addAtom(), Avogadro::Residue::atomId(), atoms(), Avogadro::Residue::removeAtom(), removeAtom(), Avogadro::Residue::setAtomId(), and Avogadro::Residue::setAtomIds().
QList<unsigned long> Avogadro::Fragment::m_bonds [protected] |
QList of the atom ids.
Referenced by addBond(), bonds(), and removeBond().