VTK
|
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 00078 #ifndef __vtkTecplotReader_h 00079 #define __vtkTecplotReader_h 00080 00081 #include "vtkMultiBlockDataSetAlgorithm.h" 00082 00083 //BTX 00084 #include <vector> // STL Header; Required for vector 00085 #include <string> // STL Header; Required for string 00086 //ETX 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 //BTX 00264 std::string DataTitle; 00265 std::vector< int > CellBased; 00266 std::vector< std::string > ZoneNames; 00267 std::vector< std::string > Variables; 00268 //ETX 00269 00270 private: 00271 00272 vtkTecplotReader( const vtkTecplotReader & ); // Not implemented. 00273 void operator = ( const vtkTecplotReader & ); // Not implemented. 00274 }; 00275 00276 #endif