+
+## Class wrapping 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
+
+ ## Computes the sub-mesh and returns the status of the computation
+ # @param refresh if @c True, Object browser is automatically updated (when running in GUI)
+ # @return True or False
+ # @ingroup l2_construct
+ 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(1)
+ pass
+
+ return ok
+ pass
+omniORB.registerObjref(SMESH._objref_SMESH_subMesh._NP_RepositoryId, submeshProxy)
+
+
+## Class used to compensate change of CORBA API of SMESH_MeshEditor for backward compatibility