VTK
dox/Infovis/vtkDIMACSGraphReader.h
Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    $RCSfile: vtkDIMACSGraphReader.h,v $
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 (c) Sandia Corporation
00017  See Copyright.txt or http://www.paraview.org/HTML/Copyright.html for details.
00018 ----------------------------------------------------------------------------*/
00019 
00061 #ifndef _vtkDIMACSGraphReader_h
00062 #define _vtkDIMACSGraphReader_h
00063 
00064 #include "vtkGraphAlgorithm.h"
00065 #include "vtkStdString.h" // For string API
00066 
00067 class VTK_INFOVIS_EXPORT vtkDIMACSGraphReader : public vtkGraphAlgorithm
00068 {
00069 
00070 public:
00071 
00072   static vtkDIMACSGraphReader *New();
00073   vtkTypeMacro(vtkDIMACSGraphReader, vtkGraphAlgorithm);
00074   void PrintSelf(ostream& os, vtkIndent indent);
00075 
00077 
00078   vtkGetStringMacro(FileName);
00079   vtkSetStringMacro(FileName);
00081 
00083 
00084   vtkGetStringMacro(VertexAttributeArrayName);
00085   vtkSetStringMacro(VertexAttributeArrayName);
00087 
00089 
00090   vtkGetStringMacro(EdgeAttributeArrayName);
00091   vtkSetStringMacro(EdgeAttributeArrayName);
00093 
00094 protected:
00095 
00096   vtkDIMACSGraphReader();
00097   ~vtkDIMACSGraphReader();
00098 
00099   virtual int RequestData(vtkInformation *,
00100                           vtkInformationVector **,
00101                           vtkInformationVector *);
00102 
00103   int buildGenericGraph(vtkGraph     * output,
00104                         vtkStdString & defaultVertexAttrArrayName,
00105                         vtkStdString & defaultEdgeAttrArrayName);
00106 
00107   int buildColoringGraph(vtkGraph * output);
00108   int buildMaxflowGraph(vtkGraph * output);
00109 
00111 
00112   virtual int RequestDataObject(vtkInformation*,
00113                                 vtkInformationVector** inputVector,
00114                                 vtkInformationVector* outputVector);
00116 
00117   int ReadGraphMetaData();
00118 
00119 private:
00120 
00121   bool   fileOk;
00122   bool   Directed;
00123   char * FileName;
00124   char * VertexAttributeArrayName;
00125   char * EdgeAttributeArrayName;
00126 
00127   int numVerts;
00128   int numEdges;
00129   vtkStdString dimacsProblemStr;
00130 
00131   vtkDIMACSGraphReader(const vtkDIMACSGraphReader&);  // Not implemented.
00132   void operator=(const vtkDIMACSGraphReader&);  // Not implemented.
00133 };
00134 
00135 #endif // _vtkDIMACSGraphReader_h