VTK  9.0.20210118
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 "vtkGraphAlgorithm.h"
60 #include "vtkIOInfovisModule.h" // For export macro
61 #include "vtkStdString.h" // For string API
62 
63 class VTKIOINFOVIS_EXPORT vtkDIMACSGraphReader : public vtkGraphAlgorithm
64 {
65 
66 public:
67  static vtkDIMACSGraphReader* New();
69  void PrintSelf(ostream& os, vtkIndent indent) override;
70 
72 
75  vtkGetStringMacro(FileName);
76  vtkSetStringMacro(FileName);
78 
80 
83  vtkGetStringMacro(VertexAttributeArrayName);
84  vtkSetStringMacro(VertexAttributeArrayName);
86 
88 
91  vtkGetStringMacro(EdgeAttributeArrayName);
92  vtkSetStringMacro(EdgeAttributeArrayName);
94 
95 protected:
97  ~vtkDIMACSGraphReader() override;
98 
100 
101  int buildGenericGraph(vtkGraph* output, vtkStdString& defaultVertexAttrArrayName,
102  vtkStdString& defaultEdgeAttrArrayName);
103 
104  int buildColoringGraph(vtkGraph* output);
105  int buildMaxflowGraph(vtkGraph* output);
106 
111  vtkInformationVector* outputVector) override;
112 
113  int ReadGraphMetaData();
114 
115 private:
116  bool fileOk;
117  bool Directed;
118  char* FileName;
119  char* VertexAttributeArrayName;
120  char* EdgeAttributeArrayName;
121 
122  int numVerts;
123  int numEdges;
124  vtkStdString dimacsProblemStr;
125 
127  void operator=(const vtkDIMACSGraphReader&) = delete;
128 };
129 
130 #endif // vtkDIMACSGraphReader_h
vtkStdString.h
vtkGraphAlgorithm
Superclass for algorithms that produce only graph as output.
Definition: vtkGraphAlgorithm.h:51
vtkInformationVector
Store zero or more vtkInformation instances.
Definition: vtkInformationVector.h:35
vtkDIMACSGraphReader
reads vtkGraph data from a DIMACS formatted file
Definition: vtkDIMACSGraphReader.h:63
vtkGraphAlgorithm::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkGraphAlgorithm.h
vtkGraphAlgorithm::RequestDataObject
virtual int RequestDataObject(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:33
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:73
vtkGraphAlgorithm::RequestData
virtual int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
This is called by the superclass.
vtkStdString
Wrapper around std::string to keep symbols short.
Definition: vtkStdString.h:34
vtkGraph
Base class for graph data types.
Definition: vtkGraph.h:289
vtkGraphAlgorithm::New
static vtkGraphAlgorithm * New()