]> SALOME platform Git repositories - modules/smesh.git/commitdiff
Salome HOME
In RemoveHypothesis() print a WARNING if the hypothesis was not
authoreap <eap@opencascade.com>
Thu, 10 Jan 2013 11:30:44 +0000 (11:30 +0000)
committereap <eap@opencascade.com>
Thu, 10 Jan 2013 11:30:44 +0000 (11:30 +0000)
assigned to the given shape

src/SMESH_SWIG/smeshDC.py

index 5ad50bdea638b13ddaee8a63dad38b1f7174136a..d17642e4ae4f620f8ba0f99851af8341dc343bdf 100644 (file)
@@ -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