Skip to content

Commit

Permalink
[FEM] fix selection issues with flow velocity constraint
Browse files Browse the repository at this point in the history
- same fix as commit 7e07162 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
  • Loading branch information
donovaly committed Aug 9, 2022
1 parent 8acce95 commit 4b2a486
Showing 1 changed file with 16 additions and 5 deletions.
21 changes: 16 additions & 5 deletions src/Mod/Fem/femtaskpanels/task_constraint_flowvelocity.py
Expand Up @@ -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
Expand All @@ -72,8 +83,8 @@ def reject(self):
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()
Expand Down

0 comments on commit 4b2a486

Please sign in to comment.