FreeMat: vtkTable

FreeMat

- Main Page
- Related Pages

vtkTable

Section: Visualization Toolkit Filtering Classes

# Usage

vtkTable is a basic data structure for storing columns of data. Internally, columns are stored in a vtkDataSetAttributes structure called RowData. However, using the vtkTable API additionally ensures that every column has the same number of entries, and provides row access (using vtkVariantArray) and single entry access (using vtkVariant).

The field data inherited from vtkDataObject may be used to store metadata related to the table.

To create an instance of class vtkTable, simply invoke its constructor as follows

      obj = vtkTable

# Methods

The class vtkTable has several methods that can be used. They are listed below. Note that the documentation is translated automatically from the VTK sources, and may not be completely intelligible. When in doubt, consult the VTK website. In the methods listed below, `obj` is an instance of the vtkTable class.

- `string = obj.GetClassName ()`
- `int = obj.IsA (string name)`
- `vtkTable = obj.NewInstance ()`
- `vtkTable = obj.SafeDownCast (vtkObject o)`
- `obj.Dump (int colWidth)` - Dump table contents.
- `int = obj.GetDataObjectType ()` - Return the actual size of the data in kilobytes. This number is valid only after the pipeline has updated. The memory size returned is guaranteed to be greater than or equal to the memory required to represent the data (e.g., extra space in arrays, etc. are not included in the return value).
- `long = obj.GetActualMemorySize ()` - Return the actual size of the data in kilobytes. This number is valid only after the pipeline has updated. The memory size returned is guaranteed to be greater than or equal to the memory required to represent the data (e.g., extra space in arrays, etc. are not included in the return value).
- `vtkDataSetAttributes = obj.GetRowData ()` - Get/Set the main data (columns) of the table.
- `obj.SetRowData (vtkDataSetAttributes data)` - Get/Set the main data (columns) of the table.
- `vtkIdType = obj.GetNumberOfRows ()` - Get the number of rows in the table.
- `obj.SetNumberOfRows (vtkIdType )` - Set the number of rows in the table. Note that memory allocation might be performed as a result of this, but no memory will be released.
- `vtkVariantArray = obj.GetRow (vtkIdType row)` - Get a row of the table as a vtkVariantArray which has one entry for each column. NOTE: This version of the method is NOT thread safe.
- `obj.GetRow (vtkIdType row, vtkVariantArray values)` - Get a row of the table as a vtkVariantArray which has one entry for each column.
- `obj.SetRow (vtkIdType row, vtkVariantArray values)` - Set a row of the table with a vtkVariantArray which has one entry for each column.
- `vtkIdType = obj.InsertNextBlankRow (double default_num_val)` - Insert a blank row at the end of the table.
- `vtkIdType = obj.InsertNextRow (vtkVariantArray arr)` - Insert a row specified by a vtkVariantArray. The number of entries in the array should match the number of columns in the table.
- `obj.RemoveRow (vtkIdType row)` - Delete a row from the table. Rows below the deleted row are shifted up.
- `vtkIdType = obj.GetNumberOfColumns ()` - Get the number of columns in the table.
- `string = obj.GetColumnName (vtkIdType col)`
- `vtkAbstractArray = obj.GetColumnByName (string name)` - Get a column of the table by its name.
- `vtkAbstractArray = obj.GetColumn (vtkIdType col)` - Get a column of the table by its column index.
- `obj.AddColumn (vtkAbstractArray arr)` - Add a column to the table.
- `obj.RemoveColumnByName (string name)` - Remove a column from the table by its name.
- `obj.RemoveColumn (vtkIdType col)` - Remove a column from the table by its column index.
- `obj.Initialize ()` - Initialize to an empty table.
- `obj.ShallowCopy (vtkDataObject src)` - Shallow/deep copy the data from src into this object.
- `obj.DeepCopy (vtkDataObject src)` - Shallow/deep copy the data from src into this object.
- `vtkFieldData = obj.GetAttributesAsFieldData (int type)` - Returns the attributes of the data object as a vtkFieldData. This returns non-null values in all the same cases as GetAttributes, in addition to the case of FIELD, which will return the field data for any vtkDataObject subclass.
- `vtkIdType = obj.GetNumberOfElements (int type)` - Get the number of elements for a specific attribute type (ROW, etc.).