13 #ifndef mitkBaseRenderer_h
14 #define mitkBaseRenderer_h
29 #include <vtkRenderWindow.h>
30 #include <vtkRenderer.h>
38 class BaseLocalStorageHandler;
41 #pragma GCC visibility push(default)
45 #pragma GCC visibility pop
148 BaseRenderer(
const char* name =
nullptr, vtkRenderWindow* renderWindow =
nullptr);
183 return m_DataStorage.GetPointer();
192 return m_RenderWindow;
201 return m_VtkRenderer;
240 MITK_INFO <<
"BaseRenderer::DrawOverlayMouse() should be in concret implementation OpenGLRenderer." << std::endl;
276 itkGetMacro(ReferenceGeometryAligned,
bool);
307 itkGetConstMacro(Slice,
unsigned int);
318 itkGetConstMacro(TimeStep,
unsigned int);
338 virtual void SetGeometry(
const itk::EventObject& geometrySliceEvent);
363 itkGetObjectMacro(CurrentWorldPlaneGeometryNode,
DataNode);
373 itkGetMacro(CurrentWorldPlaneGeometryUpdateTime,
unsigned long);
378 itkGetMacro(TimeStepUpdateTime,
unsigned long);
443 itkGetMacro(EmptyWorldGeometry,
bool);
449 itkGetMacro(KeepDisplayedRegion,
bool);
450 itkSetMacro(KeepDisplayedRegion,
bool);
457 return m_Name.c_str();
465 return this->GetSize()[0];
473 return this->GetSize()[1];
583 itkGetConstMacro(ConstrainZoomingAndPanning,
bool)
592 virtual
void SetConstrainZoomingAndPanning(
bool constrain);
598 virtual
void Update() = 0;
600 vtkRenderWindow* m_RenderWindow;
601 vtkRenderer* m_VtkRenderer;
605 unsigned long m_LastUpdateTime;
611 void UpdateCurrentGeometries();
635 TimeGeometry::ConstPointer m_InteractionReferenceGeometry;
655 unsigned int m_Slice;
656 unsigned int m_TimeStep;
658 itk::TimeStamp m_CurrentWorldPlaneGeometryUpdateTime;
659 itk::TimeStamp m_TimeStepUpdateTime;
663 bool m_KeepDisplayedRegion;
664 bool m_ReferenceGeometryAligned;
668 void PrintSelf(std::ostream& os,
itk::Indent indent) const override;
672 unsigned long m_CurrentWorldPlaneGeometryTransformTime;
678 bool m_EmptyWorldGeometry;
682 unsigned int m_NumberOfVisibleLODEnabledMappers;
686 bool m_ConstrainZoomingAndPanning;
Base class of all data objects.
Abstract base class describing the geometry of a data object.
Interface for accessing (templated) LocalStorageHandler instances.
Organizes the rendering process.
void PlaneToDisplay(const Point2D &planePointInMM, Point2D &displayPoint) const
Convert a 2D plane coordinate in millimeters to a 2D display point.
static BaseRendererMapType GetAll2DRenderWindows()
Convenience function: Get a map of all 2D RenderWindows.
static BaseRendererMapType baseRendererMap
Static map holding all registered BaseRenderer instances, keyed by their vtkRenderWindow.
static void AddInstance(vtkRenderWindow *renderWindow, BaseRenderer *baseRenderer)
Register a BaseRenderer instance for the given vtkRenderWindow.
std::map< vtkRenderWindow *, BaseRenderer * > BaseRendererMapType
Map type associating vtkRenderWindow pointers with BaseRenderer pointers.
virtual void SetDataStorage(DataStorage *storage)
Set the DataStorage used by this renderer.
void RemoveAllLocalStorages()
Remove all registered local storages and notify observers via RendererResetEvent.
virtual void PickWorldPoint(const Point2D &diplayPosition, Point3D &worldPosition) const =0
Pick a world coordinate (x,y,z) given a display coordinate (x,y).
Dispatcher::Pointer GetDispatcher() const
Get the dispatcher, which handles events for this base renderer.
void SetSliceNavigationController(SliceNavigationController *SlicenavigationController)
Replace the current SliceNavigationController.
void UnregisterLocalStorageHandler(BaseLocalStorageHandler *lsh)
Unregister a previously registered local storage handler.
void DisplayToPlane(const Point2D &displayPoint, Point2D &planePointInMM) const
Convert a display point to a 2D plane coordinate in millimeters.
virtual void SetSlice(unsigned int slice)
Set the slice that should be used for geometry extraction.
vtkRenderer * GetVtkRenderer() const
Get the underlying vtkRenderer used for VTK rendering.
BaseRenderer(const char *name=nullptr, vtkRenderWindow *renderWindow=nullptr)
Construct a BaseRenderer with an optional name and vtkRenderWindow.
const char * GetName() const
Return the name of the base renderer.
virtual DataStorage::Pointer GetDataStorage() const
Get the DataStorage used by this renderer.
void WorldToDisplay(const Point3D &worldIndex, Point2D &displayPoint) const
Convert a 3D world coordinate to a 2D display point.
void WorldToView(const Point3D &worldIndex, Point2D &viewPoint) const
Convert a 3D world coordinate to a 2D viewport point.
static BaseRenderer * GetByName(const std::string &name)
Find a BaseRenderer by its name.
virtual bool SetWorldGeometryToDataStorageBounds()
Set the world geometry so that it encompasses all objects in the DataStorage.
virtual void SetGeometry(const itk::EventObject &geometrySliceEvent)
Set the world time geometry using the geometry of the given event.
virtual void InitRenderer(vtkRenderWindow *renderwindow)
Initialize the base renderer with a vtk render window.
void SendUpdateSlice()
Modify the update time of the current world plane geometry and force reslicing.
Point2D GetOriginInMM() const
Get the origin of the viewport in plane coordinates (millimeters).
static BaseRenderer * GetInstance(vtkRenderWindow *renderWindow)
Get the BaseRenderer instance associated with the given vtkRenderWindow.
Point2D GetDisplaySizeInMM() const
Get the size of the render window in millimeters.
vtkRenderWindow * GetRenderWindow() const
Get the vtkRenderWindow associated with this renderer.
virtual void SetTimeStep(unsigned int timeStep)
Set the timestep that should be used for geometry extraction.
static void RemoveInstance(vtkRenderWindow *renderWindow)
Remove the BaseRenderer registration for the given vtkRenderWindow.
unsigned int GetNumberOfVisibleLODEnabledMappers() const
Return the number of mappers which are visible and have level-of-detail rendering enabled.
StandardMapperSlot
Defines which kind of mapper (e.g. 2D or 3D) should be used.
double GetScaleFactorMMPerDisplayUnit() const
Get the scale factor relating millimeters to display pixels.
void PlaneToView(const Point2D &planePointInMM, Point2D &viewPoint) const
Convert a 2D plane coordinate in millimeters to a 2D viewport point.
virtual DataNode * PickObject(const Point2D &, Point3D &) const
Determines the object (mitk::DataNode) closest to the current position by means of picking.
virtual void UpdateGeometry(const itk::EventObject &geometrySliceEvent)
Set the current world plane geometry using the existing current world geometry.
virtual void InitSize(int w, int h)
Set the initial size for the render window.
void ForceImmediateUpdate()
Force an immediate synchronous rendering update for this render window.
virtual int * GetViewportSize() const
Get the size of the VTK viewport in pixels.
const double * GetBounds() const
Return the bounds of the bounding box of the current world geometry (time-extracted 3D-geometry).
std::set< Mapper * > LODEnabledMappersType
Point2D GetViewportSizeInMM() const
Get the size of the VTK viewport in millimeters.
virtual void SetMapperID(MapperSlotId id)
Set the used mapperID.
virtual void SetGeometryTime(const itk::EventObject &geometryTimeEvent)
Set the current time using "SetTimeStep" and update the current world geometry and the current world ...
static BaseRendererMapType GetAll3DRenderWindows()
Convenience function: Get a map of all 3D RenderWindows.
virtual void Resize(int w, int h)
Set a new size for the render window.
ScalarType GetTime() const
Get the time in ms of the currently display content (geometry).
virtual int * GetSize() const
Get the size of the render window in pixels.
mitkClassMacroItkParent(BaseRenderer, itk::Object)
virtual void DrawOverlayMouse(Point2D &)
Draw an overlay mouse cursor at the given position.
virtual void SetGeometrySlice(const itk::EventObject &geometrySliceEvent)
Set the current slice using "SetSlice" and update the current world geometry and the current world pl...
TimeStepType GetTimeStep(const BaseData *data) const
Get the timestep of a BaseData object which exists at the time of the currently displayed content.
void RegisterLocalStorageHandler(BaseLocalStorageHandler *lsh)
Register a local storage handler with this renderer.
void DisplayToWorld(const Point2D &displayPoint, Point3D &worldIndex) const
Convert a display point to a 3D world coordinate.
virtual void SetWorldTimeGeometry(const TimeGeometry *geometry)
Set the world time geometry using the given TimeGeometry.
int GetSizeX() const
Return the size in x-direction of the base renderer.
int GetSizeY() const
Return the size in y-direction of the base renderer.
static vtkRenderWindow * GetRenderWindowByName(const std::string &name)
Find a vtkRenderWindow by the name of its associated BaseRenderer.
static BaseRendererMapType GetSpecificRenderWindows(MapperSlotId mapper)
Get a map of all BaseRenderers that use the specified mapper type.
virtual void SetInteractionReferenceGeometry(const TimeGeometry *geometry)
Set the interaction reference world time geometry using the given TimeGeometry.
void RequestUpdate()
Request an asynchronous rendering update for this render window via the RenderingManager.
Connects a DataStorage with a Dispatcher for interaction event routing.
Controls the camera used by the associated BaseRenderer.
Controls azimuthal camera rotation driven by a Stepper.
Central node class of the MITK data tree, associating a data object with properties and mappers.
Abstract data management class that organizes DataNode objects in a directed acyclic graph.
Base class of all mappers, Vtk as well as OpenGL mappers.
Data class containing PlaneGeometry objects.
Describes the geometry of a plane object.
Controls the selection of the slice the associated BaseRenderer will display.
unsigned int MapperSlotId
#define MITK_INFO
Log an informational message.
Find image slices visible on a given plane.
std::size_t TimeStepType
Type for time step indices (non-negative integers starting from 0).
double ScalarType
Scalar type used throughout MITK for geometric computations.
itkEventMacroDeclaration(BoundingShapeInteractionEvent, itk::AnyEvent)