FAST  3.2.0
Framework for Heterogeneous Medical Image Computing and Visualization
ComputationThread.hpp
Go to the documentation of this file.
1 #pragma once
2 
3 #include "FAST/Object.hpp"
5 #include <QThread>
6 #include <mutex>
7 #include <condition_variable>
8 #include <vector>
9 
10 
11 namespace fast {
12 
13 class View;
14 class ProcessObject;
15 
16 class FAST_EXPORT ComputationThread : public QObject, public Object {
17  Q_OBJECT
18  public:
19  ComputationThread(QThread* mainThread);
21  bool isRunning();
22  void stop();
23  void addView(View* view);
24  void clearViews();
25  void setProcessObjects(std::vector<std::shared_ptr<ProcessObject>> processObjects);
26  public slots:
27  void run();
28  signals:
29  void finished();
30  private:
31 
32  bool mIsRunning;
33  std::condition_variable mUpdateThreadConditionVariable;
34  std::mutex mUpdateThreadMutex;
35 
36  QThread* mMainThread;
37 
38  std::vector<View*> mViews;
39  std::vector<std::shared_ptr<ProcessObject>> m_processObjects;
40 
41  bool mStop = false;
42 };
43 
44 }
Object.hpp
fast
Definition: AffineTransformation.hpp:7
fast::View
Definition: View.hpp:17
fast::Object
Definition: Object.hpp:34
fast::ComputationThread
Definition: ComputationThread.hpp:16
DataChannel.hpp