X-Git-Url: http://git.salome-platform.org/gitweb/?p=modules%2Fsmesh.git;a=blobdiff_plain;f=src%2FTools%2FblocFissure%2Fgmu%2FinsereFissureGenerale.py;h=c57b8b69e89b86787dbc0a5bc0a86493235f0ebc;hp=a8619bdda38b8b09cce60634d2a34dacd5270e8b;hb=6d32f944a0a115b6419184c50b57bf7c4eef5786;hpb=a1920ff31054e2c882bd94d4f3c04abe53980ce0 diff --git a/src/Tools/blocFissure/gmu/insereFissureGenerale.py b/src/Tools/blocFissure/gmu/insereFissureGenerale.py index a8619bdda..c57b8b69e 100644 --- a/src/Tools/blocFissure/gmu/insereFissureGenerale.py +++ b/src/Tools/blocFissure/gmu/insereFissureGenerale.py @@ -1,41 +1,59 @@ # -*- 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 +# import logging import salome -from geomsmesh import geompy -from geomsmesh import geomPublish -from geomsmesh import geomPublishInFather -import initLog +from .geomsmesh import geompy +from .geomsmesh import geomPublish +from .geomsmesh import geomPublishInFather +from . import initLog import GEOM -from geomsmesh import smesh +from .geomsmesh import smesh from salome.smesh import smeshBuilder import SMESH import math import bisect -from extractionOrientee import extractionOrientee -from extractionOrienteeMulti import extractionOrienteeMulti -from sortFaces import sortFaces -from sortEdges import sortEdges -from eliminateDoubles import eliminateDoubles -from substractSubShapes import substractSubShapes -from produitMixte import produitMixte -from findWireEndVertices import findWireEndVertices -from findWireIntermediateVertices import findWireIntermediateVertices -from orderEdgesFromWire import orderEdgesFromWire -from getSubshapeIds import getSubshapeIds -from putName import putName -from distance2 import distance2 -from enleveDefaut import enleveDefaut -from shapeSurFissure import shapeSurFissure -from regroupeSainEtDefaut import RegroupeSainEtDefaut -from triedreBase import triedreBase -from checkDecoupePartition import checkDecoupePartition -from whichSide import whichSide -from whichSideMulti import whichSideMulti -from whichSideVertex import whichSideVertex -from projettePointSurCourbe import projettePointSurCourbe -from prolongeWire import prolongeWire +from .extractionOrientee import extractionOrientee +from .extractionOrienteeMulti import extractionOrienteeMulti +from .sortFaces import sortFaces +from .sortEdges import sortEdges +from .eliminateDoubles import eliminateDoubles +from .substractSubShapes import substractSubShapes +from .produitMixte import produitMixte +from .findWireEndVertices import findWireEndVertices +from .findWireIntermediateVertices import findWireIntermediateVertices +from .orderEdgesFromWire import orderEdgesFromWire +from .getSubshapeIds import getSubshapeIds +from .putName import putName +from .distance2 import distance2 +from .enleveDefaut import enleveDefaut +from .shapeSurFissure import shapeSurFissure +from .regroupeSainEtDefaut import RegroupeSainEtDefaut +from .triedreBase import triedreBase +from .checkDecoupePartition import checkDecoupePartition +from .whichSide import whichSide +from .whichSideMulti import whichSideMulti +from .whichSideVertex import whichSideVertex +from .projettePointSurCourbe import projettePointSurCourbe +from .prolongeWire import prolongeWire #from getCentreFondFiss import getCentreFondFiss # ----------------------------------------------------------------------------- @@ -53,7 +71,7 @@ def insereFissureGenerale(maillagesSains, fondFiss = shapesFissure[4] # groupe d'edges de fond de fissure rayonPipe = shapeFissureParams['rayonPipe'] - if shapeFissureParams.has_key('lenSegPipe'): + if 'lenSegPipe' in shapeFissureParams: lenSegPipe = shapeFissureParams['lenSegPipe'] else: lenSegPipe = rayonPipe @@ -70,13 +88,13 @@ def insereFissureGenerale(maillagesSains, pointIn_y = 0.0 pointIn_z = 0.0 isPointInterne = False - if shapeFissureParams.has_key('pointIn_x'): + if 'pointIn_x' in shapeFissureParams: pointIn_x = shapeFissureParams['pointIn_x'] isPointInterne = True - if shapeFissureParams.has_key('pointIn_y'): + if 'pointIn_y' in shapeFissureParams: pointIn_y = shapeFissureParams['pointIn_y'] isPointInterne = True - if shapeFissureParams.has_key('pointIn_z'): + if 'pointIn_z' in shapeFissureParams: pointIn_z = shapeFissureParams['pointIn_z'] isPointInterne = True if isPointInterne: @@ -1373,12 +1391,12 @@ def insereFissureGenerale(maillagesSains, fond = maillageComplet.GetMesh().CreateDimGroup( grps, SMESH.NODE, 'FACE2' ) logging.info("export maillage fini") - maillageComplet.ExportMED( fichierMaillageFissure, 0, SMESH.MED_V2_2, 1 ) + maillageComplet.ExportMED(fichierMaillageFissure) putName(maillageComplet, nomFicFissure) logging.info("fichier maillage fissure %s", fichierMaillageFissure) if salome.sg.hasDesktop(): - salome.sg.updateObjBrowser(True) + salome.sg.updateObjBrowser() logging.info("maillage fissure fini")