Avogadro  1.1.0
Public Member Functions
Avogadro::Bond Class Reference

Representation of a chemical bond. More...

#include <avogadro/bond.h>

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

List of all members.

Public Member Functions

 Bond (QObject *parent=0)
Set bonding information

These functions are used to set bonding information.

void setBegin (Atom *atom)
void setEnd (Atom *atom)
void setAtoms (unsigned long atom1, unsigned long atom2, short order=1)
void setOrder (short order)
void setAromaticity (bool isAromatic) const
void setCustomLabel (const QString &label)
Get bonding information

These functions are used to get bonding information.

unsigned long beginAtomId () const
AtombeginAtom () const
unsigned long endAtomId () const
AtomendAtom () const
const Eigen::Vector3d * beginPos () const
const Eigen::Vector3d * midPos () const
const Eigen::Vector3d * endPos () const
unsigned long otherAtom (unsigned long atomId) const
short order () const
bool isAromatic () const
double length () const
QString customLabel () const
OpenBabel conversion functions

These functions are used convert between Avogadro and OpenBabel bonds.

bool setOBBond (OpenBabel::OBBond *obbond)
Operators

Overloaded operators.

Bondoperator= (const Bond &other)

Detailed Description

Representation of a chemical bond.

Author:
Marcus D. Hanwell

The Bond class is a Primitive subclass that provides a Bond object.


Constructor & Destructor Documentation

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

Constructor

Parameters:
parentthe object parent.

References QObject::parent().


Member Function Documentation

Returns:
Pointer to the first atom in the bond.

References Avogadro::Molecule::atomById().

Referenced by Avogadro::Molecule::operator=().

unsigned long Avogadro::Bond::beginAtomId ( ) const [inline]
Returns:
the unique ID of the first atom in the bond.

Referenced by Avogadro::Molecule::OBMol(), Avogadro::Molecule::operator+=(), and Avogadro::Molecule::removeBond().

const Eigen::Vector3d * Avogadro::Bond::beginPos ( ) const
Returns:
The position of the start of the Bond.

References Avogadro::Molecule::atomPos().

Returns:
the custom label of the bond

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

Returns:
Pointer to the second atom in the bond.

References Avogadro::Molecule::atomById().

Referenced by Avogadro::Molecule::operator=().

unsigned long Avogadro::Bond::endAtomId ( ) const [inline]
Returns:
the unique ID of the second atom in the bond.

Referenced by Avogadro::Molecule::OBMol(), Avogadro::Molecule::operator+=(), and Avogadro::Molecule::removeBond().

const Eigen::Vector3d * Avogadro::Bond::endPos ( ) const
Returns:
The position of the end of the Bond.

References Avogadro::Molecule::atomPos().

Returns:
True if the bond is aromatic.

References Avogadro::Molecule::calculateAromaticity().

Referenced by setAromaticity().

double Avogadro::Bond::length ( ) const
Returns:
the length of the bond.

References Avogadro::Molecule::atomById(), and Avogadro::Atom::pos().

const Eigen::Vector3d * Avogadro::Bond::midPos ( ) const
Returns:
The position of the mid-point of the Bond.

References Avogadro::Molecule::atomPos().

short Avogadro::Bond::order ( ) const [inline]
Returns:
the order of the bond - 1 = single, 2 = double etc.

Referenced by Avogadro::Atom::formalCharge(), Avogadro::Molecule::OBMol(), and setAtoms().

unsigned long Avogadro::Bond::otherAtom ( unsigned long  atomId) const

Get the unique id of the other atom in the bond.

Parameters:
atomIdThe unique id of the Atom.
Returns:
The unique if of the other Atom in the bond.
Note:
This function does not perform checks to ensure the supplied Atom is actually in the bond.

Referenced by Avogadro::Molecule::bond(), and Avogadro::Atom::neighbors().

void Avogadro::Bond::setAromaticity ( bool  isAromatic) const

Set the aromaticity of the bond.

References isAromatic().

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

void Avogadro::Bond::setAtoms ( unsigned long  atom1,
unsigned long  atom2,
short  order = 1 
)

Set the unique ID of both atoms in the bond.

Parameters:
atom1First atom in the bond.
atom2Second atom in the bond.
orderBond order (defaults to 1).

References Avogadro::Atom::addBond(), Avogadro::Molecule::atomById(), and order().

Referenced by Avogadro::Molecule::addBond(), Avogadro::ZMatrix::addRow(), Avogadro::ZMatrix::setBond(), and Avogadro::Molecule::setOBMol().

void Avogadro::Bond::setBegin ( Atom atom)
void Avogadro::Bond::setCustomLabel ( const QString label) [inline]

Set the custom label for the bond

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

void Avogadro::Bond::setEnd ( Atom atom)
void Avogadro::Bond::setOrder ( short  order) [inline]

Set the order of the bond.

Referenced by Avogadro::Animation::setFrame().


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