OGS
MeshView.h
Go to the documentation of this file.
1 
14 #pragma once
15 
16 #include <QTreeView>
17 #include "GeoLib/GeoType.h"
18 #include "GeoLib/Point.h"
19 
20 class MeshModel;
21 class vtkUnstructuredGridAlgorithm;
22 
23 namespace MeshLib {
24  class Mesh;
25 }
26 
27 namespace MeshLib {
28  class VtkMappedMeshSource;
29 }
30 
35 class MeshView : public QTreeView
36 {
37  Q_OBJECT
38 
39 public:
40  explicit MeshView(QWidget* parent = nullptr);
41  ~MeshView() override;
42 
43 public slots:
44  void updateView();
45 
46 protected slots:
48  void selectionChanged(const QItemSelection& selected,
49  const QItemSelection& deselected) override;
50 
51 private:
52  struct MeshAction
53  {
54  QAction* action;
55  unsigned min_dim;
56  unsigned max_dim;
57  };
58 
59  void contextMenuEvent(QContextMenuEvent* event) override;
60 
61 private slots:
63  void openMap2dMeshDialog();
64 
67 
69  void openMeshEditDialog();
70 
72  void openValuesEditDialog();
73 
75  void openAddLayerDialog();
76 
78  void addMesh();
79 
80  void addDIRECTSourceTerms();
81 
82  void extractSurfaceMesh();
83 
84  void exportToTetGen();
85 
86  void loadDIRECTSourceTerms();
87 
88  void convertMeshToGeometry();
89 
90  void exportToShapefile() const;
91 
93  void removeMesh();
94 
96  void writeToFile() const;
97 
99  void checkMeshQuality();
100 
101 signals:
102  void elementSelected(vtkUnstructuredGridAlgorithm const*const, unsigned, bool);
103  void enableSaveButton(bool);
104  void enableRemoveButton(bool);
106  void openMeshFile(int);
109  void requestCondSetupDialog(const std::string&, const GeoLib::GEOTYPE, const std::size_t, bool on_points);
110  void requestMeshRemoval(const QModelIndex&);
112  void loadFEMCondFileRequested(const std::string);
114 
115 };
Definition of the Point class.
Definition of the GEOTYPE enumeration.
void enableSaveButton(bool)
void selectionChanged(const QItemSelection &selected, const QItemSelection &deselected) override
Is called when the selection of this view changes.
Definition: MeshView.cpp:67
~MeshView() override
void checkMeshQuality()
Calls the dialog for calculating an element quality metric.
Definition: MeshView.cpp:446
void saveMeshAction()
void extractSurfaceMesh()
Definition: MeshView.cpp:319
void meshSelected(MeshLib::Mesh const &)
void qualityCheckRequested(MeshLib::VtkMappedMeshSource *)
void contextMenuEvent(QContextMenuEvent *event) override
Definition: MeshView.cpp:117
void openValuesEditDialog()
Opens a dialog for editing material groups.
Definition: MeshView.cpp:271
MeshView(QWidget *parent=nullptr)
Definition: MeshView.cpp:46
void openMap2dMeshDialog()
Opens a dialog for mapping 2d meshes.
Definition: MeshView.cpp:175
void openMeshEditDialog()
Opens a dialog for editing meshes.
Definition: MeshView.cpp:259
void requestCondSetupDialog(const std::string &, const GeoLib::GEOTYPE, const std::size_t, bool on_points)
void writeToFile() const
Calls the FileDialog to save a mesh to a file.
Definition: MeshView.cpp:412
void requestMeshToGeometryConversion(const MeshLib::Mesh *)
void addMesh()
Adds a new mesh.
Definition: MeshView.cpp:97
void exportToTetGen()
Definition: MeshView.cpp:389
void removeSelectedMeshComponent()
void openRasterDataToMeshDialog()
Opens a dialog for assigning raster data to the mesh.
Definition: MeshView.cpp:220
void convertMeshToGeometry()
Definition: MeshView.cpp:352
void openMeshFile(int)
void loadDIRECTSourceTerms()
Definition: MeshView.cpp:440
void openAddLayerDialog()
Opens a dialog for adding a layer to the mesh.
Definition: MeshView.cpp:283
void elementSelected(vtkUnstructuredGridAlgorithm const *const, unsigned, bool)
void requestMeshRemoval(const QModelIndex &)
void loadFEMCondFileRequested(const std::string)
void addDIRECTSourceTerms()
Definition: MeshView.cpp:433
void removeMesh()
Remove the currently selected mesh.
Definition: MeshView.cpp:102
void updateView()
Definition: MeshView.cpp:55
void exportToShapefile() const
Definition: MeshView.cpp:360
void enableRemoveButton(bool)
GEOTYPE
Definition: GeoType.h:25
QAction * action
Definition: MeshView.h:54
unsigned max_dim
Definition: MeshView.h:56
unsigned min_dim
Definition: MeshView.h:55