Medical Imaging Interaction Toolkit  2016.11.0
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,
6 Division of Medical and Biological Informatics.
7 All rights reserved.
8 
9 This software is distributed WITHOUT ANY WARRANTY; without
10 even the implied warranty of MERCHANTABILITY or FITNESS FOR
11 A PARTICULAR PURPOSE.
12 
13 See LICENSE.txt or http://www.mitk.org for details.
14 
15 ===================================================================*/
16 
17 #ifndef _VTK_POINT_SET_XML_READER__H_
18 #define _VTK_POINT_SET_XML_READER__H_
19 
20 #include <MitkLegacyIOExports.h>
21 #include <list>
22 #include <mitkPointSet.h>
23 #include <stack>
24 #include <string>
25 #include <vtkXMLParser.h>
26 
27 namespace mitk
28 {
39  class DEPRECATED() MITKLEGACYIO_EXPORT vtkPointSetXMLParser : public vtkXMLParser
40  {
41  public:
42  vtkTypeMacro(vtkPointSetXMLParser, vtkXMLParser);
43 
44  static vtkPointSetXMLParser *New();
45 
47 
48  typedef std::stack<std::string> ParseStack;
49 
50  typedef std::list<PointSetType::Pointer> PointSetList;
51 
53 
55 
56  virtual int InitializeParser() override;
57  virtual int CleanupParser() override;
62  virtual void StartElement(const char *name, const char **atts) override;
63 
68  virtual void EndElement(const char *name) override;
69 
76  virtual void CharacterDataHandler(const char *inData, int inLength) override;
77 
81  virtual mitk::ScalarType ParseScalarType(const std::string &data);
82 
86  virtual PointIdentifier ParsePointIdentifier(const std::string &data);
87 
92  virtual PointSetList GetParsedPointSets();
93 
94  protected:
96  virtual ~vtkPointSetXMLParser();
97 
103  ParseStack m_ParseStack;
104 
108  PointSetList m_PointSetList;
109 
115 
120  PointType m_CurrentPoint;
121 
122  std::string m_CurId;
123  std::string m_CurXString;
124  std::string m_CurYString;
125  std::string m_CurZString;
126 
131  PointIdentifier m_CurrentPointId;
132 
133  std::locale m_PreviousLocale;
134  };
135 }
136 #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:135
#define DEPRECATED(func)
Definition: mitkCommon.h:183
std::stack< std::string > ParseStack
Data structure which stores a set of points. Superclass of mitk::Mesh.
Definition: mitkPointSet.h:79
Implementation of the vtkXMLParser interface for reading mitk::PointSets.
PointSetType::DataType::PointIdentifier PointIdentifier
std::list< PointSetType::Pointer > PointSetList
PointSetType::Pointer m_CurrentPointSet
static itkEventMacro(BoundingShapeInteractionEvent, itk::AnyEvent) class MITKBOUNDINGSHAPE_EXPORT BoundingShapeInteractor Pointer New()
Basic interaction methods for mitk::GeometryData.