OpenWalnut  1.5.0dev
Public Slots | Public Member Functions | Protected Member Functions | Protected Attributes | Private Slots | Private Attributes | List of all members
WQtGLDockWidget Class Reference

Dock widget containing only a GLWidget. More...

#include <WQtGLDockWidget.h>

+ Inheritance diagram for WQtGLDockWidget:
+ Collaboration diagram for WQtGLDockWidget:

Public Slots

void openScreenCaptureConfig ()
 Open screen capture config options. More...
 
- Public Slots inherited from WQtDockWidget
void showHelp ()
 Show help. More...
 

Public Member Functions

 WQtGLDockWidget (QString viewTitle, QString dockTitle, QWidget *parent, WGECamera::ProjectionMode projectionMode=WGECamera::ORTHOGRAPHIC, const QWidget *shareWidget=0)
 default constructor More...
 
virtual ~WQtGLDockWidget ()
 destructor. More...
 
WQtGLWidgetgetGLWidget () const
 Gets the contained GL widget instance. More...
 
WQtGLScreenCapturegetScreenCapture ()
 Adds a screen capture dock using this view's screen capture callback. More...
 
void forceGLWidgetSize (size_t w, size_t h)
 Forces the GL widget to have the desired size. More...
 
void restoreGLWidgetSize ()
 Restores the GL widget size if it was fixed with forceMainGLWidgetSize() previously. More...
 
const QString & getDockTitle () const
 Return the title of the view/dock. More...
 
virtual void saveSettings ()
 Save settings. More...
 
virtual void restoreSettings ()
 Restore settings. More...
 
void setSaveViewerSettings (bool enable=true)
 Allow turning the automatic save and restore of viewer-settings. More...
 
bool getSaveViewerSettings () const
 Check whether the automatic saving of WGEViewer properties is enabled. More...
 
QMenugetCameraPresetMenu () const
 Get the menu used for camera presets. More...
 
void updateCameraPresetButton ()
 Update camera button. More...
 
- Public Member Functions inherited from WQtDockWidget
 WQtDockWidget (const QString &title, QWidget *parent=0, Qt::WindowFlags flags=Qt::WindowFlags())
 Construct dock widget with title. More...
 
 WQtDockWidget (QWidget *parent=0, Qt::WindowFlags flags=Qt::WindowFlags())
 Construct dock widget. More...
 
virtual ~WQtDockWidget ()
 Destructor. More...
 
virtual void addTitleProperty (WPropTrigger prop, WGEImage::SPtr icon=WGEImage::SPtr())
 Add a property to the title of this dock. More...
 
virtual void addTitleProperty (WPropBool prop, WGEImage::SPtr icon=WGEImage::SPtr())
 Add a property to the title of this dock. More...
 
virtual void addTitleProperty (WPropGroup prop, WGEImage::SPtr icon=WGEImage::SPtr())
 Add a property to the title of this dock. More...
 
virtual void addTitleAction (QAction *action, bool instantPopup=false)
 Add the given action to the titlebar. More...
 
virtual void addTitleButton (QToolButton *button)
 Add the given tool button to the titlebar. More...
 
virtual void removeTitleAction (QAction *action)
 Remove the given action from the list. More...
 
virtual void addTitleSeperator ()
 Add a separator. More...
 
virtual void addTitleWidget (QWidget *widget)
 Add an arbitrary widget. More...
 
virtual void removeTitleWidget (QWidget *widget)
 Remove the specified widget from the title bar. More...
 
virtual void setHelpContext (const QString &id)
 Set a string which identifies help material for this dock. More...
 
virtual const QString & getHelpContext ()
 Return the help context id. More...
 
void disableCloseButton (bool disable=true)
 Disable close button? Might come in handy when embedding these widgets into others. More...
 

Protected Member Functions

virtual void closeEvent (QCloseEvent *event)
 Called whenever a close event is received. More...
 
virtual void showEvent (QShowEvent *event)
 Called whenever the widget gets opened. More...
 

Protected Attributes

QVBoxLayout * m_layout
 Layout of this widget. More...
 
QWidget * m_panel
 The panel widget using m_layout. More...
 

Private Slots

void handleVisibilityChange (bool visible)
 If the dock widget changes its visibility. More...
 

Private Attributes

WQtGLWidgetm_glWidget
 My GL widget. More...
 
QString m_dockTitle
 The view name and dock title. More...
 
WQtGLScreenCapturem_screenCapture
 Manager for screen capturing of this view. More...
 
bool m_saveViewerSettings
 If true, the saveSettings method also saves the WGEViewer properties. More...
 
QToolButton * m_presetBtn
 Camera presets. More...
 

Detailed Description

Dock widget containing only a GLWidget.

Definition at line 46 of file WQtGLDockWidget.h.

Constructor & Destructor Documentation

◆ WQtGLDockWidget()

WQtGLDockWidget::WQtGLDockWidget ( QString  viewTitle,
QString  dockTitle,
QWidget *  parent,
WGECamera::ProjectionMode  projectionMode = WGECamera::ORTHOGRAPHIC,
const QWidget *  shareWidget = 0 
)

default constructor

Parameters
viewTitleTitle will be used as view title
dockTitleThe title of the dock widget.
parentThe widget that manages this widget
projectionModeThe projection mode used in the GL widget.
shareWidgetthis widget will share OpenGL display lists and texture objects with shareWidget

Definition at line 52 of file WQtGLDockWidget.cpp.

References WQtDockWidget::addTitleButton(), WQtDockWidget::addTitleProperty(), WQtGLWidget::getCameraPresetsMenu(), WQtGLWidget::getCameraResetAction(), WQtGLScreenCapture::getScreenshotTrigger(), WQtGLWidget::getViewer(), handleVisibilityChange(), m_glWidget, m_layout, m_panel, m_presetBtn, and m_screenCapture.

+ Here is the call graph for this function:

◆ ~WQtGLDockWidget()

WQtGLDockWidget::~WQtGLDockWidget ( )
virtual

destructor.

Definition at line 105 of file WQtGLDockWidget.cpp.

References m_screenCapture.

Member Function Documentation

◆ closeEvent()

void WQtGLDockWidget::closeEvent ( QCloseEvent *  event)
protectedvirtual

Called whenever a close event is received.

Parameters
eventthe event.

Reimplemented from WQtDockWidget.

Definition at line 184 of file WQtGLDockWidget.cpp.

References WQtDockWidget::closeEvent(), m_glWidget, and WQtGLWidget::setPaused().

+ Here is the call graph for this function:

◆ forceGLWidgetSize()

void WQtGLDockWidget::forceGLWidgetSize ( size_t  w,
size_t  h 
)

Forces the GL widget to have the desired size.

This is mainly useful for screenshots and similar.

Parameters
wwidth
hheight

Definition at line 202 of file WQtGLDockWidget.cpp.

References wlog::debug(), and m_glWidget.

Referenced by WQtGLScreenCapture::resolutionChange().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getCameraPresetMenu()

QMenu * WQtGLDockWidget::getCameraPresetMenu ( ) const

Get the menu used for camera presets.

Returns
the menu.

Definition at line 244 of file WQtGLDockWidget.cpp.

References WQtGLWidget::getCameraPresetsMenu(), and m_glWidget.

Referenced by WUIQtViewWidget::addCameraPresetGT(), WUIQtViewWidget::clearCameraPresetsGT(), and updateCameraPresetButton().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getDockTitle()

const QString & WQtGLDockWidget::getDockTitle ( ) const

Return the title of the view/dock.

Returns
the title text

Definition at line 218 of file WQtGLDockWidget.cpp.

References m_dockTitle.

Referenced by WQtGLScreenCapture::WQtGLScreenCapture().

+ Here is the caller graph for this function:

◆ getGLWidget()

WQtGLWidget * WQtGLDockWidget::getGLWidget ( ) const

Gets the contained GL widget instance.

Returns
pointer to GL widget

Definition at line 174 of file WQtGLDockWidget.cpp.

References m_glWidget.

Referenced by WUIQtViewWidget::addEventHandler(), WUIQtViewWidget::getViewer(), WUIQtViewWidget::height(), WUIQtViewWidget::realizeImpl(), WQtNavGLWidget::setSliderProperty(), WMainWindow::setupGUI(), WUIQtViewWidget::width(), and WQtNavGLWidget::WQtNavGLWidget().

+ Here is the caller graph for this function:

◆ getSaveViewerSettings()

bool WQtGLDockWidget::getSaveViewerSettings ( ) const

Check whether the automatic saving of WGEViewer properties is enabled.

Returns
true if enabled.

Definition at line 169 of file WQtGLDockWidget.cpp.

References m_saveViewerSettings.

◆ getScreenCapture()

WQtGLScreenCapture * WQtGLDockWidget::getScreenCapture ( )

Adds a screen capture dock using this view's screen capture callback.

Returns
the capture dock instance.

Definition at line 197 of file WQtGLDockWidget.cpp.

References m_screenCapture.

◆ handleVisibilityChange

void WQtGLDockWidget::handleVisibilityChange ( bool  visible)
privateslot

If the dock widget changes its visibility.

Parameters
visibleif true, the dock is visible

Definition at line 179 of file WQtGLDockWidget.cpp.

References WQtGLWidget::getViewer(), and m_glWidget.

Referenced by WQtGLDockWidget().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ openScreenCaptureConfig

void WQtGLDockWidget::openScreenCaptureConfig ( )
slot

Open screen capture config options.

Definition at line 223 of file WQtGLDockWidget.cpp.

References m_screenCapture.

◆ restoreGLWidgetSize()

void WQtGLDockWidget::restoreGLWidgetSize ( )

Restores the GL widget size if it was fixed with forceMainGLWidgetSize() previously.

Definition at line 208 of file WQtGLDockWidget.cpp.

References m_glWidget, and m_panel.

Referenced by WQtGLScreenCapture::resolutionChange().

+ Here is the caller graph for this function:

◆ restoreSettings()

void WQtGLDockWidget::restoreSettings ( )
virtual

Restore settings.

Reimplemented from WQtDockWidget.

Definition at line 129 of file WQtGLDockWidget.cpp.

References WMainWindow::getSettings(), WQtGLWidget::getViewer(), m_dockTitle, m_glWidget, m_saveViewerSettings, m_screenCapture, WQtDockWidget::restoreSettings(), and WQtGLScreenCapture::restoreSettings().

Referenced by WMainWindow::setupGUI().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ saveSettings()

void WQtGLDockWidget::saveSettings ( )
virtual

Save settings.

Reimplemented from WQtDockWidget.

Definition at line 112 of file WQtGLDockWidget.cpp.

References WQtGLWidget::getViewer(), m_dockTitle, m_glWidget, m_saveViewerSettings, m_screenCapture, WQtDockWidget::saveSettings(), WQtGLScreenCapture::saveSettings(), and WMainWindow::setSetting().

+ Here is the call graph for this function:

◆ setSaveViewerSettings()

void WQtGLDockWidget::setSaveViewerSettings ( bool  enable = true)

Allow turning the automatic save and restore of viewer-settings.

Parameters
enabletrue to enable

Definition at line 164 of file WQtGLDockWidget.cpp.

References m_saveViewerSettings.

Referenced by WUIQtViewWidget::realizeImpl().

+ Here is the caller graph for this function:

◆ showEvent()

void WQtGLDockWidget::showEvent ( QShowEvent *  event)
protectedvirtual

Called whenever the widget gets opened.

Parameters
eventthe event

Definition at line 191 of file WQtGLDockWidget.cpp.

References m_glWidget, and WQtGLWidget::setPaused().

+ Here is the call graph for this function:

◆ updateCameraPresetButton()

void WQtGLDockWidget::updateCameraPresetButton ( )

Update camera button.

Call this when you modify the camera preset menu.

Definition at line 232 of file WQtGLDockWidget.cpp.

References getCameraPresetMenu(), and m_presetBtn.

Referenced by WUIQtViewWidget::addCameraPresetGT(), and WUIQtViewWidget::clearCameraPresetsGT().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ m_dockTitle

QString WQtGLDockWidget::m_dockTitle
private

The view name and dock title.

Definition at line 184 of file WQtGLDockWidget.h.

Referenced by getDockTitle(), restoreSettings(), and saveSettings().

◆ m_glWidget

WQtGLWidget* WQtGLDockWidget::m_glWidget
private

◆ m_layout

QVBoxLayout* WQtGLDockWidget::m_layout
protected

Layout of this widget.

Use this to extend the dock width other widgets (i.e. PropWidgets).

Definition at line 146 of file WQtGLDockWidget.h.

Referenced by WQtNavGLWidget::removeSliderProperty(), WQtNavGLWidget::setSliderProperty(), and WQtGLDockWidget().

◆ m_panel

QWidget* WQtGLDockWidget::m_panel
protected

The panel widget using m_layout.

Definition at line 151 of file WQtGLDockWidget.h.

Referenced by restoreGLWidgetSize(), and WQtGLDockWidget().

◆ m_presetBtn

QToolButton* WQtGLDockWidget::m_presetBtn
private

Camera presets.

Definition at line 199 of file WQtGLDockWidget.h.

Referenced by updateCameraPresetButton(), and WQtGLDockWidget().

◆ m_saveViewerSettings

bool WQtGLDockWidget::m_saveViewerSettings
private

If true, the saveSettings method also saves the WGEViewer properties.

Definition at line 194 of file WQtGLDockWidget.h.

Referenced by getSaveViewerSettings(), restoreSettings(), saveSettings(), and setSaveViewerSettings().

◆ m_screenCapture

WQtGLScreenCapture* WQtGLDockWidget::m_screenCapture
private

Manager for screen capturing of this view.

Definition at line 189 of file WQtGLDockWidget.h.

Referenced by getScreenCapture(), openScreenCaptureConfig(), restoreSettings(), saveSettings(), WQtGLDockWidget(), and ~WQtGLDockWidget().


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