VTK  9.3.20240301
vtkDIMACSGraphReader.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-FileCopyrightText: Copyright (c) Sandia Corporation
3 // SPDX-License-Identifier: BSD-3-Clause
4 
44 #ifndef vtkDIMACSGraphReader_h
45 #define vtkDIMACSGraphReader_h
46 
47 #include "vtkGraphAlgorithm.h"
48 #include "vtkIOInfovisModule.h" // For export macro
49 #include "vtkStdString.h" // For string API
50 
51 VTK_ABI_NAMESPACE_BEGIN
52 class VTKIOINFOVIS_EXPORT vtkDIMACSGraphReader : public vtkGraphAlgorithm
53 {
54 
55 public:
58  void PrintSelf(ostream& os, vtkIndent indent) override;
59 
61 
67 
69 
72  vtkGetStringMacro(VertexAttributeArrayName);
73  vtkSetStringMacro(VertexAttributeArrayName);
75 
77 
80  vtkGetStringMacro(EdgeAttributeArrayName);
81  vtkSetStringMacro(EdgeAttributeArrayName);
83 
84 protected:
87 
89 
90  int buildGenericGraph(vtkGraph* output, vtkStdString& defaultVertexAttrArrayName,
91  vtkStdString& defaultEdgeAttrArrayName);
92 
95 
100  vtkInformationVector* outputVector) override;
101 
103 
104 private:
105  bool fileOk;
106  bool Directed;
107  char* FileName;
108  char* VertexAttributeArrayName;
109  char* EdgeAttributeArrayName;
110 
111  int numVerts;
112  int numEdges;
113  std::string dimacsProblemStr;
114 
116  void operator=(const vtkDIMACSGraphReader&) = delete;
117 };
118 
119 VTK_ABI_NAMESPACE_END
120 #endif // vtkDIMACSGraphReader_h
reads vtkGraph data from a DIMACS formatted file
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called by the superclass.
~vtkDIMACSGraphReader() override
vtkSetFilePathMacro(FileName)
The DIMACS file name.
int buildGenericGraph(vtkGraph *output, vtkStdString &defaultVertexAttrArrayName, vtkStdString &defaultEdgeAttrArrayName)
int RequestDataObject(vtkInformation *, vtkInformationVector **inputVector, vtkInformationVector *outputVector) override
Creates directed or undirected output based on Directed flag.
vtkGetFilePathMacro(FileName)
The DIMACS file name.
static vtkDIMACSGraphReader * New()
int buildColoringGraph(vtkGraph *output)
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
int buildMaxflowGraph(vtkGraph *output)
Superclass for algorithms that produce only graph as output.
Base class for graph data types.
Definition: vtkGraph.h:340
a simple class to control print indentation
Definition: vtkIndent.h:108
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
Wrapper around std::string to keep symbols short.
Definition: vtkStdString.h:78
@ string
Definition: vtkX3D.h:490