Medical Imaging Interaction Toolkit  2022.04.99-01b95b17
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.
It also offers convinient signals that are only triggered when the selected timepoint or the selected possition of the active render window have realy changed.
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 ()
 
void SelectedTimePointChanged (const mitk::TimePointType &newTimePoint)
 
void SelectedPositionChanged (const mitk::Point3D &newPoint)
 

Public Member Functions

 QmitkSliceNavigationListener ()
 
 ~QmitkSliceNavigationListener () override
 
mitk::TimePointType GetCurrentSelectedTimePoint () const
 
mitk::Point3D GetCurrentSelectedPosition () const
 

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=nullptr)
 

Protected Attributes

mitk::IRenderWindowPartm_renderWindowPart
 
bool m_PendingSliceChangedEvent
 
ObserverMapType m_ObserverMap
 
mitk::Point3D m_CurrentSelectedPosition
 
mitk::TimePointType m_CurrentSelectedTimePoint
 

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.
It also offers convinient signals that are only triggered when the selected timepoint or the selected possition of the active render window have realy changed.
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 65 of file QmitkSliceNavigationListener.h.

Member Typedef Documentation

◆ ObserverMapType

Constructor & Destructor Documentation

◆ QmitkSliceNavigationListener()

QmitkSliceNavigationListener::QmitkSliceNavigationListener ( )

◆ ~QmitkSliceNavigationListener()

QmitkSliceNavigationListener::~QmitkSliceNavigationListener ( )
override

Member Function Documentation

◆ GetCurrentSelectedPosition()

mitk::Point3D QmitkSliceNavigationListener::GetCurrentSelectedPosition ( ) const

◆ GetCurrentSelectedTimePoint()

mitk::TimePointType QmitkSliceNavigationListener::GetCurrentSelectedTimePoint ( ) const

◆ InitObservers()

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

◆ OnSliceChangedDelayed

void QmitkSliceNavigationListener::OnSliceChangedDelayed ( )
protectedslot

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

◆ OnSliceChangedInternal()

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

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

◆ OnSliceNavigationControllerDeleted()

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

◆ RemoveAllObservers()

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

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

◆ RemoveObservers()

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

◆ RenderWindowPartActivated

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

◆ RenderWindowPartDeactivated

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

◆ SelectedPositionChanged

void QmitkSliceNavigationListener::SelectedPositionChanged ( const mitk::Point3D newPoint)
signal

Convinience signal that can be used if you are only interested in changes of the current selected position. Changes in time will be ignored.

◆ SelectedTimePointChanged

void QmitkSliceNavigationListener::SelectedTimePointChanged ( const mitk::TimePointType newTimePoint)
signal

Convinience signal that can be used if you are only interested in changes of the current selected time point. Changes in spatial position will be ignored.

◆ SliceChanged

void QmitkSliceNavigationListener::SliceChanged ( )
signal

Signal triggered as soon as there is any change. It may be a change in the position/slice or of the selected timepoint.

Member Data Documentation

◆ m_CurrentSelectedPosition

mitk::Point3D QmitkSliceNavigationListener::m_CurrentSelectedPosition
protected

Definition at line 128 of file QmitkSliceNavigationListener.h.

◆ m_CurrentSelectedTimePoint

mitk::TimePointType QmitkSliceNavigationListener::m_CurrentSelectedTimePoint
protected

Definition at line 129 of file QmitkSliceNavigationListener.h.

◆ m_ObserverMap

ObserverMapType QmitkSliceNavigationListener::m_ObserverMap
protected

Definition at line 126 of file QmitkSliceNavigationListener.h.

◆ m_PendingSliceChangedEvent

bool QmitkSliceNavigationListener::m_PendingSliceChangedEvent
protected

Definition at line 111 of file QmitkSliceNavigationListener.h.

◆ m_renderWindowPart

mitk::IRenderWindowPart* QmitkSliceNavigationListener::m_renderWindowPart
protected

Definition at line 108 of file QmitkSliceNavigationListener.h.


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