VTK
/Users/kitware/Dashboards/MyTests/VTK_BLD_Release_docs/Utilities/Doxygen/dox/IO/VPIC/vtkVPICReader.h
Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    vtkVPICReader.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 =========================================================================*/
00031 #ifndef vtkVPICReader_h
00032 #define vtkVPICReader_h
00033 
00034 #include "vtkIOVPICModule.h" // For export macro
00035 #include "vtkImageAlgorithm.h"
00036 
00037 
00038 class vtkCallbackCommand;
00039 class vtkDataArraySelection;
00040 class vtkFloatArray;
00041 class vtkStdString;
00042 class vtkMultiProcessController;
00043 class vtkInformation;
00044 //BTX
00045 class VPICDataSet;
00046 class GridExchange;
00047 //ETX
00048 class VTKIOVPIC_EXPORT vtkVPICReader : public vtkImageAlgorithm
00049 {
00050 public:
00051   static vtkVPICReader *New();
00052   vtkTypeMacro(vtkVPICReader,vtkImageAlgorithm);
00053   void PrintSelf(ostream& os, vtkIndent indent);
00054 
00056 
00057   vtkSetStringMacro(FileName);
00058   vtkGetStringMacro(FileName);
00060 
00062 
00063   vtkSetVector3Macro(Stride, int);
00064   vtkGetVector3Macro(Stride, int);
00066 
00068 
00069   vtkSetVector2Macro(XExtent, int);
00070   vtkSetVector2Macro(YExtent, int);
00071   vtkSetVector2Macro(ZExtent, int);
00073 
00074   // Get the full layout size in files for setting the range in GUI
00075   vtkGetVector2Macro(XLayout, int);
00076   vtkGetVector2Macro(YLayout, int);
00077   vtkGetVector2Macro(ZLayout, int);
00078 
00080 
00081   vtkImageData *GetOutput();
00082   vtkImageData *GetOutput(int index);
00084 
00086 
00089   int GetNumberOfPointArrays();
00090   const char* GetPointArrayName(int index);
00091   int GetPointArrayStatus(const char* name);
00092   void SetPointArrayStatus(const char* name, int status);
00093   void DisableAllPointArrays();
00094   void EnableAllPointArrays();
00096 
00097 protected:
00098   vtkVPICReader();
00099   ~vtkVPICReader();
00100 
00101   char *FileName;                       // First field part file giving path
00102 
00103   int Rank;                             // Number of this processor
00104   int TotalRank;                        // Number of processors
00105   int UsedRank;                         // Number of processors used in display
00106 
00107   VPICDataSet* vpicData;                // Data structure controlling access
00108   GridExchange* exchanger;    // Exchange ghost cells between procs
00109 
00110   vtkIdType NumberOfNodes;              // Number of points in grid
00111   vtkIdType NumberOfCells;              // Number of cells in grid
00112   vtkIdType NumberOfTuples;             // Number of tuples in sub extent
00113 
00114   int WholeExtent[6];                   // Problem image extent
00115   int SubExtent[6];                     // Processor problem extent
00116   int Dimension[3];                     // Size of image
00117   int SubDimension[3];                  // Size of subextent of image
00118   int XLayout[2];                       // Extent in complete files
00119   int YLayout[2];                       // Extent in complete files
00120   int ZLayout[2];                       // Extent in complete files
00121 
00122   int NumberOfVariables;                // Number of variables to display
00123   vtkStdString* VariableName;           // Names of each variable
00124   int* VariableStruct;                  // Scalar, vector or tensor
00125 
00126   int NumberOfTimeSteps;                // Temporal domain
00127   double* TimeSteps;                    // Times available for request
00128   int CurrentTimeStep;                  // Time currently displayed
00129 
00130   int Stride[3];                        // Stride over actual data
00131   int XExtent[2];                       // Subview extent in files
00132   int YExtent[2];                       // Subview extent in files
00133   int ZExtent[2];                       // Subview extent in files
00134 
00135   vtkFloatArray** data;                 // Actual data arrays
00136   int* dataLoaded;                      // Data is loaded for current time
00137 
00138   int Start[3];                         // Start offset for processor w ghosts
00139   int GhostDimension[3];                // Dimension including ghosts on proc
00140   int NumberOfGhostTuples;              // Total ghost cells per component
00141   int ghostLevel0;                      // Left plane number of ghosts
00142   int ghostLevel1;                      // Right plane number of ghosts
00143 
00144   // Controls initializing and querrying MPI
00145   vtkMultiProcessController * MPIController;
00146 
00147   // Selected field of interest
00148   vtkDataArraySelection* PointDataArraySelection;
00149 
00150   // Observer to modify this object when array selections are modified
00151   vtkCallbackCommand* SelectionObserver;
00152 
00153   int RequestData(vtkInformation *, vtkInformationVector **,
00154                   vtkInformationVector *);
00155   int RequestInformation(vtkInformation *, vtkInformationVector **inVector,
00156                          vtkInformationVector *);
00157 
00158   void LoadVariableData(int var, int timeStep);
00159   void LoadComponent(
00160         float* varData,
00161         float* block,
00162         int comp,
00163         int numberOfComponents);
00164 
00165   static void SelectionCallback(vtkObject* caller, unsigned long eid,
00166                                 void* clientdata, void* calldata);
00167   static void EventCallback(vtkObject* caller, unsigned long eid,
00168                                 void* clientdata, void* calldata);
00169 
00170 
00171 private:
00172   vtkVPICReader(const vtkVPICReader&);  // Not implemented.
00173   void operator=(const vtkVPICReader&); // Not implemented.
00174 };
00175 
00176 #endif