FEM: use python base constraint class, mesh result mesh

This commit is contained in:
Bernd Hahnebach
2020-03-03 21:04:51 +01:00
parent 36118fb59e
commit 62fa28fc63
2 changed files with 9 additions and 33 deletions

View File

@@ -28,27 +28,11 @@ __url__ = "http://www.freecadweb.org"
# \ingroup FEM
# \brief FreeCAD FEM _ViewProviderFemMeshResult
from . import ViewProviderFemConstraint
class _ViewProviderFemMeshResult:
class _ViewProviderFemMeshResult(ViewProviderFemConstraint.ViewProxy):
"A View Provider for the FemMeshResult object"
def __init__(self, vobj):
vobj.Proxy = self
def getIcon(self):
return ":/icons/fem-femmesh-result.svg"
def attach(self, vobj):
self.ViewObject = vobj
self.Object = vobj.Object
def updateData(self, obj, prop):
return
def onChanged(self, vobj, prop):
return
def __getstate__(self):
return None
def __setstate__(self, state):
return None

View File

@@ -27,22 +27,14 @@ __url__ = "http://www.freecadweb.org"
# \ingroup FEM
# \brief FreeCAD FEM _FemMeshResult
from . import FemConstraint
class _FemMeshResult():
class _FemMeshResult(FemConstraint.Proxy):
"""The Fem::FemMeshObject's Proxy python type, add Result specific object type
"""
Type = "Fem::FemMeshResult"
def __init__(self, obj):
self.Type = "Fem::FemMeshResult"
self.Object = obj # keep a ref to the DocObj for nonGui usage
obj.Proxy = self # link between App::DocumentObject to this object
def execute(self, obj):
return
def __getstate__(self):
return self.Type
def __setstate__(self, state):
if state:
self.Type = state
super(_FemMeshResult, self).__init__(obj)