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 
79 #ifndef vtkTecplotReader_h
80 #define vtkTecplotReader_h
81 
82 #include "vtkIOGeometryModule.h" // For export macro
84 
85 #include <vector> // STL Header; Required for vector
86 #include <string> // STL Header; Required for string
87 
88 class vtkPoints;
89 class vtkCellData;
90 class vtkPointData;
91 class vtkCallbackCommand;
95 class vtkTecplotReaderInternal;
96 
97 class VTKIOGEOMETRY_EXPORT vtkTecplotReader : public vtkMultiBlockDataSetAlgorithm
98 {
99 public:
100  static vtkTecplotReader * New();
102  void PrintSelf( ostream & os, vtkIndent indent );
103 
105 
108  vtkGetMacro( NumberOfVariables, int );
110 
114  void SetFileName( const char * fileName );
115 
119  const char * GetDataTitle();
120 
125 
130  const char * GetBlockName( int blockIdx );
131 
137 
142  const char * GetDataAttributeName( int attrIndx );
143 
149  int IsDataAttributeCellBased( const char * attrName );
150 
156  int IsDataAttributeCellBased( int attrIndx );
157 
162 
166  const char * GetDataArrayName( int arrayIdx );
167 
171  int GetDataArrayStatus( const char * arayName );
172 
177  void SetDataArrayStatus( const char * arayName, int bChecked );
178 
179 protected:
182 
184  virtual int RequestInformation( vtkInformation * request,
185  vtkInformationVector ** inputVector,
186  vtkInformationVector * outputVector );
187  virtual int RequestData
189 
194  ( vtkObject *, unsigned long, void * tpReader, void * );
195 
201  void Init();
202 
207 
212  void ReadFile( vtkMultiBlockDataSet * multZone);
213 
220  void GetArraysFromBlockPackingZone( int numNodes, int numCells,
221  vtkPoints * theNodes, vtkPointData * nodeData, vtkCellData * cellData );
222 
232  ( int numNodes, vtkPoints * theNodes, vtkPointData * nodeData );
233 
241  void GetStructuredGridFromBlockPackingZone( int iDimSize, int jDimSize,
242  int kDimSize, int zoneIndx, const char * zoneName,
243  vtkMultiBlockDataSet * multZone );
244 
252  void GetStructuredGridFromPointPackingZone( int iDimSize, int jDimSize,
253  int kDimSize, int zoneIndx, const char * zoneName,
254  vtkMultiBlockDataSet * multZone );
255 
263  void GetUnstructuredGridFromBlockPackingZone( int numNodes, int numCells,
264  const char * cellType, int zoneIndx, const char * zoneName,
265  vtkMultiBlockDataSet * multZone );
266 
274  void GetUnstructuredGridFromPointPackingZone( int numNodes, int numCells,
275  const char * cellType,int zoneIndx, const char * zoneName,
276  vtkMultiBlockDataSet * multZone );
277 
282  void GetUnstructuredGridCells( int numberCells, const char * cellTypeStr,
283  vtkUnstructuredGrid * unstrctGrid );
284 
286  char * FileName;
289  vtkTecplotReaderInternal * Internal;
290 
292  std::vector< int > CellBased;
293  std::vector< std::string > ZoneNames;
294  std::vector< std::string > Variables;
295 
296 private:
297 
298  vtkTecplotReader( const vtkTecplotReader & ) VTK_DELETE_FUNCTION;
299  void operator = ( const vtkTecplotReader & ) VTK_DELETE_FUNCTION;
300 };
301 
302 #endif
vtkPoints
represent and manipulate 3D points
Definition: vtkPoints.h:40
vtkTecplotReader::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent)
Methods invoked by print to print information about the object including superclasses.
vtkTecplotReader
A concrete class to read an ASCII Tecplot file.
Definition: vtkTecplotReader.h:98
vtkTecplotReader::vtkTecplotReader
vtkTecplotReader()
vtkTecplotReader::GetNumberOfBlocks
int GetNumberOfBlocks()
Get the number of blocks (i.e., zones in Tecplot terms).
vtkTecplotReader::GetArraysFromBlockPackingZone
void GetArraysFromBlockPackingZone(int numNodes, int numCells, vtkPoints *theNodes, vtkPointData *nodeData, vtkCellData *cellData)
This function extracts each variable array from a block-packing (component- based) zone and collects ...
vtkPointData
represent and manipulate point attribute data
Definition: vtkPointData.h:38
vtkTecplotReader::IsDataAttributeCellBased
int IsDataAttributeCellBased(const char *attrName)
Get the type (0 for node-based and 1 for cell-based) of a specified data attribute (not 3D coordinate...
vtkTecplotReader::GetDataArrayName
const char * GetDataArrayName(int arrayIdx)
Get the name of a data array specified by the zero-based index (arrayIdx).
vtkInformationVector
Store zero or more vtkInformation instances.
Definition: vtkInformationVector.h:42
vtkTecplotReader::FileName
char * FileName
Definition: vtkTecplotReader.h:286
vtkTecplotReader::GetDataTitle
const char * GetDataTitle()
Get the Tecplot data title.
vtkTecplotReader::GetNumberOfDataArrays
int GetNumberOfDataArrays()
Get the number of all data attributes (point data and cell data).
vtkTecplotReader::Init
void Init()
This function initializes the context.
vtkObject
abstract base class for most VTK objects
Definition: vtkObject.h:60
vtkTecplotReader::Variables
std::vector< std::string > Variables
Definition: vtkTecplotReader.h:294
vtkMultiBlockDataSet
Composite dataset that organizes datasets into blocks.
Definition: vtkMultiBlockDataSet.h:52
vtkTecplotReader::SelectionObserver
vtkCallbackCommand * SelectionObserver
Definition: vtkTecplotReader.h:287
vtkTecplotReader::GetStructuredGridFromBlockPackingZone
void GetStructuredGridFromBlockPackingZone(int iDimSize, int jDimSize, int kDimSize, int zoneIndx, const char *zoneName, vtkMultiBlockDataSet *multZone)
This function creates a vtkStructuredGrid object made up of a set of points and the associated attrib...
vtkTecplotReader::RequestInformation
virtual int RequestInformation(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
This is called by the superclass.
vtkDataArraySelection
Store on/off settings for data arrays for a vtkSource.
Definition: vtkDataArraySelection.h:35
vtkTecplotReader::GetUnstructuredGridFromPointPackingZone
void GetUnstructuredGridFromPointPackingZone(int numNodes, int numCells, const char *cellType, int zoneIndx, const char *zoneName, vtkMultiBlockDataSet *multZone)
This function creates a vtkUnstructuredGrid object made up of a set of points and the associated attr...
vtkX3D::port
@ port
Definition: vtkX3D.h:447
vtkTecplotReader::DataArraySelection
vtkDataArraySelection * DataArraySelection
Definition: vtkTecplotReader.h:288
vtkTecplotReader::GetNumberOfDataAttributes
int GetNumberOfDataAttributes()
Get the number of standard data attributes (node-based and cell-based), excluding 3D coordinates.
vtkTecplotReader::SelectionModifiedCallback
static void SelectionModifiedCallback(vtkObject *, unsigned long, void *tpReader, void *)
A callback function registered with the selection observer.
vtkTecplotReader::GetDataAttributeName
const char * GetDataAttributeName(int attrIndx)
Get the name of a zero-based data attribute (not 3D coordinates).
vtkTecplotReader::NumberOfVariables
int NumberOfVariables
Definition: vtkTecplotReader.h:285
vtkCellData
represent and manipulate cell attribute data
Definition: vtkCellData.h:39
vtkTecplotReader::GetBlockName
const char * GetBlockName(int blockIdx)
Get the name of a block specified by a zero-based index.
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:40
vtkTecplotReader::~vtkTecplotReader
~vtkTecplotReader()
vtkTecplotReader::CellBased
std::vector< int > CellBased
Definition: vtkTecplotReader.h:292
vtkMultiBlockDataSetAlgorithm.h
vtkTecplotReader::GetDataArraysList
void GetDataArraysList()
Get the data arrays list from the tecplot file header.
vtkDax::detail::cellType
CellTypeInDataSet cellType(vtkDataSet *input)
Definition: vtkDaxDetailCommon.h:36
vtkTecplotReader::GetStructuredGridFromPointPackingZone
void GetStructuredGridFromPointPackingZone(int iDimSize, int jDimSize, int kDimSize, int zoneIndx, const char *zoneName, vtkMultiBlockDataSet *multZone)
This function creates a vtkStructuredGrid object made up of a set of points and the associated attrib...
vtkTecplotReader::GetDataArrayStatus
int GetDataArrayStatus(const char *arayName)
Get the status of a specific data array (0: un-selected; 1: selected).
vtkTecplotReader::RequestData
virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
This is called by the superclass.
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:87
vtkTecplotReader::FillOutputPortInformation
virtual int FillOutputPortInformation(int port, vtkInformation *info)
Fill the output port information objects for this algorithm.
vtkX3D::info
@ info
Definition: vtkX3D.h:376
vtkX3D::string
@ string
Definition: vtkX3D.h:490
vtkTecplotReader::GetUnstructuredGridCells
void GetUnstructuredGridCells(int numberCells, const char *cellTypeStr, vtkUnstructuredGrid *unstrctGrid)
This function fills an allocated vtkUnstructuredGrid object with numberCells cells of type cellTypeSt...
vtkCallbackCommand
supports function callbacks
Definition: vtkCallbackCommand.h:51
vtkTecplotReader::Internal
vtkTecplotReaderInternal * Internal
Definition: vtkTecplotReader.h:289
vtkTecplotReader::IsDataAttributeCellBased
int IsDataAttributeCellBased(int attrIndx)
Get the type (0 for node-based and 1 for cell-based) of a specified data attribute (not 3D coordinate...
vtkTecplotReader::ZoneNames
std::vector< std::string > ZoneNames
Definition: vtkTecplotReader.h:293
vtkTecplotReader::ReadFile
void ReadFile(vtkMultiBlockDataSet *multZone)
This function, the data loading engine, parses the Tecplot file to fill a vtkMultiBlockDataSet object...
vtkTecplotReader::GetUnstructuredGridFromBlockPackingZone
void GetUnstructuredGridFromBlockPackingZone(int numNodes, int numCells, const char *cellType, int zoneIndx, const char *zoneName, vtkMultiBlockDataSet *multZone)
This function creates a vtkUnstructuredGrid object made up of a set of points and the associated attr...
vtkUnstructuredGrid
dataset represents arbitrary combinations of all possible cell types
Definition: vtkUnstructuredGrid.h:83
vtkTecplotReader::GetArraysFromPointPackingZone
void GetArraysFromPointPackingZone(int numNodes, vtkPoints *theNodes, vtkPointData *nodeData)
This function extracts each variable array from a point-packing (tuple- based) zone and collects the ...
vtkTecplotReader::SetFileName
void SetFileName(const char *fileName)
Specify a Tecplot ASCII file for data loading.
vtkTecplotReader::DataTitle
std::string DataTitle
Definition: vtkTecplotReader.h:291
vtkTecplotReader::SetDataArrayStatus
void SetDataArrayStatus(const char *arayName, int bChecked)
Set the status of a specific data array (0: de-select; 1: select) specified by the name.
vtkTecplotReader::New
static vtkTecplotReader * New()
vtkMultiBlockDataSetAlgorithm
Superclass for algorithms that produce only vtkMultiBlockDataSet as output.
Definition: vtkMultiBlockDataSetAlgorithm.h:33