62 TiXmlDeclaration *decl =
new TiXmlDeclaration(
64 doc.LinkEndChild(decl);
66 TiXmlElement *rootNode =
new TiXmlElement(
"GeometryData");
67 doc.LinkEndChild(rootNode);
70 TiXmlElement *version =
new TiXmlElement(
"Version");
71 version->SetAttribute(
"Writer", __FILE__);
72 version->SetAttribute(
"FileVersion", 1);
73 rootNode->LinkEndChild(version);
78 if ((timeGeometry = dynamic_cast<const ProportionalTimeGeometry *>(data->
GetTimeGeometry())))
81 rootNode->LinkEndChild(timeGeometryElement);
85 MITK_WARN <<
"Serializing GeometryData that does not have a valid ProportionalTimeGeometry! Not implemented!";
An output stream wrapper.
static TiXmlElement * ToXML(const ProportionalTimeGeometry *geometry)
Serialize given geometry to XML.
const mitk::TimeGeometry * GetTimeGeometry() const
Return the TimeGeometry of the data as const pointer.
virtual ~GeometryDataWriterService()
Convenience class to temporarily change the current locale.
GeometryDataWriterService()
static const char * GetStaticNameOfClass()
Data class only having a BaseGeometry but not containing any specific data.
virtual void Write() override
Write the base data to the specified location or output stream.
us::ServiceRegistration< IFileWriter > RegisterService(us::ModuleContext *context=us::GetModuleContext())
Base class for writing mitk::BaseData objects to files or streams.