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
65class vtkVariant;
66class vtkVariantArray;
67
68class VTKCOMMONDATAMODEL_EXPORT vtkTable : public vtkDataObject
69{
70public:
71 static vtkTable* New();
72 vtkTypeMacro(vtkTable, vtkDataObject);
73 void PrintSelf(ostream &os, vtkIndent indent) VTK_OVERRIDE;
74
81 void Dump( unsigned int colWidth = 16, int rowLimit = -1 );
82
86 int GetDataObjectType() VTK_OVERRIDE {return VTK_TABLE;}
87
95 unsigned long GetActualMemorySize() VTK_OVERRIDE;
96
98
101 vtkGetObjectMacro(RowData, vtkDataSetAttributes);
102 virtual void SetRowData(vtkDataSetAttributes* data);
104
105 //
106 // Row functions
107 //
108
112 vtkIdType GetNumberOfRows();
113
118 void SetNumberOfRows(const vtkIdType );
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
145 vtkIdType InsertNextRow(vtkVariantArray* arr);
146
150 void RemoveRow(vtkIdType row);
151
152 //
153 // Column functions
154 //
155
159 vtkIdType GetNumberOfColumns();
160
161 // Get the name of a column of the table.
162 const char* GetColumnName(vtkIdType col);
163
167 vtkAbstractArray* GetColumnByName(const char* name);
168
173
177 void AddColumn(vtkAbstractArray* arr);
178
182 void RemoveColumnByName(const char* name);
183
187 void RemoveColumn(vtkIdType col);
188
189 //
190 // Table single entry functions
191 //
192
199 vtkVariant GetValue(vtkIdType row, vtkIdType col);
200
204 vtkVariant GetValueByName(vtkIdType row, const char* col);
205
209 void SetValue(vtkIdType row, vtkIdType col, vtkVariant value);
210
214 void SetValueByName(vtkIdType row, const char* col, vtkVariant value);
215
219 void Initialize() VTK_OVERRIDE;
220
222
225 static vtkTable* GetData(vtkInformation* info);
226 static vtkTable* GetData(vtkInformationVector* v, int i=0);
228
230
233 void ShallowCopy(vtkDataObject* src) VTK_OVERRIDE;
234 void DeepCopy(vtkDataObject* src) VTK_OVERRIDE;
236
243 vtkFieldData* GetAttributesAsFieldData(int type) VTK_OVERRIDE;
244
248 vtkIdType GetNumberOfElements(int type) VTK_OVERRIDE;
249
250protected:
252 ~vtkTable() VTK_OVERRIDE;
253
258
263
264private:
265 vtkTable(const vtkTable&) VTK_DELETE_FUNCTION;
266 void operator=(const vtkTable&) VTK_DELETE_FUNCTION;
267};
268
269#endif
270
Abstract superclass for all arrays.
general representation of visualization data
Definition: vtkDataObject.h:65
represent and manipulate attribute data in a dataset
represent and manipulate fields of data
Definition: vtkFieldData.h:57
a simple class to control print indentation
Definition: vtkIndent.h:40
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
A table, which contains similar-typed columns of data.
Definition: vtkTable.h:69
unsigned long GetActualMemorySize() override
Return the actual size of the data in kibibytes (1024 bytes).
static vtkTable * New()
void Dump(unsigned int colWidth=16, int rowLimit=-1)
Dump table contents.
int GetDataObjectType() override
Return what type of dataset this is.
Definition: vtkTable.h:86
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
An array holding vtkVariants.
A atomic type representing the union of many types.
Definition: vtkVariant.h:76
@ info
Definition: vtkX3D.h:376
@ value
Definition: vtkX3D.h:220
@ type
Definition: vtkX3D.h:516
@ name
Definition: vtkX3D.h:219
@ data
Definition: vtkX3D.h:315
void DeepCopy(vtkPistonReference *self, vtkPistonReference *other)
int vtkIdType
Definition: vtkType.h:287
#define VTK_TABLE
Definition: vtkType.h:106