Medical Imaging Interaction Toolkit  2018.4.99-389bf124
Medical Imaging Interaction Toolkit
vtkPointSetXMLParser.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 _VTK_POINT_SET_XML_READER__H_
14 #define _VTK_POINT_SET_XML_READER__H_
15 
16 #include <MitkLegacyIOExports.h>
17 #include <list>
18 #include <mitkPointSet.h>
19 #include <stack>
20 #include <string>
21 #include <vtkXMLParser.h>
22 
23 namespace mitk
24 {
35  class DEPRECATED() MITKLEGACYIO_EXPORT vtkPointSetXMLParser : public vtkXMLParser
36  {
37  public:
38  vtkTypeMacro(vtkPointSetXMLParser, vtkXMLParser);
39 
40  static vtkPointSetXMLParser *New();
41 
43 
44  typedef std::stack<std::string> ParseStack;
45 
46  typedef std::list<PointSetType::Pointer> PointSetList;
47 
49 
51 
52  int InitializeParser() override;
53  int CleanupParser() override;
58  void StartElement(const char *name, const char **atts) override;
59 
64  void EndElement(const char *name) override;
65 
72  void CharacterDataHandler(const char *inData, int inLength) override;
73 
77  virtual mitk::ScalarType ParseScalarType(const std::string &data);
78 
82  virtual PointIdentifier ParsePointIdentifier(const std::string &data);
83 
88  virtual PointSetList GetParsedPointSets();
89 
90  protected:
92  ~vtkPointSetXMLParser() override;
93 
99  ParseStack m_ParseStack;
100 
104  PointSetList m_PointSetList;
105 
111 
116  PointType m_CurrentPoint;
117 
118  std::string m_CurId;
119  std::string m_CurXString;
120  std::string m_CurYString;
121  std::string m_CurZString;
122 
127  PointIdentifier m_CurrentPointId;
128 
129  std::locale m_PreviousLocale;
130  };
131 }
132 #endif // _VTK_POINT_SET_XML_READER__H_
#define MITKLEGACYIO_EXPORT
double ScalarType
PointSetType::PointType PointType
DataCollection - Class to facilitate loading/accessing structured data.
DataType::PointIdentifier PointIdentifier
Definition: mitkPointSet.h:133
#define DEPRECATED(func)
Definition: mitkCommon.h:179
std::stack< std::string > ParseStack
Data structure which stores a set of points. Superclass of mitk::Mesh.
Definition: mitkPointSet.h:75
Implementation of the vtkXMLParser interface for reading mitk::PointSets.
PointSetType::DataType::PointIdentifier PointIdentifier
std::list< PointSetType::Pointer > PointSetList
PointSetType::Pointer m_CurrentPointSet