Salome HOME
Update copyrights
[modules/smesh.git] / src / Tools / blocFissure / gmu / quadranglesToShapeWithCorner.py
index 83fba60785af09a715ddcdf95cf9799e6523bf56..40ecbea305ac37a74695481fac1e528c3a18b7c8 100644 (file)
@@ -1,4 +1,22 @@
 # -*- coding: utf-8 -*-
+# Copyright (C) 2014-2019  CEA/DEN, 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
+#
 """
 Created on Tue Jun 24 09:14:13 2014
 
@@ -6,11 +24,14 @@ Created on Tue Jun 24 09:14:13 2014
 """
 
 import logging
-from geomsmesh import geompy
+from .geomsmesh import geompy
+from .geomsmesh import geomPublish
+from .geomsmesh import geomPublishInFather
+from . import initLog
 import GEOM
 
-from listOfExtraFunctions import createNewMeshesFromCorner
-from listOfExtraFunctions import createLinesFromMesh
+from .listOfExtraFunctions import createNewMeshesFromCorner
+from .listOfExtraFunctions import createLinesFromMesh
 
 # -----------------------------------------------------------------------------
 # --- groupe de quadrangles de face transformé en face géométrique par filling
@@ -62,7 +83,7 @@ def quadranglesToShapeWithCorner(meshQuad, shapeDefaut, shapeFissureParams, cent
         # A partir des lignes de chaque face,
         # on recrée un objet GEOM temporaire par filling.
         filling = geompy.MakeFilling(geompy.MakeCompound(face), 2, 5, 0.0001, 0.0001, 0, GEOM.FOM_Default, True)
-        geompy.addToStudy(filling, 'filling_{0}'.format(i + 1)) 
+        geomPublish(initLog.debug, filling, 'filling_{0}'.format(i + 1)) 
         tmpFillings.append(filling)
 
     for face in setOfNodes:
@@ -81,10 +102,10 @@ def quadranglesToShapeWithCorner(meshQuad, shapeDefaut, shapeFissureParams, cent
         tmpExplodeRef = geompy.ExtractShapes(filling, geompy.ShapeType["EDGE"], True)
         tmpExplodeNum = geompy.ExtractShapes(tmpPartition, geompy.ShapeType["EDGE"], True)
         if len(tmpExplodeRef) == len(tmpExplodeNum):
-            geompy.addToStudy(filling, "faceNonCoupee_{0}".format(i + 1))
+            geomPublish(initLog.debug, filling, "faceNonCoupee_{0}".format(i + 1))
             facesNonCoupees.append(filling)
         else:
-            geompy.addToStudy(filling, "faceCoupee_{0}".format(i + 1))
+            geomPublish(initLog.debug, filling, "faceCoupee_{0}".format(i + 1))
             facesCoupees.append(filling)
     fillings = facesCoupees, facesNonCoupees
     
@@ -93,21 +114,21 @@ def quadranglesToShapeWithCorner(meshQuad, shapeDefaut, shapeFissureParams, cent
         tmpExplodeRef = geompy.ExtractShapes(shapeDefaut, geompy.ShapeType["EDGE"], True) + geompy.ExtractShapes(shapeDefaut, geompy.ShapeType["VERTEX"], True)
         tmpExplodeNum = geompy.ExtractShapes(tmpPartition, geompy.ShapeType["EDGE"], True) + geompy.ExtractShapes(tmpPartition, geompy.ShapeType["VERTEX"], True)
         if len(tmpExplodeRef) == len(tmpExplodeNum):
-            geompy.addToStudy(filling, "areteNonCoupee_{0}".format(i + 1))
+            geomPublish(initLog.debug, filling, "areteNonCoupee_{0}".format(i + 1))
             aretesNonCoupees.append(filling)
         else:
-            geompy.addToStudy(filling, "areteCoupee_{0}".format(i + 1))
+            geomPublish(initLog.debug, filling, "areteCoupee_{0}".format(i + 1))
             aretesCoupees.append(filling)
     bords_Partages = aretesCoupees, aretesNonCoupees
     
 # TODO: A enlever
 #    for i, face in enumerate(setOfLines):
 #        for j, line in enumerate(face):
-#            geompy.addToStudy(line, 'face{0}_ligne{1}'.format(i + 1, j + 1))
+#            geomPublish(initLog.debug, line, 'face{0}_ligne{1}'.format(i + 1, j + 1))
 
  #TODO: A enlever
 #    for i, filling in enumerate(fillings[0]):
-#        geompy.addToStudy(filling, 'filling_{0}'.format(i + 1))
+#        geomPublish(initLog.debug, filling, 'filling_{0}'.format(i + 1))
 #        for j, line in enumerate(setOfLines[i]):
 #            geompy.addToStudyInFather(filling, line, 'line_{0}'.format(j + 1))