FAST  3.2.0
Framework for Heterogeneous Medical Image Computing and Visualization
Window.hpp
Go to the documentation of this file.
1 #pragma once
2 
3 #include "FASTExport.hpp"
4 #include "FAST/Object.hpp"
5 #include "WindowWidget.hpp"
6 #include "ComputationThread.hpp"
7 #include "View.hpp"
8 #include <vector>
9 #include <QGLContext>
10 
11 class QGLContext;
12 class QEventLoop;
13 class QOffscreenSurface;
14 
15 namespace fast {
16 
17 class ProcessObject;
18 
19 class FAST_EXPORT Window : public QObject, public Object {
20  Q_OBJECT
21  public:
22  static void initializeQtApp();
23  static QGLContext* getMainGLContext();
24  static void setMainGLContext(QGLContext* context);
28  virtual void setTimeout(unsigned int milliseconds);
29  ~Window();
33  virtual void start();
34  void setWidth(uint width);
35  void setHeight(uint height);
36  void setSize(uint width, uint height);
37  void enableMaximized();
38  void disableMaximized();
39  void enableFullscreen();
40  void disableFullscreen();
41  void setTitle(std::string);
42  std::vector<View*> getViews() const;
43  View* getView(uint i) const;
44  static void cleanup();
49  int getScreenWidth() const;
54  int getScreenHeight() const;
59  float getScalingFactor() const;
60  void saveScreenshotOnClose(std::string filename);
61  void saveScreenshotOfViewsOnClose(std::string filename);
62  QWidget* getWidget();
63  void addProcessObject(std::shared_ptr<ProcessObject> po);
64  protected:
65  void startComputationThread();
66  void stopComputationThread();
67  Window();
68  View* createView();
69 
71  unsigned int mWidth, mHeight;
72  bool mFullscreen, mMaximized;
73  unsigned int mTimeout;
74  float mGUIScalingFactor = 1.0f;
75  QEventLoop* mEventLoop;
77  std::vector<std::shared_ptr<ProcessObject>> m_processObjects;
78  private:
79  static QGLContext* mMainGLContext;
80  public Q_SLOTS:
81  void stop();
82 
83 
84 };
85 
86 } // end namespace fast
87 
Object.hpp
fast
Definition: AffineTransformation.hpp:7
fast::View
Definition: View.hpp:17
View.hpp
fast::Window::mEventLoop
QEventLoop * mEventLoop
Definition: Window.hpp:75
ComputationThread.hpp
fast::Object
Definition: Object.hpp:34
fast::Window::mWidget
WindowWidget * mWidget
Definition: Window.hpp:70
fast::Window::mThread
ComputationThread * mThread
Definition: Window.hpp:76
fast::WindowWidget
Definition: WindowWidget.hpp:11
fast::ComputationThread
Definition: ComputationThread.hpp:16
fast::Window::mMaximized
bool mMaximized
Definition: Window.hpp:72
fast::Window::mTimeout
unsigned int mTimeout
Definition: Window.hpp:73
uint
unsigned int uint
Definition: DataTypes.hpp:16
fast::Window
Definition: Window.hpp:19
fast::Window::mWidth
unsigned int mWidth
Definition: Window.hpp:71
fast::Window::m_processObjects
std::vector< std::shared_ptr< ProcessObject > > m_processObjects
Definition: Window.hpp:77
WindowWidget.hpp