+
+
+class meshProxy(SMESH._objref_SMESH_Mesh):
+ """
+ Private class used to compensate change of CORBA API of SMESH_Mesh for backward compatibility
+ with old dump scripts which call SMESH_Mesh directly and not via smeshBuilder.Mesh
+ """
+ def __init__(self,*args):
+ SMESH._objref_SMESH_Mesh.__init__(self,*args)
+ def __deepcopy__(self, memo=None):
+ new = self.__class__(self)
+ return new
+ def CreateDimGroup(self,*args): # 2 args added: nbCommonNodes, underlyingOnly
+ if len( args ) == 3:
+ args += SMESH.ALL_NODES, True
+ return SMESH._objref_SMESH_Mesh.CreateDimGroup(self, *args)
+ def ExportToMEDX(self, *args): # function removed
+ print("WARNING: ExportToMEDX() is deprecated, use ExportMED() instead")
+ #args = [i for i in args if i not in [SMESH.MED_V2_1, SMESH.MED_V2_2]]
+ SMESH._objref_SMESH_Mesh.ExportMED(self, *args)
+ def ExportToMED(self, *args): # function removed
+ print("WARNING: ExportToMED() is deprecated, use ExportMED() instead")
+ #args = [i for i in args if i not in [SMESH.MED_V2_1, SMESH.MED_V2_2]]
+ args2 = list(args)
+ while len(args2) < 5: # !!!! nb of parameters for ExportToMED IDL's method
+ args2.append(True)
+ SMESH._objref_SMESH_Mesh.ExportMED(self, *args2)
+ def ExportPartToMED(self, *args): # 'version' parameter removed
+ #args = [i for i in args if i not in [SMESH.MED_V2_1, SMESH.MED_V2_2]]
+ SMESH._objref_SMESH_Mesh.ExportPartToMED(self, *args)
+ def ExportMED(self, *args): # signature of method changed
+ #args = [i for i in args if i not in [SMESH.MED_V2_1, SMESH.MED_V2_2]]
+ args2 = list(args)
+ while len(args2) < 5: # !!!! nb of parameters for ExportToMED IDL's method
+ args2.append(True)
+ SMESH._objref_SMESH_Mesh.ExportMED(self, *args2)
+ pass
+omniORB.registerObjref(SMESH._objref_SMESH_Mesh._NP_RepositoryId, meshProxy)
+
+
+class submeshProxy(SMESH._objref_SMESH_subMesh):
+
+ """
+ Private class wrapping SMESH.SMESH_SubMesh in order to add Compute()
+ """
+ def __init__(self,*args):
+ SMESH._objref_SMESH_subMesh.__init__(self,*args)
+ self.mesh = None
+ def __deepcopy__(self, memo=None):
+ new = self.__class__(self)
+ return new
+
+ def Compute(self,refresh=False):
+ """
+ Compute the sub-mesh and return the status of the computation
+
+ Parameters:
+ refresh: if *True*, Object Browser is automatically updated (when running in GUI)
+
+ Returns:
+ True or False
+
+ This is a method of SMESH.SMESH_submesh that can be obtained via Mesh.GetSubMesh() or
+ :meth:`smeshBuilder.Mesh.GetSubMesh`.
+ """
+
+ if not self.mesh:
+ self.mesh = Mesh( smeshBuilder(), None, self.GetMesh())
+
+ ok = self.mesh.Compute( self.GetSubShape(),refresh=[] )
+
+ if salome.sg.hasDesktop():
+ if refresh: salome.sg.updateObjBrowser()
+ pass
+
+ return ok
+ pass
+omniORB.registerObjref(SMESH._objref_SMESH_subMesh._NP_RepositoryId, submeshProxy)
+
+
+class meshEditor(SMESH._objref_SMESH_MeshEditor):
+ """
+ Private class used to compensate change of CORBA API of SMESH_MeshEditor for backward
+ compatibility with old dump scripts which call SMESH_MeshEditor directly and not via
+ smeshBuilder.Mesh
+ """
+ def __init__(self,*args):
+ SMESH._objref_SMESH_MeshEditor.__init__( self, *args)
+ self.mesh = None
+ def __getattr__(self, name ): # method called if an attribute not found
+ if not self.mesh: # look for name() method in Mesh class
+ self.mesh = Mesh( None, None, SMESH._objref_SMESH_MeshEditor.GetMesh(self))
+ if hasattr( self.mesh, name ):
+ return getattr( self.mesh, name )
+ if name == "ExtrusionAlongPathObjX":
+ return getattr( self.mesh, "ExtrusionAlongPathX" ) # other method name
+ print("meshEditor: attribute '%s' NOT FOUND" % name)
+ return None
+ def __deepcopy__(self, memo=None):
+ new = self.__class__(self)
+ return new
+ def FindCoincidentNodes(self,*args): # a 2nd arg added (SeparateCornerAndMediumNodes)
+ if len( args ) == 1: args += False,
+ return SMESH._objref_SMESH_MeshEditor.FindCoincidentNodes( self, *args )
+ def FindCoincidentNodesOnPart(self,*args): # a 3d arg added (SeparateCornerAndMediumNodes)
+ if len( args ) == 2: args += False,
+ return SMESH._objref_SMESH_MeshEditor.FindCoincidentNodesOnPart( self, *args )
+ def MergeNodes(self,*args): # 2 args added (NodesToKeep,AvoidMakingHoles)
+ if len( args ) == 1:
+ return SMESH._objref_SMESH_MeshEditor.MergeNodes( self, args[0], [], False )
+ NodesToKeep = args[1]
+ AvoidMakingHoles = args[2] if len( args ) == 3 else False
+ unRegister = genObjUnRegister()
+ if NodesToKeep:
+ if isinstance( NodesToKeep, list ) and isinstance( NodesToKeep[0], int ):
+ NodesToKeep = self.MakeIDSource( NodesToKeep, SMESH.NODE )
+ if not isinstance( NodesToKeep, list ):
+ NodesToKeep = [ NodesToKeep ]
+ return SMESH._objref_SMESH_MeshEditor.MergeNodes( self, args[0], NodesToKeep, AvoidMakingHoles )
+ pass
+omniORB.registerObjref(SMESH._objref_SMESH_MeshEditor._NP_RepositoryId, meshEditor)
+