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 
45 {
46 public:
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 
66  virtual const char *GetVariableArrayName(int idx);
67  virtual int GetVariableArrayStatus(const char *name);
68  virtual void SetVariableArrayStatus(const char *name, int status);
70 
74 
75  // Set/Get the vtkMultiProcessController which will handle communications
76  // for the parallel rendering.
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();
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
vtkPNetCDFPOPReader::NCDFFD
int NCDFFD
Definition: vtkPNetCDFPOPReader.h:110
vtkGetObjectMacro
#define vtkGetObjectMacro(name, type)
Definition: vtkSetGet.h:232
vtkSetVector3Macro
#define vtkSetVector3Macro(name, type)
Definition: vtkSetGet.h:287
vtkRectilinearGridAlgorithm
Superclass for algorithms that produce only rectilinear grid as output.
Definition: vtkRectilinearGridAlgorithm.h:43
vtkInformationVector
Store zero or more vtkInformation instances.
Definition: vtkInformationVector.h:41
vtkPNetCDFPOPReader::SetVariableArrayStatus
virtual void SetVariableArrayStatus(const char *name, int status)
vtkPNetCDFPOPReader::FileName
char * FileName
Definition: vtkPNetCDFPOPReader.h:108
vtkPNetCDFPOPReader::SelectionObserver
vtkCallbackCommand * SelectionObserver
Definition: vtkPNetCDFPOPReader.h:106
vtkTypeMacro
#define vtkTypeMacro(thisClass, superclass)
Definition: vtkSetGet.h:642
vtkObject
abstract base class for most VTK objects
Definition: vtkObject.h:62
vtkPNetCDFPOPReader
read NetCDF files in parallel with MPI .Author Ross Miller 03.14.2011
Definition: vtkPNetCDFPOPReader.h:45
vtkPNetCDFPOPReader::~vtkPNetCDFPOPReader
~vtkPNetCDFPOPReader()
vtkPNetCDFPOPReader::IsFirstReaderRank
bool IsFirstReaderRank()
vtkPNetCDFPOPReader::SetController
void SetController(vtkMPIController *controller)
VTKIOPARALLELNETCDF_EXPORT
#define VTKIOPARALLELNETCDF_EXPORT
Definition: vtkIOParallelNetCDFModule.h:15
vtkPNetCDFPOPReader::RequestData
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
vtkPNetCDFPOPReader::SetReaderRanks
void SetReaderRanks(vtkIdList *)
vtkDataArraySelection
Store on/off settings for data arrays for a vtkSource.
Definition: vtkDataArraySelection.h:34
vtkPNetCDFPOPReader::Controller
vtkMPIController * Controller
Definition: vtkPNetCDFPOPReader.h:116
vtkgl::depth
GLint GLint GLsizei GLsizei GLsizei depth
Definition: vtkgl.h:11316
vtkgl::name
GLuint const GLchar * name
Definition: vtkgl.h:11983
vtkGetVector3Macro
#define vtkGetVector3Macro(name, type)
Definition: vtkSetGet.h:304
vtkPNetCDFPOPReader::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent)
vtkPNetCDFPOPReader::ReaderForDepth
int ReaderForDepth(unsigned depth)
vtkIOParallelNetCDFModule.h
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:39
vtkSetStringMacro
#define vtkSetStringMacro(name)
Definition: vtkSetGet.h:104
vtkIdList
list of point or cell ids
Definition: vtkIdList.h:36
vtkGetStringMacro
vtkGetStringMacro(ExtensionsString)
vtkPNetCDFPOPReader::SelectionModifiedCallback
static void SelectionModifiedCallback(vtkObject *caller, unsigned long eid, void *clientdata, void *calldata)
vtkPNetCDFPOPReader::IsReaderRank
bool IsReaderRank()
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:86
vtkRectilinearGridAlgorithm.h
vtkPNetCDFPOPReader::GetVariableArrayStatus
virtual int GetVariableArrayStatus(const char *name)
vtkPNetCDFPOPReader::EventCallback
static void EventCallback(vtkObject *caller, unsigned long eid, void *clientdata, void *calldata)
vtkCallbackCommand
supports function callbacks
Definition: vtkCallbackCommand.h:50
vtkPNetCDFPOPReader::GetVariableArrayName
virtual const char * GetVariableArrayName(int idx)
vtkPNetCDFPOPReader::vtkPNetCDFPOPReader
vtkPNetCDFPOPReader()
vtkMPIController
Process communication using MPI.
Definition: vtkMPIController.h:61
vtkPNetCDFPOPReader::New
static vtkPNetCDFPOPReader * New()
vtkPNetCDFPOPReader::ReadAndSend
int ReadAndSend(vtkInformation *outInfo, int varID)
vtkPNetCDFPOPReader::RequestInformation
virtual int RequestInformation(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
vtkPNetCDFPOPReader::GetNumberOfVariableArrays
virtual int GetNumberOfVariableArrays()
vtkPNetCDFPOPReader::OpenedFileName
char * OpenedFileName
Definition: vtkPNetCDFPOPReader.h:109