13 #ifndef mitkPoint3iPropertySerializer_h_included 14 #define mitkPoint3iPropertySerializer_h_included 21 class Point3iPropertySerializer :
public BasePropertySerializer
25 itkFactorylessNewMacro(Self) itkCloneMacro(Self)
27 TiXmlElement *Serialize()
override 29 if (
const Point3iProperty *prop = dynamic_cast<const Point3iProperty *>(m_Property.GetPointer()))
31 auto element =
new TiXmlElement(
"point");
32 Point3I point = prop->GetValue();
33 element->SetAttribute(
"x", point[0]);
34 element->SetAttribute(
"y", point[1]);
35 element->SetAttribute(
"z", point[2]);
48 if (element->QueryIntAttribute(
"x", &v[0]) != TIXML_SUCCESS)
50 if (element->QueryIntAttribute(
"y", &v[1]) != TIXML_SUCCESS)
52 if (element->QueryIntAttribute(
"z", &v[2]) != TIXML_SUCCESS)
58 Point3iPropertySerializer() {}
59 ~Point3iPropertySerializer()
override {}
DataCollection - Class to facilitate loading/accessing structured data.
itk::SmartPointer< Self > Pointer
#define mitkClassMacro(className, SuperClassName)
MITK_REGISTER_SERIALIZER(Point3iPropertySerializer)