Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
QmitkSliceNavigationListener Class Reference

Helper class to allow QmitkAbstractView and derived classes to react on changes of the slice/time navigation. Purpose of the class to be used in view and to give the respective view class (by composition) the posibility to react on changes of the currently selected timepoint or position in the world geometry.
In order to setup this class properly the following things must be regarded: More...

#include <QmitkSliceNavigationListener.h>

Inheritance diagram for QmitkSliceNavigationListener:
Collaboration diagram for QmitkSliceNavigationListener:

Classes

struct  ObserverInfo
 

Public Slots

void RenderWindowPartActivated (mitk::IRenderWindowPart *renderWindowPart)
 
void RenderWindowPartDeactivated (mitk::IRenderWindowPart *renderWindowPart)
 

Signals

void SliceChanged ()
 

Public Member Functions

 QmitkSliceNavigationListener ()
 
More...
 
virtual ~QmitkSliceNavigationListener ()
 

Protected Types

typedef std::multimap< const mitk::SliceNavigationController *, ObserverInfoObserverMapType
 

Protected Slots

void OnSliceChangedDelayed ()
 

Protected Member Functions

void OnSliceChangedInternal (const itk::EventObject &e)
 Calls OnSliceChangedDelayed so the event isn't triggered multiple times. More...
 
void OnSliceNavigationControllerDeleted (const itk::Object *sender, const itk::EventObject &)
 
bool InitObservers ()
 
void RemoveObservers (const mitk::SliceNavigationController *deletedSlicer)
 
void RemoveAllObservers (mitk::IRenderWindowPart *deletedPart=NULL)
 

Protected Attributes

mitk::IRenderWindowPartm_renderWindowPart
 
bool m_PendingSliceChangedEvent
 
ObserverMapType m_ObserverMap
 
bool m_internalUpdateFlag
 Is a visualization currently running? More...
 

Detailed Description

Helper class to allow QmitkAbstractView and derived classes to react on changes of the slice/time navigation. Purpose of the class to be used in view and to give the respective view class (by composition) the posibility to react on changes of the currently selected timepoint or position in the world geometry.
In order to setup this class properly the following things must be regarded:

  • View class must also derive public from mitk::IRenderWindowPartListener
  • View class must implement void RenderWindowPartActivated(mitk::IRenderWindowPart* renderWindowPart) and pass the renderWindowPart to the listener.

    void QmitkMyView::RenderWindowPartActivated(mitk::IRenderWindowPart* renderWindowPart) { this->m_SliceNavigationListener.RenderWindowPartActivated(renderWindowPart); }

  • View class must implement void RenderWindowPartDeactivated(mitk::IRenderWindowPart* renderWindowPart) and pass the renderWindowPart to the listener.

    void QmitkMyView::RenderWindowPartDeactivated(mitk::IRenderWindowPart* renderWindowPart) { this->m_SliceNavigationListener.RenderWindowPartDeactivated(renderWindowPart); }

  • View class must pass its on render window part in its CreateQtPartControl(QWidget* parent)

    this->m_SliceNavigationListener.RenderWindowPartActivated(this->GetRenderWindowPart());

  • View class must connect the SliceChanged signal of the listener as see fit.

Definition at line 64 of file QmitkSliceNavigationListener.h.

Member Typedef Documentation

Constructor & Destructor Documentation

QmitkSliceNavigationListener::QmitkSliceNavigationListener ( )


Definition at line 29 of file QmitkSliceNavigationListener.cpp.

QmitkSliceNavigationListener::~QmitkSliceNavigationListener ( )
virtual

Definition at line 35 of file QmitkSliceNavigationListener.cpp.

References RemoveAllObservers().

Member Function Documentation

bool QmitkSliceNavigationListener::InitObservers ( )
protected

Initializes and sets the observers that are used to monitor changes in the selected position or time point in order to actualize the view.h

Definition at line 90 of file QmitkSliceNavigationListener.cpp.

References mitk::IRenderWindowPart::GetQmitkRenderWindows(), m_ObserverMap, m_renderWindowPart, mitk::New(), OnSliceChangedInternal(), and OnSliceNavigationControllerDeleted().

Referenced by RenderWindowPartActivated().

void QmitkSliceNavigationListener::OnSliceChangedDelayed ( )
protectedslot

Overwrite function to implement the behavior on slice/time changes.

Definition at line 40 of file QmitkSliceNavigationListener.cpp.

References m_PendingSliceChangedEvent, and SliceChanged().

Referenced by OnSliceChangedInternal().

void QmitkSliceNavigationListener::OnSliceChangedInternal ( const itk::EventObject &  e)
protected

Calls OnSliceChangedDelayed so the event isn't triggered multiple times.

Definition at line 47 of file QmitkSliceNavigationListener.cpp.

References m_PendingSliceChangedEvent, and OnSliceChangedDelayed().

Referenced by InitObservers().

void QmitkSliceNavigationListener::OnSliceNavigationControllerDeleted ( const itk::Object *  sender,
const itk::EventObject &   
)
protected

Definition at line 61 of file QmitkSliceNavigationListener.cpp.

References RemoveObservers().

Referenced by InitObservers().

void QmitkSliceNavigationListener::RemoveAllObservers ( mitk::IRenderWindowPart deletedPart = NULL)
protected

Removes all observers of the deletedPart. If null pointer is passed all observers will be removed.

Definition at line 158 of file QmitkSliceNavigationListener.cpp.

References m_ObserverMap.

Referenced by RenderWindowPartDeactivated(), and ~QmitkSliceNavigationListener().

void QmitkSliceNavigationListener::RemoveObservers ( const mitk::SliceNavigationController deletedSlicer)
protected

Definition at line 145 of file QmitkSliceNavigationListener.cpp.

References m_ObserverMap.

Referenced by OnSliceNavigationControllerDeleted().

void QmitkSliceNavigationListener::RenderWindowPartActivated ( mitk::IRenderWindowPart renderWindowPart)
slot

Definition at line 69 of file QmitkSliceNavigationListener.cpp.

References InitObservers(), and m_renderWindowPart.

void QmitkSliceNavigationListener::RenderWindowPartDeactivated ( mitk::IRenderWindowPart renderWindowPart)
slot

Definition at line 84 of file QmitkSliceNavigationListener.cpp.

References m_renderWindowPart, and RemoveAllObservers().

void QmitkSliceNavigationListener::SliceChanged ( )
signal

Referenced by OnSliceChangedDelayed().

Member Data Documentation

bool QmitkSliceNavigationListener::m_internalUpdateFlag
protected

Is a visualization currently running?

Definition at line 118 of file QmitkSliceNavigationListener.h.

ObserverMapType QmitkSliceNavigationListener::m_ObserverMap
protected
bool QmitkSliceNavigationListener::m_PendingSliceChangedEvent
protected
mitk::IRenderWindowPart* QmitkSliceNavigationListener::m_renderWindowPart
protected

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