AvogadroLibs 1.97.0
Classes | Public Types | Public Slots | Signals | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
RWMolecule Class Reference

The RWMolecule class is an editable molecule class that automatically populates an undo stack. More...

#include <avogadro/qtgui/rwmolecule.h>

Inheritance diagram for RWMolecule:

Classes

class  UndoCommand
 

Public Types

typedef RWAtom AtomType
 
typedef PersistentAtom< RWMoleculePersistentAtomType
 
typedef RWBond BondType
 
typedef PersistentBond< RWMoleculePersistentBondType
 

Public Slots

void emitChanged (unsigned int change)
 Force the molecule to emit the changed() signal. More...
 

Signals

void changed (unsigned int change)
 Indicates that the molecule has changed. More...
 

Public Member Functions

 RWMolecule (Molecule &mol, QObject *parent=nullptr)
 
Moleculemolecule ()
 
const Moleculemolecule () const
 
AtomType addAtom (unsigned char atomicNumber, bool usingPositions=true)
 
AtomType addAtom (unsigned char atomicNumber, const Vector3 &position3d)
 
AtomType atom (Index atomId) const
 
AtomType atomByUniqueId (Index atomUId) const
 
Index atomCount () const
 
Index atomCount (unsigned char atomicNumber) const
 
void clearAtoms ()
 
void adjustHydrogens (Index atomId)
 
void adjustHydrogens (const Core::Array< Index > &atomIds)
 
const Core::Array< unsigned char > & atomicNumbers () const
 
unsigned char atomicNumber (Index atomId) const
 
bool setAtomicNumbers (const Core::Array< unsigned char > &nums)
 
bool setAtomicNumber (Index atomId, unsigned char atomicNumber)
 
const Core::Array< Vector3 > & atomPositions3d () const
 
Vector3 atomPosition3d (Index atomId) const
 
std::string label (Index atomId) const
 
bool setLabel (Index atomId, const std::string &label, const QString &undoText=QStringLiteral("Change Atom Label"))
 
bool setAtomPositions3d (const Core::Array< Vector3 > &pos, const QString &undoText=QStringLiteral("Change Atom Positions"))
 
bool setAtomPosition3d (Index atomId, const Vector3 &pos, const QString &undoText=QStringLiteral("Change Atom Position"))
 
void setAtomSelected (Index atomId, bool selected)
 
bool atomSelected (Index atomId) const
 
bool setAtomPosition2d (Index, const Vector2 &)
 
Vector2 atomPosition2d (Index)
 
const Core::Array< Vector2 > & atomPositions2d () const
 
Core::AtomHybridization hybridization (Index atomId) const
 
bool setHybridization (Index atomId, Core::AtomHybridization hyb)
 
signed char formalCharge (Index atomId) const
 
bool setFormalCharge (Index atomId, signed char charge)
 
Vector3ub color (Index atomId) const
 
bool setColor (Index atomId, Vector3ub color)
 
bool setLayer (Index atomId, size_t layer)
 
size_t layer (Index atomId) const
 
BondType bond (Index bondId) const
 
BondType bond (Index atom1, Index atom2) const
 
BondType bond (const AtomType &atom1, const AtomType &atom2) const
 
BondType bondByUniqueId (Index bondUid) const
 
Index bondUniqueId (Index bondId) const
 
Index bondUniqueId (const BondType &bond) const
 
Index bondCount () const
 
void clearBonds ()
 
Core::Array< BondTypebonds (const AtomType &atom) const
 
Core::Array< BondTypebonds (const Index &atomId) const
 
const Core::Array< unsigned char > & bondOrders () const
 
unsigned char bondOrder (Index bondId) const
 
bool setBondOrders (const Core::Array< unsigned char > &orders)
 
bool setBondOrder (Index bondId, unsigned char order)
 
const Core::Array< std::pair< Index, Index > > & bondPairs () const
 
std::pair< Index, IndexbondPair (Index bondId) const
 
bool setBondPairs (const Core::Array< std::pair< Index, Index > > &pairs)
 
bool setBondPair (Index bondId, const std::pair< Index, Index > &pair)
 
void addUnitCell ()
 
void removeUnitCell ()
 
void modifyMolecule (const Molecule &newMolecule, Molecule::MoleculeChanges changes, const QString &undoText=QStringLiteral("Modify Molecule"))
 
void appendMolecule (const Molecule &addMolecule, const QString &undoText=QStringLiteral("Append Molecule"))
 
void editUnitCell (Matrix3 cellMatrix, Core::CrystalTools::Options opts)
 
void wrapAtomsToCell ()
 
void rotateCellToStandardOrientation ()
 
void setCellVolume (double newVolume, Core::CrystalTools::Options options)
 
void buildSupercell (unsigned int a, unsigned int b, unsigned int c)
 
void