VTK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
vtkTableToGraph Class Reference

convert a vtkTable into a vtkGraph More...

#include <vtkTableToGraph.h>

Inherits vtkGraphAlgorithm.

Public Types

typedef vtkGraphAlgorithm Superclass
 

Public Member Functions

virtual int IsA (const char *type)
 
vtkTableToGraphNewInstance () const
 
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 vtkMutableDirectedGraph * GetLinkGraph ()
 
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 (vtkObjectBase *o)
 

Protected Member Functions

virtual vtkObjectBase * NewInstanceInternal () const
 
 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
 
vtkMutableDirectedGraph * LinkGraph
 
vtkStringArray * VertexTableDomains
 

Detailed Description

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.

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

Definition at line 85 of file vtkTableToGraph.h.

Member Typedef Documentation

typedef vtkGraphAlgorithm vtkTableToGraph::Superclass

Definition at line 89 of file vtkTableToGraph.h.

Constructor & Destructor Documentation

vtkTableToGraph::vtkTableToGraph ( )
protected
vtkTableToGraph::~vtkTableToGraph ( )
protected

Member Function Documentation

static vtkTableToGraph* vtkTableToGraph::New ( )
static
static int vtkTableToGraph::IsTypeOf ( const char *  type)
static
virtual int vtkTableToGraph::IsA ( const char *  type)
virtual
static vtkTableToGraph* vtkTableToGraph::SafeDownCast ( vtkObjectBase *  o)
static
virtual vtkObjectBase* vtkTableToGraph::NewInstanceInternal ( ) const
protectedvirtual
vtkTableToGraph* vtkTableToGraph::NewInstance ( ) const
void vtkTableToGraph::PrintSelf ( ostream &  os,
vtkIndent  indent 
)
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.

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 
)
protectedvirtual
virtual int vtkTableToGraph::RequestData ( vtkInformation *  ,
vtkInformationVector **  ,
vtkInformationVector *   
)
protectedvirtual
virtual int vtkTableToGraph::RequestDataObject ( vtkInformation *  ,
vtkInformationVector **  ,
vtkInformationVector *   
)
protectedvirtual

Member Data Documentation

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.


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