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
00075 #ifndef __vtkTecplotReader_h
00076 #define __vtkTecplotReader_h
00077
00078 #include "vtkMultiBlockDataSetAlgorithm.h"
00079
00080
00081 #include <vtkstd/vector>
00082 #include <vtkstd/string>
00083
00084
00085 class vtkPoints;
00086 class vtkCellData;
00087 class vtkPointData;
00088 class vtkCallbackCommand;
00089 class vtkUnstructuredGrid;
00090 class vtkMultiBlockDataSet;
00091 class vtkDataArraySelection;
00092 class vtkTecplotReaderInternal;
00093
00094 class VTK_IO_EXPORT vtkTecplotReader : public vtkMultiBlockDataSetAlgorithm
00095 {
00096 public:
00097 static vtkTecplotReader * New();
00098 vtkTypeMacro( vtkTecplotReader, vtkMultiBlockDataSetAlgorithm );
00099 void PrintSelf( ostream & os, vtkIndent indent );
00100
00102
00103 vtkGetMacro( NumberOfVariables, int );
00105
00107 void SetFileName( const char * fileName );
00108
00110 const char * GetDataTitle();
00111
00113 int GetNumberOfBlocks();
00114
00117 const char * GetBlockName( int blockIdx );
00118
00121 int GetNumberOfDataAttributes();
00122
00125 const char * GetDataAttributeName( int attrIndx );
00126
00130 int IsDataAttributeCellBased( const char * attrName );
00131
00135 int IsDataAttributeCellBased( int attrIndx );
00136
00138 int GetNumberOfDataArrays();
00139
00142 const char * GetDataArrayName( int arrayIdx );
00143
00146 int GetDataArrayStatus( const char * arayName );
00147
00150 void SetDataArrayStatus( const char * arayName, int bChecked );
00151
00152 protected:
00153 vtkTecplotReader();
00154 ~vtkTecplotReader();
00155
00156 virtual int FillOutputPortInformation( int port, vtkInformation * info );
00157 virtual int RequestInformation( vtkInformation * request,
00158 vtkInformationVector ** inputVector,
00159 vtkInformationVector * outputVector );
00160 virtual int RequestData
00161 ( vtkInformation *, vtkInformationVector **, vtkInformationVector * );
00162
00164
00165 static void SelectionModifiedCallback
00166 ( vtkObject *, unsigned long, void * tpReader, void * );
00168
00173 void Init();
00174
00176 void GetDataArraysList();
00177
00180 void ReadFile( vtkMultiBlockDataSet * multZone);
00181
00183
00188 void GetArraysFromBlockPackingZone( int numNodes, int numCells,
00189 vtkPoints * theNodes, vtkPointData * nodeData, vtkCellData * cellData );
00191
00193
00199 void GetArraysFromPointPackingZone
00200 ( int numNodes, vtkPoints * theNodes, vtkPointData * nodeData );
00202
00204
00209 void GetStructuredGridFromBlockPackingZone( int iDimSize, int jDimSize,
00210 int kDimSize, int zoneIndx, const char * zoneName,
00211 vtkMultiBlockDataSet * multZone );
00213
00215
00220 void GetStructuredGridFromPointPackingZone( int iDimSize, int jDimSize,
00221 int kDimSize, int zoneIndx, const char * zoneName,
00222 vtkMultiBlockDataSet * multZone );
00224
00226
00231 void GetUnstructuredGridFromBlockPackingZone( int numNodes, int numCells,
00232 const char * cellType, int zoneIndx, const char * zoneName,
00233 vtkMultiBlockDataSet * multZone );
00235
00237
00242 void GetUnstructuredGridFromPointPackingZone( int numNodes, int numCells,
00243 const char * cellType,int zoneIndx, const char * zoneName,
00244 vtkMultiBlockDataSet * multZone );
00246
00248
00250 void GetUnstructuredGridCells( int numberCells, const char * cellTypeStr,
00251 vtkUnstructuredGrid * unstrctGrid );
00253
00254 int NumberOfVariables;
00255 char * FileName;
00256 vtkCallbackCommand * SelectionObserver;
00257 vtkDataArraySelection * DataArraySelection;
00258 vtkTecplotReaderInternal * Internal;
00259
00260
00261 vtkstd::string DataTitle;
00262 vtkstd::vector< int > CellBased;
00263 vtkstd::vector< vtkstd::string > ZoneNames;
00264 vtkstd::vector< vtkstd::string > Variables;
00265
00266
00267 private:
00268
00269 vtkTecplotReader( const vtkTecplotReader & );
00270 void operator = ( const vtkTecplotReader & );
00271 };
00272
00273 #endif