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 =========================================================================*/
30 #ifndef __vtkPNetCDFPOPReader_h
31 #define __vtkPNetCDFPOPReader_h
32 
33 #include "vtkIOParallelNetCDFModule.h" // For export macro
35 
37 class vtkCallbackCommand;
38 class vtkMPIController;
39 class vtkPNetCDFPOPReaderInternal;
40 
41 class VTKIOPARALLELNETCDF_EXPORT vtkPNetCDFPOPReader : public vtkRectilinearGridAlgorithm
42 {
43 public:
45  static vtkPNetCDFPOPReader *New();
46  void PrintSelf(ostream& os, vtkIndent indent);
47 
49 
50  vtkSetStringMacro(FileName);
51  vtkGetStringMacro(FileName);
53 
55 
56  vtkSetVector3Macro(Stride, int);
57  vtkGetVector3Macro(Stride, int);
59 
61 
62  virtual int GetNumberOfVariableArrays();
63  virtual const char *GetVariableArrayName(int idx);
64  virtual int GetVariableArrayStatus(const char *name);
65  virtual void SetVariableArrayStatus(const char *name, int status);
67 
69 
71  vtkGetObjectMacro(Controller, vtkMPIController);
72  void SetController(vtkMPIController *controller);
74 
76  void SetReaderRanks(vtkIdList*);
77 
85  void SetNumberOfReaderProcesses(int number);
86 
87 protected:
90 
93  virtual int RequestInformation(vtkInformation* request,
94  vtkInformationVector** inputVector,
95  vtkInformationVector* outputVector);
96 
100  void AssignRoundRobin(int numReaders, vtkIdList* readerRanks);
101 
102  // Functions added by RGM....
103 
106  int ReadAndSend( vtkInformation* outInfo, int varID);
107 
110  int ReaderForDepth( unsigned depth);
111 
112  bool IsReaderRank();
113  bool IsFirstReaderRank();
114 
115  // end of functions added by RGM...
116 
117  static void SelectionModifiedCallback(vtkObject *caller, unsigned long eid,
118  void *clientdata, void *calldata);
119 
120  static void EventCallback(vtkObject* caller, unsigned long eid,
121  void* clientdata, void* calldata);
122 
124 
125  char *FileName;
127  vtkSetStringMacro(OpenedFileName);
128 
129  int NCDFFD; //netcdf file descriptor
130 
131  int Stride[3];
132 
134 
135 private:
136  vtkPNetCDFPOPReader(const vtkPNetCDFPOPReader&); // Not implemented.
137  void operator=(const vtkPNetCDFPOPReader&); // Not implemented.
138 
139  vtkPNetCDFPOPReaderInternal* Internals;
140 };
141 #endif