VTK
|
00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: vtkTable.h 00005 00006 Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen 00007 All rights reserved. 00008 See Copyright.txt or http://www.kitware.com/Copyright.htm for details. 00009 00010 This software is distributed WITHOUT ANY WARRANTY; without even 00011 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 00012 PURPOSE. See the above copyright notice for more information. 00013 00014 =========================================================================*/ 00015 /*------------------------------------------------------------------------- 00016 Copyright 2008 Sandia Corporation. 00017 Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, 00018 the U.S. Government retains certain rights in this software. 00019 -------------------------------------------------------------------------*/ 00056 #ifndef __vtkTable_h 00057 #define __vtkTable_h 00058 00059 #include "vtkDataObject.h" 00060 00061 class vtkAbstractArray; 00062 class vtkDataSetAttributes; 00063 class vtkVariant; 00064 class vtkVariantArray; 00065 00066 class VTK_FILTERING_EXPORT vtkTable : public vtkDataObject 00067 { 00068 public: 00069 static vtkTable* New(); 00070 vtkTypeMacro(vtkTable, vtkDataObject); 00071 void PrintSelf(ostream &os, vtkIndent indent); 00072 00074 void Dump( unsigned int colWidth = 16 ); 00075 00077 int GetDataObjectType() {return VTK_TABLE;} 00078 00084 virtual unsigned long GetActualMemorySize(); 00085 00087 00088 vtkGetObjectMacro(RowData, vtkDataSetAttributes); 00089 virtual void SetRowData(vtkDataSetAttributes* data); 00091 00092 // 00093 // Row functions 00094 // 00095 00097 vtkIdType GetNumberOfRows(); 00098 00102 void SetNumberOfRows(const vtkIdType ); 00103 00106 vtkVariantArray* GetRow(vtkIdType row); 00107 00110 void GetRow(vtkIdType row, vtkVariantArray *values); 00111 00114 void SetRow(vtkIdType row, vtkVariantArray *values); 00115 00117 vtkIdType InsertNextBlankRow(double default_num_val=0.0); 00118 00121 vtkIdType InsertNextRow(vtkVariantArray* arr); 00122 00125 void RemoveRow(vtkIdType row); 00126 00127 // 00128 // Column functions 00129 // 00130 00132 vtkIdType GetNumberOfColumns(); 00133 00134 // Get the name of a column of the table. 00135 const char* GetColumnName(vtkIdType col); 00136 00138 vtkAbstractArray* GetColumnByName(const char* name); 00139 00141 vtkAbstractArray* GetColumn(vtkIdType col); 00142 00144 void AddColumn(vtkAbstractArray* arr); 00145 00147 void RemoveColumnByName(const char* name); 00148 00150 void RemoveColumn(vtkIdType col); 00151 00152 // 00153 // Table single entry functions 00154 // 00155 00160 vtkVariant GetValue(vtkIdType row, vtkIdType col); 00161 00164 vtkVariant GetValueByName(vtkIdType row, const char* col); 00165 00167 void SetValue(vtkIdType row, vtkIdType col, vtkVariant value); 00168 00170 void SetValueByName(vtkIdType row, const char* col, vtkVariant value); 00171 00173 virtual void Initialize(); 00174 00176 00177 static vtkTable* GetData(vtkInformation* info); 00178 static vtkTable* GetData(vtkInformationVector* v, int i=0); 00180 00182 00183 virtual void ShallowCopy(vtkDataObject* src); 00184 virtual void DeepCopy(vtkDataObject* src); 00186 00191 virtual vtkFieldData* GetAttributesAsFieldData(int type); 00192 00194 virtual vtkIdType GetNumberOfElements(int type); 00195 00196 protected: 00197 vtkTable(); 00198 ~vtkTable(); 00199 00201 vtkDataSetAttributes* RowData; 00202 00204 vtkVariantArray* RowArray; 00205 00206 private: 00207 vtkTable(const vtkTable&); // Not implemented 00208 void operator=(const vtkTable&); // Not implemented 00209 }; 00210 00211 #endif 00212