17 #ifndef SLICENAVIGATIONCONTROLLER_H_HEADER_INCLUDED_C1C55A2F
18 #define SLICENAVIGATIONCONTROLLER_H_HEADER_INCLUDED_C1C55A2F
25 #pragma GCC visibility push(default)
26 #include <itkEventObject.h>
27 #pragma GCC visibility pop
30 #include <itkCommand.h>
37 #define mitkTimeSlicedGeometryEventMacro(classname, super) \
38 class MITKCORE_EXPORT DEPRECATED(classname) : public super \
41 typedef classname Self; \
42 typedef super Superclass; \
43 classname(TimeGeometry *aTimeGeometry, unsigned int aPos) : Superclass(aTimeGeometry, aPos) {} \
44 virtual ~classname() {} \
45 virtual const char *GetEventName() const { return #classname; } \
46 virtual bool CheckEvent(const ::itk::EventObject *e) const { return dynamic_cast<const Self *>(e); } \
47 virtual ::itk::EventObject *MakeObject() const { return new Self(GetTimeGeometry(), GetPos()); } \
49 void operator=(const Self &); \
52 #define mitkTimeGeometryEventMacro(classname, super) \
53 class MITKCORE_EXPORT classname : public super \
56 typedef classname Self; \
57 typedef super Superclass; \
58 classname(TimeGeometry *aTimeGeometry, unsigned int aPos) : Superclass(aTimeGeometry, aPos) {} \
59 virtual ~classname() {} \
60 virtual const char *GetEventName() const { return #classname; } \
61 virtual bool CheckEvent(const ::itk::EventObject *e) const { return dynamic_cast<const Self *>(e); } \
62 virtual ::itk::EventObject *MakeObject() const { return new Self(GetTimeGeometry(), GetPos()); } \
64 void operator=(const Self &); \
215 itkSetEnumMacro(ViewDirection, ViewDirection);
216 itkGetEnumMacro(ViewDirection, ViewDirection);
228 itkSetEnumMacro(DefaultViewDirection, ViewDirection);
229 itkGetEnumMacro(DefaultViewDirection, ViewDirection);
231 const char *GetViewDirectionAsString()
const;
233 virtual void SetViewDirectionToDefault();
247 virtual void Update(ViewDirection viewDirection,
bool top =
true,
bool frontside =
true,
bool rotated =
false);
255 virtual void SendCreatedWorldGeometry();
261 virtual void SendCreatedWorldGeometryUpdate();
269 virtual void SendSlice();
277 virtual void SendTime();
287 #pragma GCC visibility push(default)
289 #pragma GCC visibility pop
299 virtual const char *
GetEventName()
const override {
return "TimeGeometryEvent"; }
300 virtual bool CheckEvent(const ::itk::EventObject *e)
const override {
return dynamic_cast<const Self *
>(e); }
301 virtual ::itk::EventObject *
MakeObject()
const override {
return new Self(m_TimeGeometry, m_Pos); }
303 unsigned int GetPos()
const {
return m_Pos; }
308 void operator=(
const Self &);
322 template <
typename T>
327 eventReceptorCommand->SetCallbackFunction(receiver, &T::SetGeometry);
328 unsigned long tag = AddObserver(
GeometrySendEvent(
nullptr, 0), eventReceptorCommand);
329 m_ReceiverToObserverTagsMap[
static_cast<void *
>(receiver)].push_back(tag);
332 template <
typename T>
337 eventReceptorCommand->SetCallbackFunction(receiver, &T::UpdateGeometry);
339 m_ReceiverToObserverTagsMap[
static_cast<void *
>(receiver)].push_back(tag);
342 template <
typename T>
347 eventReceptorCommand->SetCallbackFunction(receiver, &T::SetGeometrySlice);
348 unsigned long tag = AddObserver(
GeometrySliceEvent(
nullptr, 0), eventReceptorCommand);
349 m_ReceiverToObserverTagsMap[
static_cast<void *
>(receiver)].push_back(tag);
350 if (connectSendEvent)
351 ConnectGeometrySendEvent(receiver);
354 template <
typename T>
359 eventReceptorCommand->SetCallbackFunction(receiver, &T::SetGeometryTime);
360 unsigned long tag = AddObserver(
GeometryTimeEvent(
nullptr, 0), eventReceptorCommand);
361 m_ReceiverToObserverTagsMap[
static_cast<void *
>(receiver)].push_back(tag);
362 if (connectSendEvent)
363 ConnectGeometrySendEvent(receiver);
366 template <
typename T>
370 ConnectGeometrySliceEvent(receiver,
false);
371 ConnectGeometryTimeEvent(receiver);
375 template <
typename T>
378 auto i = m_ReceiverToObserverTagsMap.find(static_cast<void *>(receiver));
379 if (i == m_ReceiverToObserverTagsMap.end())
381 const std::list<unsigned long> &tags = i->second;
382 for (
auto tagIter = tags.begin(); tagIter != tags.end(); ++tagIter)
384 RemoveObserver(*tagIter);
386 m_ReceiverToObserverTagsMap.erase(i);
396 virtual void SetGeometry(
const itk::EventObject &geometrySliceEvent);
402 virtual void SetGeometrySlice(
const itk::EventObject &geometrySliceEvent);
408 virtual void SetGeometryTime(
const itk::EventObject &geometryTimeEvent);
447 void ExecuteOperation(
Operation *operation)
override;
454 itkSetMacro(SliceLocked,
bool);
455 itkGetMacro(SliceLocked,
bool);
456 itkBooleanMacro(SliceLocked);
464 itkSetMacro(SliceRotationLocked,
bool);
465 itkGetMacro(SliceRotationLocked,
bool);
466 itkBooleanMacro(SliceRotationLocked);
472 void AdjustSliceStepperRange();
490 itkSetMacro(Top,
bool);
491 itkGetMacro(Top,
bool);
492 itkBooleanMacro(Top);
494 itkSetMacro(FrontSide,
bool);
495 itkGetMacro(FrontSide,
bool);
496 itkBooleanMacro(FrontSide);
498 itkSetMacro(Rotated,
bool);
499 itkGetMacro(Rotated,
bool);
500 itkBooleanMacro(Rotated);
#define mitkTimeGeometryEventMacro(classname, super)
ViewDirection m_DefaultViewDirection
itk::SmartPointer< Self > Pointer
void Disconnect(T *receiver)
virtual const char * GetEventName() const override
Baseclass for renderer slice-/camera-control.
Base class of all Operation-classes.
mitk::TimeGeometry::Pointer m_CreatedWorldGeometry
ViewDirection m_ViewDirection
virtual bool CheckEvent(const ::itk::EventObject *e) const override
Organizes the rendering process.
static void Update(vtkPolyData *)
DataCollection - Class to facilitate loading/accessing structured data.
std::map< void *, std::list< unsigned long > > ObserverTagsMapType
TimeGeometryEvent(TimeGeometry *aTimeGeometry, unsigned int aPos)
TimeGeometry * GetTimeGeometry() const
void ConnectGeometrySliceEvent(T *receiver, bool connectSendEvent=true)
Controls the selection of the slice the associated BaseRenderer will display.
void ConnectGeometryTimeEvent(T *receiver, bool connectSendEvent=true)
void ConnectGeometrySendEvent(T *receiver)
mitk::BaseRenderer * m_Renderer
void ConnectGeometryUpdateEvent(T *receiver)
Manager for coordinating the rendering process.
#define mitkClassMacro(className, SuperClassName)
bool m_SliceRotationLocked
Event/message/notification class.
unsigned int GetPos() const
itkEventMacro(ContourModelEvent, itk::AnyEvent)
virtual ::itk::EventObject * MakeObject() const override
void ConnectGeometryEvents(T *receiver)
mitk::BaseGeometry::ConstPointer m_InputWorldGeometry3D
mitk::TimeGeometry::ConstPointer m_InputWorldTimeGeometry
Describes a two-dimensional, rectangular plane.
mitk::RenderingManager::Pointer m_RenderingManager
virtual ~TimeGeometryEvent()
Message crosshairPositionEvent
ViewDirection
Possible view directions, Original will uses the PlaneGeometry instances in a SlicedGeometry3D provid...
BaseGeometry Describes the geometry of a data object.
ObserverTagsMapType m_ReceiverToObserverTagsMap
static itkEventMacro(BoundingShapeInteractionEvent, itk::AnyEvent) class MITKBOUNDINGSHAPE_EXPORT BoundingShapeInteractor Pointer New()
Basic interaction methods for mitk::GeometryData.