VTK
vtkTable.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkTable.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
15 /*-------------------------------------------------------------------------
16  Copyright 2008 Sandia Corporation.
17  Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
18  the U.S. Government retains certain rights in this software.
19 -------------------------------------------------------------------------*/
57 #ifndef vtkTable_h
58 #define vtkTable_h
59 
60 #include "vtkCommonDataModelModule.h" // For export macro
61 #include "vtkDataObject.h"
62 
63 class vtkAbstractArray;
65 class vtkVariant;
66 class vtkVariantArray;
67 
68 class VTKCOMMONDATAMODEL_EXPORT vtkTable : public vtkDataObject
69 {
70 public:
71  static vtkTable* New();
72  vtkTypeMacro(vtkTable, vtkDataObject);
73  void PrintSelf(ostream &os, vtkIndent indent) override;
74 
81  void Dump( unsigned int colWidth = 16, int rowLimit = -1 );
82 
86  int GetDataObjectType() override {return VTK_TABLE;}
87 
95  unsigned long GetActualMemorySize() override;
96 
98 
101  vtkGetObjectMacro(RowData, vtkDataSetAttributes);
104 
105  //
106  // Row functions
107  //
108 
113 
119 
125 
129  void GetRow(vtkIdType row, vtkVariantArray *values);
130 
134  void SetRow(vtkIdType row, vtkVariantArray *values);
135 
139  vtkIdType InsertNextBlankRow(double default_num_val=0.0);
140 
146 
150  void RemoveRow(vtkIdType row);
151 
152  //
153  // Column functions
154  //
155 
160 
161  // Get the name of a column of the table.
162  const char* GetColumnName(vtkIdType col);
163 
168 
173 
178 
182  void RemoveColumnByName(const char* name);
183 
188 
189  //
190  // Table single entry functions
191  //
192 
200 
204  vtkVariant GetValueByName(vtkIdType row, const char* col);
205 
210 
214  void SetValueByName(vtkIdType row, const char* col, vtkVariant value);
215 
219  void Initialize() override;
220 
222 
226  static vtkTable* GetData(vtkInformationVector* v, int i=0);
228 
230 
233  void ShallowCopy(vtkDataObject* src) override;
234  void DeepCopy(vtkDataObject* src) override;
236 
244 
249 
250 protected:
252  ~vtkTable() override;
253 
258 
263 
264 private:
265  vtkTable(const vtkTable&) = delete;
266  void operator=(const vtkTable&) = delete;
267 };
268 
269 #endif
270 
vtkTable::GetActualMemorySize
unsigned long GetActualMemorySize() override
Return the actual size of the data in kibibytes (1024 bytes).
vtkTable::vtkTable
vtkTable()
vtkTable::SetRowData
virtual void SetRowData(vtkDataSetAttributes *data)
vtkTable::SetNumberOfRows
void SetNumberOfRows(const vtkIdType)
Set the number of rows in the table.
vtkX3D::value
@ value
Definition: vtkX3D.h:220
vtkX3D::type
@ type
Definition: vtkX3D.h:516
vtkIdType
int vtkIdType
Definition: vtkType.h:347
vtkDataSetAttributes
represent and manipulate attribute data in a dataset
Definition: vtkDataSetAttributes.h:60
vtkX3D::data
@ data
Definition: vtkX3D.h:315
vtkTable::~vtkTable
~vtkTable() override
vtkInformationVector
Store zero or more vtkInformation instances.
Definition: vtkInformationVector.h:42
vtkTable
A table, which contains similar-typed columns of data.
Definition: vtkTable.h:69
vtkTable::Dump
void Dump(unsigned int colWidth=16, int rowLimit=-1)
Dump table contents.
vtkTable::DeepCopy
void DeepCopy(vtkDataObject *src) override
vtkTable::GetColumnName
const char * GetColumnName(vtkIdType col)
VTK_TABLE
#define VTK_TABLE
Definition: vtkType.h:110
vtkVariantArray
An array holding vtkVariants.
Definition: vtkVariantArray.h:47
vtkTable::New
static vtkTable * New()
vtkTable::GetRow
vtkVariantArray * GetRow(vtkIdType row)
Get a row of the table as a vtkVariantArray which has one entry for each column.
vtkTable::GetNumberOfElements
vtkIdType GetNumberOfElements(int type) override
Get the number of elements for a specific attribute type (ROW, etc.).
vtkTable::ShallowCopy
void ShallowCopy(vtkDataObject *src) override
Shallow/deep copy the data from src into this object.
vtkTable::RowArray
vtkVariantArray * RowArray
Holds row information returned by GetRow().
Definition: vtkTable.h:262
vtkFieldData
represent and manipulate fields of data
Definition: vtkFieldData.h:57
vtkTable::GetColumn
vtkAbstractArray * GetColumn(vtkIdType col)
Get a column of the table by its column index.
vtkTable::GetColumnByName
vtkAbstractArray * GetColumnByName(const char *name)
Get a column of the table by its name.
vtkTable::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkTable::GetValueByName
vtkVariant GetValueByName(vtkIdType row, const char *col)
Retrieve a value in the table by row index and column name as a variant.
vtkTable::RemoveColumnByName
void RemoveColumnByName(const char *name)
Remove a column from the table by its name.
vtkTable::SetValue
void SetValue(vtkIdType row, vtkIdType col, vtkVariant value)
Set a value in the table by row and column index as a variant.
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:40
vtkTable::Initialize
void Initialize() override
Initialize to an empty table.
vtkVariant
A atomic type representing the union of many types.
Definition: vtkVariant.h:72
vtkTable::GetDataObjectType
int GetDataObjectType() override
Return what type of dataset this is.
Definition: vtkTable.h:86
vtkTable::GetData
static vtkTable * GetData(vtkInformation *info)
Retrieve the table from vtkInformation.
vtkX3D::name
@ name
Definition: vtkX3D.h:219
vtkTable::SetValueByName
void SetValueByName(vtkIdType row, const char *col, vtkVariant value)
Set a value in the table by row index and column name as a variant.
vtkTable::SetRow
void SetRow(vtkIdType row, vtkVariantArray *values)
Set a row of the table with a vtkVariantArray which has one entry for each column.
vtkAbstractArray
Abstract superclass for all arrays.
Definition: vtkAbstractArray.h:79
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:87
vtkTable::RemoveColumn
void RemoveColumn(vtkIdType col)
Remove a column from the table by its column index.
vtkTable::RowData
vtkDataSetAttributes * RowData
Holds the column data of the table.
Definition: vtkTable.h:257
vtkTable::InsertNextRow
vtkIdType InsertNextRow(vtkVariantArray *arr)
Insert a row specified by a vtkVariantArray.
vtkX3D::info
@ info
Definition: vtkX3D.h:376
vtkTable::GetValue
vtkVariant GetValue(vtkIdType row, vtkIdType col)
Retrieve a value in the table by row and column index as a variant.
vtkTable::GetNumberOfColumns
vtkIdType GetNumberOfColumns()
Get the number of columns in the table.
vtkDataObject.h
vtkTable::GetNumberOfRows
vtkIdType GetNumberOfRows()
Get the number of rows in the table.
vtkDataObject
general representation of visualization data
Definition: vtkDataObject.h:65
vtkTable::RemoveRow
void RemoveRow(vtkIdType row)
Delete a row from the table.
vtkTable::GetRow
void GetRow(vtkIdType row, vtkVariantArray *values)
Get a row of the table as a vtkVariantArray which has one entry for each column.
vtkTable::GetData
static vtkTable * GetData(vtkInformationVector *v, int i=0)
vtkTable::AddColumn
void AddColumn(vtkAbstractArray *arr)
Add a column to the table.
vtkTable::InsertNextBlankRow
vtkIdType InsertNextBlankRow(double default_num_val=0.0)
Insert a blank row at the end of the table.
vtkTable::GetAttributesAsFieldData
vtkFieldData * GetAttributesAsFieldData(int type) override
Returns the attributes of the data object as a vtkFieldData.