vtkUnstructuredPOPReader.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Kitware Inc.
2 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
3 // SPDX-License-Identifier: BSD-3-Clause
24 #ifndef vtkUnstructuredPOPReader_h
25 #define vtkUnstructuredPOPReader_h
26 
27 #include "vtkPVVTKExtensionsIOGeneralModule.h" //needed for exports
29 
30 #include <cstddef> // for ptrdiff_t
31 
32 class vtkCallbackCommand;
34 class vtkIdList;
35 class vtkUnstructuredPOPReaderInternal;
36 class VTKPointIterator;
37 
40 {
41 public:
43  static vtkUnstructuredPOPReader* New();
44  void PrintSelf(ostream& os, vtkIndent indent) override;
45 
47 
50  vtkSetStringMacro(FileName);
51  vtkGetStringMacro(FileName);
53 
55 
60  vtkSetVector3Macro(Stride, int);
61  vtkGetVector3Macro(Stride, int);
63 
65 
70  vtkSetVector6Macro(VOI, int);
71  vtkGetVector6Macro(VOI, int);
73 
75 
78  virtual int GetNumberOfVariableArrays();
79  virtual const char* GetVariableArrayName(int idx);
80  virtual int GetVariableArrayStatus(const char* name);
81  virtual void SetVariableArrayStatus(const char* name, int status);
83 
85 
89  vtkSetMacro(Radius, double);
90  vtkGetMacro(Radius, double);
92 
94 
99  vtkGetMacro(VectorGrid, int);
101 
103 
108  vtkSetMacro(VerticalVelocity, bool);
109  vtkGetMacro(VerticalVelocity, bool);
111 
112 protected:
114  ~vtkUnstructuredPOPReader() override;
115 
117 
118  static void SelectionModifiedCallback(
119  vtkObject* caller, unsigned long eid, void* clientdata, void* calldata);
120 
121  static void EventCallback(vtkObject* caller, unsigned long eid, void* clientdata, void* calldata);
122 
124 
128  char* FileName;
129 
131 
135  vtkSetStringMacro(OpenedFileName);
137 
138  int Stride[3];
139 
143  int NCDFFD;
144 
149  double Radius;
150 
151  int VOI[6];
152 
154 
165 
172 
180 
186  bool Transform(vtkUnstructuredGrid* grid, size_t* start, size_t* count, int* wholeExtent,
187  int* subExtent, int numberOfGhostLevels, int wrapped, int piece, int numberOfPieces);
188 
193  int ProcessGrid(
194  vtkUnstructuredGrid* grid, int piece, int numberOfPieces, int numberOfGhostLevels);
195 
201  bool ReadMetaData(int wholeExtent[6]);
202 
203  int RequestInformation(vtkInformation* request, vtkInformationVector** inputVector,
204  vtkInformationVector* outputVector) override;
205 
211  void LoadPointData(vtkUnstructuredGrid* grid, int netCDFFD, int varidp, size_t* start,
212  size_t* count, ptrdiff_t* rStride, const char* arrayName);
213 
218  void ComputeVerticalVelocity(vtkUnstructuredGrid* grid, int* wholeExtent, int* subExtent,
219  int numberOfGhostLevels, int latlonFileId);
220 
226  void CommunicateParallelVerticalVelocity(int* wholeExtent, int* subExtent,
227  int numberOfGhostLevels, VTKPointIterator& pointIterator, double* w);
228 
237  int GetPointOwnerPiece(int iIndex, int jIndex, int kKindex, int numberOfPieces,
238  int numberOfGhostLevels, int* wholeExtent);
239 
247  void GetPiecesNeedingPoint(int iIndex, int jIndex, int kKindex, int numberOfPieces,
248  int numberOfGhostLevels, int* wholeExtent, vtkIdList* pieceIds);
249 
254  bool GetExtentInformation(
255  int piece, int numberOfPieces, int numberOfGhostLevels, int* wholeExtent, int* subExtent);
256 
263  bool BuildGhostInformation(vtkUnstructuredGrid* grid, int numberOfGhostLevels, int* wholeExtent,
264  int* subExtent, int wrapped, int piece, int numberOfPieces);
265 
266 private:
268  void operator=(const vtkUnstructuredPOPReader&) = delete;
269 
270  vtkUnstructuredPOPReaderInternal* Internals;
271 };
272 #endif
virtual int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
bool SubsettingXMax
State variables so that we know whether or not we are only reading in part of the grid...
bool SubsettingXMin
State variables so that we know whether or not we are only reading in part of the grid...
vtkCallbackCommand * SelectionObserver
char * FileName
The name of the file to be opened.
static vtkUnstructuredGridAlgorithm * New()
char * OpenedFileName
If a file is opened, the file name of the opened file.
virtual int RequestInformation(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
Transform
void PrintSelf(ostream &os, vtkIndent indent) VTK_OVERRIDE
double Radius
The radius of the sphere to be outputted in meters.
bool VerticalVelocity
If it is a vector grid (i.e.
int NCDFFD
The NetCDF file descriptor.
#define VTKPVVTKEXTENSIONSIOGENERAL_EXPORT
int VectorGrid
Specify whether the grid points are at the vector field (U_LAT and U_LON) locations or the scalar fie...
bool ReducedHeightResolution
State variables so that we know whether or not we are only reading in part of the grid...
void operator=(const vtkObjectBase &)