13 #ifndef mitkAnnotation_h
14 #define mitkAnnotation_h
34 itk::Point<double, 2>
Size;
62 void SetProperty(
const std::string &propertyKey,
const BaseProperty::Pointer &property);
74 void ReplaceProperty(
const std::string &propertyKey,
const BaseProperty::Pointer &property);
92 void AddProperty(
const std::string &propertyKey,
const BaseProperty::Pointer &property,
bool overwrite =
false);
136 template <
typename T>
139 property =
dynamic_cast<T *
>(GetProperty(propertyKey));
140 return property.IsNotNull();
154 template <
typename T>
155 bool GetProperty(T *&property,
const std::string &propertyKey)
const
157 property =
dynamic_cast<T *
>(GetProperty(propertyKey));
158 return property !=
nullptr;
166 template <
typename T>
252 bool IsOn(
const std::string &propertyKey,
bool defaultIsOn =
true)
const
254 GetBoolProperty(propertyKey, defaultIsOn);
263 bool GetName(std::string &nodeName,
const std::string &propertyKey =
"name")
const;
281 virtual void SetName(
const std::string &name);
288 bool GetColor(
float rgb[],
const std::string &propertyKey =
"color")
const;
298 void SetColor(
float red,
float green,
float blue,
const std::string &propertyKey =
"color");
303 void SetColor(
const float rgb[],
const std::string &propertyKey =
"color");
309 bool GetOpacity(
float &opacity,
const std::string &propertyKey =
"opacity")
const;
314 void SetOpacity(
float opacity,
const std::string &propertyKey =
"opacity");
330 bool GetVisibility(
bool &visible,
const std::string &propertyKey =
"visible")
const;
343 bool IsVisible(
const std::string &propertyKey =
"visible",
bool defaultIsOn =
true)
const;
351 void SetVisibility(
bool visible,
const std::string &propertyKey =
"visible");
439 bool m_ForceInForeground;
450 unsigned long m_PropertyListModifiedObserverTag;
451 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 This class is to be implemented in order to create Annotation which are...
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 int properties (instances of IntProperty)
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 int properties (instances of IntProperty)
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 int properties (instances of IntProperty)
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 int properties (instances of IntProperty)
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 SetIntProperty(const std::string &propertyKey, int intValue)
Convenience method for setting int properties (instances of IntProperty)
Abstract base class for properties.
virtual T GetValue() const
Key-value list holding instances of BaseProperty.
US_UNORDERED_MAP_TYPE< std::string, Any > ServiceProperties
#define MITK_DECLARE_SERVICE_INTERFACE(IFace, IId)
Find image slices visible on a given plane.
static const char * replace[]
This is a dictionary to replace long names of classes, modules, etc. to shorter versions in the conso...
itk::RGBPixel< float > Color
Color Standard RGB color typedef (float)
Container for position and size on the display.
itk::Point< double, 2 > Size
itk::Point< double, 2 > Position