mirror of
https://git.salome-platform.org/gitpub/modules/smesh.git
synced 2025-01-15 11:50:33 +05:00
Improve GetMinMax()
This commit is contained in:
parent
c365f36e98
commit
5f3d1965f6
@ -4635,11 +4635,21 @@ class Mesh:
|
|||||||
## Return minimal and maximal value of a given functor.
|
## Return minimal and maximal value of a given functor.
|
||||||
# @param funType a functor type, an item of SMESH.FunctorType enum
|
# @param funType a functor type, an item of SMESH.FunctorType enum
|
||||||
# (one of SMESH.FunctorType._items)
|
# (one of SMESH.FunctorType._items)
|
||||||
|
# @param meshPart a part of mesh (group, sub-mesh) to treat
|
||||||
# @return tuple (min,max)
|
# @return tuple (min,max)
|
||||||
# @ingroup l1_measurements
|
# @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 )
|
fun = self._getFunctor( funType )
|
||||||
if fun:
|
if fun:
|
||||||
|
if meshPart:
|
||||||
|
hist = fun.GetLocalHistogram( 1, False, meshPart )
|
||||||
|
else:
|
||||||
hist = fun.GetHistogram( 1, False )
|
hist = fun.GetHistogram( 1, False )
|
||||||
if hist:
|
if hist:
|
||||||
return hist[0].min, hist[0].max
|
return hist[0].min, hist[0].max
|
||||||
|
Loading…
Reference in New Issue
Block a user