VTK  9.2.6
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 class VTKIOINFOVIS_EXPORT vtkDIMACSGraphReader : public vtkGraphAlgorithm
67 {
68 
69 public:
70  static vtkDIMACSGraphReader* New();
72  void PrintSelf(ostream& os, vtkIndent indent) override;
73 
75 
78  vtkGetFilePathMacro(FileName);
79  vtkSetFilePathMacro(FileName);
81 
83 
86  vtkGetStringMacro(VertexAttributeArrayName);
87  vtkSetStringMacro(VertexAttributeArrayName);
89 
91 
94  vtkGetStringMacro(EdgeAttributeArrayName);
95  vtkSetStringMacro(EdgeAttributeArrayName);
97 
98 protected:
100  ~vtkDIMACSGraphReader() override;
101 
103 
104  int buildGenericGraph(vtkGraph* output, vtkStdString& defaultVertexAttrArrayName,
105  vtkStdString& defaultEdgeAttrArrayName);
106 
107  int buildColoringGraph(vtkGraph* output);
108  int buildMaxflowGraph(vtkGraph* output);
109 
114  vtkInformationVector* outputVector) override;
115 
116  int ReadGraphMetaData();
117 
118 private:
119  bool fileOk;
120  bool Directed;
121  char* FileName;
122  char* VertexAttributeArrayName;
123  char* EdgeAttributeArrayName;
124 
125  int numVerts;
126  int numEdges;
127  vtkStdString dimacsProblemStr;
128 
130  void operator=(const vtkDIMACSGraphReader&) = delete;
131 };
132 
133 #endif // vtkDIMACSGraphReader_h
static vtkGraphAlgorithm * New()
Wrapper around std::string to keep symbols short.
Definition: vtkStdString.h:38
Store vtkAlgorithm input/output information.
Superclass for algorithms that produce only graph as output.
Base class for graph data types.
Definition: vtkGraph.h:295
a simple class to control print indentation
Definition: vtkIndent.h:39
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