Medical Imaging Interaction Toolkit  2018.4.99-389bf124
Medical Imaging Interaction Toolkit
mitkEnumerationPropertySerializer.cpp
Go to the documentation of this file.
1 /*============================================================================
2 
3 The Medical Imaging Interaction Toolkit (MITK)
4 
5 Copyright (c) German Cancer Research Center (DKFZ)
6 All rights reserved.
7 
8 Use of this source code is governed by a 3-clause BSD license that can be
9 found in the LICENSE file.
10 
11 ============================================================================*/
12 
14 
15 namespace mitk
16 {
18  {
19  if (const auto *prop = dynamic_cast<const EnumerationProperty *>(m_Property.GetPointer()))
20  {
21  auto element = new TiXmlElement("enum");
22  element->SetAttribute("value", prop->GetValueAsString());
23  return element;
24  }
25  else
26  return nullptr;
27  }
28 
31 } // namespace
32 
33 // important to put this into the GLOBAL namespace (because it starts with 'namespace mitk')
MITK_REGISTER_SERIALIZER(EnumerationPropertySerializer)
DataCollection - Class to facilitate loading/accessing structured data.
TiXmlElement * Serialize() override
Serializes given BaseProperty object.
BaseProperty::ConstPointer m_Property