From a1d546766e4d2aa05dada7ee0810cfcb0c1eb51b Mon Sep 17 00:00:00 2001 From: Pascale Noyret Date: Tue, 29 Nov 2011 10:10:31 +0000 Subject: [PATCH] Carmel 3D et les groupes de maille --- src/EFICASGUI/eficasSalome.py | 36 +++++++++++++++++++++++++++-------- 1 file changed, 28 insertions(+), 8 deletions(-) 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 ): -- 2.39.2