1 # -*- coding: latin-1 -*-
2 # Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
4 # Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
5 # CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
7 # This library is free software; you can redistribute it and/or
8 # modify it under the terms of the GNU Lesser General Public
9 # License as published by the Free Software Foundation; either
10 # version 2.1 of the License.
12 # This library is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 # Lesser General Public License for more details.
17 # You should have received a copy of the GNU Lesser General Public
18 # License along with this library; if not, write to the Free Software
19 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
23 # Author : A. Bruneton
26 from CFDesktop import CFDesktop
30 # Get SALOME PyQt interface
34 ########################################################
36 ########################################################
38 sgPyQt = SalomePyQt.SalomePyQt()
39 sg = libSALOME_Swig.SALOMEGUI_Swig()
40 sgDesktop = sgPyQt.getDesktop()
44 ########################################################
46 ########################################################
49 """This method returns the active study ID"""
50 return sgPyQt.getStudyId()
53 """This method returns the active study"""
55 studyId = _getStudyId()
56 study = getStudyManager().GetStudyByID( studyId )
60 """This method returns the current TRUST_PLOT2D desktop"""
65 def setDesktop( studyID ):
66 """This method sets and returns TRUST_PLOT2D desktop"""
68 global moduleDesktop, desktop
70 if not moduleDesktop.has_key( studyID ):
71 moduleDesktop[studyID] = CFDesktop( sgPyQt )
72 moduleDesktop[studyID].initialize()
73 desktop = moduleDesktop[studyID]
76 ################################################
78 ################################################
81 """This method is called when module is initialized. It performs initialization actions"""
82 setDesktop( getStudyId() )
85 def activeStudyChanged( studyID ):
86 """This method is called when active study is changed"""
88 setDesktop( getStudyId() )
92 """This method is called when module is initialized. It returns a map of popup windows to be used by the module"""
97 """This method is called when module is initialized. It returns a list of 2D/3D views to be used by the module"""
101 """This method mimicks SALOME's module activation """
103 fv = desktop.showCentralWidget()
107 """This method is called when module is deactivated"""
108 global moduleDesktop, widgetDialogBox
109 moduleDesktop[getStudyId()].hideCentralWidget()