COPASI API  4.16.103
CQSpecieDM.h
Go to the documentation of this file.
1 // Begin CVS Header
2 // $Source: /Volumes/Home/Users/shoops/cvs/copasi_dev/copasi/UI/CQSpecieDM.h,v $
3 // $Revision: 1.6 $
4 // $Name: $
5 // $Author: shoops $
6 // $Date: 2011/10/07 16:28:57 $
7 // End CVS Header
8 
9 // Copyright (C) 2011 - 2010 by Pedro Mendes, Virginia Tech Intellectual
10 // Properties, Inc., University of Heidelberg, and The University
11 // of Manchester.
12 // All rights reserved.
13 
14 // Copyright (C) 2008 by Pedro Mendes, Virginia Tech Intellectual
15 // Properties, Inc., EML Research, gGmbH, University of Heidelberg,
16 // and The University of Manchester.
17 // All rights reserved.
18 
19 #ifndef CQSpecieDM_H
20 #define CQSpecieDM_H
21 
22 #include "model/CModel.h"
23 #include "listviews.h"
24 #include "CQBaseDataModel.h"
25 
26 #define COL_NAME_SPECIES 1
27 #define COL_COMPARTMENT 2
28 #define COL_TYPE_SPECIES 3
29 #define COL_ICONCENTRATION 4
30 #define COL_INUMBER 5
31 #define COL_CONCENTRATION 6
32 #define COL_NUMBER 7
33 #define COL_CRATE 8
34 #define COL_NRATE 9
35 #define COL_IEXPRESSION_SPECIES 10
36 #define COL_EXPRESSION_SPECIES 11
37 #define TOTAL_COLS_SPECIES 12
38 
40 {
41  Q_OBJECT
42 
43 public:
44  CQSpecieDM(QObject *parent = 0);
45  virtual int rowCount(const QModelIndex &parent = QModelIndex()) const;
46  virtual int columnCount(const QModelIndex &parent = QModelIndex()) const;
47  Qt::ItemFlags flags(const QModelIndex &index) const;
48  QVariant data(const QModelIndex &index, int role) const;
49  QVariant headerData(int section, Qt::Orientation orientation,
50  int role = Qt::DisplayRole) const;
51  bool setData(const QModelIndex &index, const QVariant &value,
52  int role = Qt::EditRole);
53  const QStringList& getTypes();
54  void setFlagConc(bool flag);
55  const std::vector< unsigned C_INT32 >& getItemToType();
56  bool removeRows(QModelIndexList rows, const QModelIndex &index = QModelIndex());
57 
58 protected:
59  bool mFlagConc;
60  QStringList mTypes;
61 
62  /**
63  * A vector mapping the item index to a model value type
64  */
65  std::vector< unsigned C_INT32 > mItemToType;
66 
67  /**
68  * A pointer to the selected species
69  */
70  mutable CMetab * mpSpecies;
71 
72  bool mNotify;
73 
74  bool insertRows(int position, int rows, const QModelIndex &index = QModelIndex());
75  bool removeRows(int position, int rows, const QModelIndex &index = QModelIndex());
76 };
77 
78 #endif //CQSpecieDM_H
virtual int columnCount(const QModelIndex &parent=QModelIndex()) const
Definition: CQSpecieDM.cpp:59
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
Qt::ItemFlags flags(const QModelIndex &index) const
Definition: CQSpecieDM.cpp:64
bool mFlagConc
Definition: CQSpecieDM.h:59
virtual int rowCount(const QModelIndex &parent=QModelIndex()) const
Definition: CQSpecieDM.cpp:54
CMetab * mpSpecies
Definition: CQSpecieDM.h:70
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
QStringList mTypes
Definition: CQSpecieDM.h:60
bool insertRows(int position, int rows, const QModelIndex &index=QModelIndex())
Definition: CQSpecieDM.cpp:479
bool removeRows(QModelIndexList rows, const QModelIndex &index=QModelIndex())
Definition: CQSpecieDM.cpp:541
bool mNotify
Definition: CQSpecieDM.h:72
const std::vector< unsigned C_INT32 > & getItemToType()
Definition: CQSpecieDM.cpp:49
std::vector< unsigned C_INT32 > mItemToType
Definition: CQSpecieDM.h:65