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

Displays text on the renderwindow. More...

#include <mitkTextAnnotation2D.h>

Inheritance diagram for mitk::TextAnnotation2D:
Collaboration diagram for mitk::TextAnnotation2D:

Classes

class  LocalStorage
 

Public Member Functions

 mitkClassMacro (TextAnnotation2D, mitk::VtkAnnotation2D)
 
Pointer Clone () const
 
Annotation::Bounds GetBoundsOnDisplay (BaseRenderer *renderer) const override
 Returns position and size of the Annotation on the display. More...
 
void SetBoundsOnDisplay (BaseRenderer *renderer, const Bounds &bounds) override
 Sets position and size of the Annotation on the display. More...
 
- Public Member Functions inherited from mitk::VtkAnnotation2D
 mitkClassMacro (VtkAnnotation2D, VtkAnnotation)
 
Annotation::Bounds GetBoundsOnDisplay (BaseRenderer *renderer) const override
 Get the bounding rectangle of this annotation on the display. More...
 
void SetBoundsOnDisplay (BaseRenderer *renderer, const Bounds &bounds) override
 Set the bounding rectangle of this annotation on the display. More...
 
void SetPosition2D (const Point2D &position2D)
 Set the 2D position in display coordinates. More...
 
Point2D GetPosition2D () const
 Get the 2D position in display coordinates. More...
 
void SetOffsetVector (const Point2D &OffsetVector)
 Set an offset vector added to the position. More...
 
Point2D GetOffsetVector () const
 Get the offset vector. More...
 
- Public Member Functions inherited from mitk::VtkAnnotation
 mitkClassMacro (VtkAnnotation, Annotation)
 
void Update (BaseRenderer *renderer) override
 Update the annotation for the given renderer. More...
 
void AddToBaseRenderer (BaseRenderer *renderer) override
 Add this annotation's vtkProp to the given BaseRenderer. More...
 
void AddToRenderer (BaseRenderer *renderer, vtkRenderer *vtkrenderer) override
 Add this annotation's vtkProp to a specific vtkRenderer. More...
 
void RemoveFromRenderer (BaseRenderer *renderer, vtkRenderer *vtkrenderer) override
 Remove this annotation's vtkProp from a specific vtkRenderer. More...
 
void RemoveFromBaseRenderer (BaseRenderer *renderer) override
 Remove this annotation's vtkProp from the given BaseRenderer. More...
 
void Paint (BaseRenderer *renderer)
 Force an immediate paint of this annotation. More...
 
- Public Member Functions inherited from mitk::Annotation
void SetProperty (const std::string &propertyKey, const BaseProperty::Pointer &property)
 Set the property (instance of BaseProperty) with key propertyKey in the PropertyList of the renderer (if nullptr, use BaseRenderer-independent PropertyList). This is set-by-value. More...
 
void ReplaceProperty (const std::string &propertyKey, const BaseProperty::Pointer &property)
 Replace the property (instance of BaseProperty) with key propertyKey in the PropertyList of the renderer (if nullptr, use BaseRenderer-independent PropertyList). This is set-by-reference. More...
 
void AddProperty (const std::string &propertyKey, const BaseProperty::Pointer &property, bool overwrite=false)
 Add the property (instance of BaseProperty) if it does not exist (or always if overwrite is true) with key propertyKey in the PropertyList of the renderer (if nullptr, use BaseRenderer-independent PropertyList). This is set-by-value. More...
 
void ConcatenatePropertyList (PropertyList *pList, bool replace=false)
 Add values from another PropertyList. More...
 
mitk::BaseProperty * GetProperty (const std::string &propertyKey) const
 Get the property (instance of BaseProperty) with key propertyKey from the PropertyList of the renderer, if available there, otherwise use the BaseRenderer-independent PropertyList. More...
 
template<typename T >
bool GetProperty (itk::SmartPointer< T > &property, const std::string &propertyKey) const
 Get the property of type T with key propertyKey from the PropertyList of the renderer, if available there, otherwise use the BaseRenderer-independent PropertyList. More...
 
template<typename T >
bool GetProperty (T *&property, const std::string &propertyKey) const
 Get the property of type T with key propertyKey from the PropertyList of the renderer, if available there, otherwise use the BaseRenderer-independent PropertyList. More...
 
template<typename T >
bool GetPropertyValue (const std::string &propertyKey, T &value) const
 Convenience access method for GenericProperty<T> properties (T being the type of the second parameter) More...
 
bool GetBoolProperty (const std::string &propertyKey, bool &boolValue) const
 Convenience access method for bool properties (instances of BoolProperty) More...
 
bool GetIntProperty (const std::string &propertyKey, int &intValue) const
 Convenience access method for int properties (instances of IntProperty) More...
 
bool GetFloatProperty (const std::string &propertyKey, float &floatValue) const
 Convenience access method for float properties (instances of FloatProperty) More...
 
bool GetDoubleProperty (const std::string &propertyKey, double &doubleValue) const
 Convenience access method for double properties (instances of DoubleProperty) More...
 
bool GetStringProperty (const std::string &propertyKey, std::string &string) const
 Convenience access method for string properties (instances of StringProperty) More...
 
void SetIntProperty (const std::string &propertyKey, int intValue)
 Convenience method for setting int properties (instances of IntProperty). More...
 
void SetBoolProperty (const std::string &propertyKey, bool boolValue)
 Convenience method for setting bool properties (instances of BoolProperty). More...
 
void SetFloatProperty (const std::string &propertyKey, float floatValue)
 Convenience method for setting float properties (instances of FloatProperty). More...
 
void SetDoubleProperty (const std::string &propertyKey, double doubleValue)
 Convenience method for setting double properties (instances of DoubleProperty). More...
 
void SetStringProperty (const std::string &propertyKey, const std::string &string)
 Convenience method for setting string properties (instances of StringProperty). More...
 
bool IsOn (const std::string &propertyKey, bool defaultIsOn=true) const
 Convenience access method for boolean properties (instances of BoolProperty). Return value is the value of the property. If the property is not found, the value of defaultIsOn is returned. More...
 
bool GetName (std::string &nodeName, const std::string &propertyKey="name") const
 Convenience access method for accessing the name of an object (instance of StringProperty with property-key "name") More...
 
virtual std::string GetName () const
 Extra convenience access method for accessing the name of an object (instance of StringProperty with property-key "name"). More...
 
virtual void SetName (const std::string &name)
 Extra convenience access method to set the name of an object. More...
 
bool GetColor (float rgb[], const std::string &propertyKey="color") const
 Convenience access method for color properties (instances of ColorProperty) More...
 
void SetColor (const mitk::Color &color, const std::string &propertyKey="color")
 Convenience method for setting color properties (instances of ColorProperty) More...
 
void SetColor (float red, float green, float blue, const std::string &propertyKey="color")
 Convenience method for setting color properties (instances of ColorProperty) More...
 
void SetColor (const float rgb[], const std::string &propertyKey="color")
 Convenience method for setting color properties (instances of ColorProperty) More...
 
bool GetOpacity (float &opacity, const std::string &propertyKey="opacity") const
 Convenience access method for opacity properties (instances of FloatProperty) More...
 
void SetOpacity (float opacity, const std::string &propertyKey="opacity")
 Convenience method for setting opacity properties (instances of FloatProperty) More...
 
void SetText (std::string text)
 
std::string GetText () const
 
void SetFontSize (int fontSize)
 
int GetFontSize () const
 
bool GetVisibility (bool &visible, const std::string &propertyKey="visible") const
 Convenience access method for visibility properties (instances of BoolProperty with property-key "visible") More...
 
bool IsVisible (const std::string &propertyKey="visible", bool defaultIsOn=true) const
 Convenience access method for visibility properties (instances of BoolProperty). Return value is the visibility. Default is visible==true, i.e., true is returned even if the property (propertyKey) is not found. More...
 
void SetVisibility (bool visible, const std::string &propertyKey="visible")
 Convenience method for setting visibility properties (instances of BoolProperty) More...
 
void SetForceInForeground (bool forceForeground)
 
bool IsForceInForeground () const
 
PropertyList * GetPropertyList () const
 
std::string GetMicroserviceID ()
 Returns the id that this device is registered with. The id will only be valid, if the Annotation has been registered using RegisterAsMicroservice(). More...
 
virtual void RegisterAsMicroservice (us::ServiceProperties props)
 Registers this object as a Microservice, making it available to every module and/or plugin. To unregister, call UnregisterMicroservice(). More...
 
virtual void UnRegisterMicroservice ()
 Registers this object as a Microservice, making it available to every module and/or plugin. More...
 
void AnnotationModified ()
 
 mitkClassMacroItkParent (Annotation, itk::Object)
 

Static Public Member Functions

static Pointer New ()
 

Protected Member Functions

vtkProp * GetVtkProp (BaseRenderer *renderer) const override
 Create the VTK prop representing this annotation. More...
 
vtkActor2D * GetVtkActor2D (BaseRenderer *renderer) const override
 
void UpdateVtkAnnotation2D (mitk::BaseRenderer *renderer) override
 
 TextAnnotation2D ()
 explicit constructor which disallows implicit conversions More...
 
 ~TextAnnotation2D () override
 virtual destructor in order to derive from this class More...
 
- Protected Member Functions inherited from mitk::VtkAnnotation2D
vtkProp * GetVtkProp (BaseRenderer *renderer) const override
 Create the VTK prop representing this annotation. More...
 
void UpdateVtkAnnotation (BaseRenderer *renderer) override
 
 VtkAnnotation2D ()
 explicit constructor which disallows implicit conversions More...
 
 ~VtkAnnotation2D () override
 virtual destructor in order to derive from this class More...
 
- Protected Member Functions inherited from mitk::VtkAnnotation
 VtkAnnotation ()
 explicit constructor which disallows implicit conversions More...
 
 ~VtkAnnotation () override
 virtual destructor in order to derive from this class More...
 
- Protected Member Functions inherited from mitk::Annotation
 Annotation ()
 explicit constructor which disallows implicit conversions More...
 
 ~Annotation () override
 virtual destructor in order to derive from this class More...
 
void SetUSProperty (const std::string &propertyKey, us::Any value)
 
void RemoveFromAllRegisteredBaseRenderers (const std::vector< BaseRenderer * > &renderers) noexcept
 Calls RemoveFromBaseRenderer on every non-null entry, swallowing any exception. More...
 

Protected Attributes

mitk::LocalStorageHandler< LocalStorage > m_LSH
 The LocalStorageHandler holds all LocalStorages for the render windows. More...
 
- Protected Attributes inherited from mitk::Annotation
PropertyList::Pointer m_PropertyList
 BaseRenderer-independent PropertyList. More...
 
itk::TimeStamp m_DataReferenceChangedTime
 Timestamp of the last change of m_Data. More...
 

Additional Inherited Members

- Static Public Attributes inherited from mitk::Annotation
static const std::string US_INTERFACE_NAME
 These Constants are used in conjunction with Microservices. More...
 
static const std::string US_PROPKEY_AnnotationNAME
 
static const std::string US_PROPKEY_ID
 
static const std::string US_PROPKEY_MODIFIED
 
static const std::string US_PROPKEY_RENDERER_ID
 
static const std::string US_PROPKEY_AR_ID
 

Detailed Description

Displays text on the renderwindow.

Definition at line 28 of file mitkTextAnnotation2D.h.

Constructor & Destructor Documentation

◆ TextAnnotation2D()

mitk::TextAnnotation2D::TextAnnotation2D ( )
explicitprotected

explicit constructor which disallows implicit conversions

◆ ~TextAnnotation2D()

mitk::TextAnnotation2D::~TextAnnotation2D ( )
overrideprotected

virtual destructor in order to derive from this class

Member Function Documentation

◆ Clone()

Pointer mitk::TextAnnotation2D::Clone ( ) const

◆ GetBoundsOnDisplay()

Annotation::Bounds mitk::TextAnnotation2D::GetBoundsOnDisplay ( BaseRenderer *  renderer) const
overridevirtual

Returns position and size of the Annotation on the display.

Reimplemented from mitk::Annotation.

◆ GetVtkActor2D()

vtkActor2D* mitk::TextAnnotation2D::GetVtkActor2D ( BaseRenderer *  renderer) const
overrideprotectedvirtual

Implements mitk::VtkAnnotation2D.

◆ GetVtkProp()

vtkProp* mitk::TextAnnotation2D::GetVtkProp ( BaseRenderer *  renderer) const
overrideprotectedvirtual

Create the VTK prop representing this annotation.

Must be implemented by subclasses.

Returns
The vtkProp element created by the subclass.

Implements mitk::VtkAnnotation.

◆ mitkClassMacro()

mitk::TextAnnotation2D::mitkClassMacro ( TextAnnotation2D  ,
mitk::VtkAnnotation2D   
)

◆ New()

static Pointer mitk::TextAnnotation2D::New ( )
static

◆ SetBoundsOnDisplay()

void mitk::TextAnnotation2D::SetBoundsOnDisplay ( BaseRenderer *  renderer,
const Bounds &   
)
overridevirtual

Sets position and size of the Annotation on the display.

Reimplemented from mitk::Annotation.

◆ UpdateVtkAnnotation2D()

void mitk::TextAnnotation2D::UpdateVtkAnnotation2D ( mitk::BaseRenderer *  renderer)
overrideprotectedvirtual

Implements mitk::VtkAnnotation2D.

Member Data Documentation

◆ m_LSH

mitk::LocalStorageHandler<LocalStorage> mitk::TextAnnotation2D::m_LSH
mutableprotected

The LocalStorageHandler holds all LocalStorages for the render windows.

Definition at line 63 of file mitkTextAnnotation2D.h.


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