|
Medical Imaging Interaction Toolkit
2026.06.00
Medical Imaging Interaction Toolkit
|
Manager for coordinating the rendering process. More...
#include <mitkRenderingManager.h>


Classes | |
| struct | RenderWindowCallbacks |
Public Types | |
| enum | RequestType { REQUEST_UPDATE_ALL , REQUEST_UPDATE_2DWINDOWS , REQUEST_UPDATE_3DWINDOWS } |
| Enumeration of update request types. More... | |
| typedef std::vector< vtkRenderWindow * > | RenderWindowVector |
| typedef std::vector< float > | FloatVector |
| typedef std::vector< bool > | BoolVector |
| typedef itk::SmartPointer< DataStorage > | DataStoragePointer |
Public Member Functions | |
| mitkClassMacroItkParent (RenderingManager, itk::Object) | |
| void | AddRenderWindow (vtkRenderWindow *renderWindow) |
| Register a vtkRenderWindow with this RenderingManager. More... | |
| void | RemoveRenderWindow (vtkRenderWindow *renderWindow) |
| Unregister a vtkRenderWindow from this RenderingManager. More... | |
| const RenderWindowVector & | GetAllRegisteredRenderWindows () |
| Get all registered vtkRenderWindows. More... | |
| void | RequestUpdate (vtkRenderWindow *renderWindow) |
| Request a deferred update for the specified render window. More... | |
| void | ForceImmediateUpdate (vtkRenderWindow *renderWindow) |
| Immediately execute a synchronous update of the specified render window. More... | |
| void | RequestUpdateAll (RequestType type=REQUEST_UPDATE_ALL) |
| Request a deferred update for all registered render windows. More... | |
| void | ForceImmediateUpdateAll (RequestType type=REQUEST_UPDATE_ALL) |
| Immediately execute a synchronous update for all registered render windows. More... | |
| virtual void | InitializeViewsByBoundingObjects (const DataStorage *dataStorage) |
| Initialize the render windows by the aggregated geometry of all objects that are held in the data storage. More... | |
| virtual void | InitializeViewByBoundingObjects (vtkRenderWindow *renderWindow, const DataStorage *dataStorage, bool resetCamera=true) |
| Initialize the given render window by the aggregated geometry of all objects that are held in the data storage. More... | |
| virtual bool | InitializeViews (const BaseGeometry *geometry, RequestType type=REQUEST_UPDATE_ALL, bool resetCamera=true) |
| Initialize the render windows specified by "type" to the given geometry. More... | |
| virtual bool | InitializeViews (const TimeGeometry *geometry, RequestType type=REQUEST_UPDATE_ALL, bool resetCamera=true) |
| Initialize the render windows specified by "type" to the given geometry. More... | |
| virtual bool | InitializeViews (RequestType type=REQUEST_UPDATE_ALL) |
| Initialize the render windows specified by "type" to the default viewing direction without updating the geometry information. More... | |
| virtual bool | InitializeView (vtkRenderWindow *renderWindow, const BaseGeometry *geometry, bool resetCamera=true) |
| Initialize the specified render window to the given geometry. More... | |
| virtual bool | InitializeView (vtkRenderWindow *renderWindow, const TimeGeometry *geometry, bool resetCamera=true) |
| Initialize the specified render window to the given geometry. More... | |
| virtual bool | InitializeView (vtkRenderWindow *renderWindow) |
| Initialize the specified render window to the default viewing direction without updating the geometry information. More... | |
| const TimeNavigationController * | GetTimeNavigationController () const |
| TimeNavigationController * | GetTimeNavigationController () |
| ~RenderingManager () override | |
| Destructor. Unregisters all render windows and removes callbacks. More... | |
| virtual void | ExecutePendingRequests () |
| Execute all pending rendering requests. More... | |
| bool | IsRendering () const |
| Check whether any registered render window is currently rendering. More... | |
| void | AbortRendering () |
| Abort all in-progress renderings by setting the abort flag on active render windows. More... | |
| virtual void | SetLODIncreaseBlocked (bool _arg) |
| Set whether LOD increase is blocked globally. More... | |
| virtual bool | GetLODIncreaseBlocked () |
| Get whether LOD increase is blocked globally. More... | |
| virtual void | LODIncreaseBlockedOn () |
| Toggle LOD increase blocking. More... | |
| virtual void | LODIncreaseBlockedOff () |
| virtual void | SetLODAbortMechanismEnabled (bool _arg) |
| Set whether the LOD abort mechanism is enabled. More... | |
| virtual bool | GetLODAbortMechanismEnabled () |
| Get whether the LOD abort mechanism is enabled. More... | |
| virtual void | LODAbortMechanismEnabledOn () |
| Toggle the LOD abort mechanism. More... | |
| virtual void | LODAbortMechanismEnabledOff () |
| virtual void | StartOrResetTimer () |
| Start or reset a timer for a pending high-resolution rendering request. Subclasses should override. More... | |
| void | ExecutePendingHighResRenderingRequest () |
| Execute any pending high-resolution rendering requests. Called from a timer callback in subclasses. More... | |
| virtual void | DoStartRendering () |
| Hook called when rendering starts. Override in subclasses. More... | |
| virtual void | DoMonitorRendering () |
| Hook called to monitor rendering progress. Override in subclasses. More... | |
| virtual void | DoFinishAbortRendering () |
| Hook called when rendering abort is finished. Override in subclasses. More... | |
| int | GetNextLOD (BaseRenderer *renderer) |
| Get the next LOD level for the given renderer. More... | |
| void | SetMaximumLOD (unsigned int max) |
| Set the maximum LOD level. More... | |
| void | SetShading (bool state, unsigned int lod) |
| Enable or disable shading for a specific LOD level. More... | |
| bool | GetShading (unsigned int lod) |
| Get the shading state for a specific LOD level. More... | |
| void | SetClippingPlaneStatus (bool status) |
| Enable or disable the clipping plane. More... | |
| bool | GetClippingPlaneStatus () |
| Get the clipping plane status. More... | |
| void | SetShadingValues (float ambient, float diffuse, float specular, float specpower) |
| Set the shading values for rendering. More... | |
| FloatVector & | GetShadingValues () |
| Get the current shading values. More... | |
| PropertyList::Pointer | GetPropertyList () const |
| Get the internal property list used for global rendering settings. More... | |
| BaseProperty * | GetProperty (const char *propertyKey) const |
| Get a property from the internal property list. More... | |
| void | SetProperty (const char *propertyKey, BaseProperty *propertyValue) |
| Set or add a property in the internal property list. More... | |
| void | SetDataStorage (DataStorage *storage) |
| Setter for internal DataStorage. More... | |
| virtual DataStorage * | GetDataStorage () |
| Getter for internal DataStorage. More... | |
| virtual DataStorage * | GetDataStorage () const |
| void | SetRenderWindowFocus (vtkRenderWindow *focusWindow) |
| Sets a flag to the given renderwindow to indicated that it has the focus e.g. has been clicked recently. More... | |
| virtual vtkRenderWindow * | GetFocusedRenderWindow () |
| void | SetConstrainedPanningZooming (bool constrain) |
| virtual bool | GetConstrainedPanningZooming () const |
| void | SetAntiAliasing (AntiAliasing antiAliasing) |
| virtual AntiAliasing | GetAntiAliasing () const |
Static Public Member Functions | |
| static Pointer | New () |
| Create a new RenderingManager instance via the registered factory. More... | |
| static void | SetFactory (RenderingManagerFactory *factory) |
| Set the factory that produces platform-specific RenderingManager instances. More... | |
| static const RenderingManagerFactory * | GetFactory () |
| Get the factory that produces platform-specific RenderingManager instances. More... | |
| static bool | HasFactory () |
| Check whether a factory has already been set. More... | |
| static RenderingManager * | GetInstance () |
| Get the RenderingManager singleton instance. More... | |
| static bool | IsInstantiated () |
| Check whether the singleton instance already exists. More... | |
Protected Types | |
| enum | { RENDERING_INACTIVE , RENDERING_REQUESTED , RENDERING_INPROGRESS } |
| typedef std::map< BaseRenderer *, unsigned int > | RendererIntMap |
| typedef std::map< BaseRenderer *, bool > | RendererBoolMap |
| typedef std::map< vtkRenderWindow *, int > | RenderWindowList |
| typedef std::map< vtkRenderWindow *, RenderWindowCallbacks > | RenderWindowCallbacksList |
Protected Member Functions | |
| RenderingManager () | |
| virtual void | GenerateRenderingRequestEvent ()=0 |
| virtual void | InitializePropertyList () |
Static Protected Member Functions | |
| static void | RenderingStartCallback (vtkObject *caller, unsigned long eid, void *clientdata, void *calldata) |
| static void | RenderingProgressCallback (vtkObject *caller, unsigned long eid, void *clientdata, void *calldata) |
| static void | RenderingEndCallback (vtkObject *caller, unsigned long eid, void *clientdata, void *calldata) |
Static Protected Attributes | |
| static RenderingManager::Pointer | s_Instance |
| static RenderingManagerFactory * | s_RenderingManagerFactory |
Manager for coordinating the rendering process.
RenderingManager is a central instance retrieving and executing RenderWindow update requests. Its main purpose is to coordinate distributed requests which cannot be aware of each other - lacking the knowledge of whether they are really necessary or not. For example, two objects might determine that a specific RenderWindow needs to be updated. This would result in one unnecessary update, if both executed the update on their own.
The RenderingManager addresses this by letting each such object request an update, and waiting for other objects to possibly issue the same request. The actual update will then only be executed at a well-defined point in the main event loop (this may be each time after event processing is done).
Convenience methods for updating all RenderWindows which have been registered with the RenderingManager exist. If these methods are not used, it is not required to register (add) RenderWindows prior to using the RenderingManager.
The methods ForceImmediateUpdate() and ForceImmediateUpdateAll() can be used to force the RenderWindow update execution without any delay, bypassing the request functionality.
The interface of RenderingManager is platform independent. Platform specific subclasses have to be implemented, though, to supply an appropriate event issuing for controlling the update execution process. See method documentation for a description of how this can be done.
Definition at line 74 of file mitkRenderingManager.h.
| typedef std::vector<bool> mitk::RenderingManager::BoolVector |
Definition at line 81 of file mitkRenderingManager.h.
Definition at line 83 of file mitkRenderingManager.h.
| typedef std::vector<float> mitk::RenderingManager::FloatVector |
Definition at line 80 of file mitkRenderingManager.h.
|
protected |
Definition at line 494 of file mitkRenderingManager.h.
|
protected |
Definition at line 493 of file mitkRenderingManager.h.
|
protected |
Definition at line 526 of file mitkRenderingManager.h.
|
protected |
Definition at line 516 of file mitkRenderingManager.h.
| typedef std::vector<vtkRenderWindow *> mitk::RenderingManager::RenderWindowVector |
Definition at line 79 of file mitkRenderingManager.h.
|
protected |
| Enumerator | |
|---|---|
| RENDERING_INACTIVE | |
| RENDERING_REQUESTED | |
| RENDERING_INPROGRESS | |
Definition at line 476 of file mitkRenderingManager.h.
Enumeration of update request types.
| Enumerator | |
|---|---|
| REQUEST_UPDATE_ALL | Update all render windows. |
| REQUEST_UPDATE_2DWINDOWS | Update only 2D render windows. |
| REQUEST_UPDATE_3DWINDOWS | Update only 3D render windows. |
Definition at line 88 of file mitkRenderingManager.h.
|
override |
Destructor. Unregisters all render windows and removes callbacks.
|
protected |
| void mitk::RenderingManager::AbortRendering | ( | ) |
Abort all in-progress renderings by setting the abort flag on active render windows.
| void mitk::RenderingManager::AddRenderWindow | ( | vtkRenderWindow * | renderWindow | ) |
Register a vtkRenderWindow with this RenderingManager.
Required for using RequestUpdateAll() and ForceImmediateUpdateAll(). Also sets up VTK rendering callbacks for the LOD abort mechanism.
| [in] | renderWindow | The render window to register. |
|
inlinevirtual |
Hook called when rendering abort is finished. Override in subclasses.
Reimplemented in QmitkRenderingManager.
Definition at line 365 of file mitkRenderingManager.h.
|
inlinevirtual |
Hook called to monitor rendering progress. Override in subclasses.
Reimplemented in QmitkRenderingManager.
Definition at line 363 of file mitkRenderingManager.h.
|
inlinevirtual |
Hook called when rendering starts. Override in subclasses.
Definition at line 361 of file mitkRenderingManager.h.
| void mitk::RenderingManager::ExecutePendingHighResRenderingRequest | ( | ) |
Execute any pending high-resolution rendering requests. Called from a timer callback in subclasses.
|
virtual |
Execute all pending rendering requests.
Must be called by the system whenever a RenderingManager-induced request event occurs in the system pipeline.
| void mitk::RenderingManager::ForceImmediateUpdate | ( | vtkRenderWindow * | renderWindow | ) |
Immediately execute a synchronous update of the specified render window.
| [in] | renderWindow | The render window to update. |
| void mitk::RenderingManager::ForceImmediateUpdateAll | ( | RequestType | type = REQUEST_UPDATE_ALL | ) |
Immediately execute a synchronous update for all registered render windows.
| [in] | type | Filter to update only specific window types (default: all). |
|
protectedpure virtual |
Abstract method for generating a system specific event for rendering request. This method is called whenever an update is requested
Implemented in QmitkRenderingManager, and mitk::TestingRenderingManager.
| const RenderWindowVector& mitk::RenderingManager::GetAllRegisteredRenderWindows | ( | ) |
Get all registered vtkRenderWindows.
|
virtual |
| bool mitk::RenderingManager::GetClippingPlaneStatus | ( | ) |
Get the clipping plane status.
|
virtual |
|
virtual |
Getter for internal DataStorage.
Returns the DataStorage that is used internally. This instance holds all DataNodes that are rendered by the registered BaseRenderers.
|
virtual |
|
static |
Get the factory that produces platform-specific RenderingManager instances.
|
virtual |
|
static |
Get the RenderingManager singleton instance.
If no instance exists yet, one is created using the registered factory.
Referenced by QmitkTransferFunctionCanvas::SetX(), and QmitkTransferFunctionCanvas::SetY().
|
virtual |
Get whether the LOD abort mechanism is enabled.
|
virtual |
Get whether LOD increase is blocked globally.
| int mitk::RenderingManager::GetNextLOD | ( | BaseRenderer * | renderer | ) |
Get the next LOD level for the given renderer.
| [in] | renderer | The renderer to query (nullptr returns 0). |
| BaseProperty* mitk::RenderingManager::GetProperty | ( | const char * | propertyKey | ) | const |
Get a property from the internal property list.
| [in] | propertyKey | The property key to look up. |
| PropertyList::Pointer mitk::RenderingManager::GetPropertyList | ( | ) | const |
Get the internal property list used for global rendering settings.
| bool mitk::RenderingManager::GetShading | ( | unsigned int | lod | ) |
Get the shading state for a specific LOD level.
| [in] | lod | The LOD level. |
| FloatVector& mitk::RenderingManager::GetShadingValues | ( | ) |
Get the current shading values.
| TimeNavigationController* mitk::RenderingManager::GetTimeNavigationController | ( | ) |
Gets the (global) TimeNavigationController responsible for time-slicing.
| const TimeNavigationController* mitk::RenderingManager::GetTimeNavigationController | ( | ) | const |
Gets the (global) TimeNavigationController responsible for time-slicing.
|
static |
Check whether a factory has already been set.
Referenced by mitk::TestingRenderingManagerFactory::TestingRenderingManagerFactory().
|
protectedvirtual |
|
virtual |
Initialize the specified render window to the default viewing direction without updating the geometry information.
| renderWindow | The specific render window to update |
|
virtual |
Initialize the specified render window to the given geometry.
Throws an exception if bounding box has 0 extent due to exceeding double precision range.
| renderWindow | The specific render window to update |
| geometry | The geometry to be used to initialize / update the render window's time- and slice navigation controller |
| resetCamera | If this parameter is set to true, the camera controller will be set / fit to the center of the rendered image. If set to false, only the the slice navigation controller is reset to the geometry without changing the camera view / position. |
|
virtual |
Initialize the specified render window to the given geometry.
Throws an exception if bounding box has 0 extent due to exceeding double precision range.
| renderWindow | The specific render window to update |
| geometry | The geometry to be used to initialize / update the render window's time- and slice navigation controller |
| resetCamera | If this parameter is set to true, the camera controller will be set / fit to the center of the rendered image. If set to false, only the the slice navigation controller is reset to the geometry without changing the camera view / position. |
|
virtual |
Initialize the given render window by the aggregated geometry of all objects that are held in the data storage.
| renderWindow | The specified render window to update |
| dataStorage | The data storage from which the bounding object can be retrieved |
| resetCamera | If this parameter is set to true, the camera controller will be set / fit to the center of the rendered image. If set to false, only the the slice navigation controller is reset to the geometry without changing the camera view / position. |
|
virtual |
Initialize the render windows specified by "type" to the given geometry.
Throws an exception if bounding box has 0 extent due to exceeding double precision range.
| geometry | The geometry to be used to initialize / update a render window's time and slice navigation controller |
| type | The type of update request:
|
| resetCamera | If this parameter is set to true, the camera controller will be set / fit to the center of the rendered image. If set to false, only the the slice navigation controller is reset to the geometry without changing the camera view / position. |
|
virtual |
Initialize the render windows specified by "type" to the given geometry.
Throws an exception if bounding box has 0 extent due to exceeding double precision range.
| geometry | The geometry to be used to initialize / update a render window's time- and slice navigation controller |
| type | The type of update request:
|
| resetCamera | If this parameter is set to true, the camera controller will be set / fit to the center of the rendered image. If set to false, only the the slice navigation controller is reset to the geometry without changing the camera view / position. |
|
virtual |
Initialize the render windows specified by "type" to the default viewing direction without updating the geometry information.
| type | The type of update request:
|
|
virtual |
Initialize the render windows by the aggregated geometry of all objects that are held in the data storage.
| dataStorage | The data storage from which the bounding object can be retrieved |
|
static |
Check whether the singleton instance already exists.
| bool mitk::RenderingManager::IsRendering | ( | ) | const |
Check whether any registered render window is currently rendering.
|
virtual |
|
virtual |
Toggle the LOD abort mechanism.
|
virtual |
|
virtual |
Toggle LOD increase blocking.
| mitk::RenderingManager::mitkClassMacroItkParent | ( | RenderingManager | , |
| itk::Object | |||
| ) |
|
static |
Create a new RenderingManager instance via the registered factory.
| void mitk::RenderingManager::RemoveRenderWindow | ( | vtkRenderWindow * | renderWindow | ) |
Unregister a vtkRenderWindow from this RenderingManager.
| [in] | renderWindow | The render window to remove. |
|
staticprotected |
|
staticprotected |
|
staticprotected |
| void mitk::RenderingManager::RequestUpdate | ( | vtkRenderWindow * | renderWindow | ) |
Request a deferred update for the specified render window.
The update is executed at the next event loop iteration. Multiple requests for the same window are coalesced.
| [in] | renderWindow | The render window to update. |
| void mitk::RenderingManager::RequestUpdateAll | ( | RequestType | type = REQUEST_UPDATE_ALL | ) |
Request a deferred update for all registered render windows.
| [in] | type | Filter to update only specific window types (default: all). |
Referenced by QmitkTransferFunctionCanvas::SetX(), and QmitkTransferFunctionCanvas::SetY().
| void mitk::RenderingManager::SetAntiAliasing | ( | AntiAliasing | antiAliasing | ) |
| void mitk::RenderingManager::SetClippingPlaneStatus | ( | bool | status | ) |
Enable or disable the clipping plane.
| [in] | status | True to enable, false to disable. |
| void mitk::RenderingManager::SetConstrainedPanningZooming | ( | bool | constrain | ) |
| void mitk::RenderingManager::SetDataStorage | ( | DataStorage * | storage | ) |
Setter for internal DataStorage.
Sets the DataStorage that is used internally. This instance holds all DataNodes that are rendered by the registered BaseRenderers.
If this DataStorage is changed at runtime by calling SetDataStorage(), all currently registered BaseRenderers are automatically given the correct instance. When a new BaseRenderer is added, it is automatically initialized with the currently active DataStorage.
|
static |
Set the factory that produces platform-specific RenderingManager instances.
| [in] | factory | The factory to use. |
Referenced by mitk::TestingRenderingManagerFactory::TestingRenderingManagerFactory().
|
virtual |
Set whether the LOD abort mechanism is enabled.
|
virtual |
Set whether LOD increase is blocked globally.
| void mitk::RenderingManager::SetMaximumLOD | ( | unsigned int | max | ) |
Set the maximum LOD level.
| [in] | max | The maximum LOD value. |
| void mitk::RenderingManager::SetProperty | ( | const char * | propertyKey, |
| BaseProperty * | propertyValue | ||
| ) |
Set or add a property in the internal property list.
| [in] | propertyKey | The property key. |
| [in] | propertyValue | The property value to set. |
| void mitk::RenderingManager::SetRenderWindowFocus | ( | vtkRenderWindow * | focusWindow | ) |
Sets a flag to the given renderwindow to indicated that it has the focus e.g. has been clicked recently.
| focusWindow |
| void mitk::RenderingManager::SetShading | ( | bool | state, |
| unsigned int | lod | ||
| ) |
Enable or disable shading for a specific LOD level.
| [in] | state | True to enable, false to disable. |
| [in] | lod | The LOD level. |
| void mitk::RenderingManager::SetShadingValues | ( | float | ambient, |
| float | diffuse, | ||
| float | specular, | ||
| float | specpower | ||
| ) |
Set the shading values for rendering.
| [in] | ambient | Ambient coefficient. |
| [in] | diffuse | Diffuse coefficient. |
| [in] | specular | Specular coefficient. |
| [in] | specpower | Specular power. |
|
inlinevirtual |
Start or reset a timer for a pending high-resolution rendering request. Subclasses should override.
Reimplemented in QmitkRenderingManager.
Definition at line 355 of file mitkRenderingManager.h.
|
protected |
Definition at line 519 of file mitkRenderingManager.h.
|
protected |
Definition at line 508 of file mitkRenderingManager.h.
|
protected |
Definition at line 539 of file mitkRenderingManager.h.
|
protected |
Definition at line 537 of file mitkRenderingManager.h.
|
protected |
Definition at line 504 of file mitkRenderingManager.h.
|
protected |
Definition at line 502 of file mitkRenderingManager.h.
|
protected |
Definition at line 500 of file mitkRenderingManager.h.
|
protected |
Definition at line 498 of file mitkRenderingManager.h.
|
protected |
Definition at line 535 of file mitkRenderingManager.h.
|
protected |
Definition at line 496 of file mitkRenderingManager.h.
|
protected |
Definition at line 528 of file mitkRenderingManager.h.
|
protected |
Definition at line 518 of file mitkRenderingManager.h.
|
protected |
Definition at line 506 of file mitkRenderingManager.h.
|
protected |
Definition at line 510 of file mitkRenderingManager.h.
|
protected |
Definition at line 530 of file mitkRenderingManager.h.
|
protected |
Definition at line 491 of file mitkRenderingManager.h.
|
staticprotected |
Definition at line 532 of file mitkRenderingManager.h.
|
staticprotected |
Definition at line 533 of file mitkRenderingManager.h.