VTK  9.2.20221001
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 
59 #ifndef vtkDIMACSGraphReader_h
60 #define vtkDIMACSGraphReader_h
61 
62 #include "vtkGraphAlgorithm.h"
63 #include "vtkIOInfovisModule.h" // For export macro
64 #include "vtkStdString.h" // For string API
65 
66 VTK_ABI_NAMESPACE_BEGIN
67 class VTKIOINFOVIS_EXPORT vtkDIMACSGraphReader : public vtkGraphAlgorithm
68 {
69 
70 public:
73  void PrintSelf(ostream& os, vtkIndent indent) override;
74 
76 
82 
84 
87  vtkGetStringMacro(VertexAttributeArrayName);
88  vtkSetStringMacro(VertexAttributeArrayName);
90 
92 
95  vtkGetStringMacro(EdgeAttributeArrayName);
96  vtkSetStringMacro(EdgeAttributeArrayName);
98 
99 protected:
102 
104 
105  int buildGenericGraph(vtkGraph* output, vtkStdString& defaultVertexAttrArrayName,
106  vtkStdString& defaultEdgeAttrArrayName);
107 
110 
115  vtkInformationVector* outputVector) override;
116 
118 
119 private:
120  bool fileOk;
121  bool Directed;
122  char* FileName;
123  char* VertexAttributeArrayName;
124  char* EdgeAttributeArrayName;
125 
126  int numVerts;
127  int numEdges;
128  std::string dimacsProblemStr;
129 
131  void operator=(const vtkDIMACSGraphReader&) = delete;
132 };
133 
134 VTK_ABI_NAMESPACE_END
135 #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:346
a simple class to control print indentation
Definition: vtkIndent.h:120
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
Wrapper around std::string to keep symbols short.
Definition: vtkStdString.h:110
@ string
Definition: vtkX3D.h:502