Salome HOME
22874: [CEA 1425] Performance SMESH Module
[modules/smesh.git] / src / SMESH_SWIG / smeshBuilder.py
index 60bf355a7fb076c3d5e1c7090869eaed191bfd62..b4f79d7356e2ed27ff664744de29fc9be4ef4236 100644 (file)
@@ -520,7 +520,8 @@ class smeshBuilder(object, SMESH._objref_SMESH_Gen):
         #return self.IsEmbeddedMode()
         return SMESH._objref_SMESH_Gen.IsEmbeddedMode(self)
 
-    ## Sets the current study
+    ## Sets the current study. Calling SetCurrentStudy( None ) allows to
+    #  switch OFF automatic pubilishing in the Study of mesh objects.
     #  @ingroup l1_auxiliary
     def SetCurrentStudy( self, theStudy, geompyD = None ):
         #self.SetCurrentStudy(theStudy)
@@ -601,14 +602,15 @@ class smeshBuilder(object, SMESH._objref_SMESH_Gen):
         if error.comment: print "*** CreateMeshesFromGMF() errors:\n", error.comment
         return Mesh(self, self.geompyD, aSmeshMesh), error
 
-    ## Concatenate the given meshes into one mesh.
-    #  @return an instance of Mesh class
+    ## Concatenate the given meshes into one mesh. All groups of input meshes will be
+    #  present in the new mesh.
     #  @param meshes the meshes to combine into one mesh
     #  @param uniteIdenticalGroups if true, groups with same names are united, else they are renamed
-    #  @param mergeNodesAndElements if true, equal nodes and elements aremerged
+    #  @param mergeNodesAndElements if true, equal nodes and elements are merged
     #  @param mergeTolerance tolerance for merging nodes
-    #  @param allGroups forces creation of groups of all elements
+    #  @param allGroups forces creation of groups corresponding to every input mesh
     #  @param name name of a new mesh
+    #  @return an instance of Mesh class
     def Concatenate( self, meshes, uniteIdenticalGroups,
                      mergeNodesAndElements = False, mergeTolerance = 1e-5, allGroups = False,
                      name = ""):
@@ -1375,9 +1377,10 @@ class Mesh:
     #  @param discardModifs if True and the mesh has been edited since
     #         a last total re-compute and that may prevent successful partial re-compute,
     #         then the mesh is cleaned before Compute()
+    #  @param refresh if @c True, Object browser is automatically updated (when running in GUI)
     #  @return True or False
     #  @ingroup l2_construct
-    def Compute(self, geom=0, discardModifs=False):
+    def Compute(self, geom=0, discardModifs=False, refresh=False):
         if geom == 0 or not isinstance(geom, geomBuilder.GEOM._objref_GEOM_Object):
             if self.geom == 0:
                 geom = self.mesh.GetShapeToMesh()
@@ -1505,7 +1508,7 @@ class Mesh:
             smeshgui = salome.ImportComponentGUI("SMESH")
             smeshgui.Init(self.mesh.GetStudyId())
             smeshgui.SetMeshIcon( salome.ObjectToID( self.mesh ), ok, (self.NbNodes()==0) )
-            salome.sg.updateObjBrowser(1)
+            if refresh: salome.sg.updateObjBrowser(1)
             pass
         return ok
 
@@ -1522,25 +1525,28 @@ class Mesh:
         return self.mesh.SetMeshOrder(submeshes)
 
     ## Removes all nodes and elements
+    #  @param refresh if @c True, Object browser is automatically updated (when running in GUI)
     #  @ingroup l2_construct
-    def Clear(self):
+    def Clear(self, refresh=False):
         self.mesh.Clear()
         if ( salome.sg.hasDesktop() and 
-             salome.myStudyManager.GetStudyByID( self.mesh.GetStudyId() )):
+             salome.myStudyManager.GetStudyByID( self.mesh.GetStudyId() ) ):
             smeshgui = salome.ImportComponentGUI("SMESH")
             smeshgui.Init(self.mesh.GetStudyId())
             smeshgui.SetMeshIcon( salome.ObjectToID( self.mesh ), False, True )
-            salome.sg.updateObjBrowser(1)
+            if refresh: salome.sg.updateObjBrowser(1)
 
     ## Removes all nodes and elements of indicated shape
+    #  @param refresh if @c True, Object browser is automatically updated (when running in GUI)
+    #  @param geomId the ID of a sub-shape to remove elements on
     #  @ingroup l2_construct
-    def ClearSubMesh(self, geomId):
+    def ClearSubMesh(self, geomId, refresh=False):
         self.mesh.ClearSubMesh(geomId)
         if salome.sg.hasDesktop():
             smeshgui = salome.ImportComponentGUI("SMESH")
             smeshgui.Init(self.mesh.GetStudyId())
             smeshgui.SetMeshIcon( salome.ObjectToID( self.mesh ), False, True )
-            salome.sg.updateObjBrowser(1)
+            if refresh: salome.sg.updateObjBrowser(1)
 
     ## Computes a tetrahedral mesh using AutomaticLength + MEFISTO + Tetrahedron
     #  @param fineness [0.0,1.0] defines mesh fineness