################################################
# study-to-context map
-__study2context__ = {}
+#__study2context__ = {}
# current context
-__current_context__ = None
+#__current_context__ = None
+
# ##
# set and return current GUI context
# study ID is passed as parameter
# ##
-def _setContext(studyID):
- global eficasRoot
- if eficasRoot is None:
- return
- global __study2context__, __current_context__
- if studyID not in __study2context__:
- __study2context__[studyID] = GUIcontext()
- pass
- __current_context__ = __study2context__[studyID]
- return __current_context__
+#def _setContext(studyID):
+# global eficasRoot
+# if eficasRoot is None:
+# return
+# global __study2context__, __current_context__
+# if studyID not in __study2context__:
+# __study2context__[studyID] = GUIcontext()
+# pass
+# __current_context__ = __study2context__[studyID]
+# return __current_context__
# -----------------------------------------------------------------------------
# -----------------------------------------------------------------------------
-def setSettings():
- """
- Cette méthode permet les initialisations.
- """
- _setContext(sgPyQt.getStudyId())
+#def setSettings():
+# """
+# Cette méthode permet les initialisations.
+# """
+ #_setContext(sgPyQt.getStudyId())
def activate():
Portage V3.
"""
- setSettings()
+# setSettings()
+ GUIcontext()
# -----------------------------------------------------------------------------
-def activeStudyChanged(ID):
- _setContext(ID)
+#def activeStudyChanged(ID):
+# _setContext(ID)
# -----------------------------------------------------------------------------
SVisu = "Post-Pro"
SAster = "Aster"
+__study__ = None
+def getStudy():
+ global __study__
+ if __study__ is None:
+ obj = getNS().Resolve( '/Study' )
+ __study__ = obj._narrow( SALOMEDS.Study )
+ pass
+ return __study__
+
class SalomeStudy(salomedsgui.guiDS):
"""
une étude courante ( positionnée dans le constructeur ou par la méthode
setCurrentStudyID() )
"""
- def __init__(self, studyID=salome.myStudyId):
+ #def __init__(self, studyID=salome.myStudyId):
+ def __init__(self):
salomedsgui.guiDS.__init__(self)
- self.setCurrentStudy(studyID)
+ #self.setCurrentStudy(studyID)
+ self.setCurrentStudy()
# spécifique méthode __getMeshType() :
self.groupOp = None
"""
self._father = None
self._component = None
- self._myStudy = self._myStudyManager.GetStudyByID(studyID)
+ self.myStudy = getStudy()
self._myBuilder = self._myStudy.NewBuilder()
salome.myStudy = self._myStudy
- salome.myStudyId = studyID
+ #salome.myStudyId = studyID
salome.myStudyName = self._myStudy._get_Name()
def refresh(self):
# import sys
# ex_type = sys.exc_info()[0]
# ex_value = sys.exc_info()[1]
- # print('>>>>CS_Pbruno StudyTree.getMainShapeEntry( entry = %s ) ' %entry)
# print('type = %s , value = %s '%( ex_type, ex_value ))
result = None
# import sys
# ex_type = sys.exc_info()[0]
# ex_value = sys.exc_info()[1]
- # print('>>>>CS_Pbruno StudyTree.sameMainShape( shapeEntry1 = %s , shapeEntry2 = %s )'%( shapeEntry1, shapeEntry2 ))
# print('type = %s , value = %s '%( ex_type, ex_value ))
result = None