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 
62 #ifndef vtkDIMACSGraphReader_h
63 #define vtkDIMACSGraphReader_h
64 
65 #include "vtkIOInfovisModule.h" // For export macro
66 #include "vtkGraphAlgorithm.h"
67 #include "vtkStdString.h" // For string API
68 
69 class VTKIOINFOVIS_EXPORT vtkDIMACSGraphReader : public vtkGraphAlgorithm
70 {
71 
72 public:
73 
74  static vtkDIMACSGraphReader *New();
76  void PrintSelf(ostream& os, vtkIndent indent);
77 
79 
82  vtkGetStringMacro(FileName);
83  vtkSetStringMacro(FileName);
85 
87 
90  vtkGetStringMacro(VertexAttributeArrayName);
91  vtkSetStringMacro(VertexAttributeArrayName);
93 
95 
98  vtkGetStringMacro(EdgeAttributeArrayName);
99  vtkSetStringMacro(EdgeAttributeArrayName);
101 
102 protected:
103 
106 
107  virtual int RequestData(vtkInformation *,
110 
111  int buildGenericGraph(vtkGraph * output,
112  vtkStdString & defaultVertexAttrArrayName,
113  vtkStdString & defaultEdgeAttrArrayName);
114 
115  int buildColoringGraph(vtkGraph * output);
116  int buildMaxflowGraph(vtkGraph * output);
117 
121  virtual int RequestDataObject(vtkInformation*,
122  vtkInformationVector** inputVector,
123  vtkInformationVector* outputVector);
124 
125  int ReadGraphMetaData();
126 
127 private:
128 
129  bool fileOk;
130  bool Directed;
131  char * FileName;
132  char * VertexAttributeArrayName;
133  char * EdgeAttributeArrayName;
134 
135  int numVerts;
136  int numEdges;
137  vtkStdString dimacsProblemStr;
138 
139  vtkDIMACSGraphReader(const vtkDIMACSGraphReader&) VTK_DELETE_FUNCTION;
140  void operator=(const vtkDIMACSGraphReader&) VTK_DELETE_FUNCTION;
141 };
142 
143 #endif // vtkDIMACSGraphReader_h
static vtkGraphAlgorithm * New()
Wrapper around std::string to keep symbols short.
Definition: vtkStdString.h:47
Store vtkAlgorithm input/output information.
Superclass for algorithms that produce only graph as output.
Base class for graph data types.
Definition: vtkGraph.h:287
a simple class to control print indentation
Definition: vtkIndent.h:39
virtual int RequestDataObject(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
vtkGetStringMacro(ExtensionsString)
Returns a string listing all available extensions.
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