reactant.h

00001 // -*- C++ -*-
00002 
00003 /* 
00004  * GChemPaint library
00005  * reactant.h 
00006  *
00007  * Copyright (C) 2004-2007 Jean Bréfort <jean.brefort@normalesup.org>
00008  *
00009  * This program is free software; you can redistribute it and/or 
00010  * modify it under the terms of the GNU General Public License as 
00011  * published by the Free Software Foundation; either version 2 of the
00012  * License, or (at your option) any later version.
00013  *
00014  * This program is distributed in the hope that it will be useful,
00015  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00016  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00017  * GNU General Public License for more details.
00018  *
00019  * You should have received a copy of the GNU General Public License
00020  * along with this program; if not, write to the Free Software
00021  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301
00022  * USA
00023  */
00024 
00025 #ifndef GCHEMPAINT_REACTANT_H
00026 #define GCHEMPAINT_REACTANT_H
00027 
00028 #include <gcu/object.h>
00029 
00030 using namespace gcu;
00031 
00032 namespace gcp {
00033 
00034 class ReactionStep;
00035 
00036 class Reactant: public Object
00037 {
00038 public:
00039         Reactant ();
00040         virtual ~Reactant ();
00041 
00042         Reactant (ReactionStep* step, Object* object) throw (std::invalid_argument);
00043         
00044         virtual xmlNodePtr Save (xmlDocPtr xml);
00045         virtual bool Load (xmlNodePtr);
00046         unsigned GetStoich () {return m_Stoich;}
00047         void SetStoich (unsigned Stoich) {m_Stoich = Stoich;}
00048 
00049         unsigned GetStoichiometry () {return m_Stoich;}
00050         void SetStoichiometry (unsigned coef) {m_Stoich = coef;}
00051         virtual double GetYAlign ();
00052         virtual bool BuildContextualMenu (GtkUIManager *UIManager, Object *object, double x, double y);
00053         virtual bool OnSignal (SignalId Signal, Object *Child);
00054         
00055         void AddStoichiometry ();
00056         Object *GetChild () {return Child;}
00057         Object *GetStoichChild () {return Stoichiometry;}
00058 
00059 private:
00060         unsigned m_Stoich;      //always positive
00061         Object *Stoichiometry;
00062         Object *Child;
00063 };
00064 
00065 }       //      namespace gcp
00066 
00067 #endif //       GCHEMPAINT_REACTANT_H

Generated on Thu Jun 28 09:02:01 2007 for The Gnome Chemistry Utils by  doxygen 1.5.2