The Gnome Chemistry Utils
0.14.0
|
#include <gcu/chain.h>
Public Member Functions | |
Chain (Bond *pBond, Atom *pAtom=NULL, TypeId Type=ChainType) | |
Chain (Molecule *molecule, Bond *pBond, TypeId Type=ChainType) | |
Chain (Molecule *molecule, Atom *pAtom, TypeId Type=ChainType) | |
virtual | ~Chain () |
void | FindCycles (Atom *pAtom) |
bool | FindCycle (Atom *pAtom, Bond *pBond) |
virtual void | Erase (Atom *pAtom1, Atom *pAtom2) |
virtual void | Insert (Atom *pAtom1, Atom *pAtom2, Chain &chain) |
void | Extract (Atom *pAtom1, Atom *pAtom2, Chain &chain) |
void | Reverse () |
void | AddBond (Atom *start, Atom *end) |
unsigned | GetUnsaturations () |
unsigned | GetHeteroatoms () |
bool | Contains (Atom *pAtom) |
bool | Contains (Bond *pBond) |
unsigned | GetLength () |
double | GetMeanBondLength () |
Atom * | GetNextAtom (Atom *pAtom) |
std::string | Name () |
unsigned | BuildLength (unsigned *cycle_size=NULL, unsigned *cycle_pos=NULL) |
![]() | |
Object (TypeId Id=OtherType) | |
virtual | ~Object () |
TypeId | GetType () const |
void | SetId (gchar const *Id) |
char const * | GetId () const |
virtual void | AddChild (Object *object) |
Object * | GetMolecule () const |
Object * | GetReaction () const |
Object * | GetGroup () const |
Document * | GetDocument () const |
Application * | GetApplication () const |
Object * | GetParentOfType (TypeId Id) const |
Object * | GetChild (const gchar *Id) const |
Object * | GetFirstChild (std::map< std::string, Object * >::iterator &i) |
Object * | GetNextChild (std::map< std::string, Object * >::iterator &i) |
Object * | GetDescendant (const char *Id) const |
Object * | GetParent () const |
void | SetParent (Object *Parent) |
virtual xmlNodePtr | Save (xmlDocPtr xml) const |
virtual bool | Load (xmlNodePtr node) |
virtual bool | GetCoords (double *x, double *y, double *z=NULL) const |
virtual void | Move (double x, double y, double z=0.) |
virtual void | Transform2D (Matrix2D &m, double x, double y) |
bool | SaveChildren (xmlDocPtr xml, xmlNodePtr node) const |
void | SaveId (xmlNodePtr node) const |
xmlNodePtr | GetNodeByProp (xmlNodePtr node, char const *Property, char const *Id) |
xmlNodePtr | GetNextNodeByProp (xmlNodePtr node, char const *Property, char const *Id) |
xmlNodePtr | GetNodeByName (xmlNodePtr node, char const *Name) |
xmlNodePtr | GetNextNodeByName (xmlNodePtr node, char const *Name) |
bool | HasChildren () const |
unsigned | GetChildrenNumber () const |
virtual Object * | GetAtomAt (double x, double y, double z=0.) |
virtual bool | Build (std::set< Object * > const &Children) throw (std::invalid_argument) |
virtual double | GetYAlign () |
virtual bool | BuildContextualMenu (UIManager *uim, Object *object, double x, double y) |
void | EmitSignal (SignalId Signal) |
virtual bool | OnSignal (SignalId Signal, Object *Child) |
void | Lock (bool state=true) |
bool | IsLocked () |
Object * | GetFirstLink (std::set< Object * >::iterator &i) |
Object * | GetNextLink (std::set< Object * >::iterator &i) |
void | Link (Object *object) |
void | Unlink (Object *object) |
virtual void | OnUnlink (Object *object) |
void | GetPossibleAncestorTypes (std::set< TypeId > &types) const |
virtual bool | SetProperty (unsigned property, char const *value) |
virtual std::string | GetProperty (unsigned property) const |
virtual void | OnLoaded () |
void | SetDirty (bool dirty=true) |
virtual void | Clear () |
std::string | Identity () |
virtual char const * | HasPropertiesDialog () const |
virtual bool | CanSelect () const |
virtual void | NotifyEmpty () |
void | ShowPropertiesDialog () |
bool | GetDirty (void) const |
Protected Attributes | |
std::map< Atom *, ChainElt > | m_Bonds |
Molecule * | m_Molecule |
Additional Inherited Members | |
![]() | |
static TypeId | AddType (std::string TypeName, Object *(*CreateFunc)(), TypeId id=OtherType) |
static void | AddAlias (TypeId id, std::string TypeName) |
static Object * | CreateObject (const std::string &TypeName, Object *parent=NULL) |
static TypeId | GetTypeId (const std::string &Name) |
static std::string | GetTypeName (TypeId Id) |
static void | AddMenuCallback (TypeId Id, BuildMenuCb cb) |
static void | AddRule (TypeId type1, RuleId rule, TypeId type2) |
static void | AddRule (const std::string &type1, RuleId rule, const std::string &type2) |
static const std::set< TypeId > & | GetRules (TypeId type, RuleId rule) |
static const std::set< TypeId > & | GetRules (const std::string &type, RuleId rule) |
static void | SetCreationLabel (TypeId Id, std::string Label) |
static const std::string & | GetCreationLabel (TypeId Id) |
static const std::string & | GetCreationLabel (const std::string &TypeName) |
static SignalId | CreateNewSignalId () |
![]() | |
virtual Dialog * | BuildPropertiesDialog () |
pBond | a bond. |
pAtom | an atom. |
Type | an optional type id used when constructing a derived type (i. e. a cycle). |
Constructs a Chain starting from a bond and an optional atom. Choosing the atom forces the direction of the chain, otherwise, the first atom will be the first atom of the bond.
molecule | a molecule. |
pBond | a bond in the molecule or NULL. |
Type | an optional type id used when constructing a derived type |
Explores a molecule and find all cycles, starting from pBond or an empty chain if pBond is NULL.
molecule | a molecule. |
pAtom | an atom in the molecule. |
Type | an optional type id used when constructing a derived type |
Explores a molecule and find all cycles, starting from pAtom or an empty chain if pAtom is NULL.
|
virtual |
The destructor.
start | an atom. |
end | an atom. |
Adds the two atoms and the bond between them to the chain. The two atoms must be bonded.
unsigned gcu::Chain::BuildLength | ( | unsigned * | cycle_size = NULL , |
unsigned * | cycle_pos = NULL |
||
) |
cycle_size | where to store a cycle size if a cycle is encountered |
cycle_pos | where to store a cycle position if a cycle is encountered |
Finds the longest chani starting from first bond and ending when a cycle is found or at the chain end.
bool gcu::Chain::Contains | ( | Atom * | pAtom | ) |
pAtom | an atom. |
bool gcu::Chain::Contains | ( | Bond * | pBond | ) |
pBond | a bond. |
pAtom1 | an atom in the source chain. |
pAtom2 | an atom in the source chain. |
Erases a sub-chain. One of the atoms must already be one of the chain ends.
Reimplemented in gcu::Cycle.
pAtom1 | an atom in the chain. |
pAtom2 | an atom in the chain. |
chain | the target chain. |
Extracts a sub-chain to the chain variable which should be empty before the call.
pAtom | an atom. |
pBond | a bond. |
Searches for a cycle containing the atom pAtom and the bond pBond. pAtom must be one of the ends of pBond. If a cycle is found, it is added to the molecule cycles list.
void gcu::Chain::FindCycles | ( | Atom * | pAtom | ) |
pAtom | an atom. |
Searches all cycles in a molecule starting from Atom pAtom. Found cycles are added to the molecule cycles list.
unsigned gcu::Chain::GetHeteroatoms | ( | ) |
unsigned gcu::Chain::GetLength | ( | ) |
double gcu::Chain::GetMeanBondLength | ( | ) |
pAtom | an atom in the chain. |
unsigned gcu::Chain::GetUnsaturations | ( | ) |
pAtom1 | an atom in the source chain. |
pAtom2 | an atom in the source chain. |
chain | the source chain. |
Inserts a chain. One of the atoms must already be in the target chain.
Reimplemented in gcu::Cycle.
|
virtual |
Reimplemented from gcu::Object.
Reimplemented in gcu::Cycle.
void gcu::Chain::Reverse | ( | ) |
Reverses the chain order.
The gcu::ChainElt elements in the chain indexed by their common atom.
|
protected |