Medical Imaging Interaction Toolkit
2024.12.99-0da743f6
Medical Imaging Interaction Toolkit
|
Go to the documentation of this file.
13 #ifndef mitkGenericProperty_h
14 #define mitkGenericProperty_h
28 #pragma warning(disable : 4522)
55 itkSetMacro(Value, T);
56 itkGetConstMacro(Value, T);
60 std::stringstream myStr;
75 using BaseProperty::operator=;
87 itk::LightObject::Pointer InternalClone()
const override
89 itk::LightObject::Pointer result(
new Self(*
this));
96 return (this->m_Value ==
static_cast<const Self &
>(other).m_Value);
99 bool Assign(
const BaseProperty &other)
override
101 this->m_Value =
static_cast<const Self &
>(other).m_Value;
120 #define mitkDeclareGenericProperty(PropertyName, Type, Export) \
122 class Export PropertyName : public GenericProperty<Type> \
126 mitkClassMacro(PropertyName, GenericProperty<Type>); \
127 itkFactorylessNewMacro(Self); \
128 itkCloneMacro(Self); \
129 mitkNewMacro1Param(PropertyName, Type); \
131 bool ToJSON(nlohmann::json& j) const override; \
132 bool FromJSON(const nlohmann::json& j) override; \
134 using BaseProperty::operator=; \
138 PropertyName(const PropertyName &); \
139 PropertyName(Type x); \
142 itk::LightObject::Pointer InternalClone() const override; \
145 #define mitkDefineGenericProperty(PropertyName, Type, DefaultValue) \
146 mitk::PropertyName::PropertyName() : Superclass(DefaultValue) {} \
147 mitk::PropertyName::PropertyName(const PropertyName &other) : GenericProperty<Type>(other) {} \
148 mitk::PropertyName::PropertyName(Type x) : Superclass(x) {} \
149 itk::LightObject::Pointer mitk::PropertyName::InternalClone() const \
151 itk::LightObject::Pointer result(new Self(*this)); \
152 result->UnRegister(); \
155 bool mitk::PropertyName::ToJSON(nlohmann::json& j) const \
157 j = this->GetValue(); \
161 bool mitk::PropertyName::FromJSON(const nlohmann::json& j) \
163 this->SetValue(j.get<Type>()); \
Abstract base class for properties.
bool ToJSON(nlohmann::json &) const override
Serialize property value(s) to JSON.
#define mitkNewMacro1Param(classname, type)
bool FromJSON(const nlohmann::json &) override
Deserialize property value(s) from JSON.
Find image slices visible on a given plane.
std::string GetValueAsString() const override
GenericProperty(const GenericProperty &other)
#define mitkClassMacro(className, SuperClassName)