/usr/include/vtk-6.2/vtkNetCDFReader.h is in libvtk6-dev 6.2.0+dfsg1-10build1.
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 236 237 238 | // -*- c++ -*-
/*=========================================================================
Program: Visualization Toolkit
Module: vtkNetCDFReader.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 2008 Sandia Corporation.
Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
the U.S. Government retains certain rights in this software.
-------------------------------------------------------------------------*/
// .NAME vtkNetCDFReader
//
// .SECTION Description
//
// A superclass for reading netCDF files. Subclass add conventions to the
// reader. This class just outputs data into a multi block data set with a
// vtkImageData at each block. A block is created for each variable except that
// variables with matching dimensions will be placed in the same block.
#ifndef vtkNetCDFReader_h
#define vtkNetCDFReader_h
#include "vtkIONetCDFModule.h" // For export macro
#include "vtkDataObjectAlgorithm.h"
#include "vtkSmartPointer.h" // For ivars
#include <string> //For std::string
class vtkDataArraySelection;
class vtkDataSet;
class vtkDoubleArray;
class vtkIntArray;
class vtkStdString;
class vtkStringArray;
class vtkNetCDFReaderPrivate;
class VTKIONETCDF_EXPORT vtkNetCDFReader : public vtkDataObjectAlgorithm
{
public:
vtkTypeMacro(vtkNetCDFReader, vtkDataObjectAlgorithm);
static vtkNetCDFReader *New();
virtual void PrintSelf(ostream &os, vtkIndent indent);
virtual void SetFileName(const char *filename);
vtkGetStringMacro(FileName);
// Description:
// Update the meta data from the current file. Automatically called
// during the RequestInformation pipeline update stage.
int UpdateMetaData();
// // Description:
// // Get the data array selection tables used to configure which variables to
// // load.
// vtkGetObjectMacro(VariableArraySelection, vtkDataArraySelection);
// Description:
// Variable array selection.
virtual int GetNumberOfVariableArrays();
virtual const char *GetVariableArrayName(int idx);
virtual int GetVariableArrayStatus(const char *name);
virtual void SetVariableArrayStatus(const char *name, int status);
// Description:
// Convenience method to get a list of variable arrays. The length of the
// returned list is the same as GetNumberOfVariableArrays, and the string
// at each index i is the same as returned from GetVariableArrayname(i).
virtual vtkStringArray *GetAllVariableArrayNames();
// Description:
// Returns an array with string encodings for the dimensions used in each of
// the variables. The indices in the returned array correspond to those used
// in the GetVariableArrayName method. Two arrays with the same dimensions
// will have the same encoded string returned by this method.
vtkGetObjectMacro(VariableDimensions, vtkStringArray);
// Description:
// Loads the grid with the given dimensions. The dimensions are encoded in a
// string that conforms to the same format as returned by
// GetVariableDimensions and GetAllDimensions. This method is really a
// convenience method for SetVariableArrayStatus. It turns on all variables
// that have the given dimensions and turns off all other variables.
virtual void SetDimensions(const char *dimensions);
// Description:
// Returns an array with string encodings for the dimension combinations used
// in the variables. The result is the same as GetVariableDimensions except
// that each entry in the array is unique (a set of dimensions is only given
// once even if it occurs for multiple variables) and the order is
// meaningless.
vtkGetObjectMacro(AllDimensions, vtkStringArray);
// Description:
// If on, any float or double variable read that has a _FillValue attribute
// will have that fill value replaced with a not-a-number (NaN) value. The
// advantage of setting these to NaN values is that, if implemented properly
// by the system and careful math operations are used, they can implicitly be
// ignored by calculations like finding the range of the values. That said,
// this option should be used with caution as VTK does not fully support NaN
// values and therefore odd calculations may occur. By default this is off.
vtkGetMacro(ReplaceFillValueWithNan, int);
vtkSetMacro(ReplaceFillValueWithNan, int);
vtkBooleanMacro(ReplaceFillValueWithNan, int);
// Description:
// Access to the time dimensions units.
// Can be used by the udunits library to convert raw numerical time values
// into meaningful representations.
vtkGetStringMacro(TimeUnits);
vtkGetStringMacro(Calendar);
// Description:
// Get units attached to a particular array in the netcdf file.
std::string QueryArrayUnits(const char *ArrayName);
protected:
vtkNetCDFReader();
~vtkNetCDFReader();
char *FileName;
vtkTimeStamp FileNameMTime;
vtkTimeStamp MetaDataMTime;
//BTX
// Description:
// The dimension ids of the arrays being loaded into the data.
vtkSmartPointer<vtkIntArray> LoadingDimensions;
vtkSmartPointer<vtkDataArraySelection> VariableArraySelection;
vtkSmartPointer<vtkStringArray> AllVariableArrayNames;
// Description:
// Placeholder for structure returned from GetVariableDimensions().
vtkStringArray *VariableDimensions;
// Description:
// Placeholder for structure returned from GetAllDimensions().
vtkStringArray *AllDimensions;
//ETX
int ReplaceFillValueWithNan;
int WholeExtent[6];
virtual int RequestDataObject(vtkInformation *request,
vtkInformationVector **inputVector,
vtkInformationVector *outputVector);
virtual int RequestInformation(vtkInformation *request,
vtkInformationVector **inputVector,
vtkInformationVector *outputVector);
virtual int RequestData(vtkInformation *request,
vtkInformationVector **inputVector,
vtkInformationVector *outputVector);
// Description:
// Callback registered with the VariableArraySelection.
static void SelectionModifiedCallback(vtkObject *caller, unsigned long eid,
void *clientdata, void *calldata);
// Description:
// Convenience function for getting a string that describes a set of
// dimensions.
vtkStdString DescribeDimensions(int ncFD, const int *dimIds, int numDims);
// Description:
// Reads meta data and populates ivars. Returns 1 on success, 0 on failure.
virtual int ReadMetaData(int ncFD);
// Description:
// Fills the VariableDimensions array.
virtual int FillVariableDimensions(int ncFD);
// Description:
// Determines whether the given variable is a time dimension. The default
// implementation bases the decision on the name of the variable. Subclasses
// should override this function if there is a more specific way to identify
// the time variable. This method is always called after ReadMetaData for
// a given file.
virtual int IsTimeDimension(int ncFD, int dimId);
//BTX
// Description:
// Given a dimension already determined to be a time dimension (via a call to
// IsTimeDimension) returns an array with time values. The default
// implementation just uses the time index for the time value. Subclasses
// should override this function if there is a convention that identifies time
// values. This method returns 0 on error, 1 otherwise.
virtual vtkSmartPointer<vtkDoubleArray> GetTimeValues(int ncFD, int dimId);
//ETX
// Description:
// Called internally to determine whether a variable with the given set of
// dimensions should be loaded as point data (return true) or cell data
// (return false). The implementation in this class always returns true.
// Subclasses should override to load cell data for some or all variables.
virtual bool DimensionsAreForPointData(vtkIntArray *vtkNotUsed(dimensions)) {
return true;
}
// Description:
// Retrieves the update extent for the output object. The default
// implementation just gets the update extent from the object as you would
// expect. However, if a subclass is loading an unstructured data set, this
// gives it a chance to set the range of values to read.
virtual void GetUpdateExtentForOutput(vtkDataSet *output, int extent[6]);
// Description:
// Load the variable at the given time into the given data set. Return 1
// on success and 0 on failure.
virtual int LoadVariable(int ncFD, const char *varName, double time,
vtkDataSet *output);
private:
vtkNetCDFReader(const vtkNetCDFReader &); // Not implemented
void operator=(const vtkNetCDFReader &); // Not implemented
int UpdateExtent[6];
char *TimeUnits;
char *Calendar;
vtkNetCDFReaderPrivate *Private;
};
#endif //vtkNetCDFReader_h
|