From 1ec9c61779f5649c2de7ab0741fdd15d53172435 Mon Sep 17 00:00:00 2001 From: bourcier <> Date: Mon, 30 Apr 2007 15:11:14 +0000 Subject: [PATCH] =?utf8?q?On=20court-circuite=20la=20cr=C3=A9ation=20d'une?= =?utf8?q?=20vue=20OCC=20si=20la=20vue=20active=20n'est=20pas=20une=20vue?= =?utf8?q?=20OCC=20ou=20aucune=20vue=20n'exite.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/EFICASGUI/eficasSalome.py | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/src/EFICASGUI/eficasSalome.py b/src/EFICASGUI/eficasSalome.py index 9ca3d10d..3a4b3cc8 100644 --- a/src/EFICASGUI/eficasSalome.py +++ b/src/EFICASGUI/eficasSalome.py @@ -272,6 +272,7 @@ class MyEficas( Tkinter.Toplevel, eficas.EFICAS ): studyManager.palStudy.setCurrentStudyID( activeStudyId ) return True + def __createOCCView( self ): """ @@ -279,12 +280,24 @@ class MyEficas( Tkinter.Toplevel, eficas.EFICAS ): """ #salome.salome_init() import iparameters - ipar = iparameters.IParameters(salome.myStudy.GetCommonParameters("Interface Applicative", 1)) + + # On détermine le nombre de GUI states déjà présents dans l'arbre d'étude + GUIStateID = 1 + + ipar = iparameters.IParameters(salome.myStudy.GetCommonParameters("Interface Applicative", GUIStateID)) + properties = ipar.getProperties() + + while properties != []: + GUIStateID += 1 + ipar = iparameters.IParameters(salome.myStudy.GetCommonParameters("Interface Applicative", GUIStateID)) + properties = ipar.getProperties() + print "GUIStateID: ", GUIStateID + #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") + ipar.setProperty("AP_SAVEPOINT_NAME", "GUI state: %i"%(GUIStateID)) #Set up lists: # fill list AP_VIEWERS_LIST ipar.append("AP_VIEWERS_LIST", "OCCViewer_1") @@ -294,7 +307,7 @@ class MyEficas( Tkinter.Toplevel, eficas.EFICAS ): if salome.sg.hasDesktop(): salome.sg.updateObjBrowser(1) - iparameters.getSession().restoreVisualState(1) + iparameters.getSession().restoreVisualState(GUIStateID) def __selectWorkingMesh( self, meshGroupEntries ): @@ -705,7 +718,7 @@ class MyEficas( Tkinter.Toplevel, eficas.EFICAS ): ok, msgError = self.displayMeshGroups(shapeName) else: #geometrie print 'Vue courante = OCC : affichage element geometrique' - self.__createOCCView() +# self.__createOCCView() current_color = COLORS[ self.icolor % LEN_COLORS ] ok = studyManager.palStudy.displayShapeByName( shapeName, current_color ) salome.sg.FitAll() -- 2.39.2