15#ifndef __vtkMRMLColorNode_h
16#define __vtkMRMLColorNode_h
23class vtkScalarsToColors;
52 void PrintSelf(ostream& os, vtkIndent indent)
override;
66 void WriteXML(ostream& of,
int indent)
override;
90 vtkGetMacro(Type,
int);
110 TypeModifiedEvent = 20002
159 vtkSetStringMacro(FileName);
160 vtkGetStringMacro(FileName);
176 vtkGetStringMacro(NoName);
177 vtkSetStringMacro(NoName);
181 vtkGetMacro(NamesInitialised,
int);
182 vtkSetMacro(NamesInitialised,
int);
183 vtkBooleanMacro(NamesInitialised,
int);
Abstract MRML node to represent color information.
char * FileName
A file name to read text attributes from.
virtual vtkLookupTable * GetLookupTable()
void ProcessMRMLEvents(vtkObject *caller, unsigned long event, void *callData) override
Propagate events generated in mrml.
void ReadXMLAttributes(const char **atts) override
Set node attributes.
virtual void SetType(int type)
Set Type to type, then build colors and set names.
virtual bool GetColor(int ind, double color[4])
void WriteXML(ostream &of, int indent) override
Write this node's information to a MRML file in XML format.
int NamesInitialised
Have the color names been set? Used to do lazy copy of the Names array.
void operator=(const vtkMRMLColorNode &)
virtual vtkLookupTable * CreateLookupTableCopy()
char * NoName
the string used for an unnamed color
vtkMRMLColorNode(const vtkMRMLColorNode &)
vtkMRMLNode * CreateNodeInstance() override
MRMLNode methods.
const char * GetColorName(int ind)
std::string GetColorNameWithoutSpaces(int ind, const char *subst)
void PrintSelf(ostream &os, vtkIndent indent) override
virtual int GetNumberOfColors()
Get the number of colors in the table.
void Reset(vtkMRMLNode *defaultNode) override
virtual const char * GetTypeAsString()
return a text string describing the color look up table type
int GetColorIndexByName(const char *name)
void UpdateScene(vtkMRMLScene *scene) override
int SetColorName(int ind, const char *name)
virtual bool HasNameFromColor(int index)
virtual bool SetNameFromColor(int index)
Set values in the names vector from the colors in the node.
void Copy(vtkMRMLNode *node) override
Copy the node's attributes to this object.
std::string GetColorNameAsFileName(int colorIndex, const char *subst="_")
bool GetModifiedSinceRead() override
static vtkMRMLColorNode * New()
virtual int GetFirstType()
virtual vtkScalarsToColors * GetScalarsToColors()
~vtkMRMLColorNode() override
const char * GetNodeTagName() override
Get node XML tag name (like Volume, Model)
int SetColorNameWithSpaces(int ind, const char *name, const char *subst)
void SetNamesFromColors()
Set values in the names vector from the colors in the node.
std::vector< std::string > Names
A vector of names for the color table elements.
virtual int GetLastType()
Abstract Superclass for all specific types of MRML nodes.
A set of MRML Nodes that supports serialization and undo/redo.
MRML node to represent a 3D surface model.