VTK  9.3.1
vtkNetCDFCAMReader.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-License-Identifier: BSD-3-Clause
19 #ifndef vtkNetCDFCAMReader_h
20 #define vtkNetCDFCAMReader_h
21 
22 #include "vtkIONetCDFModule.h" // For export macro
24 
25 VTK_ABI_NAMESPACE_BEGIN
26 class vtkCallbackCommand;
28 
29 class VTKIONETCDF_EXPORT vtkNetCDFCAMReader : public vtkUnstructuredGridAlgorithm
30 {
31 public:
32  static vtkNetCDFCAMReader* New();
34  void PrintSelf(ostream& os, vtkIndent indent) override;
35 
42  static int CanReadFile(VTK_FILEPATH const char* fileName);
43 
44  void SetFileName(VTK_FILEPATH const char* fileName);
45  vtkGetFilePathMacro(FileName);
46 
47  void SetConnectivityFileName(VTK_FILEPATH const char* fileName);
48  vtkGetFilePathMacro(ConnectivityFileName);
49 
51 
64  {
68  VERTICAL_DIMENSION_COUNT
69  };
70  vtkSetClampMacro(VerticalDimension, int, 0, 2);
71  vtkGetMacro(VerticalDimension, int);
73 
75 
81  vtkBooleanMacro(SingleMidpointLayer, vtkTypeBool);
82  vtkSetMacro(SingleMidpointLayer, vtkTypeBool);
83  vtkGetMacro(SingleMidpointLayer, vtkTypeBool);
84  vtkSetMacro(MidpointLayerIndex, int);
85  vtkGetMacro(MidpointLayerIndex, int);
86  vtkGetVector2Macro(MidpointLayersRange, int);
87 
88  vtkBooleanMacro(SingleInterfaceLayer, vtkTypeBool);
89  vtkSetMacro(SingleInterfaceLayer, vtkTypeBool);
90  vtkGetMacro(SingleInterfaceLayer, vtkTypeBool);
91  vtkSetMacro(InterfaceLayerIndex, int);
92  vtkGetMacro(InterfaceLayerIndex, int);
93  vtkGetVector2Macro(InterfaceLayersRange, int);
95 
97 
101  int GetNumberOfPointArrays();
102  const char* GetPointArrayName(int index);
103  int GetPointArrayStatus(const char* name);
104  void SetPointArrayStatus(const char* name, int status);
105  void DisableAllPointArrays();
106  void EnableAllPointArrays();
108 
109 protected:
111  ~vtkNetCDFCAMReader() override;
112 
114 
116 
118 
124  bool GetPartitioning(size_t piece, size_t numPieces, size_t numCellLevels,
125  size_t numCellsPerLevel, size_t& beginCellLevel, size_t& endCellLevel, size_t& beginCell,
126  size_t& endCell);
127 
128  void BuildVarArray();
129  static void SelectionCallback(
130  vtkObject* caller, unsigned long eid, void* clientdata, void* calldata);
131 
132 private:
133  vtkNetCDFCAMReader(const vtkNetCDFCAMReader&) = delete;
134  void operator=(const vtkNetCDFCAMReader&) = delete;
135 
137 
141  char* FileName;
142  char* CurrentFileName;
143  vtkSetStringMacro(CurrentFileName);
145 
147 
150  char* ConnectivityFileName;
151  char* CurrentConnectivityFileName;
152  vtkSetStringMacro(CurrentConnectivityFileName);
154 
155  int VerticalDimension;
156  double* TimeSteps;
157  size_t NumberOfTimeSteps;
158  vtkDataArraySelection* PointDataArraySelection;
159  vtkCallbackCommand* SelectionObserver;
160 
161  vtkTypeBool SingleMidpointLayer;
162  int MidpointLayerIndex;
163  int MidpointLayersRange[2];
164 
165  vtkTypeBool SingleInterfaceLayer;
166  int InterfaceLayerIndex;
167  int InterfaceLayersRange[2];
168 
169  class Internal;
170  Internal* Internals;
171 };
172 
173 VTK_ABI_NAMESPACE_END
174 #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:51
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:64
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:28
Store on/off settings for data arrays, etc.
Superclass for algorithms that produce only unstructured grid as output.
VerticalDimension
Set whether to read a single layer, midpoint layers or interface layers.
#define VTK_FILEPATH
Store zero or more vtkInformation instances.
virtual int RequestUpdateExtent(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
This is called by the superclass.