Medical Imaging Interaction Toolkit  2021.10.99-fd647480
Medical Imaging Interaction Toolkit
mitkXML2EventParser.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 mitkXML2EventParser_h
14 #define mitkXML2EventParser_h
15 
16 #include <MitkCoreExports.h>
17 
18 #include "mitkPropertyList.h"
19 
20 #include <vtkXMLParser.h>
21 
22 #include "mitkInteractionEvent.h"
23 
24 namespace us
25 {
26  class Module;
27 }
28 
29 namespace mitk
30 {
38  class MITKCORE_EXPORT XML2EventParser : public vtkXMLParser
39  {
40  public:
51  XML2EventParser(const std::string &filename, const us::Module *module = nullptr);
52 
62  XML2EventParser(std::istream &inputStream);
63 
64  typedef std::vector<mitk::InteractionEvent::Pointer> EventContainerType;
65 
66  EventContainerType GetInteractions() { return m_InteractionList; }
67  ~XML2EventParser() override{};
68 
69  protected:
73  void StartElement(const char *elementName, const char **atts) override;
74 
78  void EndElement(const char *elementName) override;
79 
80  std::string ReadXMLStringAttribute(const std::string &name, const char **atts);
81  bool ReadXMLBooleanAttribute(const std::string &name, const char **atts);
82 
83  private:
84  PropertyList::Pointer m_EventPropertyList;
85 
86  EventContainerType m_InteractionList;
87  };
88 
89 } // namespace mitk
90 
91 #endif /* mitkStateMachineConfig_h */
#define MITKCORE_EXPORT
DataCollection - Class to facilitate loading/accessing structured data.
std::vector< mitk::InteractionEvent::Pointer > EventContainerType
EventContainerType GetInteractions()