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) 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 
77  {
81  VERTICAL_DIMENSION_COUNT
82  };
83  vtkSetClampMacro(VerticalDimension, int, 0, 2);
84  vtkGetMacro(VerticalDimension, int);
86 
88 
94  vtkBooleanMacro(SingleMidpointLayer, vtkTypeBool);
95  vtkSetMacro(SingleMidpointLayer, vtkTypeBool);
96  vtkGetMacro(SingleMidpointLayer, vtkTypeBool);
97  vtkSetMacro(MidpointLayerIndex, int);
98  vtkGetMacro(MidpointLayerIndex, int);
99  vtkGetVector2Macro(MidpointLayersRange, int);
100 
101  vtkBooleanMacro(SingleInterfaceLayer, vtkTypeBool);
102  vtkSetMacro(SingleInterfaceLayer, vtkTypeBool);
103  vtkGetMacro(SingleInterfaceLayer, vtkTypeBool);
104  vtkSetMacro(InterfaceLayerIndex, int);
105  vtkGetMacro(InterfaceLayerIndex, int);
106  vtkGetVector2Macro(InterfaceLayersRange, int);
108 
110 
114  int GetNumberOfPointArrays();
115  const char* GetPointArrayName(int index);
116  int GetPointArrayStatus(const char* name);
117  void SetPointArrayStatus(const char* name, int status);
118  void DisableAllPointArrays();
119  void EnableAllPointArrays();
121 
122 protected:
124  ~vtkNetCDFCAMReader() override;
125 
127  vtkInformationVector*) override;
128 
130  vtkInformationVector *) override;
131 
133  vtkInformationVector *) override;
134 
140  bool GetPartitioning(
141  int piece, int numPieces,int numCellLevels, int numCellsPerLevel,
142  int & beginCellLevel, int & endCellLevel, int & beginCell, int & endCell);
143 
144  void BuildVarArray();
145  static void SelectionCallback(vtkObject* caller, unsigned long eid,
146  void* clientdata, void* calldata);
147 
148 
149 private:
150  vtkNetCDFCAMReader(const vtkNetCDFCAMReader&) = delete;
151  void operator=(const vtkNetCDFCAMReader&) = delete;
152 
154 
158  char* FileName;
159  char* CurrentFileName;
160  vtkSetStringMacro(CurrentFileName);
162 
164 
167  char* ConnectivityFileName;
168  char* CurrentConnectivityFileName;
169  vtkSetStringMacro(CurrentConnectivityFileName);
171 
172  int VerticalDimension;
173  double * TimeSteps;
174  long NumberOfTimeSteps;
175  vtkDataArraySelection* PointDataArraySelection;
176  vtkCallbackCommand* SelectionObserver;
177 
178  vtkTypeBool SingleMidpointLayer;
179  int MidpointLayerIndex;
180  int MidpointLayersRange[2];
181 
182  vtkTypeBool SingleInterfaceLayer;
183  int InterfaceLayerIndex;
184  int InterfaceLayersRange[2];
185 
186 
188 
192  NcFile* PointsFile;
193  NcFile* ConnectivityFile;
194 };
196 
197 #endif
virtual int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
This is called by the superclass.
abstract base class for most VTK objects
Definition: vtkObject.h:59
Store vtkAlgorithm input/output information.
static vtkUnstructuredGridAlgorithm * New()
virtual int RequestInformation(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
Read unstructured NetCDF CAM files.
int vtkTypeBool
Definition: vtkABI.h:69
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.
Superclass for algorithms that produce only unstructured grid as output.
VerticalDimension
Set whether to read a single layer, midpoint layers or interface layers.
Store zero or more vtkInformation instances.
virtual int RequestUpdateExtent(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
This is called by the superclass.