VTK
|
convert a vtkTable into a vtkGraph More...
#include <vtkTableToGraph.h>
convert a vtkTable into a vtkGraph
vtkTableToGraph converts a table to a graph using an auxiliary link graph. The link graph specifies how each row in the table should be converted to an edge, or a collection of edges. It also specifies which columns of the table should be considered part of the same domain, and which columns should be hidden.
A second, optional, table may be provided as the vertex table. This vertex table must have one or more domain columns whose values match values in the edge table. The linked column name is specified in the domain array in the link graph. The output graph will only contain vertices corresponding to a row in the vertex table. For heterogeneous graphs, you may want to use vtkMergeTables to create a single vertex table.
The link graph contains the following arrays:
(1) The "column" array has the names of the columns to connect in each table row. This array is required.
(2) The optional "domain" array provides user-defined domain names for each column. Matching domains in multiple columns will merge vertices with the same value from those columns. By default, all columns are in the same domain. If a vertex table is supplied, the domain indicates the column in the vertex table that the edge table column associates with. If the user provides a vertex table but no domain names, the output will be an empty graph. Hidden columns do not need valid domain names.
(3) The optional "hidden" array is a bit array specifying whether the column should be hidden. The resulting graph will contain edges representing connections "through" the hidden column, but the vertices for that column will not be present. By default, no columns are hidden. Hiding a column in a particular domain hides all columns in that domain.
The output graph will contain three additional arrays in the vertex data. The "domain" column is a string array containing the domain of each vertex. The "label" column is a string version of the distinct value that, along with the domain, defines that vertex. The "ids" column also contains the distinguishing value, but as a vtkVariant holding the raw value instead of being converted to a string. The "ids" column is set as the vertex pedigree ID attribute.
Definition at line 85 of file vtkTableToGraph.h.
Reimplemented from vtkGraphAlgorithm.
Definition at line 89 of file vtkTableToGraph.h.
vtkTableToGraph::vtkTableToGraph | ( | ) | [protected] |
vtkTableToGraph::~vtkTableToGraph | ( | ) | [protected] |
static vtkTableToGraph* vtkTableToGraph::New | ( | ) | [static] |
Create an object with Debug turned off, modified time initialized to zero, and reference counting on.
Reimplemented from vtkGraphAlgorithm.
static int vtkTableToGraph::IsTypeOf | ( | const char * | name | ) | [static] |
Return 1 if this class type is the same type of (or a subclass of) the named class. Returns 0 otherwise. This method works in combination with vtkTypeMacro found in vtkSetGet.h.
Reimplemented from vtkGraphAlgorithm.
virtual int vtkTableToGraph::IsA | ( | const char * | name | ) | [virtual] |
Return 1 if this class is the same type of (or a subclass of) the named class. Returns 0 otherwise. This method works in combination with vtkTypeMacro found in vtkSetGet.h.
Reimplemented from vtkGraphAlgorithm.
static vtkTableToGraph* vtkTableToGraph::SafeDownCast | ( | vtkObjectBase * | o | ) | [static] |
Reimplemented from vtkGraphAlgorithm.
virtual vtkObjectBase* vtkTableToGraph::NewInstanceInternal | ( | ) | const [protected, virtual] |
Reimplemented from vtkGraphAlgorithm.
vtkTableToGraph* vtkTableToGraph::NewInstance | ( | ) | const |
Reimplemented from vtkGraphAlgorithm.
void vtkTableToGraph::PrintSelf | ( | ostream & | os, |
vtkIndent | indent | ||
) | [virtual] |
Methods invoked by print to print information about the object including superclasses. Typically not called by the user (use Print() instead) but used in the hierarchical print process to combine the output of several classes.
Reimplemented from vtkGraphAlgorithm.
void vtkTableToGraph::AddLinkVertex | ( | const char * | column, |
const char * | domain = 0 , |
||
int | hidden = 0 |
||
) |
Add a vertex to the link graph. Specify the column name, the domain name for the column, and whether the column is hidden.
void vtkTableToGraph::ClearLinkVertices | ( | ) |
Clear the link graph vertices. This also clears all edges.
void vtkTableToGraph::AddLinkEdge | ( | const char * | column1, |
const char * | column2 | ||
) |
Add an edge to the link graph. Specify the names of the columns to link.
void vtkTableToGraph::ClearLinkEdges | ( | ) |
Clear the link graph edges. The graph vertices will remain.
virtual vtkMutableDirectedGraph* vtkTableToGraph::GetLinkGraph | ( | ) | [virtual] |
The graph describing how to link the columns in the table.
void vtkTableToGraph::SetLinkGraph | ( | vtkMutableDirectedGraph * | g | ) |
The graph describing how to link the columns in the table.
void vtkTableToGraph::LinkColumnPath | ( | vtkStringArray * | column, |
vtkStringArray * | domain = 0 , |
||
vtkBitArray * | hidden = 0 |
||
) |
Links the columns in a specific order. This creates a simple path as the link graph.
virtual void vtkTableToGraph::SetDirected | ( | bool | ) | [virtual] |
Specify the directedness of the output graph.
virtual bool vtkTableToGraph::GetDirected | ( | ) | [virtual] |
Specify the directedness of the output graph.
virtual void vtkTableToGraph::DirectedOn | ( | ) | [virtual] |
Specify the directedness of the output graph.
virtual void vtkTableToGraph::DirectedOff | ( | ) | [virtual] |
Specify the directedness of the output graph.
virtual unsigned long vtkTableToGraph::GetMTime | ( | ) | [virtual] |
Get the current modified time.
Reimplemented from vtkObject.
A convenience method for setting the vertex table input. This is mainly for the benefit of the VTK client/server layer, vanilla VTK code should use e.g: table_to_graph->SetInputConnection(1, vertex_table->output());
int vtkTableToGraph::ValidateLinkGraph | ( | ) | [protected] |
Validate that the link graph is in the appropriate format.
virtual int vtkTableToGraph::FillInputPortInformation | ( | int | port, |
vtkInformation * | info | ||
) | [protected, virtual] |
Fill the input port information objects for this algorithm. This is invoked by the first call to GetInputPortInformation for each port so subclasses can specify what they can handle.
Reimplemented from vtkGraphAlgorithm.
virtual int vtkTableToGraph::RequestData | ( | vtkInformation * | request, |
vtkInformationVector ** | inputVector, | ||
vtkInformationVector * | outputVector | ||
) | [protected, virtual] |
This is called by the superclass. This is the method you should override.
Reimplemented from vtkGraphAlgorithm.
virtual int vtkTableToGraph::RequestDataObject | ( | vtkInformation * | , |
vtkInformationVector ** | , | ||
vtkInformationVector * | |||
) | [protected, virtual] |
Reimplemented from vtkGraphAlgorithm.
bool vtkTableToGraph::Directed [protected] |
Definition at line 151 of file vtkTableToGraph.h.
vtkMutableDirectedGraph* vtkTableToGraph::LinkGraph [protected] |
Definition at line 152 of file vtkTableToGraph.h.
vtkStringArray* vtkTableToGraph::VertexTableDomains [protected] |
Definition at line 153 of file vtkTableToGraph.h.