VTK
vtkPNetCDFPOPReader.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtPkNetCDFPOPReader.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 =========================================================================*/
33 #ifndef vtkPNetCDFPOPReader_h
34 #define vtkPNetCDFPOPReader_h
35 
36 #include "vtkIOParallelNetCDFModule.h" // For export macro
38 
40 class vtkCallbackCommand;
41 class vtkMPIController;
42 class vtkPNetCDFPOPReaderInternal;
43 
44 class VTKIOPARALLELNETCDF_EXPORT vtkPNetCDFPOPReader : public vtkRectilinearGridAlgorithm
45 {
46 public:
48  static vtkPNetCDFPOPReader *New();
49  void PrintSelf(ostream& os, vtkIndent indent);
50 
52 
53  vtkSetStringMacro(FileName);
54  vtkGetStringMacro(FileName);
56 
58 
59  vtkSetVector3Macro(Stride, int);
60  vtkGetVector3Macro(Stride, int);
62 
64 
65  virtual int GetNumberOfVariableArrays();
66  virtual const char *GetVariableArrayName(int idx);
67  virtual int GetVariableArrayStatus(const char *name);
68  virtual void SetVariableArrayStatus(const char *name, int status);
70 
73  void SetReaderRanks(vtkIdList*);
74 
75  // Set/Get the vtkMultiProcessController which will handle communications
76  // for the parallel rendering.
77  vtkGetObjectMacro(Controller, vtkMPIController);
78  void SetController(vtkMPIController *controller);
79 
80 protected:
83 
86  virtual int RequestInformation(vtkInformation* request,
87  vtkInformationVector** inputVector,
88  vtkInformationVector* outputVector);
89 
90  // Helper function for RequestData: Reads part of the netCDF
91  // file and sends sub-arrays to all ranks that need that data
92  int ReadAndSend( vtkInformation* outInfo, int varID);
93 
94  // Returns the MPI rank of the process that should read the specified depth
95  int ReaderForDepth( unsigned depth);
96 
97  bool IsReaderRank();
98  bool IsFirstReaderRank();
99 
100  static void SelectionModifiedCallback(vtkObject *caller, unsigned long eid,
101  void *clientdata, void *calldata);
102 
103  static void EventCallback(vtkObject* caller, unsigned long eid,
104  void* clientdata, void* calldata);
105 
107 
108  char *FileName;
110  vtkSetStringMacro(OpenedFileName);
111 
112  int NCDFFD; //netcdf file descriptor
113 
114  int Stride[3];
115 
117 
118 private:
119  vtkPNetCDFPOPReader(const vtkPNetCDFPOPReader&); // Not implemented.
120  void operator=(const vtkPNetCDFPOPReader&); // Not implemented.
121 
122  vtkPNetCDFPOPReaderInternal* Internals;
123 };
124 #endif
Superclass for algorithms that produce only rectilinear grid as output.
abstract base class for most VTK objects
Definition: vtkObject.h:61
Store vtkAlgorithm input/output information.
static vtkRectilinearGridAlgorithm * New()
virtual int RequestInformation(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
read NetCDF files in parallel with MPI .Author Ross Miller 03.14.2011
supports function callbacks
a simple class to control print indentation
Definition: vtkIndent.h:38
virtual int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
list of point or cell ids
Definition: vtkIdList.h:35
Store on/off settings for data arrays for a vtkSource.
Process communication using MPI.
vtkMPIController * Controller
vtkCallbackCommand * SelectionObserver
Store zero or more vtkInformation instances.
void PrintSelf(ostream &os, vtkIndent indent)