OpenStructure
|
#include <gosty_app.hh>
Inherits QObject.
Public Slots | |
void | OnQuit () |
Public Member Functions | |
PythonShell * | GetPyShell () |
GLWin * | GetGLWin () |
SceneWin * | GetSceneWin () |
SequenceViewer * | GetSequenceViewer () |
ToolOptionsWin * | GetToolOptionsWin () |
MessageWidget * | GetMessageWidget () |
void | StopScript () |
ost::img::gui::DataViewer * | CreateDataViewer (const ost::img::ImageHandle &d, const QString &name="", const int noparent=0) |
void | ProcessEvents () |
Perspective * | GetPerspective () |
void | AddWidgetToApp (const QString &ident, QWidget *widget) |
QWidget * | GetWidget (const QString &ident) |
void | RemoveWidgetFromApp (const QString &ident) |
void | SetAppTitle (const QString &app_title) |
void | TryStereo (bool f) |
Static Public Member Functions | |
static GostyApp * | Instance () |
static bool | ValidInstance () |
The gosty app serves as a GUI Manager. It distinguishes between two types of windows: Windows that can only exist once (singletons) and windows with several independent instances of the same class. The first type includes windows such as the 3D Scene and the Python Shell. They can be accessed through one of the getter methods GetPyShell(), GetGLWin(), GetToolOptionsWin(). In Python, these classes are additionally exported as read-only properties py_shell, gl_win. The other class of windows include data viewers, plot viewers and sequence viewers. They can be created for example the CreateDataViewer() method.
The layout of the widgets inside the main window is managed through a perspective.
Definition at line 79 of file gosty_app.hh.
void AddWidgetToApp | ( | const QString & | ident, |
QWidget * | widget | ||
) |
add a custom QWidget to the gosty_app
This method adds a custom widget to OpenStructure. It can be used for example in a python script, so that the widget will not be destroyed, when the script reaches the end. The widget position will be stored, when OpenStructure is being closed. It will be restored the next time, a widget is added with the same identifier.
ident | the ident is used to identify a custom widget. It must be unique. Otherwise there might occur an unexpected behaviour. |
widget | the widget which will be added to the GostyApp |
ost::img::gui::DataViewer* CreateDataViewer | ( | const ost::img::ImageHandle & | d, |
const QString & | name = "" , |
||
const int | noparent = 0 |
||
) |
create new DataViewer
GLWin* GetGLWin | ( | ) |
get 3d graphics window
The GL window is initialized when this method is first called. All subsequent calls will return the same GLWin instance.
MessageWidget* GetMessageWidget | ( | ) |
get message widget
The MessageWidget is initialized when this method is first called. All subsequent calls will return the same MessageWidget instance.
Perspective* GetPerspective | ( | ) |
get perspective
The perspective is initialized when this method is first called. All subsequent calls will return the same Perspective instance.
PythonShell* GetPyShell | ( | ) |
get python shell
The Python Shell is initialized when this method is first called. There may at most be one python shell at any given time. Call PythonShell::Show() to display the shell.
SceneWin* GetSceneWin | ( | ) |
get scene menu
The scene menu window is initialized when this method is first called. All subsequent calls will return the same SceneWin instance.
SequenceViewer* GetSequenceViewer | ( | ) |
get scene menu
The sequence viewer is initialized when this method is first called. All subsequent calls will return the same SequenceViewer instance.
ToolOptionsWin* GetToolOptionsWin | ( | ) |
get tool options window
The tool options window is initialized when this method is first called. All subsequent calls will return the same SceneWin instance.
QWidget* GetWidget | ( | const QString & | ident | ) |
|
static |
|
slot |
This slot must be called when the application is going to be terminated.
void ProcessEvents | ( | ) |
give the application time to run the mainloop and process events
void RemoveWidgetFromApp | ( | const QString & | ident | ) |
remove a custom QWidget from the gosty_app
This method removes a custom widget from OpenStructure. If the given ident is not known, nothing happens. Read more about custom widgets at AddWidgetToApp() .
ident | the ident of the widget which should be removed. Before the widget is removed, the position will be stored. |
void SetAppTitle | ( | const QString & | app_title | ) |
This methods sets the Title of this Application.
app_title | Title that will be displayed in the title bar |
void StopScript | ( | ) |
stop script execution
Stops the execution of the script.
|
inline |
attempt to get a stereo visual upon startup
Definition at line 168 of file gosty_app.hh.
|
static |
GostyApp is implemented as Singleton. This returns whether there is already a valid instance around.