Salome HOME
Remove NETGEN explicit usage from AutomaticTetrahedralization()
[modules/smesh.git] / src / SMESH_SWIG / smeshBuilder.py
index 778b72c3bf2fed3097d8cd286dde73066c6f18e7..1adf27d5f6c448632e3ca1a5660f5f6f1c555bad 100644 (file)
@@ -383,6 +383,9 @@ class smeshBuilder(object, SMESH._objref_SMESH_Gen):
     def init_smesh(self,theStudy,geompyD = None):
         #print "init_smesh"
         self.SetCurrentStudy(theStudy,geompyD)
+        if theStudy:
+            global notebook
+            notebook.myStudy = theStudy
 
     ## Creates a mesh. This can be either an empty mesh, possibly having an underlying geometry,
     #  or a mesh wrapping a CORBA mesh given as a parameter.
@@ -1517,7 +1520,7 @@ class Mesh:
             smeshgui.SetMeshIcon( salome.ObjectToID( self.mesh ), False, True )
             salome.sg.updateObjBrowser(1)
 
-    ## Computes a tetrahedral mesh using AutomaticLength + MEFISTO + NETGEN
+    ## Computes a tetrahedral mesh using AutomaticLength + MEFISTO + Tetrahedron
     #  @param fineness [0.0,1.0] defines mesh fineness
     #  @return True or False
     #  @ingroup l3_algos_basic
@@ -1530,8 +1533,7 @@ class Mesh:
             self.Triangle().LengthFromEdges()
             pass
         if dim > 2 :
-            from salome.NETGENPlugin.NETGENPluginBuilder import NETGEN
-            self.Tetrahedron(NETGEN)
+            self.Tetrahedron()
             pass
         return self.Compute()
 
@@ -4632,12 +4634,22 @@ class Mesh:
     ## Return minimal and maximal value of a given functor.
     #  @param funType a functor type, an item of SMESH.FunctorType enum
     #         (one of SMESH.FunctorType._items)
+    #  @param meshPart a part of mesh (group, sub-mesh) to treat
     #  @return tuple (min,max)
     #  @ingroup l1_measurements
-    def GetMinMax(self, funType):
+    def GetMinMax(self, funType, meshPart=None):
+        unRegister = genObjUnRegister()
+        if isinstance( meshPart, list ):
+            meshPart = self.GetIDSource( meshPart, SMESH.ALL )
+            unRegister.set( meshPart )
+        if isinstance( meshPart, Mesh ):
+            meshPart = meshPart.mesh
         fun = self._getFunctor( funType )
         if fun:
-            hist = fun.GetHistogram( 1, False )
+            if meshPart:
+                hist = fun.GetLocalHistogram( 1, False, meshPart )
+            else:
+                hist = fun.GetHistogram( 1, False )
             if hist:
                 return hist[0].min, hist[0].max
         return None