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

Implementation of WUIViewWidget. More...

#include <WUIQtViewWidget.h>

+ Inheritance diagram for WUIQtViewWidget:
+ Collaboration diagram for WUIQtViewWidget:

Public Types

typedef std::shared_ptr< WUIQtViewWidgetSPtr
 Convenience typedef for a std::shared_ptr< WUIQtViewWidget >. More...
 
typedef std::shared_ptr< const WUIQtViewWidgetConstSPtr
 Convenience typedef for a std::shared_ptr< const WUIQtViewWidget >. More...
 
- Public Types inherited from WUIViewWidget
typedef std::shared_ptr< WUIViewWidgetSPtr
 Abbreviation for a shared pointer on a instance of this class. More...
 
typedef std::shared_ptr< const WUIViewWidgetConstSPtr
 Abbreviation for a const shared pointer on a instance of this class. More...
 
- Public Types inherited from WUIWidgetBase
typedef std::shared_ptr< WUIWidgetBaseSPtr
 Convenience typedef for a std::shared_ptr< WUIWidgetBase >. More...
 
typedef std::shared_ptr< const WUIWidgetBaseConstSPtr
 Convenience typedef for a std::shared_ptr< const WUIWidgetBase >. More...
 
- Public Types inherited from WUIQtWidgetBase
typedef std::shared_ptr< WUIQtWidgetBaseSPtr
 Convenience typedef for a std::shared_ptr< WUIQtWidgetBase >. More...
 
typedef std::shared_ptr< const WUIQtWidgetBaseConstSPtr
 Convenience typedef for a std::shared_ptr< const WUIQtWidgetBase >. More...
 

Public Member Functions

 WUIQtViewWidget (std::string title, WGECamera::ProjectionMode projectionMode, WMainWindow *mainWindow, WUIQtWidgetBase::SPtr parent=WUIQtWidgetBase::SPtr())
 Default constructor. More...
 
virtual ~WUIQtViewWidget ()
 Destructor. More...
 
virtual QString getTitleQString () const
 Title as QString. More...
 
virtual osg::ref_ptr< WGEGroupNodegetScene () const
 Get the scene which is displayed. More...
 
virtual std::shared_ptr< WGEViewergetViewer () const
 Get the viewer which is used. More...
 
virtual size_t height () const
 Returns the height of the viewport of the camera. More...
 
virtual size_t width () const
 Returns the width of the viewport of the camera. More...
 
virtual void addEventHandler (osgGA::GUIEventHandler *handler)
 Adds an event handler to the widget's view. More...
 
virtual void show ()
 Show this widget if not yet visible. More...
 
virtual void setVisible (bool visible=true)
 Hide/show this widget. More...
 
virtual bool isVisible () const
 Check if the widget is hidden or not. More...
 
virtual void close ()
 Handle shutdown. More...
 
virtual void addAction (WPropGroup group, WGEImage::SPtr icon=WGEImage::SPtr())
 Implement WUIWidgetBase::addAction. More...
 
virtual void addAction (WPropTrigger trigger, WGEImage::SPtr icon=WGEImage::SPtr())
 Implement WUIWidgetBase::addAction. More...
 
virtual void addAction (WPropBool toggle, WGEImage::SPtr icon=WGEImage::SPtr())
 Implement WUIWidgetBase::addAction. More...
 
virtual void clearCameraPresets ()
 Remove any pre-existing camera preset. More...
 
virtual void addCameraPreset (WPropTrigger preset, WGEImage::SPtr icon=WGEImage::SPtr())
 Add a custom camera preset. More...
 
- Public Member Functions inherited from WUIViewWidget
virtual ~WUIViewWidget ()
 Destructor. More...
 
- Public Member Functions inherited from WUIWidgetBase
virtual ~WUIWidgetBase ()
 Destructor. More...
 
virtual std::string getTitle () const
 Get the title of the widget. More...
 
void close ()
 Close the widget. More...
 
bool isClosed () const
 Checks whether the widget was closed already. More...
 
WCondition::SPtr getCloseCondition () const
 Return the condition that fires when the widgets closes. More...
 
virtual WUIWidgetBase::SPtr getParent () const
 Get the parent widget of this widget if any. More...
 
virtual bool allowNesting () const
 Tell the user whether this kind of widget can be used as parent. More...
 
- Public Member Functions inherited from WUIQtWidgetBase
 WUIQtWidgetBase (WMainWindow *mainWindow, WUIQtWidgetBase::SPtr parent)
 Default constructor. More...
 
virtual ~WUIQtWidgetBase ()
 Destructor. More...
 
virtual bool isReal ()
 The widget was created and can be used. More...
 
virtual void realize (WCondition::SPtr abortCondition=WCondition::SPtr())
 Realize the widget. More...
 
QWidget * getWidget () const
 Get the widget representation. More...
 
QWidget * getParentAsQtWidget () const
 Get the parent as Qt widget. More...
 
WUIQtWidgetBase::SPtr getQtParent () const
 Parent widget. More...
 

Protected Member Functions

virtual void realizeImpl ()
 Realize the widget. More...
 
virtual void closeImpl ()
 Close the widget. More...
 
virtual void cleanUpGT ()
 Cleanup the GUI. More...
 
virtual void clearCameraPresetsGT ()
 Remove any pre-existing camera preset. More...
 
virtual void addCameraPresetGT (WPropTrigger preset, WGEImage::SPtr icon=WGEImage::SPtr())
 Add a custom camera preset. More...
 
- Protected Member Functions inherited from WUIViewWidget
 WUIViewWidget (std::string title)
 Constructor. More...
 
- Protected Member Functions inherited from WUIWidgetBase
 WUIWidgetBase (std::string title)
 Default constructor. More...
 
virtual void setParent (WUIWidgetBase::SPtr parent)
 Set the parent of this WUI widget. More...
 
virtual void registerChild (WUIWidgetBase::SPtr child)
 Register widget as child. More...
 
ChildContainergetChildren ()
 Return the list of children. More...
 
const ChildContainergetChildren () const
 Return the list of children. More...
 
void closeChildren ()
 Comfortable function to recurse a close call. More...
 
- Protected Member Functions inherited from WUIQtWidgetBase
virtual void showGT ()
 Show this widget if not yet visible. More...
 
virtual void setVisibleGT (bool visible=true)
 Hide/show this widget. More...
 
virtual bool isVisibleGT () const
 Check if the widget is hidden or not. More...
 
virtual void closeGT ()
 Close the widget. More...
 
QWidget * getCompellingQParent () const
 Returns the parent to use for your implementation in realizeImpl. More...
 
bool hasUIParent () const
 Check if the widget is embedded into another WUI widget. More...
 
QWidget * embedContent (QWidget *content)
 This method can be used if you just create some QWidget and do not want to take care about embedding the content in a dock if there is no parent, setting size constraints and similar. More...
 
virtual void addActionGroupGT (WPropGroup group, WGEImage::SPtr icon=WGEImage::SPtr())
 Implement WUIWidgetBase::addAction. More...
 
virtual void addActionTriggerGT (WPropTrigger trigger, WGEImage::SPtr icon=WGEImage::SPtr())
 Implement WUIWidgetBase::addAction. More...
 
virtual void addActionBoolGT (WPropBool toggle, WGEImage::SPtr icon=WGEImage::SPtr())
 Implement WUIWidgetBase::addAction. More...
 

Private Attributes

WGECamera::ProjectionMode m_projectionMode
 Projection mode of the cam. More...
 
osg::ref_ptr< WGEGroupNodem_scene
 Scene in this view. More...
 
WQtGLDockWidgetm_widgetDock
 The Qt widget representing this abstract widget. More...
 

Additional Inherited Members

- Protected Types inherited from WUIWidgetBase
typedef WSharedSequenceContainer< std::vector< WUIWidgetBase::SPtr > > ChildContainer
 Keep track of our child widgets. More...
 
- Protected Attributes inherited from WUIQtWidgetBase
WMainWindowm_mainWindow
 The main window instance. More...
 
QWidget * m_widget
 The widget representing this abstract UI element. More...
 
WUIQtWidgetBase::SPtr m_parent
 Parent widget. More...
 

Detailed Description

Implementation of WUIViewWidget.

Definition at line 45 of file WUIQtViewWidget.h.

Member Typedef Documentation

◆ ConstSPtr

typedef std::shared_ptr< const WUIQtViewWidget > WUIQtViewWidget::ConstSPtr

Convenience typedef for a std::shared_ptr< const WUIQtViewWidget >.

Definition at line 57 of file WUIQtViewWidget.h.

◆ SPtr

typedef std::shared_ptr< WUIQtViewWidget > WUIQtViewWidget::SPtr

Convenience typedef for a std::shared_ptr< WUIQtViewWidget >.

Definition at line 52 of file WUIQtViewWidget.h.

Constructor & Destructor Documentation

◆ WUIQtViewWidget()

WUIQtViewWidget::WUIQtViewWidget ( std::string  title,
WGECamera::ProjectionMode  projectionMode,
WMainWindow mainWindow,
WUIQtWidgetBase::SPtr  parent = WUIQtWidgetBase::SPtr() 
)

Default constructor.

Parameters
mainWindowthe main window instance
parentthe Qt parent. Can be NULL.
titlethe title of the widget
projectionModethe kind of projection which should be used

Definition at line 37 of file WUIQtViewWidget.cpp.

◆ ~WUIQtViewWidget()

WUIQtViewWidget::~WUIQtViewWidget ( )
virtual

Destructor.

Definition at line 50 of file WUIQtViewWidget.cpp.

Member Function Documentation

◆ addAction() [1/3]

virtual void WUIQtViewWidget::addAction ( WPropBool  toggle,
WGEImage::SPtr  icon = WGEImage::SPtr() 
)
inlinevirtual

Implement WUIWidgetBase::addAction.

Parameters
togglethe property to use.
iconthe icon to use. Consider a minimum size of 32x32.

Reimplemented from WUIQtWidgetBase.

Definition at line 173 of file WUIQtViewWidget.h.

References WUIQtWidgetBase::addAction().

+ Here is the call graph for this function:

◆ addAction() [2/3]

virtual void WUIQtViewWidget::addAction ( WPropGroup  group,
WGEImage::SPtr  icon = WGEImage::SPtr() 
)
inlinevirtual

Implement WUIWidgetBase::addAction.

Parameters
groupthe property to use.
iconthe icon to use. Consider a minimum size of 32x32.

Reimplemented from WUIQtWidgetBase.

Definition at line 151 of file WUIQtViewWidget.h.

References WUIQtWidgetBase::addAction().

+ Here is the call graph for this function:

◆ addAction() [3/3]

virtual void WUIQtViewWidget::addAction ( WPropTrigger  trigger,
WGEImage::SPtr  icon = WGEImage::SPtr() 
)
inlinevirtual

Implement WUIWidgetBase::addAction.

Parameters
triggerthe property to use.
iconthe icon to use. Consider a minimum size of 32x32.

Reimplemented from WUIQtWidgetBase.

Definition at line 162 of file WUIQtViewWidget.h.

References WUIQtWidgetBase::addAction().

+ Here is the call graph for this function:

◆ addCameraPreset()

void WUIQtViewWidget::addCameraPreset ( WPropTrigger  preset,
WGEImage::SPtr  icon = WGEImage::SPtr() 
)
virtual

Add a custom camera preset.

Implements WUIViewWidget::addCameraPreset

Parameters
presetthe trigger to set the preset.
iconoptional icon.

Implements WUIViewWidget.

Definition at line 169 of file WUIQtViewWidget.cpp.

References addCameraPresetGT(), and WQtGui::execInGUIThread().

+ Here is the call graph for this function:

◆ addCameraPresetGT()

void WUIQtViewWidget::addCameraPresetGT ( WPropTrigger  preset,
WGEImage::SPtr  icon = WGEImage::SPtr() 
)
protectedvirtual

Add a custom camera preset.

Implements WUIViewWidget::addCameraPreset

Parameters
presetthe trigger to set the preset.
iconoptional icon.

Definition at line 183 of file WUIQtViewWidget.cpp.

References WIconManager::convertToIcon(), WQtGLDockWidget::getCameraPresetMenu(), WQtGui::getMainWindow(), m_widgetDock, and WQtGLDockWidget::updateCameraPresetButton().

Referenced by addCameraPreset().

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

◆ addEventHandler()

void WUIQtViewWidget::addEventHandler ( osgGA::GUIEventHandler *  handler)
virtual

Adds an event handler to the widget's view.

Parameters
handlerPointer to the handler.

Implements WUIViewWidget.

Definition at line 97 of file WUIQtViewWidget.cpp.

References WQtGLDockWidget::getGLWidget(), WQtGLWidget::getViewer(), and m_widgetDock.

+ Here is the call graph for this function:

◆ cleanUpGT()

void WUIQtViewWidget::cleanUpGT ( )
protectedvirtual

Cleanup the GUI.

Do not delete m_widget, or your content widget. This is done by WUIQtWidgetBase. This method allows you to free resources that are not automatically freed by the Qt delete mechanism.

Implements WUIQtWidgetBase.

Definition at line 121 of file WUIQtViewWidget.cpp.

◆ clearCameraPresets()

void WUIQtViewWidget::clearCameraPresets ( )
virtual

Remove any pre-existing camera preset.

Implements WUIViewWidget::clearCameraPresets.

Implements WUIViewWidget.

Definition at line 164 of file WUIQtViewWidget.cpp.

References clearCameraPresetsGT(), and WQtGui::execInGUIThread().

+ Here is the call graph for this function:

◆ clearCameraPresetsGT()

void WUIQtViewWidget::clearCameraPresetsGT ( )
protectedvirtual

Remove any pre-existing camera preset.

Implements WUIViewWidget::clearCameraPresets.

Definition at line 174 of file WUIQtViewWidget.cpp.

References WQtGLDockWidget::getCameraPresetMenu(), m_widgetDock, and WQtGLDockWidget::updateCameraPresetButton().

Referenced by clearCameraPresets().

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

◆ close()

void WUIQtViewWidget::close ( )
virtual

Handle shutdown.

This includes notification of the creating module and closing the widget. Can be called from any thread. Implement in your implementation.

Implements WUIQtWidgetBase.

Definition at line 126 of file WUIQtViewWidget.cpp.

References WUIWidgetBase::close().

+ Here is the call graph for this function:

◆ closeImpl()

void WUIQtViewWidget::closeImpl ( )
protectedvirtual

Close the widget.

When done, the widget can be safely deleted.

Reimplemented from WUIQtWidgetBase.

Definition at line 132 of file WUIQtViewWidget.cpp.

References WUIQtWidgetBase::closeImpl().

+ Here is the call graph for this function:

◆ getScene()

osg::ref_ptr< WGEGroupNode > WUIQtViewWidget::getScene ( ) const
virtual

Get the scene which is displayed.

Returns
the scene as osg::ref_ptr

Implements WUIViewWidget.

Definition at line 60 of file WUIQtViewWidget.cpp.

References m_scene.

◆ getTitleQString()

QString WUIQtViewWidget::getTitleQString ( ) const
virtual

Title as QString.

Returns
the title

Implements WUIQtWidgetBase.

Definition at line 55 of file WUIQtViewWidget.cpp.

References WUIWidgetBase::getTitle().

+ Here is the call graph for this function:

◆ getViewer()

std::shared_ptr< WGEViewer > WUIQtViewWidget::getViewer ( ) const
virtual

Get the viewer which is used.

Returns
the viewer as shared_ptr

Implements WUIViewWidget.

Definition at line 65 of file WUIQtViewWidget.cpp.

References WQtGLDockWidget::getGLWidget(), WQtGLWidget::getViewer(), and m_widgetDock.

+ Here is the call graph for this function:

◆ height()

size_t WUIQtViewWidget::height ( ) const
virtual

Returns the height of the viewport of the camera.

Returns
Height in pixels.

Implements WUIViewWidget.

Definition at line 71 of file WUIQtViewWidget.cpp.

References WQtGLDockWidget::getGLWidget(), WQtGLWidget::getViewer(), and m_widgetDock.

+ Here is the call graph for this function:

◆ isVisible()

bool WUIQtViewWidget::isVisible ( ) const
virtual

Check if the widget is hidden or not.

Returns
true if visible.

Reimplemented from WUIQtWidgetBase.

Definition at line 116 of file WUIQtViewWidget.cpp.

References WUIQtWidgetBase::isVisible().

+ Here is the call graph for this function:

◆ realizeImpl()

void WUIQtViewWidget::realizeImpl ( )
protectedvirtual

Realize the widget.

This method blocks until the GUI thread created the widget. Called from within the GUI thread! So you can safely do Qt stuff.

Implements WUIQtWidgetBase.

Definition at line 137 of file WUIQtViewWidget.cpp.

References WQtDockWidget::disableCloseButton(), WUIQtWidgetBase::embedContent(), WUIQtWidgetBase::getCompellingQParent(), WQtGLDockWidget::getGLWidget(), WUIQtWidgetBase::getQtParent(), WUIWidgetBase::getTitle(), WQtGLWidget::getViewer(), m_projectionMode, m_scene, m_widgetDock, and WQtGLDockWidget::setSaveViewerSettings().

+ Here is the call graph for this function:

◆ setVisible()

void WUIQtViewWidget::setVisible ( bool  visible = true)
virtual

Hide/show this widget.

Unlike close(), you can show the widget again using show().

Parameters
visiblefalse to hide widget

Reimplemented from WUIQtWidgetBase.

Definition at line 111 of file WUIQtViewWidget.cpp.

References WUIQtWidgetBase::setVisible().

+ Here is the call graph for this function:

◆ show()

void WUIQtViewWidget::show ( )
virtual

Show this widget if not yet visible.

Reimplemented from WUIQtWidgetBase.

Definition at line 106 of file WUIQtViewWidget.cpp.

References WUIQtWidgetBase::show().

+ Here is the call graph for this function:

◆ width()

size_t WUIQtViewWidget::width ( ) const
virtual

Returns the width of the viewport of the camera.

Returns
Width in pixels.

Implements WUIViewWidget.

Definition at line 84 of file WUIQtViewWidget.cpp.

References WQtGLDockWidget::getGLWidget(), WQtGLWidget::getViewer(), and m_widgetDock.

+ Here is the call graph for this function:

Member Data Documentation

◆ m_projectionMode

WGECamera::ProjectionMode WUIQtViewWidget::m_projectionMode
private

Projection mode of the cam.

Definition at line 224 of file WUIQtViewWidget.h.

Referenced by realizeImpl().

◆ m_scene

osg::ref_ptr< WGEGroupNode > WUIQtViewWidget::m_scene
private

Scene in this view.

Definition at line 229 of file WUIQtViewWidget.h.

Referenced by getScene(), and realizeImpl().

◆ m_widgetDock

WQtGLDockWidget* WUIQtViewWidget::m_widgetDock
private

The Qt widget representing this abstract widget.

Note
this is the same pointer as WUIQtWidgetBase::m_widget as WQtGLDockWidget.

Definition at line 235 of file WUIQtViewWidget.h.

Referenced by addCameraPresetGT(), addEventHandler(), clearCameraPresetsGT(), getViewer(), height(), realizeImpl(), and width().


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