VTK
|
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 "vtkIOInfovisModule.h" // For export macro 00065 #include "vtkGraphAlgorithm.h" 00066 #include "vtkStdString.h" // For string API 00067 00068 class VTKIOINFOVIS_EXPORT vtkDIMACSGraphReader : public vtkGraphAlgorithm 00069 { 00070 00071 public: 00072 00073 static vtkDIMACSGraphReader *New(); 00074 vtkTypeMacro(vtkDIMACSGraphReader, vtkGraphAlgorithm); 00075 void PrintSelf(ostream& os, vtkIndent indent); 00076 00078 00079 vtkGetStringMacro(FileName); 00080 vtkSetStringMacro(FileName); 00082 00084 00085 vtkGetStringMacro(VertexAttributeArrayName); 00086 vtkSetStringMacro(VertexAttributeArrayName); 00088 00090 00091 vtkGetStringMacro(EdgeAttributeArrayName); 00092 vtkSetStringMacro(EdgeAttributeArrayName); 00094 00095 protected: 00096 00097 vtkDIMACSGraphReader(); 00098 ~vtkDIMACSGraphReader(); 00099 00100 virtual int RequestData(vtkInformation *, 00101 vtkInformationVector **, 00102 vtkInformationVector *); 00103 00104 int buildGenericGraph(vtkGraph * output, 00105 vtkStdString & defaultVertexAttrArrayName, 00106 vtkStdString & defaultEdgeAttrArrayName); 00107 00108 int buildColoringGraph(vtkGraph * output); 00109 int buildMaxflowGraph(vtkGraph * output); 00110 00112 00113 virtual int RequestDataObject(vtkInformation*, 00114 vtkInformationVector** inputVector, 00115 vtkInformationVector* outputVector); 00117 00118 int ReadGraphMetaData(); 00119 00120 private: 00121 00122 bool fileOk; 00123 bool Directed; 00124 char * FileName; 00125 char * VertexAttributeArrayName; 00126 char * EdgeAttributeArrayName; 00127 00128 int numVerts; 00129 int numEdges; 00130 vtkStdString dimacsProblemStr; 00131 00132 vtkDIMACSGraphReader(const vtkDIMACSGraphReader&); // Not implemented. 00133 void operator=(const vtkDIMACSGraphReader&); // Not implemented. 00134 }; 00135 00136 #endif // _vtkDIMACSGraphReader_h