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
96 BaseRenderer(
const char* name =
nullptr, vtkRenderWindow* renderWindow =
nullptr);
106 return m_DataStorage.GetPointer();
111 return m_RenderWindow;
116 return m_VtkRenderer;
142 MITK_INFO <<
"BaseRenderer::DrawOverlayMouse() should be in concret implementation OpenGLRenderer." << std::endl;
178 itkGetMacro(ReferenceGeometryAligned,
bool);
204 itkGetConstMacro(Slice,
unsigned int);
215 itkGetConstMacro(TimeStep,
unsigned int);
235 virtual void SetGeometry(
const itk::EventObject& geometrySliceEvent);
260 itkGetObjectMacro(CurrentWorldPlaneGeometryNode,
DataNode);
270 itkGetMacro(CurrentWorldPlaneGeometryUpdateTime,
unsigned long);
275 itkGetMacro(TimeStepUpdateTime,
unsigned long);
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];
407 itkGetConstMacro(ConstrainZoomingAndPanning,
bool)
408 virtual
void SetConstrainZoomingAndPanning(
bool constrain);
414 virtual
void Update() = 0;
416 vtkRenderWindow* m_RenderWindow;
417 vtkRenderer* m_VtkRenderer;
421 unsigned long m_LastUpdateTime;
427 void UpdateCurrentGeometries();
451 TimeGeometry::ConstPointer m_InteractionReferenceGeometry;
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;
488 unsigned long m_CurrentWorldPlaneGeometryTransformTime;
494 bool m_EmptyWorldGeometry;
498 unsigned int m_NumberOfVisibleLODEnabledMappers;
502 bool m_ConstrainZoomingAndPanning;
Base of all data objects.
BaseGeometry Describes the geometry of a data object.
Interface for accessing (templated) LocalStorageHandler instances.
void PlaneToDisplay(const Point2D &planePointInMM, Point2D &displayPoint) const
Convert a 2D plane coordinate to the display point using the geometry of the renderWindow.
static BaseRendererMapType GetAll2DRenderWindows()
Convenience function: Get a map of all 2D RenderWindows.
static BaseRendererMapType baseRendererMap
static void AddInstance(vtkRenderWindow *renderWindow, BaseRenderer *baseRenderer)
std::map< vtkRenderWindow *, BaseRenderer * > BaseRendererMapType
virtual void SetDataStorage(DataStorage *storage)
void RemoveAllLocalStorages()
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)
void UnregisterLocalStorageHandler(BaseLocalStorageHandler *lsh)
void DisplayToPlane(const Point2D &displayPoint, Point2D &planePointInMM) const
Convert a display point to the 2D world index, mapped onto the display plane using the geometry of th...
virtual void SetSlice(unsigned int slice)
Set the slice that should be used for geometry extraction.
vtkRenderer * GetVtkRenderer() const
BaseRenderer(const char *name=nullptr, vtkRenderWindow *renderWindow=nullptr)
const char * GetName() const
Return the name of the base renderer.
virtual DataStorage::Pointer GetDataStorage() const
void WorldToDisplay(const Point3D &worldIndex, Point2D &displayPoint) const
Convert a 3D world index to the display point using the geometry of the renderWindow.
void WorldToView(const Point3D &worldIndex, Point2D &viewPoint) const
Convert a 3D world index to the point on the viewport using the geometry of the renderWindow.
static BaseRenderer * GetByName(const std::string &name)
virtual bool SetWorldGeometryToDataStorageBounds()
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. Set the new renderer for the camera controller...
void SendUpdateSlice()
Modify the update time of the current world plane geometry and force reslicing.
Point2D GetOriginInMM() const
static BaseRenderer * GetInstance(vtkRenderWindow *renderWindow)
Point2D GetDisplaySizeInMM() const
vtkRenderWindow * GetRenderWindow() const
virtual void SetTimeStep(unsigned int timeStep)
Set the timestep that should be used for geometry extraction.
static void RemoveInstance(vtkRenderWindow *renderWindow)
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
void PlaneToView(const Point2D &planePointInMM, Point2D &viewPoint) const
Convert a 2D plane coordinate to the point on the viewport using the geometry of the renderWindow.
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()
virtual int * GetViewportSize() const
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
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
mitkClassMacroItkParent(BaseRenderer, itk::Object)
virtual void DrawOverlayMouse(Point2D &)
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)
void DisplayToWorld(const Point2D &displayPoint, Point3D &worldIndex) const
Convert a display point to the 3D world index using the geometry of the renderWindow.
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)
static BaseRendererMapType GetSpecificRenderWindows(MapperSlotId mapper)
Get a map of specific RenderWindows.
virtual void SetInteractionReferenceGeometry(const TimeGeometry *geometry)
Set the interaction reference world time geometry using the given TimeGeometry.
This Class is used to connect a DataStorage with the Dispatcher.
controls the camera used by the associated BaseRenderer
Class for nodes of the DataTree.
Data management class that handles 'was created by' relations.
Base class of all mappers, Vtk as well as OpenGL mappers.
Data class containing PlaneGeometry objects.
Describes a two-dimensional, rectangular plane.
Controls the selection of the slice the associated BaseRenderer will display.
unsigned int MapperSlotId
Find image slices visible on a given plane.
itkEventMacroDeclaration(BoundingShapeInteractionEvent, itk::AnyEvent)