]> SALOME platform Git repositories - modules/eficas.git/commitdiff
Salome HOME
add: ouverture auto view Occ ( non testé, en attente correction Salome Version >...
authorpbruno <>
Thu, 19 Apr 2007 13:25:28 +0000 (13:25 +0000)
committerpbruno <>
Thu, 19 Apr 2007 13:25:28 +0000 (13:25 +0000)
src/EFICASGUI/eficasSalome.py

index 367875e80afa39a71fb55965ca03dbcdf7be1d08..f0fe829c4cc196551065f56c53fa107a55d097a5 100644 (file)
@@ -258,6 +258,30 @@ class MyEficas( Tkinter.Toplevel, eficas.EFICAS ):
             studyManager.palStudy.setCurrentStudyID( activeStudyId )            
             
         return True
+        
+    def __createOCCView( self ):
+        """
+        Création vue Occ
+        """        
+        #salome.salome_init()
+        import iparameters
+        ipar = iparameters.IParameters(salome.myStudy.GetCommonParameters("Interface Applicative", 1))
+
+        #Set up visual properties:
+        ipar.setProperty("AP_ACTIVE_VIEW", "OCCViewer_0_0")
+        ipar.setProperty("AP_WORKSTACK_INFO", "(splitter orientation=0 sizes=1045 (views active='OCCViewer_0_0' 'OCCViewer_0_0'))")
+        ipar.setProperty("AP_SAVEPOINT_NAME", "GUI state: 1")
+        #Set up lists:
+        # fill list AP_VIEWERS_LIST
+        ipar.append("AP_VIEWERS_LIST", "OCCViewer_1")
+        # fill list OCCViewer_1
+        ipar.append("OCCViewer_1", "OCC scene:1 - viewer:1")
+        ipar.append("OCCViewer_1", "1.000000000000e+00*0.000000000000e+00*0.000000000000e+00*5.773502588272e-01*-5.773502588272e-01*5.773502588272e-01*0.000000000000e+00*0.000000000000e+00*0.000000000000e+00*0.000000000000e+00*2.886751294136e+02*-2.886751294136e+02*2.886751294136e+02")
+
+        if salome.sg.hasDesktop():
+            salome.sg.updateObjBrowser(1)
+            iparameters.getSession().restoreVisualState(1)
+        
                         
     def __selectWorkingMesh( self, meshGroupEntries ):
         """
@@ -666,10 +690,11 @@ class MyEficas( Tkinter.Toplevel, eficas.EFICAS ):
             print 'displayShapestrGeomShape shapeName -> ', shapeName
             
             if currentViewType == VISU.TVIEW3D: # maillage
-                print 'Vue courante = VTK : affichage groupe de maille'
+                print 'Vue courante = VTK : affichage groupe de maille'                
                 ok, msgError = self.displayMeshGroups(shapeName)
             else: #geometrie
                 print 'Vue courante = OCC : affichage element geometrique'
+                self.__createOCCView()
                 current_color = COLORS[ self.icolor % LEN_COLORS ]                
                 ok = studyManager.palStudy.displayShapeByName( shapeName, current_color )
                 salome.sg.FitAll()