VTK
vtkChacoReader.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: Visualization Toolkit
4 Module: vtkChacoReader.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
36#ifndef vtkChacoReader_h
37#define vtkChacoReader_h
38
39#include "vtkIOGeometryModule.h" // For export macro
41
42class VTKIOGEOMETRY_EXPORT vtkChacoReader : public vtkUnstructuredGridAlgorithm
43{
44public:
47 void PrintSelf(ostream& os, vtkIndent indent);
48
54 vtkSetStringMacro(BaseName);
56
64 vtkSetMacro(GenerateGlobalElementIdArray, int);
65 vtkGetMacro(GenerateGlobalElementIdArray, int);
66 vtkBooleanMacro(GenerateGlobalElementIdArray, int);
67
68 static const char *GetGlobalElementIdArrayName() { return "GlobalElementId"; }
69
78 vtkSetMacro(GenerateGlobalNodeIdArray, int);
79 vtkGetMacro(GenerateGlobalNodeIdArray, int);
80 vtkBooleanMacro(GenerateGlobalNodeIdArray, int);
81
82 static const char *GetGlobalNodeIdArrayName() { return "GlobalNodeId"; }
83
90 vtkSetMacro(GenerateVertexWeightArrays, int);
91 vtkGetMacro(GenerateVertexWeightArrays, int);
92 vtkBooleanMacro(GenerateVertexWeightArrays, int);
93
99 vtkGetMacro(NumberOfVertexWeights, int);
100
110
120 vtkSetMacro(GenerateEdgeWeightArrays, int);
121 vtkGetMacro(GenerateEdgeWeightArrays, int);
122 vtkBooleanMacro(GenerateEdgeWeightArrays, int);
123
129 vtkGetMacro(NumberOfEdgeWeights, int);
130
140
142
145 vtkGetMacro(Dimensionality, int);
146 vtkGetMacro(NumberOfEdges, vtkIdType);
147 vtkGetMacro(NumberOfVertices, vtkIdType);
149
156 vtkGetMacro(NumberOfCellWeightArrays, int);
157
164 vtkGetMacro(NumberOfPointWeightArrays, int);
165
166protected:
169
171
172 // methods for parsing Chaco files
173
176
177 int InputGeom(vtkIdType nvtxs, int igeom, double *x, double *y, double *z);
179 int InputGraph2( vtkIdType **start, vtkIdType **adjacency, double **vweights,
180 double **eweights);
183
184 // methods for creating vtkUnstructuredGrid from Chaco file data
185
189
190 void MakeWeightArrayNames(int nv, int ne);
191
192 // Parameters for controlling what is read in.
193 char *BaseName;
196
199
203 vtkSetStringMacro(CurrentBaseName);
204
207
208 //----------------------------------------------------------------------
209 // The following metadata is read during RequestInformation. If you
210 // add new metadata, you must modify vtkPChacoReader::RequestInformation
211 // to include it when process 0 broadcasts the metadata.
212
216 int NumberOfVertexWeights; // in file
217 int NumberOfEdgeWeights; // in file
219
220 //----------------------------------------------------------------------
221
222 int NumberOfPointWeightArrays; // in output unstuctured grid
223 int NumberOfCellWeightArrays; // in output unstuctured grid
224
225 // Keep the points and cells
226 // around so they don't need to be re-read when the
227 // options change.
229
230 // Should I re-read in the geometry and topology of the dataset
232
237
238private:
239 vtkChacoReader(const vtkChacoReader&) VTK_DELETE_FUNCTION;
240 void operator=(const vtkChacoReader&) VTK_DELETE_FUNCTION;
241
242 double ReadVal(FILE *infile, int *end_flag);
243 vtkIdType ReadInt(FILE *infile, int *end_flag);
244 void FlushLine( FILE *infile);
245 void ResetInputBuffers();
246
247 char *Line;
248 int Line_length;
249 int Offset;
250 int Break_pnt;
251 int Save_pnt;
252
253 void ClearWeightArrayNames();
254};
255
256#endif
Read a Chaco file and create a vtkUnstructuredGrid.
int ReadFile(vtkUnstructuredGrid *output)
const char * GetVertexWeightArrayName(int weight)
This method returns the name of the selected Vertex weight point array.
const char * GetEdgeWeightArrayName(int weight)
This method returns the name of the selected Edge weight cell array.
static const char * GetGlobalNodeIdArrayName()
int GenerateGlobalElementIdArray
int NumberOfCellWeightArrays
void MakeWeightArrayNames(int nv, int ne)
int InputGeom(vtkIdType nvtxs, int igeom, double *x, double *y, double *z)
int BuildOutputGrid(vtkUnstructuredGrid *gr)
int OpenCurrentFile()
void PrintSelf(ostream &os, vtkIndent indent)
Methods invoked by print to print information about the object including superclasses.
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
This is called by the superclass.
int NumberOfPointWeightArrays
int GetCoordsMetadata()
int GenerateGlobalNodeIdArray
void AddElementIds(vtkUnstructuredGrid *output)
void CloseCurrentFile()
int GraphFileHasVertexNumbers
vtkUnstructuredGrid * DataCache
int GenerateEdgeWeightArrays
int InputGraph2(vtkIdType **start, vtkIdType **adjacency, double **vweights, double **eweights)
vtkIdType NumberOfVertices
static vtkChacoReader * New()
int GenerateVertexWeightArrays
void GetGraphMetadata()
static const char * GetGlobalElementIdArrayName()
char * CurrentBaseName
int RequestInformation(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
FILE * CurrentGeometryFP
vtkIdType NumberOfEdges
void AddNodeIds(vtkUnstructuredGrid *output)
a simple class to control print indentation
Definition: vtkIndent.h:40
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
Superclass for algorithms that produce only unstructured grid as output.
dataset represents arbitrary combinations of all possible cell types
@ weight
Definition: vtkX3D.h:532
vtkSetMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
vtkBooleanMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
vtkGetStringMacro(ExtensionsString)
Returns a string listing all available extensions.
int vtkIdType
Definition: vtkType.h:287