00001 /*========================================================================= 00002 00003 Program: Medical Imaging & Interaction Toolkit 00004 Language: C++ 00005 Date: $Date: 2009-07-07 15:56:37 +0200 (Di, 07. Jul 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 http://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 mitkPoint3iPropertySerializer_h_included 00019 #define mitkPoint3iPropertySerializer_h_included 00020 00021 #include "mitkBasePropertySerializer.h" 00022 #include "mitkProperties.h" 00023 00024 #include "SceneSerializationBaseExports.h" 00025 00026 namespace mitk 00027 { 00028 class SceneSerializationBase_EXPORT Point3iPropertySerializer : public BasePropertySerializer 00029 { 00030 public: 00031 mitkClassMacro( Point3iPropertySerializer, BasePropertySerializer ); 00032 itkNewMacro(Self); 00033 00034 virtual TiXmlElement* Serialize() 00035 { 00036 if (const Point3iProperty* prop = dynamic_cast<const Point3iProperty*>(m_Property.GetPointer())) 00037 { 00038 TiXmlElement* element = new TiXmlElement("point"); 00039 Point3I point = prop->GetValue(); 00040 element->SetAttribute("x", point[0]); 00041 element->SetAttribute("y", point[1]); 00042 element->SetAttribute("z", point[2]); 00043 return element; 00044 } 00045 else return NULL; 00046 } 00047 protected: 00048 Point3iPropertySerializer() {} 00049 virtual ~Point3iPropertySerializer() {} 00050 }; 00051 } // namespace 00052 // important to put this into the GLOBAL namespace (because it starts with 'namespace mitk') 00053 MITK_REGISTER_SERIALIZER(Point3iPropertySerializer); 00054 #endif