13 #ifndef mitkEnumerationProperty_h
14 #define mitkEnumerationProperty_h
42 itkFactorylessNewMacro(Self);
77 virtual bool SetValue(
const std::string &name);
114 virtual EnumIdsContainerType::size_type
Size()
const;
217 using BaseProperty::operator=;
Abstract base class for properties.
Property for storing enumeration-like values identified by id and name.
virtual bool IsValidEnumerationValue(const IdType &id) const
Check whether a given id corresponds to a valid enumeration value.
bool FromJSON(const nlohmann::json &j) override
Deserialize the enumeration value from JSON.
virtual bool SetValue(const IdType &id)
Set the current value of the enumeration by id.
virtual void Clear()
Remove all enumeration values and reset the current selection.
virtual EnumConstIterator End() const
Get an iterator past the last enumeration value.
const EnumStringsContainerType & GetEnumStrings() const
Get a const reference to the name-to-id map.
virtual bool IsValidEnumerationValue(const std::string &name) const
Check whether a given name corresponds to a valid enumeration value.
virtual bool AddEnum(const std::string &name, const IdType &id)
Add an enumeration value.
virtual std::string GetEnumString(const IdType &id) const
Get the name string for a given enumeration id.
std::map< std::string, IdType > EnumStringsContainerType
Map type storing name-to-id mappings.
bool IsEqual(const BaseProperty &property) const override
virtual IdType GetValueAsId() const
Get the id of the currently selected enumeration value.
EnumIdsContainerType::const_iterator EnumConstIterator
Const iterator type for iterating over enumeration values.
bool Assign(const BaseProperty &property) override
EnumerationProperty(const EnumerationProperty &)
EnumStringsContainerType & GetEnumStrings()
Get a mutable reference to the name-to-id map.
virtual EnumConstIterator Begin() const
Get an iterator to the first enumeration value.
virtual bool SetValue(const std::string &name)
Set the current value of the enumeration by name.
const EnumIdsContainerType & GetEnumIds() const
Get a const reference to the id-to-name map.
unsigned int IdType
Unsigned integer type used as unique enumeration value identifier.
EnumerationProperty & operator=(const EnumerationProperty &)=delete
std::string GetValueAsString() const override
Get the name of the currently selected enumeration value.
EnumIdsContainerType & GetEnumIds()
Get a mutable reference to the id-to-name map.
mitkClassMacro(EnumerationProperty, BaseProperty)
bool ToJSON(nlohmann::json &j) const override
Serialize the current enumeration value to JSON.
virtual IdType GetEnumId(const std::string &name) const
Get the id for a given enumeration name.
virtual EnumIdsContainerType::size_type Size() const
Get the number of defined enumeration values.
std::map< IdType, std::string > EnumIdsContainerType
Map type storing id-to-name mappings.
Find image slices visible on a given plane.