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 
56 #ifndef vtkDIMACSGraphReader_h
57 #define vtkDIMACSGraphReader_h
58 
59 #include "vtkIOInfovisModule.h" // For export macro
60 #include "vtkGraphAlgorithm.h"
61 #include "vtkStdString.h" // For string API
62 
63 class VTKIOINFOVIS_EXPORT vtkDIMACSGraphReader : public vtkGraphAlgorithm
64 {
65 
66 public:
67 
68  static vtkDIMACSGraphReader *New();
70  void PrintSelf(ostream& os, vtkIndent indent) override;
71 
73 
76  vtkGetStringMacro(FileName);
77  vtkSetStringMacro(FileName);
79 
81 
84  vtkGetStringMacro(VertexAttributeArrayName);
85  vtkSetStringMacro(VertexAttributeArrayName);
87 
89 
92  vtkGetStringMacro(EdgeAttributeArrayName);
93  vtkSetStringMacro(EdgeAttributeArrayName);
95 
96 protected:
97 
99  ~vtkDIMACSGraphReader() override;
100 
103  vtkInformationVector *) override;
104 
105  int buildGenericGraph(vtkGraph * output,
106  vtkStdString & defaultVertexAttrArrayName,
107  vtkStdString & defaultEdgeAttrArrayName);
108 
109  int buildColoringGraph(vtkGraph * output);
110  int buildMaxflowGraph(vtkGraph * output);
111 
116  vtkInformationVector** inputVector,
117  vtkInformationVector* outputVector) override;
118 
119  int ReadGraphMetaData();
120 
121 private:
122 
123  bool fileOk;
124  bool Directed;
125  char * FileName;
126  char * VertexAttributeArrayName;
127  char * EdgeAttributeArrayName;
128 
129  int numVerts;
130  int numEdges;
131  vtkStdString dimacsProblemStr;
132 
134  void operator=(const vtkDIMACSGraphReader&) = delete;
135 };
136 
137 #endif // vtkDIMACSGraphReader_h
static vtkGraphAlgorithm * New()
Wrapper around std::string to keep symbols short.
Definition: vtkStdString.h:34
Store vtkAlgorithm input/output information.
Superclass for algorithms that produce only graph as output.
Base class for graph data types.
Definition: vtkGraph.h:281
a simple class to control print indentation
Definition: vtkIndent.h:33
virtual int RequestDataObject(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
virtual int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
This is called by the superclass.
Store zero or more vtkInformation instances.
reads vtkGraph data from a DIMACS formatted file