COPASI API  4.16.103
CCopasiSelectionDialog.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 #ifndef CCopasiSelectionDialog_H__
16 #define CCopasiSelectionDialog_H__
17 
18 #include <vector>
19 
20 #include <QtGui/QDialog>
21 
23 
24 class QPushButton;
25 class QCheckBox;
27 class QVBoxLayout;
28 class QHBoxLayout;
29 class CCopasiObject;
30 class CModel;
31 class CArrayAnnotation;
32 
33 class CCopasiSelectionDialog: public QDialog
34 {
35  Q_OBJECT
36 
37 protected:
38  QCheckBox* mpModeCheckBox;
39  QHBoxLayout* mpButtonBox;
40  QWidget* mpMainWidget;
42  QVBoxLayout* mpMainLayout;
43  std::vector<const CCopasiObject * > * mpTmpVector;
44  std::vector<const CCopasiObject * > * mpOutputVector;
47 
48 protected slots:
49  void okButton_clicked();
50  void cancelButton_clicked();
51  void modeButton_toggled(bool checked);
52 
53 public:
54  CCopasiSelectionDialog(QWidget * parent = 0, const char * name = 0, bool modal = false);
56  void setOutputVector(std::vector< const CCopasiObject * > * outputVector);
57  void setModel(const CModel* model,
58  const CQSimpleSelectionTree::ObjectClasses & classes);
59  void setSingleSelection(bool singleSelectionMode);
60  void enableExpertMode(bool enable);
61 
62  static
63  const CCopasiObject * getObjectSingle(QWidget * pParent,
65  const CCopasiObject * pCurrentObject = NULL);
66  static
67  std::vector< const CCopasiObject * > getObjectVector(QWidget * pParent,
69  const std::vector< const CCopasiObject * > * pCurrentSelection = NULL);
70 
71  /**
72  * single=true means only one object can be returned (in the first element of the return vector)
73  * when single=true and the dialog is canceled the return vector will have size=1 and contain the NULL pointer.
74  * when single=false and the dialog is canceled the return vector will be empty.
75  * value=true means only objects that have a value (i.e. arrayElementReferences) are allowed.
76  * otherwise also the whole array annotation may be returned.
77  */
78  static std::vector<const CCopasiObject*> chooseCellMatrix(const CArrayAnnotation * pArrayAnnotation,
79  bool single, bool value, std::string caption = "");
80 };
81 #endif /* SimpleSelectionDialog_H__ */
static std::vector< const CCopasiObject * > getObjectVector(QWidget *pParent, const CQSimpleSelectionTree::ObjectClasses &classes, const std::vector< const CCopasiObject * > *pCurrentSelection=NULL)
void setSingleSelection(bool singleSelectionMode)
CCopasiSelectionWidget * mpSelectionWidget
std::vector< const CCopasiObject * > * mpOutputVector
CCopasiSelectionDialog(QWidget *parent=0, const char *name=0, bool modal=false)
static std::vector< const CCopasiObject * > chooseCellMatrix(const CArrayAnnotation *pArrayAnnotation, bool single, bool value, std::string caption="")
void setOutputVector(std::vector< const CCopasiObject * > *outputVector)
void modeButton_toggled(bool checked)
void setModel(const CModel *model, const CQSimpleSelectionTree::ObjectClasses &classes)
Definition: CModel.h:50
static const CCopasiObject * getObjectSingle(QWidget *pParent, const CQSimpleSelectionTree::ObjectClasses &classes, const CCopasiObject *pCurrentObject=NULL)
std::vector< const CCopasiObject * > * mpTmpVector