The Gnome Chemistry Utils
0.14.0
|
#include <gcu/bond.h>
Public Member Functions | |
Bond () | |
Bond (Atom *first, Atom *last, unsigned char order) | |
virtual | ~Bond () |
virtual Atom * | GetAtom (int which) const |
virtual Atom * | GetAtom (Atom *pAtom, int which=0) const |
virtual Atom const * | GetAtom (Atom const *pAtom, int which=0) const |
unsigned char | GetOrder () const |
void | SetOrder (unsigned char Order) |
virtual xmlNodePtr | Save (xmlDocPtr xml) const |
virtual bool | Load (xmlNodePtr node) |
virtual void | IncOrder (int n=1) |
virtual bool | LoadNode (xmlNodePtr node) |
virtual bool | SaveNode (xmlDocPtr xml, xmlNodePtr node) const |
virtual void | Move (double x, double y, double z=0.) |
virtual void | Transform2D (Matrix2D &m, double x, double y) |
bool | SetProperty (unsigned property, char const *value) |
std::string | GetProperty (unsigned property) const |
virtual void | AddCycle (Cycle *pCycle) |
virtual void | RemoveCycle (Cycle *pCycle) |
virtual void | RemoveAllCycles () |
unsigned | IsCyclic () |
Cycle * | GetFirstCycle (std::list< Cycle * >::iterator &i, Cycle *pCycle) |
Cycle * | GetNextCycle (std::list< Cycle * >::iterator &i, Cycle *pCycle) |
bool | IsInCycle (Cycle *pCycle) |
double | Get2DLength () |
double | GetAngle2DRad (Atom *pAtom) |
bool | ReplaceAtom (Atom *oldAtom, Atom *newAtom) |
void | OnLoaded () |
std::string | Name () |
Public Member Functions inherited from gcu::Object | |
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 bool | GetCoords (double *x, double *y, double *z=NULL) const |
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 |
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 | |
unsigned char | m_order |
Atom * | m_Begin |
Atom * | m_End |
std::list< Cycle * > | m_Cycles |
Additional Inherited Members | |
Static Public Member Functions inherited from gcu::Object | |
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 () |
Protected Member Functions inherited from gcu::Object | |
virtual Dialog * | BuildPropertiesDialog () |
This class is used to represent bonds.
Definition at line 42 of file gcu/bond.h.
gcu::Bond::Bond | ( | ) |
first | a pointer to the first Atom instance of the bond. |
last | a pointer to the last Atom instance of the bond. |
order | the order of the new bond. |
The distinction between first and last is important mostly for stereobonds. The Bond instance is created and adds itself to the two atoms calling Atom::AddBond.
|
virtual |
|
virtual |
pCycle | a cycle to add to the list. |
Reimplemented in gcp::Bond.
double gcu::Bond::Get2DLength | ( | ) |
double gcu::Bond::GetAngle2DRad | ( | Atom * | pAtom | ) |
pAtom | one of the atoms of the bond. |
|
virtual |
pAtom | a pointer to an Atom instance. |
which | an index which might be used for multicentered bonds (not supported); the default value should always be used even if the implementation does not use it in this version. |
pAtom | a pointer to a constant Atom instance. |
which | an index which might be used for multicentered bonds (not supported); the default value should always be used even if the implementation does not use it in this version. |
The const version of the method.
i | a C++ std::map iterator. |
pCycle | a cycle. |
i | a C++ std::map iterator initialized by Bond::GetFirstCycle. |
pCycle | a cycle. |
unsigned char gcu::Bond::GetOrder | ( | ) | const |
|
virtual |
property | the identity of the property as defined in objprops.h. |
Used by the gcu::Loader mechanism to retrieve properties of bonds.
Reimplemented from gcu::Object.
Reimplemented in gcp::Bond.
|
virtual |
n | the increment to add to the bond order |
If the resulting bond order is greater than 4, the remainder of the division by 4 is retained.
Reimplemented in gcp::Bond.
|
inline |
Definition at line 183 of file gcu/bond.h.
References m_Cycles.
bool gcu::Bond::IsInCycle | ( | Cycle * | pCycle | ) |
pCycle | a cycle in which the bond might be. |
|
virtual |
node | a pointer to the xmlNode containing the serialized Bond. |
Loads a bond from an xmlNode.
Reimplemented from gcu::Object.
Reimplemented in gcr::Bond.
|
virtual |
node | a pointer to the xmlNode containing the serialized Bond. |
This virtual method is called at the end of the Bond::Load method. The default behavior is to do nothing. It might be overrided for derived class when it is not convenient to override the Bond::Load method.
Reimplemented in gcp::Bond.
|
virtual |
x | the x component of the transation vector. |
y | the y component of the transation vector. |
z | the z component of the transation vector. |
Does nothing. Just a slight optimization to avoid execution of Object::Move
Reimplemented from gcu::Object.
|
virtual |
Reimplemented from gcu::Object.
|
virtual |
This method should be called when a bond has been fully loaded.
Reimplemented from gcu::Object.
Reimplemented in gcp::Bond.
|
virtual |
Clears the bond cycles list.
Reimplemented in gcp::Bond.
|
virtual |
pCycle | a cycle to remove from the list. |
Reimplemented in gcp::Bond.
oldAtom | the atom to replace. |
newAtom | the new atom. |
To sucess, this needs that the new atom can accept all the bonds from the old one.
|
virtual |
xml | the xmlDoc used to save the document. |
Reimplemented from gcu::Object.
|
virtual |
xml | the xmlDoc used to save the document. |
node | a pointer to the xmlNode to which this Bond is serialized. |
This virtual method is called at the end of the Bond::Save method. The default behavior is to do nothing. It might be overrided for derived class when it is not convenient to override the Bond::Save method.
Reimplemented in gcp::Bond.
void gcu::Bond::SetOrder | ( | unsigned char | Order | ) |
Order | the new bond order. |
The value used is not checked. Should be a significant value (1 to 3, exceptionally 4).
|
virtual |
property | the identity of the property as defined in objprops.h. |
value | the value of the property as a string. |
Used by the gcu::Loader mechanism to load properties of bonds.
Reimplemented from gcu::Object.
Reimplemented in gcp::Bond.
|
virtual |
m | the 2D Matrix of the transformation. |
x | the x component of the center of the transformation. |
y | the y component of the center of the transformation. |
Does nothing. Just a slight optimization to avoid execution of Object::Transform2D
Reimplemented from gcu::Object.
Reimplemented in gcp::Bond.
|
protected |
A pointer to the first Atom instance of the Bond.
Definition at line 249 of file gcu/bond.h.
|
protected |
The gcu::Cycle instnces to which the bond pertains.
Definition at line 258 of file gcu/bond.h.
Referenced by IsCyclic().
|
protected |
A pointer to the last Atom instance of the Bond.
Definition at line 253 of file gcu/bond.h.
|
protected |
The order of the bond.
Definition at line 245 of file gcu/bond.h.