13 #ifndef mitkBoolPropertySerializer_h_included 14 #define mitkBoolPropertySerializer_h_included 22 class BoolPropertySerializer :
public BasePropertySerializer
26 itkFactorylessNewMacro(Self) itkCloneMacro(Self)
28 TiXmlElement *Serialize()
override 30 if (
const BoolProperty *prop = dynamic_cast<const BoolProperty *>(m_Property.GetPointer()))
32 auto element =
new TiXmlElement(
"bool");
33 if (prop->GetValue() ==
true)
35 element->SetAttribute(
"value",
"true");
39 element->SetAttribute(
"value",
"false");
51 return BoolProperty::New(std::string(element->Attribute(
"value")) ==
"true").GetPointer();
55 BoolPropertySerializer() {}
56 ~BoolPropertySerializer()
override {}
DataCollection - Class to facilitate loading/accessing structured data.
itk::SmartPointer< Self > Pointer
MITK_REGISTER_SERIALIZER(BoolPropertySerializer)
#define mitkClassMacro(className, SuperClassName)