Medical Imaging Interaction Toolkit  2026.06.00
Medical Imaging Interaction Toolkit
mitk::VtkWidgetRendering Class Reference

Mechanism for rendering a vtkWidget in the foreground of a RenderWindow. More...

#include <mitkVtkWidgetRendering.h>

Inheritance diagram for mitk::VtkWidgetRendering:
Collaboration diagram for mitk::VtkWidgetRendering:

Public Member Functions

 mitkClassMacro (VtkWidgetRendering, BaseData)
 
Pointer Clone () const
 
virtual void SetRenderWindow (vtkRenderWindow *renderWindow)
 Set the render window in which the widget will be shown. More...
 
virtual void Enable ()
 Enable drawing of the widget. More...
 
virtual void Disable ()
 Disable drawing of the widget. More...
 
virtual bool IsEnabled ()
 Check whether the widget is currently enabled (visible). More...
 
void SetRequestedRegionToLargestPossibleRegion () override
 Empty implementation; VtkWidgetRendering does not support the requested region concept. More...
 
bool RequestedRegionIsOutsideOfTheBufferedRegion () override
 Empty implementation; VtkWidgetRendering does not support the requested region concept. More...
 
bool VerifyRequestedRegion () override
 Empty implementation; VtkWidgetRendering does not support the requested region concept. More...
 
void SetRequestedRegion (const itk::DataObject *) override
 Empty implementation; VtkWidgetRendering does not support the requested region concept. More...
 
virtual vtkRenderWindow * GetRenderWindow ()
 Get the vtkRenderWindow used for displaying the widget. More...
 
virtual vtkRenderer * GetVtkRenderer ()
 Get the renderer responsible for rendering the widget into the vtkRenderWindow. More...
 
void SetVtkWidget (vtkInteractorObserver *widget)
 Set the vtkWidget to be rendered. More...
 
vtkInteractorObserver * GetVtkWidget () const
 Get the vtkWidget that is being rendered. More...
 
- Public Member Functions inherited from mitk::BaseData
 mitkClassMacroItkParent (BaseData, itk::DataObject)
 
BaseProperty::ConstPointer GetConstProperty (const std::string &propertyKey, const std::string &contextName="", bool fallBackOnDefaultContext=true) const override
 Get a const property by its key. More...
 
std::vector< std::string > GetPropertyKeys (const std::string &contextName="", bool includeDefaultContext=false) const override
 Get all property keys stored in the property list. More...
 
std::vector< std::string > GetPropertyContextNames () const override
 Get the names of all property contexts. More...
 
BaseProperty * GetNonConstProperty (const std::string &propertyKey, const std::string &contextName="", bool fallBackOnDefaultContext=true) override
 Get a non-const property by its key. More...
 
void SetProperty (const std::string &propertyKey, BaseProperty *property, const std::string &contextName="", bool fallBackOnDefaultContext=false) override
 Set a property in the property list. More...
 
void RemoveProperty (const std::string &propertyKey, const std::string &contextName="", bool fallBackOnDefaultContext=false) override
 Remove a property from the property list. More...
 
const mitk::TimeGeometry * GetTimeGeometry () const
 Return the TimeGeometry of the data as const pointer. More...
 
mitk::TimeGeometry * GetTimeGeometry ()
 Return the TimeGeometry of the data as non-const pointer. More...
 
const mitk::TimeGeometry * GetUpdatedTimeGeometry ()
 Return the TimeGeometry of the data after ensuring it is up-to-date. More...
 
virtual void Expand (unsigned int timeSteps)
 Expand the TimeGeometry to a number of time steps. More...
 
const mitk::BaseGeometry * GetUpdatedGeometry (int t=0)
 Return the BaseGeometry of the data at time step t after ensuring it is up-to-date. More...
 
mitk::BaseGeometry * GetGeometry (int t=0) const
 Return the BaseGeometry of the data at time step t as a non-const pointer. More...
 
void UpdateOutputInformation () override
 Update the information for this BaseData so that it can be used as an output of a BaseProcess. More...
 
void CopyInformation (const itk::DataObject *data) override
 Copy information from the specified data set. More...
 
virtual bool IsInitialized () const
 Check whether the data has been initialized. More...
 
virtual void Clear ()
 Reset the data object by calling ClearData() and InitializeEmpty(). More...
 
virtual bool IsEmptyTimeStep (unsigned int t) const
 Check whether the object contains data at the specified time step. More...
 
virtual bool IsEmpty () const
 Check whether the object contains data at any time step. More...
 
void ExecuteOperation (Operation *operation) override
 Execute an operation on this data object. More...
 
virtual void SetGeometry (BaseGeometry *aGeometry3D)
 Set the BaseGeometry of the data, which will be referenced (not copied!). More...
 
virtual void SetTimeGeometry (TimeGeometry *geometry)
 Set the TimeGeometry of the data, which will be referenced (not copied!). More...
 
virtual void SetClonedGeometry (const BaseGeometry *aGeometry3D)
 Set a clone of the provided geometry as the BaseGeometry of the data. More...
 
virtual void SetClonedTimeGeometry (const TimeGeometry *geometry)
 Set a clone of the provided TimeGeometry as the TimeGeometry of the data. More...
 
virtual void SetClonedGeometry (const BaseGeometry *aGeometry3D, unsigned int time)
 Set a clone of the provided geometry as the BaseGeometry of a given time step. More...
 
mitk::PropertyList::Pointer GetPropertyList () const
 Get the data's property list. More...
 
void SetPropertyList (PropertyList *propertyList)
 Set the data's property list, replacing the existing one. More...
 
mitk::BaseProperty::Pointer GetProperty (const char *propertyKey) const
 Get a property by its key from the PropertyList. More...
 
void SetProperty (const char *propertyKey, BaseProperty *property)
 Set a property in the PropertyList. More...
 
virtual void SetOrigin (const Point3D &origin)
 Convenience method for setting the origin of the BaseGeometry instances of all time steps. More...
 
itk::SmartPointer< mitk::BaseDataSource > GetSource () const
 Get the process object that generated this data object. More...
 
unsigned int GetTimeSteps () const
 Get the number of time steps from the TimeGeometry. More...
 
itk::ModifiedTimeType GetMTime () const override
 Get the modification time of this data object or its geometry, whichever was modified most recently. More...
 
void Graft (const DataObject *) override
 Graft data and information from another data object. More...
 
- Public Member Functions inherited from mitk::OperationActor
 itkTypeMacroNoParent (OperationActor) virtual ~OperationActor()
 
- Public Member Functions inherited from mitk::Identifiable
 Identifiable ()
 Default constructor. Generates a new random UID. More...
 
 Identifiable (const UIDType &uid)
 Construct with a pre-existing UID. More...
 
 Identifiable (const Identifiable &)=delete
 Copy construction is deleted to prevent UID duplication. More...
 
 Identifiable (Identifiable &&) noexcept
 Move constructor. Transfers ownership of the UID. More...
 
virtual ~Identifiable ()
 Virtual destructor. More...
 
Identifiable & operator= (const Identifiable &)=delete
 Copy assignment is deleted to prevent UID duplication. More...
 
Identifiable & operator= (Identifiable &&other) noexcept
 Move assignment operator. Transfers ownership of the UID. More...
 
virtual UIDType GetUID () const
 Get the unique identifier of this object. More...
 
UIDType GetRuntimeUID () const noexcept
 Get a runtime-unique ID for this object instance. More...
 
- Public Member Functions inherited from mitk::IPropertyOwner
 ~IPropertyOwner () override
 
virtual bool PropertyIsOwned (const std::string &propertyKey, const std::string &contextName="", bool fallBackOnDefaultContext=true) const
 Checks if a certain property exists. More...
 
- Public Member Functions inherited from mitk::IPropertyProvider
virtual ~IPropertyProvider ()
 Virtual destructor. More...
 

Static Public Member Functions

static Pointer New ()
 

Protected Member Functions

 VtkWidgetRendering ()
 Constructor. Creates an internal vtkRenderer. More...
 
 ~VtkWidgetRendering () override
 Destructor. Disables the widget if still enabled. More...
 
- Protected Member Functions inherited from mitk::BaseData
 BaseData ()
 
 BaseData (const BaseData &other)
 
 ~BaseData () override
 
virtual void InitializeTimeGeometry (unsigned int timeSteps=1)
 Initialize the TimeGeometry for a number of time steps. The TimeGeometry is initialized empty and evenly timed. In many cases it will be necessary to overwrite this in sub-classes. More...
 
virtual void ClearData ()
 reset to non-initialized state, release memory More...
 
virtual void InitializeEmpty ()
 Pure virtual; Must be used in subclasses to get a data object to a valid state. Should at least create one empty object and call Superclass::InitializeTimeGeometry() to ensure an existing valid geometry. More...
 
void PrintSelf (std::ostream &os, itk::Indent indent) const override
 
- Protected Member Functions inherited from mitk::Identifiable
virtual void SetUID (const UIDType &uid)
 

Protected Attributes

vtkRenderWindow * m_RenderWindow
 
vtkRenderer * m_Renderer
 
vtkInteractorObserver * m_VtkWidget
 
bool m_IsEnabled
 
- Protected Attributes inherited from mitk::BaseData
bool m_LastRequestedRegionWasOutsideOfTheBufferedRegion
 
unsigned int m_SourceOutputIndexDuplicate
 
bool m_Initialized
 

Additional Inherited Members

- Public Types inherited from mitk::Identifiable
using UIDType = std::string
 Type alias for unique identifiers. More...
 

Detailed Description

Mechanism for rendering a vtkWidget in the foreground of a RenderWindow.

To use this class, specify the vtkRenderWindow of the window into which the vtkWidget shall be placed, and set the vtkWidget using SetVtkWidget(). After enabling the vtkWidget and calling Enable() of this class, the widget should be rendered.

Note
This class only provides a basic mechanism for adding a widget; all widget configuration such as placement, size, and en-/disabling of interaction mechanisms need to be done in the vtkWidget object.

Definition at line 38 of file mitkVtkWidgetRendering.h.

Constructor & Destructor Documentation

◆ VtkWidgetRendering()

mitk::VtkWidgetRendering::VtkWidgetRendering ( )
protected

Constructor. Creates an internal vtkRenderer.

◆ ~VtkWidgetRendering()

mitk::VtkWidgetRendering::~VtkWidgetRendering ( )
overrideprotected

Destructor. Disables the widget if still enabled.

Member Function Documentation

◆ Clone()

Pointer mitk::VtkWidgetRendering::Clone ( ) const

◆ Disable()

virtual void mitk::VtkWidgetRendering::Disable ( )
virtual

Disable drawing of the widget.

If you want to enable it, call the Enable() function.

◆ Enable()

virtual void mitk::VtkWidgetRendering::Enable ( )
virtual

Enable drawing of the widget.

If you want to disable it, call the Disable() function.

Precondition
SetRenderWindow() and SetVtkWidget() must have been called.

◆ GetRenderWindow()

virtual vtkRenderWindow* mitk::VtkWidgetRendering::GetRenderWindow ( )
virtual

Get the vtkRenderWindow used for displaying the widget.

Returns
The associated vtkRenderWindow, or nullptr if not yet set.

◆ GetVtkRenderer()

virtual vtkRenderer* mitk::VtkWidgetRendering::GetVtkRenderer ( )
virtual

Get the renderer responsible for rendering the widget into the vtkRenderWindow.

Returns
The internal vtkRenderer instance.

◆ GetVtkWidget()

vtkInteractorObserver* mitk::VtkWidgetRendering::GetVtkWidget ( ) const

Get the vtkWidget that is being rendered.

Returns
The currently set vtkInteractorObserver (widget), or nullptr.

◆ IsEnabled()

virtual bool mitk::VtkWidgetRendering::IsEnabled ( )
virtual

Check whether the widget is currently enabled (visible).

Returns
True if the widget is enabled, false otherwise.

◆ mitkClassMacro()

mitk::VtkWidgetRendering::mitkClassMacro ( VtkWidgetRendering  ,
BaseData   
)

◆ New()

static Pointer mitk::VtkWidgetRendering::New ( )
static

◆ RequestedRegionIsOutsideOfTheBufferedRegion()

bool mitk::VtkWidgetRendering::RequestedRegionIsOutsideOfTheBufferedRegion ( )
overridevirtual

Empty implementation; VtkWidgetRendering does not support the requested region concept.

Returns
Always false.

Implements mitk::BaseData.

◆ SetRenderWindow()

virtual void mitk::VtkWidgetRendering::SetRenderWindow ( vtkRenderWindow *  renderWindow)
virtual

Set the render window in which the widget will be shown.

Precondition
Must be called before calling Enable().
Parameters
[in]renderWindowThe vtkRenderWindow into which the widget is placed.

◆ SetRequestedRegion()

void mitk::VtkWidgetRendering::SetRequestedRegion ( const itk::DataObject *  )
overridevirtual

Empty implementation; VtkWidgetRendering does not support the requested region concept.

Implements mitk::BaseData.

◆ SetRequestedRegionToLargestPossibleRegion()

void mitk::VtkWidgetRendering::SetRequestedRegionToLargestPossibleRegion ( )
overridevirtual

Empty implementation; VtkWidgetRendering does not support the requested region concept.

Implements mitk::BaseData.

◆ SetVtkWidget()

void mitk::VtkWidgetRendering::SetVtkWidget ( vtkInteractorObserver *  widget)

Set the vtkWidget to be rendered.

Parameters
[in]widgetThe vtkInteractorObserver (widget) to render.

◆ VerifyRequestedRegion()

bool mitk::VtkWidgetRendering::VerifyRequestedRegion ( )
overridevirtual

Empty implementation; VtkWidgetRendering does not support the requested region concept.

Returns
Always true.

Implements mitk::BaseData.

Member Data Documentation

◆ m_IsEnabled

bool mitk::VtkWidgetRendering::m_IsEnabled
protected

Definition at line 148 of file mitkVtkWidgetRendering.h.

◆ m_Renderer

vtkRenderer* mitk::VtkWidgetRendering::m_Renderer
protected

Definition at line 144 of file mitkVtkWidgetRendering.h.

◆ m_RenderWindow

vtkRenderWindow* mitk::VtkWidgetRendering::m_RenderWindow
protected

Definition at line 143 of file mitkVtkWidgetRendering.h.

◆ m_VtkWidget

vtkInteractorObserver* mitk::VtkWidgetRendering::m_VtkWidget
protected

Definition at line 146 of file mitkVtkWidgetRendering.h.


The documentation for this class was generated from the following file: