This file is indexed.

/usr/include/vtk-5.8/vtkChacoReader.h is in libvtk5-dev 5.8.0-5.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
/*=========================================================================

  Program:   Visualization Toolkit
  Module:    vtkChacoReader.h

  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
  All rights reserved.
  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.

     This software is distributed WITHOUT ANY WARRANTY; without even
     the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
     PURPOSE.  See the above copyright notice for more information.

=========================================================================*/
/*----------------------------------------------------------------------------
 Copyright (c) Sandia Corporation
 See Copyright.txt or http://www.paraview.org/HTML/Copyright.html for details.
----------------------------------------------------------------------------*/

// .NAME vtkChacoReader - Read a Chaco file and create a vtkUnstructuredGrid. 
// .SECTION Description
// vtkChacoReader is an unstructured grid source object that reads Chaco
// files.  The reader DOES NOT respond to piece requests. Chaco
// is a graph partitioning package developed at Sandia National Laboratories
// in the early 1990s.  (http://www.cs.sandia.gov/~bahendr/chaco.html)
//
// Note that the Chaco "edges" become VTK "cells", and the Chaco
// "vertices" become VTK "points".

#ifndef __vtkChacoReader_h
#define __vtkChacoReader_h

#include "vtkUnstructuredGridAlgorithm.h"

class VTK_IO_EXPORT vtkChacoReader : public vtkUnstructuredGridAlgorithm 
{
public:
  static vtkChacoReader *New();
  vtkTypeMacro(vtkChacoReader,vtkUnstructuredGridAlgorithm);
  void PrintSelf(ostream& os, vtkIndent indent);

  // Description:
  // Specify the base name of the Chaco files.  The reader will try to
  // open BaseName.coords and BaseName.graph.

  vtkSetStringMacro(BaseName);
  vtkGetStringMacro(BaseName);

  // Description:
  // Indicate whether this reader should create a cell array containing
  // global IDs for the cells in the output vtkUnstructuredGrid.  These cells
  // represent the edges that were in the Chaco file.  Each edge is a vtkLine.
  // Default is ON.

  vtkSetMacro(GenerateGlobalElementIdArray, int);
  vtkGetMacro(GenerateGlobalElementIdArray, int);
  vtkBooleanMacro(GenerateGlobalElementIdArray, int);

  static const char *GetGlobalElementIdArrayName() { return "GlobalElementId"; }

  // Description:
  // Indicate whether this reader should create a point array of global IDs for 
  // the points in the output vtkUnstructuredGrid.  These points are the vertices
  // that were in the Chaco file.  Global point IDs start at "1" for the first
  // vertex in BaseName.coords and go up from there.
  // Default is ON.

  vtkSetMacro(GenerateGlobalNodeIdArray, int);
  vtkGetMacro(GenerateGlobalNodeIdArray, int);
  vtkBooleanMacro(GenerateGlobalNodeIdArray, int);

  static const char *GetGlobalNodeIdArrayName() { return "GlobalNodeId"; }
  
  // Description:
  // Indicate whether this reader should create a point array for each
  // vertex weight in the Chaco file.
  // Default is OFF.

  vtkSetMacro(GenerateVertexWeightArrays, int);
  vtkGetMacro(GenerateVertexWeightArrays, int);
  vtkBooleanMacro(GenerateVertexWeightArrays, int);

  // Description:
  // Returns the number of weights per vertex in the Chaco file, whether or
  // not GenerateVertexWeightArrays is ON.

  vtkGetMacro(NumberOfVertexWeights, int);

  // Description:
  // This method returns the name of the selected Vertex weight point
  // array.  If you did not turn on GenerateVertexWeightArrays, or
  // if the weight you requested is invalid, it returns NULL.
  // Weights begin at one and go up to NumberOfVertexWeights. 
  // This is a pointer to our copy of the name, so don't "delete" it.

  const char *GetVertexWeightArrayName(int weight);

  // Description:
  // Each edge in the Chaco file connects two vertices.  The file may 
  // specify one or more weights for each edge.  (The weight for an
  // edge from vertex A to vertex B equals the weight from B to A.)
  // Indicate with the following parameter whether this reader should
  // create a cell array for each weight for every edge.
  // Default is OFF.

  vtkSetMacro(GenerateEdgeWeightArrays, int);
  vtkGetMacro(GenerateEdgeWeightArrays, int);
  vtkBooleanMacro(GenerateEdgeWeightArrays, int);

  // Description:
  // Returns the number of weights per edge in the Chaco file, whether or
  // not GenerateEdgeWeightArrays is ON.

  vtkGetMacro(NumberOfEdgeWeights, int);

  // Description:
  // This method returns the name of the selected Edge weight cell
  // array.  If you did not turn on GenerateEdgeWeightArrays, or
  // if the weight you requested is invalid, it returns NULL.
  // Weights begin at one and go up to NumberOfEdgeWeights. 
  // This is a pointer to our copy of the name, so don't "delete" it.

  const char *GetEdgeWeightArrayName(int weight);

  // Description:
  // Access to meta data generated by RequestInformation.
  vtkGetMacro(Dimensionality, int);
  vtkGetMacro(NumberOfEdges, vtkIdType);
  vtkGetMacro(NumberOfVertices, vtkIdType);

  // Description:
  // After this filter executes, this method returns the number of
  // cell arrays that were created to hold the edge weights.  It
  // is equal to NumberOfEdgeWeights if GenerateEdgeWeightArrays was ON.

  vtkGetMacro(NumberOfCellWeightArrays, int);

  // Description:
  // After this filter executes, this method returns the number of
  // point arrays that were created to hold the vertex weights.  It
  // is equal to NumberOfVertexWeights if GenerateVertexWeightArrays was ON.

  vtkGetMacro(NumberOfPointWeightArrays, int);
  
protected:
  vtkChacoReader();
  ~vtkChacoReader();

  int BuildOutputGrid(vtkUnstructuredGrid *gr);

  // methods for parsing Chaco files

  void CloseCurrentFile();
  int OpenCurrentFile();

  int InputGeom(vtkIdType nvtxs, int igeom, double *x, double *y, double *z);
  int InputGraph1();
  int InputGraph2( vtkIdType **start, vtkIdType **adjacency, double **vweights,
      double **eweights);
  int GetCoordsMetadata();
  void GetGraphMetadata();

  // methods for creating vtkUnstructuredGrid from Chaco file data

  int ReadFile(vtkUnstructuredGrid* output);
  void AddElementIds(vtkUnstructuredGrid* output);
  void AddNodeIds(vtkUnstructuredGrid* output);

  void MakeWeightArrayNames(int nv, int ne);

  // Parameters for controlling what is read in.
  char *BaseName;
  int GenerateGlobalElementIdArray;
  int GenerateGlobalNodeIdArray;

  int GenerateVertexWeightArrays;
  int GenerateEdgeWeightArrays;

  FILE *CurrentGeometryFP;
  FILE *CurrentGraphFP;
  char *CurrentBaseName;
  vtkSetStringMacro(CurrentBaseName);

  char **VarrayName;
  char **EarrayName;

  //----------------------------------------------------------------------
  // The following metadata is read during RequestInformation.  If you
  // add new metadata, you must modify vtkPChacoReader::RequestInformation
  // to include it when process 0 broadcasts the metadata.
  
  int Dimensionality;
  vtkIdType NumberOfVertices;
  vtkIdType NumberOfEdges;
  int NumberOfVertexWeights;   // in file
  int NumberOfEdgeWeights;     // in file
  int GraphFileHasVertexNumbers;

  //----------------------------------------------------------------------

  int NumberOfPointWeightArrays;   // in output unstuctured grid
  int NumberOfCellWeightArrays;    // in output unstuctured grid

  // Keep the points and cells
  // around so they don't need to be re-read when the
  // options change.
  vtkUnstructuredGrid *DataCache;
    
  // Should I re-read in the geometry and topology of the dataset
  int RemakeDataCacheFlag;

  int RequestInformation(
    vtkInformation *, vtkInformationVector **, vtkInformationVector *);
  int RequestData(
    vtkInformation *, vtkInformationVector **, vtkInformationVector *);

private:
  vtkChacoReader(const vtkChacoReader&); // Not implemented
  void operator=(const vtkChacoReader&); // Not implemented

  double ReadVal(FILE *infile, int *end_flag);
  vtkIdType ReadInt(FILE *infile, int *end_flag);
  void FlushLine( FILE *infile);
  void ResetInputBuffers();

  char *Line;
  int Line_length;
  int Offset;
  int Break_pnt;
  int Save_pnt;

  void ClearWeightArrayNames();
};

#endif