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 -------------------------------------------------------------------------*/
51 #ifndef vtkTable_h
52 #define vtkTable_h
53 
54 #include "vtkCommonDataModelModule.h" // For export macro
55 #include "vtkDataObject.h"
56 
57 class vtkAbstractArray;
59 class vtkVariant;
60 class vtkVariantArray;
61 
62 class VTKCOMMONDATAMODEL_EXPORT vtkTable : public vtkDataObject
63 {
64 public:
65  static vtkTable* New();
66  vtkTypeMacro(vtkTable, vtkDataObject);
67  void PrintSelf(ostream &os, vtkIndent indent) VTK_OVERRIDE;
68 
75  void Dump( unsigned int colWidth = 16, int rowLimit = -1 );
76 
80  int GetDataObjectType() VTK_OVERRIDE {return VTK_TABLE;}
81 
89  unsigned long GetActualMemorySize() VTK_OVERRIDE;
90 
92 
95  vtkGetObjectMacro(RowData, vtkDataSetAttributes);
96  virtual void SetRowData(vtkDataSetAttributes* data);
98 
99  //
100  // Row functions
101  //
102 
106  vtkIdType GetNumberOfRows();
107 
112  void SetNumberOfRows(const vtkIdType );
113 
118  vtkVariantArray* GetRow(vtkIdType row);
119 
123  void GetRow(vtkIdType row, vtkVariantArray *values);
124 
128  void SetRow(vtkIdType row, vtkVariantArray *values);
129 
133  vtkIdType InsertNextBlankRow(double default_num_val=0.0);
134 
139  vtkIdType InsertNextRow(vtkVariantArray* arr);
140 
144  void RemoveRow(vtkIdType row);
145 
146  //
147  // Column functions
148  //
149 
153  vtkIdType GetNumberOfColumns();
154 
155  // Get the name of a column of the table.
156  const char* GetColumnName(vtkIdType col);
157 
161  vtkAbstractArray* GetColumnByName(const char* name);
162 
166  vtkAbstractArray* GetColumn(vtkIdType col);
167 
171  void AddColumn(vtkAbstractArray* arr);
172 
176  void RemoveColumnByName(const char* name);
177 
181  void RemoveColumn(vtkIdType col);
182 
183  //
184  // Table single entry functions
185  //
186 
193  vtkVariant GetValue(vtkIdType row, vtkIdType col);
194 
198  vtkVariant GetValueByName(vtkIdType row, const char* col);
199 
203  void SetValue(vtkIdType row, vtkIdType col, vtkVariant value);
204 
208  void SetValueByName(vtkIdType row, const char* col, vtkVariant value);
209 
213  void Initialize() VTK_OVERRIDE;
214 
216 
219  static vtkTable* GetData(vtkInformation* info);
220  static vtkTable* GetData(vtkInformationVector* v, int i=0);
222 
224 
227  void ShallowCopy(vtkDataObject* src) VTK_OVERRIDE;
228  void DeepCopy(vtkDataObject* src) VTK_OVERRIDE;
230 
237  vtkFieldData* GetAttributesAsFieldData(int type) VTK_OVERRIDE;
238 
242  vtkIdType GetNumberOfElements(int type) VTK_OVERRIDE;
243 
244 protected:
245  vtkTable();
246  ~vtkTable() VTK_OVERRIDE;
247 
251  vtkDataSetAttributes* RowData;
252 
256  vtkVariantArray* RowArray;
257 
258 private:
259  vtkTable(const vtkTable&) VTK_DELETE_FUNCTION;
260  void operator=(const vtkTable&) VTK_DELETE_FUNCTION;
261 };
262 
263 #endif
264 
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
static vtkDataObject * New()
An array holding vtkVariants.
Store vtkAlgorithm input/output information.
Abstract superclass for all arrays.
#define VTK_TABLE
Definition: vtkType.h:110
int vtkIdType
Definition: vtkType.h:345
A atomic type representing the union of many types.
Definition: vtkVariant.h:69
int GetDataObjectType() override
Return what type of dataset this is.
Definition: vtkTable.h:80
a simple class to control print indentation
Definition: vtkIndent.h:33
represent and manipulate attribute data in a dataset
virtual unsigned long GetActualMemorySize()
Return the actual size of the data in kibibytes (1024 bytes).
A table, which contains similar-typed columns of data.
Definition: vtkTable.h:62
Store zero or more vtkInformation instances.
general representation of visualization data
Definition: vtkDataObject.h:58
represent and manipulate fields of data
Definition: vtkFieldData.h:53