VTK  9.7.20261008
vtkTecplotReader.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2// SPDX-FileCopyrightText: Copyright (c) 2000 - 2009, Lawrence Livermore National Security, LLC
3// SPDX-License-Identifier: BSD-3-Clause
4
53
54#ifndef vtkTecplotReader_h
55#define vtkTecplotReader_h
56
57#include "vtkIOGeometryModule.h" // For export macro
59
60#include <string> // STL Header; Required for string
61#include <vector> // STL Header; Required for vector
62
63VTK_ABI_NAMESPACE_BEGIN
64class vtkPoints;
65class vtkCellData;
66class vtkPointData;
71class vtkTecplotReaderInternal;
72
73class VTKIOGEOMETRY_EXPORT vtkTecplotReader : public vtkMultiBlockDataSetAlgorithm
74{
75public:
78 void PrintSelf(ostream& os, vtkIndent indent) override;
79
81
84 vtkGetMacro(NumberOfVariables, int);
86
90 void SetFileName(VTK_FILEPATH const char* fileName);
91
95 const char* GetDataTitle();
96
101
106 const char* GetBlockName(int blockIdx);
107
113
118 const char* GetDataAttributeName(int attrIndx);
119
125 int IsDataAttributeCellBased(const char* attrName);
126
132 int IsDataAttributeCellBased(int attrIndx);
133
138
142 const char* GetDataArrayName(int arrayIdx);
143
147 int GetDataArrayStatus(const char* arayName);
148
153 void SetDataArrayStatus(const char* arayName, int bChecked);
154
155protected:
158
159 int FillOutputPortInformation(int port, vtkInformation* info) override;
161 vtkInformationVector* outputVector) override;
163
167 static void SelectionModifiedCallback(vtkObject*, unsigned long, void* tpReader, void*);
168
174 void Init();
175
183 int numNodes, int numCells, vtkPoints* theNodes, vtkPointData* nodeData, vtkCellData* cellData);
184
193 void GetArraysFromPointPackingZone(int numNodes, vtkPoints* theNodes, vtkPointData* nodeData);
194
200 int numberCells, const char* cellTypeStr, vtkUnstructuredGrid* unstrctGrid);
201
202private:
203 int NumberOfVariables;
204 char* FileName;
205 vtkCallbackCommand* SelectionObserver;
206 vtkDataArraySelection* DataArraySelection;
207 vtkTecplotReaderInternal* Internal;
208
209 std::string DataTitle;
210 std::vector<int> CellBased;
211 std::vector<std::string> ZoneNames;
212 std::vector<std::string> Variables;
213
218 void ReadFile(vtkInformation* outInfo);
219
223 void ReadData(vtkMultiBlockDataSet* multZone, std::size_t timeStepIndex);
224
232 void GetStructuredGridFromBlockPackingZone(
233 int zoneDataIndex, int multiBlockIdx, vtkMultiBlockDataSet* multZone);
234
242 void GetStructuredGridFromPointPackingZone(
243 int zoneDataIndex, int multiBlockIdx, vtkMultiBlockDataSet* multZone);
244
252 void GetUnstructuredGridFromBlockPackingZone(
253 int zoneDataIndex, int multiBlockIdx, vtkMultiBlockDataSet* multZone);
254
262 void GetPolyhedralGridFromBlockPackingZone(
263 int zoneDataIndex, int multiBlockIdx, vtkMultiBlockDataSet* multZone);
264
272 void GetPolygonalGridFromBlockPackingZone(
273 int zoneDataIndex, int multiBlockIdx, vtkMultiBlockDataSet* multZone);
274
279 void GetPolyhedralGridCells(int numberCells, int numFaces, vtkUnstructuredGrid* unstruct) const;
280
285 void GetPolygonalGridCells(int numFaces, int numEdges, vtkUnstructuredGrid* unstruct) const;
286
294 void GetUnstructuredGridFromPointPackingZone(
295 int zoneDataIndex, int multiBlockIndex, vtkMultiBlockDataSet* multZone);
296
297 vtkTecplotReader(const vtkTecplotReader&) = delete;
298 void operator=(const vtkTecplotReader&) = delete;
299};
300
301VTK_ABI_NAMESPACE_END
302#endif
supports function callbacks
represent and manipulate cell attribute data
Store on/off settings for data arrays, etc.
a simple class to control print indentation
Definition vtkIndent.h:108
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
Composite dataset that organizes datasets into blocks.
represent and manipulate point attribute data
represent and manipulate 3D points
Definition vtkPoints.h:140
void Init()
This function initializes the context.
void SetFileName(const char *fileName)
Specify a Tecplot ASCII file for data loading.
void GetArraysFromPointPackingZone(int numNodes, vtkPoints *theNodes, vtkPointData *nodeData)
This function extracts each variable array from a point-packing (tuple- based) zone and collects the ...
int GetNumberOfDataArrays()
Get the number of all data attributes (point data and cell data).
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...
int IsDataAttributeCellBased(int attrIndx)
Get the type (0 for node-based and 1 for cell-based) of a specified data attribute (not 3D coordinate...
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
const char * GetDataTitle()
Get the Tecplot data title.
int GetNumberOfDataAttributes()
Get the number of standard data attributes (node-based and cell-based), excluding 3D coordinates.
int RequestInformation(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector) override
This is called by the superclass.
~vtkTecplotReader() override
static vtkTecplotReader * New()
static void SelectionModifiedCallback(vtkObject *, unsigned long, void *tpReader, void *)
A callback function registered with the selection observer.
void SetDataArrayStatus(const char *arayName, int bChecked)
Set the status of a specific data array (0: de-select; 1: select) specified by the name.
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 ...
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called by the superclass.
int GetNumberOfBlocks()
Get the number of blocks (i.e., zones in Tecplot terms).
const char * GetDataArrayName(int arrayIdx)
Get the name of a data array specified by the zero-based index (arrayIdx).
void GetUnstructuredGridCells(int numberCells, const char *cellTypeStr, vtkUnstructuredGrid *unstrctGrid)
This function fills an allocated vtkUnstructuredGrid object with numberCells cells of type cellTypeSt...
int FillOutputPortInformation(int port, vtkInformation *info) override
Fill the output port information objects for this algorithm.
const char * GetBlockName(int blockIdx)
Get the name of a block specified by a zero-based index.
const char * GetDataAttributeName(int attrIndx)
Get the name of a zero-based data attribute (not 3D coordinates).
int GetDataArrayStatus(const char *arayName)
Get the status of a specific data array (0: un-selected; 1: selected).
dataset represents arbitrary combinations of all possible cell types
#define VTK_FILEPATH