COPASI API  4.16.103
CQLayoutThread.h
Go to the documentation of this file.
1 // Copyright (C) 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 #ifndef CQ_LAYOUT_THREAD_H
7 #define CQ_LAYOUT_THREAD_H
8 
9 #include <QtCore/QThread>
10 #include <QtCore/QMutex>
11 #include <QtCore/QWaitCondition>
12 #include <QtCore/QSharedPointer>
13 #include <QtCore/QMetaType>
14 
15 #include <copasi.h>
16 #include <layout/CLayoutState.h>
18 
20 class CLayout;
21 class QWidget;
22 class QDockWidget;
24 
25 class CQLayoutThread : public QThread
26 {
27  Q_OBJECT;
28 public:
29  CQLayoutThread(QWidget* parent);
30  virtual ~CQLayoutThread();
31 
32  QDockWidget* getParameterWindow();
33 
34  void randomizeLayout(CLayout* layout);
35 
36  /**
37  * Run the layout algorithm on the given layout
38  */
39  void createSpringLayout(CLayout* layout, int numIntervals = 1000, int updateWait = 100);
40 
41  void stopLayout();
42 
43  void resume();
44 
45  void finalize();
46 
47  bool pause();
48 
49 signals:
50  void layoutUpdated();
51  void layoutFinished();
52  void layoutStateChanged(QSharedPointer<CLayoutState> newState);
53 
54 public slots:
55  void terminateLayout();
56 
57 protected:
58  virtual void run();
59 
60  /**
61  * The parameter window
62  */
64 
65  /**
66  * The current layout
67  */
69 
70  /**
71  * Number of Iterations the layout algorithm will run
72  */
74 
75  /**
76  * Number of msecs to wait between updates, use 0 to disable updates
77  */
79 
80  /**
81  * boolean indicating whether the layout algorithm should stop
82  */
84 
85  // synchronization
86  QMutex mSync;
87  QWaitCondition mPauseCond;
88  bool mPause;
90 };
91 
92 Q_DECLARE_METATYPE(QSharedPointer<CLayoutState>)
93 
94 #endif //CQ_LAYOUT_THREAD_H
void layoutStateChanged(QSharedPointer< CLayoutState > newState)
void createSpringLayout(CLayout *layout, int numIntervals=1000, int updateWait=100)
CQLayoutThread(QWidget *parent)
CLayout * mpCurrentLayout
void layoutFinished()
CCopasiSpringLayout * mpCurrent
virtual ~CQLayoutThread()
CQSpringLayoutParameterWindow * mpParameterWindow
void randomizeLayout(CLayout *layout)
QDockWidget * getParameterWindow()
void layoutUpdated()
virtual void run()
QWaitCondition mPauseCond