VTK
vtkDIMACSGraphReader.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkDIMACSGraphReader.h
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 "vtkIOInfovisModule.h" // For export macro
65 #include "vtkGraphAlgorithm.h"
66 #include "vtkStdString.h" // For string API
67 
69 {
70 
71 public:
72 
73  static vtkDIMACSGraphReader *New();
75  void PrintSelf(ostream& os, vtkIndent indent);
76 
78 
79  vtkGetStringMacro(FileName);
80  vtkSetStringMacro(FileName);
82 
84 
85  vtkGetStringMacro(VertexAttributeArrayName);
86  vtkSetStringMacro(VertexAttributeArrayName);
88 
90 
91  vtkGetStringMacro(EdgeAttributeArrayName);
92  vtkSetStringMacro(EdgeAttributeArrayName);
94 
95 protected:
96 
99 
100  virtual int RequestData(vtkInformation *,
103 
104  int buildGenericGraph(vtkGraph * output,
105  vtkStdString & defaultVertexAttrArrayName,
106  vtkStdString & defaultEdgeAttrArrayName);
107 
108  int buildColoringGraph(vtkGraph * output);
109  int buildMaxflowGraph(vtkGraph * output);
110 
112 
113  virtual int RequestDataObject(vtkInformation*,
114  vtkInformationVector** inputVector,
115  vtkInformationVector* outputVector);
117 
118  int ReadGraphMetaData();
119 
120 private:
121 
122  bool fileOk;
123  bool Directed;
124  char * FileName;
125  char * VertexAttributeArrayName;
126  char * EdgeAttributeArrayName;
127 
128  int numVerts;
129  int numEdges;
130  vtkStdString dimacsProblemStr;
131 
132  vtkDIMACSGraphReader(const vtkDIMACSGraphReader&); // Not implemented.
133  void operator=(const vtkDIMACSGraphReader&); // Not implemented.
134 };
135 
136 #endif // vtkDIMACSGraphReader_h
static vtkGraphAlgorithm * New()
Wrapper around std::string to keep symbols short.
Definition: vtkStdString.h:46
Store vtkAlgorithm input/output information.
#define VTKIOINFOVIS_EXPORT
Superclass for algorithms that produce only graph as output.
Base class for graph data types.
Definition: vtkGraph.h:288
a simple class to control print indentation
Definition: vtkIndent.h:38
void PrintSelf(ostream &os, vtkIndent indent)
virtual int RequestDataObject(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
virtual int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
Store zero or more vtkInformation instances.
reads vtkGraph data from a DIMACS formatted file