]> SALOME platform Git repositories - modules/eficas.git/commitdiff
Salome HOME
*** empty log message ***
authorPascale Noyret <pascale.noyret@edf.fr>
Mon, 28 Nov 2011 15:09:53 +0000 (15:09 +0000)
committerPascale Noyret <pascale.noyret@edf.fr>
Mon, 28 Nov 2011 15:09:53 +0000 (15:09 +0000)
src/EFICASGUI/eficasSalome.py

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