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 
61 #ifndef _vtkDIMACSGraphReader_h
62 #define _vtkDIMACSGraphReader_h
63 
64 #include "vtkGraphAlgorithm.h"
65 #include "vtkStdString.h" // For string API
66 
68 {
69 
70 public:
71 
72  static vtkDIMACSGraphReader *New();
74  void PrintSelf(ostream& os, vtkIndent indent);
75 
77 
78  vtkGetStringMacro(FileName);
79  vtkSetStringMacro(FileName);
81 
83 
84  vtkGetStringMacro(VertexAttributeArrayName);
85  vtkSetStringMacro(VertexAttributeArrayName);
87 
89 
90  vtkGetStringMacro(EdgeAttributeArrayName);
91  vtkSetStringMacro(EdgeAttributeArrayName);
93 
94 protected:
95 
98 
99  virtual int RequestData(vtkInformation *,
102 
103  int buildGenericGraph(vtkGraph * output,
104  vtkStdString & defaultVertexAttrArrayName,
105  vtkStdString & defaultEdgeAttrArrayName);
106 
107  int buildColoringGraph(vtkGraph * output);
108  int buildMaxflowGraph(vtkGraph * output);
109 
111 
112  virtual int RequestDataObject(vtkInformation*,
113  vtkInformationVector** inputVector,
114  vtkInformationVector* outputVector);
116 
117  int ReadGraphMetaData();
118 
119 private:
120 
121  bool fileOk;
122  bool Directed;
123  char * FileName;
124  char * VertexAttributeArrayName;
125  char * EdgeAttributeArrayName;
126 
127  int numVerts;
128  int numEdges;
129  vtkStdString dimacsProblemStr;
130 
131  vtkDIMACSGraphReader(const vtkDIMACSGraphReader&); // Not implemented.
132  void operator=(const vtkDIMACSGraphReader&); // Not implemented.
133 };
134 
135 #endif // _vtkDIMACSGraphReader_h