VTK  9.7.20261110
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
176private:
183 void GetArraysFromBlockPackingZone(int numNodes, int numCells, vtkPoints* theNodes,
184 vtkPointData* nodeData, vtkCellData* cellData, const std::vector<int>& variablesToRead);
185
194 void GetArraysFromPointPackingZone(int numNodes, vtkPoints* theNodes, vtkPointData* nodeData,
195 const std::vector<int>& variablesToRead);
196
201 void ReadFile(vtkInformation* outInfo);
202
206 void ReadData(vtkMultiBlockDataSet* multZone, std::size_t timeStepIndex);
207
215 void GetStructuredGridFromBlockPackingZone(
216 int zoneDataIndex, int multiBlockIdx, vtkMultiBlockDataSet* multZone);
217
225 void GetStructuredGridFromPointPackingZone(
226 int zoneDataIndex, int multiBlockIdx, vtkMultiBlockDataSet* multZone);
227
235 void GetUnstructuredGridFromBlockPackingZone(
236 int zoneDataIndex, int multiBlockIdx, vtkMultiBlockDataSet* multZone);
237
245 void GetPolyhedralGridFromBlockPackingZone(
246 int zoneDataIndex, int multiBlockIdx, vtkMultiBlockDataSet* multZone);
247
255 void GetPolygonalGridFromBlockPackingZone(
256 int zoneDataIndex, int multiBlockIdx, vtkMultiBlockDataSet* multZone);
257
262 void GetPolyhedralGridCells(int numberCells, int numFaces, vtkUnstructuredGrid* unstruct) const;
263
268 void GetPolygonalGridCells(int numFaces, int numEdges, vtkUnstructuredGrid* unstruct) const;
269
277 void GetUnstructuredGridFromPointPackingZone(
278 int zoneDataIndex, int multiBlockIndex, vtkMultiBlockDataSet* multZone);
279
280 vtkTecplotReader(const vtkTecplotReader&) = delete;
281 void operator=(const vtkTecplotReader&) = delete;
282
283 int NumberOfVariables = 0;
284 char* FileName = nullptr;
285 vtkCallbackCommand* SelectionObserver = nullptr;
286 vtkDataArraySelection* DataArraySelection = nullptr;
287 vtkTecplotReaderInternal* Internal = nullptr;
288
289 std::string DataTitle;
290 std::vector<int> CellBased;
291 std::vector<std::string> ZoneNames;
292 std::vector<std::string> Variables;
293};
294
295VTK_ABI_NAMESPACE_END
296#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.
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.
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).
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