The Gnome Chemistry Utils 0.13.3
|
Class for reactants and products of a chemical reaction. More...
#include <gcp/reactant.h>
Public Member Functions | |
Reactant () | |
virtual | ~Reactant () |
Reactant (ReactionStep *step, gcu::Object *object) throw (std::invalid_argument) | |
virtual xmlNodePtr | Save (xmlDocPtr xml) const |
virtual bool | Load (xmlNodePtr node) |
unsigned | GetStoichiometry () const |
void | SetStoichiometry (unsigned coef) |
virtual double | GetYAlign () |
bool | BuildContextualMenu (gcu::UIManager *UIManager, gcu::Object *object, double x, double y) |
bool | OnSignal (gcu::SignalId Signal, gcu::Object *Child) |
void | AddStoichiometry () |
gcu::Object * | GetChild () |
gcu::Object * | GetStoichChild () |
std::string | Name () |
Class for reactants and products of a chemical reaction.
Objects of these class embed either a molecule or a text representing a reactant or a product for a chemical reaction. They can have a stoichiometry coefficient.
Definition at line 46 of file reactant.h.
gcp::Reactant::Reactant | ( | ) |
The default constructor.
virtual gcp::Reactant::~Reactant | ( | ) | [virtual] |
The destructor.
gcp::Reactant::Reactant | ( | ReactionStep * | step, |
gcu::Object * | object | ||
) | throw (std::invalid_argument) |
step | the parent reaction step. |
object | the molecule formula or text to use as reactant. |
void gcp::Reactant::AddStoichiometry | ( | ) |
Adds a text item to display the reactants stoichiometry coefficient. This coefficient does not need to be an integer, but should always be positive.
bool gcp::Reactant::BuildContextualMenu | ( | gcu::UIManager * | UIManager, |
gcu::Object * | object, | ||
double | x, | ||
double | y | ||
) | [virtual] |
UIManager | the gcu::UIManager to populate. |
object | the Object on which occured the mouse click. |
x | x coordinate of the mouse click. |
y | y coordinate of the mouse click. |
This method is called to build a contextual menu for the reactant.
Reimplemented from gcu::Object.
gcu::Object* gcp::Reactant::GetChild | ( | ) | [inline] |
Definition at line 125 of file reactant.h.
gcu::Object* gcp::Reactant::GetStoichChild | ( | ) | [inline] |
Definition at line 129 of file reactant.h.
unsigned gcp::Reactant::GetStoichiometry | ( | ) | const [inline] |
Definition at line 83 of file reactant.h.
virtual double gcp::Reactant::GetYAlign | ( | ) | [virtual] |
Used to retrieve the y coordinate for alignment.
Reimplemented from gcu::Object.
virtual bool gcp::Reactant::Load | ( | xmlNodePtr | node | ) | [virtual] |
node | a pointer to the xmlNode containing the serialized reactant. |
Used to load a reactant in memory. The Reactant instance must already exist.
Reimplemented from gcu::Object.
std::string gcp::Reactant::Name | ( | ) | [virtual] |
Reimplemented from gcu::Object.
bool gcp::Reactant::OnSignal | ( | gcu::SignalId | Signal, |
gcu::Object * | Child | ||
) | [virtual] |
Signal | the appropriate SignalId |
Child | the child which emitted the signal or NULL |
This function is called by the framework when a signal has been emitted for the reactant, when the embedded text or molecule changed. It should not be called by a program; call Object::EmitSignal instead.
Reimplemented from gcu::Object.
virtual xmlNodePtr gcp::Reactant::Save | ( | xmlDocPtr | xml | ) | const [virtual] |
xml | the xmlDoc used to save the document. |
Used to save the reactant to the xmlDoc.
Reimplemented from gcu::Object.
void gcp::Reactant::SetStoichiometry | ( | unsigned | coef | ) | [inline] |
coef | the new stoichiometry coefficient. |
Sets the stoichiometry coefficient for the reactant.
Definition at line 89 of file reactant.h.