[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
This commit is contained in:
Uwe
2022-08-10 01:17:53 +02:00
parent 8acce95ebb
commit 4b2a486d51

View File

@@ -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()