VTK
vtkTecplotReader.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkTecplotReader.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
15 
16 /*****************************************************************************
17 *
18 * Copyright (c) 2000 - 2009, Lawrence Livermore National Security, LLC
19 * Produced at the Lawrence Livermore National Laboratory
20 * LLNL-CODE-400124
21 * All rights reserved.
22 *
23 * This file was adapted from the ASCII Tecplot reader of VisIt. For details,
24 * see https://visit.llnl.gov/. The full copyright notice is contained in the
25 * file COPYRIGHT located at the root of the VisIt distribution or at
26 * http://www.llnl.gov/visit/copyright.html.
27 *
28 *****************************************************************************/
29 
76 #ifndef vtkTecplotReader_h
77 #define vtkTecplotReader_h
78 
79 #include "vtkIOGeometryModule.h" // For export macro
81 
82 #include <vector> // STL Header; Required for vector
83 #include <string> // STL Header; Required for string
84 
85 class vtkPoints;
86 class vtkCellData;
87 class vtkPointData;
88 class vtkCallbackCommand;
92 class vtkTecplotReaderInternal;
93 
94 class VTKIOGEOMETRY_EXPORT vtkTecplotReader : public vtkMultiBlockDataSetAlgorithm
95 {
96 public:
97  static vtkTecplotReader * New();
99  void PrintSelf( ostream & os, vtkIndent indent ) override;
100 
102 
105  vtkGetMacro( NumberOfVariables, int );
107 
111  void SetFileName( const char * fileName );
112 
116  const char * GetDataTitle();
117 
121  int GetNumberOfBlocks();
122 
127  const char * GetBlockName( int blockIdx );
128 
133  int GetNumberOfDataAttributes();
134 
139  const char * GetDataAttributeName( int attrIndx );
140 
146  int IsDataAttributeCellBased( const char * attrName );
147 
153  int IsDataAttributeCellBased( int attrIndx );
154 
158  int GetNumberOfDataArrays();
159 
163  const char * GetDataArrayName( int arrayIdx );
164 
168  int GetDataArrayStatus( const char * arayName );
169 
174  void SetDataArrayStatus( const char * arayName, int bChecked );
175 
176 protected:
178  ~vtkTecplotReader() override;
179 
180  int FillOutputPortInformation( int port, vtkInformation * info ) override;
181  int RequestInformation( vtkInformation * request,
182  vtkInformationVector ** inputVector,
183  vtkInformationVector * outputVector ) override;
184  int RequestData
186 
190  static void SelectionModifiedCallback
191  ( vtkObject *, unsigned long, void * tpReader, void * );
192 
198  void Init();
199 
203  void GetDataArraysList();
204 
209  void ReadFile( vtkMultiBlockDataSet * multZone);
210 
217  void GetArraysFromBlockPackingZone( int numNodes, int numCells,
218  vtkPoints * theNodes, vtkPointData * nodeData, vtkCellData * cellData );
219 
228  void GetArraysFromPointPackingZone
229  ( int numNodes, vtkPoints * theNodes, vtkPointData * nodeData );
230 
238  void GetStructuredGridFromBlockPackingZone( int iDimSize, int jDimSize,
239  int kDimSize, int zoneIndx, const char * zoneName,
240  vtkMultiBlockDataSet * multZone );
241 
249  void GetStructuredGridFromPointPackingZone( int iDimSize, int jDimSize,
250  int kDimSize, int zoneIndx, const char * zoneName,
251  vtkMultiBlockDataSet * multZone );
252 
260  void GetUnstructuredGridFromBlockPackingZone( int numNodes, int numCells,
261  const char * cellType, int zoneIndx, const char * zoneName,
262  vtkMultiBlockDataSet * multZone );
263 
271  void GetUnstructuredGridFromPointPackingZone( int numNodes, int numCells,
272  const char * cellType,int zoneIndx, const char * zoneName,
273  vtkMultiBlockDataSet * multZone );
274 
279  void GetUnstructuredGridCells( int numberCells, const char * cellTypeStr,
280  vtkUnstructuredGrid * unstrctGrid );
281 
283  char * FileName;
286  vtkTecplotReaderInternal * Internal;
287 
289  std::vector< int > CellBased;
290  std::vector< std::string > ZoneNames;
291  std::vector< std::string > Variables;
292 
293 private:
294 
295  vtkTecplotReader( const vtkTecplotReader & ) = delete;
296  void operator = ( const vtkTecplotReader & ) = delete;
297 };
298 
299 #endif
vtkCallbackCommand * SelectionObserver
abstract base class for most VTK objects
Definition: vtkObject.h:53
represent and manipulate point attribute data
Definition: vtkPointData.h:31
Store vtkAlgorithm input/output information.
vtkDataArraySelection * DataArraySelection
represent and manipulate cell attribute data
Definition: vtkCellData.h:32
Superclass for algorithms that produce only vtkMultiBlockDataSet as output.
virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
This is called by the superclass.
std::vector< int > CellBased
int FillOutputPortInformation(int port, vtkInformation *info) override
Fill the output port information objects for this algorithm.
static vtkMultiBlockDataSetAlgorithm * New()
supports function callbacks
a simple class to control print indentation
Definition: vtkIndent.h:33
Store on/off settings for data arrays for a vtkSource.
dataset represents arbitrary combinations of all possible cell types
vtkTecplotReaderInternal * Internal
std::vector< std::string > ZoneNames
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
std::string DataTitle
Composite dataset that organizes datasets into blocks.
Store zero or more vtkInformation instances.
A concrete class to read an ASCII Tecplot file.
represent and manipulate 3D points
Definition: vtkPoints.h:33
std::vector< std::string > Variables
virtual int RequestInformation(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
This is called by the superclass.