From: Pascale Noyret Date: Mon, 28 Nov 2011 15:09:53 +0000 (+0000) Subject: *** empty log message *** X-Git-Tag: mergeto_trunk_2012-08-22~11 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=386c83a4065a0e9fe0d41ba6d2f586e26660cf4a;p=tools%2Feficas.git *** empty log message *** --- diff --git a/src/EFICASGUI/eficasSalome.py b/src/EFICASGUI/eficasSalome.py index b7f79cb8..fe8ab81e 100644 --- a/src/EFICASGUI/eficasSalome.py +++ b/src/EFICASGUI/eficasSalome.py @@ -123,6 +123,43 @@ class MyEficas( qtEficas.Appli ): return object + #------------------------------------- + def giveMeshGroups( self,entry): + #------------------------------------- + msg=None + names=[] + import SMESH + try: + monMaillage =self.getCORBAObjectInComponent(entry,"SMESH") + if monMaillage != None : # selection d'un groupe de SMESH + if monMaillage._narrow(SMESH.SMESH_Mesh): + mailSO = self.editor.study.FindObjectID(entry) + if mailSO == None : return names, msg + +# on ajoute deja le maillage + name=mailSO.GetName() + names.append(name) + +# on ajoute deja le maillage + subIt = self.editor.study.NewChildIterator(mailSO) + while subIt.More(): + subSO = subIt.Value() + subIt.Next() + + if (subSO.GetName()[0:9]!="SubMeshes") : continue + subSSMeshit=self.editor.study.NewChildIterator(subSO) + while subSSMeshit.More(): + subSSMeshSO = subSSMeshit.Value() + subSSMeshit.Next() + if subSSMeshSO.GetObject()._narrow(SMESH.SMESH_subMesh): + names.append(subSSMeshSO.GetName()) + else : + msg=entry + " n est pas un maillage" + except : + logger.debug(' giveMeshGroups pb avec ( entry = %s ) ' %entry ) + msg=' giveMeshGroup pb avec ( entry = %s ) '+ entry + return names, msg + #------------------------------------- def isMeshGroup( self,entry): #------------------------------------- @@ -130,11 +167,9 @@ class MyEficas( qtEficas.Appli ): import SMESH try: monObjet =self.getCORBAObjectInComponent(entry,"SMESH") - #print monObjet if monObjet != None : # selection d'un groupe de SMESH if monObjet._narrow(SMESH.SMESH_GroupBase): result = True - #print result except : logger.debug(' isMeshGroup pb avec ( entry = %s ) ' %entry ) return result @@ -419,10 +454,12 @@ class MyEficas( qtEficas.Appli ): 'OPENTURNS': "FICHIER_EFICAS_OPENTURNS", 'OPENTURNS_STUDY': "FICHIER_EFICAS_OPENTURNS_STUDY", 'OPENTURNS_WRAPPER': "FICHIER_EFICAS_OPENTURNS_WRAPPER", + 'CARMEL3D': "FICHIER_EFICAS_OPENTURNS_WRAPPER", } folderName = { 'ASTER' : 'AsterFiles', 'SEP' : 'OMFiles' , + 'CARMEL3D' : 'CARMEL3DFiles' , 'MAP' : 'MapFiles' , 'OPENTURNS_STUDY': 'OpenturnsFiles', 'OPENTURNS_WRAPPER': 'OpenturnsFiles'} @@ -430,6 +467,7 @@ class MyEficas( qtEficas.Appli ): folderType = { 'ASTER': "ASTER_FILE_FOLDER", 'SEP': "SEP_FILE_FOLDER", 'MAP': "MAP_FILE_FOLDER", + 'CARMEL3D': "CARMEL3D_FILE_FOLDER", 'OPENTURNS_STUDY':"OPENTURNS_FILE_FOLDER", 'OPENTURNS_WRAPPER': "OPENTURNS_FILE_FOLDER"} @@ -496,6 +534,26 @@ class MyEficas( qtEficas.Appli ): logger.debug(50*'=') return ok, msgError + #--------------------------------------- + def ChercheGrpMeshInSalome(self): + print "je passe par la" + names, msg = [], '' + #try : + 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) + print names + #except : + else : + print "bim bam boum" + return(msg,names) + + #--------------------------------------- # def buildCabriGeom( self, name, **param ): """