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 00040 #ifndef _vtkDIMACSGraphReader_h 00041 #define _vtkDIMACSGraphReader_h 00042 00043 #include "vtkGraphAlgorithm.h" 00044 #include "vtkStdString.h" // For string API 00045 00046 class VTK_INFOVIS_EXPORT vtkDIMACSGraphReader : public vtkGraphAlgorithm 00047 { 00048 00049 public: 00050 00051 static vtkDIMACSGraphReader *New(); 00052 vtkTypeMacro(vtkDIMACSGraphReader, vtkGraphAlgorithm); 00053 void PrintSelf(ostream& os, vtkIndent indent); 00054 00056 00057 vtkGetStringMacro(FileName); 00058 vtkSetStringMacro(FileName); 00060 00062 00063 vtkGetStringMacro(VertexAttributeArrayName); 00064 vtkSetStringMacro(VertexAttributeArrayName); 00066 00068 00069 vtkGetStringMacro(EdgeAttributeArrayName); 00070 vtkSetStringMacro(EdgeAttributeArrayName); 00072 00073 protected: 00074 00075 vtkDIMACSGraphReader(); 00076 ~vtkDIMACSGraphReader(); 00077 00078 virtual int RequestData(vtkInformation *, 00079 vtkInformationVector **, 00080 vtkInformationVector *); 00081 00082 int buildGenericGraph(vtkGraph * output, 00083 vtkStdString & defaultVertexAttrArrayName, 00084 vtkStdString & defaultEdgeAttrArrayName); 00085 00086 int buildColoringGraph(vtkGraph * output); 00087 int buildMaxflowGraph(vtkGraph * output); 00088 00090 00091 virtual int RequestDataObject(vtkInformation*, 00092 vtkInformationVector** inputVector, 00093 vtkInformationVector* outputVector); 00095 00096 int ReadGraphMetaData(); 00097 00098 private: 00099 00100 bool fileOk; 00101 bool Directed; 00102 char * FileName; 00103 char * VertexAttributeArrayName; 00104 char * EdgeAttributeArrayName; 00105 00106 int numVerts; 00107 int numEdges; 00108 vtkStdString dimacsProblemStr; 00109 00110 vtkDIMACSGraphReader(const vtkDIMACSGraphReader&); // Not implemented. 00111 void operator=(const vtkDIMACSGraphReader&); // Not implemented. 00112 }; 00113 00114 #endif // _vtkDIMACSGraphReader_h