The Gnome Chemistry Utils
0.14.0
|
#include <gcr/atom.h>
Public Member Functions | |
Atom () | |
virtual | ~Atom () |
Atom (int Z, double x, double y, double z) | |
Atom (Atom &caAtom) | |
void | SetColor (float red, float green, float blue, float alpha) |
void | SetDefaultColor () |
bool | HasCustomColor () |
void | GetColor (double *red, double *green, double *blue, double *alpha) |
void | SetSize (double r) |
double | GetSize () |
bool | operator== (Atom &caAtom) |
void | Cleave () |
double | ScalProd (int h, int k, int l) |
double | Distance (double x, double y, double z, bool bFixed) |
double | r () |
const GcuAtomicRadius & | GetRadius () |
void | SetRadius (const GcuAtomicRadius &r) |
bool | IsCleaved () |
virtual bool | SaveNode (xmlDocPtr xml, xmlNodePtr node) const |
virtual bool | LoadNode (xmlNodePtr node) |
Public Member Functions inherited from gcu::Atom | |
Atom (Atom &a) | |
Atom & | operator= (Atom &a) |
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 void | Move (double x, double y, double z=0.) |
virtual void | Transform2D (Matrix2D &m, double x, double y) |
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 Member Functions | |
bool | SetProperty (unsigned property, char const *value) |
std::string | GetProperty (unsigned property) const |
Protected Attributes | |
float | m_fBlue |
float | m_fRed |
float | m_fGreen |
float | m_fAlpha |
bool | m_bCustomColor |
GcuAtomicRadius | m_Radius |
int | m_nCleave |
Protected Attributes inherited from gcu::Atom | |
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 () |
Used to represent atoms in a crystal.
Definition at line 45 of file gcr/atom.h.
gcr::Atom::Atom | ( | ) |
The default constructor. Creates an atom with atomic number set to 0.
Reimplemented from gcu::Atom.
|
virtual |
gcr::Atom::Atom | ( | int | Z, |
double | x, | ||
double | y, | ||
double | z | ||
) |
Z | the atomic number of the new atom. |
x | the x coordinate of the new atom. |
y | the y coordinate of the new atom. |
z | the z coordinate of the new atom. |
Creates an atom.
Reimplemented from gcu::Atom.
gcr::Atom::Atom | ( | Atom & | caAtom | ) |
|
inline |
Method used to cleave an atom. The inverse operation does not exist since the whole crystal must be recalculated after a change in the definition.
Definition at line 127 of file gcr/atom.h.
References m_nCleave.
double gcr::Atom::Distance | ( | double | x, |
double | y, | ||
double | z, | ||
bool | bFixed | ||
) |
x,: | the x coordinate of the center. |
y,: | the y coordinate of the center. |
z,: | the z coordinate of the center. |
bFixed,: | tells if cleaved atoms are taken into account. |
This helper method is called when searching for the size of the crystal. When some cleavages are defined, the procedure cn take into account atoms cleaved to get the same position in the view for the cleaved crystal than for the whole crystal. If bFixed is true, all atoms are taken into account.
void gcr::Atom::GetColor | ( | double * | red, |
double * | green, | ||
double * | blue, | ||
double * | alpha | ||
) |
red,: | a pointer to the red component. |
green,: | a pointer to the green component. |
blue,: | a pointer to the blue component. |
alpha,: | a pointer to the alpha component. |
Used to retrieve the color used in the representation of the atom. Mainly useful for user defined colors.
|
protectedvirtual |
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::Atom.
|
inline |
Definition at line 157 of file gcr/atom.h.
References m_Radius.
double gcr::Atom::GetSize | ( | ) |
|
inline |
Definition at line 96 of file gcr/atom.h.
References m_bCustomColor.
|
inline |
Definition at line 165 of file gcr/atom.h.
References m_nCleave.
|
virtual |
bool gcr::Atom::operator== | ( | Atom & | caAtom | ) |
caAtom,: | a Atom instance. |
|
inline |
Definition at line 153 of file gcr/atom.h.
References m_Radius, GcuDimensionalValue::value, and GcuAtomicRadius::value.
|
virtual |
double gcr::Atom::ScalProd | ( | int | h, |
int | k, | ||
int | l | ||
) |
h,: | the h Miller index of a plane. |
k,: | the k Miller index of a plane. |
l,: | the l Miller index of a plane. |
void gcr::Atom::SetColor | ( | float | red, |
float | green, | ||
float | blue, | ||
float | alpha | ||
) |
red,: | the red component of the color. |
green,: | the green component of the color. |
blue,: | the blue component of the color. |
alpha,: | the alpha component of the color. |
Sets a custom color to the atom.
void gcr::Atom::SetDefaultColor | ( | ) |
Gives the atom the default color.
|
protectedvirtual |
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::Atom.
void gcr::Atom::SetRadius | ( | const GcuAtomicRadius & | r | ) |
r,: | a GcuAtomicRadius with the caracteristics of the atom radius. |
void gcr::Atom::SetSize | ( | double | r | ) |
r,: | the new value of the atomic radius. |
Sets the value of the radius (in pm).
|
protected |
False if the color used is the default color and true if it is a user defined color.
Definition at line 200 of file gcr/atom.h.
Referenced by HasCustomColor().
|
protected |
The alpha component of the color of the sphere representing the atom.
Definition at line 196 of file gcr/atom.h.
|
protected |
The blue component of the color of the sphere representing the atom.
Definition at line 184 of file gcr/atom.h.
|
protected |
The green component of the color of the sphere representing the atom.
Definition at line 192 of file gcr/atom.h.
|
protected |
The red component of the color of the sphere representing the atom.
Definition at line 188 of file gcr/atom.h.
|
protected |
When cleavages (see gcr::Cleavage class documentation) are defined, the atom might be cleaved. m_nCleave is the number of gcr::Cleavage instances which remove the atom. If this member is not 0, the atom will not be displayed.
Definition at line 210 of file gcr/atom.h.
Referenced by Cleave(), and IsCleaved().
|
protected |
The GcuAtomicRadius containing the radius caracteristics of the atom.
Definition at line 204 of file gcr/atom.h.
Referenced by GetRadius(), and r().