13 #ifndef mitkRenderingManager_h
14 #define mitkRenderingManager_h
18 #include <vtkCallbackCommand.h>
20 #include <itkObject.h>
21 #include <itkObjectFactory.h>
28 class vtkRenderWindow;
33 class RenderingManagerFactory;
35 class TimeNavigationController;
90 REQUEST_UPDATE_ALL = 0,
92 REQUEST_UPDATE_3DWINDOWS
206 bool resetCamera =
true);
229 bool resetCamera =
true);
252 bool resetCamera =
true);
283 bool resetCamera =
true);
300 bool resetCamera =
true);
341 itkSetMacro(LODIncreaseBlocked,
bool);
343 itkGetMacro(LODIncreaseBlocked,
bool);
345 itkBooleanMacro(LODIncreaseBlocked);
348 itkSetMacro(LODAbortMechanismEnabled,
bool);
350 itkGetMacro(LODAbortMechanismEnabled,
bool);
352 itkBooleanMacro(LODAbortMechanismEnabled);
467 itkGetMacro(FocusedRenderWindow, vtkRenderWindow *);
470 itkGetConstMacro(ConstrainedPanningZooming,
bool);
478 RENDERING_INACTIVE = 0,
523 vtkCallbackCommand *commands[3u];
561 void InternalViewInitialization(
BaseRenderer *baseRenderer,
563 bool boundingBoxInitialized,
574 bool ExtendGeometryForBoundingBox(
const TimeGeometry* originalGeometry, TimeGeometry::Pointer& modifiedGeometry);
576 vtkRenderWindow *m_FocusedRenderWindow;
581 #pragma GCC visibility push(default)
588 #pragma GCC visibility pop
604 itkFactorylessNewMacro(Self);
Abstract base class describing the geometry of a data object.
Abstract base class for properties.
Organizes the rendering process.
Abstract data management class that organizes DataNode objects in a directed acyclic graph.
Factory interface for facilitating the usage of a platform-specific mitk::RenderingManager instance.
Manager for coordinating the rendering process.
void SetShadingValues(float ambient, float diffuse, float specular, float specpower)
Set the shading values for rendering.
itk::SmartPointer< DataStorage > DataStoragePointer
void SetMaximumLOD(unsigned int max)
Set the maximum LOD level.
static Pointer New()
Create a new RenderingManager instance via the registered factory.
void SetAntiAliasing(AntiAliasing antiAliasing)
virtual void DoMonitorRendering()
Hook called to monitor rendering progress. Override in subclasses.
virtual void ExecutePendingRequests()
Execute all pending rendering requests.
BaseProperty * GetProperty(const char *propertyKey) const
Get a property from the internal property list.
itk::SmartPointer< TimeNavigationController > m_TimeNavigationController
void ExecutePendingHighResRenderingRequest()
Execute any pending high-resolution rendering requests. Called from a timer callback in subclasses.
void SetClippingPlaneStatus(bool status)
Enable or disable the clipping plane.
bool m_ClippingPlaneEnabled
PropertyList::Pointer m_PropertyList
void RequestUpdate(vtkRenderWindow *renderWindow)
Request a deferred update for the specified render window.
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 dat...
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.
virtual void StartOrResetTimer()
Start or reset a timer for a pending high-resolution rendering request. Subclasses should override.
RenderWindowList m_RenderWindowList
bool GetClippingPlaneStatus()
Get the clipping plane status.
TimeNavigationController * GetTimeNavigationController()
bool m_LODIncreaseBlocked
mitkClassMacroItkParent(RenderingManager, itk::Object)
virtual bool InitializeViews(RequestType type=REQUEST_UPDATE_ALL)
Initialize the render windows specified by "type" to the default viewing direction without updating t...
static RenderingManagerFactory * s_RenderingManagerFactory
static bool IsInstantiated()
Check whether the singleton instance already exists.
DataStoragePointer m_DataStorage
const RenderWindowVector & GetAllRegisteredRenderWindows()
Get all registered vtkRenderWindows.
RendererBoolMap m_RenderingAbortedMap
virtual void GenerateRenderingRequestEvent()=0
std::vector< float > FloatVector
bool IsRendering() const
Check whether any registered render window is currently rendering.
virtual void InitializeViewsByBoundingObjects(const DataStorage *dataStorage)
Initialize the render windows by the aggregated geometry of all objects that are held in the data sto...
bool GetShading(unsigned int lod)
Get the shading state for a specific LOD level.
void AbortRendering()
Abort all in-progress renderings by setting the abort flag on active render windows.
const TimeNavigationController * GetTimeNavigationController() const
RenderWindowVector m_AllRenderWindows
void RemoveRenderWindow(vtkRenderWindow *renderWindow)
Unregister a vtkRenderWindow from this RenderingManager.
static void RenderingProgressCallback(vtkObject *caller, unsigned long eid, void *clientdata, void *calldata)
virtual void DoFinishAbortRendering()
Hook called when rendering abort is finished. Override in subclasses.
static RenderingManager * GetInstance()
Get the RenderingManager singleton instance.
FloatVector m_ShadingValues
void SetRenderWindowFocus(vtkRenderWindow *focusWindow)
Sets a flag to the given renderwindow to indicated that it has the focus e.g. has been clicked recent...
std::vector< vtkRenderWindow * > RenderWindowVector
RequestType
Enumeration of update request types.
@ REQUEST_UPDATE_2DWINDOWS
Update only 2D render windows.
std::map< vtkRenderWindow *, RenderWindowCallbacks > RenderWindowCallbacksList
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.
static const RenderingManagerFactory * GetFactory()
Get the factory that produces platform-specific RenderingManager instances.
void SetShading(bool state, unsigned int lod)
Enable or disable shading for a specific LOD level.
void ForceImmediateUpdate(vtkRenderWindow *renderWindow)
Immediately execute a synchronous update of the specified render window.
void SetProperty(const char *propertyKey, BaseProperty *propertyValue)
Set or add a property in the internal property list.
static void RenderingEndCallback(vtkObject *caller, unsigned long eid, void *clientdata, void *calldata)
RenderWindowCallbacksList m_RenderWindowCallbacksList
PropertyList::Pointer GetPropertyList() const
Get the internal property list used for global rendering settings.
RendererIntMap m_NextLODMap
virtual bool InitializeView(vtkRenderWindow *renderWindow, const BaseGeometry *geometry, bool resetCamera=true)
Initialize the specified render window to the given geometry.
void AddRenderWindow(vtkRenderWindow *renderWindow)
Register a vtkRenderWindow with this RenderingManager.
void ForceImmediateUpdateAll(RequestType type=REQUEST_UPDATE_ALL)
Immediately execute a synchronous update for all registered render windows.
~RenderingManager() override
Destructor. Unregisters all render windows and removes callbacks.
void RequestUpdateAll(RequestType type=REQUEST_UPDATE_ALL)
Request a deferred update for all registered render windows.
static bool HasFactory()
Check whether a factory has already been set.
bool m_ConstrainedPanningZooming
void SetDataStorage(DataStorage *storage)
Setter for internal DataStorage.
virtual bool InitializeView(vtkRenderWindow *renderWindow)
Initialize the specified render window to the default viewing direction without updating the geometry...
FloatVector & GetShadingValues()
Get the current shading values.
BoolVector m_ShadingEnabled
static void RenderingStartCallback(vtkObject *caller, unsigned long eid, void *clientdata, void *calldata)
void SetConstrainedPanningZooming(bool constrain)
std::map< BaseRenderer *, bool > RendererBoolMap
bool m_LODAbortMechanismEnabled
std::vector< bool > BoolVector
virtual bool InitializeView(vtkRenderWindow *renderWindow, const TimeGeometry *geometry, bool resetCamera=true)
Initialize the specified render window to the given geometry.
std::map< BaseRenderer *, unsigned int > RendererIntMap
virtual void DoStartRendering()
Hook called when rendering starts. Override in subclasses.
static RenderingManager::Pointer s_Instance
std::map< vtkRenderWindow *, int > RenderWindowList
int GetNextLOD(BaseRenderer *renderer)
Get the next LOD level for the given renderer.
virtual void InitializePropertyList()
static void SetFactory(RenderingManagerFactory *factory)
Set the factory that produces platform-specific RenderingManager instances.
mitkClassMacro(TestingRenderingManager, RenderingManager)
void GenerateRenderingRequestEvent() override
Controls the time-related properties of the time stepper, according to the given input world time geo...
AntiAliasing
Anti-aliasing methods for rendering.
Declares commonly used GenericProperty specializations for MITK.
Find image slices visible on a given plane.
itkEventMacroDeclaration(BoundingShapeInteractionEvent, itk::AnyEvent)