COPASI API  4.16.103
CQBrowserPaneDM.cpp
Go to the documentation of this file.
1 // Copyright (C) 2011 - 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 #include <sstream>
7 
8 #include "copasi.h"
9 
10 #include "CQBrowserPaneDM.h"
11 #include "DataModel.txt.h"
12 #include "qtUtilities.h"
13 #include "DataModelGUI.h"
14 
15 #include "utilities/CCopasiTree.h"
17 #include "model/CModel.h"
18 #include "utilities/CCopasiTask.h"
22 #include "function/CFunctionDB.h"
24 
26  QAbstractItemModel(pParent),
27  mpRoot(NULL),
28  mpCopasiDM(NULL),
29  mpGuiDM(NULL),
30  mEmitDataChanged(true),
31  mFlags(CQBrowserPaneDM::Model | CQBrowserPaneDM::Tasks | CQBrowserPaneDM::Output | CQBrowserPaneDM::FunctionDB)
32 {
33  // setSortRole(Qt::EditRole);
35 }
36 
37 // virtual
39 {
40  pdelete(mpRoot);
41 }
42 
43 // virtual
44 int CQBrowserPaneDM::columnCount(const QModelIndex & /* parent */) const
45 {
46  return 1;
47 }
48 
49 // virtual
50 QVariant CQBrowserPaneDM::data(const QModelIndex & index, int role) const
51 {
52  CNode * pNode = nodeFromIndex(index);
53 
54  if (pNode == NULL) return QVariant();
55 
56  switch (role)
57  {
58  case Qt::DisplayRole:
59 
60  // We need to add the number of children to some nodes.
61  switch (pNode->getId())
62  {
63  case 5:
64  case 42:
65  case 43:
66  case 111:
67  case 112:
68  case 114:
69  case 115:
70  case 116:
71  case 119:
72  return QVariant(pNode->getDisplayRole() + " (" + QString::number(pNode->getNumChildren()) + ")");
73  break;
74 
75  default:
76  return QVariant(pNode->getDisplayRole());
77  break;
78  }
79 
80  break;
81 
82  case Qt::EditRole:
83  return QVariant(pNode->getSortRole());
84  break;
85  }
86 
87  return QVariant();
88 }
89 
90 // virtual
91 QModelIndex CQBrowserPaneDM::index(int row, int column, const QModelIndex & parent) const
92 {
93  CNode * pParent = nodeFromIndex(parent);
94 
95  if (pParent == NULL) return createIndex(row, column, mpRoot);
96 
97  CNode * pNode = static_cast< CNode * >(pParent->getChild(row));
98 
99  if (pNode)
100  return createIndex(row, column, pNode);
101  else
102  return QModelIndex();
103 }
104 
105 // virtual
106 QModelIndex CQBrowserPaneDM::parent(const QModelIndex & index) const
107 {
108  CNode * pNode = nodeFromIndex(index);
109 
110  if (pNode == NULL || pNode == mpRoot)
111  {
112  return QModelIndex();
113  }
114 
115  CNode * pParent = static_cast< CNode * >(pNode->getParent());
116  assert(pParent != NULL);
117 
118  return createIndex(pParent->getRow(), 0, pParent);
119 }
120 
121 QModelIndex CQBrowserPaneDM::index(const size_t & id, const std::string & key) const
122 {
123  CNode * pNode = NULL;
124 
125  if (id != C_INVALID_INDEX)
126  {
127  pNode = findNodeFromId(id);
128  }
129  else if (key != "")
130  {
131  pNode = findNodeFromKey(key);
132  }
133 
134  return index(pNode);
135 }
136 
137 // virtual
138 int CQBrowserPaneDM::rowCount(const QModelIndex & parent) const
139 {
140  if (!parent.isValid())
141  return (mpRoot != NULL) ? 1 : 0;
142 
143  CNode * pParent = nodeFromIndex(parent);
144 
145  return pParent->getNumChildren();
146 }
147 
148 // virtual
149 bool CQBrowserPaneDM::removeRows(int row, int count, const QModelIndex & parent)
150 {
151  CNode * pParent = nodeFromIndex(parent);
152 
153  if (pParent == NULL) return false;
154 
155  CNode * pNode = static_cast< CNode * >(pParent->getChild(row));
156 
157  beginRemoveRows(parent, row, row + count - 1);
158 
159  for (int i = 0; i < count && pNode != NULL; i++)
160  {
161  CNode * pTmp = pNode;
162  pNode = static_cast< CNode * >(pNode->getSibling());
163  delete pTmp;
164  }
165 
166  endRemoveRows();
167 
168  return true;
169 }
170 
172 {
175 
176  for (; it != end; ++it)
177  {
178  if (it->getData().mId == id)
179  {
180  return &*it;
181  }
182  }
183 
184  return NULL;
185 }
186 
188 {
191 
192  for (; it != end; ++it)
193  {
194  if (it->getData().mKey == key)
195  {
196  return &*it;
197  }
198  }
199 
200  return NULL;
201 }
202 
203 size_t CQBrowserPaneDM::getIdFromIndex(const QModelIndex & index) const
204 {
205  CNode * pNode = nodeFromIndex(index);
206 
207  if (pNode == NULL) return C_INVALID_INDEX;
208 
209  return pNode->getId();
210 }
211 
212 std::string CQBrowserPaneDM::getKeyFromIndex(const QModelIndex & index) const
213 {
214  CNode * pNode = nodeFromIndex(index);
215 
216  if (pNode == NULL) return "";
217 
218  return pNode->getKey();
219 }
220 
221 void CQBrowserPaneDM::remove(const std::string & key)
222 {
223  CNode * pNode = findNodeFromKey(key);
224 
225  if (pNode == NULL || pNode->getParent() == NULL)
226  {
227  return;
228  }
229 
230  QModelIndex Parent = index(static_cast< CNode * >(pNode->getParent()));
231 
232  removeRows(pNode->getRow(), 1, Parent);
233 }
234 
235 void CQBrowserPaneDM::rename(const std::string & key, const QString & displayRole)
236 {
237  CNode * pNode = findNodeFromKey(key);
238 
239  if (pNode == NULL) return;
240 
241  if (pNode->getDisplayRole() != displayRole)
242  {
243  pNode->setDisplayRole(displayRole);
244 
245  QModelIndex Index = index(pNode);
246 
247  if (mEmitDataChanged)
248  {
249  emit dataChanged(Index, Index);
250  }
251  }
252 }
253 
254 void CQBrowserPaneDM::add(const size_t & id,
255  const std::string & key,
256  const QString & displayRole,
257  const size_t & parentId)
258 {
259  CNode * pParent = findNodeFromId(parentId);
260  int row = 0;
261 
262  if (pParent != NULL)
263  {
264  row = pParent->getNumChildren();
265  }
266 
267  beginInsertRows(index(pParent), row, row);
268  new CNode(id, key, displayRole, pParent);
269  endInsertRows();
270 }
271 
273 {
274  if (mpCopasiDM != pDataModel)
275  {
276  mpCopasiDM = pDataModel;
277 
278  mEmitDataChanged = false;
279 
280  clear();
281  load();
282 
283  dataChanged(index(0, 0), index(0, 0));
284 
285  mEmitDataChanged = true;
286  }
287 }
288 
289 void CQBrowserPaneDM::setGuiDM(const DataModelGUI * pDataModel)
290 {
291  if (mpGuiDM)
292  {
293  disconnect(mpGuiDM, SIGNAL(notifyView(ListViews::ObjectType, ListViews::Action, std::string)),
294  this, SLOT(slotNotify(ListViews::ObjectType, ListViews::Action, const std::string &)));
295  }
296 
297  mpGuiDM = pDataModel;
298 
299  if (mpGuiDM)
300  {
301  connect(mpGuiDM, SIGNAL(notifyView(ListViews::ObjectType, ListViews::Action, std::string)),
302  this, SLOT(slotNotify(ListViews::ObjectType, ListViews::Action, std::string)));
303  }
304 }
305 
307 {
309 
310  load(111); // Compartment
311  load(112); // Species
312  load(114); // Reactions
313  load(115); // Global Quantities
314  load(116); // Events
315 
316  findNodeFromId(118)->setKey(mpCopasiDM->getModel()->getModelParameterSet().getKey()); // Parameter Set
318  load(119); // Model Parameter Sets
319 
320  findNodeFromId(21)->setKey((*mpCopasiDM->getTaskList())["Steady-State"]->getKey());
321  findNodeFromId(221)->setKey((*mpCopasiDM->getTaskList())["Elementary Flux Modes"]->getKey());
322  findNodeFromId(222)->setKey((*mpCopasiDM->getTaskList())["Moieties"]->getKey());
323  findNodeFromId(2221)->setKey((*mpCopasiDM->getTaskList())["Moieties"]->getKey());
324  findNodeFromId(23)->setKey((*mpCopasiDM->getTaskList())["Time-Course"]->getKey());
325  findNodeFromId(24)->setKey((*mpCopasiDM->getTaskList())["Metabolic Control Analysis"]->getKey());
326  findNodeFromId(27)->setKey((*mpCopasiDM->getTaskList())["Time Scale Separation Analysis"]->getKey());
327  findNodeFromId(26)->setKey((*mpCopasiDM->getTaskList())["Lyapunov Exponents"]->getKey());
328  findNodeFromId(28)->setKey((*mpCopasiDM->getTaskList())["Cross Section"]->getKey());
329  findNodeFromId(31)->setKey((*mpCopasiDM->getTaskList())["Scan"]->getKey());
330  findNodeFromId(32)->setKey((*mpCopasiDM->getTaskList())["Optimization"]->getKey());
331  findNodeFromId(33)->setKey((*mpCopasiDM->getTaskList())["Parameter Estimation"]->getKey());
332  findNodeFromId(34)->setKey((*mpCopasiDM->getTaskList())["Sensitivities"]->getKey());
333  findNodeFromId(35)->setKey((*mpCopasiDM->getTaskList())["Linear Noise Approximation"]->getKey());
334 
336  load(42); // Plot Specifications
337 
339  load(43); // Report Specifications
340 
341  load(5); // Functions
342 
343  dataChanged(index(0, 0), index(0, 0));
344 }
345 
346 void CQBrowserPaneDM::load(const size_t & id)
347 {
348  bool isSpecies = false;
349  const CModel * pModel = mpCopasiDM->getModel();
350  const CCopasiVector< CCopasiObject > * pVector = NULL;
351 
352  switch (id)
353  {
354  case 111: // Compartment
355  pVector = reinterpret_cast< const CCopasiVector< CCopasiObject > * >(&pModel->getCompartments());
356  break;
357 
358  case 112: // Species
359  pVector = reinterpret_cast< const CCopasiVector< CCopasiObject > * >(&pModel->getMetabolites());
360  isSpecies = true;
361  break;
362 
363  case 114: // Reactions
364  pVector = reinterpret_cast< const CCopasiVector< CCopasiObject > * >(&pModel->getReactions());
365  break;
366 
367  case 115: // Global Quantities
368  pVector = reinterpret_cast< const CCopasiVector< CCopasiObject > * >(&pModel->getModelValues());
369  break;
370 
371  case 116: // Events
372  pVector = reinterpret_cast< const CCopasiVector< CCopasiObject > * >(&pModel->getEvents());
373  break;
374 
375  case 119: // Parameter Sets
376  pVector = reinterpret_cast< const CCopasiVector< CCopasiObject > * >(&pModel->getModelParameterSets());
377  break;
378 
379  case 42: // Plot Specifications
380  pVector = reinterpret_cast< const CCopasiVector< CCopasiObject > * >(mpCopasiDM->getPlotDefinitionList());
381  break;
382 
383  case 43: // Report Specifications
384  pVector = reinterpret_cast< const CCopasiVector< CCopasiObject > * >(mpCopasiDM->getReportDefinitionList());
385  break;
386 
387  case 5: // Functions
388  pVector = reinterpret_cast< const CCopasiVector< CCopasiObject > * >(&CCopasiRootContainer::getFunctionList()->loadedFunctions());
389  break;
390 
391  default:
392  return;
393  break;
394  }
395 
396  // We need to compare the existing nodes with the COPASI data model objects.
397  CNode * pParent = findNodeFromId(id);
398  CCopasiNode< CQBrowserPaneDM::SData > * pChildData = pParent->CCopasiNode< CQBrowserPaneDM::SData >::getChild();
401 
402  bool changed = false;
403 
404  for (; pChildData != NULL && it != end; pChildData = pChildData->getSibling(), ++it)
405  {
406  CNode * pChild = static_cast< CNode *>(pChildData);
407 
408  pChild->setKey((*it)->getKey());
409 
410  QString DisplayRole;
411 
412  if (isSpecies)
413  {
414  DisplayRole = FROM_UTF8(CMetabNameInterface::getDisplayName(pModel, *static_cast<const CMetab *>(*it), false));
415  }
416  else
417  {
418  DisplayRole = FROM_UTF8((*it)->getObjectName());
419  }
420 
421  if (pChild->getDisplayRole() != DisplayRole)
422  {
423  pChild->setDisplayRole(DisplayRole);
424  changed = true;
425  }
426  }
427 
428  // Remove excess nodes
429  if (pChildData != NULL)
430  {
431  int row = static_cast< CNode *>(pChildData)->getRow();
432  int count = 0;
433 
434  while (pChildData != NULL)
435  {
436  count++;
437  pChildData = pChildData->getSibling();
438  }
439 
440  removeRows(row, count, index(pParent));
441  }
442 
443  // Add missing nodes
444  if (it != end)
445  {
446  int first = pParent->getNumChildren();
447  int last = first + (end - it) - 1;
448 
449  beginInsertRows(index(pParent), first, last);
450 
451  for (; it != end; ++it)
452  {
453  QString DisplayRole;
454 
455  if (isSpecies)
456  {
457  DisplayRole = FROM_UTF8(CMetabNameInterface::getDisplayName(pModel, *static_cast<const CMetab *>(*it), false));
458  }
459  else
460  {
461  DisplayRole = FROM_UTF8((*it)->getObjectName());
462  }
463 
464  new CNode(C_INVALID_INDEX, (*it)->getKey(), DisplayRole, pParent);
465  }
466 
467  endInsertRows();
468  }
469 
470  if (changed && mEmitDataChanged)
471  {
472  QModelIndex Parent = index(pParent);
473 
474  emit dataChanged(Parent, Parent);
475  }
476 }
477 
479 {
480  if (key == "")
481  {
482  // Load is only reporting actual changes.
483  load();
484  return true;
485  }
486 
487  const CCopasiObject * pObject = CCopasiRootContainer::getKeyFactory()->get(key);
488 
489  if (pObject == NULL &&
490  action != ListViews::DELETE)
491  {
492  return false;
493  }
494 
495  QString DisplayRole;
496 
497  if (pObject != NULL)
498  {
499  // We have a key we can there fore determine the display role.
500  DisplayRole = FROM_UTF8(pObject->getObjectName());
501 
502  // Species need to be handled differently
503  const CMetab * pMetab = dynamic_cast< const CMetab *>(pObject);
504 
505  if (pMetab != NULL)
506  {
507  const CModel * pModel = pMetab->getModel();
508 
509  if (pModel != NULL)
510  {
511  DisplayRole = FROM_UTF8(CMetabNameInterface::getDisplayName(pModel, *pMetab, false));
512  }
513  }
514  }
515 
516  switch (action)
517  {
518  case ListViews::RENAME:
519  case ListViews::CHANGE:
520 
521  switch (objectType)
522  {
525  case ListViews::REACTION:
527  case ListViews::EVENT:
528  case ListViews::PLOT:
529  case ListViews::REPORT:
530  case ListViews::FUNCTION:
531  case ListViews::LAYOUT:
533  rename(key, DisplayRole);
534  break;
535 
536  default:
537  break;
538  }
539 
540  break;
541 
542  case ListViews::DELETE:
543 
544  // TODO CRITICAL We need to be smarter when deleting objects
545  switch (objectType)
546  {
549  case ListViews::REACTION:
551  case ListViews::EVENT:
552  case ListViews::PLOT:
553  case ListViews::REPORT:
554  case ListViews::FUNCTION:
555  case ListViews::LAYOUT:
557  remove(key);
558  break;
559 
560  default:
561  break;
562  }
563 
564  break;
565 
566  case ListViews::ADD:
567  {
568  switch (objectType)
569  {
570  case ListViews::MODEL:
571  load();
572  break;
573 
575  add(C_INVALID_INDEX, key, DisplayRole, 111);
576  break;
577 
579  add(C_INVALID_INDEX, key, DisplayRole, 112);
580  break;
581 
582  case ListViews::REACTION:
583  add(C_INVALID_INDEX, key, DisplayRole, 114);
584  break;
585 
587  add(C_INVALID_INDEX, key, DisplayRole, 115);
588  break;
589 
590  case ListViews::EVENT:
591  add(C_INVALID_INDEX, key, DisplayRole, 116);
592  break;
593 
595  add(C_INVALID_INDEX, key, DisplayRole, 119);
596  break;
597 
598  case ListViews::PLOT:
599  add(C_INVALID_INDEX, key, DisplayRole, 42);
600  break;
601 
602  case ListViews::REPORT:
603  add(C_INVALID_INDEX, key, DisplayRole, 43);
604  break;
605 
606  case ListViews::FUNCTION:
607  add(C_INVALID_INDEX, key, DisplayRole, 5);
608  break;
609 
610  default:
611  break;
612  }
613  }
614  break;
615  }
616 
617  return true;
618 }
619 
621 {
622  if (pNode == NULL)
623  {
624  return QModelIndex();
625  }
626 
627  if (pNode == mpRoot)
628  {
629  return index(0, 0, QModelIndex());
630  }
631 
632  QModelIndex Parent = index(static_cast< CNode * >(pNode->getParent()));
633 
634  return index(pNode->getRow(), 0, Parent);
635 }
636 
638 {
639  if (!index.isValid()) return NULL;
640 
641  QModelIndex Tmp = index;
642  const QAbstractItemModel *pModel = Tmp.model();
643 
644  while (pModel->inherits("QSortFilterProxyModel"))
645  {
646  Tmp = static_cast< const QSortFilterProxyModel *>(pModel)->mapToSource(index);
647  pModel = Tmp.model();
648  }
649 
650  return static_cast< CNode * >(Tmp.internalPointer());
651 }
652 
654 {
655  mpRoot = new CNode(0, "", "COPASI", NULL);
656 
657  std::stringstream in;
658  in.str(DataModeltxt);
659 
660  std::string str1;
661  std::string delimiter("\x0a\x0d");
662  char c;
663 
664  while (!in.eof())
665  {
666  str1 = "";
667 
668  while (!in.fail())
669  {
670  in.get(c);
671 
672  if (delimiter.find(c) != std::string::npos) break;
673 
674  str1 += c;
675  }
676 
677  if (str1 == "") break;
678 
679  QString data(FROM_UTF8(str1));
680 
681  int first = data.indexOf(':');
682  int second = data.indexOf(':', first + 1);
683  int parentId = data.mid(0, first).toInt();
684  int myId = data.mid(first + 1, second - first - 1).toInt();
685  QString str = data.mid(second + 1, data.length() - second - 1);
686 
687  CNode * pParent = NULL;
688 
689  if (parentId == 0)
690  {
691  switch (myId)
692  {
693  case 1:
694  pParent = (mFlags & Model) ? mpRoot : NULL;
695  break;
696 
697  case 2:
698  pParent = (mFlags & Tasks) ? mpRoot : NULL;
699  break;
700 
701  case 4:
702  pParent = (mFlags & Output) ? mpRoot : NULL;
703  break;
704 
705  case 5:
706  pParent = (mFlags & FunctionDB) ? mpRoot : NULL;
707  break;
708  }
709  }
710  else
711  {
712  pParent = this->findNodeFromId(parentId);
713  }
714 
715  if (pParent != NULL)
716  {
717  new CNode(myId, "", str, pParent);
718  }
719  }
720 }
721 
723 {
724  findNodeFromId(111)->deleteChildren(); // Compartment
725  findNodeFromId(112)->deleteChildren(); // Species
726  findNodeFromId(114)->deleteChildren(); // Reactions
727  findNodeFromId(115)->deleteChildren(); // Global Quantities
728  findNodeFromId(116)->deleteChildren(); // Events
729  findNodeFromId(119)->deleteChildren(); // Model Parameter Sets
730  findNodeFromId(42)->deleteChildren(); // Plot Specifications
731  findNodeFromId(43)->deleteChildren(); // Report Specifications
732  findNodeFromId(5)->deleteChildren(); // Functions
733 }
734 
737 {}
738 
740  const std::string & key,
741  const QString & displayRole,
742  CNode * pParent):
743  CCopasiNode< CQBrowserPaneDM::SData >(pParent)
744 {
745  mData.mId = id;
746  mData.mKey = key;
747  mData.mDisplayRole = displayRole;
748 
749  if (pParent != NULL)
750  {
751  pParent->addChild(this);
752  }
753 }
754 
756 {}
757 
758 const size_t & CQBrowserPaneDM::CNode::getId() const
759 {
760  return mData.mId;
761 }
762 
763 void CQBrowserPaneDM::CNode::setDisplayRole(const QString & displayRole)
764 {
765  mData.mDisplayRole = displayRole;
766 }
767 
769 {
770  return mData.mDisplayRole;
771 }
772 
774 {
775  if (mData.mId == C_INVALID_INDEX)
776  {
777  return mData.mDisplayRole;
778  }
779 
780  return QString::number(mData.mId);
781 }
782 
783 void CQBrowserPaneDM::CNode::setKey(const std::string & key)
784 {
785  mData.mKey = key;
786 }
787 
788 const std::string & CQBrowserPaneDM::CNode::getKey() const
789 {
790  return mData.mKey;
791 }
792 
794 {
795  int count = 0;
796 
797  const CCopasiNode< CQBrowserPaneDM::SData > * pParent = getParent();
798 
799  if (pParent == NULL)
800  {
801  return 0;
802  }
803 
804  const CCopasiNode< CQBrowserPaneDM::SData > * pChild = pParent->getChild();
805 
806  while (pChild != NULL && pChild != this)
807  {
808  count++;
809  pChild = pChild->getSibling();
810  }
811 
812  return (pChild != NULL) ? count : -1;
813 }
814 
815 std::ostream & operator<<(std::ostream &os, const CQBrowserPaneDM::CNode & n)
816 {
817  os << "CQBrowserPaneDM::CNode:" << std::endl;
818  //os << " mChemicalEquation: " << d.getChemicalEquation() << std::endl;
819  //os << " mChemicalEquationConverted: " << d.getChemicalEquationConverted() << std::endl;
820 
821  os << " mId: " << n.mData.mId << std::endl;
822  os << " mKey: " << n.mData.mKey << std::endl;
823  os << " mDisplayRole: " << TO_UTF8(n.mData.mDisplayRole) << std::endl;
824  return os;
825 }
virtual QModelIndex parent(const QModelIndex &index) const
CCopasiVectorN< CFunction > & loadedFunctions()
const CModelParameterSet & getModelParameterSet() const
Definition: CModel.cpp:1072
CNode * findNodeFromKey(const std::string &key) const
#define pdelete(p)
Definition: copasi.h:215
objectType
CCopasiNode< Data > * getSibling()
Definition: CCopasiNode.h:353
#define FROM_UTF8(__x)
Definition: qtUtilities.h:73
CCopasiVectorN< CEvent > & getEvents()
Definition: CModel.cpp:1110
const CCopasiVector< CMetab > & getMetabolites() const
Definition: CModel.cpp:1051
const std::string & getObjectName() const
const CCopasiVectorN< CModelValue > & getModelValues() const
Definition: CModel.cpp:1060
CCopasiObject * get(const std::string &key)
void setCopasiDM(const CCopasiDataModel *pDataModel)
virtual QModelIndex index(int row, int column, const QModelIndex &parent=QModelIndex()) const
std::ostream & operator<<(std::ostream &os, const CQBrowserPaneDM::CNode &n)
iterator begin()
virtual int rowCount(const QModelIndex &parent=QModelIndex()) const
#define C_INVALID_INDEX
Definition: copasi.h:222
static std::string getDisplayName(const CModel *model, const std::string &key, const bool &quoted)
CNode * findNodeFromId(const size_t &id) const
Definition: CMetab.h:178
const CCopasiDataModel * mpCopasiDM
void remove(const std::string &key)
static CNode * nodeFromIndex(const QModelIndex &index)
virtual const std::string & getKey() const
const CReportDefinitionVector * getReportDefinitionList() const
const std::string & getKey() const
iterator end()
virtual const std::string & getKey() const
void add(const size_t &id, const std::string &key, const QString &displayRole, const size_t &parentId=C_INVALID_INDEX)
virtual bool removeRows(int row, int count, const QModelIndex &parent=QModelIndex())
virtual bool addChild(CCopasiNode< Data > *pChild, CCopasiNode< Data > *pAfter=NULL)
Definition: CCopasiNode.h:156
CCopasiVectorN< CCopasiTask > * getTaskList()
virtual ~CQBrowserPaneDM()
CQBrowserPaneDM(QObject *parent=0)
void rename(const std::string &key, const QString &displayRole)
const size_t & getId() const
void setKey(const std::string &key)
const CCopasiVectorN< CModelParameterSet > & getModelParameterSets() const
Definition: CModel.cpp:1066
const std::string & getKey() const
Definition: CModel.cpp:1142
static CFunctionDB * getFunctionList()
const DataModelGUI * mpGuiDM
const std::string & getKey() const
size_t getNumChildren() const
Definition: CCopasiNode.h:262
size_t getIdFromIndex(const QModelIndex &index) const
CCopasiVectorNS< CCompartment > & getCompartments()
Definition: CModel.cpp:1145
static CKeyFactory * getKeyFactory()
const COutputDefinitionVector * getPlotDefinitionList() const
bool deleteChildren()
Definition: CCopasiNode.h:199
CCopasiNode< Data > * getParent()
Definition: CCopasiNode.h:139
const QString & getDisplayRole() const
void setDisplayRole(const QString &displayRole)
CCopasiVectorNS< CReaction > & getReactions()
Definition: CModel.cpp:1039
#define TO_UTF8(__x)
Definition: qtUtilities.h:74
Definition: CModel.h:50
void setGuiDM(const DataModelGUI *pDataModel)
virtual QVariant data(const QModelIndex &index, int role=Qt::DisplayRole) const
std::string getKeyFromIndex(const QModelIndex &index) const
CCopasiNode< Data > * getChild()
Definition: CCopasiNode.h:210
QString getSortRole() const
virtual int columnCount(const QModelIndex &parent=QModelIndex()) const
static char DataModeltxt[]
Definition: DataModel.txt.h:15
bool slotNotify(ListViews::ObjectType objectType, ListViews::Action action, std::string key="")