mirror of https://gitlab.com/pamhyr/pamhyr2
Geometry: Meshing: Add cross sections limites.
parent
387d462c2c
commit
1b22ba436b
|
|
@ -44,6 +44,7 @@ class MeshingDialog(PamhyrDialog):
|
||||||
)
|
)
|
||||||
|
|
||||||
self._reach = reach
|
self._reach = reach
|
||||||
|
self._profiles = None
|
||||||
|
|
||||||
self._init_default_values()
|
self._init_default_values()
|
||||||
|
|
||||||
|
|
@ -51,6 +52,10 @@ class MeshingDialog(PamhyrDialog):
|
||||||
self._space_step = 50.0
|
self._space_step = 50.0
|
||||||
self._lplan = False
|
self._lplan = False
|
||||||
self._linear = False
|
self._linear = False
|
||||||
|
self._begin_cs = -1
|
||||||
|
self._end_cs = -1
|
||||||
|
|
||||||
|
self._init_default_values_profiles()
|
||||||
|
|
||||||
self.set_double_spin_box(
|
self.set_double_spin_box(
|
||||||
"doubleSpinBox_space_step",
|
"doubleSpinBox_space_step",
|
||||||
|
|
@ -62,6 +67,41 @@ class MeshingDialog(PamhyrDialog):
|
||||||
else:
|
else:
|
||||||
self.set_radio_button("radioButton_spline", True)
|
self.set_radio_button("radioButton_spline", True)
|
||||||
|
|
||||||
|
def _init_default_values_profiles(self):
|
||||||
|
profiles = self.profiles
|
||||||
|
|
||||||
|
self.combobox_add_items("comboBox_begin_kp", profiles)
|
||||||
|
self.combobox_add_items("comboBox_end_kp", profiles)
|
||||||
|
|
||||||
|
self.set_combobox_text("comboBox_begin_kp", profiles[0])
|
||||||
|
self.set_combobox_text("comboBox_end_kp", profiles[-1])
|
||||||
|
|
||||||
|
@property
|
||||||
|
def profiles(self):
|
||||||
|
if self._profiles == None:
|
||||||
|
self._profiles = list(
|
||||||
|
map(
|
||||||
|
lambda p: self._profile_name(p),
|
||||||
|
self._reach.profiles
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
return self._profiles
|
||||||
|
|
||||||
|
def _profile_name(self, profile):
|
||||||
|
name = profile.name
|
||||||
|
|
||||||
|
if name == "":
|
||||||
|
name = f"{profile.kp}"
|
||||||
|
else:
|
||||||
|
name += f" ({profile.kp})"
|
||||||
|
|
||||||
|
return name
|
||||||
|
|
||||||
|
def _get_guide_line(self):
|
||||||
|
gl = self._reach
|
||||||
|
return []
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def space_step(self):
|
def space_step(self):
|
||||||
return self._space_step
|
return self._space_step
|
||||||
|
|
@ -74,12 +114,26 @@ class MeshingDialog(PamhyrDialog):
|
||||||
def linear(self):
|
def linear(self):
|
||||||
return self._linear
|
return self._linear
|
||||||
|
|
||||||
|
@property
|
||||||
|
def begin_cs(self):
|
||||||
|
return self._begin_cs + 1
|
||||||
|
|
||||||
|
@property
|
||||||
|
def end_cs(self):
|
||||||
|
return self._end_cs + 1
|
||||||
|
|
||||||
def accept(self):
|
def accept(self):
|
||||||
self._space_step = self.get_double_spin_box(
|
self._space_step = self.get_double_spin_box(
|
||||||
"doubleSpinBox_space_step",
|
"doubleSpinBox_space_step",
|
||||||
)
|
)
|
||||||
self._linear = self.get_radio_button("radioButton_linear")
|
self._linear = self.get_radio_button("radioButton_linear")
|
||||||
|
|
||||||
|
p1 = self.get_combobox_text("comboBox_begin_kp")
|
||||||
|
p2 = self.get_combobox_text("comboBox_end_kp")
|
||||||
|
|
||||||
|
self._begin_cs = self.profiles.index(p1)
|
||||||
|
self._end_cs = self.profiles.index(p2)
|
||||||
|
|
||||||
super().accept()
|
super().accept()
|
||||||
|
|
||||||
def reject(self):
|
def reject(self):
|
||||||
|
|
|
||||||
|
|
@ -268,6 +268,7 @@ class GeometryWindow(PamhyrWindow):
|
||||||
if dlg.exec():
|
if dlg.exec():
|
||||||
data = {
|
data = {
|
||||||
"step": dlg.space_step,
|
"step": dlg.space_step,
|
||||||
|
"limites": [dlg.begin_cs, dlg.end_cs],
|
||||||
"lplan": dlg.lplan,
|
"lplan": dlg.lplan,
|
||||||
"linear": dlg.linear,
|
"linear": dlg.linear,
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue