23 #ifndef __vtkMRMLTableNode_h 24 #define __vtkMRMLTableNode_h 53 void PrintSelf(ostream& os, vtkIndent indent)
override;
67 void WriteXML(ostream& of,
int indent)
override;
79 void ProcessMRMLEvents(vtkObject *caller,
unsigned long event,
void *callData)
override;
84 virtual void SetAndObserveTable(vtkTable*
table);
85 vtkGetObjectMacro(Table, vtkTable);
103 virtual void SetAndObserveSchema(vtkTable* schema);
104 vtkGetObjectMacro(Schema, vtkTable);
108 vtkGetMacro(Locked,
bool);
109 vtkSetMacro(Locked,
bool);
112 vtkGetMacro(UseFirstColumnAsRowHeader,
bool);
113 vtkSetMacro(UseFirstColumnAsRowHeader,
bool);
117 vtkGetMacro(UseColumnNameAsColumnHeader,
bool);
118 vtkSetMacro(UseColumnNameAsColumnHeader,
bool);
132 vtkAbstractArray* AddColumn(vtkAbstractArray* column =
nullptr);
139 bool RenameColumn(
int columnIndex,
const char* newName);
144 bool RemoveColumn(
int columnIndex);
149 bool RemoveAllColumns();
159 bool RemoveRow(
int rowIndex);
164 std::string GetCellText(
int rowIndex,
int columnIndex);
172 bool SetCellText(
int rowIndex,
int columnIndex,
const char* text);
177 int GetColumnIndex(
const char* columnName);
178 int GetColumnIndex(
const std::string &columnName);
183 int GetColumnIndex(vtkAbstractArray* column);
188 std::string GetColumnName(
int columnIndex);
192 int GetNumberOfRows();
196 int GetNumberOfColumns();
200 void SetColumnNullValue(
const std::string& columnName,
const std::string& nullValue);
201 std::string GetColumnNullValue(
const std::string& columnName);
207 void SetColumnLongName(
const std::string& columnName,
const std::string& description);
208 std::string GetColumnLongName(
const std::string& columnName);
212 void SetColumnDescription(
const std::string& columnName,
const std::string& description);
213 std::string GetColumnDescription(
const std::string& columnName);
217 void SetColumnUnitLabel(
const std::string& columnName,
const std::string& unitLabel);
218 std::string GetColumnUnitLabel(
const std::string& columnName);
224 std::string GetColumnProperty(
const std::string& columnName,
const std::string& propertyName);
225 std::string GetColumnProperty(
int columnIndex,
const std::string& propertyName);
230 void GetAllColumnPropertyNames(vtkStringArray* propertyNames);
237 void SetColumnProperty(
const std::string& columnName,
const std::string& propertyName,
const std::string& propertyValue);
238 void SetColumnProperty(
int columnIndex,
const std::string& propertyName,
const std::string& propertyValue);
244 void RemoveColumnProperty(
const std::string& propertyName);
248 void CopyAllColumnProperties(
const std::string& sourceColumnName,
const std::string& targetColumnName);
253 void RemoveAllColumnProperties(
const std::string& columnName);
254 void RemoveAllColumnProperties(
int columnIndex);
258 int GetColumnValueTypeFromSchema(
const std::string& columnName);
262 vtkIdType InsertNextBlankRowWithNullValues(vtkTable*
table);
266 int GetColumnType(
const std::string& columnName);
273 bool SetColumnType(
const std::string& columnName,
int typeId);
283 bool SetDefaultColumnType(
const std::string& type,
const std::string& nullValue=
"");
286 static const char* GetDefaultColumnName();
289 static int GetValueTypeFromString(std::string valueTypeStr);
292 static std::string GetValueTypeAsString(
int valueType);
295 bool SetComponentNames(
const std::string& columnName,
const std::vector<std::string>& componentNames);
298 std::vector<std::string> GetComponentNames(
const std::string& columnName);
302 std::vector<std::string> GetComponentNamesFromSchema(
const std::string& columnName);
305 static std::vector<std::string> GetComponentNamesFromArray(vtkAbstractArray* array);
308 static const std::vector<std::string> GetComponentNamesFromString(
const std::string& componentNameString);
311 static std::string GetComponentNamesAsString(
const std::vector<std::string>& componentNames);
325 std::string GetColumnPropertyInternal(
const std::string& columnName,
const std::string& propertyName);
328 void SetColumnPropertyInternal(
const std::string& columnName,
const std::string& propertyName,
const std::string& propertyValue);
330 vtkIdType GetPropertyRowIndex(
const std::string& columnName);
bool UseColumnNameAsColumnHeader
virtual vtkMRMLStorageNode * CreateDefaultStorageNode()
void ReadXMLAttributes(const char **atts) override
Read node attributes from XML file
bool UseFirstColumnAsRowHeader
vtkMRMLNode * CreateNodeInstance() override=0
MRMLNode methods.
MRML node to represent a 3D surface model.
A superclass for other storage nodes.
void ProcessMRMLEvents(vtkObject *, unsigned long, void *) override
alternative method to propagate events generated in Storage nodes
const char * GetNodeTagName() override
Get node XML tag name (like Volume, Model)
vtkMRMLCopyContentMacro(vtkMRMLStorableNode)
MRML node to represent a table object.
Abstract Superclass for all specific types of MRML nodes.
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