22 this->
SetName(this->GetNameOfClass());
35 GetPropertyList(renderer)->SetProperty(propertyKey, propertyValue);
36 GetPropertyList(renderer)->Modified();
43 GetPropertyList(renderer)->ReplaceProperty(propertyKey, propertyValue);
44 GetPropertyList(renderer)->Modified();
52 if ((overwrite) || (GetProperty(propertyKey, renderer) == NULL))
54 SetProperty(propertyKey, propertyValue, renderer);
60 m_PropertyList->ConcatenatePropertyList(pList, replace);
68 std::map<const mitk::BaseRenderer *, mitk::PropertyList::Pointer>::const_iterator it;
70 it = m_MapOfPropertyLists.find(renderer);
71 if (it != m_MapOfPropertyLists.cend())
74 if (property.IsNotNull())
77 return m_PropertyList->GetProperty(propertyKey);
82 return m_PropertyList->GetProperty(propertyKey);
88 if (property.IsNotNull())
99 if (boolprop.IsNull())
102 boolValue = boolprop->GetValue();
109 if (intprop.IsNull())
112 intValue = intprop->GetValue();
121 if (floatprop.IsNull())
124 floatValue = floatprop->GetValue();
133 if (stringProp.IsNull())
140 string = stringProp->GetValue();
184 this->SetStringProperty(
"name", name);
189 return GetStringProperty(propertyKey, nodeName, renderer);
194 SetStringProperty(
"Text", text.c_str(), renderer);
200 GetStringProperty(
"Text", text, renderer);
206 SetIntProperty(
"FontSize", fontSize, renderer);
212 GetIntProperty(
"FontSize", fontSize, renderer);
218 return GetBoolProperty(propertyKey, visible, renderer);
223 return IsOn(propertyKey, renderer, defaultIsOn);
229 if (colorprop.IsNull())
232 memcpy(rgb, colorprop->GetColor().GetDataPointer(), 3 *
sizeof(float));
240 GetPropertyList(renderer)->SetProperty(propertyKey, prop);
244 float red,
float green,
float blue,
mitk::BaseRenderer *renderer,
const std::string &propertyKey)
250 SetColor(color, renderer, propertyKey);
257 GetPropertyList(renderer)->SetProperty(propertyKey, prop);
263 if (opacityprop.IsNull())
266 opacity = opacityprop->GetValue();
274 GetPropertyList(renderer)->SetProperty(propertyKey, prop);
281 GetPropertyList(renderer)->SetProperty(propertyKey, prop);
286 if (renderer == NULL)
287 return m_PropertyList;
291 if (propertyList.IsNull())
294 assert(m_MapOfPropertyLists[renderer].IsNotNull());
301 if (m_LastGenerateDataTime < overlay->GetMTime())
304 if (m_LastGenerateDataTime < overlay->GetPropertyList()->GetMTime())
307 if (m_LastGenerateDataTime < overlay->GetPropertyList(renderer)->GetMTime())
310 if (renderer && m_LastGenerateDataTime < renderer->GetTimeStepUpdateTime())
329 m_ForceInForeground = forceForeground;
334 return m_ForceInForeground;
void SetVisibility(bool visible, mitk::BaseRenderer *renderer=nullptr, const std::string &propertyKey="visible")
Convenience method for setting visibility properties (instances of BoolProperty)
void AddProperty(const std::string &propertyKey, const BaseProperty::Pointer &property, const mitk::BaseRenderer *renderer=nullptr, bool overwrite=false)
Add the property (instance of BaseProperty) if it does not exist (or always if overwrite is true) wit...
virtual std::string GetName() const
Extra convenience access method for accessing the name of an object (instance of StringProperty with ...
virtual void SetBoundsOnDisplay(BaseRenderer *renderer, const Bounds &)
Sets position and size of the overlay on the display.
void ConcatenatePropertyList(PropertyList *pList, bool replace=false)
Add values from another PropertyList.
virtual Bounds GetBoundsOnDisplay(BaseRenderer *renderer) const
Returns position and size of the overlay on the display.
mitk::BaseProperty * GetProperty(const std::string &propertyKey, const mitk::BaseRenderer *renderer=nullptr) const
Get the property (instance of BaseProperty) with key propertyKey from the PropertyList of the rendere...
int GetFontSize(mitk::BaseRenderer *renderer=nullptr) const
bool GetVisibility(bool &visible, mitk::BaseRenderer *renderer, const std::string &propertyKey="visible") const
Convenience access method for visibility properties (instances of BoolProperty with property-key "vis...
itk::Point< double, 2 > Size
void SetFloatProperty(const std::string &propertyKey, float floatValue, mitk::BaseRenderer *renderer=nullptr)
Convenience method for setting int properties (instances of IntProperty)
Organizes the rendering process.
bool IsForceInForeground() const
itk::Point< double, 2 > Position
Key-value list holding instances of BaseProperty.
void ReplaceProperty(const std::string &propertyKey, const BaseProperty::Pointer &property, const mitk::BaseRenderer *renderer=nullptr)
Replace the property (instance of BaseProperty) with key propertyKey in the PropertyList of the rende...
void SetColor(const mitk::Color &color, mitk::BaseRenderer *renderer=nullptr, const std::string &propertyKey="color")
Convenience method for setting color properties (instances of ColorProperty)
PropertyList::Pointer m_PropertyList
BaseRenderer-independent PropertyList.
bool GetStringProperty(const std::string &propertyKey, std::string &string, mitk::BaseRenderer *renderer=nullptr) const
Convenience access method for string properties (instances of StringProperty)
void SetIntProperty(const std::string &propertyKey, int intValue, mitk::BaseRenderer *renderer=nullptr)
Convenience method for setting int properties (instances of IntProperty)
virtual const char * GetValue() const
void SetForceInForeground(bool forceForeground)
The ColorProperty class RGB color property.
bool GetColor(float rgb[], mitk::BaseRenderer *renderer=nullptr, const std::string &propertyKey="color") const
Convenience access method for color properties (instances of ColorProperty)
Abstract base class for properties.
bool GetOpacity(float &opacity, mitk::BaseRenderer *renderer, const std::string &propertyKey="opacity") const
Convenience access method for opacity properties (instances of FloatProperty)
bool GetFloatProperty(const std::string &propertyKey, float &floatValue, mitk::BaseRenderer *renderer=nullptr) const
Convenience access method for float properties (instances of FloatProperty)
virtual ~Overlay()
virtual destructor in order to derive from this class
bool GetIntProperty(const std::string &propertyKey, int &intValue, mitk::BaseRenderer *renderer=nullptr) const
Convenience access method for int properties (instances of IntProperty)
void SetProperty(const std::string &propertyKey, const BaseProperty::Pointer &property, const mitk::BaseRenderer *renderer=nullptr)
Set the property (instance of BaseProperty) with key propertyKey in the PropertyList of the renderer ...
bool IsVisible(mitk::BaseRenderer *renderer, const std::string &propertyKey="visible", bool defaultIsOn=true) const
Convenience access method for visibility properties (instances of BoolProperty). Return value is the ...
itk::RGBPixel< float > Color
Color Standard RGB color typedef (float)
bool GetBoolProperty(const std::string &propertyKey, bool &boolValue, mitk::BaseRenderer *renderer=nullptr) const
Convenience access method for bool properties (instances of BoolProperty)
void SetOpacity(float opacity, mitk::BaseRenderer *renderer=nullptr, const std::string &propertyKey="opacity")
Convenience method for setting opacity properties (instances of FloatProperty)
void SetFontSize(int fontSize, mitk::BaseRenderer *renderer=nullptr)
virtual void SetName(const std::string &name)
Extra convenience access method to set the name of an object.
void SetBoolProperty(const std::string &propertyKey, bool boolValue, mitk::BaseRenderer *renderer=nullptr)
Convenience method for setting int properties (instances of IntProperty)
Overlay()
explicit constructor which disallows implicit conversions
Base class for all overlays.
static const char * replace[]
This is a dictionary to replace long names of classes, modules, etc. to shorter versions in the conso...
bool IsGenerateDataRequired(mitk::BaseRenderer *renderer, mitk::Overlay *overlay)
void SetText(std::string text, mitk::BaseRenderer *renderer=nullptr)
std::string GetText(mitk::BaseRenderer *renderer=nullptr) const
void SetStringProperty(const std::string &propertyKey, const std::string &string, mitk::BaseRenderer *renderer=nullptr)
Convenience method for setting int properties (instances of IntProperty)
Container for position and size on the display.
mitk::PropertyList * GetPropertyList(const mitk::BaseRenderer *renderer=nullptr) const
Get the PropertyList of the renderer. If renderer is NULL, the BaseRenderer-independent PropertyList ...