VTK
dox/IO/vtkTecplotReader.h
Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    vtkTecplotReader.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 =========================================================================*/
00015 
00016 /*****************************************************************************
00017 *
00018 * Copyright (c) 2000 - 2009, Lawrence Livermore National Security, LLC
00019 * Produced at the Lawrence Livermore National Laboratory
00020 * LLNL-CODE-400124
00021 * All rights reserved.
00022 *
00023 * This file was adapted from the ASCII Tecplot reader of VisIt. For  details,
00024 * see https://visit.llnl.gov/.  The full copyright notice is contained in the
00025 * file COPYRIGHT located at the root of the VisIt distribution or at 
00026 * http://www.llnl.gov/visit/copyright.html.
00027 *
00028 *****************************************************************************/
00029 
00075 #ifndef __vtkTecplotReader_h
00076 #define __vtkTecplotReader_h
00077 
00078 #include "vtkMultiBlockDataSetAlgorithm.h"
00079 
00080 //BTX
00081 #include <vtkstd/vector> // STL Header; Required for vector
00082 #include <vtkstd/string> // STL Header; Required for string
00083 //ETX
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   //BTX
00261   vtkstd::string                    DataTitle;
00262   vtkstd::vector< int >             CellBased;
00263   vtkstd::vector< vtkstd::string >  ZoneNames;
00264   vtkstd::vector< vtkstd::string >  Variables;
00265   //ETX
00266   
00267 private:
00268   
00269   vtkTecplotReader( const vtkTecplotReader & );  // Not implemented.
00270   void operator = ( const vtkTecplotReader & );  // Not implemented.
00271 };
00272 
00273 #endif