X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FTools%2FblocFissure%2Fgmu%2Fgeomsmesh.py;h=41994125d296d1aea4cdc8e46d79ff373f9e3890;hb=f6e61276ef184fefd1e34fe83c608e95a75854f5;hp=5c41b46d427582a2d24d865992f98c56041e3c9a;hpb=6d32f944a0a115b6419184c50b57bf7c4eef5786;p=modules%2Fsmesh.git diff --git a/src/Tools/blocFissure/gmu/geomsmesh.py b/src/Tools/blocFissure/gmu/geomsmesh.py index 5c41b46d4..41994125d 100644 --- a/src/Tools/blocFissure/gmu/geomsmesh.py +++ b/src/Tools/blocFissure/gmu/geomsmesh.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright (C) 2014-2019 CEA/DEN, EDF R&D +# 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 @@ -17,10 +17,7 @@ # # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # - -import logging -#logging.info('start') -from . import initLog +"""Publications dans salome""" import salome salome.salome_init() @@ -31,13 +28,45 @@ geompy = geomBuilder.New() from salome.smesh import smeshBuilder smesh = smeshBuilder.New() -# logging.debug("initialisation de geompy et smesh OK") +from . import initLog + +def geomPublish(level,aShape, aName, i_pref=None): + """Publication d'un objet sous GEOM -def geomPublish(level,aShape, aName): + @level niveau d'impression voulu + @aShape objet à nommer + @aName le nom brut + @i_pref un éventuel préfixe + """ + #print ("initLog.getLogLevel() = {}".format(initLog.getLogLevel())) + #print ("level = {}".format(level)) if initLog.getLogLevel() <= level: + # préfixe éventuel : + if ( i_pref is not None): + if isinstance(i_pref,int): + prefixe = "Cas{:02d}_".format(i_pref) + else: + prefixe = "{}_".format(i_pref) + aName = prefixe + aName + geompy.addToStudy(aShape, aName) - -def geomPublishInFather(level, aFather, aShape, aName): + +def geomPublishInFather(level, aFather, aShape, aName, i_pref=None): + """Publication d'un objet sous son ascendant sous GEOM + + @level niveau d'impression voulu + @aFather objet ascendant + @aShape objet à nommer + @aName le nom brut + @i_pref un éventuel préfixe + """ if initLog.getLogLevel() <= level: + # préfixe éventuel : + if ( i_pref is not None): + if isinstance(i_pref,int): + prefixe = "Cas{:02d}_".format(i_pref) + else: + prefixe = "{}_".format(i_pref) + aName = prefixe + aName + geompy.addToStudyInFather(aFather, aShape, aName) - \ No newline at end of file