Merge branch 'master' of gitlab-ssh.irstea.fr:theophile.terraz/pamhyr

This commit is contained in:
Pierre-Antoine Rouby committed 2024-01-08 15:20:06 +01:00
commit f2b97b68bd
8 files changed
+105 -13

No files matched your search

+20 -3
View File
@@ -49,6 +49,7 @@ class MeshingWithMage(AMeshingTool):
self._init_c_set_bief_name()
self._init_c_st_to_m_compl()
self._init_c_interpolate_profils_pas_transversal()
self._init_c_purge()
self._init_c_output_bief()
def _lib_path(self):
@@ -104,6 +105,11 @@ class MeshingWithMage(AMeshingTool):
]
self._c_interpolate_profils_pas_transversal.restype = None
def _init_c_purge(self):
self._c_purge = getattr(self._bief_lib, 'c_purge')
self._c_purge.argtypes = None
self._c_purge.restype = None
def _init_c_output_bief(self):
self._c_output_bief = getattr(self._bief_lib, 'c_output_bief')
self._c_output_bief.argtypes = [c_char_p]
@@ -181,8 +187,12 @@ class MeshingWithMage(AMeshingTool):
ns, npts_max = self.get_reach_stat()
self.complete_cross_section()
gl = reach.compute_guidelines()
# we make sure that the lines are in the left-ti-right order
guide_list = [x.name for x in reach.profiles[0].named_points() if x in gl[0]]
self.complete_cross_section(guide_list)
self.interpolate_cross_section(ns, step)
self.purge()
self.export_to_m(m_file)
@@ -212,8 +222,12 @@ class MeshingWithMage(AMeshingTool):
return ns, npts_max
def complete_cross_section(self):
self.st_to_m_compl(0, ' ', ' ')
def complete_cross_section(self, gl=[]):
gl1 = ["un"]+gl
gl2 = gl+["np"]
print (gl1)
for l in zip(gl1, gl2):
self.st_to_m_compl(0, l[0], l[1])
def interpolate_cross_section(self, ns, step: float):
self.interpolate_profils_pas_transversal(
@@ -222,6 +236,9 @@ class MeshingWithMage(AMeshingTool):
step
)
def purge(self):
self._c_purge()
def export_to_m(self, m):
self.output_bief(m)
+1 -1
View File
@@ -374,7 +374,7 @@ class Reach(SQLSubModel):
Returns:
Tuple of complete and incomplete guidelines name.
"""
# Get all point contains into a guideline
# Get all point contained into a guideline
named_points = [profile.named_points() for profile in self.profiles]
points_name = list(
map(
+1 -1
View File
@@ -59,7 +59,7 @@ class GeometryReachTableModel(PamhyrTableModel):
return f"{kp:.4f}"
if role == Qt.DisplayRole and index.column() == 2:
return self._data.profile(index.row()).profile_type
return str(self._data.profile(index.row()).nb_points)
if role == Qt.TextAlignmentRole:
return Qt.AlignHCenter | Qt.AlignVCenter
+1
View File
@@ -45,4 +45,5 @@ class GeometryTranslate(PamhyrTranslate):
self._sub_dict["table_headers"] = {
"name": _translate("Geometry", "Name"),
"kp": _translate("Geometry", "KP"),
"poins": _translate("Geometry", "Points"),
}