Salome HOME
22599: EDF 8159 SMESH: Bad groups created by extrusion
[modules/smesh.git] / src / SMESH_SWIG / smeshBuilder.py
index ce0a35594f1a35befb4d9109ad41333536073ffd..6e0812455081549f998ed16694018a11e7158522 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.
@@ -4629,6 +4632,19 @@ class Mesh:
     def GetSkew(self, elemId):
         return self._valueFromFunctor(SMESH.FT_Skew, elemId)
 
+    ## 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)
+    #  @return tuple (min,max)
+    #  @ingroup l1_measurements
+    def GetMinMax(self, funType):
+        fun = self._getFunctor( funType )
+        if fun:
+            hist = fun.GetHistogram( 1, False )
+            if hist:
+                return hist[0].min, hist[0].max
+        return None
+
     pass # end of Mesh class
 
 ## Helper class for wrapping of SMESH.SMESH_Pattern CORBA class