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 
41 
43 class vtkDataSet;
44 class vtkDoubleArray;
45 class vtkIntArray;
46 class vtkStdString;
47 class vtkStringArray;
48 
49 class VTKIONETCDF_EXPORT vtkNetCDFReader : public vtkDataObjectAlgorithm
50 {
51 public:
53  static vtkNetCDFReader *New();
54  virtual void PrintSelf(ostream &os, vtkIndent indent);
55 
56  virtual void SetFileName(const char *filename);
57  vtkGetStringMacro(FileName);
58 
61  int UpdateMetaData();
62 
63 // // Description:
64 // // Get the data array selection tables used to configure which variables to
65 // // load.
66 // vtkGetObjectMacro(VariableArraySelection, vtkDataArraySelection);
67 
69 
70  virtual int GetNumberOfVariableArrays();
71  virtual const char *GetVariableArrayName(int idx);
72  virtual int GetVariableArrayStatus(const char *name);
73  virtual void SetVariableArrayStatus(const char *name, int status);
75 
80  virtual vtkStringArray *GetAllVariableArrayNames();
81 
83 
88  vtkGetObjectMacro(VariableDimensions, vtkStringArray);
90 
97  virtual void SetDimensions(const char *dimensions);
98 
100 
105  vtkGetObjectMacro(AllDimensions, vtkStringArray);
107 
109 
117  vtkGetMacro(ReplaceFillValueWithNan, int);
118  vtkSetMacro(ReplaceFillValueWithNan, int);
119  vtkBooleanMacro(ReplaceFillValueWithNan, int);
121 
122 protected:
123  vtkNetCDFReader();
124  ~vtkNetCDFReader();
125 
126  char *FileName;
129 
130 //BTX
133 
135 
137 
140 
142 
144 //ETX
146 
148 
149  int WholeExtent[6];
150 
151  virtual int RequestDataObject(vtkInformation *request,
152  vtkInformationVector **inputVector,
153  vtkInformationVector *outputVector);
154 
155  virtual int RequestInformation(vtkInformation *request,
156  vtkInformationVector **inputVector,
157  vtkInformationVector *outputVector);
158 
159  virtual int RequestData(vtkInformation *request,
160  vtkInformationVector **inputVector,
161  vtkInformationVector *outputVector);
162 
164 
165  static void SelectionModifiedCallback(vtkObject *caller, unsigned long eid,
166  void *clientdata, void *calldata);
168 
171  vtkStdString DescribeDimensions(int ncFD, const int *dimIds, int numDims);
172 
175  virtual int ReadMetaData(int ncFD);
176 
178  virtual int FillVariableDimensions(int ncFD);
179 
185  virtual int IsTimeDimension(int ncFD, int dimId);
186 
187 //BTX
189 
195  virtual vtkSmartPointer<vtkDoubleArray> GetTimeValues(int ncFD, int dimId);
196 //ETX
198 
200 
205  virtual bool DimensionsAreForPointData(vtkIntArray *vtkNotUsed(dimensions)) {
206  return true;
207  }
209 
214  virtual void GetUpdateExtentForOutput(vtkDataSet *output, int extent[6]);
215 
217 
219  virtual int LoadVariable(int ncFD, const char *varName, double time,
220  vtkDataSet *output);
222 
223 private:
224  vtkNetCDFReader(const vtkNetCDFReader &); // Not implemented
225  void operator=(const vtkNetCDFReader &); // Not implemented
226 
227  int UpdateExtent[6];
228 };
229 
230 #endif //__vtkNetCDFReader_h