VTK  9.7.1
vtkCONVERGECFDCGNSReader.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-License-Identifier: BSD-3-Clause
3 
25 #ifndef vtkCONVERGECFDCGNSReader_h
26 #define vtkCONVERGECFDCGNSReader_h
27 
28 #include "vtkIOCGNSReaderModule.h" // For export macro
29 
30 #include "vtkNew.h" // for vtkNew
32 #include "vtkSmartPointer.h" // for vtkSmartPointer
33 
34 #include <string> // for std::string
35 
36 VTK_ABI_NAMESPACE_BEGIN
37 class vtkCGNSReader;
39 class vtkPolyData;
40 
41 class VTKIOCGNSREADER_EXPORT vtkCONVERGECFDCGNSReader
43 {
44 public:
45  static vtkCONVERGECFDCGNSReader* New();
47  void PrintSelf(ostream& os, vtkIndent indent) override;
48 
53  vtkGetMacro(PointDataArraySelection, vtkDataArraySelection*);
54 
59  vtkGetMacro(CellDataArraySelection, vtkDataArraySelection*);
60 
66  vtkGetMacro(ParcelDataArraySelection, vtkDataArraySelection*);
67 
72  virtual int CanReadFile(VTK_FILEPATH const std::string& filename);
73 
75 
78  vtkSetMacro(FileName, std::string);
79  vtkGetMacro(FileName, std::string);
81 
82 protected:
84  ~vtkCONVERGECFDCGNSReader() override = default;
85 
88 
89 private:
91  void operator=(const vtkCONVERGECFDCGNSReader&) = delete;
92 
97  void FindVectorNodeIds(int cgioId, const std::vector<double>& arrayIds, const std::string& prefix,
98  double& vectorXId, double& vectorYId, double& vectorZId) const;
99 
103  bool CreateParcelPoints(
104  int cgioId, double parcelXId, double parcelYId, double parcelZId, vtkPolyData* parcel) const;
105 
110  vtkSmartPointer<vtkDataArray> ReadParcelDataArray(int cgioId, double dataNodeId,
111  const std::string& name, const std::vector<double>& arrayIds, bool isVector) const;
112 
113  std::string FileName;
114  bool DataArraysInitialized = false;
115  vtkNew<vtkDataArraySelection> PointDataArraySelection;
116  vtkNew<vtkDataArraySelection> CellDataArraySelection;
117  vtkNew<vtkDataArraySelection> ParcelDataArraySelection;
118  vtkNew<vtkCGNSReader> CGNSReader;
119 };
120 
121 VTK_ABI_NAMESPACE_END
122 #endif // vtkCONVERGECFDCGNSReader_h
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
Store vtkAlgorithm input/output information.
virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
Methods for subclasses to override to handle different pipeline requests.
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:71
virtual int RequestInformation(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
Methods for subclasses to override to handle different pipeline requests.
a simple class to control print indentation
Definition: vtkIndent.h:28
Store on/off settings for data arrays, etc.
Superclass for algorithms that produce vtkPartitionedDataSetCollectionAlgorithm.
vtkCGNSReader creates a multi-block dataset and reads unstructured grids and structured meshes from b...
Definition: vtkCGNSReader.h:42
#define VTK_FILEPATH
Store zero or more vtkInformation instances.
static vtkAlgorithm * New()
Reader for CONVERGECFD CGNS post files.