00001 /*========================================================================= 00002 00003 Program: Medical Imaging & Interaction Toolkit 00004 Language: C++ 00005 Date: $Date$ 00006 Version: $Revision: 1.12 $ 00007 00008 Copyright (c) German Cancer Research Center, Division of Medical and 00009 Biological Informatics. All rights reserved. 00010 See MITKCopyright.txt or https://www.mitk.org/copyright.html for details. 00011 00012 This software is distributed WITHOUT ANY WARRANTY; without even 00013 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 00014 PURPOSE. See the above copyright notices for more information. 00015 00016 =========================================================================*/ 00017 00018 // TODO this should be moved to module SceneSerializationExt 00019 00020 #ifndef mitkEnumerationSubclassesDeserializer_h_included 00021 #define mitkEnumerationSubclassesDeserializer_h_included 00022 00023 #include "mitkBasePropertyDeserializer.h" 00024 00025 /* 00026 #include "mitkGridRepresentationProperty.h" 00027 #include "mitkGridVolumeMapperProperty.h" 00028 #include "mitkOrganTypeProperty.h" 00029 */ 00030 #include "mitkPlaneOrientationProperty.h" 00031 #include "mitkShaderProperty.h" 00032 #include "mitkVtkInterpolationProperty.h" 00033 #include "mitkVtkRepresentationProperty.h" 00034 #include "mitkVtkResliceInterpolationProperty.h" 00035 #include "mitkVtkScalarModeProperty.h" 00036 #include "mitkVtkVolumeRenderingProperty.h" 00037 #include "mitkModalityProperty.h" 00038 00039 #include "SceneSerializationBaseExports.h" 00040 00041 00042 #define MITK_REGISTER_ENUM_SUB_DESERIALIZER(classname) \ 00043 \ 00044 namespace mitk \ 00045 { \ 00046 \ 00047 class SceneSerializationBase_EXPORT classname ## Deserializer : public BasePropertyDeserializer \ 00048 { \ 00049 public: \ 00050 \ 00051 mitkClassMacro( classname ## Deserializer, BasePropertyDeserializer ); \ 00052 itkNewMacro(Self); \ 00053 \ 00054 virtual BaseProperty::Pointer Deserialize(TiXmlElement* element) \ 00055 { \ 00056 if (!element) return NULL; \ 00057 const char* sa( element->Attribute("value") ); \ 00058 std::string s(sa?sa:""); \ 00059 classname::Pointer property = classname::New(); \ 00060 property->SetValue( s ); \ 00061 return property.GetPointer(); \ 00062 } \ 00063 \ 00064 \ 00065 protected: \ 00066 \ 00067 classname ## Deserializer () {} \ 00068 virtual ~classname ## Deserializer () {} \ 00069 }; \ 00070 \ 00071 } \ 00072 \ 00073 MITK_REGISTER_SERIALIZER( classname ## Deserializer ); 00074 00075 /* 00076 MITK_REGISTER_ENUM_SUB_DESERIALIZER(GridRepresentationProperty); 00077 MITK_REGISTER_ENUM_SUB_DESERIALIZER(GridVolumeMapperProperty); 00078 MITK_REGISTER_ENUM_SUB_DESERIALIZER(OrganTypeProperty); 00079 */ 00080 MITK_REGISTER_ENUM_SUB_DESERIALIZER(PlaneOrientationProperty); 00081 MITK_REGISTER_ENUM_SUB_DESERIALIZER(ShaderProperty); 00082 MITK_REGISTER_ENUM_SUB_DESERIALIZER(VtkInterpolationProperty); 00083 MITK_REGISTER_ENUM_SUB_DESERIALIZER(VtkRepresentationProperty); 00084 MITK_REGISTER_ENUM_SUB_DESERIALIZER(VtkResliceInterpolationProperty); 00085 MITK_REGISTER_ENUM_SUB_DESERIALIZER(VtkScalarModeProperty); 00086 MITK_REGISTER_ENUM_SUB_DESERIALIZER(VtkVolumeRenderingProperty); 00087 MITK_REGISTER_ENUM_SUB_DESERIALIZER(ModalityProperty); 00088 #endif