#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 (GtkUIManager *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 () |
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 41 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 | ( | GtkUIManager * | UIManager, | |
gcu::Object * | object, | |||
double | x, | |||
double | y | |||
) | [virtual] |
UIManager | the GtkUIManager 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. |
Reimplemented from gcu::Object.
gcu::Object* gcp::Reactant::GetChild | ( | ) | [inline] |
gcu::Object* gcp::Reactant::GetStoichChild | ( | ) | [inline] |
Definition at line 124 of file reactant.h.
unsigned gcp::Reactant::GetStoichiometry | ( | ) | const [inline] |
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. |
Reimplemented from gcu::Object.
std::string gcp::Reactant::Name | ( | ) | [virtual] |
bool gcp::Reactant::OnSignal | ( | gcu::SignalId | Signal, | |
gcu::Object * | Child | |||
) | [virtual] |
Signal | the appropriate SignalId | |
Child | the child which emitted the signal or NULL |
Reimplemented from gcu::Object.
virtual xmlNodePtr gcp::Reactant::Save | ( | xmlDocPtr | xml | ) | const [virtual] |
xml | the xmlDoc used to save the document. |
Reimplemented from gcu::Object.
void gcp::Reactant::SetStoichiometry | ( | unsigned | coef | ) | [inline] |
coef | the new stoichiometry coefficient. |
Definition at line 84 of file reactant.h.