[FEM] fix selection issues with electrostatic 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 voltage and you cannot figure out which ones.
To fix this use another selection widget
This commit is contained in:
Uwe
2022-08-07 02:33:09 +02:00
parent e3edfc1ca3
commit 7ffbf56c4e

View File

@@ -42,12 +42,23 @@ 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/ElectrostaticPotential.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
@@ -71,8 +82,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()