VTK
vtkDIMACSGraphReader.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: $RCSfile: vtkDIMACSGraphReader.h,v $
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
15 /*----------------------------------------------------------------------------
16  Copyright (c) Sandia Corporation
17  See Copyright.txt or http://www.paraview.org/HTML/Copyright.html for details.
18 ----------------------------------------------------------------------------*/
19 
40 #ifndef _vtkDIMACSGraphReader_h
41 #define _vtkDIMACSGraphReader_h
42 
43 #include "vtkGraphAlgorithm.h"
44 #include "vtkStdString.h" // For string API
45 
47 {
48 
49 public:
50 
51  static vtkDIMACSGraphReader *New();
53  void PrintSelf(ostream& os, vtkIndent indent);
54 
56 
57  vtkGetStringMacro(FileName);
58  vtkSetStringMacro(FileName);
60 
62 
63  vtkGetStringMacro(VertexAttributeArrayName);
64  vtkSetStringMacro(VertexAttributeArrayName);
66 
68 
69  vtkGetStringMacro(EdgeAttributeArrayName);
70  vtkSetStringMacro(EdgeAttributeArrayName);
72 
73 protected:
74 
77 
78  virtual int RequestData(vtkInformation *,
81 
82  int buildGenericGraph(vtkGraph * output,
83  vtkStdString & defaultVertexAttrArrayName,
84  vtkStdString & defaultEdgeAttrArrayName);
85 
86  int buildColoringGraph(vtkGraph * output);
87  int buildMaxflowGraph(vtkGraph * output);
88 
90 
91  virtual int RequestDataObject(vtkInformation*,
92  vtkInformationVector** inputVector,
93  vtkInformationVector* outputVector);
95 
96  int ReadGraphMetaData();
97 
98 private:
99 
100  bool fileOk;
101  bool Directed;
102  char * FileName;
103  char * VertexAttributeArrayName;
104  char * EdgeAttributeArrayName;
105 
106  int numVerts;
107  int numEdges;
108  vtkStdString dimacsProblemStr;
109 
110  vtkDIMACSGraphReader(const vtkDIMACSGraphReader&); // Not implemented.
111  void operator=(const vtkDIMACSGraphReader&); // Not implemented.
112 };
113 
114 #endif // _vtkDIMACSGraphReader_h