VTK
|
00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: $RCSfile: vtkTable.h,v $ 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 -------------------------------------------------------------------------*/ 00053 #ifndef __vtkTable_h 00054 #define __vtkTable_h 00055 00056 #include "vtkDataObject.h" 00057 00058 class vtkAbstractArray; 00059 class vtkDataSetAttributes; 00060 class vtkVariant; 00061 class vtkVariantArray; 00062 00063 class VTK_FILTERING_EXPORT vtkTable : public vtkDataObject 00064 { 00065 public: 00066 static vtkTable* New(); 00067 vtkTypeRevisionMacro(vtkTable, vtkDataObject); 00068 void PrintSelf(ostream &os, vtkIndent indent); 00069 00071 void Dump( unsigned int colWidth = 16 ); 00072 00074 int GetDataObjectType() {return VTK_TABLE;} 00075 00081 virtual unsigned long GetActualMemorySize(); 00082 00084 00085 vtkGetObjectMacro(RowData, vtkDataSetAttributes); 00086 virtual void SetRowData(vtkDataSetAttributes* data); 00088 00089 // 00090 // Row functions 00091 // 00092 00094 vtkIdType GetNumberOfRows(); 00095 00098 vtkVariantArray* GetRow(vtkIdType row); 00099 00102 void GetRow(vtkIdType row, vtkVariantArray *values); 00103 00106 void SetRow(vtkIdType row, vtkVariantArray *values); 00107 00109 vtkIdType InsertNextBlankRow(); 00110 00113 vtkIdType InsertNextRow(vtkVariantArray* arr); 00114 00117 void RemoveRow(vtkIdType row); 00118 00119 // 00120 // Column functions 00121 // 00122 00124 vtkIdType GetNumberOfColumns(); 00125 00127 const char* GetColumnName(vtkIdType col); 00128 00130 vtkAbstractArray* GetColumnByName(const char* name); 00131 00133 vtkAbstractArray* GetColumn(vtkIdType col); 00134 00136 void AddColumn(vtkAbstractArray* arr); 00137 00139 void RemoveColumnByName(const char* name); 00140 00142 void RemoveColumn(vtkIdType col); 00143 00144 // 00145 // Table single entry functions 00146 // 00147 00148 //BTX 00153 vtkVariant GetValue(vtkIdType row, vtkIdType col); 00154 00157 vtkVariant GetValueByName(vtkIdType row, const char* col); 00158 00160 void SetValue(vtkIdType row, vtkIdType col, vtkVariant value); 00161 00163 00164 void SetValueByName(vtkIdType row, const char* col, vtkVariant value); 00165 //ETX 00167 00169 virtual void Initialize(); 00170 00172 00173 static vtkTable* GetData(vtkInformation* info); 00174 static vtkTable* GetData(vtkInformationVector* v, int i=0); 00176 00178 00179 virtual void ShallowCopy(vtkDataObject* src); 00180 virtual void DeepCopy(vtkDataObject* src); 00182 00183 protected: 00184 vtkTable(); 00185 ~vtkTable(); 00186 00188 vtkDataSetAttributes* RowData; 00189 00191 vtkVariantArray* RowArray; 00192 00193 private: 00194 vtkTable(const vtkTable&); // Not implemented 00195 void operator=(const vtkTable&); // Not implemented 00196 }; 00197 00198 #endif 00199