00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 
00014 
00015 
00016 
00017 
00018 
00019 
00020 
00021 
00022 
00023 
00024 
00025 
00026 
00027 
00028 
00029 
00078 #ifndef __vtkTecplotReader_h
00079 #define __vtkTecplotReader_h
00080 
00081 #include "vtkMultiBlockDataSetAlgorithm.h"
00082 
00083 
00084 #include <vtkstd/vector> 
00085 #include <vtkstd/string> 
00086 
00087 
00088 class vtkPoints;
00089 class vtkCellData;
00090 class vtkPointData;
00091 class vtkCallbackCommand;
00092 class vtkUnstructuredGrid;
00093 class vtkMultiBlockDataSet;
00094 class vtkDataArraySelection;
00095 class vtkTecplotReaderInternal;
00096 
00097 class VTK_IO_EXPORT vtkTecplotReader : public vtkMultiBlockDataSetAlgorithm
00098 {
00099 public:
00100   static vtkTecplotReader * New();
00101   vtkTypeMacro( vtkTecplotReader, vtkMultiBlockDataSetAlgorithm );
00102   void  PrintSelf( ostream & os, vtkIndent indent );
00103   
00105 
00106   vtkGetMacro( NumberOfVariables, int );
00108   
00110   void  SetFileName( const char * fileName );
00111   
00113   const char * GetDataTitle();
00114   
00116   int   GetNumberOfBlocks();
00117   
00120   const char * GetBlockName( int blockIdx );
00121   
00124   int   GetNumberOfDataAttributes(); 
00125   
00128   const char * GetDataAttributeName( int attrIndx );
00129  
00133   int   IsDataAttributeCellBased( const char * attrName );
00134   
00138   int   IsDataAttributeCellBased( int attrIndx );
00139   
00141   int   GetNumberOfDataArrays();
00142   
00145   const char * GetDataArrayName( int arrayIdx );
00146   
00149   int   GetDataArrayStatus( const char * arayName );
00150   
00153   void  SetDataArrayStatus( const char * arayName, int bChecked ); 
00154   
00155 protected:
00156   vtkTecplotReader();
00157   ~vtkTecplotReader();
00158   
00159   virtual int FillOutputPortInformation( int port, vtkInformation * info );
00160   virtual int RequestInformation( vtkInformation * request, 
00161                                   vtkInformationVector ** inputVector, 
00162                                   vtkInformationVector  * outputVector );
00163   virtual int RequestData
00164           ( vtkInformation *, vtkInformationVector **, vtkInformationVector * );
00165             
00167 
00168   static  void SelectionModifiedCallback
00169           ( vtkObject *, unsigned long, void * tpReader, void * );
00171   
00176   void    Init();
00177   
00179   void    GetDataArraysList();
00180   
00183   void    ReadFile( vtkMultiBlockDataSet * multZone);
00184   
00186 
00191   void    GetArraysFromBlockPackingZone( int numNodes, int numCells, 
00192           vtkPoints * theNodes, vtkPointData * nodeData, vtkCellData * cellData );
00194   
00196 
00202   void    GetArraysFromPointPackingZone
00203           ( int numNodes, vtkPoints * theNodes, vtkPointData * nodeData );
00205   
00207 
00212   void    GetStructuredGridFromBlockPackingZone( int iDimSize, int jDimSize,
00213           int kDimSize, int zoneIndx, const char * zoneName, 
00214           vtkMultiBlockDataSet * multZone );
00216             
00218 
00223   void    GetStructuredGridFromPointPackingZone( int iDimSize, int jDimSize, 
00224           int kDimSize, int zoneIndx, const char * zoneName, 
00225           vtkMultiBlockDataSet * multZone );
00227             
00229 
00234   void    GetUnstructuredGridFromBlockPackingZone( int numNodes, int numCells, 
00235           const char * cellType, int zoneIndx, const char * zoneName, 
00236           vtkMultiBlockDataSet * multZone );
00238             
00240 
00245   void    GetUnstructuredGridFromPointPackingZone( int numNodes, int numCells, 
00246           const char * cellType,int zoneIndx, const char * zoneName, 
00247           vtkMultiBlockDataSet * multZone );
00249   
00251 
00253   void    GetUnstructuredGridCells( int numberCells, const char * cellTypeStr, 
00254           vtkUnstructuredGrid * unstrctGrid );
00256          
00257   int     NumberOfVariables;
00258   char *  FileName;
00259   vtkCallbackCommand       *        SelectionObserver;
00260   vtkDataArraySelection    *        DataArraySelection;
00261   vtkTecplotReaderInternal *        Internal;
00262   
00263   
00264   vtkstd::string                    DataTitle;
00265   vtkstd::vector< int >             CellBased;
00266   vtkstd::vector< vtkstd::string >  ZoneNames;
00267   vtkstd::vector< vtkstd::string >  Variables;
00268   
00269   
00270 private:
00271   
00272   vtkTecplotReader( const vtkTecplotReader & );  
00273   void operator = ( const vtkTecplotReader & );  
00274 };
00275 
00276 #endif