X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FTools%2FblocFissure%2Fgmu%2Fgeomsmesh.py;h=41994125d296d1aea4cdc8e46d79ff373f9e3890;hb=95de5fabdc238bcf1dbc3399e79d3b5c5ff41a5e;hp=50c900d00b05f136094fc45c3cfd9d3df98a53b9;hpb=4e6f2284a44bc1da45d137fe825e31b2feadaa9a;p=modules%2Fsmesh.git diff --git a/src/Tools/blocFissure/gmu/geomsmesh.py b/src/Tools/blocFissure/gmu/geomsmesh.py index 50c900d00..41994125d 100644 --- a/src/Tools/blocFissure/gmu/geomsmesh.py +++ b/src/Tools/blocFissure/gmu/geomsmesh.py @@ -30,12 +30,43 @@ smesh = smeshBuilder.New() from . import initLog -def geomPublish(level,aShape, aName): - """Publication d'un objet""" +def geomPublish(level,aShape, aName, i_pref=None): + """Publication d'un objet sous GEOM + + @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): - """Publication d'un objet sous son ascendant""" +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)