From: Pascale Noyret Date: Tue, 29 Nov 2011 10:10:31 +0000 (+0000) Subject: Carmel 3D et les groupes de maille X-Git-Tag: mergeto_trunk_2012-08-22~10 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=a1d546766e4d2aa05dada7ee0810cfcb0c1eb51b;p=tools%2Feficas.git Carmel 3D et les groupes de maille --- diff --git a/src/EFICASGUI/eficasSalome.py b/src/EFICASGUI/eficasSalome.py index fe8ab81e..bdd29112 100644 --- a/src/EFICASGUI/eficasSalome.py +++ b/src/EFICASGUI/eficasSalome.py @@ -123,9 +123,9 @@ class MyEficas( qtEficas.Appli ): return object - #------------------------------------- - def giveMeshGroups( self,entry): - #------------------------------------- + #---------------------------------------------- + def giveMeshGroups( self,entry,label1,typeMesh): + #---------------------------------------------- msg=None names=[] import SMESH @@ -139,6 +139,7 @@ class MyEficas( qtEficas.Appli ): # on ajoute deja le maillage name=mailSO.GetName() names.append(name) + print name # on ajoute deja le maillage subIt = self.editor.study.NewChildIterator(mailSO) @@ -146,12 +147,12 @@ class MyEficas( qtEficas.Appli ): subSO = subIt.Value() subIt.Next() - if (subSO.GetName()[0:9]!="SubMeshes") : continue + if (subSO.GetName()[0:9]!=label1) : continue subSSMeshit=self.editor.study.NewChildIterator(subSO) while subSSMeshit.More(): subSSMeshSO = subSSMeshit.Value() subSSMeshit.Next() - if subSSMeshSO.GetObject()._narrow(SMESH.SMESH_subMesh): + if subSSMeshSO.GetObject()._narrow(typeMesh): names.append(subSSMeshSO.GetName()) else : msg=entry + " n est pas un maillage" @@ -537,22 +538,41 @@ class MyEficas( qtEficas.Appli ): #--------------------------------------- def ChercheGrpMeshInSalome(self): print "je passe par la" + import SMESH + names, msg = [], '' + try : + entries = salome.sg.getAllSelected() + nbEntries = len( entries ) + names, msg = None, "Selection SALOME non autorisee." + if nbEntries == 1: + for entry in entries: + print entry + names,msg=self.giveMeshGroups(entry,"SubMeshes",SMESH.SMESH_subMesh) + print names + except : + print "bim bam boum" + return(msg,names) + + #--------------------------------------- + def ChercheGrpMailleInSalome(self): + import SMESH names, msg = [], '' #try : - if 1 : + if 1: entries = salome.sg.getAllSelected() nbEntries = len( entries ) names, msg = None, "Selection SALOME non autorisee." if nbEntries == 1: for entry in entries: print entry - names,msg=self.giveMeshGroups(entry) + names,msg=self.giveMeshGroups(entry,"Groups of",SMESH.SMESH_GroupBase) print names #except : - else : + else: print "bim bam boum" return(msg,names) + #--------------------------------------- # def buildCabriGeom( self, name, **param ):