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

A fragment containing atoms and bonds. More...

#include <avogadro/fragment.h>

Inheritance diagram for Avogadro::Fragment:
Inheritance graph
[legend]

List of all members.

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

Moleculem_molecule
QString m_name
QList< unsigned long > m_atoms
QList< unsigned long > m_bonds

Detailed Description

A fragment containing atoms and bonds.

Author:
Marcus D. Hanwell

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.


Constructor & Destructor Documentation

Constructor

Parameters:
parentthe object parent.

References QObject::parent().

Avogadro::Fragment::Fragment ( Type  type,
QObject parent = 0 
) [explicit]

Consttructor. This class is further inherited by Residue.

References QObject::parent().

Destructor.


Member Function Documentation

void Avogadro::Fragment::addAtom ( unsigned long  id)

Add an Atom to the Fragment.

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)
QList< unsigned long > Avogadro::Fragment::atoms ( ) const
QList< unsigned long > Avogadro::Fragment::bonds ( ) const
Returns:
QList of the unique ids of the bonds in this Fragment.

References m_bonds.

QString Avogadro::Fragment::name ( ) const [inline]
Returns:
the name of the fragment.
Note:
Replaces GetName().

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)
void Avogadro::Fragment::setName ( QString  name) [inline]

Member Data Documentation

QList<unsigned long> Avogadro::Fragment::m_atoms [protected]
QList<unsigned long> Avogadro::Fragment::m_bonds [protected]

QList of the atom ids.

Referenced by addBond(), bonds(), and removeBond().


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