Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
mitkConnectomicsEnumerationSubclassesSerializer.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,
6 Division of Medical and Biological Informatics.
7 All rights reserved.
8 
9 This software is distributed WITHOUT ANY WARRANTY; without
10 even the implied warranty of MERCHANTABILITY or FITNESS FOR
11 A PARTICULAR PURPOSE.
12 
13 See LICENSE.txt or http://www.mitk.org for details.
14 
15 ===================================================================*/
16 
17 #ifndef mitkConnectomicsEnumerationSubclassesSerializer_h_included
18 #define mitkConnectomicsEnumerationSubclassesSerializer_h_included
19 
21 
31 
32 #include <MitkConnectomicsExports.h>
33 
34 #define MITK_REGISTER_ENUM_SUB_SERIALIZER(classname) \
35  \
36 namespace mitk \
37 { \
38  \
39 class MITKCONNECTOMICS_EXPORT classname ## Serializer : public EnumerationPropertySerializer \
40 { \
41  public: \
42  \
43  mitkClassMacro( classname ## Serializer, EnumerationPropertySerializer ) \
44  itkFactorylessNewMacro(Self) \
45  itkCloneMacro(Self) \
46  \
47  virtual BaseProperty::Pointer Deserialize(TiXmlElement* element) \
48  { \
49  if (!element) return NULL; \
50  const char* sa( element->Attribute("value") ); \
51  \
52  std::string s(sa?sa:""); \
53  classname::Pointer property = classname::New(); \
54  property->SetValue( s ); \
55  \
56  return property.GetPointer(); \
57  } \
58  \
59  protected: \
60  \
61  classname ## Serializer () {} \
62  virtual ~classname ## Serializer () {} \
63 }; \
64  \
65 } \
66  \
67 MITK_REGISTER_SERIALIZER( classname ## Serializer );
68 
69 MITK_REGISTER_ENUM_SUB_SERIALIZER(ConnectomicsRenderingEdgeColorParameterProperty);
70 MITK_REGISTER_ENUM_SUB_SERIALIZER(ConnectomicsRenderingEdgeFilteringProperty);
71 MITK_REGISTER_ENUM_SUB_SERIALIZER(ConnectomicsRenderingEdgeRadiusParameterProperty);
72 MITK_REGISTER_ENUM_SUB_SERIALIZER(ConnectomicsRenderingEdgeThresholdParameterProperty);
73 MITK_REGISTER_ENUM_SUB_SERIALIZER(ConnectomicsRenderingNodeColorParameterProperty);
74 MITK_REGISTER_ENUM_SUB_SERIALIZER(ConnectomicsRenderingNodeFilteringProperty);
75 MITK_REGISTER_ENUM_SUB_SERIALIZER(ConnectomicsRenderingNodeRadiusParameterProperty);
76 MITK_REGISTER_ENUM_SUB_SERIALIZER(ConnectomicsRenderingNodeThresholdParameterProperty);
77 MITK_REGISTER_ENUM_SUB_SERIALIZER(ConnectomicsRenderingSchemeProperty);
78 
79 #endif
#define MITK_REGISTER_ENUM_SUB_SERIALIZER(classname)