VTK
vtkNetCDFCAMReader.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkNetCDFCAMReader.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
28 #ifndef vtkNetCDFCAMReader_h
29 #define vtkNetCDFCAMReader_h
30 
31 #include "vtkIONetCDFModule.h" // For export macro
33 
34 #include "vtk_netcdfcpp_fwd.h" // Forward declarations for vtknetcdfcpp
35 
36 class vtkCallbackCommand;
38 
39 class VTKIONETCDF_EXPORT vtkNetCDFCAMReader : public vtkUnstructuredGridAlgorithm
40 {
41 public:
42  static vtkNetCDFCAMReader *New();
44  void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
45 
52  static int CanReadFile(const char* fileName);
53 
54  void SetFileName(const char* fileName);
55  vtkGetStringMacro(FileName);
56 
57  void SetConnectivityFileName(const char* fileName);
58  vtkGetStringMacro(ConnectivityFileName);
59 
61 
72  VTK_LEGACY(virtual void SingleLevelOn ());
73  VTK_LEGACY(virtual void SingleLevelOff ());
74  VTK_LEGACY(virtual void SetSingleLevel (int level));
75  VTK_LEGACY(virtual int GetSingleLevel ());
77 
79 
92  {
96  VERTICAL_DIMENSION_COUNT
97  };
98  vtkSetClampMacro(VerticalDimension, int, 0, 2);
99  vtkGetMacro(VerticalDimension, int);
101 
103 
109  vtkBooleanMacro(SingleMidpointLayer, int);
110  vtkSetMacro(SingleMidpointLayer, int);
111  vtkGetMacro(SingleMidpointLayer, int);
112  vtkSetMacro(MidpointLayerIndex, int);
113  vtkGetMacro(MidpointLayerIndex, int);
114  vtkGetVector2Macro(MidpointLayersRange, int);
115 
116  vtkBooleanMacro(SingleInterfaceLayer, int);
117  vtkSetMacro(SingleInterfaceLayer, int);
118  vtkGetMacro(SingleInterfaceLayer, int);
119  vtkSetMacro(InterfaceLayerIndex, int);
120  vtkGetMacro(InterfaceLayerIndex, int);
121  vtkGetVector2Macro(InterfaceLayersRange, int);
123 
125 
129  int GetNumberOfPointArrays();
130  const char* GetPointArrayName(int index);
131  int GetPointArrayStatus(const char* name);
132  void SetPointArrayStatus(const char* name, int status);
133  void DisableAllPointArrays();
134  void EnableAllPointArrays();
136 
137 
139 
146  VTK_LEGACY(void SetCellLayerRight(int));
147  VTK_LEGACY(int GetCellLayerRight());
149 
150 protected:
152  ~vtkNetCDFCAMReader() VTK_OVERRIDE;
153 
154  int RequestInformation(vtkInformation*, vtkInformationVector**,
155  vtkInformationVector*) VTK_OVERRIDE;
156 
157  int RequestData(vtkInformation *, vtkInformationVector **,
158  vtkInformationVector *) VTK_OVERRIDE;
159 
160  int RequestUpdateExtent(vtkInformation *, vtkInformationVector **,
161  vtkInformationVector *) VTK_OVERRIDE;
162 
168  bool GetPartitioning(
169  int piece, int numPieces,int numCellLevels, int numCellsPerLevel,
170  int & beginCellLevel, int & endCellLevel, int & beginCell, int & endCell);
171 
172  void BuildVarArray();
173  static void SelectionCallback(vtkObject* caller, unsigned long eid,
174  void* clientdata, void* calldata);
175 
176 
177 private:
178  vtkNetCDFCAMReader(const vtkNetCDFCAMReader&) VTK_DELETE_FUNCTION;
179  void operator=(const vtkNetCDFCAMReader&) VTK_DELETE_FUNCTION;
180 
182 
186  char* FileName;
187  char* CurrentFileName;
188  vtkSetStringMacro(CurrentFileName);
190 
192 
195  char* ConnectivityFileName;
196  char* CurrentConnectivityFileName;
197  vtkSetStringMacro(CurrentConnectivityFileName);
199 
200  int VerticalDimension;
201  double * TimeSteps;
202  long NumberOfTimeSteps;
203  vtkDataArraySelection* PointDataArraySelection;
204  vtkCallbackCommand* SelectionObserver;
205 
206  int SingleMidpointLayer;
207  int MidpointLayerIndex;
208  int MidpointLayersRange[2];
209 
210  int SingleInterfaceLayer;
211  int InterfaceLayerIndex;
212  int InterfaceLayersRange[2];
213 
214 
216 
220  NcFile* PointsFile;
221  NcFile* ConnectivityFile;
222 };
224 
225 #endif
abstract base class for most VTK objects
Definition: vtkObject.h:53
Store vtkAlgorithm input/output information.
static vtkUnstructuredGridAlgorithm * New()
Read unstructured NetCDF CAM files.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
supports function callbacks
a simple class to control print indentation
Definition: vtkIndent.h:33
Store on/off settings for data arrays for a vtkSource.
vtkGetStringMacro(ExtensionsString)
Returns a string listing all available extensions.
Superclass for algorithms that produce only unstructured grid as output.
vtkSetMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
VerticalDimension
Set whether to read a single layer, midpoint layers or interface layers.
Store zero or more vtkInformation instances.
vtkBooleanMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.