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-2011 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 
124 #if OST_IMG_ENABLED
125  ost::img::gui::DataViewer* CreateDataViewer(const ost::img::ImageHandle& d, const QString& name="", const int noparent=0);
128 #endif
129 
131  void ProcessEvents();
132 
137  Perspective* GetPerspective();
138 
146  void AddWidgetToApp(const QString& ident, QWidget* widget);
147 
148  QWidget* GetWidget(const QString& ident);
153  void RemoveWidgetFromApp(const QString& ident);
154 
158  static GostyApp* Instance();
159 
162  void SetAppTitle(const QString& app_title);
163 
165  void TryStereo(bool f) {try_stereo_=f;}
166 
167 public slots:
169  void OnQuit();
170 private:
171  GostyApp();
172  PythonShell* py_shell_;
173 
174  GLWin* gl_win_;
175 
176  SceneWin* scene_win_;
177 
178  MessageWidget* message_widget_;
179 
180  SequenceViewer* seq_viewer_;
181 
182  ToolOptionsWin* tool_options_win_;
183  GostyMainWindow* main_;
184 
185  Perspective* perspective_;
186 
187  QMap<QString,WidgetGeomHandler *> external_widgets_;
188 
189  bool try_stereo_;
190 
191  static GostyApp* app_;
192 };
193 
194 }}
195 
196 #endif
void TryStereo(bool f)
attempt to get a stereo visual upon startup
Definition: gosty_app.hh:165
interactive python shell
Definition: python_shell.hh:34
def CreateDataViewer
Definition: __init__.py:31
#define DLLEXPORT_OST_GUI
Manage shared instances of images.
QTableView with first column not moving.