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 
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
std::map< vtkIdType, vtkIdType > PointsIds
virtual int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
vtkNew< vtkCellArray > Cells
static vtkUnstructuredGridAlgorithm * New()
vtkSmartPointer< vtkDoubleArray > Pload2
int vtkIdType
void PrintSelf(ostream &os, vtkIndent indent) VTK_OVERRIDE
std::map< std::string, vtkIdType > UnsupportedElements
#define VTKPVVTKEXTENSIONSIOGENERAL_EXPORT
vtkNew< vtkPoints > Points
std::map< vtkIdType, vtkIdType > CellsIds
vtkNew< vtkIdTypeArray > OriginalPointIds
void operator=(const vtkObjectBase &)
Reader for Bulk Data Format from Nastran.