OpenStructure
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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:
87  PythonShell* GetPyShell();
88 
93  GLWin* GetGLWin();
94 
99  SceneWin* GetSceneWin();
100 
105  SequenceViewer* GetSequenceViewer();
106 
111  ToolOptionsWin* GetToolOptionsWin();
112 
117  MessageWidget* GetMessageWidget();
118 
122  void StopScript();
123 
126  ost::img::gui::DataViewer* CreateDataViewer(const ost::img::ImageHandle& d, const QString& name="", const int noparent=0);
127 
129  void ProcessEvents();
130 
135  Perspective* GetPerspective();
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
void TryStereo(bool f)
attempt to get a stereo visual upon startup
Definition: gosty_app.hh:168
interactive python shell
Definition: python_shell.hh:34
def CreateDataViewer
Definition: __init__.py:29
#define DLLEXPORT_OST_GUI
Manage shared instances of images.
QTableView with first column not moving.