Medical Imaging Interaction Toolkit
2018.04.99-15ecdf8d
Medical Imaging Interaction Toolkit
|
Organizes the rendering process. More...
#include <mitkBaseRenderer.h>
Public Types | |
enum | StandardMapperSlot { Standard2D, Standard3D } |
enum | ViewDirection { ViewDirection::AXIAL, ViewDirection::SAGITTAL, ViewDirection::CORONAL, ViewDirection::THREE_D } |
Possible view directions for render windows. More... | |
typedef std::map< vtkRenderWindow *, BaseRenderer * > | BaseRendererMapType |
typedef BaseRenderer | Self |
typedef itk::Object | Superclass |
typedef itk::SmartPointer< Self > | Pointer |
typedef itk::SmartPointer< const Self > | ConstPointer |
typedef int | MapperSlotId |
MapperSlotId defines which kind of mapper (e.g. 2D or 3D) should be used. More... | |
Public Member Functions | |
itkEventMacro (RendererResetEvent, itk::AnyEvent) | |
virtual std::vector< std::string > | GetClassHierarchy () const |
virtual const char * | GetClassName () const |
BaseRenderer (const char *name=nullptr, vtkRenderWindow *renWin=nullptr) | |
virtual void | SetDataStorage (DataStorage *storage) |
set the datastorage that will be used for rendering More... | |
virtual DataStorage::Pointer | GetDataStorage () const |
vtkRenderWindow * | GetRenderWindow () const |
Access the RenderWindow into which this renderer renders. More... | |
vtkRenderer * | GetVtkRenderer () const |
Dispatcher::Pointer | GetDispatcher () const |
Returns the Dispatcher which handles Events for this BaseRenderer. More... | |
virtual void | Paint () |
Do the rendering and flush the result. More... | |
virtual void | Initialize () |
Initialize the RenderWindow. Should only be called from RenderWindow. More... | |
virtual void | Resize (int w, int h) |
Called to inform the renderer that the RenderWindow has been resized. More... | |
virtual void | InitRenderer (vtkRenderWindow *renderwindow) |
Initialize the renderer with a RenderWindow (renderwindow). More... | |
virtual void | InitSize (int w, int h) |
Set the initial size. Called by RenderWindow after it has become visible for the first time. More... | |
virtual void | DrawOverlayMouse (Point2D &p2d) |
Draws a point on the widget. Should be used during conferences to show the position of the remote mouse. More... | |
virtual void | SetWorldGeometry3D (const BaseGeometry *geometry) |
Set/Get the WorldGeometry (m_WorldGeometry) for 3D and 2D rendering, that describing the (maximal) area to be rendered. More... | |
virtual void | SetWorldTimeGeometry (const mitk::TimeGeometry *geometry) |
void | SetWorldGeometry3D (TimeSlicedGeometry *geometry) |
virtual const TimeGeometry * | GetWorldTimeGeometry () |
virtual const BaseGeometry * | GetCurrentWorldGeometry () |
Get the current 3D-worldgeometry (m_CurrentWorldGeometry) used for 3D-rendering. More... | |
virtual const PlaneGeometry * | GetCurrentWorldPlaneGeometry () |
Get the current 2D-worldgeometry (m_CurrentWorldPlaneGeometry) used for 2D-rendering. More... | |
const PlaneGeometry * | GetCurrentWorldGeometry2D () |
virtual bool | SetWorldGeometryToDataStorageBounds () |
virtual void | SetSlice (unsigned int slice) |
Set/Get m_Slice which defines together with m_TimeStep the 2D geometry stored in m_WorldTimeGeometry used as m_CurrentWorldPlaneGeometry. More... | |
virtual unsigned int | GetSlice () const |
virtual void | SetTimeStep (unsigned int timeStep) |
Set/Get m_TimeStep which defines together with m_Slice the 2D geometry stored in m_WorldTimeGeometry used as m_CurrentWorldPlaneGeometry. More... | |
virtual unsigned int | GetTimeStep () const |
int | GetTimeStep (const BaseData *data) const |
Get the time-step of a BaseData object which exists at the time of the currently displayed content. More... | |
ScalarType | GetTime () const |
Get the time in ms of the currently displayed content. More... | |
virtual void | SetGeometry (const itk::EventObject &geometrySliceEvent) |
SetWorldGeometry is called according to the geometrySliceEvent, which is supposed to be a SliceNavigationController::GeometrySendEvent. More... | |
virtual void | UpdateGeometry (const itk::EventObject &geometrySliceEvent) |
UpdateWorldGeometry is called to re-read the 2D geometry from the slice navigation controller. More... | |
virtual void | SetGeometrySlice (const itk::EventObject &geometrySliceEvent) |
SetSlice is called according to the geometrySliceEvent, which is supposed to be a SliceNavigationController::GeometrySliceEvent. More... | |
virtual void | SetGeometryTime (const itk::EventObject &geometryTimeEvent) |
SetTimeStep is called according to the geometrySliceEvent, which is supposed to be a SliceNavigationController::GeometryTimeEvent. More... | |
virtual DataNode * | GetCurrentWorldPlaneGeometryNode () |
Get a DataNode pointing to a data object containing the current 2D-worldgeometry. More... | |
DataNode * | GetCurrentWorldGeometry2DNode () |
void | SendUpdateSlice () |
Sets timestamp of CurrentWorldPlaneGeometry and forces so reslicing in that renderwindow. More... | |
unsigned long | GetCurrentWorldPlaneGeometryUpdateTime () |
Get timestamp of last call of SetCurrentWorldPlaneGeometry. More... | |
unsigned long | GetCurrentWorldGeometry2DUpdateTime () |
unsigned long | GetTimeStepUpdateTime () |
Get timestamp of last change of current TimeStep. More... | |
virtual void | PickWorldPoint (const Point2D &diplayPosition, Point3D &worldPosition) const =0 |
Perform a picking: find the x,y,z world coordinate of a display x,y coordinate. More... | |
virtual DataNode * | PickObject (const Point2D &, Point3D &) const |
Determines the object (mitk::DataNode) closest to the current position by means of picking. More... | |
virtual MapperSlotId | GetMapperID () |
Get the MapperSlotId to use. More... | |
virtual MapperSlotId | GetMapperID () const |
virtual void | SetMapperID (MapperSlotId id) |
Set the MapperSlotId to use. More... | |
virtual int * | GetSize () const |
virtual int * | GetViewportSize () const |
void | SetSliceNavigationController (SliceNavigationController *SlicenavigationController) |
virtual CameraController * | GetCameraController () |
virtual SliceNavigationController * | GetSliceNavigationController () |
virtual CameraRotationController * | GetCameraRotationController () |
virtual bool | GetEmptyWorldGeometry () |
virtual bool | GetKeepDisplayedRegion () |
Tells if the displayed region is shifted and rescaled if the render window is resized. More... | |
virtual void | SetKeepDisplayedRegion (bool _arg) |
Tells if the displayed region should be shifted and rescaled if the render window is resized. More... | |
const char * | GetName () const |
get the name of the Renderer More... | |
int | GetSizeX () const |
get the x_size of the RendererWindow More... | |
int | GetSizeY () const |
get the y_size of the RendererWindow More... | |
const double * | GetBounds () const |
void | RequestUpdate () |
void | ForceImmediateUpdate () |
unsigned int | GetNumberOfVisibleLODEnabledMappers () const |
void | DisplayToWorld (const Point2D &displayPoint, Point3D &worldIndex) const |
This method converts a display point to the 3D world index using the geometry of the renderWindow. More... | |
void | DisplayToPlane (const Point2D &displayPoint, Point2D &planePointInMM) const |
This method converts a display point to the 2D world index, mapped onto the display plane using the geometry of the renderWindow. More... | |
void | WorldToDisplay (const Point3D &worldIndex, Point2D &displayPoint) const |
This method converts a 3D world index to the display point using the geometry of the renderWindow. More... | |
void | WorldToView (const Point3D &worldIndex, Point2D &viewPoint) const |
This method converts a 3D world index to the point on the viewport using the geometry of the renderWindow. More... | |
void | PlaneToDisplay (const Point2D &planePointInMM, Point2D &displayPoint) const |
This method converts a 2D plane coordinate to the display point using the geometry of the renderWindow. More... | |
void | PlaneToView (const Point2D &planePointInMM, Point2D &viewPoint) const |
This method converts a 2D plane coordinate to the point on the viewport using the geometry of the renderWindow. More... | |
double | GetScaleFactorMMPerDisplayUnit () const |
Point2D | GetDisplaySizeInMM () const |
Point2D | GetViewportSizeInMM () const |
Point2D | GetOriginInMM () const |
virtual bool | GetConstrainZoomingAndPanning () const |
virtual void | SetConstrainZoomingAndPanning (bool constrain) |
virtual Point3D | Map2DRendererPositionTo3DWorldPosition (const Point2D &mousePosition) const |
Provides (1) world coordinates for a given mouse position and (2) translates mousePosition to Display coordinates. More... | |
void | RemoveAllLocalStorages () |
void | RegisterLocalStorageHandler (mitk::BaseLocalStorageHandler *lsh) |
void | UnregisterLocalStorageHandler (mitk::BaseLocalStorageHandler *lsh) |
Static Public Member Functions | |
static BaseRenderer * | GetInstance (vtkRenderWindow *renWin) |
static void | AddInstance (vtkRenderWindow *renWin, BaseRenderer *baseRenderer) |
static void | RemoveInstance (vtkRenderWindow *renWin) |
static BaseRenderer * | GetByName (const std::string &name) |
static vtkRenderWindow * | GetRenderWindowByName (const std::string &name) |
static const char * | GetStaticNameOfClass () |
Static Public Attributes | |
static BaseRendererMapType | baseRendererMap |
static const MapperSlotId | defaultMapper |
Default mapper id to use. More... | |
Protected Types | |
typedef std::set< Mapper * > | LODEnabledMappersType |
Protected Member Functions | |
~BaseRenderer () override | |
virtual void | Update ()=0 |
Call update of all mappers. To be implemented in subclasses. More... | |
virtual void | SetCurrentWorldPlaneGeometry (const PlaneGeometry *geometry2d) |
Sets m_CurrentWorldPlaneGeometry. More... | |
void | SetCurrentWorldGeometry2D (PlaneGeometry *geometry2d) |
virtual void | SetCurrentWorldGeometry (const BaseGeometry *geometry) |
Sets m_CurrentWorldGeometry. More... | |
void | PrintSelf (std::ostream &os, itk::Indent indent) const override |
Protected Attributes | |
vtkRenderWindow * | m_RenderWindow |
vtkRenderer * | m_VtkRenderer |
MapperSlotId | m_MapperID |
MapperSlotId to use. Defines which kind of mapper (e.g., 2D or 3D) shoud be used. More... | |
DataStorage::Pointer | m_DataStorage |
The DataStorage that is used for rendering. More... | |
unsigned long | m_LastUpdateTime |
Timestamp of last call of Update(). More... | |
itk::SmartPointer< CameraController > | m_CameraController |
CameraController for 3D rendering. More... | |
SliceNavigationController::Pointer | m_SliceNavigationController |
CameraRotationController::Pointer | m_CameraRotationController |
PlaneGeometryData::Pointer | m_CurrentWorldPlaneGeometryData |
DataNode::Pointer | m_CurrentWorldPlaneGeometryNode |
unsigned long | m_CurrentWorldPlaneGeometryTransformTime |
test only More... | |
std::string | m_Name |
double | m_Bounds [6] |
bool | m_EmptyWorldGeometry |
unsigned int | m_NumberOfVisibleLODEnabledMappers |
std::list< mitk::BaseLocalStorageHandler * > | m_RegisteredLocalStorageHandlers |
bool | m_ConstrainZoomingAndPanning |
Organizes the rendering process.
Organizes the rendering process. A Renderer contains a reference to a DataStorage and asks the mappers of the data objects to render the data into the renderwindow it is associated to.
#Render() checks if rendering is currently allowed by calling RenderWindow::PrepareRendering(). Initialization of a rendering context can also be performed in this method.
The actual rendering code has been moved to #Repaint() Both #Repaint() and #Update() are declared protected now.
Note: Separation of the Repaint and Update processes (rendering vs creating a vtk prop tree) still needs to be worked on. The whole rendering process also should be reworked to use VTK based classes for both 2D and 3D rendering.
Definition at line 65 of file mitkBaseRenderer.h.
typedef std::map<vtkRenderWindow *, BaseRenderer *> mitk::BaseRenderer::BaseRendererMapType |
Definition at line 68 of file mitkBaseRenderer.h.
typedef itk::SmartPointer<const Self> mitk::BaseRenderer::ConstPointer |
Definition at line 83 of file mitkBaseRenderer.h.
|
protected |
Definition at line 512 of file mitkBaseRenderer.h.
typedef int mitk::BaseRenderer::MapperSlotId |
MapperSlotId defines which kind of mapper (e.g. 2D or 3D) should be used.
Definition at line 89 of file mitkBaseRenderer.h.
Definition at line 83 of file mitkBaseRenderer.h.
typedef BaseRenderer mitk::BaseRenderer::Self |
Standard class typedefs.
Definition at line 83 of file mitkBaseRenderer.h.
typedef itk::Object mitk::BaseRenderer::Superclass |
Definition at line 83 of file mitkBaseRenderer.h.
Enumerator | |
---|---|
Standard2D | |
Standard3D |
Definition at line 91 of file mitkBaseRenderer.h.
|
strong |
Possible view directions for render windows.
Enumerator | |
---|---|
AXIAL | |
SAGITTAL | |
CORONAL | |
THREE_D |
Definition at line 99 of file mitkBaseRenderer.h.
mitk::BaseRenderer::BaseRenderer | ( | const char * | name = nullptr , |
vtkRenderWindow * | renWin = nullptr |
||
) |
|
overrideprotected |
|
static |
void mitk::BaseRenderer::DisplayToPlane | ( | const Point2D & | displayPoint, |
Point2D & | planePointInMM | ||
) | const |
This method converts a display point to the 2D world index, mapped onto the display plane using the geometry of the renderWindow.
void mitk::BaseRenderer::DisplayToWorld | ( | const Point2D & | displayPoint, |
Point3D & | worldIndex | ||
) | const |
This method converts a display point to the 3D world index using the geometry of the renderWindow.
|
virtual |
Draws a point on the widget. Should be used during conferences to show the position of the remote mouse.
void mitk::BaseRenderer::ForceImmediateUpdate | ( | ) |
const double* mitk::BaseRenderer::GetBounds | ( | ) | const |
|
static |
|
virtual |
|
virtual |
|
inlinevirtual |
Reimplemented in mitk::VtkPropRenderer.
Definition at line 83 of file mitkBaseRenderer.h.
|
virtual |
Reimplemented in mitk::VtkPropRenderer.
|
virtual |
|
virtual |
Get the current 3D-worldgeometry (m_CurrentWorldGeometry) used for 3D-rendering.
|
inline |
Definition at line 190 of file mitkBaseRenderer.h.
|
inline |
Definition at line 264 of file mitkBaseRenderer.h.
|
inline |
Definition at line 279 of file mitkBaseRenderer.h.
|
virtual |
Get the current 2D-worldgeometry (m_CurrentWorldPlaneGeometry) used for 2D-rendering.
|
virtual |
Get a DataNode pointing to a data object containing the current 2D-worldgeometry.
|
inline |
Get timestamp of last call of SetCurrentWorldPlaneGeometry.
Definition at line 275 of file mitkBaseRenderer.h.
|
inlinevirtual |
return the DataStorage that is used for rendering
Definition at line 111 of file mitkBaseRenderer.h.
Dispatcher::Pointer mitk::BaseRenderer::GetDispatcher | ( | ) | const |
Returns the Dispatcher which handles Events for this BaseRenderer.
Point2D mitk::BaseRenderer::GetDisplaySizeInMM | ( | ) | const |
|
virtual |
|
static |
|
virtual |
Tells if the displayed region is shifted and rescaled if the render window is resized.
|
virtual |
Get the MapperSlotId to use.
|
virtual |
|
inline |
unsigned int mitk::BaseRenderer::GetNumberOfVisibleLODEnabledMappers | ( | ) | const |
Returns number of mappers which are visible and have level-of-detail rendering enabled
Point2D mitk::BaseRenderer::GetOriginInMM | ( | ) | const |
|
inline |
Access the RenderWindow into which this renderer renders.
Definition at line 114 of file mitkBaseRenderer.h.
|
static |
double mitk::BaseRenderer::GetScaleFactorMMPerDisplayUnit | ( | ) | const |
|
virtual |
|
inline |
|
inline |
get the y_size of the RendererWindow
Definition at line 344 of file mitkBaseRenderer.h.
References DEPRECATED.
|
virtual |
|
virtual |
|
inlinestatic |
Definition at line 83 of file mitkBaseRenderer.h.
ScalarType mitk::BaseRenderer::GetTime | ( | ) | const |
Get the time in ms of the currently displayed content.
|
virtual |
int mitk::BaseRenderer::GetTimeStep | ( | const BaseData * | data | ) | const |
Get the time-step of a BaseData object which exists at the time of the currently displayed content.
Returns -1 or mitk::BaseData::m_TimeSteps if there is no data at the current time.
|
inline |
Get timestamp of last change of current TimeStep.
Definition at line 285 of file mitkBaseRenderer.h.
|
virtual |
Point2D mitk::BaseRenderer::GetViewportSizeInMM | ( | ) | const |
|
inline |
Definition at line 115 of file mitkBaseRenderer.h.
|
virtual |
|
virtual |
Initialize the RenderWindow. Should only be called from RenderWindow.
|
virtual |
Initialize the renderer with a RenderWindow (renderwindow).
Reimplemented in mitk::VtkPropRenderer.
|
virtual |
Set the initial size. Called by RenderWindow after it has become visible for the first time.
Reimplemented in mitk::VtkPropRenderer.
mitk::BaseRenderer::itkEventMacro | ( | RendererResetEvent | , |
itk::AnyEvent | |||
) |
|
virtual |
Provides (1) world coordinates for a given mouse position and (2) translates mousePosition to Display coordinates.
|
virtual |
Do the rendering and flush the result.
|
inlinevirtual |
Determines the object (mitk::DataNode) closest to the current position by means of picking.
Reimplemented in mitk::VtkPropRenderer.
Definition at line 299 of file mitkBaseRenderer.h.
|
pure virtual |
Perform a picking: find the x,y,z world coordinate of a display x,y coordinate.
Implemented here only for 2D-rendering
Implemented in mitk::VtkPropRenderer.
void mitk::BaseRenderer::PlaneToDisplay | ( | const Point2D & | planePointInMM, |
Point2D & | displayPoint | ||
) | const |
This method converts a 2D plane coordinate to the display point using the geometry of the renderWindow.
This method converts a 2D plane coordinate to the point on the viewport using the geometry of the renderWindow.
|
overrideprotected |
void mitk::BaseRenderer::RegisterLocalStorageHandler | ( | mitk::BaseLocalStorageHandler * | lsh | ) |
void mitk::BaseRenderer::RemoveAllLocalStorages | ( | ) |
|
static |
void mitk::BaseRenderer::RequestUpdate | ( | ) |
|
virtual |
Called to inform the renderer that the RenderWindow has been resized.
Reimplemented in mitk::VtkPropRenderer.
void mitk::BaseRenderer::SendUpdateSlice | ( | ) |
Sets timestamp of CurrentWorldPlaneGeometry and forces so reslicing in that renderwindow.
|
virtual |
|
protectedvirtual |
Sets m_CurrentWorldGeometry.
|
inlineprotected |
Definition at line 436 of file mitkBaseRenderer.h.
|
protectedvirtual |
Sets m_CurrentWorldPlaneGeometry.
|
virtual |
set the datastorage that will be used for rendering
Reimplemented in mitk::VtkPropRenderer.
|
virtual |
SetWorldGeometry is called according to the geometrySliceEvent, which is supposed to be a SliceNavigationController::GeometrySendEvent.
|
virtual |
SetSlice is called according to the geometrySliceEvent, which is supposed to be a SliceNavigationController::GeometrySliceEvent.
|
virtual |
SetTimeStep is called according to the geometrySliceEvent, which is supposed to be a SliceNavigationController::GeometryTimeEvent.
|
virtual |
Tells if the displayed region should be shifted and rescaled if the render window is resized.
|
virtual |
Set the MapperSlotId to use.
Reimplemented in mitk::VtkPropRenderer.
|
virtual |
Set/Get m_Slice which defines together with m_TimeStep the 2D geometry stored in m_WorldTimeGeometry used as m_CurrentWorldPlaneGeometry.
void mitk::BaseRenderer::SetSliceNavigationController | ( | SliceNavigationController * | SlicenavigationController | ) |
|
virtual |
Set/Get m_TimeStep which defines together with m_Slice the 2D geometry stored in m_WorldTimeGeometry used as m_CurrentWorldPlaneGeometry.
|
virtual |
Set/Get the WorldGeometry (m_WorldGeometry) for 3D and 2D rendering, that describing the (maximal) area to be rendered.
Depending of the type of the passed BaseGeometry more or less information can be extracted:
void mitk::BaseRenderer::SetWorldGeometry3D | ( | TimeSlicedGeometry * | geometry | ) |
|
inlinevirtual |
Calculates the bounds of the DataStorage (if it contains any valid data), creates a geometry from these bounds and sets it as world geometry of the renderer.
Call this method to re-initialize the renderer to the current DataStorage (e.g. after loading an additional dataset), to ensure that the view is aligned correctly.
Reimplemented in mitk::VtkPropRenderer.
Definition at line 203 of file mitkBaseRenderer.h.
|
virtual |
void mitk::BaseRenderer::UnregisterLocalStorageHandler | ( | mitk::BaseLocalStorageHandler * | lsh | ) |
|
protectedpure virtual |
Call update of all mappers. To be implemented in subclasses.
Implemented in mitk::VtkPropRenderer.
|
virtual |
UpdateWorldGeometry is called to re-read the 2D geometry from the slice navigation controller.
void mitk::BaseRenderer::WorldToDisplay | ( | const Point3D & | worldIndex, |
Point2D & | displayPoint | ||
) | const |
This method converts a 3D world index to the display point using the geometry of the renderWindow.
This method converts a 3D world index to the point on the viewport using the geometry of the renderWindow.
|
static |
Definition at line 69 of file mitkBaseRenderer.h.
|
static |
Default mapper id to use.
Definition at line 122 of file mitkBaseRenderer.h.
|
protected |
Definition at line 508 of file mitkBaseRenderer.h.
|
protected |
CameraController for 3D rendering.
Definition at line 426 of file mitkBaseRenderer.h.
|
protected |
Definition at line 428 of file mitkBaseRenderer.h.
|
protected |
Definition at line 523 of file mitkBaseRenderer.h.
|
protected |
Data object containing the m_CurrentWorldPlaneGeometry defined above.
Definition at line 496 of file mitkBaseRenderer.h.
|
protected |
DataNode objects containing the m_CurrentWorldPlaneGeometryData defined above.
Definition at line 500 of file mitkBaseRenderer.h.
|
protected |
test only
Definition at line 504 of file mitkBaseRenderer.h.
|
protected |
The DataStorage that is used for rendering.
Definition at line 417 of file mitkBaseRenderer.h.
|
protected |
Definition at line 510 of file mitkBaseRenderer.h.
|
protected |
Timestamp of last call of Update().
Definition at line 421 of file mitkBaseRenderer.h.
|
protected |
MapperSlotId to use. Defines which kind of mapper (e.g., 2D or 3D) shoud be used.
Definition at line 413 of file mitkBaseRenderer.h.
|
protected |
Definition at line 506 of file mitkBaseRenderer.h.
|
protected |
Number of mappers which are visible and have level-of-detail rendering enabled
Definition at line 516 of file mitkBaseRenderer.h.
|
protected |
Definition at line 521 of file mitkBaseRenderer.h.
|
protected |
Definition at line 408 of file mitkBaseRenderer.h.
|
protected |
Definition at line 427 of file mitkBaseRenderer.h.
|
protected |
Definition at line 409 of file mitkBaseRenderer.h.