Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

Servers/Filters/vtkSpyPlotReader.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    $RCSfile: vtkSpyPlotReader.h,v $
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 =========================================================================*/
00051 #ifndef __vtkSpyPlotReader_h
00052 #define __vtkSpyPlotReader_h
00053 
00054 #include "vtkHierarchicalDataSetAlgorithm.h"
00055 
00056 class vtkDataArraySelection;
00057 class vtkCallbackCommand;
00058 class vtkSpyPlotReaderMap;
00059 class vtkMultiProcessController;
00060 class vtkDataSetAttributes;
00061 class vtkDataArray;
00062 
00063 class VTK_EXPORT vtkSpyPlotReader : public vtkHierarchicalDataSetAlgorithm
00064 {
00065 public:
00066   static vtkSpyPlotReader* New();
00067   vtkTypeRevisionMacro(vtkSpyPlotReader,vtkHierarchicalDataSetAlgorithm);
00068   void PrintSelf(ostream& os, vtkIndent indent);
00069 
00071 
00073   vtkSetStringMacro(FileName);
00074   vtkGetStringMacro(FileName);
00076 
00078 
00080   vtkSetMacro(TimeStep, int);
00081   vtkGetMacro(TimeStep, int);
00083   
00085 
00090   vtkSetMacro(DistributeFiles,int);
00091   vtkGetMacro(DistributeFiles,int);
00092   vtkBooleanMacro(DistributeFiles,int);
00094   
00096 
00098   vtkSetMacro(GenerateLevelArray,int);
00099   vtkGetMacro(GenerateLevelArray,int);
00100   vtkBooleanMacro(GenerateLevelArray,int);
00102   
00104 
00106   vtkSetMacro(GenerateBlockIdArray,int);
00107   vtkGetMacro(GenerateBlockIdArray,int);
00108   vtkBooleanMacro(GenerateBlockIdArray,int);
00110   
00112 
00114   void SetDownConvertVolumeFraction(int vf);
00115   vtkGetMacro(DownConvertVolumeFraction,int);
00116   vtkBooleanMacro(DownConvertVolumeFraction,int);
00118   
00120 
00121   vtkGetVector2Macro(TimeStepRange, int);
00123 
00125 
00127   vtkGetObjectMacro(CellDataArraySelection, vtkDataArraySelection);
00129   
00131 
00132   int GetNumberOfCellArrays();
00133   const char* GetCellArrayName(int idx);
00134   int GetCellArrayStatus(const char *name);
00135   void SetCellArrayStatus(const char *name, int status);  
00137 
00139   void SetController(vtkMultiProcessController* controller);
00140   
00141   // Return the controller used to coordinate parallel reading. By default,
00142   // it is the global controller.
00143   vtkGetObjectMacro(Controller,vtkMultiProcessController);
00144 
00146   virtual int CanReadFile(const char* fname);
00147 
00148 protected:
00149   vtkSpyPlotReader();
00150   ~vtkSpyPlotReader();
00151 
00152   // The array selections.
00153   vtkDataArraySelection *CellDataArraySelection;
00154   
00155   // Read the case file and the first binary file do get meta
00156   // informations (number of files, number of fields, number of timestep).
00157   virtual int RequestInformation(vtkInformation *request, 
00158                                  vtkInformationVector **inputVector, 
00159                                  vtkInformationVector *outputVector);
00160   
00161   // Read the data: get the number of pieces (=processors) and get
00162   // my piece id (=my processor id).
00163   virtual int RequestData(vtkInformation *request,
00164                           vtkInformationVector **inputVector,
00165                           vtkInformationVector *outputVector);
00166 
00167   // Callback registered with the SelectionObserver.
00168   static void SelectionModifiedCallback(vtkObject *caller, unsigned long eid,
00169                                         void *clientdata, void *calldata);
00170 
00172 
00175   int UpdateMetaData(vtkInformation* request, 
00176                      vtkInformationVector* outputVector);
00178 
00180 
00181   int UpdateCaseFile(const char *fname,
00182                      vtkInformation* request, 
00183                      vtkInformationVector* outputVector);
00185 
00187 
00189   int UpdateNoCaseFile(const char *ext,
00190                        vtkInformation* request, 
00191                        vtkInformationVector* outputVector);
00193 
00194   void AddGhostLevelArray(int numLevels);
00195 
00197 
00199   vtkSetStringMacro(CurrentFileName);
00200   vtkGetStringMacro(CurrentFileName);
00202 
00203   // The observer to modify this object when the array selections are
00204   // modified.
00205   vtkCallbackCommand *SelectionObserver;
00206   char *FileName;
00207   char *CurrentFileName;
00208   int TimeStep; // set by the user
00209   int TimeStepRange[2];
00210   int CurrentTimeStep; // computed
00211 
00212   int IsAMR; // AMR (hierarchy of uniform grids)
00213   // or flat mesh (set of rectilinear grids)?
00214   
00215   vtkMultiProcessController *Controller;
00216   
00217   // The file format stores a vector field as separated scalar component
00218   // fields. This method rebuilds the vector field from those scalar
00219   // component fields.
00220   void MergeVectors(vtkDataSetAttributes *da);
00221   int MergeVectors(vtkDataSetAttributes *da, 
00222                    vtkDataArray *a1,
00223                    vtkDataArray *a2);
00224   int MergeVectors(vtkDataSetAttributes *da, 
00225                    vtkDataArray *a1,
00226                    vtkDataArray *a2,
00227                    vtkDataArray *a3);
00228   
00229   vtkSpyPlotReaderMap *Map;
00230   
00232 
00234   int GetParentProcessor(int proc);
00235   int GetLeftChildProcessor(int proc);
00237   
00238   int DistributeFiles;
00239   
00240   double Bounds[6]; // bounds of the hierarchy without the bad ghostcells.
00241   
00242   int GenerateLevelArray; // user flag
00243   int GenerateBlockIdArray; // user flag
00244 
00245   int DownConvertVolumeFraction;
00246   
00247 private:
00248   vtkSpyPlotReader(const vtkSpyPlotReader&);  // Not implemented.
00249   void operator=(const vtkSpyPlotReader&);  // Not implemented.
00250 };
00251 
00252 #endif

Generated on Tue May 30 12:31:47 2006 for ParaView by doxygen 1.3.5