OGS
mainwindow.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) OpenGeoSys Community (opengeosys.org)
2// SPDX-License-Identifier: BSD-3-Clause
3
4#pragma once
5
6#include <memory>
7
12#include "DataView/GEOModels.h"
13#include "DataView/MeshModel.h"
17#include "ui_mainwindow.h"
18
19class TreeModel;
20
21namespace MeshLib
22{
24}
25
26class QSignalMapper;
27
31class MainWindow : public QMainWindow, public Ui_MainWindowClass
32{
33 Q_OBJECT
34
35public:
36 explicit MainWindow(QWidget* parent = nullptr);
37
38 void ShowWindow();
39 void HideWindow();
40 void loadFileOnStartUp(const QString& fileName);
41
42protected:
43 void closeEvent(QCloseEvent* event) override;
44
45protected slots:
47 void showGeoDockWidget(bool show);
48 void showStationDockWidget(bool show);
49 void showMshDockWidget(bool show);
50 void showConditionDockWidget(bool show);
51 void showVisDockWidget(bool show);
52
54 void open(int file_type = 0);
56 void save();
58 void callGMSH(std::vector<std::string>& selectedGeometries,
59 unsigned param1,
60 double param2,
61 double param3,
62 double param4,
63 bool delete_geo_file);
65 void exportBoreholesToGMS(std::string listName, std::string fileName);
67 void FEMTestStart();
68 void loadPetrelFiles();
69 void mapGeometry(const std::string& geo_name);
70 void convertMeshToGeometry(const MeshLib::Mesh* mesh);
71 void convertPointsToStations(std::string const& geo_name);
72 void openRecentFile();
73 void about();
74 void showAddPipelineFilterItemDialog(QModelIndex parentIndex);
77 void showGeoNameDialog(const std::string& geometry_name,
78 const GeoLib::GEOTYPE object_type,
79 std::size_t id);
81 void showStationNameDialog(const std::string& stn_vec_name, std::size_t id);
90 void showDiagramPrefsDialog(QModelIndex& index);
92 void showFileConverter();
93 // TODO6 void showFileConverterDialog();
94 void showLicense();
95 void showLineEditDialog(const std::string& geoName);
104 void showVtu2GridDialog();
105 void updateDataViews();
106 void writeGeometryToFile(QString gliName, QString fileName);
107 void writeStationListToFile(QString listName, QString fileName);
108
109 void on_actionExportVTK_triggered(bool checked = false);
110 void on_actionExportVRML2_triggered(bool checked = false);
111 void on_actionExportObj_triggered(bool checked = false);
112
116
117private:
118 QMenu* createImportFilesMenu();
119 void loadFile(ImportFileType::type t, const QString& fileName);
120 void loadFEMConditionsFromFile(const QString& fileName,
121 std::string geoName = "");
122 void readSettings();
123 void writeSettings();
124 QString getLastUsedDir();
125
127 std::unique_ptr<MeshModel> _meshModel;
128 std::unique_ptr<ElementTreeModel> _elementModel;
129 std::unique_ptr<ProcessModel> _processModel;
130 std::unique_ptr<FemConditionModel> _conditionModel;
131 std::unique_ptr<VtkVisPipeline> _vtkVisPipeline;
132 QList<QRect> _screenGeometries;
133 std::unique_ptr<QWidget> _vtkWidget;
134 QByteArray _windowState;
135
136 std::unique_ptr<VisPrefsDialog> _visPrefsDialog;
137
138 std::unique_ptr<GEOModels> _geo_model;
139
140signals:
141 void fileUsed(QString filename);
143};
void showConditionDockWidget(bool show)
void closeEvent(QCloseEvent *event) override
void readSettings()
std::unique_ptr< MeshModel > _meshModel
Definition mainwindow.h:127
void callGMSH(std::vector< std::string > &selectedGeometries, unsigned param1, double param2, double param3, double param4, bool delete_geo_file)
Function calls for generating GMSH files from the GUI.
void open(int file_type=0)
Function calls for opening files.
void FEMTestStart()
Testing functionality for connection to FEM lib.
QMenu * createImportFilesMenu()
void showGMSHPrefsDialog()
void quitPresentationMode()
void loadFile(ImportFileType::type t, const QString &fileName)
void on_actionExportObj_triggered(bool checked=false)
void showFileConverter()
Calls the OGSFileConverter as an external tool.
std::unique_ptr< ElementTreeModel > _elementModel
Definition mainwindow.h:128
void showStationNameDialog(const std::string &stn_vec_name, std::size_t id)
Allows setting the name for a station.
void save()
Function calls for saving files.
void writeStationListToFile(QString listName, QString fileName)
void loadFileOnStartUp(const QString &fileName)
void showGeoDockWidget(bool show)
void showLayers2GridDialog()
void writeSettings()
void showGeoNameDialog(const std::string &geometry_name, const GeoLib::GEOTYPE object_type, std::size_t id)
Allows setting the name for a geometric object.
void showLineEditDialog(const std::string &geoName)
void showStationDockWidget(bool show)
std::unique_ptr< VisPrefsDialog > _visPrefsDialog
Definition mainwindow.h:136
void showLicense()
void convertMeshToGeometry(const MeshLib::Mesh *mesh)
void showDiagramPrefsDialog()
Calls the diagram prefs dialog from the Tools menu.
void showMshDockWidget(bool show)
void loadFEMConditionsFromFile(const QString &fileName, std::string geoName="")
QString getLastUsedDir()
void showMeshAnalysisDialog()
void showAddPipelineFilterItemDialog(QModelIndex parentIndex)
void showCreateStructuredGridDialog()
Creates a structured grid with user-specified parameters.
void ShowWindow()
void showMergeGeometriesDialog()
void showVisDockWidget(bool show)
void showMeshElementRemovalDialog()
Removal of mesh elements based on a number of criteria.
std::unique_ptr< ProcessModel > _processModel
Definition mainwindow.h:129
void showTranslateDataDialog()
void on_actionExportVRML2_triggered(bool checked=false)
void createPresentationMenu()
void openRecentFile()
void fileOpenRequested(int)
DataHolderLib::Project _project
Definition mainwindow.h:126
void writeGeometryToFile(QString gliName, QString fileName)
MainWindow(QWidget *parent=nullptr)
std::unique_ptr< GEOModels > _geo_model
Definition mainwindow.h:138
void startPresentationMode()
std::unique_ptr< VtkVisPipeline > _vtkVisPipeline
Definition mainwindow.h:131
void HideWindow()
void loadPetrelFiles()
void on_actionExportVTK_triggered(bool checked=false)
void showAddFaultsToVoxelGridDialog()
void showVisalizationPrefsDialog()
std::unique_ptr< QWidget > _vtkWidget
Definition mainwindow.h:133
void showVtu2GridDialog()
void mapGeometry(const std::string &geo_name)
void showMeshQualitySelectionDialog(MeshLib::VtkMappedMeshSource *mshSource)
QList< QRect > _screenGeometries
Definition mainwindow.h:132
void fileUsed(QString filename)
QByteArray _windowState
Definition mainwindow.h:134
std::unique_ptr< FemConditionModel > _conditionModel
Definition mainwindow.h:130
void updateDataViews()
void showDataExplorerSettingsDialog()
void convertPointsToStations(std::string const &geo_name)
void exportBoreholesToGMS(std::string listName, std::string fileName)
Function calls for GMS export.
VtkMappedMeshSource is a source class to transform OGS meshes into complete vtkUnstructuredGrids....
A hierarchical model for a tree implemented as a double-linked list.
Definition TreeModel.h:19
GEOTYPE
Definition GeoType.h:12