00001 /*========================================================================= 00002 00003 Program: Medical Imaging & Interaction Toolkit 00004 Language: C++ 00005 Date: $Date: 2009-10-08 16:58:56 +0200 (Do, 08. Okt 2009) $ 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 #ifndef mitkPoint3iPropertyDeserializer_h_included 00019 #define mitkPoint3iPropertyDeserializer_h_included 00020 00021 #include "mitkBasePropertyDeserializer.h" 00022 #include "mitkProperties.h" 00023 00024 #include "SceneSerializationBaseExports.h" 00025 00026 namespace mitk 00027 { 00028 class SceneSerializationBase_EXPORT Point3iPropertyDeserializer : public BasePropertyDeserializer 00029 { 00030 public: 00031 mitkClassMacro( Point3iPropertyDeserializer, BasePropertyDeserializer ); 00032 itkNewMacro(Self); 00033 virtual BaseProperty::Pointer Deserialize(TiXmlElement* element) 00034 { 00035 if (!element) return NULL; 00036 00037 Point3I v; 00038 if ( element->QueryIntAttribute( "x", &v[0] ) != TIXML_SUCCESS ) return NULL; 00039 if ( element->QueryIntAttribute( "y", &v[1] ) != TIXML_SUCCESS ) return NULL; 00040 if ( element->QueryIntAttribute( "z", &v[2] ) != TIXML_SUCCESS ) return NULL; 00041 return Point3iProperty::New( v ).GetPointer(); 00042 } 00043 protected: 00044 Point3iPropertyDeserializer() {} 00045 virtual ~Point3iPropertyDeserializer() {} 00046 }; 00047 } // namespace 00048 // important to put this into the GLOBAL namespace (because it starts with 'namespace mitk') 00049 MITK_REGISTER_SERIALIZER(Point3iPropertyDeserializer); 00050 #endif