vtkNastranBDFReader.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Kitware Inc.
2 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
3 // SPDX-License-Identifier: BSD-3-Clause
9 #ifndef vtkNastranBDFReader_h
10 #define vtkNastranBDFReader_h
11 
13 
14 #include "vtkNew.h"
15 #include "vtkPVVTKExtensionsIOGeneralModule.h" //needed for exports
16 #include "vtkSmartPointer.h"
17 
18 #include <map>
19 #include <string>
20 #include <vector>
21 
22 class vtkCellArray;
23 class vtkDoubleArray;
24 class vtkIdTypeArray;
25 class vtkPoints;
26 
27 class VTKPVVTKEXTENSIONSIOGENERAL_EXPORT vtkNastranBDFReader : public vtkUnstructuredGridAlgorithm
28 {
29 public:
31  static vtkNastranBDFReader* New();
32  void PrintSelf(ostream& os, vtkIndent indent) override;
33 
35 
38  vtkSetMacro(FileName, std::string);
39  vtkGetMacro(FileName, std::string);
41 
42 protected:
44  ~vtkNastranBDFReader() override = default;
45 
47 
49 
52  // Add title as field data
53  bool AddTitle(const std::vector<std::string>& args);
54  // Add time as field data
55  bool AddTimeInfo(const std::vector<std::string>& args);
56  // Add output point
57  bool AddPoint(const std::vector<std::string>& args);
58  // Add triangle cell. Points should be parsed first.
59  bool AddTriangle(const std::vector<std::string>& args);
60  // Add Pload2 as cell data. Cells should be parsed first.
61  bool AddPload2Data(const std::vector<std::string>& args);
63 
64  // Return the id in `Points` of the element id `arg`
65  vtkIdType GetVTKPointId(const std::string& arg);
66 
67  std::string FileName;
68 
73 
74  // Utilities map to store <inputId, VTKId>
75  std::map<vtkIdType, vtkIdType> CellsIds;
76  std::map<vtkIdType, vtkIdType> PointsIds;
77 
78  // Store parsing errors as <Keyword, numberOfOccurence>
79  std::map<std::string, vtkIdType> UnsupportedElements;
80 
81 private:
83  void operator=(const vtkNastranBDFReader&) = delete;
84 };
85 
86 #endif
vtkPoints
vtkObjectBase::operator=
void operator=(const vtkObjectBase &)
vtkNastranBDFReader::OriginalPointIds
vtkNew< vtkIdTypeArray > OriginalPointIds
Definition: vtkNastranBDFReader.h:71
vtkIdType
int vtkIdType
vtkInformationVector
vtkNastranBDFReader::CellsIds
std::map< vtkIdType, vtkIdType > CellsIds
Definition: vtkNastranBDFReader.h:75
vtkSmartPointer< vtkDoubleArray >
vtkNastranBDFReader::Cells
vtkNew< vtkCellArray > Cells
Definition: vtkNastranBDFReader.h:70
vtkNastranBDFReader::FileName
std::string FileName
Definition: vtkNastranBDFReader.h:67
vtkUnstructuredGridAlgorithm::RequestData
virtual int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
vtkNastranBDFReader::Points
vtkNew< vtkPoints > Points
Definition: vtkNastranBDFReader.h:69
vtkIndent
vtkCellArray
vtkSmartPointer.h
vtkNew< vtkPoints >
vtkNastranBDFReader::Pload2
vtkSmartPointer< vtkDoubleArray > Pload2
Definition: vtkNastranBDFReader.h:72
vtkUnstructuredGridAlgorithm::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) VTK_OVERRIDE
vtkNastranBDFReader
Reader for Bulk Data Format from Nastran.
Definition: vtkNastranBDFReader.h:27
vtkInformation
vtkIdTypeArray
vtkNastranBDFReader::UnsupportedElements
std::map< std::string, vtkIdType > UnsupportedElements
Definition: vtkNastranBDFReader.h:79
vtkNew.h
vtkUnstructuredGridAlgorithm::New
static vtkUnstructuredGridAlgorithm * New()
vtkUnstructuredGridAlgorithm.h
vtkUnstructuredGridAlgorithm
vtkDoubleArray
vtkNastranBDFReader::PointsIds
std::map< vtkIdType, vtkIdType > PointsIds
Definition: vtkNastranBDFReader.h:76