vtkTableToGraph Class Reference

#include <vtkTableToGraph.h>

Inheritance diagram for vtkTableToGraph:

Inheritance graph
[legend]
Collaboration diagram for vtkTableToGraph:

Collaboration graph
[legend]

List of all members.


Detailed Description

convert a vtkTable into a vtkGraph

vtkTableToGraph converts a table to a graph using an auxilliary 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 heterogenous 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.

Events:
vtkCommand::ProgressEvent
Examples:
vtkTableToGraph (Examples)
Tests:
vtkTableToGraph (Tests)

Definition at line 84 of file vtkTableToGraph.h.


Public Types

typedef vtkGraphAlgorithm Superclass

Public Member Functions

virtual const char * GetClassName ()
virtual int IsA (const char *type)
void PrintSelf (ostream &os, vtkIndent indent)
void AddLinkVertex (const char *column, const char *domain=0, int hidden=0)
void ClearLinkVertices ()
void AddLinkEdge (const char *column1, const char *column2)
void ClearLinkEdges ()
void LinkColumnPath (vtkStringArray *column, vtkStringArray *domain=0, vtkBitArray *hidden=0)
virtual unsigned long GetMTime ()
void SetVertexTableConnection (vtkAlgorithmOutput *in)
virtual vtkMutableDirectedGraphGetLinkGraph ()
void SetLinkGraph (vtkMutableDirectedGraph *g)
virtual void SetDirected (bool)
virtual bool GetDirected ()
virtual void DirectedOn ()
virtual void DirectedOff ()

Static Public Member Functions

static vtkTableToGraphNew ()
static int IsTypeOf (const char *type)
static vtkTableToGraphSafeDownCast (vtkObject *o)

Protected Member Functions

 vtkTableToGraph ()
 ~vtkTableToGraph ()
int ValidateLinkGraph ()
virtual int FillInputPortInformation (int port, vtkInformation *info)
virtual int RequestData (vtkInformation *, vtkInformationVector **, vtkInformationVector *)
virtual int RequestDataObject (vtkInformation *, vtkInformationVector **, vtkInformationVector *)

Protected Attributes

bool Directed
vtkMutableDirectedGraphLinkGraph
vtkStringArrayVertexTableDomains

Member Typedef Documentation

Reimplemented from vtkGraphAlgorithm.

Definition at line 88 of file vtkTableToGraph.h.


Constructor & Destructor Documentation

vtkTableToGraph::vtkTableToGraph (  )  [protected]

vtkTableToGraph::~vtkTableToGraph (  )  [protected]


Member Function Documentation

static vtkTableToGraph* vtkTableToGraph::New (  )  [static]

Create an object with Debug turned off, modified time initialized to zero, and reference counting on.

Reimplemented from vtkGraphAlgorithm.

virtual const char* vtkTableToGraph::GetClassName (  )  [virtual]

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 ( vtkObject o  )  [static]

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.

void vtkTableToGraph::SetVertexTableConnection ( vtkAlgorithmOutput in  ) 

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 **  inputVector,
vtkInformationVector outputVector 
) [protected, virtual]

By default, creates the same output type as the input type.

Reimplemented from vtkGraphAlgorithm.


Member Data Documentation

bool vtkTableToGraph::Directed [protected]

Definition at line 150 of file vtkTableToGraph.h.

Definition at line 151 of file vtkTableToGraph.h.

Definition at line 152 of file vtkTableToGraph.h.


The documentation for this class was generated from the following file:

Generated on Mon Sep 27 18:53:51 2010 for VTK by  doxygen 1.5.6