]> SALOME platform Git repositories - tools/eficas.git/commitdiff
Salome HOME
Carmel 3D et les groupes de maille
authorPascale Noyret <pascale.noyret@edf.fr>
Tue, 29 Nov 2011 10:10:31 +0000 (10:10 +0000)
committerPascale Noyret <pascale.noyret@edf.fr>
Tue, 29 Nov 2011 10:10:31 +0000 (10:10 +0000)
src/EFICASGUI/eficasSalome.py

index fe8ab81e0d7a8de7cc88690fd391ff0c3c021d20..bdd29112ca5aba72f673b67a706743d4187457a7 100644 (file)
@@ -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 ):