25 #include <QMessageBox>
30 m_PendingSliceChangedEvent(false),
31 m_internalUpdateFlag(false)
77 QMessageBox::information(NULL,
"Error",
"Unable to set up the event observers. The " \
78 "plot will not be triggered on changing the crosshair, " \
79 "position or time step.");
94 typedef QHash<QString, QmitkRenderWindow*> WindowMapType;
97 auto i = windowMap.begin();
99 while (i != windowMap.end())
102 i.value()->GetSliceNavigationController();
104 if (sliceNavController)
109 int tag = sliceNavController->AddObserver(
119 tag = sliceNavController->AddObserver(
128 cmdDelEvent->SetCallbackFunction(
this,
130 tag = sliceNavController->AddObserver(
131 itk::DeleteEvent(), cmdDelEvent);
139 result = result && sliceNavController;
147 std::pair < ObserverMapType::const_iterator, ObserverMapType::const_iterator> obsRange =
150 for (ObserverMapType::const_iterator pos = obsRange.first; pos != obsRange.second; ++pos)
152 pos->second.controller->RemoveObserver(pos->second.observerTag);
162 ObserverMapType::const_iterator delPos = pos++;
164 if (deletedPart == NULL || deletedPart == delPos->second.renderWindowPart)
166 delPos->second.controller->RemoveObserver(delPos->second.observerTag);
173 const std::string& renderWindowName,
mitk::IRenderWindowPart* part) : controller(controller), observerTag(observerTag),
174 renderWindowName(renderWindowName), renderWindowPart(part)
itk::SmartPointer< Self > Pointer
void OnSliceChangedInternal(const itk::EventObject &e)
Calls OnSliceChangedDelayed so the event isn't triggered multiple times.
void RemoveAllObservers(mitk::IRenderWindowPart *deletedPart=NULL)
QmitkSliceNavigationListener()
Interface for a MITK Workbench Part providing a render window.
ObserverInfo(mitk::SliceNavigationController *controller, int observerTag, const std::string &renderWindowName, mitk::IRenderWindowPart *part)
virtual QHash< QString, QmitkRenderWindow * > GetQmitkRenderWindows() const =0
void OnSliceChangedDelayed()
Controls the selection of the slice the associated BaseRenderer will display.
mitk::IRenderWindowPart * m_renderWindowPart
void RenderWindowPartActivated(mitk::IRenderWindowPart *renderWindowPart)
bool m_PendingSliceChangedEvent
void RenderWindowPartDeactivated(mitk::IRenderWindowPart *renderWindowPart)
void RemoveObservers(const mitk::SliceNavigationController *deletedSlicer)
ObserverMapType m_ObserverMap
virtual ~QmitkSliceNavigationListener()
void OnSliceNavigationControllerDeleted(const itk::Object *sender, const itk::EventObject &)
static itkEventMacro(BoundingShapeInteractionEvent, itk::AnyEvent) class MITKBOUNDINGSHAPE_EXPORT BoundingShapeInteractor Pointer New()
Basic interaction methods for mitk::GeometryData.