Medical Imaging Interaction Toolkit
2018.4.99-389bf124
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 |
![]() | |
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 () |
EnumerationProperty & | operator= (const EnumerationProperty &)=delete |
![]() | |
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 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 |
![]() | |
BaseProperty () | |
BaseProperty (const BaseProperty &other) | |
~BaseProperty () override | |
Additional Inherited Members | |
![]() | |
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.
Definition at line 16 of file mitkEnumerationProperty.cpp.
|
protected |
Definition at line 21 of file mitkEnumerationProperty.cpp.
|
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::VtkVolumeRenderingProperty, mitk::RegEvalStyleProperty, mitk::RegEvalWipeStyleProperty, mitk::RegVisColorStyleProperty, mitk::RegVisDirectionProperty, mitk::RegVisStyleProperty, and mitk::PlanarFigureControlPointStyleProperty.
Definition at line 29 of file mitkEnumerationProperty.cpp.
References GetEnumIds(), GetEnumStrings(), and IsValidEnumerationValue().
Referenced by mitk::VtkVolumeRenderingProperty::AddEnum(), mitk::VtkResliceInterpolationProperty::AddEnum(), mitk::VtkScalarModeProperty::AddEnum(), mitk::VtkInterpolationProperty::AddEnum(), mitk::VtkRepresentationProperty::AddEnum(), mitk::PointSetShapeProperty::AddEnum(), mitk::PlaneOrientationProperty::AddEnum(), mitk::RenderingModeProperty::AddEnum(), mitk::ModalityProperty::AddEnumerationTypes(), and mitk::ResliceMethodProperty::AddThickSlicesTypes().
|
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.
Definition at line 126 of file mitkEnumerationProperty.cpp.
References GetEnumIds(), and GetEnumStrings().
|
virtual |
Provides access to the set of enumeration values. The name can be accessed with iterator->second, the id via iterator->first.
Definition at line 92 of file mitkEnumerationProperty.cpp.
References GetEnumIds().
Referenced by QmitkDataNodeSurfaceRepresentationAction::InitializeAction(), and IsEqual().
|
virtual |
Clears all enumerations including the current one.
Definition at line 79 of file mitkEnumerationProperty.cpp.
References GetEnumIds(), and GetEnumStrings().
Pointer mitk::EnumerationProperty::Clone | ( | ) | const |
|
virtual |
Specifies the end of the range of enumeration values.
Definition at line 97 of file mitkEnumerationProperty.cpp.
References GetEnumIds().
Referenced by QmitkDataNodeSurfaceRepresentationAction::InitializeAction(), and IsEqual().
|
inlineoverridevirtual |
Reimplemented from mitk::BaseProperty.
Reimplemented in mitk::RenderingModeProperty, mitk::PointSetShapeProperty, mitk::PlaneOrientationProperty, mitk::VtkScalarModeProperty, mitk::VtkVolumeRenderingProperty, 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::VtkVolumeRenderingProperty, 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. |
Definition at line 109 of file mitkEnumerationProperty.cpp.
References GetEnumStrings(), and IsValidEnumerationValue().
Referenced by SetValue().
const mitk::EnumerationProperty::EnumIdsContainerType & mitk::EnumerationProperty::GetEnumIds | ( | ) | const |
Definition at line 153 of file mitkEnumerationProperty.cpp.
Referenced by AddEnum(), Assign(), Begin(), Clear(), End(), GetEnumString(), IsValidEnumerationValue(), and Size().
mitk::EnumerationProperty::EnumIdsContainerType & mitk::EnumerationProperty::GetEnumIds | ( | ) |
Definition at line 148 of file mitkEnumerationProperty.cpp.
|
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. |
Definition at line 102 of file mitkEnumerationProperty.cpp.
References GetEnumIds(), and IsValidEnumerationValue().
Referenced by GetValueAsString().
const mitk::EnumerationProperty::EnumStringsContainerType & mitk::EnumerationProperty::GetEnumStrings | ( | ) | const |
Definition at line 163 of file mitkEnumerationProperty.cpp.
Referenced by AddEnum(), Assign(), Clear(), GetEnumId(), IsValidEnumerationValue(), and QmitkUGCombinedRepresentationPropertyWidget::SetProperty().
mitk::EnumerationProperty::EnumStringsContainerType & mitk::EnumerationProperty::GetEnumStrings | ( | ) |
Definition at line 158 of file mitkEnumerationProperty.cpp.
|
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.
Definition at line 69 of file mitkEnumerationProperty.cpp.
Referenced by QmitkRegEvalSettingsWidget::ConfigureControls(), mitk::PlaneGeometryDataMapper2D::DetermineThickSliceMode(), mitk::MITKRegistrationWrapperMapperBase::GenerateDataForRenderer(), mitk::DoseImageVtkMapper2D::GenerateDataForRenderer(), mitk::ImageVtkMapper2D::GenerateDataForRenderer(), mitk::VtkResliceInterpolationProperty::GetInterpolation(), mitk::PlaneOrientationProperty::GetPlaneDecoration(), mitk::PointSetShapeProperty::GetPointSetShape(), mitk::GetRelevantRegKernelOfNode(), mitk::RenderingModeProperty::GetRenderingMode(), mitk::VtkVolumeRenderingProperty::GetRenderingType(), mitk::PlanarFigureControlPointStyleProperty::GetShape(), mitk::VtkInterpolationProperty::GetVtkInterpolation(), mitk::VtkRepresentationProperty::GetVtkRepresentation(), mitk::VtkScalarModeProperty::GetVtkScalarMode(), IsEqual(), QmitkRenderWindowMenu::OnTSNumChanged(), and QmitkUGCombinedRepresentationPropertyWidget::SetProperty().
|
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.
Definition at line 74 of file mitkEnumerationProperty.cpp.
References GetEnumString().
Referenced by QmitkDataNodeSurfaceRepresentationAction::InitializeAction().
|
inlineoverrideprotectedvirtual |
Definition at line 181 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.
Definition at line 116 of file mitkEnumerationProperty.cpp.
References Begin(), End(), GetValueAsId(), and Size().
|
virtual |
Determines if a given id is valid.
id | The id to check |
Definition at line 138 of file mitkEnumerationProperty.cpp.
References GetEnumIds().
Referenced by AddEnum(), GetEnumId(), GetEnumString(), mitk::GridRepresentationProperty::GridRepresentationProperty(), mitk::GridVolumeMapperProperty::GridVolumeMapperProperty(), QmitkDataNodeSurfaceRepresentationAction::InitializeAction(), mitk::ModalityProperty::ModalityProperty(), mitk::PlanarFigureControlPointStyleProperty::PlanarFigureControlPointStyleProperty(), mitk::PlaneOrientationProperty::PlaneOrientationProperty(), mitk::PointSetShapeProperty::PointSetShapeProperty(), mitk::RegEvalStyleProperty::RegEvalStyleProperty(), mitk::RegEvalWipeStyleProperty::RegEvalWipeStyleProperty(), mitk::RegVisColorStyleProperty::RegVisColorStyleProperty(), mitk::RegVisDirectionProperty::RegVisDirectionProperty(), mitk::RegVisStyleProperty::RegVisStyleProperty(), mitk::RenderingModeProperty::RenderingModeProperty(), mitk::ResliceMethodProperty::ResliceMethodProperty(), SetValue(), mitk::VtkInterpolationProperty::VtkInterpolationProperty(), mitk::VtkRepresentationProperty::VtkRepresentationProperty(), mitk::VtkResliceInterpolationProperty::VtkResliceInterpolationProperty(), mitk::VtkScalarModeProperty::VtkScalarModeProperty(), and mitk::VtkVolumeRenderingProperty::VtkVolumeRenderingProperty().
|
virtual |
Determines if a given name is valid.
name | The name to check |
Definition at line 143 of file mitkEnumerationProperty.cpp.
References GetEnumStrings().
|
static |
Referenced by mitkEnumerationPropertyTest().
|
delete |
|
virtual |
Sets the current value of the enumeration.
name | The name of the enumeration value to set |
Definition at line 43 of file mitkEnumerationProperty.cpp.
References GetEnumId(), and IsValidEnumerationValue().
Referenced by mitk::GridRepresentationProperty::GridRepresentationProperty(), mitk::GridVolumeMapperProperty::GridVolumeMapperProperty(), QmitkDataNodeSurfaceRepresentationAction::InitializeAction(), mitkPointSetVtkMapper2DGlyphTypeTest(), mitk::ModalityProperty::ModalityProperty(), mitk::PlanarFigureControlPointStyleProperty::PlanarFigureControlPointStyleProperty(), mitk::PlaneOrientationProperty::PlaneOrientationProperty(), mitk::PointSetShapeProperty::PointSetShapeProperty(), mitk::RegEvalStyleProperty::RegEvalStyleProperty(), mitk::RegEvalWipeStyleProperty::RegEvalWipeStyleProperty(), mitk::RegVisColorStyleProperty::RegVisColorStyleProperty(), mitk::RegVisDirectionProperty::RegVisDirectionProperty(), mitk::RegVisStyleProperty::RegVisStyleProperty(), mitk::RenderingModeProperty::RenderingModeProperty(), mitk::ResliceMethodProperty::ResliceMethodProperty(), mitk::VtkResliceInterpolationProperty::SetInterpolationToCubic(), mitk::VtkInterpolationProperty::SetInterpolationToFlat(), mitk::VtkInterpolationProperty::SetInterpolationToGouraud(), mitk::VtkResliceInterpolationProperty::SetInterpolationToLinear(), mitk::VtkResliceInterpolationProperty::SetInterpolationToNearest(), mitk::VtkInterpolationProperty::SetInterpolationToPhong(), mitk::PlaneOrientationProperty::SetPlaneDecorationToNegativeOrientation(), mitk::PlaneOrientationProperty::SetPlaneDecorationToNone(), mitk::PlaneOrientationProperty::SetPlaneDecorationToPositiveOrientation(), mitk::VtkVolumeRenderingProperty::SetRenderingTypeToComposite(), mitk::VtkVolumeRenderingProperty::SetRenderingTypeToMIP(), mitk::VtkRepresentationProperty::SetRepresentationToPoints(), mitk::GridRepresentationProperty::SetRepresentationToPoints(), mitk::VtkRepresentationProperty::SetRepresentationToSurface(), mitk::GridRepresentationProperty::SetRepresentationToSurface(), mitk::VtkRepresentationProperty::SetRepresentationToWireframe(), mitk::GridRepresentationProperty::SetRepresentationToWireframe(), mitk::VtkScalarModeProperty::SetScalarModeToCellData(), mitk::VtkScalarModeProperty::SetScalarModeToCellFieldData(), mitk::VtkScalarModeProperty::SetScalarModeToDefault(), mitk::VtkScalarModeProperty::SetScalarModeToPointData(), mitk::VtkScalarModeProperty::SetScalarModeToPointFieldData(), mitk::PlanarFigureControlPointStyleProperty::SetShape(), mitk::GridVolumeMapperProperty::SetVolumeMapperToPT(), mitk::GridVolumeMapperProperty::SetVolumeMapperToRayCast(), mitk::GridVolumeMapperProperty::SetVolumeMapperToZSweep(), mitk::VtkInterpolationProperty::VtkInterpolationProperty(), mitk::VtkRepresentationProperty::VtkRepresentationProperty(), mitk::VtkResliceInterpolationProperty::VtkResliceInterpolationProperty(), mitk::VtkScalarModeProperty::VtkScalarModeProperty(), and mitk::VtkVolumeRenderingProperty::VtkVolumeRenderingProperty().
|
virtual |
Sets the current value of the enumeration.
id | The id of the enumeration value to set |
Definition at line 56 of file mitkEnumerationProperty.cpp.
References IsValidEnumerationValue().
|
virtual |
Determines the number of enumeration values.
Definition at line 87 of file mitkEnumerationProperty.cpp.
References GetEnumIds().
Referenced by mitk::ModalityProperty::AddEnumerationTypes(), and IsEqual().