Slicer  4.8
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
vtkMRMLAnnotationStorageNode.h
Go to the documentation of this file.
1 // .NAME vtkMRMLAnnotationStorageNode - MRML node for representing a volume storage
2 // .SECTION Description
3 // vtkMRMLAnnotationStorageNode nodes describe the annotation storage
4 // node that allows to read/write point data from/to file.
5 
6 #ifndef __vtkMRMLAnnotationStorageNode_h
7 #define __vtkMRMLAnnotationStorageNode_h
8 
9 #include "vtkSlicerAnnotationsModuleMRMLExport.h"
10 #include "vtkMRMLStorageNode.h"
11 
15 
17 class VTK_SLICER_ANNOTATIONS_MODULE_MRML_EXPORT vtkMRMLAnnotationStorageNode : public vtkMRMLStorageNode
18 {
19 public:
20  static vtkMRMLAnnotationStorageNode *New();
22  void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
23 
24  virtual vtkMRMLNode* CreateNodeInstance() VTK_OVERRIDE;
25 
26  // Description:
27  // Get node XML tag name (like Storage, Model)
28  virtual const char* GetNodeTagName() VTK_OVERRIDE {return "AnnotationStorage";}
29 
31  virtual bool CanReadInReferenceNode(vtkMRMLNode* refNode) VTK_OVERRIDE;
32 
33 protected:
38 
39  int WriteAnnotationDisplayProperties(fstream & of, vtkMRMLAnnotationDisplayNode *refNode, std::string preposition);
40  int WriteAnnotationTextDisplayProperties(fstream & of, vtkMRMLAnnotationTextDisplayNode *refNode, std::string preposition);
41 
42  int WriteAnnotationTextProperties(fstream & of, vtkMRMLAnnotationNode *refNode);
43  int WriteAnnotationData(fstream& of, vtkMRMLAnnotationNode *refNode);
44  int OpenFileToWrite(fstream& of);
45 
46  // Description:
47  // Read data related to vtkMRMLAnnotationDisplayNode
48  int ReadAnnotationDisplayProperties(vtkMRMLAnnotationDisplayNode *annotationDisplayNode, std::string lineString, std::string preposition);
49  int ReadAnnotationTextDisplayProperties(vtkMRMLAnnotationTextDisplayNode *annotationDisplayNode, std::string lineString, std::string preposition);
50 
51  int ReadAnnotationTextData(vtkMRMLAnnotationNode *refNode, char line[1024], int typeColumn, int textColumn, int selColumn,
52  int visColumn, int numColumns);
53  int ReadAnnotationTextProperties(vtkMRMLAnnotationNode *annotationNode, char line[1024], int &typeColumn, int& annotationColumn, int& selColumn, int& visColumn, int& columnNumber);
54  // Description:
55  // assumes that ResetAnnotations is executed
56  int ReadAnnotation(vtkMRMLAnnotationNode *refNode);
57 
58  int OpenFileToRead(fstream& of, vtkMRMLNode *refNode);
59  const char* GetAnnotationStorageType() { return "text"; }
60 
62  virtual void InitializeSupportedReadFileTypes() VTK_OVERRIDE;
63 
65  virtual void InitializeSupportedWriteFileTypes() VTK_OVERRIDE;
66 
68  virtual int ReadDataInternal(vtkMRMLNode *refNode) VTK_OVERRIDE;
69 
71  virtual int WriteDataInternal(vtkMRMLNode *refNode) VTK_OVERRIDE;
73  virtual int WriteAnnotationDataInternal(vtkMRMLNode *refNode, fstream &of);
74 
75 };
76 
77 #endif
virtual int ReadDataInternal(vtkMRMLNode *refNode)
virtual void InitializeSupportedReadFileTypes()
void operator=(const vtkMRMLStorageNode &)
virtual vtkMRMLNode * CreateNodeInstance() VTK_OVERRIDE=0
Create instance of the default node. Like New only virtual.
A supercalss for other storage nodes.
void PrintSelf(ostream &os, vtkIndent indent) VTK_OVERRIDE
virtual void InitializeSupportedWriteFileTypes()
virtual int WriteDataInternal(vtkMRMLNode *refNode)
Abstract Superclass for all specific types of MRML nodes.
Definition: vtkMRMLNode.h:135
virtual bool CanReadInReferenceNode(vtkMRMLNode *refNode)=0