Meshing: Add lplan and linear to meching options.

setup.py
Pierre-Antoine Rouby 2024-02-07 17:09:50 +01:00
parent b913d76972
commit a663dc482c
5 changed files with 29 additions and 17 deletions

View File

@ -65,6 +65,10 @@ class MeshingWithMage(AMeshingTool):
) )
) )
@classmethod
def _path(cls):
return cls._exe_path()
def _init_c_init_bief_from_geo_file(self): def _init_c_init_bief_from_geo_file(self):
self._c_init_bief_from_geo_file = getattr( self._c_init_bief_from_geo_file = getattr(
self._bief_lib, 'c_init_bief_from_geo_file' 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 # # Meshing #
########### ###########
@ -288,7 +296,7 @@ class MeshingWithMageMailleurTT(AMeshingTool):
directrices=['un', 'np'], directrices=['un', 'np'],
lplan: bool = False, lplan: bool = False,
lm: int = 3, lm: int = 3,
lineaire: bool = False): linear: bool = False):
if reach is None or len(reach.profiles) == 0: if reach is None or len(reach.profiles) == 0:
return reach return reach
@ -301,14 +309,14 @@ class MeshingWithMageMailleurTT(AMeshingTool):
proc.setWorkingDirectory(tmp) proc.setWorkingDirectory(tmp)
lplan = 1 if lplan else 0 lplan = 1 if lplan else 0
lineaire = 1 if lineaire else 0 linear = 1 if linear else 0
logger.info( logger.info(
f"! mailleurTT {st_file} {m_file} " + f"! mailleurTT {st_file} {m_file} " +
f"{str(step)} " + f"{str(step)} " +
f"{limites[0]} {limites[1]} " + f"{limites[0]} {limites[1]} " +
f"{directrices[0]} {directrices[1]} " + f"{directrices[0]} {directrices[1]} " +
f"{lplan} {lm} {lineaire}" f"{lplan} {lm} {linear}"
) )
proc.start( proc.start(
self._exe_path(), self._exe_path(),
@ -318,7 +326,7 @@ class MeshingWithMageMailleurTT(AMeshingTool):
st_file, m_file, step, st_file, m_file, step,
limites[0], limites[1], limites[0], limites[1],
directrices[0], directrices[1], directrices[0], directrices[1],
lplan, lm, lineaire lplan, lm, linear
] ]
)) ))
) )

View File

@ -235,12 +235,12 @@ class GeometryReachTableModel(PamhyrTableModel):
self.layoutAboutToBeChanged.emit() self.layoutAboutToBeChanged.emit()
self.layoutChanged.emit() self.layoutChanged.emit()
def meshing(self, mesher, step): def meshing(self, mesher, data):
self.layoutAboutToBeChanged.emit() self.layoutAboutToBeChanged.emit()
self._undo.push( self._undo.push(
MeshingCommand( MeshingCommand(
self._data, mesher, step self._data, mesher, data
) )
) )

View File

@ -217,11 +217,11 @@ class ImportCommand(QUndoCommand):
class MeshingCommand(QUndoCommand): class MeshingCommand(QUndoCommand):
def __init__(self, reach, mesher, step): def __init__(self, reach, mesher, data):
QUndoCommand.__init__(self) QUndoCommand.__init__(self)
self._reach = reach self._reach = reach
self._step = step self._data = data
self._mesher = mesher self._mesher = mesher
self._profiles = reach.profiles.copy() self._profiles = reach.profiles.copy()
@ -239,7 +239,7 @@ class MeshingCommand(QUndoCommand):
if self._new_profiles is None: if self._new_profiles is None:
self._mesher.meshing( self._mesher.meshing(
self._reach, self._reach,
step=self._step **self._data
) )
self._new_profiles = self._reach.profiles.copy() self._new_profiles = self._reach.profiles.copy()

View File

@ -263,21 +263,25 @@ class GeometryWindow(PamhyrWindow):
try: try:
dlg = MeshingDialog(parent=self) dlg = MeshingDialog(parent=self)
if dlg.exec(): if dlg.exec():
step = dlg.space_step data = {
self._edit_meshing(step) "step": dlg.space_step,
"lplan": dlg.lplan,
"linear": dlg.linear,
}
self._edit_meshing(data)
except Exception as e: except Exception as e:
return return
def _edit_meshing(self, step): def _edit_meshing(self, data):
try: try:
mesher = MeshingWithMageMailleurTT() mesher = MeshingWithMageMailleurTT()
self._table.meshing(mesher, step) self._table.meshing(mesher, data)
except Exception as e: except Exception as e:
logger_exception(e) logger_exception(e)
raise ExternFileMissingError( raise ExternFileMissingError(
module="mage", module="mage",
filename="libbief", filename="MailleurTT",
path=MeshingWithMage._lib_path(), path=MeshingWithMageMailleurTT._path(),
src_except=e src_except=e
) )

View File

@ -170,7 +170,7 @@
<item row="4" column="0"> <item row="4" column="0">
<widget class="QCheckBox" name="checkBox_lplan"> <widget class="QCheckBox" name="checkBox_lplan">
<property name="enabled"> <property name="enabled">
<bool>false</bool> <bool>true</bool>
</property> </property>
<property name="text"> <property name="text">
<string>Lplan</string> <string>Lplan</string>
@ -180,7 +180,7 @@
<item row="5" column="0"> <item row="5" column="0">
<widget class="QCheckBox" name="checkBox_linear"> <widget class="QCheckBox" name="checkBox_linear">
<property name="enabled"> <property name="enabled">
<bool>false</bool> <bool>true</bool>
</property> </property>
<property name="text"> <property name="text">
<string>Linear</string> <string>Linear</string>