VTK
dox/Infovis/vtkTableToGraph.h
Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    vtkTableToGraph.h
00005 
00006   Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
00007   All rights reserved.
00008   See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
00009 
00010      This software is distributed WITHOUT ANY WARRANTY; without even
00011      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
00012      PURPOSE.  See the above copyright notice for more information.
00013 
00014 =========================================================================*/
00015 /*-------------------------------------------------------------------------
00016   Copyright 2008 Sandia Corporation.
00017   Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
00018   the U.S. Government retains certain rights in this software.
00019 -------------------------------------------------------------------------*/
00074 #ifndef __vtkTableToGraph_h
00075 #define __vtkTableToGraph_h
00076 
00077 #include "vtkGraphAlgorithm.h"
00078 
00079 class vtkBitArray;
00080 class vtkMutableDirectedGraph;
00081 class vtkStringArray;
00082 class vtkTable;
00083 
00084 class VTK_INFOVIS_EXPORT vtkTableToGraph : public vtkGraphAlgorithm
00085 {
00086 public:
00087   static vtkTableToGraph* New();
00088   vtkTypeMacro(vtkTableToGraph,vtkGraphAlgorithm);
00089   void PrintSelf(ostream& os, vtkIndent indent);
00090   
00093   void AddLinkVertex(const char* column, const char* domain = 0, int hidden = 0);
00094 
00096   void ClearLinkVertices();
00097 
00100   void AddLinkEdge(const char* column1, const char* column2);
00101 
00103   void ClearLinkEdges();
00104 
00106 
00107   vtkGetObjectMacro(LinkGraph, vtkMutableDirectedGraph);
00108   void SetLinkGraph(vtkMutableDirectedGraph* g);
00110   
00113   void LinkColumnPath(vtkStringArray* column, vtkStringArray* domain = 0, vtkBitArray* hidden = 0);
00114 
00116 
00117   vtkSetMacro(Directed, bool);
00118   vtkGetMacro(Directed, bool);
00119   vtkBooleanMacro(Directed, bool);
00121   
00123   virtual unsigned long GetMTime();
00124 
00129   void SetVertexTableConnection(vtkAlgorithmOutput* in);
00130   
00131 protected:
00132   vtkTableToGraph();
00133   ~vtkTableToGraph();
00134 
00136   int ValidateLinkGraph();
00137   
00138   virtual int FillInputPortInformation(int port, vtkInformation* info);
00139 
00140   virtual int RequestData(
00141     vtkInformation*, 
00142     vtkInformationVector**, 
00143     vtkInformationVector*);
00144 
00145   virtual int RequestDataObject(
00146     vtkInformation*, 
00147     vtkInformationVector**, 
00148     vtkInformationVector*);
00149 
00150   bool Directed;
00151   vtkMutableDirectedGraph* LinkGraph;
00152   vtkStringArray* VertexTableDomains;
00153 
00154 private:
00155   vtkTableToGraph(const vtkTableToGraph&); // Not implemented
00156   void operator=(const vtkTableToGraph&);   // Not implemented
00157 };
00158 
00159 #endif
00160