13 #ifndef mitkBaseRenderer_h
14 #define mitkBaseRenderer_h
29 #include <vtkRenderWindow.h>
30 #include <vtkRenderer.h>
38 class BaseLocalStorageHandler;
40 #pragma GCC visibility push(default)
42 #pragma GCC visibility pop
72 static BaseRenderer* GetInstance(vtkRenderWindow* renderWindow);
73 static void AddInstance(vtkRenderWindow* renderWindow,
BaseRenderer* baseRenderer);
74 static void RemoveInstance(vtkRenderWindow* renderWindow);
77 static vtkRenderWindow* GetRenderWindowByName(
const std::string& name);
82 static BaseRendererMapType GetSpecificRenderWindows(
MapperSlotId mapper);
87 static BaseRendererMapType GetAll2DRenderWindows();
92 static BaseRendererMapType GetAll3DRenderWindows();
96 BaseRenderer(
const char* name =
nullptr, vtkRenderWindow* renderWindow =
nullptr);
98 void RemoveAllLocalStorages();
106 return m_DataStorage.GetPointer();
111 return m_RenderWindow;
116 return m_VtkRenderer;
127 virtual void Resize(
int w,
int h);
133 virtual void InitRenderer(vtkRenderWindow* renderwindow);
138 virtual void InitSize(
int w,
int h);
142 MITK_INFO <<
"BaseRenderer::DrawOverlayMouse() should be in concret implementation OpenGLRenderer." << std::endl;
151 virtual void SetWorldTimeGeometry(
const TimeGeometry* geometry);
152 itkGetConstObjectMacro(WorldTimeGeometry,
TimeGeometry);
166 virtual void SetInteractionReferenceGeometry(
const TimeGeometry* geometry);
171 itkGetConstObjectMacro(InteractionReferenceGeometry,
TimeGeometry);
178 itkGetMacro(ReferenceGeometryAligned,
bool);
183 itkGetConstObjectMacro(CurrentWorldGeometry,
BaseGeometry);
188 itkGetConstObjectMacro(CurrentWorldPlaneGeometry,
PlaneGeometry);
202 virtual void SetSlice(
unsigned int slice);
204 itkGetConstMacro(Slice,
unsigned int);
213 virtual void SetTimeStep(
unsigned int timeStep);
215 itkGetConstMacro(TimeStep,
unsigned int);
235 virtual void SetGeometry(
const itk::EventObject& geometrySliceEvent);
242 virtual void UpdateGeometry(
const itk::EventObject& geometrySliceEvent);
250 virtual void SetGeometrySlice(
const itk::EventObject& geometrySliceEvent);
258 virtual void SetGeometryTime(
const itk::EventObject& geometryTimeEvent);
260 itkGetObjectMacro(CurrentWorldPlaneGeometryNode,
DataNode);
265 void SendUpdateSlice();
270 itkGetMacro(CurrentWorldPlaneGeometryUpdateTime,
unsigned long);
275 itkGetMacro(TimeStepUpdateTime,
unsigned long);
282 virtual void PickWorldPoint(
const Point2D& diplayPosition,
Point3D& worldPosition)
const = 0;
307 virtual int* GetSize()
const;
308 virtual int* GetViewportSize()
const;
314 itkGetMacro(EmptyWorldGeometry,
bool);
320 itkGetMacro(KeepDisplayedRegion,
bool);
321 itkSetMacro(KeepDisplayedRegion,
bool);
328 return m_Name.c_str();
336 return this->GetSize()[0];
344 return this->GetSize()[1];
353 const double* GetBounds()
const;
355 void RequestUpdate();
356 void ForceImmediateUpdate();
362 unsigned int GetNumberOfVisibleLODEnabledMappers()
const;
368 void DisplayToWorld(
const Point2D& displayPoint,
Point3D& worldIndex)
const;
374 void DisplayToPlane(
const Point2D& displayPoint,
Point2D& planePointInMM)
const;
380 void WorldToDisplay(
const Point3D& worldIndex,
Point2D& displayPoint)
const;
386 void WorldToView(
const Point3D& worldIndex,
Point2D& viewPoint)
const;
392 void PlaneToDisplay(
const Point2D& planePointInMM,
Point2D& displayPoint)
const;
398 void PlaneToView(
const Point2D& planePointInMM,
Point2D& viewPoint)
const;
400 double GetScaleFactorMMPerDisplayUnit()
const;
402 Point2D GetDisplaySizeInMM()
const;
403 Point2D GetViewportSizeInMM()
const;
407 itkGetConstMacro(ConstrainZoomingAndPanning,
bool)
408 virtual void SetConstrainZoomingAndPanning(
bool constrain);
414 virtual void Update() = 0;
427 void UpdateCurrentGeometries();
428 virtual void SetCurrentWorldPlaneGeometry(
const PlaneGeometry* geometry2d);
429 virtual void SetCurrentWorldGeometry(
const BaseGeometry *geometry);
471 unsigned int m_Slice;
472 unsigned int m_TimeStep;
474 itk::TimeStamp m_CurrentWorldPlaneGeometryUpdateTime;
475 itk::TimeStamp m_TimeStepUpdateTime;
479 bool m_KeepDisplayedRegion;
480 bool m_ReferenceGeometryAligned;
484 void PrintSelf(std::ostream& os, itk::Indent indent)
const override;