13 #ifndef BASERENDERER_H_HEADER_INCLUDED_C1CCA0F4 14 #define BASERENDERER_H_HEADER_INCLUDED_C1CCA0F4 26 #include <vtkRenderWindow.h> 27 #include <vtkRenderer.h> 37 class NavigationController;
38 class SliceNavigationController;
39 class CameraRotationController;
40 class CameraController;
43 class BaseLocalStorageHandler;
71 static BaseRenderer *GetInstance(vtkRenderWindow *renWin);
72 static void AddInstance(vtkRenderWindow *renWin,
BaseRenderer *baseRenderer);
73 static void RemoveInstance(vtkRenderWindow *renWin);
76 static vtkRenderWindow *GetRenderWindowByName(
const std::string &name);
78 #pragma GCC visibility push(default) 80 #pragma GCC visibility pop 85 BaseRenderer(
const char *name =
nullptr, vtkRenderWindow *renWin =
nullptr);
126 virtual void Paint();
130 virtual void Initialize();
134 virtual void Resize(
int w,
int h);
138 virtual void InitRenderer(vtkRenderWindow *renderwindow);
143 virtual void InitSize(
int w,
int h);
148 virtual void DrawOverlayMouse(
Point2D &p2d);
169 virtual void SetWorldGeometry3D(
const BaseGeometry *geometry);
178 itkGetConstObjectMacro(WorldTimeGeometry,
TimeGeometry);
182 itkGetConstObjectMacro(CurrentWorldGeometry,
BaseGeometry);
186 itkGetConstObjectMacro(CurrentWorldPlaneGeometry,
PlaneGeometry)
192 return GetCurrentWorldPlaneGeometry();
209 virtual void SetSlice(
unsigned int slice);
211 itkGetConstMacro(Slice,
unsigned int);
218 virtual void SetTimeStep(
unsigned int timeStep);
220 itkGetConstMacro(TimeStep,
unsigned int);
229 int GetTimeStep(
const BaseData *data)
const;
240 virtual void SetGeometry(
const itk::EventObject &geometrySliceEvent);
245 virtual void UpdateGeometry(
const itk::EventObject &geometrySliceEvent);
250 virtual void SetGeometrySlice(
const itk::EventObject &geometrySliceEvent);
255 virtual void SetGeometryTime(
const itk::EventObject &geometryTimeEvent);
260 itkGetObjectMacro(CurrentWorldPlaneGeometryNode,
DataNode)
266 return GetCurrentWorldPlaneGeometryNode();
271 void SendUpdateSlice();
281 return GetCurrentWorldPlaneGeometryUpdateTime();
292 virtual void PickWorldPoint(
const Point2D &diplayPosition,
Point3D &worldPosition)
const = 0;
306 itkGetMacro(MapperID, MapperSlotId);
307 itkGetConstMacro(MapperID, MapperSlotId);
311 virtual void SetMapperID(MapperSlotId
id);
313 virtual int *GetSize()
const;
314 virtual int *GetViewportSize()
const;
320 itkGetMacro(EmptyWorldGeometry,
bool);
324 itkGetMacro(KeepDisplayedRegion,
bool)
327 itkSetMacro(KeepDisplayedRegion,
bool);
334 return m_Name.c_str();
345 const double *GetBounds()
const;
347 void RequestUpdate();
348 void ForceImmediateUpdate();
352 unsigned int GetNumberOfVisibleLODEnabledMappers()
const;
357 void DisplayToWorld(
const Point2D &displayPoint,
Point3D &worldIndex)
const;
362 void DisplayToPlane(
const Point2D &displayPoint,
Point2D &planePointInMM)
const;
367 void WorldToDisplay(
const Point3D &worldIndex,
Point2D &displayPoint)
const;
372 void WorldToView(
const Point3D &worldIndex,
Point2D &viewPoint)
const;
377 void PlaneToDisplay(
const Point2D &planePointInMM,
Point2D &displayPoint)
const;
382 void PlaneToView(
const Point2D &planePointInMM,
Point2D &viewPoint)
const;
385 double GetScaleFactorMMPerDisplayUnit()
const;
387 Point2D GetDisplaySizeInMM()
const;
388 Point2D GetViewportSizeInMM()
const;
392 itkGetConstMacro(ConstrainZoomingAndPanning,
bool)
virtual void SetConstrainZoomingAndPanning(
bool constrain);
406 virtual void Update() = 0;
432 virtual void SetCurrentWorldPlaneGeometry(
const PlaneGeometry *geometry2d);
439 virtual void SetCurrentWorldGeometry(
const BaseGeometry *geometry);
468 unsigned int m_Slice;
473 unsigned int m_TimeStep;
477 itk::TimeStamp m_CurrentWorldPlaneGeometryUpdateTime;
481 itk::TimeStamp m_TimeStepUpdateTime;
489 bool m_KeepDisplayedRegion;
492 void PrintSelf(std::ostream &os, itk::Indent indent)
const override;
526 void RemoveAllLocalStorages();
std::map< vtkRenderWindow *, BaseRenderer * > BaseRendererMapType
PlaneGeometryData::Pointer m_CurrentWorldPlaneGeometryData
Data management class that handles 'was created by' relations.
This Class is used to connect a DataStorage with the Dispatcher.
itkEventMacro(BoundingShapeInteractionEvent, itk::AnyEvent)
static BaseRendererMapType baseRendererMap
Base of all data objects.
vtkRenderer * GetVtkRenderer() const
virtual bool SetWorldGeometryToDataStorageBounds()
bool m_ConstrainZoomingAndPanning
Organizes the rendering process.
std::set< Mapper * > LODEnabledMappersType
std::list< mitk::BaseLocalStorageHandler * > m_RegisteredLocalStorageHandlers
DataCollection - Class to facilitate loading/accessing structured data.
unsigned long GetCurrentWorldGeometry2DUpdateTime()
Interface for accessing (templated) LocalStorageHandler instances.
CameraRotationController::Pointer m_CameraRotationController
unsigned long m_LastUpdateTime
Timestamp of last call of Update().
Controls the selection of the slice the associated BaseRenderer will display.
int GetSizeX() const
get the x_size of the RendererWindow
int MapperSlotId
MapperSlotId defines which kind of mapper (e.g. 2D or 3D) should be used.
#define mitkClassMacroItkParent(className, SuperClassName)
unsigned long m_CurrentWorldPlaneGeometryTransformTime
test only
vtkRenderer * m_VtkRenderer
vtkRenderWindow * m_RenderWindow
static const MapperSlotId defaultMapper
Default mapper id to use.
void SetCurrentWorldGeometry2D(PlaneGeometry *geometry2d)
unsigned int m_NumberOfVisibleLODEnabledMappers
virtual DataNode * PickObject(const Point2D &, Point3D &) const
Determines the object (mitk::DataNode) closest to the current position by means of picking...
vtkRenderWindow * GetRenderWindow() const
Access the RenderWindow into which this renderer renders.
unsigned long GetTimeStepUpdateTime()
Get timestamp of last change of current TimeStep.
DataStorage::Pointer m_DataStorage
The DataStorage that is used for rendering.
ViewDirection
Possible view directions for render windows.
unsigned long GetCurrentWorldPlaneGeometryUpdateTime()
Get timestamp of last call of SetCurrentWorldPlaneGeometry.
Describes a two-dimensional, rectangular plane.
DataNode::Pointer m_CurrentWorldPlaneGeometryNode
itk::SmartPointer< CameraController > m_CameraController
CameraController for 3D rendering.
virtual DataStorage::Pointer GetDataStorage() const
MapperSlotId m_MapperID
MapperSlotId to use. Defines which kind of mapper (e.g., 2D or 3D) shoud be used. ...
bool m_EmptyWorldGeometry
SliceNavigationController::Pointer m_SliceNavigationController
BaseGeometry Describes the geometry of a data object.
const char * GetName() const
get the name of the Renderer
Class for nodes of the DataTree.
int GetSizeY() const
get the y_size of the RendererWindow
controls the camera used by the associated BaseRenderer