13 #ifndef mitkBaseRenderer_h
14 #define mitkBaseRenderer_h
28 #include <vtkRenderWindow.h>
29 #include <vtkRenderer.h>
37 class BaseLocalStorageHandler;
39 #pragma GCC visibility push(default)
41 #pragma GCC visibility pop
71 static BaseRenderer* GetInstance(vtkRenderWindow* renderWindow);
72 static void AddInstance(vtkRenderWindow* renderWindow,
BaseRenderer* baseRenderer);
73 static void RemoveInstance(vtkRenderWindow* renderWindow);
76 static vtkRenderWindow* GetRenderWindowByName(
const std::string& name);
81 static BaseRendererMapType GetSpecificRenderWindows(
MapperSlotId mapper);
86 static BaseRendererMapType GetAll2DRenderWindows();
91 static BaseRendererMapType GetAll3DRenderWindows();
95 BaseRenderer(
const char* name =
nullptr, vtkRenderWindow* renderWindow =
nullptr);
97 void RemoveAllLocalStorages();
105 return m_DataStorage.GetPointer();
110 return m_RenderWindow;
115 return m_VtkRenderer;
126 virtual void Resize(
int w,
int h);
132 virtual void InitRenderer(vtkRenderWindow* renderwindow);
137 virtual void InitSize(
int w,
int h);
141 MITK_INFO <<
"BaseRenderer::DrawOverlayMouse() should be in concret implementation OpenGLRenderer." << std::endl;
150 virtual void SetWorldTimeGeometry(
const TimeGeometry* geometry);
151 itkGetConstObjectMacro(WorldTimeGeometry,
TimeGeometry);
165 virtual void SetInteractionReferenceGeometry(
const TimeGeometry* geometry);
170 itkGetConstObjectMacro(InteractionReferenceGeometry,
TimeGeometry);
177 itkGetMacro(ReferenceGeometryAligned,
bool);
182 itkGetConstObjectMacro(CurrentWorldGeometry,
BaseGeometry);
187 itkGetConstObjectMacro(CurrentWorldPlaneGeometry,
PlaneGeometry);
201 virtual void SetSlice(
unsigned int slice);
203 itkGetConstMacro(Slice,
unsigned int);
212 virtual void SetTimeStep(
unsigned int timeStep);
214 itkGetConstMacro(TimeStep,
unsigned int);
234 virtual void SetGeometry(
const itk::EventObject& geometrySliceEvent);
241 virtual void UpdateGeometry(
const itk::EventObject& geometrySliceEvent);
249 virtual void SetGeometrySlice(
const itk::EventObject& geometrySliceEvent);
257 virtual void SetGeometryTime(
const itk::EventObject& geometryTimeEvent);
259 itkGetObjectMacro(CurrentWorldPlaneGeometryNode,
DataNode);
264 void SendUpdateSlice();
269 itkGetMacro(CurrentWorldPlaneGeometryUpdateTime,
unsigned long);
274 itkGetMacro(TimeStepUpdateTime,
unsigned long);
281 virtual void PickWorldPoint(
const Point2D& diplayPosition,
Point3D& worldPosition)
const = 0;
306 virtual int* GetSize()
const;
307 virtual int* GetViewportSize()
const;
313 itkGetMacro(EmptyWorldGeometry,
bool);
319 itkGetMacro(KeepDisplayedRegion,
bool);
320 itkSetMacro(KeepDisplayedRegion,
bool);
327 return m_Name.c_str();
335 return this->GetSize()[0];
343 return this->GetSize()[1];
352 const double* GetBounds()
const;
354 void RequestUpdate();
355 void ForceImmediateUpdate();
361 unsigned int GetNumberOfVisibleLODEnabledMappers()
const;
367 void DisplayToWorld(
const Point2D& displayPoint,
Point3D& worldIndex)
const;
373 void DisplayToPlane(
const Point2D& displayPoint,
Point2D& planePointInMM)
const;
379 void WorldToDisplay(
const Point3D& worldIndex,
Point2D& displayPoint)
const;
385 void WorldToView(
const Point3D& worldIndex,
Point2D& viewPoint)
const;
391 void PlaneToDisplay(
const Point2D& planePointInMM,
Point2D& displayPoint)
const;
397 void PlaneToView(
const Point2D& planePointInMM,
Point2D& viewPoint)
const;
399 double GetScaleFactorMMPerDisplayUnit()
const;
401 Point2D GetDisplaySizeInMM()
const;
402 Point2D GetViewportSizeInMM()
const;
406 itkGetConstMacro(ConstrainZoomingAndPanning,
bool)
407 virtual void SetConstrainZoomingAndPanning(
bool constrain);
413 virtual void Update() = 0;
426 void UpdateCurrentGeometries();
427 virtual void SetCurrentWorldPlaneGeometry(
const PlaneGeometry* geometry2d);
428 virtual void SetCurrentWorldGeometry(
const BaseGeometry *geometry);
470 unsigned int m_Slice;
471 unsigned int m_TimeStep;
473 itk::TimeStamp m_CurrentWorldPlaneGeometryUpdateTime;
474 itk::TimeStamp m_TimeStepUpdateTime;
478 bool m_KeepDisplayedRegion;
479 bool m_ReferenceGeometryAligned;
483 void PrintSelf(std::ostream& os, itk::Indent indent)
const override;