Slicer  5.1
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
vtkMRMLParser.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Copyright (c) Brigham and Women's Hospital (BWH) All Rights Reserved.
4 
5  See License.txt or http://www.slicer.org/copyright/copyright.txt for details.
6 
7 ==========================================================================*/
8 
9 #ifndef __vtkMRMLParser_h
10 #define __vtkMRMLParser_h
11 
12 // MRML includes
13 #include "vtkMRML.h"
14 class vtkMRMLNode;
15 class vtkMRMLScene;
16 
17 // VTK includes
18 #include "vtkXMLParser.h"
19 class vtkCollection;
20 
21 // STD includes
22 #include <stack>
23 
25 class VTK_MRML_EXPORT vtkMRMLParser : public vtkXMLParser
26 {
27 public:
28  static vtkMRMLParser *New();
29  vtkTypeMacro(vtkMRMLParser,vtkXMLParser);
30 
31  vtkMRMLScene* GetMRMLScene() {return this->MRMLScene;};
32  void SetMRMLScene(vtkMRMLScene* scene) {this->MRMLScene = scene;};
33 
34  vtkCollection* GetNodeCollection() {return this->NodeCollection;};
35  void SetNodeCollection(vtkCollection* scene) {this->NodeCollection = scene;};
36 
37 protected:
38  vtkMRMLParser() = default;;
39  ~vtkMRMLParser() override = default;
41  void operator=(const vtkMRMLParser&);
42 
43  void StartElement(const char* name, const char** atts) override;
44  void EndElement (const char *name) override;
45 
46 private:
47  vtkMRMLScene* MRMLScene{nullptr};
48  vtkCollection* NodeCollection{nullptr};
49  std::stack< vtkMRMLNode *> NodeStack;
50 };
51 
52 #endif
vtkMRMLScene * GetMRMLScene()
Definition: vtkMRMLParser.h:31
void SetMRMLScene(vtkMRMLScene *scene)
Definition: vtkMRMLParser.h:32
A set of MRML Nodes that supports serialization and undo/redo.
Definition: vtkMRMLScene.h:57
void SetNodeCollection(vtkCollection *scene)
Definition: vtkMRMLParser.h:35
Parse XML scene file.
Definition: vtkMRMLParser.h:25
vtkCollection * GetNodeCollection()
Definition: vtkMRMLParser.h:34
Abstract Superclass for all specific types of MRML nodes.
Definition: vtkMRMLNode.h:167