OpenStructure
Loading...
Searching...
No Matches
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>
31
32
33#include <QObject>
34#include <QString>
35#include <QMap>
36
37
38class QMainWindow;
39class QMdiArea;
40class QWidget;
41
42namespace ost {
43
44
45// forward declarations
46
47namespace img {
48
49class ImageHandle;
50
51namespace gui {
52class DataViewer;
53
54}}
55
56namespace gui {
57
58class PythonShell;
59class GLWin;
60class TextLogger;
61class ToolOptionsWin;
62class Perspective;
63class SequenceViewer;
64class SceneWin;
65class MessageWidget;
66
79class DLLEXPORT_OST_GUI GostyApp : public QObject {
80 Q_OBJECT
81public:
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
157
161 static bool ValidInstance();
162
165 void SetAppTitle(const QString& app_title);
166
168 void TryStereo(bool f) {try_stereo_=f;}
169
170public slots:
172 void OnQuit();
173private:
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
SequenceViewer * GetSequenceViewer()
get scene menu
void OnQuit()
This slot must be called when the application is going to be terminated.
ost::img::gui::DataViewer * CreateDataViewer(const ost::img::ImageHandle &d, const QString &name="", const int noparent=0)
create new DataViewer
void ProcessEvents()
give the application time to run the mainloop and process events
PythonShell * GetPyShell()
get python shell
void RemoveWidgetFromApp(const QString &ident)
remove a custom QWidget from the gosty_app
Perspective * GetPerspective()
get perspective
static bool ValidInstance()
GostyApp is implemented as Singleton. This returns whether there is already a valid instance around.
void AddWidgetToApp(const QString &ident, QWidget *widget)
add a custom QWidget to the gosty_app
static GostyApp * Instance()
get the GostyApp instance GostyApp is implemented as Singleton. This returns the Instance of GostyApp...
QWidget * GetWidget(const QString &ident)
void SetAppTitle(const QString &app_title)
This methods sets the Title of this Application.
void TryStereo(bool f)
attempt to get a stereo visual upon startup
Definition gosty_app.hh:168
void StopScript()
stop script execution
MessageWidget * GetMessageWidget()
get message widget
ToolOptionsWin * GetToolOptionsWin()
get tool options window
SceneWin * GetSceneWin()
get scene menu
GLWin * GetGLWin()
get 3d graphics window
interactive python shell
QTableView with first column not moving.
Manage shared instances of images.
#define DLLEXPORT_OST_GUI
Definition base.dox:1