Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
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,
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 mitkXML2EventParser_h
18 #define mitkXML2EventParser_h
19 
20 #include <MitkCoreExports.h>
21 
22 #include "mitkPropertyList.h"
23 
24 #include <vtkXMLParser.h>
25 
26 #include "mitkInteractionEvent.h"
27 
28 namespace us
29 {
30  class Module;
31 }
32 
33 namespace mitk
34 {
42  class MITKCORE_EXPORT XML2EventParser : public vtkXMLParser
43  {
44  public:
55  XML2EventParser(const std::string &filename, const us::Module *module = NULL);
56 
66  XML2EventParser(std::istream &inputStream);
67 
68  typedef std::vector<mitk::InteractionEvent::Pointer> EventContainerType;
69 
70  EventContainerType GetInteractions() { return m_InteractionList; }
72 
73  protected:
77  void StartElement(const char *elementName, const char **atts) override;
78 
82  void EndElement(const char *elementName) override;
83 
84  std::string ReadXMLStringAttribute(const std::string &name, const char **atts);
85  bool ReadXMLBooleanAttribute(const std::string &name, const char **atts);
86 
87  private:
88  PropertyList::Pointer m_EventPropertyList;
89 
90  EventContainerType m_InteractionList;
91  };
92 
93 } // namespace mitk
94 
95 #endif /* mitkStateMachineConfig_h */
#define MITKCORE_EXPORT
DataCollection - Class to facilitate loading/accessing structured data.
static const std::string filename
std::vector< mitk::InteractionEvent::Pointer > EventContainerType
EventContainerType GetInteractions()