From e6178525d7bab93c5a81bd0c0c9c87bf1096a30e Mon Sep 17 00:00:00 2001 From: Pierre-Antoine Rouby <pierre-antoine.rouby@inrae.fr> Date: Wed, 7 Feb 2024 17:19:22 +0100 Subject: [PATCH] Geometry: Add missing file. --- src/View/Geometry/MeshingDialog.py | 83 ++++++++++++++++++++++++++++++ 1 file changed, 83 insertions(+) create mode 100644 src/View/Geometry/MeshingDialog.py diff --git a/src/View/Geometry/MeshingDialog.py b/src/View/Geometry/MeshingDialog.py new file mode 100644 index 00000000..b5942dc5 --- /dev/null +++ b/src/View/Geometry/MeshingDialog.py @@ -0,0 +1,83 @@ +# MeshingDialog.py -- Pamhyr +# Copyright (C) 2023 INRAE +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <https://www.gnu.org/licenses/>. + +# -*- coding: utf-8 -*- + +from View.Tools.PamhyrWindow import PamhyrDialog + +from PyQt5.QtGui import ( + QKeySequence, +) + +from PyQt5.QtCore import ( + Qt, QVariant, QAbstractTableModel, +) + +from PyQt5.QtWidgets import ( + QDialogButtonBox, QComboBox, QUndoStack, QShortcut, + QDoubleSpinBox, +) + + +class MeshingDialog(PamhyrDialog): + _pamhyr_ui = "MeshingOptions" + _pamhyr_name = "Meshing" + + def __init__(self, parent=None): + super(MeshingDialog, self).__init__( + title=self._pamhyr_name, + options=[], + parent=parent + ) + + self._init_default_values() + + def _init_default_values(self): + self._space_step = 50.0 + self._lplan = False + self._linear = False + + self.set_double_spin_box( + "doubleSpinBox_space_step", + self._space_step + ) + + self.set_check_box("checkBox_lplan", self._lplan) + self.set_check_box("checkBox_linear", self._linear) + + @property + def space_step(self): + return self._space_step + + @property + def lplan(self): + return self._lplan + + @property + def linear(self): + return self._linear + + def accept(self): + self._space_step = self.get_double_spin_box( + "doubleSpinBox_space_step", + ) + self._lplan = self.get_check_box("checkBox_lplan") + self._linear = self.get_check_box("checkBox_linear") + + super().accept() + + def reject(self): + self.close() -- GitLab