13 #ifndef mitkAnnotation_h
14 #define mitkAnnotation_h
45 itk::Point<double, 2>
Size;
73 void SetProperty(
const std::string &propertyKey,
const BaseProperty::Pointer &property);
85 void ReplaceProperty(
const std::string &propertyKey,
const BaseProperty::Pointer &property);
103 void AddProperty(
const std::string &propertyKey,
const BaseProperty::Pointer &property,
bool overwrite =
false);
147 template <
typename T>
150 property =
dynamic_cast<T *
>(GetProperty(propertyKey));
151 return property.IsNotNull();
165 template <
typename T>
166 bool GetProperty(T *&property,
const std::string &propertyKey)
const
168 property =
dynamic_cast<T *
>(GetProperty(propertyKey));
169 return property !=
nullptr;
177 template <
typename T>
258 bool IsOn(
const std::string &propertyKey,
bool defaultIsOn =
true)
const
260 GetBoolProperty(propertyKey, defaultIsOn);
269 bool GetName(std::string &nodeName,
const std::string &propertyKey =
"name")
const;
287 virtual void SetName(
const std::string &name);
294 bool GetColor(
float rgb[],
const std::string &propertyKey =
"color")
const;
304 void SetColor(
float red,
float green,
float blue,
const std::string &propertyKey =
"color");
309 void SetColor(
const float rgb[],
const std::string &propertyKey =
"color");
315 bool GetOpacity(
float &opacity,
const std::string &propertyKey =
"opacity")
const;
320 void SetOpacity(
float opacity,
const std::string &propertyKey =
"opacity");
336 bool GetVisibility(
bool &visible,
const std::string &propertyKey =
"visible")
const;
349 bool IsVisible(
const std::string &propertyKey =
"visible",
bool defaultIsOn =
true)
const;
357 void SetVisibility(
bool visible,
const std::string &propertyKey =
"visible");
456 bool m_ForceInForeground;
467 unsigned long m_PropertyListModifiedObserverTag;
468 void PropertyListModified(
const itk::Object *,
const itk::EventObject &);
Base class for mapper specific rendering resources.
itk::TimeStamp & GetLastGenerateDataTime()
itk::TimeStamp m_LastGenerateDataTime
timestamp of last update of stored data
bool IsGenerateDataRequired(mitk::BaseRenderer *renderer, mitk::Annotation *Annotation)
void UpdateGenerateDataTime()
Base class for all Annotation objects.
virtual void SetName(const std::string &name)
Extra convenience access method to set the name of an object.
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 proper...
virtual void AddToBaseRenderer(BaseRenderer *renderer)=0
Adds the Annotation to the specified renderer. Update Annotation should be called soon in order to ap...
void SetFontSize(int fontSize)
static const std::string US_PROPKEY_AnnotationNAME
bool GetStringProperty(const std::string &propertyKey, std::string &string) const
Convenience access method for string properties (instances of StringProperty)
mitk::BaseProperty * GetProperty(const std::string &propertyKey) const
Get the property (instance of BaseProperty) with key propertyKey from the PropertyList of the rendere...
bool GetPropertyValue(const std::string &propertyKey, T &value) const
Convenience access method for GenericProperty<T> properties (T being the type of the second parameter...
static const std::string US_INTERFACE_NAME
These Constants are used in conjunction with Microservices.
mitkClassMacroItkParent(Annotation, itk::Object)
void SetText(std::string text)
virtual Bounds GetBoundsOnDisplay(BaseRenderer *renderer) const
Returns position and size of the Annotation on the display.
void SetStringProperty(const std::string &propertyKey, const std::string &string)
Convenience method for setting string properties (instances of StringProperty).
bool GetFloatProperty(const std::string &propertyKey, float &floatValue) const
Convenience access method for float properties (instances of FloatProperty)
void SetColor(const mitk::Color &color, const std::string &propertyKey="color")
Convenience method for setting color properties (instances of ColorProperty)
virtual void SetBoundsOnDisplay(BaseRenderer *renderer, const Bounds &)
Sets position and size of the Annotation on the display.
bool GetColor(float rgb[], const std::string &propertyKey="color") const
Convenience access method for color properties (instances of ColorProperty)
bool IsOn(const std::string &propertyKey, bool defaultIsOn=true) const
Convenience access method for boolean properties (instances of BoolProperty). Return value is the val...
void ConcatenatePropertyList(PropertyList *pList, bool replace=false)
Add values from another PropertyList.
static const std::string US_PROPKEY_AR_ID
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,...
void SetDoubleProperty(const std::string &propertyKey, double doubleValue)
Convenience method for setting double properties (instances of DoubleProperty).
virtual std::string GetName() const
Extra convenience access method for accessing the name of an object (instance of StringProperty with ...
void ReplaceProperty(const std::string &propertyKey, const BaseProperty::Pointer &property)
Replace the property (instance of BaseProperty) with key propertyKey in the PropertyList of the rende...
static const std::string US_PROPKEY_RENDERER_ID
bool GetProperty(T *&property, const std::string &propertyKey) const
Get the property of type T with key propertyKey from the PropertyList of the renderer,...
bool GetIntProperty(const std::string &propertyKey, int &intValue) const
Convenience access method for int properties (instances of IntProperty)
PropertyList * GetPropertyList() const
void SetBoolProperty(const std::string &propertyKey, bool boolValue)
Convenience method for setting bool properties (instances of BoolProperty).
itk::TimeStamp m_DataReferenceChangedTime
Timestamp of the last change of m_Data.
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) wit...
void AnnotationModified()
virtual void UnRegisterMicroservice()
Registers this object as a Microservice, making it available to every module and/or plugin.
virtual void RemoveFromRenderer(BaseRenderer *renderer, vtkRenderer *vtkrenderer)=0
Removes the Annotation from the specified renderer. It is not visible anymore then.
void SetFloatProperty(const std::string &propertyKey, float floatValue)
Convenience method for setting float properties (instances of FloatProperty).
bool GetDoubleProperty(const std::string &propertyKey, double &doubleValue) const
Convenience access method for double properties (instances of DoubleProperty)
void SetColor(float red, float green, float blue, const std::string &propertyKey="color")
Convenience method for setting color properties (instances of ColorProperty)
virtual void RegisterAsMicroservice(us::ServiceProperties props)
Registers this object as a Microservice, making it available to every module and/or plugin....
Annotation()
explicit constructor which disallows implicit conversions
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 ...
static const std::string US_PROPKEY_MODIFIED
void SetUSProperty(const std::string &propertyKey, us::Any value)
void SetVisibility(bool visible, const std::string &propertyKey="visible")
Convenience method for setting visibility properties (instances of BoolProperty)
void SetOpacity(float opacity, const std::string &propertyKey="opacity")
Convenience method for setting opacity properties (instances of FloatProperty)
bool IsVisible(const std::string &propertyKey="visible", bool defaultIsOn=true) const
Convenience access method for visibility properties (instances of BoolProperty). Return value is the ...
bool IsForceInForeground() const
std::string GetMicroserviceID()
Returns the id that this device is registered with. The id will only be valid, if the Annotation has ...
~Annotation() override
virtual destructor in order to derive from this class
bool GetOpacity(float &opacity, const std::string &propertyKey="opacity") const
Convenience access method for opacity properties (instances of FloatProperty)
virtual void AddToRenderer(BaseRenderer *renderer, vtkRenderer *vtkrenderer)=0
Adds the Annotation to the specified renderer. Update Annotation should be called soon in order to ap...
static const std::string US_PROPKEY_ID
void SetColor(const float rgb[], const std::string &propertyKey="color")
Convenience method for setting color properties (instances of ColorProperty)
bool GetBoolProperty(const std::string &propertyKey, bool &boolValue) const
Convenience access method for bool properties (instances of BoolProperty)
virtual void RemoveFromBaseRenderer(BaseRenderer *renderer)=0
Removes the Annotation from the specified renderer. It is not visible anymore then.
PropertyList::Pointer m_PropertyList
BaseRenderer-independent PropertyList.
bool GetVisibility(bool &visible, const std::string &propertyKey="visible") const
Convenience access method for visibility properties (instances of BoolProperty with property-key "vis...
virtual void Update(BaseRenderer *renderer)=0
Applies all properties and should be called before the rendering procedure.
void SetForceInForeground(bool forceForeground)
std::string GetText() const
void RemoveFromAllRegisteredBaseRenderers(const std::vector< BaseRenderer * > &renderers) noexcept
Calls RemoveFromBaseRenderer on every non-null entry, swallowing any exception.
void SetIntProperty(const std::string &propertyKey, int intValue)
Convenience method for setting int properties (instances of IntProperty).
Abstract base class for properties.
Organizes the rendering process.
Template class for generating properties for simple value types (int, float, bool,...
virtual T GetValue() const
Get the property value.
Key-value list holding instances of BaseProperty.
An Any class represents a general type and is capable of storing any type, supporting type-safe extra...
std::unordered_map< std::string, Any > ServiceProperties
Provides the MITK_DECLARE_SERVICE_INTERFACE macro for registering C++ interfaces with both the CppMic...
#define MITK_DECLARE_SERVICE_INTERFACE(IFace, IId)
Declare a C++ interface for use with CppMicroServices (Qt not available).
Find image slices visible on a given plane.
static const char * replace[]
Dictionary for abbreviating class, module, and namespace names in log output.
itk::RGBPixel< float > Color
Standard RGB color typedef using float components.
Container for position and size on the display.
itk::Point< double, 2 > Size
itk::Point< double, 2 > Position