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 -------------------------------------------------------------------------*/
56 #ifndef vtkTable_h
57 #define vtkTable_h
58 
59 #include "vtkCommonDataModelModule.h" // For export macro
60 #include "vtkDataObject.h"
61 
62 class vtkAbstractArray;
64 class vtkVariant;
65 class vtkVariantArray;
66 
68 {
69 public:
70  static vtkTable* New();
71  vtkTypeMacro(vtkTable, vtkDataObject);
72  void PrintSelf(ostream &os, vtkIndent indent);
73 
78  void Dump( unsigned int colWidth = 16, int rowLimit = -1 );
79 
81  int GetDataObjectType() {return VTK_TABLE;}
82 
88  virtual unsigned long GetActualMemorySize();
89 
91 
92  vtkGetObjectMacro(RowData, vtkDataSetAttributes);
93  virtual void SetRowData(vtkDataSetAttributes* data);
95 
96  //
97  // Row functions
98  //
99 
101  vtkIdType GetNumberOfRows();
102 
106  void SetNumberOfRows(const vtkIdType );
107 
110  vtkVariantArray* GetRow(vtkIdType row);
111 
114  void GetRow(vtkIdType row, vtkVariantArray *values);
115 
118  void SetRow(vtkIdType row, vtkVariantArray *values);
119 
121  vtkIdType InsertNextBlankRow(double default_num_val=0.0);
122 
125  vtkIdType InsertNextRow(vtkVariantArray* arr);
126 
129  void RemoveRow(vtkIdType row);
130 
131  //
132  // Column functions
133  //
134 
136  vtkIdType GetNumberOfColumns();
137 
138  // Get the name of a column of the table.
139  const char* GetColumnName(vtkIdType col);
140 
142  vtkAbstractArray* GetColumnByName(const char* name);
143 
145  vtkAbstractArray* GetColumn(vtkIdType col);
146 
148  void AddColumn(vtkAbstractArray* arr);
149 
151  void RemoveColumnByName(const char* name);
152 
154  void RemoveColumn(vtkIdType col);
155 
156  //
157  // Table single entry functions
158  //
159 
164  vtkVariant GetValue(vtkIdType row, vtkIdType col);
165 
168  vtkVariant GetValueByName(vtkIdType row, const char* col);
169 
171  void SetValue(vtkIdType row, vtkIdType col, vtkVariant value);
172 
174  void SetValueByName(vtkIdType row, const char* col, vtkVariant value);
175 
177  virtual void Initialize();
178 
180 
182  static vtkTable* GetData(vtkInformationVector* v, int i=0);
184 
186 
187  virtual void ShallowCopy(vtkDataObject* src);
188  virtual void DeepCopy(vtkDataObject* src);
190 
196 
198  virtual vtkIdType GetNumberOfElements(int type);
199 
200 protected:
201  vtkTable();
202  ~vtkTable();
203 
206 
209 
210 private:
211  vtkTable(const vtkTable&); // Not implemented
212  void operator=(const vtkTable&); // Not implemented
213 };
214 
215 #endif
216 
static vtkDataObject * GetData(vtkInformation *info)
virtual vtkFieldData * GetAttributesAsFieldData(int type)
static vtkDataObject * New()
An array holding vtkVariants.
Store vtkAlgorithm input/output information.
Abstract superclass for all arrays.
#define VTK_TABLE
Definition: vtkType.h:85
virtual void Initialize()
int vtkIdType
Definition: vtkType.h:275
A atomic type representing the union of many types.
Definition: vtkVariant.h:78
vtkVariantArray * RowArray
Definition: vtkTable.h:208
a simple class to control print indentation
Definition: vtkIndent.h:38
represent and manipulate attribute data in a dataset
void PrintSelf(ostream &os, vtkIndent indent)
virtual unsigned long GetActualMemorySize()
virtual vtkIdType GetNumberOfElements(int type)
A table, which contains similar-typed columns of data.
Definition: vtkTable.h:67
int GetDataObjectType()
Definition: vtkTable.h:81
Store zero or more vtkInformation instances.
general representation of visualization data
Definition: vtkDataObject.h:64
vtkDataSetAttributes * RowData
Definition: vtkTable.h:205
virtual void DeepCopy(vtkDataObject *src)
#define VTKCOMMONDATAMODEL_EXPORT
virtual void ShallowCopy(vtkDataObject *src)
represent and manipulate fields of data
Definition: vtkFieldData.h:55