Medical Imaging Interaction Toolkit
2023.12.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 } |
typedef RenderingManager | Self |
typedef itk::Object | Superclass |
typedef itk::SmartPointer< Self > | Pointer |
typedef itk::SmartPointer< const Self > | ConstPointer |
typedef std::vector< vtkRenderWindow * > | RenderWindowVector |
typedef std::vector< float > | FloatVector |
typedef std::vector< bool > | BoolVector |
typedef itk::SmartPointer< DataStorage > | DataStoragePointer |
Public Member Functions | |
virtual std::vector< std::string > | GetClassHierarchy () const |
virtual const char * | GetClassName () const |
void | AddRenderWindow (vtkRenderWindow *renderWindow) |
void | RemoveRenderWindow (vtkRenderWindow *renderWindow) |
const RenderWindowVector & | GetAllRegisteredRenderWindows () |
void | RequestUpdate (vtkRenderWindow *renderWindow) |
void | ForceImmediateUpdate (vtkRenderWindow *renderWindow) |
void | RequestUpdateAll (RequestType type=REQUEST_UPDATE_ALL) |
void | ForceImmediateUpdateAll (RequestType type=REQUEST_UPDATE_ALL) |
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 | |
virtual void | ExecutePendingRequests () |
bool | IsRendering () const |
void | AbortRendering () |
virtual void | SetLODIncreaseBlocked (bool _arg) |
virtual bool | GetLODIncreaseBlocked () |
virtual void | LODIncreaseBlockedOn () |
virtual void | LODIncreaseBlockedOff () |
virtual void | SetLODAbortMechanismEnabled (bool _arg) |
virtual bool | GetLODAbortMechanismEnabled () |
virtual void | LODAbortMechanismEnabledOn () |
virtual void | LODAbortMechanismEnabledOff () |
virtual void | StartOrResetTimer () |
void | ExecutePendingHighResRenderingRequest () |
virtual void | DoStartRendering () |
virtual void | DoMonitorRendering () |
virtual void | DoFinishAbortRendering () |
int | GetNextLOD (BaseRenderer *renderer) |
void | SetMaximumLOD (unsigned int max) |
void | SetShading (bool state, unsigned int lod) |
bool | GetShading (unsigned int lod) |
void | SetClippingPlaneStatus (bool status) |
bool | GetClippingPlaneStatus () |
void | SetShadingValues (float ambient, float diffuse, float specular, float specpower) |
FloatVector & | GetShadingValues () |
PropertyList::Pointer | GetPropertyList () const |
BaseProperty * | GetProperty (const char *propertyKey) const |
void | SetProperty (const char *propertyKey, BaseProperty *propertyValue) |
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 () |
virtual void | SetConstrainedPanningZooming (bool _arg) |
virtual bool | GetConstrainedPanningZooming () const |
void | SetAntiAliasing (AntiAliasing antiAliasing) |
virtual AntiAliasing | GetAntiAliasing () const |
Static Public Member Functions | |
static const char * | GetStaticNameOfClass () |
static Pointer | New () |
static void | SetFactory (RenderingManagerFactory *factory) |
static const RenderingManagerFactory * | GetFactory () |
static bool | HasFactory () |
static RenderingManager * | GetInstance () |
static bool | IsInstantiated () |
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.
typedef itk::SmartPointer<const Self> mitk::RenderingManager::ConstPointer |
Definition at line 77 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.
Definition at line 77 of file mitkRenderingManager.h.
|
protected |
Definition at line 387 of file mitkRenderingManager.h.
|
protected |
Definition at line 386 of file mitkRenderingManager.h.
|
protected |
Definition at line 419 of file mitkRenderingManager.h.
|
protected |
Definition at line 409 of file mitkRenderingManager.h.
typedef std::vector<vtkRenderWindow *> mitk::RenderingManager::RenderWindowVector |
Definition at line 77 of file mitkRenderingManager.h.
Definition at line 77 of file mitkRenderingManager.h.
typedef itk::Object mitk::RenderingManager::Superclass |
Definition at line 77 of file mitkRenderingManager.h.
|
protected |
Enumerator | |
---|---|
RENDERING_INACTIVE | |
RENDERING_REQUESTED | |
RENDERING_INPROGRESS |
Definition at line 369 of file mitkRenderingManager.h.
Enumerator | |
---|---|
REQUEST_UPDATE_ALL | |
REQUEST_UPDATE_2DWINDOWS | |
REQUEST_UPDATE_3DWINDOWS |
Definition at line 85 of file mitkRenderingManager.h.
|
override |
|
protected |
void mitk::RenderingManager::AbortRendering | ( | ) |
void mitk::RenderingManager::AddRenderWindow | ( | vtkRenderWindow * | renderWindow | ) |
Adds a RenderWindow. This is required if the methods RequestUpdateAll or ForceImmediateUpdate are to be used.
|
inlinevirtual |
Reimplemented in QmitkRenderingManager.
Definition at line 308 of file mitkRenderingManager.h.
|
inlinevirtual |
Reimplemented in QmitkRenderingManager.
Definition at line 307 of file mitkRenderingManager.h.
|
inlinevirtual |
Definition at line 306 of file mitkRenderingManager.h.
void mitk::RenderingManager::ExecutePendingHighResRenderingRequest | ( | ) |
To be called by a sub-class from a timer callback
|
virtual |
Executes all pending requests. This method has to be called by the system whenever a RenderingManager induced request event occurs in the system pipeline (see concrete RenderingManager implementations).
void mitk::RenderingManager::ForceImmediateUpdate | ( | vtkRenderWindow * | renderWindow | ) |
Immediately executes an update of the specified RenderWindow.
void mitk::RenderingManager::ForceImmediateUpdateAll | ( | RequestType | type = REQUEST_UPDATE_ALL | ) |
Immediately executes an update of all registered RenderWindows. If only 2D or 3D windows should be updated, this can be specified via the parameter requestType.
|
protectedpure virtual |
Abstract method for generating a system specific event for rendering request. This method is called whenever an update is requested
Implemented in mitk::TestingRenderingManager, and QmitkRenderingManager.
const RenderWindowVector& mitk::RenderingManager::GetAllRegisteredRenderWindows | ( | ) |
Get a list of all registered RenderWindows
|
virtual |
|
inlinevirtual |
Reimplemented in mitk::TestingRenderingManager.
Definition at line 77 of file mitkRenderingManager.h.
|
virtual |
Reimplemented in mitk::TestingRenderingManager.
bool mitk::RenderingManager::GetClippingPlaneStatus | ( | ) |
|
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 object factory which produces the platform specific RenderingManager instances.
|
virtual |
|
static |
Get the RenderingManager singleton instance.
Referenced by QmitkTransferFunctionCanvas::SetX(), and QmitkTransferFunctionCanvas::SetY().
|
virtual |
En-/Disable LOD abort mechanism.
|
virtual |
En-/Disable LOD increase globally.
int mitk::RenderingManager::GetNextLOD | ( | BaseRenderer * | renderer | ) |
BaseProperty* mitk::RenderingManager::GetProperty | ( | const char * | propertyKey | ) | const |
Returns a property from m_PropertyList
PropertyList::Pointer mitk::RenderingManager::GetPropertyList | ( | ) | const |
Returns a property list
bool mitk::RenderingManager::GetShading | ( | unsigned int | lod | ) |
FloatVector& mitk::RenderingManager::GetShadingValues | ( | ) |
|
inlinestatic |
Definition at line 77 of file mitkRenderingManager.h.
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 |
Returns true if 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 specifid 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 |
Returns true if the singleton instance does already exist.
bool mitk::RenderingManager::IsRendering | ( | ) | const |
|
virtual |
|
virtual |
En-/Disable LOD abort mechanism.
|
virtual |
|
virtual |
En-/Disable LOD increase globally.
|
static |
void mitk::RenderingManager::RemoveRenderWindow | ( | vtkRenderWindow * | renderWindow | ) |
Removes a RenderWindow.
|
staticprotected |
|
staticprotected |
|
staticprotected |
void mitk::RenderingManager::RequestUpdate | ( | vtkRenderWindow * | renderWindow | ) |
Requests an update for the specified RenderWindow, to be executed as soon as the main loop is ready for rendering.
void mitk::RenderingManager::RequestUpdateAll | ( | RequestType | type = REQUEST_UPDATE_ALL | ) |
Requests all currently registered RenderWindows to be updated. If only 2D or 3D windows should be updated, this can be specified via the parameter requestType.
Referenced by QmitkTransferFunctionCanvas::SetX(), and QmitkTransferFunctionCanvas::SetY().
void mitk::RenderingManager::SetAntiAliasing | ( | AntiAliasing | antiAliasing | ) |
void mitk::RenderingManager::SetClippingPlaneStatus | ( | bool | status | ) |
|
virtual |
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 object factory which produces the desired platform specific RenderingManager singleton instance.
Referenced by mitk::TestingRenderingManagerFactory::TestingRenderingManagerFactory().
|
virtual |
En-/Disable LOD abort mechanism.
|
virtual |
En-/Disable LOD increase globally.
void mitk::RenderingManager::SetMaximumLOD | ( | unsigned int | max | ) |
Set current LOD (nullptr means all renderers)
void mitk::RenderingManager::SetProperty | ( | const char * | propertyKey, |
BaseProperty * | propertyValue | ||
) |
Sets or adds (if not present) a property in m_PropertyList
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 | ||
) |
void mitk::RenderingManager::SetShadingValues | ( | float | ambient, |
float | diffuse, | ||
float | specular, | ||
float | specpower | ||
) |
|
inlinevirtual |
Force a sub-class to start a timer for a pending hires-rendering request
Reimplemented in QmitkRenderingManager.
Definition at line 301 of file mitkRenderingManager.h.
|
protected |
Definition at line 412 of file mitkRenderingManager.h.
|
protected |
Definition at line 401 of file mitkRenderingManager.h.
|
protected |
Definition at line 432 of file mitkRenderingManager.h.
|
protected |
Definition at line 430 of file mitkRenderingManager.h.
|
protected |
Definition at line 397 of file mitkRenderingManager.h.
|
protected |
Definition at line 395 of file mitkRenderingManager.h.
|
protected |
Definition at line 393 of file mitkRenderingManager.h.
|
protected |
Definition at line 391 of file mitkRenderingManager.h.
|
protected |
Definition at line 428 of file mitkRenderingManager.h.
|
protected |
Definition at line 389 of file mitkRenderingManager.h.
|
protected |
Definition at line 421 of file mitkRenderingManager.h.
|
protected |
Definition at line 411 of file mitkRenderingManager.h.
|
protected |
Definition at line 399 of file mitkRenderingManager.h.
|
protected |
Definition at line 403 of file mitkRenderingManager.h.
|
protected |
Definition at line 423 of file mitkRenderingManager.h.
|
protected |
Definition at line 384 of file mitkRenderingManager.h.
|
staticprotected |
Definition at line 425 of file mitkRenderingManager.h.
|
staticprotected |
Definition at line 426 of file mitkRenderingManager.h.