FEM: mesh boundary layer, rename class and module

This commit is contained in:
Bernd Hahnebach
2020-05-22 01:07:54 +02:00
parent 06eae6d9b2
commit b0772362d4
6 changed files with 33 additions and 21 deletions

View File

@@ -251,7 +251,7 @@ SET(FemObjectsScripts_SRCS
femobjects/_FemMaterial.py
femobjects/material_mechanicalnonlinear.py
femobjects/material_reinforced.py
femobjects/_FemMeshBoundaryLayer.py
femobjects/mesh_boundarylayer.py
femobjects/_FemMeshGmsh.py
femobjects/_FemMeshGroup.py
femobjects/_FemMeshRegion.py
@@ -333,12 +333,12 @@ SET(FemGuiViewObjects_SRCS
femviewprovider/view_element_rotation1D.py
femviewprovider/view_material_mechanicalnonlinear.py
femviewprovider/view_material_reinforced.py
femviewprovider/view_mesh_boundarylayer.py
)
SET(FemGuiScripts_SRCS
femguiobjects/__init__.py
femguiobjects/_ViewProviderFemMaterial.py
femguiobjects/_ViewProviderFemMeshBoundaryLayer.py
femguiobjects/_ViewProviderFemMeshGmsh.py
femguiobjects/_ViewProviderFemMeshGroup.py
femguiobjects/_ViewProviderFemMeshRegion.py

View File

@@ -436,8 +436,8 @@ def makeMeshBoundaryLayer(
"""makeMeshBoundaryLayer(document, base_mesh, [name]):
creates a FEM mesh BoundaryLayer object to define boundary layer properties"""
obj = doc.addObject("Fem::FeaturePython", name)
from femobjects import _FemMeshBoundaryLayer
_FemMeshBoundaryLayer._FemMeshBoundaryLayer(obj)
from femobjects import mesh_boundarylayer
mesh_boundarylayer.MeshBoundaryLayer(obj)
# obj.BaseMesh = base_mesh
# App::PropertyLinkList does not support append
# we will use a temporary list to append the mesh BoundaryLayer obj. to the list
@@ -445,8 +445,8 @@ def makeMeshBoundaryLayer(
tmplist.append(obj)
base_mesh.MeshBoundaryLayerList = tmplist
if FreeCAD.GuiUp:
from femguiobjects import _ViewProviderFemMeshBoundaryLayer
_ViewProviderFemMeshBoundaryLayer._ViewProviderFemMeshBoundaryLayer(obj.ViewObject)
from femviewprovider import view_mesh_boundarylayer
view_mesh_boundarylayer.VPMeshBoundaryLayer(obj.ViewObject)
return obj

View File

@@ -25,22 +25,22 @@ __title__ = "FreeCAD FEM mesh boundary layer document object"
__author__ = "Bernd Hahnebach, Qingfeng Xia"
__url__ = "http://www.freecadweb.org"
## @package FemMeshBoundaryLayer
## @package mesh_boundarylayer
# \ingroup FEM
# \brief FEM mesh boundary layer object
# \brief mesh boundary layer object
from . import FemConstraint
class _FemMeshBoundaryLayer(FemConstraint.Proxy):
class MeshBoundaryLayer(FemConstraint.Proxy):
"""
The FemMeshBoundaryLayer object
The MeshBoundaryLayer object
"""
Type = "Fem::MeshBoundaryLayer"
def __init__(self, obj):
super(_FemMeshBoundaryLayer, self).__init__(obj)
super(MeshBoundaryLayer, self).__init__(obj)
obj.addProperty(
"App::PropertyInteger",

View File

@@ -63,6 +63,8 @@ class FemMigrateApp(object):
return self
if fullname == "femobjects._FemMaterialReinforced":
return self
if fullname == "femobjects._FemMeshBoundaryLayer":
return self
if fullname == "PyObjects":
return self
@@ -196,6 +198,9 @@ class FemMigrateApp(object):
if module.__name__ == "femobjects._FemMaterialReinforced":
import femobjects.material_reinforced
module._FemMaterialReinforced = femobjects.material_reinforced.MaterialReinforced
if module.__name__ == "femobjects._FemMeshBoundaryLayer":
import femobjects.mesh_boundarylayer
module._FemMeshBoundaryLayer = femobjects.mesh_boundarylayer.MeshBoundaryLayer
if module.__name__ == "PyObjects":
module.__path__ = "PyObjects"
@@ -233,8 +238,8 @@ class FemMigrateApp(object):
import femobjects.material_mechanicalnonlinear
module._FemMaterialMechanicalNonlinear = femobjects.material_mechanicalnonlinear.MaterialMechanicalNonlinear
if module.__name__ == "PyObjects._FemMeshBoundaryLayer":
import femobjects._FemMeshBoundaryLayer
module._FemMeshBoundaryLayer = femobjects._FemMeshBoundaryLayer._FemMeshBoundaryLayer
import femobjects.mesh_boundarylayer
module._FemMeshBoundaryLayer = femobjects.mesh_boundarylayer.MeshBoundaryLayer
if module.__name__ == "PyObjects._FemMeshGmsh":
import femobjects._FemMeshGmsh
module._FemMeshGmsh = femobjects._FemMeshGmsh._FemMeshGmsh
@@ -354,6 +359,7 @@ module="femobjects._FemElementGeometry2D"
module="femobjects._FemElementRotation1D"
module="femobjects._FemMaterialMechanicalNonlinear"
module="femobjects._FemMaterialReinforced"
module="femobjects._FemMeshBoundaryLayer"
third big moving
from PyObjects to femobjects, following the parent commit

View File

@@ -61,6 +61,8 @@ class FemMigrateGui(object):
return self
if fullname == "femguiobjects._ViewProviderFemMaterialReinforced":
return self
if fullname == "femguiobjects._ViewProviderFemMeshBoundaryLayer":
return self
if fullname == "PyGui":
return self
@@ -184,6 +186,9 @@ class FemMigrateGui(object):
if module.__name__ == "femguiobjects._ViewProviderFemMaterialReinforced":
import femviewprovider.view_material_reinforced
module._ViewProviderFemMaterialReinforced = femviewprovider.view_material_reinforced.VPMaterialReinforced
if module.__name__ == "femguiobjects._ViewProviderFemMeshBoundaryLayer":
import femviewprovider.view_mesh_boundarylayer
module._ViewProviderFemMeshBoundaryLayer = femviewprovider.view_mesh_boundarylayer.VPMeshBoundaryLayer
if module.__name__ == "PyGui":
module.__path__ = "PyGui"
@@ -221,8 +226,8 @@ class FemMigrateGui(object):
import femviewprovider.view_material_mechanicalnonlinear
module._ViewProviderFemMaterialMechanicalNonlinear = femviewprovider.view_material_mechanicalnonlinear.VPMaterialMechanicalNonlinear
if module.__name__ == "PyGui._ViewProviderFemMeshBoundaryLayer":
import femguiobjects._ViewProviderFemMeshBoundaryLayer
module._ViewProviderFemMeshBoundaryLayer = femguiobjects._ViewProviderFemMeshBoundaryLayer._ViewProviderFemMeshBoundaryLayer
import femviewprovider.view_mesh_boundarylayer
module._ViewProviderFemMeshBoundaryLayer = femviewprovider.view_mesh_boundarylayer.VPMeshBoundaryLayer
if module.__name__ == "PyGui._ViewProviderFemMeshGmsh":
import femguiobjects._ViewProviderFemMeshGmsh
module._ViewProviderFemMeshGmsh = femguiobjects._ViewProviderFemMeshGmsh._ViewProviderFemMeshGmsh
@@ -318,6 +323,7 @@ module="femguiobjects._ViewProviderFemElementGeometry2D"
module="femguiobjects._ViewProviderFemElementRotation1D"
module="femguiobjects._ViewProviderFemMaterialMechanicalNonlinear"
module="femguiobjects._ViewProviderFemMaterialReinforced"
module="femguiobjects._ViewProviderFemMeshBoundaryLayer"
third big moving
from PyGui to femguiobjects, following the parent commit

View File

@@ -25,9 +25,9 @@ __title__ = "FreeCAD FEM mesh boundary layer ViewProvider for the document objec
__author__ = "Bernd Hahnebach, Qingfeng Xia"
__url__ = "http://www.freecadweb.org"
## @package ViewProviderFemMeshBoundaryLayer
## @package view_mesh_boundarylayer
# \ingroup FEM
# \brief FreeCAD FEM _ViewProviderFemMeshBoundaryLayer
# \brief view provider for mesh boundary object
from PySide import QtCore
@@ -35,12 +35,12 @@ import FreeCAD
import FreeCADGui
from femguiutils import selection_widgets
from . import ViewProviderFemConstraint
from femguiobjects import ViewProviderFemConstraint
class _ViewProviderFemMeshBoundaryLayer(ViewProviderFemConstraint.ViewProxy):
class VPMeshBoundaryLayer(ViewProviderFemConstraint.ViewProxy):
"""
A View Provider for the FemMeshBoundaryLayer object
A View Provider for the MeshBoundaryLayer object
"""
def setEdit(self, vobj, mode=0):
@@ -54,7 +54,7 @@ class _ViewProviderFemMeshBoundaryLayer(ViewProviderFemConstraint.ViewProxy):
class _TaskPanel:
"""
The TaskPanel for editing References property of FemMeshBoundaryLayer objects
The TaskPanel for editing References property of MeshBoundaryLayer objects
"""
def __init__(self, obj):