VTK
vtkNetCDFReader.h
Go to the documentation of this file.
1 // -*- c++ -*-
2 /*=========================================================================
3 
4  Program: Visualization Toolkit
5  Module: vtkNetCDFReader.h
6 
7  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
8  All rights reserved.
9  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
10 
11  This software is distributed WITHOUT ANY WARRANTY; without even
12  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
13  PURPOSE. See the above copyright notice for more information.
14 
15 =========================================================================*/
16 
17 /*-------------------------------------------------------------------------
18  Copyright 2008 Sandia Corporation.
19  Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
20  the U.S. Government retains certain rights in this software.
21 -------------------------------------------------------------------------*/
22 
33 #ifndef vtkNetCDFReader_h
34 #define vtkNetCDFReader_h
35 
36 #include "vtkIONetCDFModule.h" // For export macro
37 #include "vtkDataObjectAlgorithm.h"
38 
39 #include "vtkSmartPointer.h" // For ivars
40 #include <string> //For std::string
41 
43 class vtkDataSet;
44 class vtkDoubleArray;
45 class vtkIntArray;
46 class vtkStdString;
47 class vtkStringArray;
48 class vtkNetCDFReaderPrivate;
49 
51 {
52 public:
54  static vtkNetCDFReader *New();
55  virtual void PrintSelf(ostream &os, vtkIndent indent);
56 
57  virtual void SetFileName(const char *filename);
58  vtkGetStringMacro(FileName);
59 
62  int UpdateMetaData();
63 
64 // // Description:
65 // // Get the data array selection tables used to configure which variables to
66 // // load.
67 // vtkGetObjectMacro(VariableArraySelection, vtkDataArraySelection);
68 
70 
71  virtual int GetNumberOfVariableArrays();
72  virtual const char *GetVariableArrayName(int idx);
73  virtual int GetVariableArrayStatus(const char *name);
74  virtual void SetVariableArrayStatus(const char *name, int status);
76 
81  virtual vtkStringArray *GetAllVariableArrayNames();
82 
84 
89  vtkGetObjectMacro(VariableDimensions, vtkStringArray);
91 
98  virtual void SetDimensions(const char *dimensions);
99 
101 
106  vtkGetObjectMacro(AllDimensions, vtkStringArray);
108 
110 
118  vtkGetMacro(ReplaceFillValueWithNan, int);
119  vtkSetMacro(ReplaceFillValueWithNan, int);
120  vtkBooleanMacro(ReplaceFillValueWithNan, int);
122 
124 
127  vtkGetStringMacro(TimeUnits);
128  vtkGetStringMacro(Calendar);
130 
132  std::string QueryArrayUnits(const char *ArrayName);
133 
134 protected:
135  vtkNetCDFReader();
136  ~vtkNetCDFReader();
137 
138  char *FileName;
141 
142 //BTX
145 
147 
149 
152 
154 
156 //ETX
158 
160 
161  int WholeExtent[6];
162 
163  virtual int RequestDataObject(vtkInformation *request,
164  vtkInformationVector **inputVector,
165  vtkInformationVector *outputVector);
166 
167  virtual int RequestInformation(vtkInformation *request,
168  vtkInformationVector **inputVector,
169  vtkInformationVector *outputVector);
170 
171  virtual int RequestData(vtkInformation *request,
172  vtkInformationVector **inputVector,
173  vtkInformationVector *outputVector);
174 
176 
177  static void SelectionModifiedCallback(vtkObject *caller, unsigned long eid,
178  void *clientdata, void *calldata);
180 
183  vtkStdString DescribeDimensions(int ncFD, const int *dimIds, int numDims);
184 
187  virtual int ReadMetaData(int ncFD);
188 
190  virtual int FillVariableDimensions(int ncFD);
191 
197  virtual int IsTimeDimension(int ncFD, int dimId);
198 
199 //BTX
201 
207  virtual vtkSmartPointer<vtkDoubleArray> GetTimeValues(int ncFD, int dimId);
208 //ETX
210 
212 
217  virtual bool DimensionsAreForPointData(vtkIntArray *vtkNotUsed(dimensions)) {
218  return true;
219  }
221 
226  virtual void GetUpdateExtentForOutput(vtkDataSet *output, int extent[6]);
227 
229 
231  virtual int LoadVariable(int ncFD, const char *varName, double time,
232  vtkDataSet *output);
234 
235 private:
236  vtkNetCDFReader(const vtkNetCDFReader &); // Not implemented
237  void operator=(const vtkNetCDFReader &); // Not implemented
238 
239  int UpdateExtent[6];
240  char *TimeUnits;
241  char *Calendar;
242  vtkNetCDFReaderPrivate *Private;
243 };
244 
245 #endif //vtkNetCDFReader_h
virtual int RequestDataObject(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
Wrapper around std::string to keep symbols short.
Definition: vtkStdString.h:46
abstract base class for most VTK objects
Definition: vtkObject.h:61
Store vtkAlgorithm input/output information.
abstract class to specify dataset behavior
Definition: vtkDataSet.h:61
static vtkDataObjectAlgorithm * New()
virtual bool DimensionsAreForPointData(vtkIntArray *vtkNotUsed(dimensions))
record modification and/or execution time
Definition: vtkTimeStamp.h:34
a vtkAbstractArray subclass for strings
void PrintSelf(ostream &os, vtkIndent indent)
vtkTimeStamp FileNameMTime
dynamic, self-adjusting array of double
dynamic, self-adjusting array of int
Definition: vtkIntArray.h:49
vtkSmartPointer< vtkStringArray > AllVariableArrayNames
a simple class to control print indentation
Definition: vtkIndent.h:38
Store on/off settings for data arrays for a vtkSource.
vtkSmartPointer< vtkIntArray > LoadingDimensions
Superclass for algorithms that produce only data object as output.
vtkStringArray * VariableDimensions
virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
virtual int RequestInformation(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
Store zero or more vtkInformation instances.
#define VTKIONETCDF_EXPORT
vtkTimeStamp MetaDataMTime
vtkStringArray * AllDimensions
vtkSmartPointer< vtkDataArraySelection > VariableArraySelection