mirror of https://gitlab.com/pamhyr/pamhyr2
Meshing: Add lplan and linear to meching options.
parent
b913d76972
commit
a663dc482c
|
|
@ -65,6 +65,10 @@ class MeshingWithMage(AMeshingTool):
|
|||
)
|
||||
)
|
||||
|
||||
@classmethod
|
||||
def _path(cls):
|
||||
return cls._exe_path()
|
||||
|
||||
def _init_c_init_bief_from_geo_file(self):
|
||||
self._c_init_bief_from_geo_file = getattr(
|
||||
self._bief_lib, 'c_init_bief_from_geo_file'
|
||||
|
|
@ -278,6 +282,10 @@ class MeshingWithMageMailleurTT(AMeshingTool):
|
|||
)
|
||||
)
|
||||
|
||||
@classmethod
|
||||
def _path(cls):
|
||||
return cls._exe_path()
|
||||
|
||||
###########
|
||||
# Meshing #
|
||||
###########
|
||||
|
|
@ -288,7 +296,7 @@ class MeshingWithMageMailleurTT(AMeshingTool):
|
|||
directrices=['un', 'np'],
|
||||
lplan: bool = False,
|
||||
lm: int = 3,
|
||||
lineaire: bool = False):
|
||||
linear: bool = False):
|
||||
if reach is None or len(reach.profiles) == 0:
|
||||
return reach
|
||||
|
||||
|
|
@ -301,14 +309,14 @@ class MeshingWithMageMailleurTT(AMeshingTool):
|
|||
proc.setWorkingDirectory(tmp)
|
||||
|
||||
lplan = 1 if lplan else 0
|
||||
lineaire = 1 if lineaire else 0
|
||||
linear = 1 if linear else 0
|
||||
|
||||
logger.info(
|
||||
f"! mailleurTT {st_file} {m_file} " +
|
||||
f"{str(step)} " +
|
||||
f"{limites[0]} {limites[1]} " +
|
||||
f"{directrices[0]} {directrices[1]} " +
|
||||
f"{lplan} {lm} {lineaire}"
|
||||
f"{lplan} {lm} {linear}"
|
||||
)
|
||||
proc.start(
|
||||
self._exe_path(),
|
||||
|
|
@ -318,7 +326,7 @@ class MeshingWithMageMailleurTT(AMeshingTool):
|
|||
st_file, m_file, step,
|
||||
limites[0], limites[1],
|
||||
directrices[0], directrices[1],
|
||||
lplan, lm, lineaire
|
||||
lplan, lm, linear
|
||||
]
|
||||
))
|
||||
)
|
||||
|
|
|
|||
|
|
@ -235,12 +235,12 @@ class GeometryReachTableModel(PamhyrTableModel):
|
|||
self.layoutAboutToBeChanged.emit()
|
||||
self.layoutChanged.emit()
|
||||
|
||||
def meshing(self, mesher, step):
|
||||
def meshing(self, mesher, data):
|
||||
self.layoutAboutToBeChanged.emit()
|
||||
|
||||
self._undo.push(
|
||||
MeshingCommand(
|
||||
self._data, mesher, step
|
||||
self._data, mesher, data
|
||||
)
|
||||
)
|
||||
|
||||
|
|
|
|||
|
|
@ -217,11 +217,11 @@ class ImportCommand(QUndoCommand):
|
|||
|
||||
|
||||
class MeshingCommand(QUndoCommand):
|
||||
def __init__(self, reach, mesher, step):
|
||||
def __init__(self, reach, mesher, data):
|
||||
QUndoCommand.__init__(self)
|
||||
|
||||
self._reach = reach
|
||||
self._step = step
|
||||
self._data = data
|
||||
self._mesher = mesher
|
||||
|
||||
self._profiles = reach.profiles.copy()
|
||||
|
|
@ -239,7 +239,7 @@ class MeshingCommand(QUndoCommand):
|
|||
if self._new_profiles is None:
|
||||
self._mesher.meshing(
|
||||
self._reach,
|
||||
step=self._step
|
||||
**self._data
|
||||
)
|
||||
|
||||
self._new_profiles = self._reach.profiles.copy()
|
||||
|
|
|
|||
|
|
@ -263,21 +263,25 @@ class GeometryWindow(PamhyrWindow):
|
|||
try:
|
||||
dlg = MeshingDialog(parent=self)
|
||||
if dlg.exec():
|
||||
step = dlg.space_step
|
||||
self._edit_meshing(step)
|
||||
data = {
|
||||
"step": dlg.space_step,
|
||||
"lplan": dlg.lplan,
|
||||
"linear": dlg.linear,
|
||||
}
|
||||
self._edit_meshing(data)
|
||||
except Exception as e:
|
||||
return
|
||||
|
||||
def _edit_meshing(self, step):
|
||||
def _edit_meshing(self, data):
|
||||
try:
|
||||
mesher = MeshingWithMageMailleurTT()
|
||||
self._table.meshing(mesher, step)
|
||||
self._table.meshing(mesher, data)
|
||||
except Exception as e:
|
||||
logger_exception(e)
|
||||
raise ExternFileMissingError(
|
||||
module="mage",
|
||||
filename="libbief",
|
||||
path=MeshingWithMage._lib_path(),
|
||||
filename="MailleurTT",
|
||||
path=MeshingWithMageMailleurTT._path(),
|
||||
src_except=e
|
||||
)
|
||||
|
||||
|
|
|
|||
|
|
@ -170,7 +170,7 @@
|
|||
<item row="4" column="0">
|
||||
<widget class="QCheckBox" name="checkBox_lplan">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Lplan</string>
|
||||
|
|
@ -180,7 +180,7 @@
|
|||
<item row="5" column="0">
|
||||
<widget class="QCheckBox" name="checkBox_linear">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Linear</string>
|
||||
|
|
|
|||
Loading…
Reference in New Issue