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 =========================================================================*/
31 #ifndef vtkNetCDFCAMReader_h
32 #define vtkNetCDFCAMReader_h
33 
34 #include "vtkIONetCDFModule.h" // For export macro
36 
37 #include "vtk_netcdfcpp_fwd.h" // Forward declarations for vtknetcdfcpp
38 
39 class vtkCallbackCommand;
41 
42 class VTKIONETCDF_EXPORT vtkNetCDFCAMReader : public vtkUnstructuredGridAlgorithm
43 {
44 public:
45  static vtkNetCDFCAMReader *New();
47  void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
48 
55  static int CanReadFile(const char* fileName);
56 
57  void SetFileName(const char* fileName);
58  vtkGetStringMacro(FileName);
59 
60  void SetConnectivityFileName(const char* fileName);
61  vtkGetStringMacro(ConnectivityFileName);
62 
64 
75  VTK_LEGACY(virtual void SingleLevelOn ());
76  VTK_LEGACY(virtual void SingleLevelOff ());
77  VTK_LEGACY(virtual void SetSingleLevel (int level));
78  VTK_LEGACY(virtual int GetSingleLevel ());
80 
82 
95  {
99  VERTICAL_DIMENSION_COUNT
100  };
101  vtkSetClampMacro(VerticalDimension, int, 0, 2);
102  vtkGetMacro(VerticalDimension, int);
104 
106 
112  vtkBooleanMacro(SingleMidpointLayer, int);
113  vtkSetMacro(SingleMidpointLayer, int);
114  vtkGetMacro(SingleMidpointLayer, int);
115  vtkSetMacro(MidpointLayerIndex, int);
116  vtkGetMacro(MidpointLayerIndex, int);
117  vtkGetVector2Macro(MidpointLayersRange, int);
118 
119  vtkBooleanMacro(SingleInterfaceLayer, int);
120  vtkSetMacro(SingleInterfaceLayer, int);
121  vtkGetMacro(SingleInterfaceLayer, int);
122  vtkSetMacro(InterfaceLayerIndex, int);
123  vtkGetMacro(InterfaceLayerIndex, int);
124  vtkGetVector2Macro(InterfaceLayersRange, int);
126 
128 
132  int GetNumberOfPointArrays();
133  const char* GetPointArrayName(int index);
134  int GetPointArrayStatus(const char* name);
135  void SetPointArrayStatus(const char* name, int status);
136  void DisableAllPointArrays();
137  void EnableAllPointArrays();
139 
140 
142 
149  VTK_LEGACY(void SetCellLayerRight(int));
150  VTK_LEGACY(int GetCellLayerRight());
152 
153 protected:
155  ~vtkNetCDFCAMReader() VTK_OVERRIDE;
156 
157  int RequestInformation(vtkInformation*, vtkInformationVector**,
158  vtkInformationVector*) VTK_OVERRIDE;
159 
160  int RequestData(vtkInformation *, vtkInformationVector **,
161  vtkInformationVector *) VTK_OVERRIDE;
162 
163  int RequestUpdateExtent(vtkInformation *, vtkInformationVector **,
164  vtkInformationVector *) VTK_OVERRIDE;
165 
171  bool GetPartitioning(
172  int piece, int numPieces,int numCellLevels, int numCellsPerLevel,
173  int & beginCellLevel, int & endCellLevel, int & beginCell, int & endCell);
174 
175  void BuildVarArray();
176  static void SelectionCallback(vtkObject* caller, unsigned long eid,
177  void* clientdata, void* calldata);
178 
179 
180 private:
181  vtkNetCDFCAMReader(const vtkNetCDFCAMReader&) VTK_DELETE_FUNCTION;
182  void operator=(const vtkNetCDFCAMReader&) VTK_DELETE_FUNCTION;
183 
185 
189  char* FileName;
190  char* CurrentFileName;
191  vtkSetStringMacro(CurrentFileName);
193 
195 
198  char* ConnectivityFileName;
199  char* CurrentConnectivityFileName;
200  vtkSetStringMacro(CurrentConnectivityFileName);
202 
203  int VerticalDimension;
204  double * TimeSteps;
205  long NumberOfTimeSteps;
206  vtkDataArraySelection* PointDataArraySelection;
207  vtkCallbackCommand* SelectionObserver;
208 
209  int SingleMidpointLayer;
210  int MidpointLayerIndex;
211  int MidpointLayersRange[2];
212 
213  int SingleInterfaceLayer;
214  int InterfaceLayerIndex;
215  int InterfaceLayersRange[2];
216 
217 
219 
223  NcFile* PointsFile;
224  NcFile* ConnectivityFile;
225 };
227 
228 #endif
abstract base class for most VTK objects
Definition: vtkObject.h:59
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:39
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.