16 #ifndef __vtkMRMLColorLegendDisplayNode_h 17 #define __vtkMRMLColorLegendDisplayNode_h 21 #include "vtkSlicerColorsModuleMRMLExport.h" 24 class vtkTextProperty;
42 void PrintSelf(ostream& os, vtkIndent indent)
override;
53 void WriteXML(ostream& of,
int indent)
override;
60 vtkGetMacro(Orientation, OrientationType);
63 vtkSetMacro(Orientation, OrientationType);
67 vtkGetVector2Macro(Position,
double);
70 vtkSetVector2Macro(Position,
double);
74 vtkGetVector2Macro(Size,
double);
81 vtkSetVector2Macro(Size,
double);
85 vtkGetMacro(TitleText, std::string);
87 vtkSetMacro(TitleText, std::string);
91 vtkGetMacro(LabelFormat, std::string);
100 vtkSetMacro(LabelFormat, std::string);
106 virtual std::string GetDefaultNumericLabelFormat();
111 virtual std::string GetDefaultTextLabelFormat();
114 vtkGetMacro(MaxNumberOfColors,
int);
116 vtkSetMacro(MaxNumberOfColors,
int);
120 vtkGetMacro(NumberOfLabels,
int);
122 vtkSetMacro(NumberOfLabels,
int);
126 vtkGetMacro(UseColorNamesForLabels,
bool);
128 vtkSetMacro(UseColorNamesForLabels,
bool);
132 vtkGetObjectMacro(TitleTextProperty, vtkTextProperty);
139 vtkGetObjectMacro(LabelTextProperty, vtkTextProperty);
155 void ProcessMRMLEvents(vtkObject *caller,
unsigned long eventID,
void *callData)
override;
163 static const char* GetOrientationAsString(
int id);
164 static int GetOrientationFromString(
const char* name);
165 void SetOrientation(
int id);
168 void SetTitleTextPropertyFromString(std::string textPropertyString);
171 void SetLabelTextPropertyFromString(std::string textPropertyString);
172 std::string GetTitleTextPropertyAsString();
173 std::string GetLabelTextPropertyAsString();
178 double Position[2]{ 0.95, 0.5 };
179 double Size[2]{ 0.15, 0.5 };
180 std::string TitleText;
181 vtkTextProperty* TitleTextProperty{
nullptr };
182 vtkTextProperty* LabelTextProperty{
nullptr };
186 std::string LabelFormat;
187 int MaxNumberOfColors{ 256 };
188 int NumberOfLabels{ 5 };
189 bool UseColorNamesForLabels{
false };
190 bool CenterLabels{
false };
void PrintSelf(ostream &os, vtkIndent indent) override
const char * GetNodeTagName() override
Get node XML tag name (like Volume, Model)
void ReadXMLAttributes(const char **atts) override
virtual vtkMRMLNode * CreateNodeInstance()=0
Create instance of the default node. Like New only virtual.
vtkMRMLCopyContentMacro(vtkMRMLDisplayNode)
void WriteXML(ostream &of, int indent) override
void operator=(const vtkMRMLDisplayNode &)
Abstract MRML node to represent color information.
void ProcessMRMLEvents(vtkObject *caller, unsigned long event, void *callData) override
Abstract class that contains graphical display properties for displayable nodes.
Abstract Superclass for all specific types of MRML nodes.
OrientationType
color legend orientation preset on a view node
Class describing how to display a color legend.