COPASI API  4.16.103
CQSpecieDM.cpp
Go to the documentation of this file.
1 // Copyright (C) 2010 - 2013 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) 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 #include <QtCore/QString>
12 
15 #include "model/CChemEqInterface.h"
16 #include "function/CExpression.h"
17 
18 #include "CQMessageBox.h"
19 #include "CQSpecieDM.h"
20 #include "qtUtilities.h"
21 
22 CQSpecieDM::CQSpecieDM(QObject *parent):
23  CQBaseDataModel(parent),
24  mFlagConc(true),
25  mpSpecies(NULL),
26  mNotify(true)
27 {
32 
33  mItemToType.push_back(CModelEntity::REACTIONS);
34  mItemToType.push_back(CModelEntity::FIXED);
35  mItemToType.push_back(CModelEntity::ASSIGNMENT);
36  mItemToType.push_back(CModelEntity::ODE);
37 }
38 
39 const QStringList& CQSpecieDM::getTypes()
40 {
41  return mTypes;
42 }
43 
45 {
46  mFlagConc = flag;
47 }
48 
49 const std::vector< unsigned C_INT32 >& CQSpecieDM::getItemToType()
50 {
51  return mItemToType;
52 }
53 
54 int CQSpecieDM::rowCount(const QModelIndex& C_UNUSED(parent)) const
55 {
56  return (int)(*CCopasiRootContainer::getDatamodelList())[0]->getModel()->getMetabolites().size() + 1;
57 }
58 
59 int CQSpecieDM::columnCount(const QModelIndex& C_UNUSED(parent)) const
60 {
61  return TOTAL_COLS_SPECIES;
62 }
63 
64 Qt::ItemFlags CQSpecieDM::flags(const QModelIndex &index) const
65 {
66  if (!index.isValid())
67  return Qt::ItemIsEnabled;
68 
69  if (isDefaultRow(index))
70  {
71  if (index.column() == COL_NAME_SPECIES || index.column() == COL_COMPARTMENT ||
72  index.column() == COL_TYPE_SPECIES || index.column() == COL_ICONCENTRATION ||
73  index.column() == COL_INUMBER)
74  return QAbstractItemModel::flags(index) | Qt::ItemIsEditable;
75  else
76  return QAbstractItemModel::flags(index);
77  }
78 
79  if (index.column() == COL_NAME_SPECIES || index.column() == COL_COMPARTMENT ||
80  index.column() == COL_TYPE_SPECIES)
81  {
82  return QAbstractItemModel::flags(index) | Qt::ItemIsEditable;
83  }
84  else if (index.column() == COL_ICONCENTRATION)
85  {
86  mpSpecies = (*CCopasiRootContainer::getDatamodelList())[0]->getModel()->getMetabolites()[index.row()];
87 
88  if (this->index(index.row(), COL_TYPE_SPECIES).data().toString() == QString(FROM_UTF8(CModelEntity::StatusName[CModelEntity::ASSIGNMENT]))
89  || !(this->index(index.row(), COL_IEXPRESSION_SPECIES).data().toString().isEmpty()))
90  return QAbstractItemModel::flags(index) & ~Qt::ItemIsEnabled;
91  else
92  {
94  return QAbstractItemModel::flags(index) | Qt::ItemIsEditable | Qt::ItemIsEnabled;
95  else
96  return QAbstractItemModel::flags(index) & ~Qt::ItemIsEditable & ~Qt::ItemIsEnabled;
97  }
98  }
99  else if (index.column() == COL_INUMBER)
100  {
101  if (this->index(index.row(), COL_TYPE_SPECIES).data() == QString(FROM_UTF8(CModelEntity::StatusName[CModelEntity::ASSIGNMENT]))
102  || !(this->index(index.row(), COL_IEXPRESSION_SPECIES).data().toString().isEmpty()))
103  return QAbstractItemModel::flags(index) & ~Qt::ItemIsEditable & ~Qt::ItemIsEnabled;
104  else
105  return QAbstractItemModel::flags(index) | Qt::ItemIsEditable | Qt::ItemIsEnabled;
106  }
107  else
108  return QAbstractItemModel::flags(index);
109 }
110 
111 QVariant CQSpecieDM::data(const QModelIndex &index, int role) const
112 {
113  if (!index.isValid())
114  return QVariant();
115 
116  if (index.row() >= rowCount())
117  return QVariant();
118 
119  if (index.column() > 0 && role == Qt::ForegroundRole && !(flags(index) & Qt::ItemIsEditable))
120  return QColor(Qt::darkGray);
121 
122  if (role == Qt::DisplayRole || role == Qt::EditRole)
123  {
124  if (isDefaultRow(index))
125  {
126  switch (index.column())
127  {
128  case COL_ROW_NUMBER:
129  return QVariant(QString(""));
130 
131  case COL_NAME_SPECIES:
132  return QVariant(QString("New Species"));
133 
134  case COL_COMPARTMENT:
135  {
136  const CCopasiVector < CCompartment > & compartments =
137  (*CCopasiRootContainer::getDatamodelList())[0]->getModel()->getCompartments();
138 
139  if (compartments.size())
140  return QVariant(QString(FROM_UTF8(compartments[0]->getObjectName())));
141  else
142  return QVariant(QString(""));
143  }
144 
145  case COL_TYPE_SPECIES:
146  return QVariant(QString(FROM_UTF8(CModelEntity::StatusName[mItemToType[0]])));
147 
148  case COL_ICONCENTRATION:
149  {
150  if (mFlagConc)
151  return QVariant(QString::number(1.0, 'g', 10));
152  else
153  return QVariant(QString(""));
154  }
155 
156  case COL_INUMBER:
157  {
158  if (mFlagConc)
159  return QVariant(QString(""));
160  else
161  return QVariant(QString::number(100.0, 'g', 10));
162  }
163 
164  default:
165  return QVariant(QString(""));
166  }
167  }
168  else
169  {
170  mpSpecies = (*CCopasiRootContainer::getDatamodelList())[0]->getModel()->getMetabolites()[index.row()];
171 
172  switch (index.column())
173  {
174  case COL_ROW_NUMBER:
175  return QVariant(index.row() + 1);
176 
177  case COL_NAME_SPECIES:
178  return QVariant(QString(FROM_UTF8(mpSpecies->getObjectName())));
179 
180  case COL_COMPARTMENT:
181  return QVariant(QString(FROM_UTF8(mpSpecies->getCompartment()->getObjectName())));
182 
183  case COL_TYPE_SPECIES:
184  return QVariant(QString(FROM_UTF8(CModelEntity::StatusName[mpSpecies->getStatus()])));
185 
186  case COL_ICONCENTRATION:
187  {
188  if (role == Qt::EditRole)
189  return QVariant(QString::number(mpSpecies->getInitialConcentration(), 'g', 10));
190  else
191  return QVariant(mpSpecies->getInitialConcentration());
192  }
193 
194  case COL_INUMBER:
195  {
196  if (role == Qt::EditRole)
197  return QVariant(QString::number(mpSpecies->getInitialValue(), 'g', 10));
198  else
199  return QVariant(mpSpecies->getInitialValue());
200  }
201 
202  case COL_CONCENTRATION:
203  return QVariant(mpSpecies->getConcentration());
204 
205  case COL_NUMBER:
206  return QVariant(mpSpecies->getValue());
207 
208  case COL_CRATE:
209  return QVariant(mpSpecies->getConcentrationRate());
210 
211  case COL_NRATE:
212  return QVariant(mpSpecies->getRate());
213 
215  {
216  const CExpression * pExpression = NULL;
217 
218  if (mpSpecies->getInitialExpression() != "")
219  {
220  pExpression = mpSpecies->getInitialExpressionPtr();
221 
222  if (pExpression != NULL)
223  return QVariant(QString(FROM_UTF8(pExpression->getDisplayString())));
224  }
225 
226  return QVariant(QString(""));
227  }
228 
230  {
231  const CExpression * pExpression = mpSpecies->getExpressionPtr();
232 
233  if (pExpression != NULL)
234  return QVariant(QString(FROM_UTF8(pExpression->getDisplayString())));
235  else
236  return QVariant(QString(""));
237  }
238  }
239  }
240  }
241 
242  return QVariant();
243 }
244 
245 QVariant CQSpecieDM::headerData(int section, Qt::Orientation orientation,
246  int role) const
247 {
248  if (role != Qt::DisplayRole)
249  return QVariant();
250 
251  if (orientation == Qt::Horizontal)
252  {
253  const CModel * pModel = (*CCopasiRootContainer::getDatamodelList())[0]->getModel();
254 
255  if (pModel == NULL) return QVariant();
256 
257  QString ValueUnits, RateUnits, FrequencyUnits, ExpressionUnits;
258 
259  if (pModel)
260  ValueUnits = FROM_UTF8(pModel->getConcentrationUnitsDisplayString());
261 
262  if (!ValueUnits.isEmpty())
263  ValueUnits = "\n(" + ValueUnits + ")";
264 
265  if (pModel)
266  RateUnits = FROM_UTF8(pModel->getConcentrationRateUnitsDisplayString());
267 
268  if (!RateUnits.isEmpty())
269  RateUnits = "\n(" + RateUnits + ")";
270 
271  if (pModel)
272  FrequencyUnits = FROM_UTF8(pModel->getFrequencyUnitsDisplayString());
273 
274  if (!FrequencyUnits.isEmpty())
275  FrequencyUnits = "\n(" + FrequencyUnits + ")";
276 
277  if (!ValueUnits.isEmpty() && !RateUnits.isEmpty())
278  {
279  if (ValueUnits == RateUnits)
280  ExpressionUnits = ValueUnits;
281  else
282  ExpressionUnits = "\n(" + FROM_UTF8(pModel->getConcentrationUnitsDisplayString())
283  + " or " + FROM_UTF8(pModel->getConcentrationRateUnitsDisplayString()) + ")";
284  }
285  else if (!ValueUnits.isEmpty())
286  ExpressionUnits = "\n(" + FROM_UTF8(pModel->getConcentrationUnitsDisplayString()) + " or 1)";
287  else if (!RateUnits.isEmpty())
288  ExpressionUnits = "\n(1 or " + FROM_UTF8(pModel->getConcentrationRateUnitsDisplayString()) + ")";
289 
290  switch (section)
291  {
292  case COL_ROW_NUMBER:
293  return QVariant(QString("#"));
294 
295  case COL_NAME_SPECIES:
296  return QVariant(QString("Name"));
297 
298  case COL_COMPARTMENT:
299  return QVariant(QString("Compartment"));
300 
301  case COL_TYPE_SPECIES:
302  return QVariant(QString(" Type "));
303 
304  case COL_ICONCENTRATION:
305  return QVariant("Initial Concentration" + ValueUnits);
306 
307  case COL_INUMBER:
308  return QVariant(QString("Initial Number"));
309 
310  case COL_CONCENTRATION:
311  return QVariant("Concentration" + ValueUnits);
312 
313  case COL_NUMBER:
314  return QVariant(QString("Number"));
315 
316  case COL_CRATE:
317  return QVariant("Rate" + RateUnits);
318 
319  case COL_NRATE:
320  return QVariant("Number Rate" + FrequencyUnits);
321 
323  return QVariant("Initial Expression" + ValueUnits);
324 
326  return QVariant("Expression" + ExpressionUnits);
327 
328  default:
329  return QVariant();
330  }
331  }
332  else
333  return QString("%1").arg(section + 1);
334 }
335 
336 bool CQSpecieDM::setData(const QModelIndex &index, const QVariant &value,
337  int role)
338 {
339  if (index.isValid() && role == Qt::EditRole)
340  {
341  bool defaultRow = isDefaultRow(index);
342 
343  if (defaultRow)
344  {
345  if (index.column() == COL_TYPE_SPECIES)
346  {
347  if (index.data().toString() == QString(FROM_UTF8(CModelEntity::StatusName[mItemToType[value.toInt()]])))
348  return false;
349  }
350  else if (index.column() == COL_COMPARTMENT && value == "")
351  {
352  return false;
353  }
354  else if (index.data() == value)
355  {
356  return false;
357  }
358 
359  mNotify = false;
360  insertRow();
361  mNotify = true;
362  }
363  else
364  {
365  assert(CCopasiRootContainer::getDatamodelList()->size() > 0);
366  mpSpecies = (*CCopasiRootContainer::getDatamodelList())[0]->getModel()->getMetabolites()[index.row()];
367  }
368 
369  const CCompartment * pCompartment = NULL;
370 
371  if (index.column() == COL_COMPARTMENT ||
372  index.column() == COL_ICONCENTRATION ||
373  index.column() == COL_INUMBER)
374  {
375  try
376  {
377  pCompartment = mpSpecies->getCompartment();
378  }
379  catch (...) {}
380  }
381 
382  if (index.column() == COL_NAME_SPECIES)
383  mpSpecies->setObjectName(TO_UTF8(value.toString()));
384  else if (index.column() == COL_COMPARTMENT)
385  {
386  // This must be set first for setInitialConcentration and
387  // setInitialNumber to work correctly.
388  std::string Compartment(TO_UTF8(value.toString()));
389 
390  if (Compartment != pCompartment->getObjectName())
391  {
392  std::string CompartmentToRemove = mpSpecies->getCompartment()->getObjectName();
393  assert(CCopasiRootContainer::getDatamodelList()->size() > 0);
394 
395  if (!(*CCopasiRootContainer::getDatamodelList())[0]->getModel()->getCompartments()[Compartment]->addMetabolite(mpSpecies))
396  {
397  QString msg;
398  msg = "Unable to move species '" + FROM_UTF8(mpSpecies->getObjectName()) + "'\n"
399  + "from compartment '" + FROM_UTF8(CompartmentToRemove) + "' to compartment '" + FROM_UTF8(Compartment) + "'\n"
400  + "since a species with that name already exist in the target compartment.";
401 
403  "Unable to move Species",
404  msg,
405  QMessageBox::Ok, QMessageBox::Ok);
406  return false;
407  }
408  else
409  {
410  (*CCopasiRootContainer::getDatamodelList())[0]->getModel()->getCompartments()[CompartmentToRemove]->getMetabolites().remove(mpSpecies->getObjectName());
411  (*CCopasiRootContainer::getDatamodelList())[0]->getModel()->setCompileFlag();
412  (*CCopasiRootContainer::getDatamodelList())[0]->getModel()->initializeMetabolites();
413 
414  if (mpSpecies && pCompartment)
415  {
416  C_FLOAT64 Factor = 1.0 / pCompartment->getInitialValue();
417  Factor *= pCompartment->getInitialValue();
418 
419  mpSpecies->setInitialValue(Factor * this->index(index.row(), COL_INUMBER).data().toDouble());
420  mpSpecies->setValue(Factor * this->index(index.row(), COL_NUMBER).data().toDouble());
421  }
422 
425  }
426  }
427  }
428  else if (index.column() == COL_TYPE_SPECIES)
430  else if (index.column() == COL_ICONCENTRATION)
431  {
432  if (mFlagConc)
433  mpSpecies->setInitialConcentration(value.toDouble());
434 
435  if (mpSpecies && pCompartment)
436  {
437  const C_FLOAT64 initialValue =
438  CMetab::convertToNumber(this->index(index.row(), COL_ICONCENTRATION).data().toDouble(),
439  *pCompartment,
440  *(*CCopasiRootContainer::getDatamodelList())[0]->getModel());
441  mpSpecies->setInitialValue(initialValue);
442  }
443  }
444  else if (index.column() == COL_INUMBER)
445  {
446  if (!mFlagConc)
447  mpSpecies->setInitialValue(value.toDouble());
448 
449  if (mpSpecies && pCompartment)
450  {
452  CMetab::convertToConcentration(this->index(index.row(), COL_INUMBER).data().toDouble(),
453  *pCompartment,
454  *(*CCopasiRootContainer::getDatamodelList())[0]->getModel())
455  );
456  }
457  }
458 
459  if (defaultRow && this->index(index.row(), COL_NAME_SPECIES).data().toString() == "species")
461 
462  //Save Key
463  std::string key = mpSpecies->getKey();
464  emit dataChanged(index, index);
465 
466  if (defaultRow)
467  {
469  }
470  else
471  {
473  }
474  }
475 
476  return true;
477 }
478 
479 bool CQSpecieDM::insertRows(int position, int rows, const QModelIndex&)
480 {
482 
483  if (pDataModel->getModel()->getCompartments().size() == 0)
484  {
485  pDataModel->getModel()->createCompartment("compartment");
487  }
488 
489  beginInsertRows(QModelIndex(), position, position + rows - 1);
490 
491  for (int row = 0; row < rows; ++row)
492  {
493  mpSpecies =
495 
496  if (mNotify)
497  {
499  }
500  }
501 
502  endInsertRows();
503 
504  return true;
505 }
506 
507 bool CQSpecieDM::removeRows(int position, int rows, const QModelIndex&)
508 {
509  if (rows <= 0)
510  return true;
511 
512  beginRemoveRows(QModelIndex(), position, position + rows - 1);
513 
514  CModel * pModel = (*CCopasiRootContainer::getDatamodelList())[0]->getModel();
515 
516  std::vector< std::string > DeletedKeys;
517  DeletedKeys.resize(rows);
518 
519  std::vector< std::string >::iterator itDeletedKey;
520  std::vector< std::string >::iterator endDeletedKey = DeletedKeys.end();
521 
522  CCopasiVector< CMetab >::const_iterator itRow = pModel->getMetabolites().begin() + position;
523 
524  for (itDeletedKey = DeletedKeys.begin(); itDeletedKey != endDeletedKey; ++itDeletedKey, ++itRow)
525  {
526  *itDeletedKey = (*itRow)->getKey();
527  }
528 
529  for (itDeletedKey = DeletedKeys.begin(); itDeletedKey != endDeletedKey; ++itDeletedKey)
530  {
531  pModel->removeMetabolite(*itDeletedKey);
532  emit notifyGUI(ListViews::METABOLITE, ListViews::DELETE, *itDeletedKey);
533  emit notifyGUI(ListViews::METABOLITE, ListViews::DELETE, ""); //Refresh all as there may be dependencies.
534  }
535 
536  endRemoveRows();
537 
538  return true;
539 }
540 
541 bool CQSpecieDM::removeRows(QModelIndexList rows, const QModelIndex&)
542 {
543  if (rows.isEmpty())
544  return false;
545 
546  assert(CCopasiRootContainer::getDatamodelList()->size() > 0);
548  assert(pDataModel != NULL);
549  CModel * pModel = pDataModel->getModel();
550 
551  if (pModel == NULL)
552  return false;
553 
554 //Build the list of pointers to items to be deleted
555 //before actually deleting any item.
556  QList <CMetab *> pSpecies;
557  QModelIndexList::const_iterator i;
558 
559  for (i = rows.begin(); i != rows.end(); ++i)
560  {
561  if (!isDefaultRow(*i) && pModel->getMetabolites()[(*i).row()])
562  pSpecies.append(pModel->getMetabolites()[(*i).row()]);
563  }
564 
565  QList <CMetab *>::const_iterator j;
566 
567  for (j = pSpecies.begin(); j != pSpecies.end(); ++j)
568  {
569  CMetab * pSpecie = *j;
570 
571  size_t delRow =
572  pModel->getMetabolites().CCopasiVector< CMetab >::getIndex(pSpecie);
573 
574  if (delRow != C_INVALID_INDEX)
575  {
576  QMessageBox::StandardButton choice =
577  CQMessageBox::confirmDelete(NULL, "species",
578  FROM_UTF8(pSpecie->getObjectName()),
579  pSpecie->getDeletedObjects());
580 
581  if (choice == QMessageBox::Ok)
582  removeRow((int) delRow);
583  }
584  }
585 
586  return true;
587 }
const CExpression * getExpressionPtr() const
Header file of class CExpression.
#define COL_NAME_SPECIES
Definition: CQSpecieDM.h:26
virtual int columnCount(const QModelIndex &parent=QModelIndex()) const
Definition: CQSpecieDM.cpp:59
void setInitialConcentration(const C_FLOAT64 &initialConcentration)
Definition: CMetab.cpp:257
void setFlagConc(bool flag)
Definition: CQSpecieDM.cpp:44
QVariant headerData(int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const
Definition: CQSpecieDM.cpp:245
CQSpecieDM(QObject *parent=0)
Definition: CQSpecieDM.cpp:22
#define COL_IEXPRESSION_SPECIES
Definition: CQSpecieDM.h:35
#define FROM_UTF8(__x)
Definition: qtUtilities.h:73
static const std::string StatusName[]
Definition: CModelValue.h:67
const C_FLOAT64 & getRate() const
const CCopasiVector< CMetab > & getMetabolites() const
Definition: CModel.cpp:1051
#define TOTAL_COLS_SPECIES
Definition: CQSpecieDM.h:37
void notifyGUI(ListViews::ObjectType objectType, ListViews::Action action, const std::string &key="")
std::string getConcentrationRateUnitsDisplayString() const
Definition: CModel.cpp:4607
const std::string & getObjectName() const
std::string getFrequencyUnitsDisplayString() const
Definition: CModel.cpp:4539
virtual void setStatus(const CModelEntity::Status &status)
Definition: CMetab.cpp:291
virtual size_t size() const
const C_FLOAT64 & getInitialConcentration() const
Definition: CMetab.cpp:220
bool removeMetabolite(const std::string &key, const bool &recursive=true)
Definition: CModel.cpp:2667
Qt::ItemFlags flags(const QModelIndex &index) const
Definition: CQSpecieDM.cpp:64
bool mFlagConc
Definition: CQSpecieDM.h:59
iterator begin()
virtual int rowCount(const QModelIndex &parent=QModelIndex()) const
Definition: CQSpecieDM.cpp:54
#define COL_TYPE_SPECIES
Definition: CQSpecieDM.h:28
virtual void setValue(const C_FLOAT64 &value)
const std::string & getDisplayString() const
static StandardButton information(QWidget *parent, const QString &title, const QString &text, StandardButtons buttons=Ok, StandardButton defaultButton=NoButton)
#define C_INVALID_INDEX
Definition: copasi.h:222
#define COL_CONCENTRATION
Definition: CQSpecieDM.h:31
CMetab * mpSpecies
Definition: CQSpecieDM.h:70
#define C_UNUSED(p)
Definition: copasi.h:220
bool setData(const QModelIndex &index, const QVariant &value, int role=Qt::EditRole)
Definition: CQSpecieDM.cpp:336
const QStringList & getTypes()
Definition: CQSpecieDM.cpp:39
QVariant data(const QModelIndex &index, int role) const
Definition: CQSpecieDM.cpp:111
Definition: CMetab.h:178
#define COL_NRATE
Definition: CQSpecieDM.h:34
#define COL_EXPRESSION_SPECIES
Definition: CQSpecieDM.h:36
virtual DataObjectSet getDeletedObjects() const
Definition: CMetab.cpp:806
bool removeRow(int position)
virtual const std::string & getKey() const
const C_FLOAT64 & getInitialValue() const
#define COL_INUMBER
Definition: CQSpecieDM.h:30
const bool & isInitialConcentrationChangeAllowed() const
Definition: CMetab.cpp:664
QStringList mTypes
Definition: CQSpecieDM.h:60
#define COL_COMPARTMENT
Definition: CQSpecieDM.h:27
virtual const std::string & getKey() const
#define COL_NUMBER
static StandardButton confirmDelete(QWidget *parent, const QString &objectType, const QString &objects, const std::set< const CCopasiObject * > &deletedObjects)
bool insertRows(int position, int rows, const QModelIndex &index=QModelIndex())
Definition: CQSpecieDM.cpp:479
std::string getInitialExpression() const
static CCopasiVector< CCopasiDataModel > * getDatamodelList()
QString createNewName(const QString name, const int nameCol)
static C_FLOAT64 convertToNumber(const C_FLOAT64 &concentration, const CCompartment &compartment, const CModel &model)
Definition: CMetab.cpp:35
long int flag
Definition: f2c.h:52
std::string getConcentrationUnitsDisplayString() const
Definition: CModel.cpp:4587
CCopasiVectorNS< CCompartment > & getCompartments()
Definition: CModel.cpp:1145
bool removeRows(QModelIndexList rows, const QModelIndex &index=QModelIndex())
Definition: CQSpecieDM.cpp:541
const C_FLOAT64 & getValue() const
#define C_FLOAT64
Definition: copasi.h:92
bool mNotify
Definition: CQSpecieDM.h:72
#define TO_UTF8(__x)
Definition: qtUtilities.h:74
const C_FLOAT64 & getConcentration() const
Definition: CMetab.cpp:218
virtual void setInitialValue(const C_FLOAT64 &initialValue)
Definition: CModel.h:50
const CModelEntity::Status & getStatus() const
const std::vector< unsigned C_INT32 > & getItemToType()
Definition: CQSpecieDM.cpp:49
virtual bool isDefaultRow(const QModelIndex &i) const
bool setObjectName(const std::string &name)
C_FLOAT64 getConcentrationRate() const
Definition: CMetab.cpp:870
static C_FLOAT64 convertToConcentration(const C_FLOAT64 &number, const CCompartment &compartment, const CModel &model)
Definition: CMetab.cpp:41
const CCompartment * getCompartment() const
Definition: CMetab.cpp:222
#define COL_CRATE
Definition: CQSpecieDM.h:33
const CExpression * getInitialExpressionPtr() const
CCompartment * createCompartment(const std::string &name, const C_FLOAT64 &volume=1.0)
Definition: CModel.cpp:2698
#define COL_ICONCENTRATION
Definition: CQSpecieDM.h:29
#define COL_ROW_NUMBER
CMetab * createMetabolite(const std::string &name, const std::string &compartment, const C_FLOAT64 &iconc=1.0, const CModelEntity::Status &status=CModelEntity::REACTIONS)
Definition: CModel.cpp:2622
std::vector< unsigned C_INT32 > mItemToType
Definition: CQSpecieDM.h:65