GostyApp Class Reference

#include <gosty_app.hh>

Inherits PyQt4::QtCore::QObject.

Public Slots

void OnQuit ()

Public Member Functions

PythonShellGetPyShell ()
GLWinGetGLWin ()
SceneWinGetSceneWin ()
SequenceViewerGetSequenceViewer ()
ToolOptionsWinGetToolOptionsWin ()
MessageWidgetGetMessageWidget ()
void StopScript ()
ost::img::gui::DataViewerCreateDataViewer (const ost::img::ImageHandle &d, const QString &name="", const int noparent=0)
void ProcessEvents ()
PerspectiveGetPerspective ()
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 GostyAppInstance ()

Detailed Description

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.


Member Function Documentation

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.

Parameters:
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 GostyApp* Instance (  )  [static]

get the GostyApp instance GostyApp is implemented as Singleton. This returns the Instance of GostyApp.

Returns:
the GostyApp instance
void OnQuit (  )  [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() .

Parameters:
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.

Parameters:
app_title Title that will be displayed in the title bar
void StopScript (  ) 

stop script execution

Stops the execution of the script.

void TryStereo ( bool  f  )  [inline]

attempt to get a stereo visual upon startup

Definition at line 165 of file gosty_app.hh.


The documentation for this class was generated from the following file:
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines

Generated on 20 Jun 2016 for OpenStructure by  doxygen 1.6.1