Slicer  4.13
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
vtkMRMLStorableNode.h
Go to the documentation of this file.
1 /*=auto=========================================================================
2 
3  Portions (c) Copyright 2005 Brigham and Women's Hospital (BWH) All Rights Reserved.
4 
5  See COPYRIGHT.txt
6  or http://www.slicer.org/copyright/copyright.txt for details.
7 
8  Program: 3D Slicer
9  Module: $RCSfile: vtkMRMLStorableNode.h,v $
10  Date: $Date: 2006/03/19 17:12:28 $
11  Version: $Revision: 1.6 $
12 
13 =========================================================================auto=*/
14 
15 #ifndef __vtkMRMLStorableNode_h
16 #define __vtkMRMLStorableNode_h
17 
18 // MRML includes
19 #include "vtkMRMLNode.h"
20 class vtkMRMLStorageNode;
21 
22 // VTK includes
23 class vtkTagTable;
24 
25 // STD includes
26 #include <vector>
27 
33 class VTK_MRML_EXPORT vtkMRMLStorableNode : public vtkMRMLNode
34 {
35 public:
37  void PrintSelf(ostream& os, vtkIndent indent) override;
38 
39  //--------------------------------------------------------------------------
41  //--------------------------------------------------------------------------
42  vtkGetObjectMacro ( UserTagTable, vtkTagTable );
43 
44  //--------------------------------------------------------------------------
46  //--------------------------------------------------------------------------
47 
48  vtkMRMLNode* CreateNodeInstance() override = 0;
49 
50  const char* GetNodeTagName() override = 0;
51 
54  void ReadXMLAttributes( const char** atts) override;
55 
58  void WriteXML(ostream& of, int indent) override;
59 
63 
66  void UpdateScene(vtkMRMLScene *scene) override;
67 
70  void ProcessMRMLEvents ( vtkObject * /*caller*/,
71  unsigned long /*event*/,
72  void * /*callData*/ ) override;
73 
76  void SetAndObserveStorageNodeID(const char *storageNodeID);
77  void AddAndObserveStorageNodeID(const char *storageNodeID);
78  void SetAndObserveNthStorageNodeID(int n, const char *storageNodeID);
79 
82  bool HasStorageNodeID(const char* storageNodeID);
83 
92  void SetSlicerDataType ( const char *type );
93  const char *GetSlicerDataType ();
94 
95  int GetNumberOfStorageNodes();
96  const char *GetNthStorageNodeID(int n);
97  const char *GetStorageNodeID();
98 
101  vtkMRMLStorageNode* GetNthStorageNode(int n);
102  vtkMRMLStorageNode* GetStorageNode();
103 
109  virtual vtkMRMLStorageNode* CreateDefaultStorageNode();
110 
115  virtual std::string GetDefaultStorageNodeClassName(const char* filename = nullptr);
116 
119  virtual bool AddDefaultStorageNode(const char* filename = nullptr);
120 
125  virtual vtkMRMLStorageNode* CreateDefaultSequenceStorageNode();
126 
140  virtual bool GetModifiedSinceRead();
141 
145  virtual void StorableModified();
146 
147  protected:
149  ~vtkMRMLStorableNode() override;
151  void operator=(const vtkMRMLStorableNode&);
152 
153  static const char* StorageNodeReferenceRole;
155 
156  virtual const char* GetStorageNodeReferenceRole();
157  virtual const char* GetStorageNodeReferenceMRMLAttributeName();
158 
160 
164  std::string SlicerDataType;
165 
173  virtual vtkTimeStamp GetStoredTime();
174 
183  vtkTimeStamp StorableModifiedTime;
184 };
185 
186 #endif
static const char * StorageNodeReferenceMRMLAttributeName
virtual void ReadXMLAttributes(const char **atts)
void operator=(const vtkMRMLNode &)
virtual vtkMRMLNode * CreateNodeInstance()=0
Create instance of the default node. Like New only virtual.
virtual void ProcessMRMLEvents(vtkObject *caller, unsigned long event, void *callData)
Propagate events generated in mrml.
MRML node to represent a 3D surface model.
A set of MRML Nodes that supports serialization and undo/redo.
Definition: vtkMRMLScene.h:61
A superclass for other storage nodes.
virtual void WriteXML(ostream &of, int indent)
void PrintSelf(ostream &os, vtkIndent indent) override
#define vtkMRMLCopyContentMacro(thisClassName)
Definition: vtkMRMLNode.h:142
vtkTimeStamp StorableModifiedTime
virtual const char * GetNodeTagName()=0
Abstract Superclass for all specific types of MRML nodes.
Definition: vtkMRMLNode.h:167
static const char * StorageNodeReferenceRole
virtual void UpdateScene(vtkMRMLScene *)
Definition: vtkMRMLNode.h:206