From: eap Date: Thu, 10 Jan 2013 11:30:44 +0000 (+0000) Subject: In RemoveHypothesis() print a WARNING if the hypothesis was not X-Git-Tag: pluginMGCleaner~186 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=6f564a0788397ce5ed731d95fda3818782679c7e;p=modules%2Fsmesh.git In RemoveHypothesis() print a WARNING if the hypothesis was not assigned to the given shape --- diff --git a/src/SMESH_SWIG/smeshDC.py b/src/SMESH_SWIG/smeshDC.py index 5ad50bdea..d17642e4a 100644 --- a/src/SMESH_SWIG/smeshDC.py +++ b/src/SMESH_SWIG/smeshDC.py @@ -1388,11 +1388,16 @@ class Mesh: if isinstance( hyp, Mesh_Algorithm ): hyp = hyp.GetAlgorithm() pass - if not geom: - geom = self.geom + shape = geom + if not shape: + shape = self.geom pass - status = self.mesh.RemoveHypothesis(geom, hyp) - return status + if self.IsUsedHypothesis( hyp, shape ): + return self.mesh.RemoveHypothesis(shape, hyp) + hypName = GetName( hyp ) + geoName = GetName( shape ) + print "WARNING: RemoveHypothesis() failed as '%s' is not assigned to '%s' shape" % ( hypName, geoName ) + return None ## Gets the list of hypotheses added on a geometry # @param geom a sub-shape of mesh geometry