Salome HOME
Merge branch 'master' into gni/evolution
[modules/smesh.git] / src / Tools / blocFissure / gmu / orderEdgesFromWire.py
index 36d95f2fdd0ca2a5b86ecf5c2fa2f7b310bb7c3b..46468f539db41c9bfac70ec1c73f2cd677db271b 100644 (file)
@@ -1,4 +1,22 @@
 # -*- 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
@@ -14,7 +32,7 @@ def orderEdgesFromWire(aWire):
   logging.info("start")
   edges = geompy.ExtractShapes(aWire, geompy.ShapeType["EDGE"], False)
   
-  idverts = {}
+  idverts = dict()
   for i, edge in enumerate(edges):
     verts = geompy.ExtractShapes(edge, geompy.ShapeType["VERTEX"], True)
 #    idverts[(i,0)] = verts[0]
@@ -28,7 +46,7 @@ def orderEdgesFromWire(aWire):
       idverts[(i,0)] = verts[1]
       idverts[(i,1)] = verts[0]
      
-  idsubs = {}
+  idsubs = dict()
   for kv, sub in idverts.items():
     subid = geompy.GetSubShapeID(aWire, sub)
     if subid in list(idsubs.keys()):
@@ -45,7 +63,7 @@ def orderEdgesFromWire(aWire):
         debut = kv[0]
       else:
         fin = kv[0]
-  logging.debug("nombre d'edges: %s, indice edge début: %s, fin: %s",len(edges), debut, fin)
+  logging.debug("nombre d'edges: {}, indice edge début: {}, fin: {}".format(len(edges), debut, fin))
   if debut < 0:
     logging.critical("les edges du wire ne sont pas orientées dans le même sens: pas de début trouvé")
     return edges, list(range(len(edges)))
@@ -64,9 +82,9 @@ def orderEdgesFromWire(aWire):
             logging.critical("les edges du wire ne sont pas orientées dans le même sens: une edge à l'envers")
             return edges, list(range(len(edges)))
 
-  logging.debug("liste des edges ordonnées selon le sens de parcours: %s", orderedList)
+  logging.debug("liste des edges ordonnées selon le sens de parcours : {}".format(orderedList))
   accessList = list(range(len(orderedList)))
   for i,k in enumerate(orderedList):
     accessList[k] = i
-  logging.info("position ordonnée des edges selon le sens de parcours: %s", accessList)
+  logging.info("position ordonnée des edges selon le sens de parcours : {}".format(accessList))
   return edges, accessList