VTK
dox/Parallel/vtkPNetCDFPOPReader.h
Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    vtPkNetCDFPOPReader.h
00005 
00006   Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
00007   All rights reserved.
00008   See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
00009 
00010      This software is distributed WITHOUT ANY WARRANTY; without even
00011      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
00012      PURPOSE.  See the above copyright notice for more information.
00013 
00014 =========================================================================*/
00030 #ifndef __vtkPNetCDFPOPReader_h
00031 #define __vtkPNetCDFPOPReader_h
00032 
00033 #include "vtkRectilinearGridAlgorithm.h"
00034 
00035 class vtkDataArraySelection;
00036 class vtkCallbackCommand;
00037 class vtkMPIController;
00038 class vtkPNetCDFPOPReaderInternal;
00039 
00040 class VTK_PARALLEL_EXPORT vtkPNetCDFPOPReader : public vtkRectilinearGridAlgorithm
00041 {
00042 public:
00043   vtkTypeMacro(vtkPNetCDFPOPReader,vtkRectilinearGridAlgorithm);
00044   static vtkPNetCDFPOPReader *New();
00045   void PrintSelf(ostream& os, vtkIndent indent);
00046 
00048 
00049   vtkSetStringMacro(FileName);
00050   vtkGetStringMacro(FileName);
00052 
00054 
00055   vtkSetVector3Macro(Stride, int);
00056   vtkGetVector3Macro(Stride, int);
00058 
00060 
00061   virtual int GetNumberOfVariableArrays();
00062   virtual const char *GetVariableArrayName(int idx);
00063   virtual int GetVariableArrayStatus(const char *name);
00064   virtual void SetVariableArrayStatus(const char *name, int status);
00066 
00068 
00070   vtkGetObjectMacro(Controller, vtkMPIController);
00071   void SetController(vtkMPIController *controller);
00073 
00075   void SetReaderRanks(vtkIdList*);
00076 
00084   void SetNumberOfReaderProcesses(int number);
00085 
00086 protected:
00087   vtkPNetCDFPOPReader();
00088   ~vtkPNetCDFPOPReader();
00089 
00090   int RequestData(vtkInformation*,vtkInformationVector**,
00091                   vtkInformationVector*);
00092   virtual int RequestInformation(vtkInformation* request,
00093                                  vtkInformationVector** inputVector,
00094                                  vtkInformationVector* outputVector);
00095 
00099   void AssignRoundRobin(int numReaders, vtkIdList* readerRanks);
00100 
00101   // Functions added by RGM....
00102 
00105   int ReadAndSend( vtkInformation* outInfo, int varID);
00106 
00109   int ReaderForDepth( unsigned depth);
00110 
00111   bool IsReaderRank();
00112   bool IsFirstReaderRank();
00113 
00114   // end of functions added by RGM...
00115 
00116   static void SelectionModifiedCallback(vtkObject *caller, unsigned long eid,
00117                                         void *clientdata, void *calldata);
00118 
00119   static void EventCallback(vtkObject* caller, unsigned long eid,
00120                             void* clientdata, void* calldata);
00121 
00122   vtkCallbackCommand* SelectionObserver;
00123 
00124   char *FileName;
00125   char *OpenedFileName;
00126   vtkSetStringMacro(OpenedFileName);
00127 
00128   int NCDFFD; //netcdf file descriptor
00129 
00130   int Stride[3];
00131 
00132   vtkMPIController *Controller;
00133 
00134 private:
00135   vtkPNetCDFPOPReader(const vtkPNetCDFPOPReader&);  // Not implemented.
00136   void operator=(const vtkPNetCDFPOPReader&);  // Not implemented.
00137 
00138   vtkPNetCDFPOPReaderInternal* Internals;
00139 };
00140 #endif