The Gnome Chemistry Utils  0.14.0
Public Member Functions | List of all members
gcp::FragmentAtom Class Reference

#include <gcp/fragment-atom.h>

Inheritance diagram for gcp::FragmentAtom:
gcp::Atom gcu::Atom gcu::DialogOwner gccv::ItemClient gcu::Object gcp::FragmentResidue

Public Member Functions

 FragmentAtom ()
 FragmentAtom (Fragment *fragment, int Z)
virtual ~FragmentAtom ()
void SetZ (int Z)
bool AcceptNewBonds (int nb)
void Update ()
void AddItem ()
void UpdateItem ()
void SetSelected (int state)
xmlNodePtr Save (xmlDocPtr xml) const
bool Load (xmlNodePtr node)
gccv::Anchor GetChargePosition (unsigned char &Pos, double Angle, double &x, double &y)
int GetAvailablePosition (double &x, double &y)
bool GetPosition (double angle, double &x, double &y)
bool AcceptCharge (int charge)
void AddToMolecule (Molecule *Mol)
bool Match (gcu::Atom *atom, gcu::AtomMatchState &state)
void DoBuildSymbolGeometry (View *pView)
Fragment const * GetFragment (void) const
- Public Member Functions inherited from gcp::Atom
 Atom ()
 Atom (int Z, double x, double y, double z)
virtual ~Atom ()
void AddBond (gcu::Bond *pBond)
void RemoveBond (gcu::Bond *pBond)
int GetTotalBondsNumber () const
int GetAttachedHydrogens () const
HPos GetBestSide ()
virtual bool GetRelativePosition (double angle, double &x, double &y)
virtual bool LoadNode (xmlNodePtr node)
virtual double GetYAlign ()
virtual void Move (double x, double y, double z=0.)
virtual void Transform2D (gcu::Matrix2D &m, double x, double y)
bool BuildContextualMenu (gcu::UIManager *UIManager, Object *object, double x, double y)
bool HasImplicitElectronPairs ()
bool MayHaveImplicitUnpairedElectrons ()
void AddElectron (Electron *electron)
void RemoveElectron (Electron *electron)
void NotifyPositionOccupation (unsigned char pos, bool occupied)
void SetChargePosition (unsigned char Pos, bool def, double angle=0., double distance=0.)
char GetChargePosition (double *Angle, double *Dist) const
void SetCharge (int charge)
int GetCharge () const
void ForceChanged ()
void GetSymbolGeometry (double &width, double &height, double &angle, bool up) const
bool HasAvailableElectrons (bool paired)
BondGetBondAtAngle (double angle)
bool UpdateStereoBonds ()
bool HasStereoBond () const
BondGetNewmanBond () const
void SetShowSymbol (bool val)
bool GetShowSymbol (void) const
bool & GetRefShowSymbol (void)
void SetHPosStyle (HPos val)
HPos GetHPosStyle (void) const
HPosGetRefHPosStyle (void)
void SetChargeItem (gccv::Item *val)
gccv::ItemGetChargeItem (void)
void SetShowCharge (bool val)
bool GetShowCharge (void) const
- Public Member Functions inherited from gcu::Atom
 Atom (Atom &a)
Atomoperator= (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 SetCharge (char Charge)
char GetCharge ()
virtual const gchar * GetSymbol () const
double x () const
double y () const
double z () const
Vector GetVector () const
BondGetFirstBond (std::map< Atom *, Bond * >::iterator &i)
Bond const * GetFirstBond (std::map< Atom *, Bond * >::const_iterator &i) const
BondGetNextBond (std::map< Atom *, Bond * >::iterator &i)
Bond const * GetNextBond (std::map< Atom *, Bond * >::const_iterator &i) const
BondGetBond (Atom *pAtom) const
int GetBondsNumber () const
virtual bool SaveNode (xmlDocPtr xml, xmlNodePtr node) const
std::string GetProperty (unsigned property) const
bool IsInCycle (Cycle *pCycle)
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)
ObjectGetMolecule () const
ObjectGetReaction () const
ObjectGetGroup () const
DocumentGetDocument () const
ApplicationGetApplication () const
ObjectGetParentOfType (TypeId Id) const
ObjectGetChild (const gchar *Id) const
ObjectGetFirstChild (std::map< std::string, Object * >::iterator &i)
ObjectGetNextChild (std::map< std::string, Object * >::iterator &i)
ObjectGetDescendant (const char *Id) const
ObjectGetParent () 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 ObjectGetAtomAt (double x, double y, double z=0.)
virtual bool Build (std::set< Object * > const &Children) throw (std::invalid_argument)
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 ()
ObjectGetFirstLink (std::set< Object * >::iterator &i)
ObjectGetNextLink (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
- Public Member Functions inherited from gcu::DialogOwner
 DialogOwner ()
virtual ~DialogOwner ()
DialogGetDialog (std::string name) const
void ClearDialogs ()
- Public Member Functions inherited from gccv::ItemClient
 ItemClient ()
virtual ~ItemClient ()
ItemGetItem (void)

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 ObjectCreateObject (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 gcp::Atom
void BuildSymbolGeometry (double width, double height, double ascent)
bool SetProperty (unsigned property, char const *value)
- Protected Attributes inherited from gcp::Atom
double m_CHeight

Detailed Description

Represents an atom inside a atoms group (see gcp::Fragment class).

Definition at line 40 of file fragment-atom.h.

Constructor & Destructor Documentation

gcp::FragmentAtom::FragmentAtom ( )

The default constructor.

gcp::FragmentAtom::FragmentAtom ( Fragment fragment,
int  Z 
)
Parameters
fragmentthe parent Fragment.
Zthe atomic number.

Constructs a FragmentAtom inside fragment with atomic number Z. This does not add the symbol to the string.

virtual gcp::FragmentAtom::~FragmentAtom ( )
virtual

The destructor.

Member Function Documentation

bool gcp::FragmentAtom::AcceptCharge ( int  charge)
virtual
Parameters
chargethe charge that might be set.

Currently, these atoms only accept -1, 0, and +1 as charges.

Returns
true if the charge is acceptable.

Reimplemented from gcp::Atom.

bool gcp::FragmentAtom::AcceptNewBonds ( int  nb)
virtual
Parameters
nbthe number of bonds to add, taking orders into account.

This atom class does not currently support more than one single bond and no multiple bond at all.

Returns
true if the operation is allowed, false otherwise.

Reimplemented from gcp::Atom.

void gcp::FragmentAtom::AddItem ( )
virtual

Overrided to avoid Atom::AddItem execution. Don't do anything.

Reimplemented from gcp::Atom.

void gcp::FragmentAtom::AddToMolecule ( Molecule Mol)
virtual
Parameters
Mol,:a pointer to a molecule

Adds the fragment containing the atom to the molecule calling gcpMolecule::AddFragment()

Reimplemented from gcp::Atom.

void gcp::FragmentAtom::DoBuildSymbolGeometry ( View pView)
Parameters
pViewthe document view.

Builds the symbol geometry if necessary.

int gcp::FragmentAtom::GetAvailablePosition ( double &  x,
double &  y 
)
virtual
Parameters
xthe x position.
ythe y position.

This method finds an available position for drawing a charge sign and returns it as a symbolic value (see POSITION_E, POSITION_N,...). The x and y are updated so that they give the absolute position.

Returns
an available position.

Reimplemented from gcp::Atom.

gccv::Anchor gcp::FragmentAtom::GetChargePosition ( unsigned char &  Pos,
double  Angle,
double &  x,
double &  y 
)
virtual
Parameters
Posthe approximate position of the charge.
Anglethe angle from horizontal left.
xthe x position of the charge symbol.
ythe y position of the charge symbol.

On input Pos can be one of POSITION_E, POSITION_N,... or 0xff, in which case, it will be given a default value. x and y are set to the position where the charge sign should be displayed usding the alignment code returned by this method.

Returns
the anchor for the charge symbol. On error, gccv::AnchorCenter is used as the returned value.

Reimplemented from gcp::Atom.

gcp::FragmentAtom::GetFragment ( void  ) const
inline
Returns
the Fragment enclosing the FragmentAtom.

Definition at line 176 of file fragment-atom.h.

bool gcp::FragmentAtom::GetPosition ( double  angle,
double &  x,
double &  y 
)
virtual
Parameters
anglethe angle at which a charge sign should be displayed.
xthe x position.
ythe y position.

Updates x and y so that they become the absolute position corresponding to the angle when the position is available.

Returns
true on success, false otherwise.

Reimplemented from gcp::Atom.

bool gcp::FragmentAtom::Load ( xmlNodePtr  node)
virtual

param node a pointer to the xmlNode containing the serialized atom.

Used to load the atom specific properties in memory. The FragmentAtom must already exist.

Returns
true on succes, false otherwise.

Reimplemented from gcp::Atom.

Reimplemented in gcp::FragmentResidue.

bool gcp::FragmentAtom::Match ( gcu::Atom atom,
gcu::AtomMatchState state 
)
virtual
Parameters
atomthe atom to which the this instance is to be compared.
statethe 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. FragmentAtom instances can't be matched currently.

Returns
always false.

Reimplemented from gcp::Atom.

xmlNodePtr gcp::FragmentAtom::Save ( xmlDocPtr  xml) const
virtual
Parameters
xmlthe xmlDoc used to save the document.

Used to save the atome specific data to the xmlDoc.

Returns
the xmlNode containing the serialized atom.

Reimplemented from gcp::Atom.

Reimplemented in gcp::FragmentResidue.

void gcp::FragmentAtom::SetSelected ( int  state)
virtual
Parameters
statethe selection state of the atom.

Overrided to avoid Atom::SetSelected execution. Just call Fragment::SetSelected method.

Reimplemented from gcp::Atom.

void gcp::FragmentAtom::SetZ ( int  Z)
virtual
Parameters
Zthe new atomic number.

Changes the atomic number of the atom.

Reimplemented from gcp::Atom.

void gcp::FragmentAtom::Update ( )
virtual

Overrided to avoid Atom::Update execution. Just call Fragment::Update() method.

Reimplemented from gcp::Atom.

void gcp::FragmentAtom::UpdateItem ( )
virtual

Overrided to avoid Atom::UpdateItem execution. Just call Fragment::UpdateItem().

Reimplemented from gccv::ItemClient.


The documentation for this class was generated from the following file: