13 #ifndef mitkAnnotation_h
14 #define mitkAnnotation_h
34 itk::Point<double, 2>
Size;
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>
183 bool GetBoolProperty(
const std::string &propertyKey,
bool &boolValue)
const;
190 bool GetIntProperty(
const std::string &propertyKey,
int &intValue)
const;
197 bool GetFloatProperty(
const std::string &propertyKey,
float &floatValue)
const;
204 bool GetDoubleProperty(
const std::string &propertyKey,
double &doubleValue)
const;
211 bool GetStringProperty(
const std::string &propertyKey, std::string &
string)
const;
217 void SetIntProperty(
const std::string &propertyKey,
int intValue);
223 void SetBoolProperty(
const std::string &propertyKey,
bool boolValue);
229 void SetFloatProperty(
const std::string &propertyKey,
float floatValue);
235 void SetDoubleProperty(
const std::string &propertyKey,
double doubleValue);
241 void SetStringProperty(
const std::string &propertyKey,
const std::string &
string);
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;
274 virtual std::string GetName()
const;
281 virtual void SetName(
const std::string &name);
288 bool GetColor(
float rgb[],
const std::string &propertyKey =
"color")
const;
293 void SetColor(
const mitk::Color &color,
const std::string &propertyKey =
"color");
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");
316 void SetText(std::string text);
318 std::string GetText()
const;
320 void SetFontSize(
int fontSize);
322 int GetFontSize()
const;
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");
356 virtual void AddToBaseRenderer(
BaseRenderer *renderer) = 0;
361 virtual void AddToRenderer(
BaseRenderer *renderer, vtkRenderer *vtkrenderer) = 0;
364 virtual void RemoveFromBaseRenderer(
BaseRenderer *renderer) = 0;
367 virtual void RemoveFromRenderer(
BaseRenderer *renderer, vtkRenderer *vtkrenderer) = 0;
373 virtual Bounds GetBoundsOnDisplay(
BaseRenderer *renderer)
const;
376 virtual void SetBoundsOnDisplay(
BaseRenderer *renderer,
const Bounds &);
378 void SetForceInForeground(
bool forceForeground);
380 bool IsForceInForeground()
const;
388 std::string GetMicroserviceID();
409 virtual void UnRegisterMicroservice();
411 void AnnotationModified();
435 void SetUSProperty(
const std::string &propertyKey,
us::Any value);
439 bool m_ForceInForeground;
450 unsigned long m_PropertyListModifiedObserverTag;
451 void PropertyListModified(
const itk::Object *,
const itk::EventObject &);