Talk:Titan Data Structures
vtkTable parent class
vtkDataObject contains the methods SetFieldData and GetFieldData, which could be used to set or get the columns of the table. The columns may currently contain primitive data types and recently vtkStringArray has been added to VTK.
We could also consider inheriting from vtkDataSet, which contains mechanisms for assigning coordinates to each row of the table. These could be initialized to zero and modified when the table is graphically presented. However, vtkDataSet also has the concept of cells, but tables do not have this concept since all rows are independent of each other.
vtkTable should probably extend vtkDataObject, and then be converted to a subclass of vtkDataSet using a filter which determines coordinates for each row.
--Jeff 10:03, 2 Jun 2006 (EDT)
vtkGraph structure
I see many similarities between the vtkPolyData structure and what is required for vtkGraph. The points function like vertices, and the cells function like edges. Though edges normally have exactly two associated vertices, the vtkCellArray in vtkPolyData is flexible enough to handle hyperedges, or arbitrary sets of vertices, using cell types with arbitrary numbers of vertices (such as polygons). This could be useful for describing partitions or clusters of the graph. vtkCellTypes allows random access to edge endpoints, and using vtkCellLinks we can lookup the edges (cells) adjacent to a certain vertex (point). But, it seems we would need one more array which contains the starting index in vtkCellLinks for each point, so that we can randomly access the neighbors of any vertex.
All this to say, we could make vtkGraph directly extend vtkPolyData with added functions like AddVertex (which would essentially add a point), AddEdge (adds a cell), GetAdjacentVertices, etc. and add functionality to make adjacent edge lookup fast. The other option is to start from scratch and inherit from vtkDataObject, and have filters which convert it to a vtkPolyData.
Jeff 11:04, 2 Jun 2006 (EDT)
- After talking with Berk, we found that the vtkCellLinks is in fact random access, so adjacent edge lookup would be fast with no additional changes. However, we also discussed that the first step should be to create an ideal graph API without thinking about how to fit it into VTK. After that, we should look at how to incorporate it into VTK.
- Jeff 13:08, 2 Jun 2006 (EDT)
Heterogeneous data
One issue with the current format is that it assumes homogeneous data is contained in each data structure. That is, a graph consists of a table of vertices and a table of edges, and similarly for the other structures. This is a simple, compact approach, which would likely work well in dealing with database queries. However, it cannot efficiently handle the case where there are multiple types of objects with different properties. For example, if we are reading an XML file into a hierarchy, we should not have to read all items into a single table, since this would require making columns for all possible attributes, wasting space. I was attempting to avoid requiring an "entity" class altogether, and just work with tables, but this may not be possible for the functionality we need.
Jeff 09:34, 8 Jun 2006 (EDT)
- Prior to the meeting today, I modified the dataset such that both heterogeneous and homogeneous data could be stored in a set. However, we at the meeting we discussed that we will make the assumption that the data can be always be stored in tabular format (See Titan Developer Meeting 06/08/2006).
- Jeff 18:45, 8 Jun 2006 (EDT)
Column-data format
As per Titan Developer Meeting 06/08/2006, I have modified the data structures so that they assume all datasets may be represented as columns of data. I also made vtkAbstractGraph, which both vtkGraph and vtkHierarchy inherit from.
Jeff 12:15, 9 Jun 2006 (EDT)
Table filters vs. table containment
Originally I had thought that vtkGraph and vtkHierarchy would contain vtkTable objects, but rethinking things it seems contrary to VTK for one data object to contain other data objects. So instead, I propose filters vtkTablesToGraphFilter and vtkTableToHierarchyFilter that would use fields in the tables to automatically generate links between objects.
Jeff 12:15, 9 Jun 2006 (EDT)