The Gnome Chemistry Utils
0.14.0
|
#include <gcu/atom.h>
Public Member Functions | |
Atom () | |
Atom (int Z, double x, double y, double z=0.) | |
Atom (Atom &a) | |
Atom & | operator= (Atom &a) |
virtual | ~Atom () |
double | Distance (Atom *pAtom) |
void | zoom (double ZoomFactor) |
bool | GetCoords (double *x, double *y, double *z=NULL) const |
void | SetCoords (double x, double y, double z=0) |
int | GetZ () const |
virtual void | SetZ (int Z) |
virtual void | SetCharge (char Charge) |
char | GetCharge () |
virtual const gchar * | GetSymbol () const |
virtual void | AddBond (Bond *pBond) |
virtual void | RemoveBond (Bond *pBond) |
double | x () const |
double | y () const |
double | z () const |
Vector | GetVector () const |
Bond * | GetFirstBond (std::map< Atom *, Bond * >::iterator &i) |
Bond const * | GetFirstBond (std::map< Atom *, Bond * >::const_iterator &i) const |
Bond * | GetNextBond (std::map< Atom *, Bond * >::iterator &i) |
Bond const * | GetNextBond (std::map< Atom *, Bond * >::const_iterator &i) const |
Bond * | GetBond (Atom *pAtom) const |
int | GetBondsNumber () const |
virtual xmlNodePtr | Save (xmlDocPtr xml) const |
virtual bool | Load (xmlNodePtr node) |
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 |
bool | IsInCycle (Cycle *pCycle) |
virtual bool | Match (Atom *atom, AtomMatchState &state) |
std::string | Name () |
void | NetToCartesian (double a, double b, double c, double alpha, double beta, double gamma) |
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) |
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 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 | |
int | m_Z |
double | m_x |
double | m_y |
double | m_z |
char | m_Charge |
std::map< Atom *, Bond * > | m_Bonds |
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 atoms.
Definition at line 46 of file gcu/atom.h.
gcu::Atom::Atom | ( | ) |
gcu::Atom::Atom | ( | int | Z, |
double | x, | ||
double | y, | ||
double | z = 0. |
||
) |
gcu::Atom::Atom | ( | Atom & | a | ) |
a | the Atom to duplicate. |
Creates a new atom identical to a without any bond.
|
virtual |
|
virtual |
double gcu::Atom::Distance | ( | Atom * | pAtom | ) |
|
inline |
Definition at line 200 of file gcu/atom.h.
References m_Bonds.
|
inline |
Definition at line 128 of file gcu/atom.h.
References m_Charge.
|
virtual |
x | a pointer to the double value which will receive the x coordinate of the Atom. |
y | a pointer to the double value which will receive the y coordinate of the Atom. |
z | a pointer to the double value which will receive the z coordinate of the Atom or NULL for 2D representations. |
Retrieves the coordinates of this Atom.
Reimplemented from gcu::Object.
i | a C++ std::map iterator initialized by Atom::GetFirstBond. |
Use this method to iterate through the list of Bond instances of this Atom.
|
virtual |
property | the identity of the property as defined in objprops.h. |
Used by the gcu::Loader mechanism to retrieve properties of atoms.
Reimplemented from gcu::Object.
Reimplemented in gcr::Atom.
|
virtual |
Reimplemented in gcp::FragmentResidue.
|
inline |
bool gcu::Atom::IsInCycle | ( | Cycle * | pCycle | ) |
pCycle | a cycle in which the atom might be. |
|
virtual |
node | a pointer to the xmlNode containing the serialized Atom. |
Loads an atom from an xmlNode.
Reimplemented from gcu::Object.
Reimplemented in gcp::Atom, gcp::FragmentAtom, and gcp::FragmentResidue.
|
virtual |
node | a pointer to the xmlNode containing the serialized Atom. |
This virtual method is called at the end of the Atom::Load method. The default behavior is to do nothing. It might be overrided for derived class when it is not convenient to override the Atom::Load method.
|
virtual |
atom | the atom to which the this instance is to be compared. |
state | the AtomMatchState representing the current comparison state. |
Try to match atoms from two molecules which are compared. This function calls itself recursively until all atoms from the two molecules have been matched or until an difference is found. Overriden methods should call this base function and return its result.
Reimplemented in gcp::Atom, and gcp::FragmentAtom.
|
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. |
Used to move an Atom.
Reimplemented from gcu::Object.
Reimplemented in gcp::Atom.
|
virtual |
Reimplemented from gcu::Object.
void gcu::Atom::NetToCartesian | ( | double | a, |
double | b, | ||
double | c, | ||
double | alpha, | ||
double | beta, | ||
double | gamma | ||
) |
a,: | the a parameter of the unit cell. |
b,: | the b parameter of the unit cell. |
c,: | the c parameter of the unit cell. |
alpha,: | the alpha angle of the unit cell. |
beta,: | the beta angle of the unit cell. |
gamma,: | the gamma angle of the unit cell. |
Converts the coordinates of the atom from net related ones to cartesian. Initially, atoms are defined by their position relative to the unit cell and the coordinates must be transformed to the cartesian ones before displaying the atom.
|
virtual |
|
virtual |
xml | the xmlDoc used to save the document. |
Reimplemented from gcu::Object.
Reimplemented in gcp::Atom, gcp::FragmentAtom, and gcp::FragmentResidue.
|
virtual |
xml | the xmlDoc used to save the document. |
node | a pointer to the xmlNode to which this Atom is serialized. |
This virtual method is called at the end of the Atom::Save method. The default behavior is to do nothing. It might be overrided for derived class when it is not convenient to override the Atom::Save method.
Reimplemented in gcr::Atom.
|
inlinevirtual |
Charge | the new formal charge of the Atom. |
Changes the formal charge of this Atom.
Definition at line 124 of file gcu/atom.h.
References m_Charge.
|
inline |
|
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 atoms.
Reimplemented from gcu::Object.
|
virtual |
Z | the new atomic number of the Atom. |
This method might be overrided by derived class since changing the atomic number generally changes most properties. The default behavior is just to change the atomic number and nothing else.
Reimplemented in gcp::Atom, and gcp::FragmentAtom.
|
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. |
Used to move and/or transform an atom.
Reimplemented from gcu::Object.
Reimplemented in gcp::Atom.
|
inline |
Definition at line 148 of file gcu/atom.h.
References m_x.
Referenced by SetCoords().
|
inline |
Definition at line 153 of file gcu/atom.h.
References m_y.
Referenced by SetCoords().
|
inline |
Definition at line 158 of file gcu/atom.h.
References m_z.
Referenced by SetCoords().
void gcu::Atom::zoom | ( | double | ZoomFactor | ) |
ZoomFactor | the zoom factor. |
Multiplies all three coordinates of this Atom by ZoomFactor.
The Bond instances of the Atom. The index of the map is a pointer to the other end of the Bond.
Definition at line 323 of file gcu/atom.h.
Referenced by GetBondsNumber().
|
protected |
The charge of the Atom.
Definition at line 319 of file gcu/atom.h.
Referenced by GetCharge(), gcp::Atom::GetCharge(), and SetCharge().
|
protected |
The x coordinate of the Atom.
Definition at line 307 of file gcu/atom.h.
Referenced by SetCoords(), and x().
|
protected |
The x coordinate of the Atom.
Definition at line 311 of file gcu/atom.h.
Referenced by SetCoords(), and y().
|
protected |
|
protected |
The x coordinate of the Atom.
Definition at line 315 of file gcu/atom.h.
Referenced by SetCoords(), and z().