OpenStructure
gosty_app.hh
Go to the documentation of this file.
1 //------------------------------------------------------------------------------
2 // This file is part of the OpenStructure project <www.openstructure.org>
3 //
4 // Copyright (C) 2008-2020 by the OpenStructure authors
5 //
6 // This library is free software; you can redistribute it and/or modify it under
7 // the terms of the GNU Lesser General Public License as published by the Free
8 // Software Foundation; either version 3.0 of the License, or (at your option)
9 // any later version.
10 // This library is distributed in the hope that it will be useful, but WITHOUT
11 // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
12 // FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
13 // details.
14 //
15 // You should have received a copy of the GNU Lesser General Public License
16 // along with this library; if not, write to the Free Software Foundation, Inc.,
17 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18 //------------------------------------------------------------------------------
19 #ifndef OST_GUI_GOSTY_APP_HH
20 #define OST_GUI_GOSTY_APP_HH
21 
22 /*
23  Author: Marco Biasini, Andreas Schenk
24  */
25 
26 
27 #include <ost/config.hh>
28 #include <ost/gui/main.hh>
29 #include <ost/gui/module_config.hh>
31 
32 
33 #include <QObject>
34 #include <QString>
35 #include <QMap>
36 
37 
38 class QMainWindow;
39 class QMdiArea;
40 class QWidget;
41 
42 namespace ost {
43 
44 
45 // forward declarations
46 
47 namespace img {
48 
49 class ImageHandle;
50 
51 namespace gui {
52 class DataViewer;
53 
54 }}
55 
56 namespace gui {
57 
58 class PythonShell;
59 class GLWin;
60 class TextLogger;
61 class ToolOptionsWin;
62 class Perspective;
63 class SequenceViewer;
64 class SceneWin;
65 class MessageWidget;
66 
79 class DLLEXPORT_OST_GUI GostyApp : public QObject {
80  Q_OBJECT
81 public:
88 
94 
100 
106 
112 
118 
122  void StopScript();
123 
126  ost::img::gui::DataViewer* CreateDataViewer(const ost::img::ImageHandle& d, const QString& name="", const int noparent=0);
127 
130 
136 
144  void AddWidgetToApp(const QString& ident, QWidget* widget);
145 
146  QWidget* GetWidget(const QString& ident);
151  void RemoveWidgetFromApp(const QString& ident);
152 
156  static GostyApp* Instance();
157 
161  static bool ValidInstance();
162 
165  void SetAppTitle(const QString& app_title);
166 
168  void TryStereo(bool f) {try_stereo_=f;}
169 
170 public slots:
172  void OnQuit();
173 private:
174  GostyApp();
175  PythonShell* py_shell_;
176 
177  GLWin* gl_win_;
178 
179  SceneWin* scene_win_;
180 
181  MessageWidget* message_widget_;
182 
183  SequenceViewer* seq_viewer_;
184 
185  ToolOptionsWin* tool_options_win_;
186  GostyMainWindow* main_;
187 
188  Perspective* perspective_;
189 
190  QMap<QString,WidgetGeomHandler *> external_widgets_;
191 
192  bool try_stereo_;
193 
194  static GostyApp* app_;
195 };
196 
197 }}
198 
199 #endif
static GostyApp * Instance()
get the GostyApp instance GostyApp is implemented as Singleton. This returns the Instance of GostyApp...
void OnQuit()
This slot must be called when the application is going to be terminated.
Perspective * GetPerspective()
get perspective
SequenceViewer * GetSequenceViewer()
get scene menu
PythonShell * GetPyShell()
get python shell
ToolOptionsWin * GetToolOptionsWin()
get tool options window
void ProcessEvents()
give the application time to run the mainloop and process events
MessageWidget * GetMessageWidget()
get message widget
void RemoveWidgetFromApp(const QString &ident)
remove a custom QWidget from the gosty_app
static bool ValidInstance()
GostyApp is implemented as Singleton. This returns whether there is already a valid instance around.
GLWin * GetGLWin()
get 3d graphics window
void AddWidgetToApp(const QString &ident, QWidget *widget)
add a custom QWidget to the gosty_app
ost::img::gui::DataViewer * CreateDataViewer(const ost::img::ImageHandle &d, const QString &name="", const int noparent=0)
create new DataViewer
void SetAppTitle(const QString &app_title)
This methods sets the Title of this Application.
SceneWin * GetSceneWin()
get scene menu
void TryStereo(bool f)
attempt to get a stereo visual upon startup
Definition: gosty_app.hh:168
void StopScript()
stop script execution
QWidget * GetWidget(const QString &ident)
interactive python shell
Definition: python_shell.hh:34
QTableView with first column not moving.
Manage shared instances of images.
#define DLLEXPORT_OST_GUI
Definition: base.dox:1