Slicer 5.9
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
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"
14class vtkMRMLNode;
15class vtkMRMLScene;
16
17// VTK includes
18#include "vtkXMLParser.h"
19class vtkCollection;
20
21// STD includes
22#include <stack>
23
25class VTK_MRML_EXPORT vtkMRMLParser : public vtkXMLParser
26{
27public:
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
37protected:
38 vtkMRMLParser() = default;;
39 ~vtkMRMLParser() override = default;
42
43 void StartElement(const char* name, const char** atts) override;
44 void EndElement (const char *name) override;
45
46private:
47 vtkMRMLScene* MRMLScene{nullptr};
48 vtkCollection* NodeCollection{nullptr};
49 std::stack< vtkMRMLNode *> NodeStack;
50};
51
52#endif
Abstract Superclass for all specific types of MRML nodes.
~vtkMRMLParser() override=default
vtkMRMLParser(const vtkMRMLParser &)
void SetMRMLScene(vtkMRMLScene *scene)
vtkCollection * GetNodeCollection()
vtkMRMLScene * GetMRMLScene()
static vtkMRMLParser * New()
vtkMRMLParser()=default
void SetNodeCollection(vtkCollection *scene)
void EndElement(const char *name) override
void operator=(const vtkMRMLParser &)
void StartElement(const char *name, const char **atts) override
A set of MRML Nodes that supports serialization and undo/redo.