Slicer 5.4
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:
24
27 void PrintSelf(ostream& os, vtkIndent indent) override;
28
29 enum
30 {
33 CreateStorageNodeNever
34 };
35
37
40 void ReadXMLAttributes(const char** atts) override;
41
44 void WriteXML(ostream& of, int indent) override;
45
49
52 const char* GetNodeTagName() override { return "Text"; };
53
57 void SetText(const std::string &text, int encoding=-1);
58 vtkGetMacro(Text, std::string);
59
65 void SetEncoding(int encoding);
66 vtkGetMacro(Encoding, int);
67 std::string GetEncodingAsString();
68
74 vtkSetClampMacro(ForceCreateStorageNode, int, CreateStorageNodeAuto, CreateStorageNodeNever);
75 vtkGetMacro(ForceCreateStorageNode, int);
76
81
84 std::string GetDefaultStorageNodeClassName(const char* filename=nullptr) override;
85
86 enum
87 {
88 TextModifiedEvent = 51000, // Invoked if the text OR encoding is changed with SetText() and SetEncoding() methods and is not invoked
89 // if the text and encoding specified in the set methods are the same as the current text and encoding
90 };
91
92protected:
94 ~vtkMRMLTextNode() override;
97
98 std::string Text;
99 int Encoding{VTK_ENCODING_US_ASCII};
100 int ForceCreateStorageNode{CreateStorageNodeAuto};
101
102};
103
104#endif
Abstract Superclass for all specific types of MRML nodes.
MRML node to represent a 3D surface model.
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()