15 #ifndef __vtkMRMLColorNode_h 16 #define __vtkMRMLColorNode_h 23 class vtkScalarsToColors;
52 void PrintSelf(ostream& os, vtkIndent indent)
override;
66 void WriteXML(ostream& of,
int indent)
override;
87 virtual void SetType(
int type);
90 vtkGetMacro(Type,
int);
97 void ProcessMRMLEvents ( vtkObject *caller,
unsigned long event,
void *callData )
override;
105 virtual const char * GetTypeAsString();
110 TypeModifiedEvent = 20002
115 const char *GetColorName(
int ind);
120 int GetColorIndexByName(
const char *name);
132 std::string GetColorNameAsFileName(
int colorIndex,
const char *subst =
"_");
138 std::string GetColorNameWithoutSpaces(
int ind,
const char *subst);
142 int SetColorName(
int ind,
const char *name);
147 int SetColorNameWithSpaces(
int ind,
const char *name,
const char *subst);
150 virtual int GetNumberOfColors();
155 virtual bool GetColor(
int ind,
double color[4]);
159 vtkSetStringMacro(FileName);
160 vtkGetStringMacro(FileName);
165 virtual vtkLookupTable * GetLookupTable();
171 virtual vtkScalarsToColors* GetScalarsToColors();
176 vtkGetStringMacro(NoName);
177 vtkSetStringMacro(NoName);
181 vtkGetMacro(NamesInitialised,
int);
182 vtkSetMacro(NamesInitialised,
int);
183 vtkBooleanMacro(NamesInitialised,
int);
186 void SetNamesFromColors();
206 virtual vtkLookupTable* CreateLookupTableCopy();
216 virtual bool SetNameFromColor(
int index);
222 virtual bool HasNameFromColor(
int index);
virtual void Reset(vtkMRMLNode *defaultNode)
Reset node attributes to the initial state as defined in the constructor or the passed default node...
void ReadXMLAttributes(const char **atts) override
Read node attributes from XML file
virtual bool GetModifiedSinceRead()
virtual int GetFirstType()
vtkMRMLNode * CreateNodeInstance() override=0
MRMLNode methods.
const char * GetNodeTagName() override
Get node XML tag name (like Volume, Model)
virtual void Copy(vtkMRMLNode *node)
Copy node contents from another node of the same type. Does not copy node ID and Scene. Performs deep copy - an independent copy is created from all data, including bulk data.
MRML node to represent a 3D surface model.
A set of MRML Nodes that supports serialization and undo/redo.
char * NoName
the string used for an unnamed colour
int NamesInitialised
Have the colour names been set? Used to do lazy copy of the Names array.
char * FileName
A file name to read text attributes from
Abstract MRML node to represent color information.
void ProcessMRMLEvents(vtkObject *, unsigned long, void *) override
alternative method to propagate events generated in Storage nodes
virtual int GetLastType()
void UpdateScene(vtkMRMLScene *scene) override
Finds the storage node and read the data
Abstract Superclass for all specific types of MRML nodes.
std::vector< std::string > Names
A vector of names for the color table elements
void operator=(const vtkMRMLStorableNode &)
void WriteXML(ostream &of, int indent) override
Write this node's information to a MRML file in XML format.
void PrintSelf(ostream &os, vtkIndent indent) override