Allows to play videos with OpenCV. More...
#include <QmitkVideoPlayer.h>
Public Member Functions | |
QmitkVideoPlayer () | |
virtual | ~QmitkVideoPlayer () |
virtual bool | IsExclusiveFunctionality () const |
virtual void | StdMultiWidgetAvailable (QmitkStdMultiWidget &stdMultiWidget) |
Protected Member Functions | |
void | CreateQtPartControl (QWidget *parent) |
Protected Attributes | |
mitk::OpenCVVideoSource::Pointer | m_VideoSource |
QmitkVideoBackground * | m_VideoBackground |
QmitkOpenCVVideoControls * | m_OpenCVVideoControls |
Allows to play videos with OpenCV.
Definition at line 29 of file QmitkVideoPlayer.h.
QmitkVideoPlayer::QmitkVideoPlayer | ( | ) |
Definition at line 24 of file QmitkVideoPlayer.cpp.
: m_VideoSource(0) , m_VideoBackground( new QmitkVideoBackground(m_VideoSource) ) { }
QmitkVideoPlayer::~QmitkVideoPlayer | ( | ) | [virtual] |
Definition at line 31 of file QmitkVideoPlayer.cpp.
{
// save video preferences
}
void QmitkVideoPlayer::CreateQtPartControl | ( | QWidget * | parent ) | [protected, virtual] |
Implements berry::QtViewPart.
Definition at line 41 of file QmitkVideoPlayer.cpp.
References QmitkFunctionality::GetActiveStdMultiWidget(), m_OpenCVVideoControls, m_VideoBackground, m_VideoSource, and mitk::OpenCVVideoSource::New().
{ // retrieve old preferences m_VideoSource = mitk::OpenCVVideoSource::New(); m_VideoBackground = new QmitkVideoBackground(m_VideoSource); m_VideoBackground->setParent(parent); QVBoxLayout* layout = new QVBoxLayout; m_OpenCVVideoControls = new QmitkOpenCVVideoControls(m_VideoBackground, this->GetActiveStdMultiWidget()); layout->addWidget( m_OpenCVVideoControls ); parent->setLayout( layout ); }
bool QmitkVideoPlayer::IsExclusiveFunctionality | ( | ) | const [virtual] |
Some functionalities need to add special interactors, removes the crosshair from the stdmultiwidget, etc. In this case the functionality has to tidy up when changing to another functionality which also wants to change the "default configuration". In the old Qt3-based version of MITK, two functionalities could never be opened at the same time so that the methods Activated() and Deactivated() were the right place for the functionalitites to add/remove their interactors, etc. This is still true for the new MITK Workbench, but as there can be several functionalities visible at the same time, the behaviour concerning when Activated() and Deactivated() are called has changed:
1. Activated() and Deactivated() are only called if IsExclusiveFunctionality() returns true
2. If only one standalone functionality is or becomes visible, Activated() will be called on that functionality
3. If two or more standalone functionalities are visible, Activated() will be called on the functionality that receives focus, Deactivated() will be called on the one that looses focus, gets hidden or closed
As a consequence of 1. if you overwrite IsExclusiveFunctionality() and let it return false, you signalize the MITK Workbench that this functionality does nothing to the "default configuration" and can easily be visible while other functionalities are also visible.
By default the method returns true.
Reimplemented from QmitkFunctionality.
Definition at line 36 of file QmitkVideoPlayer.cpp.
{ return false; }
void QmitkVideoPlayer::StdMultiWidgetAvailable | ( | QmitkStdMultiWidget & | stdMultiWidget ) | [virtual] |
Called when a StdMultiWidget is available. Should not be used anymore, see GetActiveStdMultiWidget()
Reimplemented from QmitkFunctionality.
Definition at line 56 of file QmitkVideoPlayer.cpp.
References m_OpenCVVideoControls, and QmitkOpenCVVideoControls::SetStdMultiWidget().
{ m_OpenCVVideoControls->SetStdMultiWidget( &stdMultiWidget ); }
Definition at line 42 of file QmitkVideoPlayer.h.
Referenced by CreateQtPartControl(), and StdMultiWidgetAvailable().
QmitkVideoBackground* QmitkVideoPlayer::m_VideoBackground [protected] |
Definition at line 41 of file QmitkVideoPlayer.h.
Referenced by CreateQtPartControl().
Definition at line 40 of file QmitkVideoPlayer.h.
Referenced by CreateQtPartControl().