OpenStructure
Public Slots | Public Member Functions | Static Public Member Functions
GostyApp Class Reference

#include <gosty_app.hh>

Inherits 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 ()
 
static bool ValidInstance ()
 

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

◆ AddWidgetToApp()

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
identthe ident is used to identify a custom widget. It must be unique. Otherwise there might occur an unexpected behaviour.
widgetthe widget which will be added to the GostyApp

◆ CreateDataViewer()

ost::img::gui::DataViewer* CreateDataViewer ( const ost::img::ImageHandle d,
const QString &  name = "",
const int  noparent = 0 
)

create new DataViewer

◆ GetGLWin()

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.

◆ GetMessageWidget()

MessageWidget* GetMessageWidget ( )

get message widget

The MessageWidget is initialized when this method is first called. All subsequent calls will return the same MessageWidget instance.

◆ GetPerspective()

Perspective* GetPerspective ( )

get perspective

The perspective is initialized when this method is first called. All subsequent calls will return the same Perspective instance.

◆ GetPyShell()

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.

◆ GetSceneWin()

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.

◆ GetSequenceViewer()

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.

◆ GetToolOptionsWin()

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.

◆ GetWidget()

QWidget* GetWidget ( const QString &  ident)

◆ Instance()

static GostyApp* Instance ( )
static

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

Returns
the GostyApp instance

◆ OnQuit

void OnQuit ( )
slot

This slot must be called when the application is going to be terminated.

◆ ProcessEvents()

void ProcessEvents ( )

give the application time to run the mainloop and process events

◆ RemoveWidgetFromApp()

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
identthe ident of the widget which should be removed. Before the widget is removed, the position will be stored.

◆ SetAppTitle()

void SetAppTitle ( const QString &  app_title)

This methods sets the Title of this Application.

Parameters
app_titleTitle that will be displayed in the title bar

◆ StopScript()

void StopScript ( )

stop script execution

Stops the execution of the script.

◆ TryStereo()

void TryStereo ( bool  f)
inline

attempt to get a stereo visual upon startup

Definition at line 168 of file gosty_app.hh.

◆ ValidInstance()

static bool ValidInstance ( )
static

GostyApp is implemented as Singleton. This returns whether there is already a valid instance around.


The documentation for this class was generated from the following file: