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 
38 class VTKPVVTKEXTENSIONSIOGENERAL_EXPORT vtkUnstructuredPOPReader
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
vtkUnstructuredPOPReader::OpenedFileName
char * OpenedFileName
If a file is opened, the file name of the opened file.
Definition: vtkUnstructuredPOPReader.h:134
vtkObjectBase::operator=
void operator=(const vtkObjectBase &)
vtkUnstructuredPOPReader
read NetCDF files
Definition: vtkUnstructuredPOPReader.h:38
vtkInformationVector
vtkObject
vtkUnstructuredPOPReader::VerticalVelocity
bool VerticalVelocity
If it is a vector grid (i.e.
Definition: vtkUnstructuredPOPReader.h:179
vtkUnstructuredPOPReader::SubsettingXMin
bool SubsettingXMin
State variables so that we know whether or not we are only reading in part of the grid.
Definition: vtkUnstructuredPOPReader.h:161
vtkUnstructuredPOPReader::NCDFFD
int NCDFFD
The NetCDF file descriptor.
Definition: vtkUnstructuredPOPReader.h:143
Transform
Transform
vtkDataArraySelection
vtkUnstructuredGridAlgorithm::RequestInformation
virtual int RequestInformation(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
vtkUnstructuredPOPReader::SubsettingXMax
bool SubsettingXMax
State variables so that we know whether or not we are only reading in part of the grid.
Definition: vtkUnstructuredPOPReader.h:162
vtkUnstructuredGridAlgorithm::RequestData
virtual int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
vtkIndent
vtkIdList
vtkUnstructuredGridAlgorithm::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) VTK_OVERRIDE
vtkUnstructuredPOPReader::FileName
char * FileName
The name of the file to be opened.
Definition: vtkUnstructuredPOPReader.h:128
vtkUnstructuredPOPReader::VectorGrid
int VectorGrid
Specify whether the grid points are at the vector field (U_LAT and U_LON) locations or the scalar fie...
Definition: vtkUnstructuredPOPReader.h:171
vtkUnstructuredPOPReader::SelectionObserver
vtkCallbackCommand * SelectionObserver
Definition: vtkUnstructuredPOPReader.h:123
vtkInformation
vtkUnstructuredGridAlgorithm::New
static vtkUnstructuredGridAlgorithm * New()
vtkCallbackCommand
vtkUnstructuredGridAlgorithm.h
vtkUnstructuredGridAlgorithm
vtkUnstructuredGrid
vtkUnstructuredPOPReader::Radius
double Radius
The radius of the sphere to be outputted in meters.
Definition: vtkUnstructuredPOPReader.h:149
vtkUnstructuredPOPReader::ReducedHeightResolution
bool ReducedHeightResolution
State variables so that we know whether or not we are only reading in part of the grid.
Definition: vtkUnstructuredPOPReader.h:163