Medical Imaging Interaction Toolkit  2024.12.99-0da743f6
Medical Imaging Interaction Toolkit
mitkStringProperty.h
Go to the documentation of this file.
1 /*============================================================================
2 
3 The Medical Imaging Interaction Toolkit (MITK)
4 
5 Copyright (c) German Cancer Research Center (DKFZ)
6 All rights reserved.
7 
8 Use of this source code is governed by a 3-clause BSD license that can be
9 found in the LICENSE file.
10 
11 ============================================================================*/
12 
13 #ifndef mitkStringProperty_h
14 #define mitkStringProperty_h
15 
16 #include <itkConfigure.h>
17 
18 #include "mitkBaseProperty.h"
19 #include <MitkCoreExports.h>
20 
21 #include <string>
22 
23 namespace mitk
24 {
25 #ifdef _MSC_VER
26 #pragma warning(push)
27 #pragma warning(disable : 4522)
28 #endif
29 
35  {
36  protected:
37  std::string m_Value;
38 
39  StringProperty(const char *string = nullptr);
40  StringProperty(const std::string &s);
41 
43 
44  public:
46  typedef std::string ValueType;
47 
48  itkFactorylessNewMacro(Self);
49  itkCloneMacro(Self);
51  mitkNewMacro1Param(StringProperty, const std::string&);
52 
53  itkGetStringMacro(Value);
54  itkSetStringMacro(Value);
55 
56  std::string GetValueAsString() const override;
57 
58  bool ToJSON(nlohmann::json& j) const override;
59  bool FromJSON(const nlohmann::json& j) override;
60 
61  static const char *PATH;
62 
63  using BaseProperty::operator=;
64 
65  private:
66  // purposely not implemented
67  StringProperty &operator=(const StringProperty &);
68 
69  itk::LightObject::Pointer InternalClone() const override;
70 
71  bool IsEqual(const BaseProperty &property) const override;
72  bool Assign(const BaseProperty &property) override;
73  };
74 
75 #ifdef _MSC_VER
76 #pragma warning(pop)
77 #endif
78 
79 } // namespace mitk
80 
81 #endif
mitk::BaseProperty
Abstract base class for properties.
Definition: mitkBaseProperty.h:36
mitk::StringProperty::PATH
static const char * PATH
Definition: mitkStringProperty.h:61
mitk::FromJSON
MITKCORE_EXPORT void FromJSON(const nlohmann::json &j, AffineTransform3D::Pointer transform)
Read transform from JSON array (16 elements, resp. 4x4 matrix).
mitk::StringProperty
Property for strings.
Definition: mitkStringProperty.h:34
mitkNewMacro1Param
#define mitkNewMacro1Param(classname, type)
Definition: mitkCommon.h:68
mitk::StringProperty::m_Value
std::string m_Value
Definition: mitkStringProperty.h:37
mitk
Find image slices visible on a given plane.
Definition: RenderingTests.dox:1
mitk::StringProperty::ValueType
std::string ValueType
Definition: mitkStringProperty.h:45
json
nlohmann::json json
Definition: mitkModelTestFixture.h:29
MitkCoreExports.h
mitk::ToJSON
MITKCORE_EXPORT void ToJSON(nlohmann::json &j, AffineTransform3D::ConstPointer transform)
Write transform (4x4 matrix) as JSON array with 16 elements.
mitkClassMacro
#define mitkClassMacro(className, SuperClassName)
Definition: mitkCommon.h:36
mitkBaseProperty.h
MITKCORE_EXPORT
#define MITKCORE_EXPORT
Definition: MitkCoreExports.h:15