Medical Imaging Interaction Toolkit
2024.06.99-60d9b802
Medical Imaging Interaction Toolkit
|
#include <mitkEnumerationProperty.h>
Public Types | |
typedef EnumerationProperty | Self |
typedef BaseProperty | Superclass |
typedef itk::SmartPointer< Self > | Pointer |
typedef itk::SmartPointer< const Self > | ConstPointer |
typedef unsigned int | IdType |
typedef std::map< IdType, std::string > | EnumIdsContainerType |
typedef std::map< std::string, IdType > | EnumStringsContainerType |
typedef EnumIdsContainerType::const_iterator | EnumConstIterator |
Public Types inherited from mitk::BaseProperty | |
typedef BaseProperty | Self |
typedef itk::Object | Superclass |
typedef itk::SmartPointer< Self > | Pointer |
typedef itk::SmartPointer< const Self > | ConstPointer |
Public Member Functions | |
virtual std::vector< std::string > | GetClassHierarchy () const override |
virtual const char * | GetClassName () const |
Pointer | Clone () const |
virtual bool | AddEnum (const std::string &name, const IdType &id) |
virtual bool | SetValue (const std::string &name) |
virtual bool | SetValue (const IdType &id) |
virtual IdType | GetValueAsId () const |
std::string | GetValueAsString () const override |
virtual void | Clear () |
virtual EnumIdsContainerType::size_type | Size () const |
virtual EnumConstIterator | Begin () const |
virtual EnumConstIterator | End () const |
virtual std::string | GetEnumString (const IdType &id) const |
virtual IdType | GetEnumId (const std::string &name) const |
virtual bool | IsValidEnumerationValue (const IdType &id) const |
virtual bool | IsValidEnumerationValue (const std::string &name) const |
const EnumIdsContainerType & | GetEnumIds () const |
const EnumStringsContainerType & | GetEnumStrings () const |
EnumIdsContainerType & | GetEnumIds () |
EnumStringsContainerType & | GetEnumStrings () |
bool | ToJSON (nlohmann::json &j) const override |
bool | FromJSON (const nlohmann::json &j) override |
EnumerationProperty & | operator= (const EnumerationProperty &)=delete |
BaseProperty & | operator= (const BaseProperty &property) |
Assigns property to this BaseProperty instance. More... | |
Public Member Functions inherited from mitk::BaseProperty | |
Pointer | Clone () const |
bool | operator== (const BaseProperty &property) const |
Subclasses must implement IsEqual(const BaseProperty&) to support comparison. More... | |
BaseProperty & | operator= (const BaseProperty &property) |
Assigns property to this BaseProperty instance. More... | |
bool | AssignProperty (const BaseProperty &property) |
Assigns property to this BaseProperty instance. More... | |
Static Public Member Functions | |
static const char * | GetStaticNameOfClass () |
static Pointer | New () |
Static Public Member Functions inherited from mitk::BaseProperty | |
static const char * | GetStaticNameOfClass () |
Protected Member Functions | |
EnumerationProperty () | |
EnumerationProperty (const EnumerationProperty &) | |
bool | IsEqual (const BaseProperty &property) const override |
bool | Assign (const BaseProperty &property) override |
virtual itk::LightObject::Pointer | InternalClone () const override |
Protected Member Functions inherited from mitk::BaseProperty | |
BaseProperty () | |
BaseProperty (const BaseProperty &other) | |
~BaseProperty () override | |
Additional Inherited Members | |
Static Public Attributes inherited from mitk::BaseProperty | |
static const std::string | VALUE_CANNOT_BE_CONVERTED_TO_STRING |
Default return value if a property which can not be returned as string. More... | |
This class may be used to store properties similar to enumeration values. Each enumeration value is identified by an id and a name. Note that both name and id must be unique. Add enumeration values before you use the Get/SetValue methods.
To use this class, create a subclass that adds the possible enumeration values in its constructor. You should override AddEnum() as protected so that the user isn't able to add invalid enumeration values.
As example see mitk::VtkRepresentationProperty or mitk::VtkInterpolationProperty.
Definition at line 43 of file mitkEnumerationProperty.h.
typedef itk::SmartPointer<const Self> mitk::EnumerationProperty::ConstPointer |
Definition at line 46 of file mitkEnumerationProperty.h.
typedef EnumIdsContainerType::const_iterator mitk::EnumerationProperty::EnumConstIterator |
Type used for iterators over all defined enumeration values.
Definition at line 68 of file mitkEnumerationProperty.h.
typedef std::map<IdType, std::string> mitk::EnumerationProperty::EnumIdsContainerType |
Type used to store a mapping from enumeration id to enumeration name.
Definition at line 58 of file mitkEnumerationProperty.h.
typedef std::map<std::string, IdType> mitk::EnumerationProperty::EnumStringsContainerType |
Type used to store a mapping from enumeration name to enumeration id.
Definition at line 63 of file mitkEnumerationProperty.h.
typedef unsigned int mitk::EnumerationProperty::IdType |
Represents the unique id which is assigned to each enumeration name.
Definition at line 48 of file mitkEnumerationProperty.h.
Definition at line 46 of file mitkEnumerationProperty.h.
Definition at line 46 of file mitkEnumerationProperty.h.
Definition at line 46 of file mitkEnumerationProperty.h.
|
protected |
Default constructor. The current value of the enumeration is undefined.
|
protected |
|
virtual |
Adds an enumeration value into the enumeration. The name and id provided must be unique. This is checked while adding the new enumeration value. If it is not unique, false is returned. If addition was successful, true is returned.
name | The unique name of the enumeration value |
id | The unique id of the enumeration value |
Reimplemented in mitk::RenderingModeProperty, mitk::PlaneOrientationProperty, mitk::PointSetShapeProperty, mitk::GridRepresentationProperty, mitk::VtkInterpolationProperty, mitk::VtkRepresentationProperty, mitk::VtkScalarModeProperty, mitk::VtkResliceInterpolationProperty, mitk::GridVolumeMapperProperty, mitk::RegEvalStyleProperty, mitk::RegEvalWipeStyleProperty, mitk::RegVisColorStyleProperty, mitk::RegVisDirectionProperty, mitk::RegVisStyleProperty, and mitk::PlanarFigureControlPointStyleProperty.
|
overrideprotectedvirtual |
Override this method in subclasses to implement a meaningful assignment. The property argument is guaranteed to be castable to the type of the implementing subclass.
Implements mitk::BaseProperty.
|
virtual |
Provides access to the set of enumeration values. The name can be accessed with iterator->second, the id via iterator->first.
|
virtual |
Clears all enumerations including the current one.
Pointer mitk::EnumerationProperty::Clone | ( | ) | const |
|
virtual |
Specifies the end of the range of enumeration values.
|
overridevirtual |
Deserializes the property to JSON.
Implements mitk::BaseProperty.
|
inlineoverridevirtual |
Reimplemented from mitk::BaseProperty.
Reimplemented in mitk::RenderingModeProperty, mitk::PointSetShapeProperty, mitk::PlaneOrientationProperty, mitk::VtkScalarModeProperty, mitk::VtkResliceInterpolationProperty, mitk::ModalityProperty, mitk::VtkInterpolationProperty, mitk::VtkRepresentationProperty, and mitk::ResliceMethodProperty.
Definition at line 46 of file mitkEnumerationProperty.h.
|
virtual |
Reimplemented from mitk::BaseProperty.
Reimplemented in mitk::RenderingModeProperty, mitk::PointSetShapeProperty, mitk::PlaneOrientationProperty, mitk::VtkScalarModeProperty, mitk::VtkResliceInterpolationProperty, mitk::ModalityProperty, mitk::VtkInterpolationProperty, mitk::VtkRepresentationProperty, and mitk::ResliceMethodProperty.
|
virtual |
Returns the id for the given name.
name | The enumeration name for which the id should be determined. If the name is invalid, the return value is unspecified. |
EnumIdsContainerType& mitk::EnumerationProperty::GetEnumIds | ( | ) |
const EnumIdsContainerType& mitk::EnumerationProperty::GetEnumIds | ( | ) | const |
|
virtual |
Returns the name for the given id.
id | The id for which the name should be determined. If the id is invalid, the return value is unspecified. |
EnumStringsContainerType& mitk::EnumerationProperty::GetEnumStrings | ( | ) |
const EnumStringsContainerType& mitk::EnumerationProperty::GetEnumStrings | ( | ) | const |
|
inlinestatic |
Definition at line 46 of file mitkEnumerationProperty.h.
|
virtual |
Returns the id of the current enumeration value. If it was not set so far, the return value is unspecified.
|
overridevirtual |
Returns the name of the current enumeration value. If it was not set so far, the return value is unspecified.
Reimplemented from mitk::BaseProperty.
|
inlineoverrideprotectedvirtual |
Definition at line 195 of file mitkEnumerationProperty.h.
|
overrideprotectedvirtual |
Override this method in subclasses to implement a meaningful comparison. The property argument is guaranteed to be castable to the type of the implementing subclass.
Implements mitk::BaseProperty.
|
virtual |
Determines if a given id is valid.
id | The id to check |
|
virtual |
Determines if a given name is valid.
name | The name to check |
|
static |
BaseProperty& mitk::BaseProperty::operator= |
Assigns property to this BaseProperty instance.
Subclasses must implement Assign(const BaseProperty&) and call the superclass Assign method for proper handling of polymorphic assignments. The assignment operator of the subclass should be disabled and the baseclass operator should be made visible using "using" statements.
|
delete |
|
virtual |
Sets the current value of the enumeration.
id | The id of the enumeration value to set |
|
virtual |
Sets the current value of the enumeration.
name | The name of the enumeration value to set |
|
virtual |
Determines the number of enumeration values.
|
overridevirtual |
Serializes the property to JSON.
Implements mitk::BaseProperty.