25 PropertyMap::const_iterator it;
44 auto it(m_Properties.find(propertyKey));
47 if (it != m_Properties.cend())
51 if (it->second->operator==(*property))
57 if (it->second->AssignProperty(*property))
64 MITK_ERROR <<
"In " __FILE__
", l." << __LINE__ <<
": Trying to set existing property " << it->first
65 <<
" of type " << it->second->GetNameOfClass() <<
" to a property with different type "
66 <<
property->GetNameOfClass() <<
"."
67 <<
" Use ReplaceProperty() instead." << std::endl;
73 m_Properties.insert(PropertyMap::value_type(propertyKey, property));
82 auto it(m_Properties.find(propertyKey));
85 if (it != m_Properties.cend())
88 m_Properties.erase(it);
92 m_Properties.insert(PropertyMap::value_type(propertyKey, property));
104 m_Properties.insert(std::make_pair(i->first, i->second->Clone()));
118 for (
auto it = m_Properties.cbegin(); it != m_Properties.cend(); ++it)
120 if (it->second.IsNull())
122 itkWarningMacro(<<
"Property '" << it->first <<
"' contains nothing (NULL).");
125 if (Superclass::GetMTime() < it->second->GetMTime())
132 return Superclass::GetMTime();
137 PropertyMap::iterator it = m_Properties.find(propertyKey);
139 if (it != m_Properties.end())
141 it->second =
nullptr;
142 m_Properties.erase(it);
151 auto it = m_Properties.begin(), end = m_Properties.end();
154 it->second =
nullptr;
157 m_Properties.clear();
163 result->UnRegister();
173 for (
auto iter = propertyMap->cbegin();
174 iter != propertyMap->cend();
177 const std::string key = iter->first;
181 ReplaceProperty(key.c_str(), value);
185 SetProperty(key.c_str(), value);
263 this->SetBoolProperty(propertyKey, boolValue);
268 this->SetIntProperty(propertyKey, intValue);
273 this->SetFloatProperty(propertyKey, floatValue);
278 this->SetDoubleProperty(propertyKey, doubleValue);
283 this->SetStringProperty(propertyKey, stringValue);
288 this->SetStringProperty(propertyKey, stringValue.c_str());
293 return this->GetBoolProperty(propertyKey, boolValue);
298 return this->GetIntProperty(propertyKey, intValue);
303 return this->GetFloatProperty(propertyKey, floatValue);
308 return this->GetDoubleProperty(propertyKey, doubleValue);
313 return this->GetStringProperty(propertyKey, stringValue);
mitk::BaseProperty * GetProperty(const std::string &propertyKey) const
Get a property by its name.
itk::SmartPointer< Self > Pointer
void SetBoolProperty(const char *propertyKey, bool boolValue)
Convenience method to set the value of a BoolProperty.
virtual unsigned long GetMTime() const override
Get the timestamp of the last change of the map or the last change of one of the properties store in ...
void SetProperty(const std::string &propertyKey, BaseProperty *property)
Set a property in the list/map by value.
void SetDoubleProperty(const char *propertyKey, double doubleValue)
Convenience method to set the value of a DoubleProperty.
bool GetBoolProperty(const char *propertyKey, bool &boolValue) const
Convenience method to access the value of a BoolProperty.
void ConcatenatePropertyList(PropertyList *pList, bool replace=false)
Set a property object in the list/map by reference.
Key-value list holding instances of BaseProperty.
bool GetIntProperty(const char *propertyKey, int &intValue) const
Convenience method to access the value of an IntProperty.
bool DeleteProperty(const std::string &propertyKey)
Remove a property from the list/map.
virtual const char * GetValue() const
Abstract base class for properties.
std::map< std::string, BaseProperty::Pointer > PropertyMap
void ReplaceProperty(const std::string &propertyKey, BaseProperty *property)
Set a property object in the list/map by reference.
bool GetDoubleProperty(const char *propertyKey, double &doubleValue) const
Convenience method to access the value of a DoubleProperty.
PropertyMap m_Properties
Map of properties.
bool Get(const char *propertyKey, bool &boolValue) const
ShortCut for the above method.
static const char * replace[]
This is a dictionary to replace long names of classes, modules, etc. to shorter versions in the conso...
void Set(const char *propertyKey, bool boolValue)
ShortCut for the above method.
void SetStringProperty(const char *propertyKey, const char *stringValue)
Convenience method to set the value of a StringProperty.
void SetIntProperty(const char *propertyKey, int intValue)
Convenience method to set the value of an IntProperty.
void SetFloatProperty(const char *propertyKey, float floatValue)
Convenience method to set the value of a FloatProperty.
bool GetStringProperty(const char *propertyKey, std::string &stringValue) const
Convenience method to access the value of a StringProperty.
const PropertyMap * GetMap() const
bool GetFloatProperty(const char *propertyKey, float &floatValue) const
Convenience method to access the value of a FloatProperty.
virtual T GetValue() const