Slicer  5.3
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 
62  void Copy(vtkMRMLNode* node) override;
63 
67 
70  void UpdateScene(vtkMRMLScene *scene) override;
71 
74  void ProcessMRMLEvents ( vtkObject * /*caller*/,
75  unsigned long /*event*/,
76  void * /*callData*/ ) override;
77 
80  void SetAndObserveStorageNodeID(const char *storageNodeID);
81  void AddAndObserveStorageNodeID(const char *storageNodeID);
82  void SetAndObserveNthStorageNodeID(int n, const char *storageNodeID);
83 
86  bool HasStorageNodeID(const char* storageNodeID);
87 
96  void SetSlicerDataType ( const char *type );
97  const char *GetSlicerDataType ();
98 
99  int GetNumberOfStorageNodes();
100  const char *GetNthStorageNodeID(int n);
101  const char *GetStorageNodeID();
102 
105  vtkMRMLStorageNode* GetNthStorageNode(int n);
106  vtkMRMLStorageNode* GetStorageNode();
107 
113  virtual vtkMRMLStorageNode* CreateDefaultStorageNode();
114 
119  virtual std::string GetDefaultStorageNodeClassName(const char* filename = nullptr);
120 
123  virtual bool AddDefaultStorageNode(const char* filename = nullptr);
124 
130  vtkSetMacro(DefaultSequenceStorageNodeClassName, std::string);
131  vtkGetMacro(DefaultSequenceStorageNodeClassName, std::string);
132 
137  virtual vtkMRMLStorageNode* CreateDefaultSequenceStorageNode();
138 
152  virtual bool GetModifiedSinceRead();
153 
157  virtual void StorableModified();
158 
159  protected:
161  ~vtkMRMLStorableNode() override;
163  void operator=(const vtkMRMLStorableNode&);
164 
165  static const char* StorageNodeReferenceRole;
167 
168  virtual const char* GetStorageNodeReferenceRole();
169  virtual const char* GetStorageNodeReferenceMRMLAttributeName();
170 
172 
176  std::string SlicerDataType;
177 
179 
187  virtual vtkTimeStamp GetStoredTime();
188 
197  vtkTimeStamp StorableModifiedTime;
198 };
199 
200 #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.
virtual void Copy(vtkMRMLNode *node)
Copy node contents from another node of the same type. Does not copy node ID and Scene. Performs deep copy - an independent copy is created from all data, including bulk data.
MRML node to represent a 3D surface model.
A set of MRML Nodes that supports serialization and undo/redo.
Definition: vtkMRMLScene.h:57
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
std::string DefaultSequenceStorageNodeClassName
static const char * StorageNodeReferenceRole
virtual void UpdateScene(vtkMRMLScene *)
Definition: vtkMRMLNode.h:206