Medical Imaging Interaction Toolkit
2018.4.99-389bf124
Medical Imaging Interaction Toolkit
mitkEnumerationSubclassesSerializer.cpp
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 mitkEnumerationSubclassesSerializer_h_included
14
#define mitkEnumerationSubclassesSerializer_h_included
15
16
#include "
mitkEnumerationPropertySerializer.h
"
17
18
#include "
mitkModalityProperty.h
"
19
#include "
mitkPlaneOrientationProperty.h
"
20
#include "
mitkPointSetShapeProperty.h
"
21
#include "
mitkRenderingModeProperty.h
"
22
#include "
mitkVtkInterpolationProperty.h
"
23
#include "
mitkVtkRepresentationProperty.h
"
24
#include "
mitkVtkResliceInterpolationProperty.h
"
25
#include "
mitkVtkScalarModeProperty.h
"
26
#include "
mitkVtkVolumeRenderingProperty.h
"
27
28
#define MITK_REGISTER_ENUM_SUB_SERIALIZER(classname) \
29
\
30
namespace mitk \
31
\
32
{ \
33
\
34
class classname##Serializer \
35
: public EnumerationPropertySerializer\
36
{public : \
37
\
38
mitkClassMacro(classname##Serializer, EnumerationPropertySerializer) itkFactorylessNewMacro(Self) \
39
itkCloneMacro(Self) \
40
\
41
virtual BaseProperty::Pointer Deserialize(TiXmlElement * element) override{if (!element) return nullptr; \
42
const char *sa(element->Attribute("value")); \
43
\
44
std::string s(sa ? sa : ""); \
45
classname::Pointer property = classname::New(); \
46
property->SetValue(s); \
47
\
48
return property.GetPointer(); \
49
} \
50
\
51
protected: \
52
classname##Serializer() {} \
53
virtual ~classname##Serializer() {} \
54
\
55
} \
56
; \
57
\
58
} \
59
\
60
MITK_REGISTER_SERIALIZER(classname##Serializer);
61
62
MITK_REGISTER_ENUM_SUB_SERIALIZER
(PlaneOrientationProperty);
63
MITK_REGISTER_ENUM_SUB_SERIALIZER
(VtkInterpolationProperty);
64
MITK_REGISTER_ENUM_SUB_SERIALIZER
(VtkRepresentationProperty);
65
MITK_REGISTER_ENUM_SUB_SERIALIZER
(VtkResliceInterpolationProperty);
66
MITK_REGISTER_ENUM_SUB_SERIALIZER
(VtkScalarModeProperty);
67
MITK_REGISTER_ENUM_SUB_SERIALIZER
(VtkVolumeRenderingProperty);
68
MITK_REGISTER_ENUM_SUB_SERIALIZER
(ModalityProperty);
69
MITK_REGISTER_ENUM_SUB_SERIALIZER
(RenderingModeProperty);
70
MITK_REGISTER_ENUM_SUB_SERIALIZER
(PointSetShapeProperty);
71
72
#endif
mitkVtkRepresentationProperty.h
mitkPlaneOrientationProperty.h
mitkModalityProperty.h
mitkVtkInterpolationProperty.h
mitkVtkVolumeRenderingProperty.h
MITK_REGISTER_ENUM_SUB_SERIALIZER
#define MITK_REGISTER_ENUM_SUB_SERIALIZER(classname)
Definition:
mitkEnumerationSubclassesSerializer.cpp:28
mitkRenderingModeProperty.h
mitkPointSetShapeProperty.h
mitkVtkScalarModeProperty.h
mitkEnumerationPropertySerializer.h
mitkVtkResliceInterpolationProperty.h
Source
Modules
SceneSerializationBase
src
mitkEnumerationSubclassesSerializer.cpp
Generated on Thu Mar 12 2020 10:23:48 for Medical Imaging Interaction Toolkit by
1.8.13