Slicer 5.9
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
Loading...
Searching...
No Matches
vtkMRMLTextNode.h
Go to the documentation of this file.
1/*=auto=========================================================================
2
3 Portions (c) Copyright 2009 Brigham and Women's Hospital (BWH) All Rights Reserved.
4
5 See Doc/copyright/copyright.txt
6 or http://www.slicer.org/copyright/copyright.txt for details.
7
8 Program: 3D Slicer
9 Module: $RCSfile: vtkMRMLTextNode.h,v $
10 Date: $Date: 2006/03/19 17:12:29 $
11 Version: $Revision: 1.3 $
12
13=========================================================================auto=*/
14
15#ifndef __vtkMRMLTextNode_h
16#define __vtkMRMLTextNode_h
17
18// MRML includes
19#include <vtkMRMLStorableNode.h>
20
21class VTK_MRML_EXPORT vtkMRMLTextNode : public vtkMRMLStorableNode
22{
23public:
26 void PrintSelf(ostream& os, vtkIndent indent) override;
27
28 enum
29 {
33 };
34
36
39 void ReadXMLAttributes(const char** atts) override;
40
43 void WriteXML(ostream& of, int indent) override;
44
48
51 const char* GetNodeTagName() override { return "Text"; };
52
56 void SetText(const std::string& text, int encoding = -1);
57 vtkGetMacro(Text, std::string);
58
64 void SetEncoding(int encoding);
65 vtkGetMacro(Encoding, int);
66 std::string GetEncodingAsString();
67
74 vtkGetMacro(ForceCreateStorageNode, int);
75
80
83 std::string GetDefaultStorageNodeClassName(const char* filename = nullptr) override;
84
85 enum
86 {
87 TextModifiedEvent = 51000, // Invoked if the text OR encoding is changed with SetText() and SetEncoding() methods and is not invoked
88 // if the text and encoding specified in the set methods are the same as the current text and encoding
89 };
90
91protected:
93 ~vtkMRMLTextNode() override;
96
97 std::string Text;
98 int Encoding{ VTK_ENCODING_US_ASCII };
100};
101
102#endif
A superclass for other storage nodes.
vtkMRMLTextNode(const vtkMRMLTextNode &)
void SetText(const std::string &text, int encoding=-1)
void SetEncoding(int encoding)
const char * GetNodeTagName() override
Get node XML tag name (like Volume, Model)
void WriteXML(ostream &of, int indent) override
Write this node's information to a MRML file in XML format.
std::string GetEncodingAsString()
void PrintSelf(ostream &os, vtkIndent indent) override
vtkMRMLStorageNode * CreateDefaultStorageNode() override
void ReadXMLAttributes(const char **atts) override
Set node attributes.
void operator=(const vtkMRMLTextNode &)
~vtkMRMLTextNode() override
vtkMRMLNode * CreateNodeInstance() override
MRMLNode methods.
vtkMRMLCopyContentMacro(vtkMRMLTextNode)
std::string GetDefaultStorageNodeClassName(const char *filename=nullptr) override
static vtkMRMLTextNode * New()