+
+## 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
+#
+class meshProxy(SMESH._objref_SMESH_Mesh):
+ def __init__(self):
+ SMESH._objref_SMESH_Mesh.__init__(self)
+ def __deepcopy__(self, memo=None):
+ new = self.__class__()
+ 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 )
+ pass
+omniORB.registerObjref(SMESH._objref_SMESH_Mesh._NP_RepositoryId, meshProxy)
+
+
+## Private class wrapping SMESH.SMESH_SubMesh in order to add Compute()
+#
+class submeshProxy(SMESH._objref_SMESH_subMesh):
+ def __init__(self):
+ SMESH._objref_SMESH_subMesh.__init__(self)
+ self.mesh = None
+ def __deepcopy__(self, memo=None):
+ new = self.__class__()
+ return new
+
+ ## Compute the sub-mesh and return the status of the computation
+ # @param refresh if @c True, Object browser is automatically updated (when running in GUI)
+ # @return True or False
+ #
+ # This is a method of SMESH.SMESH_submesh that can be obtained via Mesh.GetSubMesh() or
+ # @ref smesh_algorithm.Mesh_Algorithm.GetSubMesh() "Mesh_Algorithm.GetSubMesh()".
+ # @ingroup l2_submeshes
+ def Compute(self,refresh=False):
+ if not self.mesh:
+ self.mesh = Mesh( smeshBuilder(), None, self.GetMesh())
+
+ ok = self.mesh.Compute( self.GetSubShape(),refresh=[] )
+
+ if salome.sg.hasDesktop() and self.mesh.GetStudyId() >= 0:
+ smeshgui = salome.ImportComponentGUI("SMESH")
+ smeshgui.Init(self.mesh.GetStudyId())
+ smeshgui.SetMeshIcon( salome.ObjectToID( self ), ok, (self.GetNumberOfElements()==0) )
+ if refresh: salome.sg.updateObjBrowser(True)
+ pass
+
+ return ok
+ pass
+omniORB.registerObjref(SMESH._objref_SMESH_subMesh._NP_RepositoryId, submeshProxy)
+
+
+## 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
+#
+class meshEditor(SMESH._objref_SMESH_MeshEditor):
+ def __init__(self):
+ SMESH._objref_SMESH_MeshEditor.__init__(self)
+ 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__()
+ 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): # a 2nd arg added (NodesToKeep)
+ if len( args ) == 1:
+ return SMESH._objref_SMESH_MeshEditor.MergeNodes( self, args[0], [] )
+ NodesToKeep = args[1]
+ 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 )
+ pass
+omniORB.registerObjref(SMESH._objref_SMESH_MeshEditor._NP_RepositoryId, meshEditor)
+
+## Private class wrapping SMESH.SMESH_Pattern CORBA class in order to treat Notebook
+# variables in some methods