Salome HOME
Utilisation d'une CAO sous xao avec des groupes
[modules/smesh.git] / src / Tools / blocFissure / gmu / getCentreFondFiss.py
index f8f53d7ba1cacd93d23c3b4aa60eb619efeab8ac..819f80b3b569b48c01270a4acb6884b942910a32 100644 (file)
@@ -1,7 +1,28 @@
 # -*- coding: utf-8 -*-
+# Copyright (C) 2014-2020  EDF R&D
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
 
 import logging
-from geomsmesh import geompy
+from .geomsmesh import geompy
+from .geomsmesh import geomPublish
+from .geomsmesh import geomPublishInFather
+from . import initLog
 import bisect
 
 publie = False
@@ -35,7 +56,7 @@ def getCentreFondFiss(shapesFissure):
       edgeFondExt = fondFiss
       aWire = geompy.MakeWire([fondFiss], 1e-07)
     if not publie:
-      geompy.addToStudy(aWire, "wireFondFissExt")
+      geomPublish(initLog.debug, aWire, "wireFondFissExt")
         
     lgWire = geompy.BasicProperties(aWire)[0]
     edges = geompy.ExtractShapes(aWire, geompy.ShapeType["EDGE"], True)
@@ -61,7 +82,7 @@ def getCentreFondFiss(shapesFissure):
         centreFondFiss = geompy.MakeVertexOnCurve(edges[iedr], 1.0 - lgOnEdge/lgEdges[iedr])
     else: # on ne sait pas comment est orientée l'edge unique, mais ça n'a pas d'importance
       centreFondFiss = geompy.MakeVertexOnCurve(edges[iedr], lgOnEdge/lgEdges[iedr])
-    geompy.addToStudyInFather(aWire, centreFondFiss, "centreFondFiss")
+    geomPublishInFather(initLog.debug,aWire, centreFondFiss, "centreFondFiss")
     tgtCentre = geompy.MakeTangentOnCurve(edges[iedr], lgOnEdge/ lgEdges[iedr])
     
     if edgeFondExt is None: # fond de fissure non fourni explicitement sous forme d'edge
@@ -71,7 +92,7 @@ def getCentreFondFiss(shapesFissure):
         logging.debug("erreur MakeEdgeWire sur fond de fissure, on fait sans")
         edgeFondExt = None
     if not publie and edgeFondExt is not None:
-      geompy.addToStudy(edgeFondExt, "edgeFondExt")
+      geomPublish(initLog.debug, edgeFondExt, "edgeFondExt")
   
   publie = True
   return edgeFondExt, centreFondFiss, tgtCentre