COPASI API  4.16.103
ObjectBrowserWidget.h
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) 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) 2004 - 2007 by Pedro Mendes, Virginia Tech Intellectual
12 // Properties, Inc. and EML Research, gGmbH.
13 // All rights reserved.
14 
15 /********************************************************
16 Author: Liang Xu
17 Version : 1.xx <first>
18 Description:
19 Date: 04/03
20 Comment : Copasi Object Browser:
21 Contact: Please contact lixu1@vt.edu.
22  *********************************************************/
23 
24 #ifndef OBJECTBROWSERWIDGET_H
25 #define OBJECTBROWSERWIDGET_H
26 
27 #include <QtGui/QWidget>
28 #include <vector>
29 
30 template <class CType> class CCopasiVector;
31 
32 class QVBoxLayout;
33 class QHBoxLayout;
34 class QGridLayout;
35 class QSpacerItem;
36 class QPushButton;
37 class QTreeWidget;
38 class QTreeWidgetItem;
39 class QTextEdit;
40 class ObjectBrowserItem;
41 class ObjectList;
42 class QFrame;
43 class CCopasiContainer;
44 class CCopasiObject;
45 class CopasiUI3Window;
46 class QPixmap;
47 
49 
50 class ObjectBrowserWidget : public QWidget
51 {
52  Q_OBJECT
53 
54 public:
55  ObjectBrowserWidget(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = 0, int state = 0);
56  virtual ~ObjectBrowserWidget();
57 
60 
61  QGridLayout* ObjectBrowserLayout;
62  QPushButton* clearButton;
63  QPushButton* toggleViewButton;
64  QPushButton* commitButton;
65  QTreeWidget* ObjectListView;
66  QFrame* Line1;
67  QSpacerItem* spacer;
68  QTextEdit* ObjectItemText;
69 
70  void eXport(ObjectBrowserItem* pCurrent, std::vector< const CCopasiObject * > * outputVector);
72  void setCheck(ObjectBrowserItem* pCurrent);
73  void setUncheck(ObjectBrowserItem* pCurrent);
74  void clickToReverseCheck(ObjectBrowserItem* pCurrent);
75  void setCheckMark(ObjectBrowserItem* pCurrent);
76 
77  void loadData();
78  void loadChild(ObjectBrowserItem* parent, const CCopasiContainer * copaParent, bool nField);
79  void loadField(ObjectBrowserItem* parent, CCopasiVector<CCopasiObject>* copaParent);
80 
81  CCopasiObject* getFieldCopasiObject(CCopasiContainer * pCurrent, const char* name);
82  void setOutputVector(std::vector< const CCopasiObject * > * pObjectVector);
83  void selectObjects(std::vector< const CCopasiObject * > * pObjectVector);
84  void updateUI();
85  void loadUI();
86 
87  void swap(int, int, ObjectBrowserItem**);
88  int partition(int, int, int, ObjectBrowserItem**);
89  void quick_sort(int, int, ObjectBrowserItem**);
90 
91 public slots:
92  virtual void clearClicked();
93  virtual void toggleViewClicked();
94  virtual void commitClicked();
95  virtual void listviewChecked(QTreeWidgetItem*, int);
96 
97 private:
98  std::vector< const CCopasiObject * > * mOutputObjectVector;
100  void selectObjects(ObjectBrowserItem* browserItem, const CCopasiObject * selectObject);
102  void cleanup();
103 };
104 #endif // OBJECTBROWSERWIDGET_H
QGridLayout * ObjectBrowserLayout
void setUncheck(ObjectBrowserItem *pCurrent)
void removeDuplicate(ObjectList *objectItemList)
void setCheck(ObjectBrowserItem *pCurrent)
void clickToReverseCheck(ObjectBrowserItem *pCurrent)
void eXport(ObjectBrowserItem *pCurrent, std::vector< const CCopasiObject * > *outputVector)
void setCheckMark(ObjectBrowserItem *pCurrent)
virtual void listviewChecked(QTreeWidgetItem *, int)
void swap(int, int, ObjectBrowserItem **)
void loadField(ObjectBrowserItem *parent, CCopasiVector< CCopasiObject > *copaParent)
void loadChild(ObjectBrowserItem *parent, const CCopasiContainer *copaParent, bool nField)
void setOutputVector(std::vector< const CCopasiObject * > *pObjectVector)
QTreeWidget * ObjectListView
virtual void toggleViewClicked()
bool fl(const C_FLOAT64 &d1, const C_FLOAT64 &d2)
std::vector< const CCopasiObject * > * mOutputObjectVector
void selectObjects(std::vector< const CCopasiObject * > *pObjectVector)
void quick_sort(int, int, ObjectBrowserItem **)
ObjectBrowserWidget(QWidget *parent=0, const char *name=0, Qt::WFlags fl=0, int state=0)
QPushButton * commitButton
int partition(int, int, int, ObjectBrowserItem **)
CCopasiObject * getFieldCopasiObject(CCopasiContainer *pCurrent, const char *name)
QPushButton * toggleViewButton