Salome HOME
Copyright update 2021
[modules/smesh.git] / src / Tools / blocFissure / gmu / casStandard.py
index cffd6aac83121a92049366a6f9ca086cd95932cb..9c542cbfdefc901489f7d3da7da640d86a49aab5 100644 (file)
@@ -1,10 +1,28 @@
 # -*- coding: utf-8 -*-
+# Copyright (C) 2014-2021  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 os
-from geomsmesh import geompy, smesh
-from geomsmesh import geomPublish
-from geomsmesh import geomPublishInFather
-import initLog
+from .geomsmesh import geompy, smesh
+from .geomsmesh import geomPublish
+from .geomsmesh import geomPublishInFather
+from . import initLog
 
 import math
 import GEOM
@@ -15,13 +33,13 @@ import SMESH
 #import NETGENPlugin
 import logging
 
-from fissureGenerique import fissureGenerique
+from .fissureGenerique import fissureGenerique
 
-from initEtude import initEtude
-from triedreBase import triedreBase
-from genereMeshCalculZoneDefaut import genereMeshCalculZoneDefaut
-from creeZoneDefautDansObjetSain import creeZoneDefautDansObjetSain
-from construitFissureGenerale import construitFissureGenerale
+from .initEtude import initEtude
+from .triedreBase import triedreBase
+from .genereMeshCalculZoneDefaut import genereMeshCalculZoneDefaut
+from .creeZoneDefautDansObjetSain import creeZoneDefautDansObjetSain
+from .construitFissureGenerale import construitFissureGenerale
 
 O, OX, OY, OZ = triedreBase()
 
@@ -39,29 +57,31 @@ class casStandard(fissureGenerique):
     initEtude()
     self.references = references
     self.dicoParams = dicoParams
-    if self.dicoParams.has_key('nomCas'):
+    if 'nomCas' in self.dicoParams:
       self.nomCas = self.dicoParams['nomCas']
-    elif self.dicoParams.has_key('nomres'):
+    elif 'nomres' in self.dicoParams:
       self.nomCas = os.path.splitext(os.path.split(self.dicoParams['nomres'])[1])[0]
     else:
       self.nomCas = 'casStandard'
-    if self.dicoParams.has_key('reptrav'):
+    if 'reptrav' in self.dicoParams:
       self.reptrav = self.dicoParams['reptrav']
     else:
-      reptrav = '.'  
+      self.reptrav = '.'  
     self.numeroCas = numeroCas
     if self.numeroCas != 0:
       self.nomCas = self.nomProbleme +"_%d"%(self.numeroCas)
     else:
       self.nomProbleme = self.nomCas
-    if self.dicoParams.has_key('lenSegPipe'):
+    if 'lenSegPipe' in self.dicoParams:
       self.lenSegPipe = self.dicoParams['lenSegPipe']
     else:
       self.lenSegPipe =self.dicoParams['rayonPipe']
-    if self.dicoParams.has_key('step'):
+    if 'step' in self.dicoParams:
       step = self.dicoParams['step']
     else:
       step = -1 # exécuter toutes les étapes
+    if 'aretesVives' not in self.dicoParams:
+      self.dicoParams['aretesVives'] = 0
     if self.numeroCas == 0: # valeur par défaut : exécution immédiate, sinon execution différée dans le cas d'une liste de problèmes
       self.executeProbleme(step)
     
@@ -84,7 +104,7 @@ class casStandard(fissureGenerique):
     pointIn_x   : optionnel : coordonnée x d'un point dans le solide sain (pour orienter la face - idem avec y,z)
     """
     logging.info("setParamShapeFissure %s", self.nomCas)
-    if self.dicoParams.has_key('pointInterieur'):
+    if 'pointInterieur' in self.dicoParams:
       self.shapeFissureParams = dict(lgInfluence = self.dicoParams['lgInfluence'],
                                      rayonPipe   = self.dicoParams['rayonPipe'],
                                      lenSegPipe  = self.lenSegPipe,
@@ -102,7 +122,7 @@ class casStandard(fissureGenerique):
 
     lgInfluence = shapeFissureParams['lgInfluence']
 
-    shellFiss = geompy.ImportFile( self.dicoParams['brepFaceFissure'], "BREP")
+    shellFiss = geompy.ImportBREP( self.dicoParams['brepFaceFissure'])
     fondFiss = geompy.CreateGroup(shellFiss, geompy.ShapeType["EDGE"])
     geompy.UnionIDs(fondFiss, self.dicoParams['edgeFissIds'] )
     geomPublish(initLog.debug, shellFiss, 'shellFiss' )
@@ -121,7 +141,8 @@ class casStandard(fissureGenerique):
                                       nomFicFissure    = self.nomCas,
                                       nbsegRad         = self.dicoParams['nbSegRad'],
                                       nbsegCercle      = self.dicoParams['nbSegCercle'],
-                                      areteFaceFissure = self.dicoParams['areteFaceFissure'])
+                                      areteFaceFissure = self.dicoParams['areteFaceFissure'],
+                                      aretesVives      = self.dicoParams['aretesVives'])
 
   # ---------------------------------------------------------------------------
   def genereZoneDefaut(self, geometriesSaines, maillagesSains, shapesFissure, shapeFissureParams, maillageFissureParams):