13 #ifndef BASERENDERER_H_HEADER_INCLUDED_C1CCA0F4 14 #define BASERENDERER_H_HEADER_INCLUDED_C1CCA0F4 26 #include <vtkRenderWindow.h> 27 #include <vtkRenderer.h> 34 class NavigationController;
35 class SliceNavigationController;
36 class CameraRotationController;
37 class CameraController;
40 class BaseLocalStorageHandler;
43 #pragma GCC visibility push(default) 45 #pragma GCC visibility pop 72 static BaseRenderer *GetInstance(vtkRenderWindow *renWin);
73 static void AddInstance(vtkRenderWindow *renWin,
BaseRenderer *baseRenderer);
74 static void RemoveInstance(vtkRenderWindow *renWin);
77 static vtkRenderWindow *GetRenderWindowByName(
const std::string &name);
82 BaseRenderer(
const char *name =
nullptr, vtkRenderWindow *renWin =
nullptr);
123 virtual void Paint();
127 virtual void Initialize();
131 virtual void Resize(
int w,
int h);
135 virtual void InitRenderer(vtkRenderWindow *renderwindow);
140 virtual void InitSize(
int w,
int h);
145 virtual void DrawOverlayMouse(
Point2D &p2d);
166 virtual void SetWorldGeometry3D(
const BaseGeometry *geometry);
169 itkGetConstObjectMacro(WorldTimeGeometry,
TimeGeometry);
173 itkGetConstObjectMacro(CurrentWorldGeometry,
BaseGeometry);
177 itkGetConstObjectMacro(CurrentWorldPlaneGeometry,
PlaneGeometry)
183 return GetCurrentWorldPlaneGeometry();
200 virtual void SetSlice(
unsigned int slice);
202 itkGetConstMacro(Slice,
unsigned int);
209 virtual void SetTimeStep(
unsigned int timeStep);
211 itkGetConstMacro(TimeStep,
unsigned int);
231 virtual void SetGeometry(
const itk::EventObject &geometrySliceEvent);
236 virtual void UpdateGeometry(
const itk::EventObject &geometrySliceEvent);
241 virtual void SetGeometrySlice(
const itk::EventObject &geometrySliceEvent);
246 virtual void SetGeometryTime(
const itk::EventObject &geometryTimeEvent);
251 itkGetObjectMacro(CurrentWorldPlaneGeometryNode,
DataNode)
257 return GetCurrentWorldPlaneGeometryNode();
262 void SendUpdateSlice();
272 return GetCurrentWorldPlaneGeometryUpdateTime();
283 virtual void PickWorldPoint(
const Point2D &diplayPosition,
Point3D &worldPosition)
const = 0;
304 virtual int *GetSize()
const;
305 virtual int *GetViewportSize()
const;
311 itkGetMacro(EmptyWorldGeometry,
bool);
315 itkGetMacro(KeepDisplayedRegion,
bool)
318 itkSetMacro(KeepDisplayedRegion,
bool);
325 return m_Name.c_str();
336 const double *GetBounds()
const;
338 void RequestUpdate();
339 void ForceImmediateUpdate();
343 unsigned int GetNumberOfVisibleLODEnabledMappers()
const;
348 void DisplayToWorld(
const Point2D &displayPoint,
Point3D &worldIndex)
const;
353 void DisplayToPlane(
const Point2D &displayPoint,
Point2D &planePointInMM)
const;
358 void WorldToDisplay(
const Point3D &worldIndex,
Point2D &displayPoint)
const;
363 void WorldToView(
const Point3D &worldIndex,
Point2D &viewPoint)
const;
368 void PlaneToDisplay(
const Point2D &planePointInMM,
Point2D &displayPoint)
const;
373 void PlaneToView(
const Point2D &planePointInMM,
Point2D &viewPoint)
const;
376 double GetScaleFactorMMPerDisplayUnit()
const;
378 Point2D GetDisplaySizeInMM()
const;
379 Point2D GetViewportSizeInMM()
const;
383 itkGetConstMacro(ConstrainZoomingAndPanning,
bool)
virtual void SetConstrainZoomingAndPanning(
bool constrain);
397 virtual void Update() = 0;
423 virtual void SetCurrentWorldPlaneGeometry(
const PlaneGeometry *geometry2d);
430 virtual void SetCurrentWorldGeometry(
const BaseGeometry *geometry);
459 unsigned int m_Slice;
464 unsigned int m_TimeStep;
468 itk::TimeStamp m_CurrentWorldPlaneGeometryUpdateTime;
472 itk::TimeStamp m_TimeStepUpdateTime;
480 bool m_KeepDisplayedRegion;
483 void PrintSelf(std::ostream &os, itk::Indent indent)
const override;
517 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.
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
itkEventMacroDeclaration(BoundingShapeInteractionEvent, itk::AnyEvent)
vtkRenderer * m_VtkRenderer
vtkRenderWindow * m_RenderWindow
static const MapperSlotId defaultMapper
Default mapper id to use.
std::vcl_size_t TimeStepType
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