vtkUnstructuredPOPReader.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkUnstructuredPOPReader.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 =========================================================================*/
35 #ifndef vtkUnstructuredPOPReader_h
36 #define vtkUnstructuredPOPReader_h
37 
38 #include "vtkPVVTKExtensionsIOGeneralModule.h" //needed for exports
40 
41 #include <cstddef> // for ptrdiff_t
42 
43 class vtkCallbackCommand;
45 class vtkIdList;
46 class vtkUnstructuredPOPReaderInternal;
47 class VTKPointIterator;
48 
51 {
52 public:
54  static vtkUnstructuredPOPReader* New();
55  void PrintSelf(ostream& os, vtkIndent indent) override;
56 
58 
61  vtkSetStringMacro(FileName);
62  vtkGetStringMacro(FileName);
64 
66 
71  vtkSetVector3Macro(Stride, int);
72  vtkGetVector3Macro(Stride, int);
74 
76 
81  vtkSetVector6Macro(VOI, int);
82  vtkGetVector6Macro(VOI, int);
84 
86 
89  virtual int GetNumberOfVariableArrays();
90  virtual const char* GetVariableArrayName(int idx);
91  virtual int GetVariableArrayStatus(const char* name);
92  virtual void SetVariableArrayStatus(const char* name, int status);
94 
96 
100  vtkSetMacro(Radius, double);
101  vtkGetMacro(Radius, double);
103 
105 
110  vtkGetMacro(VectorGrid, int);
112 
114 
119  vtkSetMacro(VerticalVelocity, bool);
120  vtkGetMacro(VerticalVelocity, bool);
122 
123 protected:
125  ~vtkUnstructuredPOPReader() override;
126 
128 
129  static void SelectionModifiedCallback(
130  vtkObject* caller, unsigned long eid, void* clientdata, void* calldata);
131 
132  static void EventCallback(vtkObject* caller, unsigned long eid, void* clientdata, void* calldata);
133 
135 
139  char* FileName;
140 
142 
146  vtkSetStringMacro(OpenedFileName);
148 
149  int Stride[3];
150 
154  int NCDFFD;
155 
160  double Radius;
161 
162  int VOI[6];
163 
165 
176 
183 
191 
197  bool Transform(vtkUnstructuredGrid* grid, size_t* start, size_t* count, int* wholeExtent,
198  int* subExtent, int numberOfGhostLevels, int wrapped, int piece, int numberOfPieces);
199 
204  int ProcessGrid(
205  vtkUnstructuredGrid* grid, int piece, int numberOfPieces, int numberOfGhostLevels);
206 
212  bool ReadMetaData(int wholeExtent[6]);
213 
214  int RequestInformation(vtkInformation* request, vtkInformationVector** inputVector,
215  vtkInformationVector* outputVector) override;
216 
222  void LoadPointData(vtkUnstructuredGrid* grid, int netCDFFD, int varidp, size_t* start,
223  size_t* count, ptrdiff_t* rStride, const char* arrayName);
224 
229  void ComputeVerticalVelocity(vtkUnstructuredGrid* grid, int* wholeExtent, int* subExtent,
230  int numberOfGhostLevels, int latlonFileId);
231 
237  void CommunicateParallelVerticalVelocity(int* wholeExtent, int* subExtent,
238  int numberOfGhostLevels, VTKPointIterator& pointIterator, double* w);
239 
248  int GetPointOwnerPiece(int iIndex, int jIndex, int kKindex, int numberOfPieces,
249  int numberOfGhostLevels, int* wholeExtent);
250 
258  void GetPiecesNeedingPoint(int iIndex, int jIndex, int kKindex, int numberOfPieces,
259  int numberOfGhostLevels, int* wholeExtent, vtkIdList* pieceIds);
260 
265  bool GetExtentInformation(
266  int piece, int numberOfPieces, int numberOfGhostLevels, int* wholeExtent, int* subExtent);
267 
274  bool BuildGhostInformation(vtkUnstructuredGrid* grid, int numberOfGhostLevels, int* wholeExtent,
275  int* subExtent, int wrapped, int piece, int numberOfPieces);
276 
277 private:
279  void operator=(const vtkUnstructuredPOPReader&) = delete;
280 
281  vtkUnstructuredPOPReaderInternal* Internals;
282 };
283 #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 &)