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 "vtkDataObject.h"
60 
61 class vtkAbstractArray;
63 class vtkVariant;
64 class vtkVariantArray;
65 
67 {
68 public:
69  static vtkTable* New();
70  vtkTypeMacro(vtkTable, vtkDataObject);
71  void PrintSelf(ostream &os, vtkIndent indent);
72 
77  void Dump( unsigned int colWidth = 16, int rowLimit = -1 );
78 
80  int GetDataObjectType() {return VTK_TABLE;}
81 
87  virtual unsigned long GetActualMemorySize();
88 
90 
91  vtkGetObjectMacro(RowData, vtkDataSetAttributes);
92  virtual void SetRowData(vtkDataSetAttributes* data);
94 
95  //
96  // Row functions
97  //
98 
100  vtkIdType GetNumberOfRows();
101 
105  void SetNumberOfRows(const vtkIdType );
106 
109  vtkVariantArray* GetRow(vtkIdType row);
110 
113  void GetRow(vtkIdType row, vtkVariantArray *values);
114 
117  void SetRow(vtkIdType row, vtkVariantArray *values);
118 
120  vtkIdType InsertNextBlankRow(double default_num_val=0.0);
121 
124  vtkIdType InsertNextRow(vtkVariantArray* arr);
125 
128  void RemoveRow(vtkIdType row);
129 
130  //
131  // Column functions
132  //
133 
135  vtkIdType GetNumberOfColumns();
136 
137  // Get the name of a column of the table.
138  const char* GetColumnName(vtkIdType col);
139 
141  vtkAbstractArray* GetColumnByName(const char* name);
142 
144  vtkAbstractArray* GetColumn(vtkIdType col);
145 
147  void AddColumn(vtkAbstractArray* arr);
148 
150  void RemoveColumnByName(const char* name);
151 
153  void RemoveColumn(vtkIdType col);
154 
155  //
156  // Table single entry functions
157  //
158 
163  vtkVariant GetValue(vtkIdType row, vtkIdType col);
164 
167  vtkVariant GetValueByName(vtkIdType row, const char* col);
168 
170  void SetValue(vtkIdType row, vtkIdType col, vtkVariant value);
171 
173  void SetValueByName(vtkIdType row, const char* col, vtkVariant value);
174 
176  virtual void Initialize();
177 
179 
181  static vtkTable* GetData(vtkInformationVector* v, int i=0);
183 
185 
186  virtual void ShallowCopy(vtkDataObject* src);
187  virtual void DeepCopy(vtkDataObject* src);
189 
195 
197  virtual vtkIdType GetNumberOfElements(int type);
198 
199 protected:
200  vtkTable();
201  ~vtkTable();
202 
205 
208 
209 private:
210  vtkTable(const vtkTable&); // Not implemented
211  void operator=(const vtkTable&); // Not implemented
212 };
213 
214 #endif
215