COPASI API  4.16.103
ReactionsWidget1.cpp
Go to the documentation of this file.
1 // Copyright (C) 2010 - 2015 by Pedro Mendes, Virginia Tech Intellectual
2 // Properties, Inc., University of Heidelberg, and The University
3 // of Manchester.
4 // All rights reserved.
5 
6 // Copyright (C) 2008 - 2009 by Pedro Mendes, Virginia Tech Intellectual
7 // Properties, Inc., EML Research, gGmbH, University of Heidelberg,
8 // and The University of Manchester.
9 // All rights reserved.
10 
11 // Copyright (C) 2002 - 2007 by Pedro Mendes, Virginia Tech Intellectual
12 // Properties, Inc. and EML Research, gGmbH.
13 // All rights reserved.
14 
15 /*********************************************************************
16  ** $ CopasiUI/ReactionsWidget1.cpp
17  ** $ Author : Mudita Singhal
18  **
19  ** This file is used to create the GUI FrontPage for the information
20  ** obtained from the data model about the Recations----It is Basically
21  ** the Second level of Reactions.
22  **********************************************************************/
23 
24 #include <QtGui/QWidget>
25 
26 #include "copasi.h"
27 #include "ReactionsWidget1.h"
28 #include "listviews.h"
29 #include "parametertable.h"
30 #include "MyLineEdit.h"
31 #include "qtUtilities.h"
32 #include "ChemEqValidator.h"
33 #include "FunctionWidget1.h"
34 #include "CQMessageBox.h"
35 #include "CQNameSelectionDialog.h" // for Copy button compartment options
36 
40 #include "model/CModel.h"
41 #include "function/CFunctionDB.h"
44 #include "report/CKeyFactory.h"
45 #include "model/CModelExpansion.h" //for Copy button and options
46 
47 /*
48  * Constructs a ReactionsWidget which is a child of 'parent', with the
49  * name 'name' and widget flags set to 'f'.
50  *
51  */
52 
53 ReactionsWidget1::ReactionsWidget1(QWidget *parent, const char * name, Qt::WFlags f)
54  : CopasiWidget(parent, name, f),
55  mpRi(NULL)
56 {
57  setupUi(this);
58 
59  if (!name)
60  setObjectName("ReactionsWidget1");
61 
62  setWindowTitle(trUtf8("ReactionsWidget1"));
63 
64  LineEdit2->setValidator(new ChemEqValidator(LineEdit2));
65 
66 #ifndef COPASI_DEBUG
67  mpFast->hide();
68 #endif
69 }
70 
72 {
73  pdelete(mpRi);
74 }
75 
76 /* This function loads the reactions widget when its name is
77  clicked in the tree */
79 {
80  if (!reaction) return false;
81 
82  // this function is also called via notify, when the control has
83  // not been entered, thus we need to ensure we are pointing to the
84  // right object
85  mpObject = const_cast<CReaction*>(reaction);
86 
87  // this loads the reaction into a CReactionInterface object.
88  // the gui works on this object and later writes back the changes to the reaction
89  pdelete(mpRi);
91 
92  mpRi->initFromReaction(reaction->getKey());
93 
94  // update the widget.
96 
97  mpFast->setChecked(reaction->isFast());
98 
99  return true; //TODO: really check
100 }
101 
103 {
104  CReaction* reac = dynamic_cast< CReaction * >(CCopasiRootContainer::getKeyFactory()->get(mKey));
105 
106  if (reac == NULL) return true;
107 
108  if (!LineEdit2->isValid()) return false;
109 
110  LineEdit2->slotForceUpdate();
111 
112  if (!mpRi->isValid()) return false;
113 
114  assert(CCopasiRootContainer::getDatamodelList()->size() > 0);
116  assert(pDataModel != NULL);
117 
118  CModel * pModel = pDataModel->getModel();
119 
120  if (pModel == NULL) return false;
121 
122  if (reac->isFast() != mpFast->isChecked())
123  {
124  reac->setFast(mpFast->isChecked());
125  }
126 
127  // Before we save any changes we must check whether any local reaction parameters,
128  // which are used in any mathematical expression in the model are removed.
129  // If that is the case the user must have option to cancel the changes or remove the
130  // affected expressions.
131  std::set< const CCopasiObject * > DeletedParameters = mpRi->getDeletedParameters();
132 
133  if (DeletedParameters.size() != 0)
134  {
135  QString ObjectType = "parameter(s)";
136  QString Objects;
137 
138  std::set< const CCopasiObject * >::const_iterator itParameter, endParameter = DeletedParameters.end();
139  std::set< const CCopasiObject * > DeletedObjects;
140 
141  for (itParameter = DeletedParameters.begin(); itParameter != endParameter; ++itParameter) //all parameters
142  {
143  Objects.append(FROM_UTF8((*itParameter)->getObjectName()) + ", ");
144  DeletedObjects.insert(static_cast< const CCopasiObject * >((*itParameter)->getObject(CCopasiObjectName("Reference=Value"))));
145  }
146 
147  Objects.remove(Objects.length() - 2, 2);
148 
149  QMessageBox::StandardButton choice =
150  CQMessageBox::confirmDelete(NULL, ObjectType,
151  Objects, DeletedObjects);
152 
153  switch (choice)
154  {
155  case QMessageBox::Ok:
156 
157  for (itParameter = DeletedParameters.begin(); itParameter != endParameter; ++itParameter) //all parameters
158  pModel->removeLocalReactionParameter((*itParameter)->getKey());
159 
161  break;
162 
163  default:
164  return true;
165  break;
166  }
167  }
168 
169  // We need to check whether the current reaction still exists, since it is possible that
170  // removing a local reaction parameter triggers its deletion.
171  reac = dynamic_cast< CReaction * >(CCopasiRootContainer::getKeyFactory()->get(mKey));
172 
173  if (reac == NULL)
174  {
176 
178  protectedNotify(ListViews::REACTION, ListViews::DELETE, ""); //Refresh all as there may be dependencies.
179  return true;
180  }
181 
182  //first check if new metabolites need to be created
183  bool createdMetabs = mpRi->createMetabolites();
184  bool createdObjects = mpRi->createOtherObjects();
185 
186  //this writes all changes to the reaction
187  mpRi->writeBackToReaction(reac);
188 
189  assert(CCopasiRootContainer::getDatamodelList()->size() > 0);
190  //(*CCopasiRootContainer::getDatamodelList())[0]->getModel()->compile();
191 
192  //this tells the gui what it needs to know.
193  if (createdObjects)
195  else
196  {
197  if (createdMetabs) protectedNotify(ListViews::METABOLITE, ListViews::ADD, "");
198 
199  // :TODO Bug 322: This should only be called when actual changes have been saved.
200  if (!this->isHidden())
202  }
203 
204  //TODO: detect rename events (mpRi->writeBackToReaction has to do this)
205 
206  // :TODO Bug 322: This should only be called when actual changes have been saved.
207  if (!this->isHidden())
208  (*CCopasiRootContainer::getDatamodelList())[0]->changed();
209 
210  return true;
211 }
212 
214 {
215  LineEdit2->slotForceUpdate();
216 
217  // tell the reaction interface
218  mpRi->setReversibility(CheckBox->isChecked(), "");
219 
220  // update the widget
222 }
223 
224 // the function has been changed
226 {
227  // tell the reaction interface
229 
230  // update the widget
232 }
233 
234 /*This function is called when the "Chemical Reaction" LineEdit is changed.*/
236 {
237  //std::string rName = TO_UTF8(LineEdit1->text());
238 
239  std::string eq = TO_UTF8(LineEdit2->text());
240 
241  //first check if the string is a valid equation
243  {
244  return; // abort further processing
245  }
246 
247  // tell the reaction interface
248  //mpRi->setReactionName(rName);
249 
250  mpRi->setChemEqString(eq, "");
251 
252  // update the widget
254 }
255 
256 // added 5/19/04
258 {
259  std::string name = "reaction_1";
260  size_t i = 1;
261  assert(CCopasiRootContainer::getDatamodelList()->size() > 0);
263  assert(pDataModel != NULL);
264 
265  while (!pDataModel->getModel()->createReaction(name))
266  {
267  i++;
268  name = "reaction_";
269  name += TO_UTF8(QString::number(i));
270  }
271 
272  std::string key = pDataModel->getModel()->getReactions()[name]->getKey();
274 // enter(key);
276 }
277 
279 {
280  CReaction* reac = dynamic_cast< CReaction * >(mpObject);
281 
282  if (reac == NULL) return;
283 
284  CModel * pModel = NULL;
285 
286  if (reac) pModel = mpDataModel->getModel();
287 
288  if (pModel == NULL) return; // for getting compartments and initializing cModelExpObj
289 
290  // Create and customize compartment choices dialog
291  CQNameSelectionDialog * pDialog = new CQNameSelectionDialog(this);
292  pDialog->resize(350, pDialog->height());
293  pDialog->setToolTip("Cancel to re-use original species");
294  pDialog->mpLblName->setText("compartment");
295  pDialog->mpSelectionBox->clear();
296  pDialog->mpSelectionBox->setDuplicatesEnabled(false);
297  pDialog->mpSelectionBox->setEditable(false); // at least for now, unless we want to add new compartment creation here.
298 
299  // Use CModelExpansion for duplication
300  CModelExpansion cModelExpObj = CModelExpansion(pModel);
302  CModelExpansion::ElementsMap origToCopyMapping;
303 
304  // for comboBox compartment list and setting compartment
305  CCopasiVectorNS< CCompartment > & Compartments = pModel->getCompartments();
306 
307  CCopasiVectorN< CCompartment >::const_iterator Compartment_it = Compartments.begin();
309  QStringList SelectionList;
310 
311  // Collect and load list of compartment names in comboBox
312  for (; Compartment_it != end; ++Compartment_it)
313  {
314  SelectionList.append(FROM_UTF8((*Compartment_it)->getObjectName()));
315  }
316 
317  pDialog->setSelectionList(SelectionList);
318 
319  const CCompartment * origCompartment = NULL;
320  // to use here, and for testing if compartment changed after executing the dialog
321  int origCompartmentIndex;
322 
324 
325  const CCopasiVector< CChemEqElement > & substratesToCopy = reac->getChemEq().getSubstrates();
326 
327  for (MetabIt = substratesToCopy.begin(); MetabIt != substratesToCopy.end(); MetabIt++)
328  {
329  pDialog->setWindowTitle("Create copy of " + FROM_UTF8((*MetabIt)->getMetabolite()->getObjectName()) + "?");
330  origCompartment = (*MetabIt)->getMetabolite()->getCompartment();
331  origCompartmentIndex = pDialog->mpSelectionBox->findText(FROM_UTF8(origCompartment->getObjectName()));
332  pDialog->mpSelectionBox->setCurrentIndex(origCompartmentIndex);
333 
334  Compartment_it = Compartments.begin(); // Reuse Compartments iterator to set compartment choice
335 
336  if (pDialog->exec() != QDialog::Rejected)
337  {
338  // Put species in different compartment (without name modification) by making
339  // duplicateMetab think the other compartment was duplicated from the original
340  if (origCompartmentIndex != pDialog->mpSelectionBox->currentIndex())
341  {
342  sourceObjects.addCompartment(origCompartment);
343  origToCopyMapping.add(origCompartment, *(Compartment_it + pDialog->mpSelectionBox->currentIndex()));
344  }
345 
346  sourceObjects.addMetab((*MetabIt)->getMetabolite());
347  cModelExpObj.duplicateMetab((*MetabIt)->getMetabolite(), "_copy", sourceObjects, origToCopyMapping);
348  }
349  }
350 
351  const CCopasiVector< CChemEqElement > & productsToCopy = reac->getChemEq().getProducts();
352 
353  for (MetabIt = productsToCopy.begin(); MetabIt != productsToCopy.end(); MetabIt++)
354  {
355  pDialog->setWindowTitle("Create copy of " + FROM_UTF8((*MetabIt)->getMetabolite()->getObjectName()) + "?");
356  origCompartment = (*MetabIt)->getMetabolite()->getCompartment();
357  origCompartmentIndex = pDialog->mpSelectionBox->findText(FROM_UTF8(origCompartment->getObjectName()));
358  pDialog->mpSelectionBox->setCurrentIndex(origCompartmentIndex);
359 
360  Compartment_it = Compartments.begin();
361 
362  if (pDialog->exec() != QDialog::Rejected)
363  {
364  if (origCompartmentIndex != pDialog->mpSelectionBox->currentIndex())
365  {
366  sourceObjects.addCompartment(origCompartment);
367  origToCopyMapping.add(origCompartment, *(Compartment_it + pDialog->mpSelectionBox->currentIndex()));
368  }
369 
370  sourceObjects.addMetab((*MetabIt)->getMetabolite());
371  cModelExpObj.duplicateMetab((*MetabIt)->getMetabolite(), "_copy", sourceObjects, origToCopyMapping);
372  }
373  }
374 
375  const CCopasiVector< CChemEqElement > & modifiersToCopy = reac->getChemEq().getModifiers();
376 
377  for (MetabIt = modifiersToCopy.begin(); MetabIt != modifiersToCopy.end(); MetabIt++)
378  {
379  pDialog->setWindowTitle("Create copy of " + FROM_UTF8((*MetabIt)->getMetabolite()->getObjectName()) + "?");
380  origCompartment = (*MetabIt)->getMetabolite()->getCompartment();
381  origCompartmentIndex = pDialog->mpSelectionBox->findText(FROM_UTF8(origCompartment->getObjectName()));
382  pDialog->mpSelectionBox->setCurrentIndex(origCompartmentIndex);
383 
384  Compartment_it = Compartments.begin();
385 
386  if (pDialog->exec() != QDialog::Rejected)
387  {
388  if (origCompartmentIndex != pDialog->mpSelectionBox->currentIndex())
389  {
390  sourceObjects.addCompartment(origCompartment);
391  origToCopyMapping.add(origCompartment, *(Compartment_it + pDialog->mpSelectionBox->currentIndex()));
392  }
393 
394  sourceObjects.addMetab((*MetabIt)->getMetabolite());
395  cModelExpObj.duplicateMetab((*MetabIt)->getMetabolite(), "_copy", sourceObjects, origToCopyMapping);
396  }
397  }
398 
399  sourceObjects.addReaction(reac);
400  cModelExpObj.duplicateReaction(reac, "_copy", sourceObjects, origToCopyMapping);
401 
406 
407  pdelete(pDialog);
408 }
409 
410 // Just added 5/18/04
412 {
413  assert(CCopasiRootContainer::getDatamodelList()->size() > 0);
415  assert(pDataModel != NULL);
416  CModel * pModel = pDataModel->getModel();
417 
418  if (pModel == NULL)
419  return;
420 
421  CReaction * pReaction =
422  dynamic_cast< CReaction * >(CCopasiRootContainer::getKeyFactory()->get(mKey));
423 
424  if (pReaction == NULL) return;
425 
426  QMessageBox::StandardButton choice =
427  CQMessageBox::confirmDelete(NULL, "reaction",
428  FROM_UTF8(pReaction->getObjectName()),
429  pReaction->getDeletedObjects());
430 
431  switch (choice)
432  {
433  case QMessageBox::Ok: // Yes or Enter
434  {
435  pDataModel->getModel()->removeReaction(mKey);
436 
438 
440  protectedNotify(ListViews::REACTION, ListViews::DELETE, "");//Refresh all as there may be dependencies.
441  break;
442  }
443 
444  default: // No or Escape
445  break;
446  }
447 }
448 
450 {
451  LineEdit2->setText(FROM_UTF8(mpRi->getChemEqString()));
452 
454 
455  // the reversibility checkbox
456  CheckBox->setChecked(false);
457 
458  if (mpRi->isReversible() == true)
459  {
460  CheckBox->setChecked(true);
461  }
462 
463  mpMultiCompartment->setChecked(mpRi->isMulticompartment());
464 
465  // the function combobox
466  QStringList comboEntries;
468 
469  ComboBox1->clear();
470  ComboBox1->insertItems(0, comboEntries);
471 
472  // if there is a current function the parameter table is initialized
473  if (mpRi->getFunctionName() != "")
474  {
475  if (comboEntries.filter(FROM_UTF8(mpRi->getFunctionName())).size() == 0)
476  ComboBox1->insertItem(0, FROM_UTF8(mpRi->getFunctionName()));
477 
478  ComboBox1->setCurrentIndex(ComboBox1->findText(FROM_UTF8(mpRi->getFunctionName())));
479  ComboBox1->setToolTip(FROM_UTF8(mpRi->getFunctionDescription()));
480 
481  assert(CCopasiRootContainer::getDatamodelList()->size() > 0);
482  table->updateTable(*mpRi, dynamic_cast< CReaction * >(mpObject));
483  }
484  else
485  {
486  ComboBox1->insertItem(0, "undefined");
487  ComboBox1->setCurrentIndex(0);
488  table->initTable();
489  }
490 }
491 
492 void ReactionsWidget1::slotTableChanged(int index, int sub, QString newValue)
493 {
494  size_t Index = index;
495  bool SkipFillWidget = false;
496 
497  // setValue
499  {
500  if (sub != 0) return;
501 
502  if (mpRi->isLocalValue(Index))
503  {
504  mpRi->setLocalValue(Index, newValue.toDouble()); // TODO: check
505  SkipFillWidget = true;
506  }
507  else
508  mpRi->setMapping(Index, TO_UTF8(newValue));
509  }
510  else if (mpRi->getUsage(Index) == CFunctionParameter::VOLUME)
511  {
512  if (sub != 0) return;
513 
514  mpRi->setMapping(Index, TO_UTF8(newValue));
515  }
516  else
517  {
518  if (sub == 0) //here we assume that vector parameters cannot be edited
519  {
520 // mpRi->setMapping((int) Index, TO_UTF8(table->item((int) table->mIndex2Line[index], 3)->text()));
521  mpRi->setMapping((int) Index, TO_UTF8(newValue));
522  }
523  }
524 
525  // if we don't stop here, we loose changes!
526  // instead just prevent updating, that way the user has a chance to correct the reaction,
527  // only if the user selects another reaction (or somehow else leaves the editing,
528  // the changes will be lost)
529  //
530  if (!mpRi->isValid())
531  return;
532 
533  // update the widget
534  int rrr = table->currentRow();
535  int ccc = table->currentColumn();
536  table->setCurrentCell(rrr, ccc);
537 
538  // Save changes when leaving cell
539  leave();
540 
541  // Will ultimately update mpRi for updateTable and FillWidgetFromRI
542  enterProtected();
543 }
544 
546 {
547  // slot is a reminant of when a checkbox handled this.
548  // This could be added in to slotTableChanged
549 
550  if (local)
551  mpRi->setLocal(index);
552  else
553  mpRi->setMapping(index, "unknown"); //TODO keep global parameter
554 }
555 
557 {
558  CReaction * pReaction =
559  dynamic_cast< CReaction * >(CCopasiRootContainer::getKeyFactory()->get(mKey));
560 
561  if (pReaction == NULL) return;
562 
563  const CFunction * pFunc = pReaction->getFunction();
564 
565  if (pFunc == NULL) return;
566 
568 }
569 
571 {
572  // FunctionWidget1 * fw = new FunctionWidget1(NULL);
573  // fw->show();
574  // TODO: we could think about calling the function widget as a dialogue here...
575 
576  std::string name = std::string("Rate Law for ") + mpObject->getObjectName();
577  std::string nname = name;
578  size_t i = 0;
579  CCopasiVectorN<CFunction>& FunctionList
581  CFunction* pFunc;
582 
583  while (FunctionList.getIndex(nname) != C_INVALID_INDEX)
584  {
585  i++;
586  nname = name + "_";
587  nname += TO_UTF8(QString::number(i));
588  }
589 
590  CCopasiRootContainer::getFunctionList()->add(pFunc = new CKinFunction(nname), true);
592 
594 }
595 
597  ListViews::Action C_UNUSED(action), const std::string & C_UNUSED(key))
598 {
599  if (mIgnoreUpdates) return true;
600 
601  switch (objectType)
602  {
603  case ListViews::MODEL:
604  case ListViews::STATE:
607  return loadFromReaction(dynamic_cast< CReaction * >(CCopasiRootContainer::getKeyFactory()->get(mKey)));
608  break;
609 
610  default:
611  break;
612  }
613 
614  return true;
615 }
616 
618 {
619  saveToReaction();
620  return true; //always return true. That means that the widget can be
621  //left without saving
622 }
623 
625 {
626  CReaction* reac = dynamic_cast< CReaction * >(mpObject);
627 
628  if (reac)
629  return loadFromReaction(reac);
630 
632  return false;
633 }
634 
636 {
637  CopasiWidget::setFramework(framework);
638 
639  const CReaction * pReaction = dynamic_cast< CReaction * >(CCopasiRootContainer::getKeyFactory()->get(mKey));
640 
641  const CModel * pModel = NULL;
642 
643  if (pReaction != NULL)
644  pModel = dynamic_cast<const CModel *>(pReaction->getObjectAncestor("Model"));
645 
646  QString Units;
647 
648  switch (mFramework)
649  {
650  case 0:
651 
652  if (pModel)
653  Units = FROM_UTF8(pModel->getQuantityRateUnitsDisplayString());
654 
655  if (!Units.isEmpty())
656  Units = " (" + Units + ")";
657 
658  TextLabel8->setText("Flux" + Units);
659 
660  if (pReaction != NULL)
661  LineEdit3->setText(QString::number(pReaction->getFlux(), 'g', 10));
662 
663  break;
664 
665  case 1:
666 
667  if (pModel)
668  Units = FROM_UTF8(pModel->getFrequencyUnitsDisplayString());
669 
670  if (!Units.isEmpty())
671  Units = " (" + Units + ")";
672 
673  TextLabel8->setText("Particle Flux" + Units);
674 
675  if (pReaction != NULL)
676  LineEdit3->setText(QString::number(pReaction->getParticleFlux(), 'g', 10));
677 
678  break;
679  }
680 }
void setSelectionList(const QStringList &selectionList)
virtual bool update(ListViews::ObjectType objectType, ListViews::Action action, const std::string &key)
virtual void slotBtnNew()
CCopasiContainer * getObjectAncestor(const std::string &type) const
void setChemEqString(const std::string &eq, const std::string &newFunction)
CCopasiVectorN< CFunction > & loadedFunctions()
bool createOtherObjects() const
#define pdelete(p)
Definition: copasi.h:215
virtual void slotTableChanged(int index, int sub, QString newValue)
#define FROM_UTF8(__x)
Definition: qtUtilities.h:73
virtual void slotNewFunction()
const C_FLOAT64 & getParticleFlux() const
Definition: CReaction.cpp:201
void switchToOtherWidget(const size_t &id, const std::string &key)
Definition: listviews.cpp:926
void addReaction(const CReaction *x)
const std::string & getObjectName() const
std::string getFrequencyUnitsDisplayString() const
Definition: CModel.cpp:4539
virtual void slotParameterStatusChanged(int index, bool local)
CCopasiObject * get(const std::string &key)
virtual const std::string & getKey() const
Definition: CReaction.cpp:190
iterator begin()
std::string getQuantityRateUnitsDisplayString() const
Definition: CModel.cpp:4657
void initFromReaction(const std::string &key)
virtual bool enterProtected()
CCopasiObject * mpObject
Definition: copasiWidget.h:64
#define C_INVALID_INDEX
Definition: copasi.h:222
virtual size_t getIndex(const std::string &name) const
#define C_UNUSED(p)
Definition: copasi.h:220
const C_FLOAT64 & getFlux() const
Definition: CReaction.cpp:192
void setLocal(size_t index)
void duplicateMetab(const CMetab *source, const std::string &index, const SetOfModelElements &sourceSet, ElementsMap &emap)
const std::string & getKey() const
Definition: CFunction.cpp:58
virtual std::set< const CCopasiObject * > getDeletedObjects() const
Definition: CReaction.cpp:959
bool mIgnoreUpdates
Definition: copasiWidget.h:67
virtual const std::string & getKey() const
static bool isValidEq(const std::string &eq)
virtual void slotComboBoxSelectionChanged(const QString &)
const CCopasiVector< CChemEqElement > & getProducts() const
Definition: CChemEq.cpp:63
const std::string & getFunctionDescription() const
const CFunction * getFunction() const
Definition: CReaction.cpp:252
CFunctionParameter::Role getUsage(size_t index) const
iterator end()
void vectorOfStrings2QStringList(std::vector< std::string > vs, QStringList &qsl)
ListViews * mpListView
Definition: copasiWidget.h:62
bool loadFromReaction(const CReaction *reaction)
CReaction * createReaction(const std::string &name)
Definition: CModel.cpp:2760
static StandardButton confirmDelete(QWidget *parent, const QString &objectType, const QString &objects, const std::set< const CCopasiObject * > &deletedObjects)
void add(const CCopasiObject *source, CCopasiObject *copy)
add a source->duplicate mapping
bool isReversible() const
void setMapping(size_t index, std::string mn)
std::string getDuplicateKey(const std::string &sourceKey) const
find the key of the duplicated object from the source object (if it exists)
static CCopasiVector< CCopasiDataModel > * getDatamodelList()
virtual bool leave()
virtual void slotBtnDelete()
void duplicateReaction(const CReaction *source, const std::string &index, const SetOfModelElements &sourceSet, ElementsMap &emap)
const CCopasiVector< CChemEqElement > & getSubstrates() const
Definition: CChemEq.cpp:60
static CFunctionDB * getFunctionList()
virtual bool protectedNotify(ListViews::ObjectType objectType, ListViews::Action action, const std::string &key="")
const bool & isFast() const
Definition: CReaction.cpp:1712
CCopasiDataModel * mpDataModel
Definition: copasiWidget.h:65
CCopasiVectorNS< CCompartment > & getCompartments()
Definition: CModel.cpp:1145
void setLocalValue(size_t index, C_FLOAT64 value)
std::set< const CCopasiObject * > getDeletedParameters() const
void addCompartment(const CCompartment *x)
virtual void slotCheckBoxClicked()
static CKeyFactory * getKeyFactory()
virtual void setFramework(int framework)
const CCopasiVector< CChemEqElement > & getModifiers() const
Definition: CChemEq.cpp:66
The class for handling a chemical kinetic function.
Definition: CFunction.h:29
CCopasiVectorNS< CReaction > & getReactions()
Definition: CModel.cpp:1039
#define TO_UTF8(__x)
Definition: qtUtilities.h:74
std::string getChemEqString() const
Definition: CModel.h:50
const std::string & getFunctionName() const
void setFast(const bool &fast)
Definition: CReaction.cpp:1703
ReactionsWidget1(QWidget *parent=0, const char *name=0, Qt::WFlags fl=0)
bool writeBackToReaction(CReaction *rea)
bool isLocalValue(size_t index) const
virtual void slotLineEditChanged()
virtual void setFramework(int framework)
std::vector< std::string > getListOfPossibleFunctions() const
bool isMulticompartment() const
std::string mKey
Definition: copasiWidget.h:63
void setFunctionAndDoMapping(const std::string &fn)
const CChemEq & getChemEq() const
Definition: CReaction.cpp:223
bool removeLocalReactionParameter(const std::string &key, const bool &recursive=true)
Definition: CModel.cpp:2818
void setReversibility(bool rev, const std::string &newFunction)
CReactionInterface * mpRi
bool removeReaction(const CReaction *pReaction, const bool &recursive=true)
Definition: CModel.cpp:2792
virtual void slotGotoFunction()
void setFunctionWithEmptyMapping(const std::string &fn)
bool add(CFunction *pFunction, const bool &adopt)