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 "vtkDataObjectAlgorithm.h"
37 
38 #include "vtkSmartPointer.h" // For ivars
39 
40 
42 class vtkDataSet;
43 class vtkDoubleArray;
44 class vtkIntArray;
45 class vtkStdString;
46 class vtkStringArray;
47 
49 {
50 public:
52  static vtkNetCDFReader *New();
53  virtual void PrintSelf(ostream &os, vtkIndent indent);
54 
55  virtual void SetFileName(const char *filename);
56  vtkGetStringMacro(FileName);
57 
60  int UpdateMetaData();
61 
62 // // Description:
63 // // Get the data array selection tables used to configure which variables to
64 // // load.
65 // vtkGetObjectMacro(VariableArraySelection, vtkDataArraySelection);
66 
68 
69  virtual int GetNumberOfVariableArrays();
70  virtual const char *GetVariableArrayName(int idx);
71  virtual int GetVariableArrayStatus(const char *name);
72  virtual void SetVariableArrayStatus(const char *name, int status);
74 
79  virtual vtkStringArray *GetAllVariableArrayNames();
80 
82 
87  vtkGetObjectMacro(VariableDimensions, vtkStringArray);
89 
96  virtual void SetDimensions(const char *dimensions);
97 
99 
104  vtkGetObjectMacro(AllDimensions, vtkStringArray);
106 
108 
116  vtkGetMacro(ReplaceFillValueWithNan, int);
117  vtkSetMacro(ReplaceFillValueWithNan, int);
118  vtkBooleanMacro(ReplaceFillValueWithNan, int);
120 
121 protected:
122  vtkNetCDFReader();
123  ~vtkNetCDFReader();
124 
125  char *FileName;
128 
129 //BTX
132 
134 
136 
139 
141 
143 //ETX
145 
147 
148  int WholeExtent[6];
149 
150  virtual int RequestDataObject(vtkInformation *request,
151  vtkInformationVector **inputVector,
152  vtkInformationVector *outputVector);
153 
154  virtual int RequestInformation(vtkInformation *request,
155  vtkInformationVector **inputVector,
156  vtkInformationVector *outputVector);
157 
158  virtual int RequestData(vtkInformation *request,
159  vtkInformationVector **inputVector,
160  vtkInformationVector *outputVector);
161 
163 
164  static void SelectionModifiedCallback(vtkObject *caller, unsigned long eid,
165  void *clientdata, void *calldata);
167 
170  vtkStdString DescribeDimensions(int ncFD, const int *dimIds, int numDims);
171 
174  virtual int ReadMetaData(int ncFD);
175 
177  virtual int FillVariableDimensions(int ncFD);
178 
184  virtual int IsTimeDimension(int ncFD, int dimId);
185 
186 //BTX
188 
194  virtual vtkSmartPointer<vtkDoubleArray> GetTimeValues(int ncFD, int dimId);
195 //ETX
197 
199 
204  virtual bool DimensionsAreForPointData(vtkIntArray *vtkNotUsed(dimensions)) {
205  return true;
206  }
208 
213  virtual void GetUpdateExtentForOutput(vtkDataSet *output, int extent[6]);
214 
216 
218  virtual int LoadVariable(int ncFD, const char *varName, double time,
219  vtkDataSet *output);
221 
222 private:
223  vtkNetCDFReader(const vtkNetCDFReader &); // Not implemented
224  void operator=(const vtkNetCDFReader &); // Not implemented
225 };
226 
227 #endif //__vtkNetCDFReader_h