OpenWalnut  1.5.0dev
Public Types | Public Member Functions | Protected Member Functions | List of all members
WUIViewWidget Class Referenceabstract

Custom widget which is created by a module to display custom information. More...

#include <WUIViewWidget.h>

+ Inheritance diagram for WUIViewWidget:
+ Collaboration diagram for WUIViewWidget:

Public Types

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 Member Functions

virtual ~WUIViewWidget ()
 Destructor. More...
 
virtual osg::ref_ptr< WGEGroupNodegetScene () const =0
 Get the scene which is displayed. More...
 
virtual std::shared_ptr< WGEViewergetViewer () const =0
 Get the viewer which is used. More...
 
virtual size_t height () const =0
 Returns the height of the viewport of the camera. More...
 
virtual size_t width () const =0
 Returns the width of the viewport of the camera. More...
 
virtual void addEventHandler (osgGA::GUIEventHandler *handler)=0
 Adds an event handler to the widget's view. More...
 
virtual void clearCameraPresets ()=0
 Remove any pre-existing camera preset. More...
 
virtual void addCameraPreset (WPropTrigger preset, WGEImage::SPtr icon=WGEImage::SPtr())=0
 Add a custom camera preset. More...
 
- Public Member Functions inherited from WUIWidgetBase
virtual ~WUIWidgetBase ()
 Destructor. More...
 
virtual std::string getTitle () const
 Get the title of the widget. More...
 
virtual void show ()=0
 Show this widget if not yet visible. More...
 
virtual void setVisible (bool visible=true)=0
 Hide/show this widget. More...
 
virtual bool isVisible () const =0
 Check if the widget is hidden or not. 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...
 
virtual void addAction (WPropGroup group, WGEImage::SPtr icon=WGEImage::SPtr())=0
 Define a property as action. More...
 
virtual void addAction (WPropTrigger trigger, WGEImage::SPtr icon=WGEImage::SPtr())=0
 Define a property as action. More...
 
virtual void addAction (WPropBool toggle, WGEImage::SPtr icon=WGEImage::SPtr())=0
 Define a property as action. More...
 

Protected Member Functions

 WUIViewWidget (std::string title)
 Constructor. More...
 
- Protected Member Functions inherited from WUIWidgetBase
 WUIWidgetBase (std::string title)
 Default constructor. More...
 
virtual void closeImpl ()=0
 Close the widget. 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...
 

Additional Inherited Members

- Protected Types inherited from WUIWidgetBase
typedef WSharedSequenceContainer< std::vector< WUIWidgetBase::SPtr > > ChildContainer
 Keep track of our child widgets. More...
 

Detailed Description

Custom widget which is created by a module to display custom information.

Note
Please read documentation of WUIWidgetFactory for limitations, requirements and creation of these widgets.

Definition at line 66 of file WUIViewWidget.h.

Member Typedef Documentation

◆ ConstSPtr

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

Abbreviation for a const shared pointer on a instance of this class.

Definition at line 77 of file WUIViewWidget.h.

◆ SPtr

typedef std::shared_ptr< WUIViewWidget > WUIViewWidget::SPtr

Abbreviation for a shared pointer on a instance of this class.

Definition at line 72 of file WUIViewWidget.h.

Constructor & Destructor Documentation

◆ ~WUIViewWidget()

WUIViewWidget::~WUIViewWidget ( )
virtual

Destructor.

Definition at line 34 of file WUIViewWidget.cpp.

◆ WUIViewWidget()

WUIViewWidget::WUIViewWidget ( std::string  title)
explicitprotected

Constructor.

Create a custom widget instance.

Parameters
titlethe title of the widget

Definition at line 29 of file WUIViewWidget.cpp.

Member Function Documentation

◆ addCameraPreset()

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

Add a custom camera preset.

Appends at the end of any pre-existing presets. The presets are not directly specified via a matrix or quaternion. A trigger property allows implementing own callbacks to actually set the preset. This is very useful when using your own osg::CameraManupulator implementation for your view.

Parameters
presetthe trigger to set the preset.
iconoptional icon.

Implemented in WUIQtViewWidget.

◆ addEventHandler()

virtual void WUIViewWidget::addEventHandler ( osgGA::GUIEventHandler *  handler)
pure virtual

Adds an event handler to the widget's view.

Parameters
handlerPointer to the handler.

Implemented in WUIQtViewWidget.

◆ clearCameraPresets()

virtual void WUIViewWidget::clearCameraPresets ( )
pure virtual

Remove any pre-existing camera preset.

Very useful when adding custom presets or presets do not make sense at all.

Implemented in WUIQtViewWidget.

◆ getScene()

virtual osg::ref_ptr< WGEGroupNode > WUIViewWidget::getScene ( ) const
pure virtual

Get the scene which is displayed.

Returns
the scene as osg::ref_ptr

Implemented in WUIQtViewWidget.

◆ getViewer()

virtual std::shared_ptr< WGEViewer > WUIViewWidget::getViewer ( ) const
pure virtual

Get the viewer which is used.

Returns
the viewer as shared_ptr

Implemented in WUIQtViewWidget.

◆ height()

virtual size_t WUIViewWidget::height ( ) const
pure virtual

Returns the height of the viewport of the camera.

Returns
Height in pixels.

Implemented in WUIQtViewWidget.

◆ width()

virtual size_t WUIViewWidget::width ( ) const
pure virtual

Returns the width of the viewport of the camera.

Returns
Width in pixels.

Implemented in WUIQtViewWidget.


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