Medical Imaging Interaction Toolkit  2018.4.99-389bf124
Medical Imaging Interaction Toolkit
mitkContourModelWriter.h
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 
13 #ifndef _MITK_CONTOURMODEL_WRITER__H_
14 #define _MITK_CONTOURMODEL_WRITER__H_
15 
16 #include <mitkAbstractFileWriter.h>
17 #include <mitkContourModel.h>
18 
19 // DEPRECATED
20 #include <mitkTimeGeometry.h>
21 
22 namespace mitk
23 {
54  class TimeSlicedGeometry;
55 
57  {
58  public:
60  ~ContourModelWriter() override;
61 
63  void Write() override;
64 
65  protected:
67 
68  mitk::ContourModelWriter *Clone() const override;
69 
77  template <typename T>
78  std::string ConvertToString(T value);
79 
86  void WriteXML(const mitk::ContourModel *contourModel, std::ostream &out);
87 
94  void WriteGeometryInformation(const mitk::TimeGeometry *geometry, std::ostream &out);
95 
105  DEPRECATED(void WriteGeometryInformation(const mitk::TimeSlicedGeometry *geometry, std::ostream &out));
106 
111  void WriteXMLHeader(std::ostream &file);
112 
114  void WriteStartElement(const char *const tag, std::ostream &file);
115 
116  void WriteStartElementWithAttribut(const char *const tag,
117  std::vector<std::string> attributes,
118  std::vector<std::string> values,
119  std::ostream &file);
120 
125  void WriteEndElement(const char *const tag, std::ostream &file, const bool &indent = true);
126 
128  void WriteCharacterData(const char *const data, std::ostream &file);
129 
131  void WriteStartElement(std::string &tag, std::ostream &file);
132 
134  void WriteEndElement(std::string &tag, std::ostream &file, const bool &indent = true);
135 
137  void WriteCharacterData(std::string &data, std::ostream &file);
138 
140  void WriteIndent(std::ostream &file);
141 
142  unsigned int m_IndentDepth;
143 
144  unsigned int m_Indent;
145 
146  public:
147  static const char *XML_CONTOURMODEL;
148 
149  static const char *XML_HEAD;
150 
151  static const char *XML_GEOMETRY_INFO;
152 
153  static const char *XML_DATA;
154 
155  static const char *XML_TIME_STEP;
156 
157  static const char *XML_CONTROL_POINTS;
158 
159  static const char *XML_POINT;
160 
161  static const char *XML_X;
162 
163  static const char *XML_Y;
164 
165  static const char *XML_Z;
166  };
167 }
168 
169 #endif
ContourModel is a structure of linked vertices defining a contour in 3D space. The vertices are store...
void WriteIndent(std::ostream &file)
void Write() override=0
Write the base data to the specified location or output stream.
void WriteGeometryInformation(const mitk::TimeGeometry *geometry, std::ostream &out)
void WriteStartElementWithAttribut(const char *const tag, std::vector< std::string > attributes, std::vector< std::string > values, std::ostream &file)
DataCollection - Class to facilitate loading/accessing structured data.
static const char * XML_GEOMETRY_INFO
void WriteXMLHeader(std::ostream &file)
#define DEPRECATED(func)
Definition: mitkCommon.h:179
static const char * XML_CONTROL_POINTS
static const char * XML_TIME_STEP
void WriteStartElement(const char *const tag, std::ostream &file)
void Write() override
Write the base data to the specified location or output stream.
void WriteEndElement(const char *const tag, std::ostream &file, const bool &indent=true)
void WriteCharacterData(const char *const data, std::ostream &file)
std::string ConvertToString(T value)
static const char * XML_CONTOURMODEL
void WriteXML(const mitk::ContourModel *contourModel, std::ostream &out)
mitk::ContourModelWriter * Clone() const override
Base class for writing mitk::BaseData objects to files or streams.