VTK  9.2.6
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 <string> // STL Header; Required for string
86 #include <vector> // STL Header; Required for vector
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) override;
103 
105 
108  vtkGetMacro(NumberOfVariables, int);
110 
114  void SetFileName(VTK_FILEPATH const char* fileName);
115 
119  const char* GetDataTitle();
120 
124  int GetNumberOfBlocks();
125 
130  const char* GetBlockName(int blockIdx);
131 
136  int GetNumberOfDataAttributes();
137 
142  const char* GetDataAttributeName(int attrIndx);
143 
149  int IsDataAttributeCellBased(const char* attrName);
150 
156  int IsDataAttributeCellBased(int attrIndx);
157 
161  int GetNumberOfDataArrays();
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:
181  ~vtkTecplotReader() override;
182 
184  int RequestInformation(vtkInformation* request, vtkInformationVector** inputVector,
185  vtkInformationVector* outputVector) override;
187 
191  static void SelectionModifiedCallback(vtkObject*, unsigned long, void* tpReader, void*);
192 
198  void Init();
199 
203  void GetDataArraysList();
204 
209  void ReadFile(vtkMultiBlockDataSet* multZone);
210 
217  void GetArraysFromBlockPackingZone(
218  int numNodes, int numCells, vtkPoints* theNodes, vtkPointData* nodeData, vtkCellData* cellData);
219 
228  void GetArraysFromPointPackingZone(int numNodes, vtkPoints* theNodes, vtkPointData* nodeData);
229 
237  void GetStructuredGridFromBlockPackingZone(int iDimSize, int jDimSize, int kDimSize, int zoneIndx,
238  const char* zoneName, vtkMultiBlockDataSet* multZone);
239 
247  void GetStructuredGridFromPointPackingZone(int iDimSize, int jDimSize, int kDimSize, int zoneIndx,
248  const char* zoneName, vtkMultiBlockDataSet* multZone);
249 
257  void GetUnstructuredGridFromBlockPackingZone(int numNodes, int numCells, const char* cellType,
258  int zoneIndx, const char* zoneName, vtkMultiBlockDataSet* multZone);
259 
267  void GetPolyhedralGridFromBlockPackingZone(int numNodes, int numElements, int numFaces,
268  int zoneIndex, const char* zoneName, vtkMultiBlockDataSet* multZone);
269 
277  void GetPolygonalGridFromBlockPackingZone(int numNodes, int numElements, int numFaces,
278  int zoneIndex, const char* zoneName, vtkMultiBlockDataSet* multZone);
279 
284  void GetPolyhedralGridCells(int numberCells, int numFaces, vtkUnstructuredGrid* unstruct) const;
285 
290  void GetPolygonalGridCells(int numFaces, int numEdges, vtkUnstructuredGrid* unstruct) const;
291 
299  void GetUnstructuredGridFromPointPackingZone(int numNodes, int numCells, const char* cellType,
300  int zoneIndx, const char* zoneName, vtkMultiBlockDataSet* multZone);
301 
306  void GetUnstructuredGridCells(
307  int numberCells, const char* cellTypeStr, vtkUnstructuredGrid* unstrctGrid);
308 
310  char* FileName;
313  vtkTecplotReaderInternal* Internal;
314 
316  std::vector<int> CellBased;
317  std::vector<std::string> ZoneNames;
318  std::vector<std::string> Variables;
319 
320 private:
321  vtkTecplotReader(const vtkTecplotReader&) = delete;
322  void operator=(const vtkTecplotReader&) = delete;
323 };
324 
325 #endif
vtkCallbackCommand * SelectionObserver
abstract base class for most VTK objects
Definition: vtkObject.h:62
represent and manipulate point attribute data
Definition: vtkPointData.h:41
Store vtkAlgorithm input/output information.
vtkDataArraySelection * DataArraySelection
represent and manipulate cell attribute data
Definition: vtkCellData.h:41
std::vector< int > CellBased
Superclass for algorithms that produce only vtkMultiBlockDataSet as output.
virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
This is called by the superclass.
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:39
Store on/off settings for data arrays, etc.
dataset represents arbitrary combinations of all possible cell types
vtkTecplotReaderInternal * Internal
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
std::vector< std::string > Variables
std::string DataTitle
#define VTK_FILEPATH
Composite dataset that organizes datasets into blocks.
Store zero or more vtkInformation instances.
std::vector< std::string > ZoneNames
A concrete class to read an ASCII Tecplot file.
represent and manipulate 3D points
Definition: vtkPoints.h:39
virtual int RequestInformation(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
This is called by the superclass.