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

This class is a screen recorder adapter in QT. More...

#include <WQtGLScreenCapture.h>

+ Inheritance diagram for WQtGLScreenCapture:
+ Collaboration diagram for WQtGLScreenCapture:

Public Member Functions

 WQtGLScreenCapture (WQtGLDockWidget *parent)
 Creates screen capture gui for the specified capture callback of a certain view. More...
 
virtual ~WQtGLScreenCapture ()
 Destructor. More...
 
QActiongetScreenshotTrigger () const
 Returns the trigger used for screenshotting. More...
 
virtual void saveSettings ()
 Save settings. More...
 
virtual void restoreSettings ()
 Restore settings. More...
 

Protected Member Functions

virtual bool event (QEvent *event)
 Custom event dispatcher. More...
 

Private Slots

void screenShot ()
 Initiates taking a screenshot. More...
 
void startRec ()
 Slot triggered by m_moveRecButton. More...
 
void stopRec ()
 Slot triggered by m_moveStopButton. More...
 
void resetFrames ()
 Slot triggered by m_configFrameResetButton. More...
 
void toolBoxChanged (int index)
 Someone changed the open tab in the toolbox. More...
 
void resolutionChange (bool force)
 Changes resolution of gl widget. More...
 

Private Member Functions

void recCallback ()
 Called by the screencapture callback to notify this widget about recording. More...
 
void handleImage (size_t framesLeft, size_t totalFrames, osg::ref_ptr< osg::Image > image) const
 The function handles new images. More...
 

Private Attributes

WQtGLDockWidgetm_glDockWidget
 My parent. More...
 
WGEViewer::SPtr m_viewer
 The actual screen capture instance. More...
 
boost::signals2::connection m_recordConnection
 Recording - callback connection. More...
 
boost::signals2::connection m_imageConnection
 New image incoming - callback connection to handleImage. More...
 
QToolBox * m_toolbox
 The toolbox containing all the stuff. More...
 
QWidget * m_configWidget
 The configuration widget. More...
 
QLineEdit * m_configFileEdit
 The filename for the screenshot. More...
 
QLabel * m_configFrameLabel
 Shows recorded frames. More...
 
QPushButton * m_configFrameResetButton
 Triggers frame counter reset. More...
 
QWidget * m_screenshotWidget
 Widget containing all the widgets to control movie recording. More...
 
QPushButton * m_screenshotButton
 The trigger which triggers the screenshot. More...
 
QActionm_screenshotAction
 This action triggers a screenshot. More...
 
QLabel * m_movieTimeLabel
 Shows recorded time in movie-time. More...
 
QWidget * m_movieWidget
 Widget containing all the widgets to control movie recording. More...
 
QPushButton * m_movieRecButton
 record button More...
 
QPushButton * m_movieStopButton
 stop button More...
 
QComboBox * m_resolutionCombo
 Stores the resolution the user wants to have. More...
 
QLineEdit * m_customWidth
 Widget for entering a custom resolution width. More...
 
QLineEdit * m_customHeight
 Widget for entering a custom resolution height. More...
 

Detailed Description

This class is a screen recorder adapter in QT.

It uses WGEScreenCapture and provides a nice widget around it.

Definition at line 52 of file WQtGLScreenCapture.h.

Constructor & Destructor Documentation

◆ WQtGLScreenCapture()

WQtGLScreenCapture::WQtGLScreenCapture ( WQtGLDockWidget parent)
explicit

◆ ~WQtGLScreenCapture()

WQtGLScreenCapture::~WQtGLScreenCapture ( )
virtual

Destructor.

Cleans up.

Definition at line 213 of file WQtGLScreenCapture.cpp.

References m_imageConnection, and m_recordConnection.

Member Function Documentation

◆ event()

bool WQtGLScreenCapture::event ( QEvent event)
protectedvirtual

Custom event dispatcher.

Gets called by QT's Event system every time an event got sent to this widget. This event handler processes several custom events, like WModuleAssocEvent.

Note
QT Doc says: use event() for custom events.
Parameters
eventthe event that got transmitted.
Returns
true if the event got handled properly.

Definition at line 264 of file WQtGLScreenCapture.cpp.

References m_configFrameLabel, m_configWidget, m_movieRecButton, m_movieStopButton, m_movieTimeLabel, m_screenshotWidget, and m_viewer.

◆ getScreenshotTrigger()

QAction * WQtGLScreenCapture::getScreenshotTrigger ( ) const

Returns the trigger used for screenshotting.

Returns
the action.

Definition at line 236 of file WQtGLScreenCapture.cpp.

References m_screenshotAction.

Referenced by WQtGLDockWidget::WQtGLDockWidget().

+ Here is the caller graph for this function:

◆ handleImage()

void WQtGLScreenCapture::handleImage ( size_t  framesLeft,
size_t  totalFrames,
osg::ref_ptr< osg::Image >  image 
) const
private

The function handles new images.

Implement it.

Parameters
framesLefthow much frames to come
totalFramesthe total number of frames until now
imagethe image

Definition at line 241 of file WQtGLScreenCapture.cpp.

References wlog::info(), and m_configFileEdit.

Referenced by WQtGLScreenCapture().

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

◆ recCallback()

void WQtGLScreenCapture::recCallback ( )
private

Called by the screencapture callback to notify this widget about recording.

Definition at line 328 of file WQtGLScreenCapture.cpp.

Referenced by WQtGLScreenCapture().

+ Here is the caller graph for this function:

◆ resetFrames

void WQtGLScreenCapture::resetFrames ( )
privateslot

Slot triggered by m_configFrameResetButton.

Definition at line 322 of file WQtGLScreenCapture.cpp.

References wlog::debug(), and m_viewer.

Referenced by WQtGLScreenCapture().

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

◆ resolutionChange

void WQtGLScreenCapture::resolutionChange ( bool  force)
privateslot

Changes resolution of gl widget.

Parameters
forceif true, the resolution is set. If not, it gets restored.

Definition at line 338 of file WQtGLScreenCapture.cpp.

References wlog::debug(), WQtGLDockWidget::forceGLWidgetSize(), m_customHeight, m_customWidth, m_glDockWidget, m_resolutionCombo, and WQtGLDockWidget::restoreGLWidgetSize().

Referenced by WQtGLScreenCapture().

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

◆ restoreSettings()

void WQtGLScreenCapture::restoreSettings ( )
virtual

Restore settings.

Definition at line 228 of file WQtGLScreenCapture.cpp.

References WQtGui::getSettings(), m_configFileEdit, m_customHeight, m_customWidth, and m_resolutionCombo.

Referenced by WQtGLDockWidget::restoreSettings().

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

◆ saveSettings()

void WQtGLScreenCapture::saveSettings ( )
virtual

Save settings.

Definition at line 220 of file WQtGLScreenCapture.cpp.

References WQtGui::getSettings(), m_configFileEdit, m_customHeight, m_customWidth, and m_resolutionCombo.

Referenced by WQtGLDockWidget::saveSettings().

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

◆ screenShot

void WQtGLScreenCapture::screenShot ( )
privateslot

Initiates taking a screenshot.

Definition at line 305 of file WQtGLScreenCapture.cpp.

References m_viewer.

Referenced by WQtGLScreenCapture().

+ Here is the caller graph for this function:

◆ startRec

void WQtGLScreenCapture::startRec ( )
privateslot

Slot triggered by m_moveRecButton.

Definition at line 310 of file WQtGLScreenCapture.cpp.

References wlog::info(), and m_viewer.

Referenced by WQtGLScreenCapture().

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

◆ stopRec

void WQtGLScreenCapture::stopRec ( )
privateslot

Slot triggered by m_moveStopButton.

Definition at line 316 of file WQtGLScreenCapture.cpp.

References wlog::info(), and m_viewer.

Referenced by WQtGLScreenCapture().

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

◆ toolBoxChanged

void WQtGLScreenCapture::toolBoxChanged ( int  index)
privateslot

Someone changed the open tab in the toolbox.

Parameters
indexthe new index

Definition at line 333 of file WQtGLScreenCapture.cpp.

Referenced by WQtGLScreenCapture().

+ Here is the caller graph for this function:

Member Data Documentation

◆ m_configFileEdit

QLineEdit* WQtGLScreenCapture::m_configFileEdit
private

The filename for the screenshot.

Definition at line 181 of file WQtGLScreenCapture.h.

Referenced by handleImage(), restoreSettings(), saveSettings(), and WQtGLScreenCapture().

◆ m_configFrameLabel

QLabel* WQtGLScreenCapture::m_configFrameLabel
private

Shows recorded frames.

Definition at line 186 of file WQtGLScreenCapture.h.

Referenced by event(), and WQtGLScreenCapture().

◆ m_configFrameResetButton

QPushButton* WQtGLScreenCapture::m_configFrameResetButton
private

Triggers frame counter reset.

Definition at line 191 of file WQtGLScreenCapture.h.

Referenced by WQtGLScreenCapture().

◆ m_configWidget

QWidget* WQtGLScreenCapture::m_configWidget
private

The configuration widget.

It contains the common config stuff

Definition at line 176 of file WQtGLScreenCapture.h.

Referenced by event(), and WQtGLScreenCapture().

◆ m_customHeight

QLineEdit* WQtGLScreenCapture::m_customHeight
private

Widget for entering a custom resolution height.

Definition at line 234 of file WQtGLScreenCapture.h.

Referenced by resolutionChange(), restoreSettings(), saveSettings(), and WQtGLScreenCapture().

◆ m_customWidth

QLineEdit* WQtGLScreenCapture::m_customWidth
private

Widget for entering a custom resolution width.

Definition at line 229 of file WQtGLScreenCapture.h.

Referenced by resolutionChange(), restoreSettings(), saveSettings(), and WQtGLScreenCapture().

◆ m_glDockWidget

WQtGLDockWidget* WQtGLScreenCapture::m_glDockWidget
private

My parent.

Definition at line 137 of file WQtGLScreenCapture.h.

Referenced by resolutionChange().

◆ m_imageConnection

boost::signals2::connection WQtGLScreenCapture::m_imageConnection
private

New image incoming - callback connection to handleImage.

Definition at line 166 of file WQtGLScreenCapture.h.

Referenced by WQtGLScreenCapture(), and ~WQtGLScreenCapture().

◆ m_movieRecButton

QPushButton* WQtGLScreenCapture::m_movieRecButton
private

record button

Definition at line 218 of file WQtGLScreenCapture.h.

Referenced by event(), and WQtGLScreenCapture().

◆ m_movieStopButton

QPushButton* WQtGLScreenCapture::m_movieStopButton
private

stop button

Definition at line 219 of file WQtGLScreenCapture.h.

Referenced by event(), and WQtGLScreenCapture().

◆ m_movieTimeLabel

QLabel* WQtGLScreenCapture::m_movieTimeLabel
private

Shows recorded time in movie-time.

Definition at line 211 of file WQtGLScreenCapture.h.

Referenced by event(), and WQtGLScreenCapture().

◆ m_movieWidget

QWidget* WQtGLScreenCapture::m_movieWidget
private

Widget containing all the widgets to control movie recording.

Definition at line 216 of file WQtGLScreenCapture.h.

Referenced by WQtGLScreenCapture().

◆ m_recordConnection

boost::signals2::connection WQtGLScreenCapture::m_recordConnection
private

Recording - callback connection.

Definition at line 161 of file WQtGLScreenCapture.h.

Referenced by WQtGLScreenCapture(), and ~WQtGLScreenCapture().

◆ m_resolutionCombo

QComboBox* WQtGLScreenCapture::m_resolutionCombo
private

Stores the resolution the user wants to have.

Definition at line 224 of file WQtGLScreenCapture.h.

Referenced by resolutionChange(), restoreSettings(), saveSettings(), and WQtGLScreenCapture().

◆ m_screenshotAction

QAction* WQtGLScreenCapture::m_screenshotAction
private

This action triggers a screenshot.

Definition at line 206 of file WQtGLScreenCapture.h.

Referenced by getScreenshotTrigger(), and WQtGLScreenCapture().

◆ m_screenshotButton

QPushButton* WQtGLScreenCapture::m_screenshotButton
private

The trigger which triggers the screenshot.

Definition at line 201 of file WQtGLScreenCapture.h.

Referenced by WQtGLScreenCapture().

◆ m_screenshotWidget

QWidget* WQtGLScreenCapture::m_screenshotWidget
private

Widget containing all the widgets to control movie recording.

Definition at line 196 of file WQtGLScreenCapture.h.

Referenced by event(), and WQtGLScreenCapture().

◆ m_toolbox

QToolBox* WQtGLScreenCapture::m_toolbox
private

The toolbox containing all the stuff.

Definition at line 171 of file WQtGLScreenCapture.h.

Referenced by WQtGLScreenCapture().

◆ m_viewer

WGEViewer::SPtr WQtGLScreenCapture::m_viewer
private

The actual screen capture instance.

Definition at line 142 of file WQtGLScreenCapture.h.

Referenced by event(), resetFrames(), screenShot(), startRec(), stopRec(), and WQtGLScreenCapture().


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