mirror of
https://gitlab.com/pamhyr/pamhyr2.git
synced 2026-10-30 03:20:41 +01:00
merge master
This commit is contained in:
commit
19045329dc
13 files changed
+491
-87
No files matched your search
+29
-12
@@ -32,6 +32,7 @@ from PyQt5.QtGui import (
|
||||
from PyQt5.QtCore import (
|
||||
QModelIndex, Qt, QSettings, pyqtSlot,
|
||||
QItemSelectionModel, QCoreApplication, QSize,
|
||||
QItemSelection, QItemSelectionRange,
|
||||
)
|
||||
from PyQt5.QtWidgets import (
|
||||
QApplication, QMainWindow, QFileDialog, QCheckBox,
|
||||
@@ -49,9 +50,7 @@ from View.Tools.Plot.PamhyrCanvas import MplCanvas
|
||||
|
||||
from View.SelectReach.Window import SelectReachWindow
|
||||
|
||||
from Meshing.Mage import (
|
||||
MeshingWithMage, MeshingWithMageMailleurTT
|
||||
)
|
||||
from Meshing.Internal import InternalMeshing
|
||||
|
||||
from View.Geometry.Table import GeometryReachTableModel
|
||||
from View.Geometry.PlotXY import PlotXY
|
||||
@@ -300,6 +299,13 @@ class GeometryWindow(PamhyrWindow):
|
||||
self.tableView.model().blockSignals(False)
|
||||
|
||||
def edit_meshing(self):
|
||||
|
||||
rows = list(
|
||||
set(
|
||||
(i.row() for i in self.tableView.selectedIndexes())
|
||||
)
|
||||
)
|
||||
selected_rk = [self._reach.profile(r).rk for r in rows]
|
||||
try:
|
||||
dlg = MeshingDialog(
|
||||
reach=self._reach,
|
||||
@@ -310,8 +316,6 @@ class GeometryWindow(PamhyrWindow):
|
||||
data = {
|
||||
"step": dlg.space_step,
|
||||
"limites": [dlg.begin_cs, dlg.end_cs],
|
||||
"directrices": [dlg.begin_dir, dlg.end_dir],
|
||||
"lplan": dlg.lplan,
|
||||
"linear": dlg.linear,
|
||||
}
|
||||
self._edit_meshing(data)
|
||||
@@ -319,18 +323,31 @@ class GeometryWindow(PamhyrWindow):
|
||||
logger_exception(e)
|
||||
return
|
||||
|
||||
ind = []
|
||||
for i in range(self._reach.number_profiles):
|
||||
if self._reach.profile(i).rk in selected_rk:
|
||||
ind.append(i)
|
||||
self.tableView.setFocus()
|
||||
selection = self.tableView.selectionModel()
|
||||
index = QItemSelection()
|
||||
if len(ind) > 0:
|
||||
for i in ind:
|
||||
index.append(QItemSelectionRange(
|
||||
self.tableView.model().index(i, 0)
|
||||
))
|
||||
selection.select(
|
||||
index,
|
||||
QItemSelectionModel.Rows |
|
||||
QItemSelectionModel.ClearAndSelect |
|
||||
QItemSelectionModel.Select
|
||||
)
|
||||
|
||||
def _edit_meshing(self, data):
|
||||
try:
|
||||
mesher = MeshingWithMageMailleurTT()
|
||||
mesher = InternalMeshing()
|
||||
self._table.meshing(mesher, data)
|
||||
except Exception as e:
|
||||
logger_exception(e)
|
||||
raise ExternFileMissingError(
|
||||
module="mage",
|
||||
filename="MailleurTT",
|
||||
path=MeshingWithMageMailleurTT._path(),
|
||||
src_except=e
|
||||
)
|
||||
|
||||
def update_rk(self):
|
||||
try:
|
||||
|
||||
Reference in new issue
Block a user