17 #ifndef BASERENDERER_H_HEADER_INCLUDED_C1CCA0F4
18 #define BASERENDERER_H_HEADER_INCLUDED_C1CCA0F4
30 #include <vtkRenderWindow.h>
31 #include <vtkRenderer.h>
41 class NavigationController;
42 class SliceNavigationController;
43 class CameraRotationController;
44 class CameraController;
47 class BaseLocalStorageHandler;
91 static BaseRenderer *GetInstance(vtkRenderWindow *renWin);
92 static void AddInstance(vtkRenderWindow *renWin,
BaseRenderer *baseRenderer);
93 static void RemoveInstance(vtkRenderWindow *renWin);
96 static vtkRenderWindow *GetRenderWindowByName(
const std::string &name);
98 #pragma GCC visibility push(default)
100 #pragma GCC visibility pop
106 vtkRenderWindow *renWin =
nullptr,
139 virtual void Paint();
143 virtual void Initialize();
147 virtual void Resize(
int w,
int h);
151 virtual void InitRenderer(vtkRenderWindow *renderwindow);
156 virtual void InitSize(
int w,
int h);
161 virtual void DrawOverlayMouse(
Point2D &p2d);
182 virtual void SetWorldGeometry3D(
BaseGeometry *geometry);
195 itkGetConstObjectMacro(CurrentWorldGeometry,
BaseGeometry)
199 itkGetConstObjectMacro(CurrentWorldPlaneGeometry,
PlaneGeometry)
205 return GetCurrentWorldPlaneGeometry();
222 virtual void SetSlice(
unsigned int slice);
234 itkGetConstMacro(Slice,
unsigned int)
241 virtual void SetTimeStep(
unsigned int timeStep);
243 itkGetConstMacro(TimeStep,
unsigned int)
252 int GetTimeStep(
const BaseData *data)
const;
263 virtual void SetGeometry(
const itk::EventObject &geometrySliceEvent);
268 virtual void UpdateGeometry(
const itk::EventObject &geometrySliceEvent);
273 virtual void SetGeometrySlice(
const itk::EventObject &geometrySliceEvent);
278 virtual void SetGeometryTime(
const itk::EventObject &geometryTimeEvent);
283 itkGetObjectMacro(CurrentWorldPlaneGeometryNode,
DataNode)
289 return GetCurrentWorldPlaneGeometryNode();
294 void SendUpdateSlice();
304 return GetCurrentWorldPlaneGeometryUpdateTime();
315 virtual void PickWorldPoint(
const Point2D &diplayPosition,
Point3D &worldPosition)
const = 0;
329 itkGetMacro(MapperID, MapperSlotId) itkGetConstMacro(MapperID, MapperSlotId)
333 itkSetMacro(MapperID, MapperSlotId)
335 virtual
int *GetSize() const;
336 virtual
int *GetViewportSize() const;
343 itkGetMacro(EmptyWorldGeometry,
bool)
347 itkGetMacro(KeepDisplayedRegion,
bool)
350 itkSetMacro(KeepDisplayedRegion,
bool)
357 return m_Name.c_str();
368 const double *GetBounds()
const;
370 void RequestUpdate();
371 void ForceImmediateUpdate();
375 unsigned int GetNumberOfVisibleLODEnabledMappers()
const;
390 void DisplayToWorld(
const Point2D &displayPoint,
Point3D &worldIndex)
const;
395 void DisplayToPlane(
const Point2D &displayPoint,
Point2D &planePointInMM)
const;
400 void WorldToDisplay(
const Point3D &worldIndex,
Point2D &displayPoint)
const;
405 void PlaneToDisplay(
const Point2D &planePointInMM,
Point2D &displayPoint)
const;
407 double GetScaleFactorMMPerDisplayUnit()
const;
409 Point2D GetDisplaySizeInMM()
const;
410 Point2D GetViewportSizeInMM()
const;
414 itkGetConstMacro(ConstrainZoomingAndPanning,
bool) virtual
void SetConstrainZoomingAndPanning(
bool constrain);
428 virtual
void Update() = 0;
430 vtkRenderWindow *m_RenderWindow;
431 vtkRenderer *m_VtkRenderer;
435 MapperSlotId m_MapperID;
447 unsigned long m_LastUpdateTime;
458 virtual
void SetCurrentWorldPlaneGeometry(
PlaneGeometry *geometry2d);
465 virtual void SetCurrentWorldGeometry(
BaseGeometry *geometry);
470 void UpdateOverlays();
501 unsigned int m_Slice;
506 unsigned int m_TimeStep;
510 itk::TimeStamp m_CurrentWorldPlaneGeometryUpdateTime;
514 itk::TimeStamp m_TimeStepUpdateTime;
522 bool m_KeepDisplayedRegion;
525 virtual void PrintSelf(std::ostream &os, itk::Indent indent)
const override;
559 void RemoveAllLocalStorages();
std::map< vtkRenderWindow *, BaseRenderer * > BaseRendererMapType
PlaneGeometryData::Pointer m_CurrentWorldPlaneGeometryData
int GetSizeX() const
get the x_size of the RendererWindow
Data management class that handles 'was created by' relations.
This Class is used to connect a DataStorage with the Dispatcher.
Base of all data objects.
virtual bool SetWorldGeometryToDataStorageBounds()
bool m_ConstrainZoomingAndPanning
virtual DataNode * PickObject(const Point2D &, Point3D &) const
Determines the object (mitk::DataNode) closest to the current position by means of picking...
Organizes the rendering process.
std::set< Mapper * > LODEnabledMappersType
static void Update(vtkPolyData *)
std::list< mitk::BaseLocalStorageHandler * > m_RegisteredLocalStorageHandlers
DataCollection - Class to facilitate loading/accessing structured data.
unsigned long GetCurrentWorldGeometry2DUpdateTime()
Interface for accessing (templated) LocalStorageHandler instances.
static const MapperSlotId defaultMapper
Default mapper id to use.
Controls the selection of the slice the associated BaseRenderer will display.
virtual DataStorage::Pointer GetDataStorage() const
mitk::DataStorage::Pointer m_DataStorage
int MapperSlotId
MapperSlotId defines which kind of mapper (e.g., 2D or 3D) shoud be used.
Manager for coordinating the rendering process.
#define mitkClassMacroItkParent(className, SuperClassName)
static BaseRendererMapType baseRendererMap
unsigned long m_CurrentWorldPlaneGeometryTransformTime
test only
int GetSizeY() const
get the y_size of the RendererWindow
unsigned int m_NumberOfVisibleLODEnabledMappers
itkEventMacro(ContourModelEvent, itk::AnyEvent)
unsigned long GetTimeStepUpdateTime()
Get timestamp of last change of current TimeStep.
This rendering mode enumeration is specified at various constructors of the Renderer and RenderWindow...
static std::string GetName(std::string fileName, std::string suffix)
unsigned long GetCurrentWorldPlaneGeometryUpdateTime()
Get timestamp of last call of SetCurrentWorldPlaneGeometry.
Describes a two-dimensional, rectangular plane.
DataNode::Pointer m_CurrentWorldPlaneGeometryNode
vtkRenderer * GetVtkRenderer() const
bool m_EmptyWorldGeometry
vtkRenderWindow * GetRenderWindow() const
Access the RenderWindow into which this renderer renders.
BaseGeometry Describes the geometry of a data object.
Class for nodes of the DataTree.
controls the camera used by the associated BaseRenderer