mirror of
https://git.salome-platform.org/gitpub/modules/geom.git
synced 2025-01-29 04:10:33 +05:00
[bos #38044][EDF] (2023-T3) Support for automatic reparation. Added selected sub-shapes list for locate subshapes dialog.
This commit is contained in:
parent
b88417223a
commit
0636dbf213
@ -30,6 +30,7 @@ GEOM_RESULT_NAME_GRP = 'Result name'
|
|||||||
NAME_LBL = 'Name'
|
NAME_LBL = 'Name'
|
||||||
GEOM_SELECTED_LBL = 'Name'
|
GEOM_SELECTED_LBL = 'Name'
|
||||||
GEOM_SELECTED_SHAPE = 'Selected shape'
|
GEOM_SELECTED_SHAPE = 'Selected shape'
|
||||||
|
GEOM_SELECTED_SUBSHAPE = 'Selected sub-shape'
|
||||||
|
|
||||||
class DlgRef_1Sel_QTD(Ui_DlgRef_1Sel_QTD, QWidget):
|
class DlgRef_1Sel_QTD(Ui_DlgRef_1Sel_QTD, QWidget):
|
||||||
"""
|
"""
|
||||||
|
@ -21,11 +21,13 @@
|
|||||||
|
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
from qtsalome import QGridLayout, QFrame, QApplication, QComboBox, QLabel, QPushButton, QMessageBox
|
from qtsalome import QGridLayout, QFrame, QApplication, \
|
||||||
|
QComboBox, QLabel, QPushButton, QMessageBox
|
||||||
|
|
||||||
from salome.geom.geomrepairadv.basedlg import BaseDlg
|
from salome.geom.geomrepairadv.basedlg import BaseDlg
|
||||||
|
|
||||||
from .geomrepairadv_common import DlgRef_1Spin_QTD
|
from .geomrepairadv_common import DlgRef_1Spin_QTD, DlgRef_1Sel_QTD, \
|
||||||
|
GEOM_SELECTED_SUBSHAPE
|
||||||
import GEOM
|
import GEOM
|
||||||
|
|
||||||
class LocateSubShapesDlg(BaseDlg):
|
class LocateSubShapesDlg(BaseDlg):
|
||||||
@ -47,6 +49,9 @@ class LocateSubShapesDlg(BaseDlg):
|
|||||||
self._type_widget.setToolTip('Select a type of shape measurement')
|
self._type_widget.setToolTip('Select a type of shape measurement')
|
||||||
self._type_widget.currentIndexChanged.connect(self.on_measurment_type_changed)
|
self._type_widget.currentIndexChanged.connect(self.on_measurment_type_changed)
|
||||||
|
|
||||||
|
# A widget to show preliminarily selected sub-shapes
|
||||||
|
self._pre_selected_widget = self.create_pre_selected_widget()
|
||||||
|
|
||||||
# Min/max values widgets
|
# Min/max values widgets
|
||||||
decimals = 2
|
decimals = 2
|
||||||
max_value = sys.float_info.max
|
max_value = sys.float_info.max
|
||||||
@ -60,9 +65,10 @@ class LocateSubShapesDlg(BaseDlg):
|
|||||||
# Add the widgets to layout
|
# Add the widgets to layout
|
||||||
layout.addWidget(type_label, 0, 0)
|
layout.addWidget(type_label, 0, 0)
|
||||||
layout.addWidget(self._type_widget, 1, 0)
|
layout.addWidget(self._type_widget, 1, 0)
|
||||||
layout.addWidget(self._min_widget, 2, 0)
|
layout.addWidget(self._pre_selected_widget, 2, 0)
|
||||||
layout.addWidget(self._max_widget, 3, 0)
|
layout.addWidget(self._min_widget, 3, 0)
|
||||||
layout.addWidget(self._select_button, 4, 0)
|
layout.addWidget(self._max_widget, 4, 0)
|
||||||
|
layout.addWidget(self._select_button, 5, 0)
|
||||||
|
|
||||||
# Init base dialog
|
# Init base dialog
|
||||||
BaseDlg.__init__(
|
BaseDlg.__init__(
|
||||||
@ -75,6 +81,41 @@ class LocateSubShapesDlg(BaseDlg):
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def create_pre_selected_widget(self):
|
||||||
|
"""
|
||||||
|
Returns a widget that lists preliminarily selected for processing sub_shapes.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
None.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
A new widget.
|
||||||
|
"""
|
||||||
|
|
||||||
|
pre_sel_widget = DlgRef_1Sel_QTD()
|
||||||
|
pre_sel_widget.TextLabel1.setText(GEOM_SELECTED_SUBSHAPE)
|
||||||
|
pre_sel_widget.PushButton1.clicked.connect(self.on_select_subshape)
|
||||||
|
|
||||||
|
return pre_sel_widget
|
||||||
|
|
||||||
|
|
||||||
|
def on_select_subshape(self):
|
||||||
|
"""
|
||||||
|
Updates pre selected widget.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
None.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
None.
|
||||||
|
"""
|
||||||
|
|
||||||
|
selected_ids = self.get_local_selection()
|
||||||
|
selected_ids_str = ', '.join(str(id) for id in selected_ids)
|
||||||
|
self._pre_selected_widget.LineEdit1.setText(selected_ids_str)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def get_limits(self):
|
def get_limits(self):
|
||||||
"""
|
"""
|
||||||
Returns current values for min/max limits.
|
Returns current values for min/max limits.
|
||||||
@ -124,6 +165,9 @@ class LocateSubShapesDlg(BaseDlg):
|
|||||||
selection_level = self.get_measurment_type(index)
|
selection_level = self.get_measurment_type(index)
|
||||||
self.set_selection_level(selection_level)
|
self.set_selection_level(selection_level)
|
||||||
|
|
||||||
|
# Clear pre selected sub-shapes list
|
||||||
|
self.on_select_subshape()
|
||||||
|
|
||||||
|
|
||||||
def on_select_button_clicked(self):
|
def on_select_button_clicked(self):
|
||||||
"""
|
"""
|
||||||
|
Loading…
Reference in New Issue
Block a user