Example #1
0
    def __init__(self, obj):
        self._obj = obj

        self._paramWidget = FreeCADGui.PySideUic.loadUi(
            FreeCAD.getHomePath() +
            "Mod/Fem/Resources/ui/ElectrostaticPotential.ui")
        self._initParamWidget()

        # 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
        if analysis is not None:
            self._mesh = membertools.get_single_member(analysis,
                                                       "Fem::FemMeshObject")
        if self._mesh is not None:
            self._part = femutils.get_part_to_mesh(self._mesh)
        self._partVisible = None
        self._meshVisible = None
Example #2
0
 def checkMeshType(self):
     mesh = membertools.get_single_member(self.analysis,
                                          "Fem::FemMeshObject")
     if not femutils.is_of_type(mesh, "Fem::FemMeshGmsh"):
         self.report.error("Unsupported type of mesh. "
                           "Mesh must be created with gmsh.")
         self.fail()
         return False
     return True
 def __init__(self, obj):
     self._obj = obj
     self._paramWidget = FreeCADGui.PySideUic.loadUi(
         FreeCAD.getHomePath() + "Mod/Fem/Resources/ui/InitialFlowVelocity.ui")
     self._initParamWidget()
     self.form = [self._paramWidget]
     analysis = obj.getParentGroup()
     self._mesh = membertools.get_single_member(analysis, "Fem::FemMeshObject")
     self._part = None
     if self._mesh is not None:
         self._part = femutils.get_part_to_mesh(self._mesh)
     self._partVisible = None
     self._meshVisible = None
 def __init__(self, obj):
     self._obj = obj
     self._refWidget = FemSelectionWidgets.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]
     analysis = obj.getParentGroup()
     self._mesh = membertools.get_single_member(analysis, "Fem::FemMeshObject")
     self._part = None
     if self._mesh is not None:
         self._part = femutils.get_part_to_mesh(self._mesh)
     self._partVisible = None
     self._meshVisible = None
Example #5
0
 def __init__(self, obj):
     self._obj = obj
     self._refWidget = selection_widgets.SolidSelector()
     self._refWidget.setReferences(obj.References)
     propWidget = obj.ViewObject.Proxy.getTaskWidget(obj.ViewObject)
     if propWidget is None:
         self.form = self._refWidget
     else:
         self.form = [self.refWidget, propWidget]
     analysis = obj.getParentGroup()
     self._mesh = membertools.get_single_member(analysis,
                                                "Fem::FemMeshObject")
     self._part = self._mesh.Part if self._mesh is not None else None
     self._partVisible = None
     self._meshVisible = None
Example #6
0
 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]
     analysis = obj.getParentGroup()
     self._mesh = None
     self._part = None
     if analysis is not None:
         self._mesh = membertools.get_single_member(analysis,
                                                    "Fem::FemMeshObject")
     if self._mesh is not None:
         self._part = femutils.get_part_to_mesh(self._mesh)
     self._partVisible = None
     self._meshVisible = None
     QtCore.QObject.connect(self._paramWidget.capacitanceBodyBox,
                            QtCore.SIGNAL("stateChanged(int)"),
                            self.capacitanceBodyBox_checked)
Example #7
0
 def _getSingleMember(self, t):
     return membertools.get_single_member(self.analysis, t)