From 4b2a486d512233cef54a8b59cce5724f6fb398ac Mon Sep 17 00:00:00 2001 From: Uwe Date: Wed, 10 Aug 2022 01:17:53 +0200 Subject: [PATCH] [FEM] fix selection issues with flow velocity constraint - same fix as commit 7e071623 for flow velocity constraint - the used selection widget did not highlight the selected faces. This made it very hard to work with when one has an existing document where e.g. 5 faces have a certain velocity and you cannot figure out which ones. To fix this use another selection widget --- .../task_constraint_flowvelocity.py | 21 ++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/src/Mod/Fem/femtaskpanels/task_constraint_flowvelocity.py b/src/Mod/Fem/femtaskpanels/task_constraint_flowvelocity.py index 3669c63bd3..7e98729b47 100644 --- a/src/Mod/Fem/femtaskpanels/task_constraint_flowvelocity.py +++ b/src/Mod/Fem/femtaskpanels/task_constraint_flowvelocity.py @@ -42,13 +42,24 @@ class _TaskPanel(object): def __init__(self, obj): self._obj = obj - self._refWidget = selection_widgets.BoundarySelector() - self._refWidget.setReferences(obj.References) + self._paramWidget = FreeCADGui.PySideUic.loadUi( FreeCAD.getHomePath() + "Mod/Fem/Resources/ui/FlowVelocity.ui" ) self._initParamWidget() - self.form = [self._refWidget, self._paramWidget] + + # geometry selection widget + # start with Solid in list! + self._selectionWidget = selection_widgets.GeometryElementsSelection( + obj.References, + ["Solid", "Face", "Edge", "Vertex"], + True, + False + ) + + # form made from param and selection widget + self.form = [self._paramWidget, self._selectionWidget] + analysis = obj.getParentGroup() self._mesh = None self._part = None @@ -72,8 +83,8 @@ class _TaskPanel(object): return True def accept(self): - if self._obj.References != self._refWidget.references(): - self._obj.References = self._refWidget.references() + if self._obj.References != self._selectionWidget.references: + self._obj.References = self._selectionWidget.references self._applyWidgetChanges() self._obj.Document.recompute() FreeCADGui.ActiveDocument.resetEdit()