Slicer  4.8
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  Program: Slicer
4  Language: C++
5  Module: $HeadURL: http://svn.slicer.org/Slicer4/trunk/Applications/GUI/Slicer3.cxx $
6  Date: $Date: 2009-04-15 06:29:13 -0400 (Wed, 15 Apr 2009) $
7  Version: $Revision: 9206 $
8 
9  Copyright (c) Brigham and Women's Hospital (BWH) All Rights Reserved.
10 
11  See License.txt or http://www.slicer.org/copyright/copyright.txt for details.
12 
13 ==========================================================================*/
14 
15 #ifndef __vtkMRMLParser_h
16 #define __vtkMRMLParser_h
17 
18 // MRML includes
19 #include "vtkMRML.h"
20 class vtkMRMLNode;
21 class vtkMRMLScene;
22 
23 // VTK includes
24 #include "vtkXMLParser.h"
25 class vtkCollection;
26 
27 // STD includes
28 #include <stack>
29 
31 class VTK_MRML_EXPORT vtkMRMLParser : public vtkXMLParser
32 {
33 public:
34  static vtkMRMLParser *New();
35  vtkTypeMacro(vtkMRMLParser,vtkXMLParser);
36 
37  vtkMRMLScene* GetMRMLScene() {return this->MRMLScene;};
38  void SetMRMLScene(vtkMRMLScene* scene) {this->MRMLScene = scene;};
39 
40  vtkCollection* GetNodeCollection() {return this->NodeCollection;};
41  void SetNodeCollection(vtkCollection* scene) {this->NodeCollection = scene;};
42 
43 protected:
44  vtkMRMLParser() : MRMLScene(NULL),NodeCollection(NULL){};
47  void operator=(const vtkMRMLParser&);
48 
49  virtual void StartElement(const char* name, const char** atts) VTK_OVERRIDE;
50  virtual void EndElement (const char *name) VTK_OVERRIDE;
51 
52 private:
53  vtkMRMLScene* MRMLScene;
54  vtkCollection* NodeCollection;
55  std::stack< vtkMRMLNode *> NodeStack;
56 };
57 
58 #endif
vtkMRMLScene * GetMRMLScene()
Definition: vtkMRMLParser.h:37
void SetMRMLScene(vtkMRMLScene *scene)
Definition: vtkMRMLParser.h:38
A set of MRML Nodes that supports serialization and undo/redo.
Definition: vtkMRMLScene.h:54
void SetNodeCollection(vtkCollection *scene)
Definition: vtkMRMLParser.h:41
Parse XML scene file.
Definition: vtkMRMLParser.h:31
vtkCollection * GetNodeCollection()
Definition: vtkMRMLParser.h:40
Abstract Superclass for all specific types of MRML nodes.
Definition: vtkMRMLNode.h:135