]> SALOME platform Git repositories - modules/homard.git/commitdiff
Salome HOME
Merge changes from 'master' branch.
authorrnv <rnv@opencascade.com>
Fri, 29 Dec 2017 13:21:20 +0000 (16:21 +0300)
committerrnv <rnv@opencascade.com>
Fri, 29 Dec 2017 13:21:20 +0000 (16:21 +0300)
40 files changed:
bin/runHOMARD.py
doc/en/tutorials.rst
doc/en/yacs.rst
doc/files/tutorial_1.py
doc/files/tutorial_2.py
doc/files/tutorial_3.py
doc/files/tutorial_4.py
doc/files/tutorial_4.xml
doc/files/tutorial_5.py
doc/files/yacs_01.en.xml
doc/files/yacs_01.fr.xml
doc/files/yacs_script.py
doc/files/yacs_script_test.py
doc/fr/tutorials.rst
doc/fr/yacs.rst
idl/Gen.xml
idl/HOMARD_Gen.idl
resources/HOMARDCatalog.xml.in
resources/yacs_01.en.xml
resources/yacs_01.fr.xml
src/HOMARD/YACSDriver.cxx
src/HOMARDGUI/HOMARDGUI.cxx
src/HOMARDGUI/HOMARDGUI.h
src/HOMARDGUI/HOMARDGUI_Utils.cxx
src/HOMARDGUI/HOMARDGUI_Utils.h
src/HOMARDGUI/HomardQtCommun.cxx
src/HOMARD_I/CMakeLists.txt
src/HOMARD_I/HOMARD_Gen_i.cxx
src/HOMARD_I/HOMARD_Gen_i.hxx
src/HOMARD_SWIG/HOMARD_shared_modules.py
src/tests/Test/test_1.py
src/tests/Test/test_2.py
src/tests/Test/test_3.py
src/tests/Test/test_4.py
src/tests/Test/test_5.py
src/tests/Test/tutorial_1.py
src/tests/Test/tutorial_2.py
src/tests/Test/tutorial_3.py
src/tests/Test/tutorial_4.py
src/tests/Test/tutorial_5.py

index 1a2c4d9988fcaf003eacfff33827682a6f5b4531..76ddece9b77ffe34132833d94425480e20d40723 100755 (executable)
@@ -23,31 +23,31 @@ usage="""USAGE: runHOMARD.py [options]
 [command line options] :
 --help                        : affichage de l'aide
 --gui                         : lancement du GUI
---logger                     : redirection des messages dans un fichier
---xterm                              : les serveurs ouvrent une fenêtre xterm et les messages sont affichés dans cette fenêtre
---modules=module1,module2,... : où modulen est le nom d'un module Salome à charger dans le catalogue
+--logger                      : redirection des messages dans un fichier
+--xterm                       : les serveurs ouvrent une fen??tre xterm et les messages sont affich??s dans cette fen??tre
+--modules=module1,module2,... : o?? modulen est le nom d'un module Salome ?? charger dans le catalogue
 --containers=cpp,python,superv: lancement des containers cpp, python et de supervision
---killall                    : arrêt des serveurs de salome
+--killall                     : arr??t des serveurs de salome
 
- La variable d'environnement <modulen>_ROOT_DIR doit etre préalablement
- positionnée (modulen doit etre en majuscule).
+ La variable d'environnement <modulen>_ROOT_DIR doit etre pr??alablement
+ positionn??e (modulen doit etre en majuscule).
  KERNEL_ROOT_DIR est obligatoire.
 """
 
 # -----------------------------------------------------------------------------
 #
-# Fonction d'arrêt de salome
+# Fonction d'arr??t de salome
 #
 
 def killSalome():
-   print "arret des serveurs SALOME"
-   for pid, cmd in process_id.items():
-      print "arret du process %s : %s"% (pid, cmd[0])
+   print("arret des serveurs SALOME")
+   for pid, cmd in list(process_id.items()):
+      print("arret du process %s : %s"% (pid, cmd[0]))
       try:
-       os.kill(pid,signal.SIGKILL)
+         os.kill(pid, signal.SIGKILL)
       except:
-         print "  ------------------ process %s : %s inexistant"% (pid, cmd[0])
-   print "arret du naming service"
+         print("  ------------------ process %s : %s inexistant"% (pid, cmd[0]))
+   print("arret du naming service")
    os.system("killall -9 omniNames")
    
 # -----------------------------------------------------------------------------
@@ -56,7 +56,7 @@ def killSalome():
 #
 
 def message(code, msg=''):
-    if msg: print msg
+    if msg: print(msg)
     sys.exit(code)
 
 import sys,os,string,glob,time,signal,pickle,getopt
@@ -78,7 +78,7 @@ with_container_superv=0
 try:
   for o, a in opts:
     if o in ('-h', '--help'):
-      print usage
+      print(usage)
       sys.exit(1)
     elif o in ('-g', '--gui'):
       with_gui=1
@@ -92,49 +92,49 @@ try:
       liste_containers = [x.lower() for x in a.split(',')]
       for r in liste_containers:
         if r not in ('cpp', 'python', 'superv'):
-          message(1, 'Invalid -c/--containers option: %s' % a)
+           message(1, 'Invalid -c/--containers option: %s' % a)
       if 'cpp' in liste_containers:
-          with_container_cpp=1
+         with_container_cpp = 1
       else:
-          with_container_cpp=0
+         with_container_cpp = 0
       if 'python' in liste_containers:
-          with_container_python=1
+         with_container_python = 1
       else:
-          with_container_python=0
+         with_container_python = 0
       if 'superv' in liste_containers:
-          with_container_superv=1
+         with_container_superv = 1
       else:
-          with_container_superv=0
+         with_container_superv = 0
     elif o in ('-k', '--killall'):
       filedict='/tmp/'+os.getenv('USER')+'_SALOME_pidict'
       #filedict='/tmp/'+os.getlogin()+'_SALOME_pidict'
       found = 0
       try:
          fpid=open(filedict, 'r')
-        found = 1
+         found = 1
       except:
-         print "le fichier %s des process SALOME n'est pas accessible"% filedict
+         print("le fichier %s des process SALOME n'est pas accessible"% filedict)
 
       if found:
          process_id=pickle.load(fpid)
          fpid.close()
          killSalome()
-        process_id={}
+         process_id = {}
          os.remove(filedict)
-       
-except getopt.error, msg:
-  print usage
+
+except getopt.error as msg:
+  print(usage)
   sys.exit(1)
 
 # -----------------------------------------------------------------------------
 #
-# Vérification des variables d'environnement
+# V??rification des variables d'environnement
 #
 try:
   kernel_root_dir=os.environ["KERNEL_ROOT_DIR"]
   modules_root_dir["KERNEL"]=kernel_root_dir
 except:
-  print usage
+  print(usage)
   sys.exit(1)
 
 for module in liste_modules :
@@ -143,12 +143,12 @@ for module in liste_modules :
       module_root_dir=os.environ[module +"_ROOT_DIR"]
       modules_root_dir[module]=module_root_dir
    except:
-      print usage
+      print(usage)
       sys.exit(1)
 
 # il faut KERNEL en premier dans la liste des modules
 # - l'ordre des modules dans le catalogue sera identique
-# - la liste des modules presents dans le catalogue est exploitée pour charger les modules CORBA python,
+# - la liste des modules presents dans le catalogue est exploit??e pour charger les modules CORBA python,
 #   il faut charger les modules python du KERNEL en premier
 
 if "KERNEL" in liste_modules:liste_modules.remove("KERNEL")
@@ -156,21 +156,21 @@ liste_modules[:0]=["KERNEL"]
 #print liste_modules
 #print modules_root_dir
 
-os.environ["SALOMEPATH"]=":".join(modules_root_dir.values())
+os.environ["SALOMEPATH"]=":".join(list(modules_root_dir.values()))
 if "SUPERV" in liste_modules:with_container_superv=1
 
 
 # -----------------------------------------------------------------------------
 #
-# Définition des classes d'objets pour le lancement des Server CORBA
+# D??finition des classes d'objets pour le lancement des Server CORBA
 #
 
 class Server:
    CMD=[]
    if with_xterm:
-       ARGS=['xterm', '-iconic', '-sb', '-sl', '500', '-e']
+     ARGS = ['xterm', '-iconic', '-sb', '-sl', '500', '-e']
    else:
-       ARGS=[] 
+      ARGS = []
 
    def run(self):
       args = self.ARGS+self.CMD
@@ -187,9 +187,9 @@ class CatalogServer(Server):
       for module in liste_modules:
           module_root_dir=modules_root_dir[module]
           module_cata=module+"Catalog.xml"
-          print "   ", module_cata
+          print("   ", module_cata)
           cata_path.extend(glob.glob(os.path.join(module_root_dir,"share","salome","resources",module_cata)))
-      self.CMD=self.SCMD1 + [string.join(cata_path,':')] + self.SCMD2
+      self.CMD = self.SCMD1 + [':'.join(cata_path)] + self.SCMD2
 
 class SalomeDSServer(Server):
    CMD=['SALOMEDS_Server']
@@ -310,7 +310,7 @@ def startGUI():
   #
   # Activation du GUI de Session Server
   #
-       
+
   session.GetInterface()
   
 #
@@ -333,8 +333,8 @@ def startSalome():
   #  disponibilite dans le naming service
   #
   if with_logger:
-       LoggerServer().run()
-       clt.waitLogger("Logger")
+    LoggerServer().run()
+    clt.waitLogger("Logger")
 
   #
   # Lancement Registry Server
@@ -342,7 +342,7 @@ def startSalome():
   RegistryServer().run()
 
   #
-  # Attente de la disponibilité du Registry dans le Naming Service
+  # Attente de la disponibilit?? du Registry dans le Naming Service
   #
   clt.waitNS("/Registry")
 
@@ -354,7 +354,7 @@ def startSalome():
   cataServer.run()
 
   #
-  # Attente de la disponibilité du Catalog Server dans le Naming Service
+  # Attente de la disponibilit?? du Catalog Server dans le Naming Service
   #
   import SALOME_ModuleCatalog
   clt.waitNS("/Kernel/ModulCatalog",SALOME_ModuleCatalog.ModuleCatalog)
@@ -367,14 +367,14 @@ def startSalome():
   SalomeDSServer().run()
 
   if "GEOM" in liste_modules:
-       print "GEOM OCAF Resources"
-       os.environ["CSF_GEOMDS_ResourcesDefaults"]=os.path.join(modules_root_dir["GEOM"],"share","salome","resources")
+    print("GEOM OCAF Resources")
+    os.environ["CSF_GEOMDS_ResourcesDefaults"] = os.path.join(modules_root_dir["GEOM"], "share", "salome", "resources")
 
 
   #
-  # Attente de la disponibilité du SalomeDS dans le Naming Service
+  # Attente de la disponibilit?? du SalomeDS dans le Naming Service
   #
-  clt.waitNS("/myStudyManager")
+  clt.waitNS("/Study")
 
   #
   # Lancement Session Server
@@ -382,7 +382,7 @@ def startSalome():
   SessionServer().run()
 
   #
-  # Attente de la disponibilité du Session Server dans le Naming Service
+  # Attente de la disponibilit?? du Session Server dans le Naming Service
   #
   import SALOME
   session=clt.waitNS("/Kernel/Session",SALOME.Session)
@@ -397,41 +397,41 @@ def startSalome():
   # Lancement Container C++ local
   #
   if with_container_cpp:
-         ContainerCPPServer().run()
-         #
-         # Attente de la disponibilité du Container C++ local 
-          # dans le Naming Service
-         #
-         clt.waitNS("/Containers/" + theComputer + "/FactoryServer")
+    ContainerCPPServer().run()
+    #
+    # Attente de la disponibilit?? du Container C++ local
+    # dans le Naming Service
+    #
+    clt.waitNS("/Containers/" + theComputer + "/FactoryServer")
   #
   # Lancement Container Python local
   #
   if with_container_python:
-         ContainerPYServer().run()
-         #
-         # Attente de la disponibilité du Container Python local 
-          #  dans le Naming Service
-         #
-         clt.waitNS("/Containers/" + theComputer + "/FactoryServerPy")
+    ContainerPYServer().run()
+    #
+    # Attente de la disponibilit?? du Container Python local
+    #  dans le Naming Service
+    #
+    clt.waitNS("/Containers/" + theComputer + "/FactoryServerPy")
 
   if with_container_superv:
-       #
-       # Lancement Container Supervision local
-       #
-       ContainerSUPERVServer().run()
-       #
-       # Attente de la disponibilité du Container Supervision local 
-        # dans le Naming Service
-       #
-       clt.waitNS("/Containers/" + theComputer + "/SuperVisionContainer")
+    #
+    # Lancement Container Supervision local
+    #
+    ContainerSUPERVServer().run()
+    #
+    # Attente de la disponibilit?? du Container Supervision local
+    # dans le Naming Service
+    #
+    clt.waitNS("/Containers/" + theComputer + "/SuperVisionContainer")
   #
   # Activation du GUI de Session Server
   #
   #session.GetInterface()
 
   end_time = os.times()
-  print
-  print "Start SALOME, elpased time : %5.1f seconds"% (end_time[4] - init_time[4])
+  print()
+  print("Start SALOME, elpased time : %5.1f seconds"% (end_time[4] - init_time[4]))
 
   return clt
 
@@ -440,13 +440,14 @@ def startSalome():
 #
 
 if __name__ == "__main__":
+   import codecs
    clt=None
    try:
       clt = startSalome()
    except:
-      print
-      print
-      print "--- erreur au lancement Salome ---"
+      print()
+      print()
+      print("--- erreur au lancement Salome ---")
    
    #print process_id
    
@@ -454,32 +455,31 @@ if __name__ == "__main__":
    filedict='/tmp/'+os.getenv('USER')+'_SALOME_pidict'
    #filedict='/tmp/'+os.getlogin()+'_SALOME_pidict'
    
-   fpid=open(filedict, 'w')
-   pickle.dump(process_id,fpid)
-   fpid.close()
+   with codecs.open(filedict, 'w') as fpid:
+      pickle.dump(process_id, fpid)
    
-   print """
+   print("""
 
 Sauvegarde du dictionnaire des process dans , %s
 Pour tuer les process SALOME, executer : python killSalome.py depuis
 une console, ou bien killSalome() depuis le present interpreteur,
-s'il n'est pas fermé.
+s'il n'est pas ferm??.
 
 runHOMARD, avec l'option --killall, commence par tuer les process restants 
-d'une execution précédente.
+d'une execution pr??c??dente.
 
 Pour lancer uniquement le GUI, executer startGUI() depuis le present interpreteur,
-s'il n'est pas fermé.
+s'il n'est pas ferm??.
 
-""" % filedict
+""" % filedict)
    
    #
    #  Impression arborescence Naming Service
    #
    
    if clt != None:
-     print
-     print " --- registered objects tree in Naming Service ---"
+     print()
+     print(" --- registered objects tree in Naming Service ---")
      clt.showNS()
      session=clt.waitNS("/Kernel/Session")
      catalog=clt.waitNS("/Kernel/ModulCatalog")
@@ -487,16 +487,15 @@ s'il n'est pas ferm
      container =  clt.waitNS("/Containers/" + socket.gethostname().split('.')[0] + "/FactoryServerPy")
    
    if os.path.isfile("~/.salome/pystartup"):
-      f=open(os.path.expanduser("~/.salome/pystartup"),'w')
-      PYTHONSTARTUP=f.read()
-      f.close()
+      with codecs.open(os.path.expanduser("~/.salome/pystartup")) as f:
+          PYTHONSTARTUP = f.read()
    else:
       PYTHONSTARTUP="""
 # Add auto-completion and a stored history file of commands to your Python
 # interactive interpreter. Requires Python 2.0+, readline. Autocomplete is
 # bound to the TAB key by default (you can change it - see readline docs).
 #
-# Store the history in ~/.salome/pyhistory, 
+# Store the history in ~/.salome/pyhistory,
 #
 import atexit
 import os
@@ -516,9 +515,7 @@ if os.path.exists(historyPath):
 atexit.register(save_history)
 del os, atexit, readline, rlcompleter, save_history, historyPath
 """
-      f=open(os.path.expanduser("~/.salome/pystartup"),'w')
-      f.write(PYTHONSTARTUP)
-      f.close()
+      with codecs.open(os.path.expanduser("~/.salome/pystartup"), 'w') as f:
+          f.write(PYTHONSTARTUP)
 
-   exec PYTHONSTARTUP in {}
-   
+   exec(PYTHONSTARTUP, {})
index b0544844bae7f1207bfd5ec3219e743f3e50d5f0..587a893d899974d261be7f39713a4ca355c57cd7 100644 (file)
@@ -16,7 +16,6 @@ The loading of the module HOMARD is done in a way similar to the other modules.
 
   import HOMARD
   homard = salome.lcc.FindOrLoadComponent('FactoryServer','HOMARD')
-  homard.SetCurrentStudy(salome.myStudy)
 
 To use the module HOMARD within a distributed scheme YACS, the loading is made as follows:
 
@@ -25,7 +24,6 @@ To use the module HOMARD within a distributed scheme YACS, the loading is made a
   import HOMARD
   my_container.load_component_Library('HOMARD')
   homard = my_container.create_component_instance('HOMARD',0)
-  homard.SetCurrentStudy(salome.myStudy)
 
 Uniform refinement
 ******************
index 4815352d777e4bffd25ff9d3406f42ae8719119d..710bb9183d3d47176c9279e3c244ec3e217142b5 100644 (file)
@@ -53,7 +53,7 @@ Etude_Initialisation
 The box Etude_Initialisation launches the component HOMARD inside SALOME. It is a block consisted of two parts, that are invariable whatever is the envisaged application:
 
 - StudyCreation : python node
-- SetCurrentStudy : service of the component HOMARD
+- UpdateStudy : service of the component HOMARD
 
 .. image:: ../images/yacs_b_01.png
    :align: center
@@ -66,7 +66,7 @@ The python node StudyCreation initialize the SALOME study that is given through
 .. literalinclude:: ../files/yacs_01.en.xml
    :lines: 44-62
 
-The service SetCurrentStudy connects this study to an instance of HOMARD.
+The service UpdateStudy connects this study to an instance of HOMARD.
 
 .. literalinclude:: ../files/yacs_01.en.xml
    :lines: 63-68
index b1553c178b01fb8fcfdb1ffc05910b0507c6f92c..51b46e37e0794402b3b00dcef14a04a7d5f0faab 100755 (executable)
@@ -47,8 +47,6 @@ salome.salome_init()
 import HOMARD
 #
 homard = salome.lcc.FindOrLoadComponent("FactoryServer", "HOMARD")
-study_main = salome.myStudyManager.NewStudy("HOMARD")
-homard.SetCurrentStudy(salome.myStudy)
 #
 # Hypotheses
 # ==========
@@ -89,4 +87,4 @@ gzip_gunzip(DATA_TUTORIAL, 1, 1)
 # ==================================
 #
 if salome.sg.hasDesktop():
-  salome.sg.updateObjBrowser(True)
+  salome.sg.updateObjBrowser()
index ad007671bef6ce4ea175a5beb7f41d814385e071..8fe7b6a9e92e643581ef9753ba3197a0d8f47415 100755 (executable)
@@ -47,8 +47,6 @@ salome.salome_init()
 import HOMARD
 #
 homard = salome.lcc.FindOrLoadComponent("FactoryServer", "HOMARD")
-study_main = salome.myStudyManager.NewStudy("HOMARD")
-homard.SetCurrentStudy(salome.myStudy)
 #
 # Creation des zones
 # ==================
@@ -99,4 +97,4 @@ gzip_gunzip(DATA_TUTORIAL, 2, 1)
 # ==================================
 
 if salome.sg.hasDesktop():
-  salome.sg.updateObjBrowser(True)
+  salome.sg.updateObjBrowser()
index 07957b8092f289b4cd158d495bc6fb139c2ca13d..61ffaae60fd68bca483d9251368296bf86935209 100755 (executable)
@@ -47,8 +47,6 @@ salome.salome_init()
 import HOMARD
 #
 homard = salome.lcc.FindOrLoadComponent("FactoryServer", "HOMARD")
-study_main = salome.myStudyManager.NewStudy("HOMARD")
-homard.SetCurrentStudy(salome.myStudy)
 #
 # Hypothese "hypo_0vers1"
 # =======================
@@ -128,4 +126,4 @@ gzip_gunzip(DATA_TUTORIAL, 3, 1)
 # ==================================
 
 if salome.sg.hasDesktop():
-  salome.sg.updateObjBrowser(True)
+  salome.sg.updateObjBrowser()
index 8b8a583daa710d265da30211371a1b77d7b74d9c..9b4751f168c044bc29f9bcc8f4fc6c5e7608caa2 100755 (executable)
@@ -47,8 +47,6 @@ salome.salome_init()
 import HOMARD
 #
 homard = salome.lcc.FindOrLoadComponent("FactoryServer", "HOMARD")
-study_main = salome.myStudyManager.NewStudy("HOMARD")
-homard.SetCurrentStudy(salome.myStudy)
 #
 # Frontieres
 # ==========
@@ -115,4 +113,4 @@ gzip_gunzip(DATA_TUTORIAL, 4, 1)
 # ==================================
 
 if salome.sg.hasDesktop():
-  salome.sg.updateObjBrowser(True)
+  salome.sg.updateObjBrowser()
index b793eeee15d98b3ab4a24e1dcd80d5b924b84033..0fadf72f6dfb70720f1e5977a58f6f207c73939e 100644 (file)
@@ -1,6 +1,5 @@
 <?xml version='1.0' encoding='iso-8859-1' ?>
 <proc name="tutorial_4">
-   <property name="DefaultStudyID" value="1"/>
    <objref name="CALCIUM_real" id="IDL:Ports/Calcium_Ports/Calcium_Real_Port:1.0"/>
    <type name="string" kind="string"/>
    <struct name="Engines/dataref">
@@ -50,8 +49,7 @@ import HOMARD_Zone_idl
 import HOMARD_Boundary_idl
 
 clt = orbmodule.client()
-StudyManager = clt.Resolve("/myStudyManager")
-CurrentStudy = StudyManager.GetStudyByID(1)
+CurrentStudy = clt.Resolve("/Study")
 ]]></code></script>
          <outport name="CurrentStudy" type="Study"/>
       </inline>
index cdcd96e766944f11ef927421a91db0ea413cc7d2..12bb4943ac951b4067d2d6d5a847f2a91540eed3 100755 (executable)
@@ -47,8 +47,6 @@ salome.salome_init()
 import HOMARD
 #
 homard = salome.lcc.FindOrLoadComponent("FactoryServer", "HOMARD")
-study_main = salome.myStudyManager.NewStudy("HOMARD")
-homard.SetCurrentStudy(salome.myStudy)
 #
 # Frontiere
 # =========
@@ -99,4 +97,4 @@ gzip_gunzip(DATA_TUTORIAL, 5, 1)
 # ==================================
 
 if salome.sg.hasDesktop():
-  salome.sg.updateObjBrowser(True)
+  salome.sg.updateObjBrowser()
index bb14b6b220fc7cfa9f3cd5914a8b90108dd4faff..83166861f4991ab3895f39217e9733c5660771ed 100644 (file)
@@ -1,6 +1,5 @@
 <?xml version='1.0' encoding='iso-8859-1' ?>
 <proc name="HOMARD">
-   <property name="DefaultStudyID" value="1"/>
    <objref name="CALCIUM_real" id="IDL:Ports/Calcium_Ports/Calcium_Real_Port:1.0"/>
    <type name="string" kind="string"/>
    <struct name="Engines/dataref">
@@ -55,8 +54,7 @@ import HOMARD_Zone_idl
 import HOMARD_Boundary_idl
 
 clt = orbmodule.client()
-StudyManager = clt.Resolve("/myStudyManager")
-CurrentStudy = StudyManager.GetStudyByID(1)
+CurrentStudy = clt.Resolve("/Study")
 ]]></code></script>
          <outport name="CurrentStudy" type="Study"/>
       </inline>
index b90f482c543f5cdae83fd77931cb98104d4d910a..c384530c7fbba8af7da8fa777ad24e9575f91097 100644 (file)
@@ -1,6 +1,5 @@
 <?xml version='1.0' encoding='iso-8859-1' ?>
 <proc name="HOMARD">
-   <property name="DefaultStudyID" value="1"/>
    <objref name="CALCIUM_real" id="IDL:Ports/Calcium_Ports/Calcium_Real_Port:1.0"/>
    <type name="string" kind="string"/>
    <struct name="Engines/dataref">
@@ -55,8 +54,7 @@ import HOMARD_Zone_idl
 import HOMARD_Boundary_idl
 
 clt = orbmodule.client()
-StudyManager = clt.Resolve("/myStudyManager")
-CurrentStudy = StudyManager.GetStudyByID(1)
+CurrentStudy = clt.Resolve("/Study")
 ]]></code></script>
          <outport name="CurrentStudy" type="Study"/>
       </inline>
index be8303400a3efb37abf999b83ee23a57a5ea5d2b..587ec7e285b16a4fdadb18bb9b5bc12740476985 100755 (executable)
@@ -98,7 +98,7 @@ Exemples :
 #
 # 0.2. ==> Le user
 #
-  if os.environ.has_key("LOGNAME") :
+  if "LOGNAME" in os.environ :
     user = os.environ ["LOGNAME"]
   else :
     user = "salome"
@@ -187,13 +187,13 @@ Le constructeur de la classe Script
 #
     if self.verbose_max :
       nom_fonction = __name__ + "/__init__"
-      print "\nDans " + nom_fonction + ","
-      print ". rep_calc       :", self.rep_calc
-      print ". mesh_file      :", self.mesh_file
-      print ". numero         :", self.numero
-      print ". opt1           :", self.opt1
-      print ". opt2           :", self.opt2
-      print ". attente        :", self.attente
+      print("\nDans " + nom_fonction + ",")
+      print(". rep_calc       :", self.rep_calc)
+      print(". mesh_file      :", self.mesh_file)
+      print(". numero         :", self.numero)
+      print(". opt1           :", self.opt1)
+      print(". opt2           :", self.opt2)
+      print(". attente        :", self.attente)
 #
 #=========================  Fin de la fonction ===================================
 #
@@ -257,8 +257,8 @@ Lancement d'un calcul
       break
 #
     if self.verbose_max :
-      print blabla
-      print ". erreur :", erreur
+      print(blabla)
+      print(". erreur :", erreur)
 #
     return erreur, message_erreur, dico_resu
 #
@@ -279,10 +279,10 @@ Preparation d'un calcul
     message_erreur = " "
 #
     if self.verbose_max :
-      print blabla
-      print ". rep_calc       :", self.rep_calc
-      print ". mesh_file      :", self.mesh_file
-      print ". tr             :", self.tr
+      print(blabla)
+      print(". rep_calc       :", self.rep_calc)
+      print(". mesh_file      :", self.mesh_file)
+      print(". tr             :", self.tr)
 #
     while not erreur :
 #
@@ -316,8 +316,8 @@ Preparation d'un calcul
       break
 #
     if self.verbose_max :
-      print blabla, "a la fin"
-      print ". erreur :", erreur
+      print(blabla, "a la fin")
+      print(". erreur :", erreur)
 #
     return erreur, message_erreur
 #
@@ -349,14 +349,14 @@ Controle les arguments et stockage de quelques informations
     message_erreur = " "
 #
     if self.verbose_max :
-      print blabla
-      print ". rep_calc       :", self.rep_calc
-      print ". mesh_file      :", self.mesh_file
-      print ". numero         :", self.numero
-      print ". tr             :", self.tr
-      print ". opt1           :", self.opt1
-      print ". opt2           :", self.opt2
-      print ". attente        :", self.attente
+      print(blabla)
+      print(". rep_calc       :", self.rep_calc)
+      print(". mesh_file      :", self.mesh_file)
+      print(". numero         :", self.numero)
+      print(". tr             :", self.tr)
+      print(". opt1           :", self.opt1)
+      print(". opt2           :", self.opt2)
+      print(". attente        :", self.attente)
 #
     while not erreur :
 #
@@ -373,7 +373,7 @@ Controle les arguments et stockage de quelques informations
 #
 # 1.2. Le repertoire de calcul
 #
-      if os.environ.has_key("HOME") :
+      if "HOME" in os.environ :
         HOME = os.environ ["HOME"]
       else :
         HOME = "/local/home/salome"
@@ -410,7 +410,7 @@ Controle les arguments et stockage de quelques informations
 #
       self.nomcas = os.path.basename(self.rep_calc)
       if self.verbose_max :
-        print ". Cas :", self.nomcas
+        print(". Cas :", self.nomcas)
 #
 # 3. Le temps d'attente
 #
@@ -524,10 +524,10 @@ Controle les arguments et stockage de quelques informations
       message_erreur = messages_erreur[erreur]
 #
     if self.verbose_max :
-      print ". rep_calc  :", self.rep_calc
-      print ". mesh_file :", self.mesh_file
-      print ". opt1      :", self.opt1
-      print ". opt2      :", self.opt2
+      print(". rep_calc  :", self.rep_calc)
+      print(". mesh_file :", self.mesh_file)
+      print(". opt1      :", self.opt1)
+      print(". opt2      :", self.opt2)
 #
     return erreur, message_erreur
 #
@@ -550,9 +550,9 @@ Modification du fichier export et reperage de quelques informations
     message_erreur = " "
 #
     if self.verbose_max :
-      print blabla
-      print ". numero     :", self.numero
-      print ". mesh_file  :", self.mesh_file
+      print(blabla)
+      print(". numero     :", self.numero)
+      print(". mesh_file  :", self.mesh_file)
 #
     while not erreur :
 #
@@ -571,7 +571,7 @@ Modification du fichier export et reperage de quelques informations
       nomfic += "." + self.numero_str + ".export"
       self.nomfic_export = os.path.join(self.rep_calc, nomfic)
       if self.verbose_max :
-        print ". nouveau fic_export :", self.nomfic_export
+        print(". nouveau fic_export :", self.nomfic_export)
       fic = open (self.nomfic_export, "w")
 #
 # 3. Exploration des lignes
@@ -606,7 +606,7 @@ Modification du fichier export et reperage de quelques informations
           if ( typfic == "comm" ) :
 #
             if self.verbose_max :
-              print ". Commandes : mise a jour du nom du repertoire"
+              print(". Commandes : mise a jour du nom du repertoire")
             chgt = True
             nomfic_l_0 = os.path.basename(nomfic_0)
             nomfic = os.path.join(self.rep_calc, nomfic_l_0)
@@ -615,7 +615,7 @@ Modification du fichier export et reperage de quelques informations
 #
           elif ( ( statut == "R" ) or ( typfic == "mmed" ) ) :
             if self.verbose_max :
-              print ". Mise a jour du nom"
+              print(". Mise a jour du nom")
             chgt = True
 #
 # 3.2.2.1. Le fichier de maillage est celui passe en argument
@@ -739,13 +739,13 @@ Modification du fichier export et reperage de quelques informations
       message_erreur = messages_erreur[erreur]
 #
     if self.verbose_max :
-      print ". mclient    ", self.mclient
-      print ". uclient    ", self.uclient
-      print ". serveur    ", self.serveur
-      print ". username   ", self.username
-      print ". aster_root ", self.aster_root
-      print ". nomjob     ", self.nomjob
-      print ". mode       ", self.mode
+      print(". mclient    ", self.mclient)
+      print(". uclient    ", self.uclient)
+      print(". serveur    ", self.serveur)
+      print(". username   ", self.username)
+      print(". aster_root ", self.aster_root)
+      print(". nomjob     ", self.nomjob)
+      print(". mode       ", self.mode)
 #
     return erreur, message_erreur
 #
@@ -769,9 +769,9 @@ Modification du fichier de commandes lie au cas transitoire
     message_erreur = " "
 #
     if self.verbose_max :
-      print blabla
-      print ". opt1 :", self.opt1
-      print ". opt2 :", self.opt2
+      print(blabla)
+      print(". opt1 :", self.opt1)
+      print(". opt2 :", self.opt2)
 #
     while not erreur :
 #
@@ -795,7 +795,7 @@ Modification du fichier de commandes lie au cas transitoire
       for ligne in les_lignes :
 #
         if self.verbose_max :
-          print "ligne =", ligne[:-1]
+          print("ligne =", ligne[:-1])
 #
 # 3.1. Pas de modification, a priori
 #
@@ -875,10 +875,10 @@ Modification du fichier de commandes lie au cas de l'excavation
     message_erreur = " "
 #
     if self.verbose_max :
-      print blabla
-      print ". numero     :", self.numero
-      print ". nro_couche :", self.nro_couche
-      print ". nro_adap   :", self.nro_adap
+      print(blabla)
+      print(". numero     :", self.numero)
+      print(". nro_couche :", self.nro_couche)
+      print(". nro_adap   :", self.nro_adap)
 #
     while not erreur :
 #
@@ -902,7 +902,7 @@ Modification du fichier de commandes lie au cas de l'excavation
       for ligne in les_lignes :
 #
         if self.verbose_max :
-          print "ligne =", ligne[:-1]
+          print("ligne =", ligne[:-1])
 #
 # 3.1. Pas de modification, a priori
 #
@@ -974,8 +974,8 @@ Lancement d'un calcul
     message_erreur = " "
 #
     if self.verbose_max :
-      print ". mclient    ", self.mclient
-      print ". serveur    ", self.serveur
+      print(". mclient    ", self.mclient)
+      print(". serveur    ", self.serveur)
 #
 # 1. Copie du fichier export sur le serveur de calcul
 #
@@ -984,8 +984,8 @@ Lancement d'un calcul
       nomfic_export_dist = self.nomjob + ".export"
       commande = "scp " + self.nomfic_export + " " + self.username + "@" + self.serveur + ":" + nomfic_export_dist
       if self.verbose_max :
-        print "Copie du fichier export vers", self.serveur, ":"
-        print commande
+        print("Copie du fichier export vers", self.serveur, ":")
+        print(commande)
       erreur = os.system(commande)
 #
 # 2. Commande du lancement
@@ -1015,8 +1015,8 @@ Lancement d'un calcul
     commande += " 1>" + fic_caract
     commande += " 2>" + fic_caract_2
     if self.verbose_max :
-      print "Lancement sur", self.serveur, ":"
-      print commande
+      print("Lancement sur", self.serveur, ":")
+      print(commande)
 #
 # 3.2. Lancement vrai
 #
@@ -1029,10 +1029,10 @@ Lancement d'un calcul
       self.message_info += self.dico["rmed"]+"\n"
 #
     if self.verbose_max :
-      print blabla
-      print ". erreur     :", erreur
-      print ". self.mode  :", self.mode
-      print ". fic_caract :", fic_caract
+      print(blabla)
+      print(". erreur     :", erreur)
+      print(". self.mode  :", self.mode)
+      print(". fic_caract :", fic_caract)
 #
     if erreur :
       message_erreur = messages_erreur[erreur]
@@ -1057,11 +1057,11 @@ fic_caract : fichier caracteristique du job
     message_erreur = " "
 #
     if self.verbose_max :
-      print ". fic_caract :", fic_caract
-      print ". nomjob     :", self.nomjob
-      print ". rep_calc   :", self.rep_calc
-      print ". mode       :", self.mode
-      print ". attente    :", self.attente
+      print(". fic_caract :", fic_caract)
+      print(". nomjob     :", self.nomjob)
+      print(". rep_calc   :", self.rep_calc)
+      print(". mode       :", self.mode)
+      print(". attente    :", self.attente)
 #
     if ( self.mode != "interactif" ) :
 #
@@ -1088,7 +1088,7 @@ fic_caract : fichier caracteristique du job
             numjob = laux1[0]
   #
       if self.verbose :
-        print ". numjob :", numjob
+        print(". numjob :", numjob)
 #
 # 2. Commande de l'examen de l'etat du job,
 #
@@ -1098,7 +1098,7 @@ fic_caract : fichier caracteristique du job
       commande_base  = os.path.join(self.aster_root, "bin", "as_run")
       commande_base += " --actu " + numjob + " " + self.nomjob + " " + self.mode
       if self.verbose_max :
-        print "commande_base =", commande_base
+        print("commande_base =", commande_base)
       if ( self.mclient == self.serveur ) :
         commande  = commande_base
       else :
@@ -1107,8 +1107,8 @@ fic_caract : fichier caracteristique du job
       commande += " 1>" + fic_etat
       commande += " 2>" + fic_etat_2
       if self.verbose_max :
-        print "Examen sur", self.serveur, ":"
-        print commande
+        print("Examen sur", self.serveur, ":")
+        print(commande)
 #
 # 3. Examen de l'etat du job, jusqu'a la fin
 #
@@ -1117,7 +1117,7 @@ fic_caract : fichier caracteristique du job
   #
         if encore % 4 == 0 :
           aux = ((encore-1)*self.attente) / 60
-          print "..", aux, "mn"
+          print("..", aux, "mn")
           #print diag
   #
         time.sleep(self.attente)
@@ -1138,7 +1138,7 @@ fic_caract : fichier caracteristique du job
               laux1 = laux[1].split("=")
               diag = laux1[1]
               if self.verbose_max :
-                print etat, diag
+                print(etat, diag)
               if etat in ( "RUN", "PEND" ) :
                 encore += 1
               else :
@@ -1163,8 +1163,8 @@ fic_caract : fichier caracteristique du job
       os.remove(fic_etat_2)
 #
     if self.verbose_max :
-      print blabla
-      print ". erreur :", erreur
+      print(blabla)
+      print(". erreur :", erreur)
 #
     if erreur :
       message_erreur = "Erreur dans le calcul"
@@ -1191,8 +1191,7 @@ Affichage de resultats selon les cas
     message_erreur = " "
 #
     dico_resu = {}
-    for cle in dico_resu_init.keys() :
-      dico_resu[cle] = dico_resu_init[cle]
+    dico_resu.update(dico_resu_init)
 #
     while not erreur :
 #
@@ -1270,9 +1269,9 @@ Affichage de resultats selon les cas
       break
 #
     if self.verbose :
-      print blabla
-      print ". erreur :", erreur
-      print ". dico_resu :", dico_resu
+      print(blabla)
+      print(". erreur :", erreur)
+      print(". dico_resu :", dico_resu)
 #
     if erreur :
       message_erreur = messages_erreur[erreur]
@@ -1306,7 +1305,7 @@ info = la ou les lignes recherchees
     nom_fonction = __name__ + "/post_aster_1"
     blabla = "\nDans " + nom_fonction + " :"
     if self.verbose_max :
-      print blabla, "nomfic =", nomfic, "chaine =", chaine, ", nuocc =", nuocc
+      print(blabla, "nomfic =", nomfic, "chaine =", chaine, ", nuocc =", nuocc)
 #
     trouve = False
     erreur = 0
@@ -1353,8 +1352,8 @@ info = la ou les lignes recherchees
       erreur = -1
 #
     if ( self.verbose_max or ( erreur>0 ) ) :
-      print blabla, "nomfic =", nomfic, "chaine =", chaine, ", nuocc =", nuocc
-      print ". erreur =", erreur
+      print(blabla, "nomfic =", nomfic, "chaine =", chaine, ", nuocc =", nuocc)
+      print(". erreur =", erreur)
 #
     if erreur :
       message_erreur = messages_erreur[erreur]
@@ -1396,8 +1395,8 @@ Dump du resultat du calcul
       self.message_info += fic_dump+"\n"
 #
     if self.verbose_max :
-      print blabla
-      print ". erreur :", erreur
+      print(blabla)
+      print(". erreur :", erreur)
 #
     os.remove(nomfic_donn)
 #
index 74a4d08b0cfafc9d7b1e933d4fb6a7f131f685f7..12f4f581323019c0c76ffc18381187f3d637b702 100755 (executable)
@@ -100,10 +100,10 @@ Le constructeur de la classe Script
 #
     if self.verbose_max :
       nom_fonction = __name__ + "/__init__"
-      print "\nDans " + nom_fonction + ","
-      print ". rep_calc       :", self.rep_calc
-      print ". mesh_file      :", self.mesh_file
-      print ". numero         :", self.numero
+      print("\nDans " + nom_fonction + ",")
+      print(". rep_calc       :", self.rep_calc)
+      print(". mesh_file      :", self.mesh_file)
+      print(". numero         :", self.numero)
 #
 #=========================  Fin de la fonction ===================================
 #
@@ -141,8 +141,8 @@ Lancement d'un calcul
       break
 #
     if self.verbose_max :
-      print blabla
-      print ". erreur :", erreur
+      print(blabla)
+      print(". erreur :", erreur)
 #
     return erreur, message_erreur, dico_resu
 #
@@ -170,10 +170,10 @@ Controle les arguments et stockage de quelques informations
     message_erreur = " "
 #
     if self.verbose_max :
-      print blabla
-      print ". rep_calc       :", self.rep_calc
-      print ". mesh_file      :", self.mesh_file
-      print ". numero         :", self.numero
+      print(blabla)
+      print(". rep_calc       :", self.rep_calc)
+      print(". mesh_file      :", self.mesh_file)
+      print(". numero         :", self.numero)
 #
     while not erreur :
 #
@@ -190,7 +190,7 @@ Controle les arguments et stockage de quelques informations
 #
 # 1.2. Le repertoire de calcul
 #
-      if os.environ.has_key("HOME") :
+      if "HOME" in os.environ :
         HOME = os.environ ["HOME"]
       else :
         HOME = "/local/home/salome"
@@ -234,8 +234,8 @@ Controle les arguments et stockage de quelques informations
       message_erreur = messages_erreur[erreur]
 #
     if self.verbose_max :
-      print ". rep_calc  :", self.rep_calc
-      print ". mesh_file :", self.mesh_file
+      print(". rep_calc  :", self.rep_calc)
+      print(". mesh_file :", self.mesh_file)
 #
     return erreur, message_erreur
 #
index 25cb739a6577f730c5a6ff49a61a2fbcf0b71958..3cda6c844930cfd2fdf59168182ac15b1a9401d7 100644 (file)
@@ -16,7 +16,7 @@ Le chargement du module HOMARD se fait de manière analogue aux autres modules.
 
   import HOMARD
   homard = salome.lcc.FindOrLoadComponent('FactoryServer','HOMARD')
-  homard.SetCurrentStudy(salome.myStudy)
+  homard.UpdateStudy()
 
 Pour utiliser le module HOMARD au sein d'un schéma YACS distribué, le chargement se fait ainsi :
 
@@ -25,7 +25,7 @@ Pour utiliser le module HOMARD au sein d'un schéma YACS distribué, le chargeme
   import HOMARD
   my_container.load_component_Library('HOMARD')
   homard = my_container.create_component_instance('HOMARD',0)
-  homard.SetCurrentStudy(salome.myStudy)
+  homard.UpdateStudy()
 
 Raffinement uniforme
 ********************
index b4c3cea37f5f7e021c667d364d31ae2125c6b66b..e8e27500f173e1ade008e21e2231f8936d74a68e 100644 (file)
@@ -53,7 +53,7 @@ Etude_Initialisation
 La boîte Etude_Initialisation lance le composant HOMARD dans SALOME. C'est un bloc composé de deux parties, qui sont invariables quelle que soit l'application envisagée :
 
 - StudyCreation : noeud python
-- SetCurrentStudy : service du composant HOMARD
+- UpdateStudy : service du composant HOMARD
 
 .. image:: ../images/yacs_b_01.png
    :align: center
@@ -66,7 +66,7 @@ Le noeud python StudyCreation sert à initialiser l'étude SALOME qui est fourni
 .. literalinclude:: ../files/yacs_01.fr.xml
    :lines: 44-62
 
-Le service SetCurrentStudy affecte cette étude à une instance de HOMARD.
+Le service UpdateStudy affecte cette étude à une instance de HOMARD.
 
 .. literalinclude:: ../files/yacs_01.fr.xml
    :lines: 63-68
index ad286aa71fbd50834010b2d474dcc8db799a024c..b78c63cdb2ac380bac26ee611a230f6b5b27a1f7 100644 (file)
@@ -18,7 +18,6 @@
             <component-author>EDF</component-author>
             <component-version>1.6</component-version>
             <component-comment>unknown</component-comment>
-            <component-multistudy>1</component-multistudy>
             <component-impltype>1</component-impltype>
             <component-icone>HOMARD_2.png</component-icone>
             <constraint></constraint>
                         </outParameter-list>
                         <DataStream-list></DataStream-list>
                     </component-service>
-                    <component-service>
-                        <service-name>SetCurrentStudy</service-name>
-                        <service-author>EDF</service-author>
-                        <service-version>1.6</service-version>
-                        <service-comment>unknown</service-comment>
-                        <service-by-default>0</service-by-default>
-                        <inParameter-list>
-                            <inParameter>
-                                <inParameter-name>theStudy</inParameter-name>
-                                <inParameter-type>SALOMEDS/Study</inParameter-type>
-                                <inParameter-comment>unknown</inParameter-comment>
-                            </inParameter>
-                        </inParameter-list>
-                        <outParameter-list></outParameter-list>
-                        <DataStream-list></DataStream-list>
-                    </component-service>
                     <component-service>
                         <service-name>PublishFileUnderIteration</service-name>
                         <service-author>EDF</service-author>
index 8dd3917f065cf808962876d7c7f8801e9c200bcd..20d8f8e278cfbc7f8cd5295c46f81dd5aba5c30f 100644 (file)
@@ -142,9 +142,7 @@ module HOMARD
 //
 // A.3. L'etude
 //
-    void SetCurrentStudy(in SALOMEDS::Study theStudy)      raises (SALOME::SALOME_Exception);
-    SALOMEDS::Study GetCurrentStudy()                      raises (SALOME::SALOME_Exception);
-    long GetCurrentStudyID()                               raises (SALOME::SALOME_Exception);
+    void UpdateStudy()      raises (SALOME::SALOME_Exception);
 //
 // A.4. Les caracteristiques generales
 //
index 304c924add2cd71a9b3eb32cbdc379ee4bb837c3..ad8774cd2ff0276a55af2c6adfff938ef63b3782 100644 (file)
@@ -54,7 +54,6 @@
             <component-author>HOMARD team - EDF RD</component-author>
             <component-version>1.4</component-version>
             <component-comment>unknown</component-comment>
-            <component-multistudy>1</component-multistudy>
             <component-impltype>1</component-impltype>
             <component-icone>HOMARD_2.png</component-icone>
             <constraint></constraint>
                         </outParameter-list>
                         <DataStream-list></DataStream-list>
                     </component-service>
-                    <component-service>
-                        <service-name>SetCurrentStudy</service-name>
-                        <service-author>HOMARD team - EDF RD</service-author>
-                        <service-version>1.1</service-version>
-                        <service-comment>unknown</service-comment>
-                        <service-by-default>0</service-by-default>
-                        <inParameter-list>
-                            <inParameter>
-                                <inParameter-name>theStudy</inParameter-name>
-                                <inParameter-type>Study</inParameter-type>
-                                <inParameter-comment>unknown</inParameter-comment>
-                            </inParameter>
-                        </inParameter-list>
-                        <outParameter-list></outParameter-list>
-                        <DataStream-list></DataStream-list>
-                    </component-service>
                     <component-service>
                         <service-name>PublishBoundaryUnderCase</service-name>
                         <service-author>HOMARD team - EDF RD</service-author>
index 0f21bf76f0bf35168ce831c490ce83a4ae742255..b0e8a585e8a4fb333440c41ff0ea9d72dc03ea4c 100644 (file)
@@ -1,6 +1,5 @@
 <?xml version='1.0' encoding='iso-8859-1' ?>
 <proc name="HOMARD">
-   <property name="DefaultStudyID" value="1"/>
    <objref name="CALCIUM_real" id="IDL:Ports/Calcium_Ports/Calcium_Real_Port:1.0"/>
    <type name="string" kind="string"/>
    <struct name="Engines/dataref">
index 5ec67d64604fc31f33e1d3aeadff9ada7725d1af..0e41d9e7656e4f0846e2632329f858d135c06e7a 100644 (file)
@@ -1,6 +1,5 @@
 <?xml version='1.0' encoding='iso-8859-1' ?>
 <proc name="HOMARD">
-   <property name="DefaultStudyID" value="1"/>
    <objref name="CALCIUM_real" id="IDL:Ports/Calcium_Ports/Calcium_Real_Port:1.0"/>
    <type name="string" kind="string"/>
    <struct name="Engines/dataref">
index c7c572536f697fce36e7e28cf4a8e9c2251cfe0b..2dee97edf510193131af431ae7720432a95b6ced 100644 (file)
@@ -127,7 +127,7 @@ std::string YACSDriver::Texte_Iter_1_Zone( int ZoneType, const std::string pytho
   _noeud_1 = noeud_2 ;
 // 3. Definition du service
   _Texte += "                           <service name=\"" + noeud_2 + "\">\n" ;
-  _Texte += "                              <node>Etude_Initialisation.SetCurrentStudy</node>\n" ;
+  _Texte += "                              <node>Etude_Initialisation.UpdateStudy</node>\n" ;
   _Texte += "                              <method>" + methode + "</method>\n" ;
 // 4. Les inports
 // 4.1. Le nom de la zone
@@ -293,7 +293,7 @@ std::string YACSDriver::Texte_Iter_1_Boundary( int BoundaryType, const std::stri
   _noeud_1 = noeud_2 ;
 // 3. Definition du service
   _Texte += "                           <service name=\"" + noeud_2 + "\">\n" ;
-  _Texte += "                              <node>Etude_Initialisation.SetCurrentStudy</node>\n" ;
+  _Texte += "                              <node>Etude_Initialisation.UpdateStudy</node>\n" ;
   _Texte += "                              <method>" + methode + "</method>\n" ;
 // 4. Les inports
 //    ATTENTION : les noms doivent etre les memes que dans Gen.xml, donc HOMARD_Gen.idl
index a2e40a95f2668f329fecebf5db377c16e6ab1c90..3d582396fdecaa4b33c3ebef09f9d3d1c061d4eb 100644 (file)
@@ -368,18 +368,12 @@ bool HOMARDGUI::OnGUIEvent (int theCommandID)
   }
 
   SUIT_Desktop* parent = application()->desktop();
+
   HOMARD::HOMARD_Gen_var homardGen = HOMARDGUI::InitHOMARDGen(app);
 
   if (!CORBA::is_nil(homardGen))
-  {
-    // Set current study
-    SalomeApp_Study* aSAStudy =dynamic_cast<SalomeApp_Study*>(app->activeStudy());
-    _PTR(Study) aStudy = aSAStudy->studyDS();
-    SALOMEDS::Study_ptr aStudyDS;
-    if (aStudy)
-      aStudyDS = _CAST(Study,aStudy)->GetStudy();
-      homardGen->SetCurrentStudy(aStudyDS);
-   }
+    homardGen->UpdateStudy();
+
   getApp()->updateObjectBrowser();
 
 // B. Choix selon les commandes
index a2acb26a16182990711b04a5555880e785e65ad7..cddac1cb7bb9288afd07f51cace33b02e0ba7178 100644 (file)
@@ -90,7 +90,6 @@ private:
 
    virtual void createPreferences();
    HOMARD::HOMARD_Gen_var myComponentHomard;
-   SALOMEDS::Study_var       myStudy;
 
    int anId;
    QString _ObjectName;
index 3b8b4ac03a1bbd0f6cd9dd2cfec07a67294d8c0a..1f5abdc0b64c296c457ef5de219a533279f801b8 100644 (file)
 
 SALOME_ListIO HOMARD_UTILS::mySelected;
 
-//================================================================
-// Function : GetCStudy
-// Returne un pointeur sur l'etude courante
-//================================================================
- _PTR(Study) HOMARD_UTILS::GetCStudy(const SalomeApp_Study* theStudy)
-{
-    return theStudy->studyDS();
-}
-
 //================================================================
 // Function : GetActiveStudy
 // Returne un pointeur sur l'etude active
@@ -71,17 +62,15 @@ SUIT_Study* HOMARD_UTILS::GetActiveStudy()
 }
 
 //================================================================
-// Function : GetActiveStudyDocument
+// Function : getStudy
 // Returne un pointeur sur l'etude active
 //================================================================
-_PTR(Study) HOMARD_UTILS::GetActiveStudyDocument()
+_PTR(Study) HOMARD_UTILS::getStudy()
 {
-    SalomeApp_Study* aStudy = dynamic_cast<SalomeApp_Study*>(GetActiveStudy());
-    if (aStudy){
-      return aStudy->studyDS();
-    }
-    else
-      return _PTR(Study)();
+  static _PTR(Study) _study;
+  if(!_study)
+    _study = SalomeApp_Application::getStudy();
+  return _study;
 }
 
 //================================================================
index 81182a0d051c33b3a71d8924cf6d7c5645b49b18..2946cf541ed463454169bcba15333903e51721e0 100644 (file)
@@ -53,12 +53,8 @@ class LightApp_SelectionMgr;
 
 namespace HOMARD_UTILS {
 
-  HOMARD_EXPORT
-  _PTR(Study)
-  GetCStudy(const SalomeApp_Study* theStudy);
-
   HOMARD_EXPORT SUIT_Study* GetActiveStudy();
-  HOMARD_EXPORT _PTR(Study) GetActiveStudyDocument();
+  HOMARD_EXPORT _PTR(Study) getStudy();
 
   HOMARD_EXPORT void updateObjBrowser();
 
index f9233e06bd47734ad754d26b9d34bf48443ceee0..7a3a3c1c9412323d63ce777302603433cafeed42 100644 (file)
@@ -75,7 +75,7 @@ QString HOMARD_QT_COMMUN::SelectionArbreEtude(QString commentaire, int option )
   if ( aIO->hasEntry() )
   {
 //     MESSAGE("aIO->getEntry() = " << aIO->getEntry());
-    _PTR(Study) aStudy = HOMARD_UTILS::GetActiveStudyDocument();
+    _PTR(Study) aStudy = HOMARD_UTILS::getStudy();
     _PTR(SObject) aSO ( aStudy->FindObjectID( aIO->getEntry() ) );
     _PTR(GenericAttribute) anAttr;
     if (aSO->FindAttribute(anAttr, "AttributeComment") )
@@ -127,7 +127,7 @@ QString HOMARD_QT_COMMUN::SelectionCasEtude()
   Handle(SALOME_InteractiveObject) aIO = HOMARD_UTILS::firstIObject();
   if ( aIO->hasEntry() )
   {
-       _PTR(Study) aStudy = HOMARD_UTILS::GetActiveStudyDocument();
+       _PTR(Study) aStudy = HOMARD_UTILS::getStudy();
        _PTR(SObject) aSO ( aStudy->FindObjectID( aIO->getEntry() ) );
         _PTR(SObject) aSObjCas = aSO->GetFather();
        _PTR(GenericAttribute) anAttr;
@@ -179,7 +179,7 @@ QString HOMARD_QT_COMMUN::PushNomFichier(bool avertir, QString TypeFichier)
     Handle(SALOME_InteractiveObject) aIO = HOMARD_UTILS::firstIObject();
     if ( aIO->hasEntry() )
     {
-      _PTR(Study) aStudy = HOMARD_UTILS::GetActiveStudyDocument();
+      _PTR(Study) aStudy = HOMARD_UTILS::getStudy();
       _PTR(SObject) aSO ( aStudy->FindObjectID( aIO->getEntry() ) );
       _PTR(GenericAttribute) anAttr;
       _PTR(AttributeFileType) aFileType;
index d6aecdaf6a63dc260b4f305a9db4d772974a749e..569efea16ec2115a6d4f4b043c47b58960b6da0d 100644 (file)
@@ -48,6 +48,7 @@ SET(_link_LIBRARIES
   ${KERNEL_TOOLSDS}
   ${KERNEL_SalomeGenericObj}
   ${SMESH_SalomeIDLSMESH}
+  ${SMESH_SMESHEngine}
   SalomeIDLHOMARD
   HOMARDImpl
 )
index 5b5dacc239749b5579ce41f3835b8464be2de4ba..915463dfbb6380834bb5c4d0e9ed4e22ac2201e6 100644 (file)
 #include "HOMARD_version.h"
 
 #include "utilities.h"
+#include "Basics_Utils.hxx"
 #include "Utils_SINGLETON.hxx"
 #include "Utils_CorbaException.hxx"
 #include "SALOMEDS_Tool.hxx"
 #include "SALOME_LifeCycleCORBA.hxx"
 #include "SALOMEconfig.h"
+#include <SMESH_Gen_i.hxx>
 #include CORBA_CLIENT_HEADER(SALOME_ModuleCatalog)
 #include CORBA_CLIENT_HEADER(SMESH_Gen)
 
@@ -99,6 +101,8 @@ Engines_Component_i(orb, poa, contId, instanceName, interfaceName)
   ASSERT(SINGLETON_<SALOME_NamingService>::IsAlreadyExisting());
   _NS->init_orb(_orb);
 
+  myStudy = SALOMEDS::Study::_duplicate( SMESH_Gen_i::getStudyServant() );
+
   _tag_gene = 0 ;
   _tag_boun = 0 ;
   _tag_hypo = 0 ;
@@ -117,24 +121,23 @@ HOMARD_Gen_i::~HOMARD_Gen_i()
 }
 //=============================================================================
 //=============================================================================
-// Utilitaires pour l'étude
+// Utilitaires pour l'??tude
 //=============================================================================
 //=============================================================================
-void HOMARD_Gen_i::addInStudy(SALOMEDS::Study_ptr theStudy)
+void HOMARD_Gen_i::UpdateStudy()
 {
-  ASSERT(!CORBA::is_nil(theStudy));
-  MESSAGE("addInStudy: ajout eventuel du composant HOMARD dans current study ID = " << GetCurrentStudyID()) ;
-  SALOMEDS::StudyBuilder_var myBuilder = theStudy->NewBuilder();
+  ASSERT(!CORBA::is_nil(myStudy));
+  SALOMEDS::StudyBuilder_var myBuilder = myStudy->NewBuilder();
 
   // Create SComponent labelled 'homard' if it doesn't already exit
-  SALOMEDS::SComponent_var homardFather = theStudy->FindComponent(ComponentDataType());
+  SALOMEDS::SComponent_var homardFather = myStudy->FindComponent(ComponentDataType());
   if (CORBA::is_nil(homardFather))
   {
     myBuilder->NewCommand();
     MESSAGE("Add Component HOMARD");
 
-    bool aLocked = theStudy->GetProperties()->IsLocked();
-    if (aLocked) theStudy->GetProperties()->SetLocked(false);
+    bool aLocked = myStudy->GetProperties()->IsLocked();
+    if (aLocked) myStudy->GetProperties()->SetLocked(false);
 
     homardFather = myBuilder->NewComponent(ComponentDataType());
     SALOMEDS::GenericAttribute_var anAttr = myBuilder->FindOrCreateAttribute(homardFather,"AttributeName");
@@ -153,32 +156,10 @@ void HOMARD_Gen_i::addInStudy(SALOMEDS::Study_ptr theStudy)
     aPixmap->SetPixMap("HOMARD_2.png");
     myBuilder->DefineComponentInstance(homardFather, HOMARD_Gen::_this());
 
-    if (aLocked) theStudy->GetProperties()->SetLocked(true);
+    if (aLocked) myStudy->GetProperties()->SetLocked(true);
     myBuilder->CommitCommand();
   }
 }
-//=============================================================================
-void HOMARD_Gen_i::SetCurrentStudy(SALOMEDS::Study_ptr theStudy)
-{
-  MESSAGE("SetCurrentStudy: current study Id = " << GetCurrentStudyID());
-  myCurrentStudy = SALOMEDS::Study::_duplicate(theStudy);
-  this->addInStudy(myCurrentStudy);
-}
-//=============================================================================
-SALOMEDS::Study_ptr HOMARD_Gen_i::GetCurrentStudy()
-//=============================================================================
-{
-  MESSAGE("GetCurrentStudy: study Id = " << GetCurrentStudyID());
-  return SALOMEDS::Study::_duplicate(myCurrentStudy);
-}
-//=============================================================================
-CORBA::Long HOMARD_Gen_i::GetCurrentStudyID()
-//=============================================================================
-{
-  return myCurrentStudy->_is_nil() ? -1 : myCurrentStudy->StudyId();
-}
-//=============================================================================
-//=============================================================================
 
 //=============================================================================
 //=============================================================================
@@ -189,7 +170,7 @@ void HOMARD_Gen_i::SetEtatIter(const char* nomIter, const CORBA::Long Etat)
 //=====================================================================================
 {
   MESSAGE( "SetEtatIter : affectation de l'etat " << Etat << " a l'iteration " << nomIter );
-  HOMARD::HOMARD_Iteration_var myIteration = myContextMap[GetCurrentStudyID()]._mesIterations[nomIter];
+  HOMARD::HOMARD_Iteration_var myIteration = myStudyContext._mesIterations[nomIter];
   if (CORBA::is_nil(myIteration))
   {
       SALOME::ExceptionStruct es;
@@ -201,8 +182,8 @@ void HOMARD_Gen_i::SetEtatIter(const char* nomIter, const CORBA::Long Etat)
 
   myIteration->SetState(Etat);
 
-  SALOMEDS::StudyBuilder_var aStudyBuilder = myCurrentStudy->NewBuilder();
-  SALOMEDS::SObject_var aIterSO = SALOMEDS::SObject::_narrow(myCurrentStudy->FindObjectIOR(_orb->object_to_string(myIteration)));
+  SALOMEDS::StudyBuilder_var aStudyBuilder = myStudy->NewBuilder();
+  SALOMEDS::SObject_var aIterSO = SALOMEDS::SObject::_narrow(myStudy->FindObjectIOR(_orb->object_to_string(myIteration)));
 
   std::string icone ;
   if ( Etat <= 0 )
@@ -227,7 +208,7 @@ void HOMARD_Gen_i::SetEtatIter(const char* nomIter, const CORBA::Long Etat)
 CORBA::Long HOMARD_Gen_i::DeleteBoundary(const char* BoundaryName)
 {
   MESSAGE ( "DeleteBoundary : BoundaryName = " << BoundaryName );
-  HOMARD::HOMARD_Boundary_var myBoundary = myContextMap[GetCurrentStudyID()]._mesBoundarys[BoundaryName];
+  HOMARD::HOMARD_Boundary_var myBoundary = myStudyContext._mesBoundarys[BoundaryName];
   if (CORBA::is_nil(myBoundary))
   {
     SALOME::ExceptionStruct es;
@@ -249,7 +230,7 @@ CORBA::Long HOMARD_Gen_i::DeleteBoundary(const char* BoundaryName)
   {
     CaseName = std::string((*maListe)[NumeCas]);
     MESSAGE ( "... Examen du cas = " << CaseName.c_str() );
-    myCase = myContextMap[GetCurrentStudyID()]._mesCas[CaseName];
+    myCase = myStudyContext._mesCas[CaseName];
     ASSERT(!CORBA::is_nil(myCase));
     ListBoundaryGroupType = myCase->GetBoundaryGroup();
     numberOfitems = ListBoundaryGroupType->length();
@@ -268,11 +249,11 @@ CORBA::Long HOMARD_Gen_i::DeleteBoundary(const char* BoundaryName)
   }
 
   // comme on a un _var comme pointeur CORBA, on ne se preoccupe pas du delete
-  myContextMap[GetCurrentStudyID()]._mesBoundarys.erase(BoundaryName);
-  SALOMEDS::Study::ListOfSObject_var listSO = myCurrentStudy->FindObjectByName(BoundaryName, ComponentDataType());
+  myStudyContext._mesBoundarys.erase(BoundaryName);
+  SALOMEDS::Study::ListOfSObject_var listSO = myStudy->FindObjectByName(BoundaryName, ComponentDataType());
   SALOMEDS::SObject_var aSO =listSO[0];
-  SALOMEDS::StudyBuilder_var aStudyBuilder = myCurrentStudy->NewBuilder();
-  myCurrentStudy->NewBuilder()->RemoveObjectWithChildren(aSO);
+  SALOMEDS::StudyBuilder_var aStudyBuilder = myStudy->NewBuilder();
+  myStudy->NewBuilder()->RemoveObjectWithChildren(aSO);
 
   return 0 ;
 }
@@ -281,7 +262,7 @@ CORBA::Long HOMARD_Gen_i::DeleteCase(const char* nomCas, CORBA::Long Option)
 {
   // Pour detruire un cas
   MESSAGE ( "DeleteCase : nomCas = " << nomCas << ", avec option = " << Option );
-  HOMARD::HOMARD_Cas_var myCase = myContextMap[GetCurrentStudyID()]._mesCas[nomCas];
+  HOMARD::HOMARD_Cas_var myCase = myStudyContext._mesCas[nomCas];
   if (CORBA::is_nil(myCase))
   {
     SALOME::ExceptionStruct es;
@@ -299,11 +280,11 @@ CORBA::Long HOMARD_Gen_i::DeleteCase(const char* nomCas, CORBA::Long Option)
   };
 
   // comme on a un _var comme pointeur CORBA, on ne se preoccupe pas du delete
-  myContextMap[GetCurrentStudyID()]._mesCas.erase(nomCas);
-  SALOMEDS::Study::ListOfSObject_var listSO = myCurrentStudy->FindObjectByName(nomCas, ComponentDataType());
+  myStudyContext._mesCas.erase(nomCas);
+  SALOMEDS::Study::ListOfSObject_var listSO = myStudy->FindObjectByName(nomCas, ComponentDataType());
   SALOMEDS::SObject_var aSO =listSO[0];
-  SALOMEDS::StudyBuilder_var aStudyBuilder = myCurrentStudy->NewBuilder();
-  myCurrentStudy->NewBuilder()->RemoveObjectWithChildren(aSO);
+  SALOMEDS::StudyBuilder_var aStudyBuilder = myStudy->NewBuilder();
+  myStudy->NewBuilder()->RemoveObjectWithChildren(aSO);
 
   return 0 ;
 }
@@ -311,7 +292,7 @@ CORBA::Long HOMARD_Gen_i::DeleteCase(const char* nomCas, CORBA::Long Option)
 CORBA::Long HOMARD_Gen_i::DeleteHypo(const char* nomHypo)
 {
   MESSAGE ( "DeleteHypo : nomHypo = " << nomHypo );
-  HOMARD::HOMARD_Hypothesis_var myHypo = myContextMap[GetCurrentStudyID()]._mesHypotheses[nomHypo];
+  HOMARD::HOMARD_Hypothesis_var myHypo = myStudyContext._mesHypotheses[nomHypo];
   if (CORBA::is_nil(myHypo))
   {
     SALOME::ExceptionStruct es;
@@ -346,11 +327,11 @@ CORBA::Long HOMARD_Gen_i::DeleteHypo(const char* nomHypo)
   }
 
   // comme on a un _var comme pointeur CORBA, on ne se preoccupe pas du delete
-  myContextMap[GetCurrentStudyID()]._mesHypotheses.erase(nomHypo);
-  SALOMEDS::Study::ListOfSObject_var listSO = myCurrentStudy->FindObjectByName(nomHypo, ComponentDataType());
+  myStudyContext._mesHypotheses.erase(nomHypo);
+  SALOMEDS::Study::ListOfSObject_var listSO = myStudy->FindObjectByName(nomHypo, ComponentDataType());
   SALOMEDS::SObject_var aSO =listSO[0];
-  SALOMEDS::StudyBuilder_var aStudyBuilder = myCurrentStudy->NewBuilder();
-  myCurrentStudy->NewBuilder()->RemoveObjectWithChildren(aSO);
+  SALOMEDS::StudyBuilder_var aStudyBuilder = myStudy->NewBuilder();
+  myStudy->NewBuilder()->RemoveObjectWithChildren(aSO);
 
   return 0 ;
 }
@@ -373,7 +354,7 @@ CORBA::Long HOMARD_Gen_i::DeleteIterationOption(const char* nomIter, CORBA::Long
   //  Option2 = 0 : On ne supprime pas le fichier du maillage associe
   //  Option2 = 1 : On supprime le fichier du maillage associe
   MESSAGE ( "DeleteIterationOption : nomIter = " << nomIter << ", avec options = " << Option1<< ", " << Option2 );
-  HOMARD::HOMARD_Iteration_var myIteration = myContextMap[GetCurrentStudyID()]._mesIterations[nomIter];
+  HOMARD::HOMARD_Iteration_var myIteration = myStudyContext._mesIterations[nomIter];
   if (CORBA::is_nil(myIteration))
   {
     SALOME::ExceptionStruct es;
@@ -418,7 +399,7 @@ CORBA::Long HOMARD_Gen_i::DeleteIterationOption(const char* nomIter, CORBA::Long
   {
     std::string nomIterationParent = myIteration->GetIterParentName();
     MESSAGE ( "Retrait dans la descendance de nomIterationParent " << nomIterationParent );
-    HOMARD::HOMARD_Iteration_var myIterationParent = myContextMap[GetCurrentStudyID()]._mesIterations[nomIterationParent];
+    HOMARD::HOMARD_Iteration_var myIterationParent = myStudyContext._mesIterations[nomIterationParent];
     if (CORBA::is_nil(myIterationParent))
     {
       SALOME::ExceptionStruct es;
@@ -434,17 +415,17 @@ CORBA::Long HOMARD_Gen_i::DeleteIterationOption(const char* nomIter, CORBA::Long
   if ( numero > 0 )
   {
     std::string nomHypo = myIteration->GetHypoName();
-    HOMARD::HOMARD_Hypothesis_var myHypo = myContextMap[GetCurrentStudyID()]._mesHypotheses[nomHypo];
+    HOMARD::HOMARD_Hypothesis_var myHypo = myStudyContext._mesHypotheses[nomHypo];
     ASSERT(!CORBA::is_nil(myHypo));
     myHypo->UnLinkIteration(nomIter);
   }
 
   // comme on a un _var comme pointeur CORBA, on ne se preoccupe pas du delete
-  myContextMap[GetCurrentStudyID()]._mesIterations.erase(nomIter);
-  SALOMEDS::Study::ListOfSObject_var listSO = myCurrentStudy->FindObjectByName(nomIter, ComponentDataType());
+  myStudyContext._mesIterations.erase(nomIter);
+  SALOMEDS::Study::ListOfSObject_var listSO = myStudy->FindObjectByName(nomIter, ComponentDataType());
   SALOMEDS::SObject_var aSO =listSO[0];
-  SALOMEDS::StudyBuilder_var aStudyBuilder = myCurrentStudy->NewBuilder();
-  myCurrentStudy->NewBuilder()->RemoveObjectWithChildren(aSO);
+  SALOMEDS::StudyBuilder_var aStudyBuilder = myStudy->NewBuilder();
+  myStudy->NewBuilder()->RemoveObjectWithChildren(aSO);
   // on peut aussi faire RemoveObject
 //   MESSAGE ( "Au final" );
 //   HOMARD::listeIterations* Liste = GetAllIterationsName() ;
@@ -463,7 +444,7 @@ CORBA::Long HOMARD_Gen_i::DeleteYACS(const char* nomYACS, CORBA::Long Option)
   //  Option = 0 : On ne supprime pas le fichier du schema associe
   //  Option = 1 : On supprime le fichier du schema associe
   MESSAGE ( "DeleteYACS : nomYACS = " << nomYACS << ", avec option = " << Option );
-  HOMARD::HOMARD_YACS_var myYACS = myContextMap[GetCurrentStudyID()]._mesYACSs[nomYACS];
+  HOMARD::HOMARD_YACS_var myYACS = myStudyContext._mesYACSs[nomYACS];
   if (CORBA::is_nil(myYACS))
   {
     SALOME::ExceptionStruct es;
@@ -488,11 +469,11 @@ CORBA::Long HOMARD_Gen_i::DeleteYACS(const char* nomYACS, CORBA::Long Option)
     }
   }
   // comme on a un _var comme pointeur CORBA, on ne se preoccupe pas du delete
-  myContextMap[GetCurrentStudyID()]._mesYACSs.erase(nomYACS);
-  SALOMEDS::Study::ListOfSObject_var listSO = myCurrentStudy->FindObjectByName(nomYACS, ComponentDataType());
+  myStudyContext._mesYACSs.erase(nomYACS);
+  SALOMEDS::Study::ListOfSObject_var listSO = myStudy->FindObjectByName(nomYACS, ComponentDataType());
   SALOMEDS::SObject_var aSO =listSO[0];
-  SALOMEDS::StudyBuilder_var aStudyBuilder = myCurrentStudy->NewBuilder();
-  myCurrentStudy->NewBuilder()->RemoveObjectWithChildren(aSO);
+  SALOMEDS::StudyBuilder_var aStudyBuilder = myStudy->NewBuilder();
+  myStudy->NewBuilder()->RemoveObjectWithChildren(aSO);
 
   return 0 ;
 }
@@ -500,7 +481,7 @@ CORBA::Long HOMARD_Gen_i::DeleteYACS(const char* nomYACS, CORBA::Long Option)
 CORBA::Long HOMARD_Gen_i::DeleteZone(const char* nomZone)
 {
   MESSAGE ( "DeleteZone : nomZone = " << nomZone );
-  HOMARD::HOMARD_Zone_var myZone = myContextMap[GetCurrentStudyID()]._mesZones[nomZone];
+  HOMARD::HOMARD_Zone_var myZone = myStudyContext._mesZones[nomZone];
   if (CORBA::is_nil(myZone))
   {
     SALOME::ExceptionStruct es;
@@ -524,11 +505,11 @@ CORBA::Long HOMARD_Gen_i::DeleteZone(const char* nomZone)
   };
 //
   // comme on a un _var comme pointeur CORBA, on ne se preoccupe pas du delete
-  myContextMap[GetCurrentStudyID()]._mesZones.erase(nomZone);
-  SALOMEDS::Study::ListOfSObject_var listSO = myCurrentStudy->FindObjectByName(nomZone, ComponentDataType());
+  myStudyContext._mesZones.erase(nomZone);
+  SALOMEDS::Study::ListOfSObject_var listSO = myStudy->FindObjectByName(nomZone, ComponentDataType());
   SALOMEDS::SObject_var aSO =listSO[0];
-  SALOMEDS::StudyBuilder_var aStudyBuilder = myCurrentStudy->NewBuilder();
-  myCurrentStudy->NewBuilder()->RemoveObjectWithChildren(aSO);
+  SALOMEDS::StudyBuilder_var aStudyBuilder = myStudy->NewBuilder();
+  myStudy->NewBuilder()->RemoveObjectWithChildren(aSO);
 
   return 0 ;
 }
@@ -543,7 +524,7 @@ CORBA::Long HOMARD_Gen_i::DeleteZone(const char* nomZone)
 void HOMARD_Gen_i::InvalideBoundary(const char* BoundaryName)
 {
   MESSAGE( "InvalideBoundary : BoundaryName = " << BoundaryName  );
-  HOMARD::HOMARD_Boundary_var myBoundary = myContextMap[GetCurrentStudyID()]._mesBoundarys[BoundaryName];
+  HOMARD::HOMARD_Boundary_var myBoundary = myStudyContext._mesBoundarys[BoundaryName];
   if (CORBA::is_nil(myBoundary))
   {
     SALOME::ExceptionStruct es;
@@ -565,7 +546,7 @@ void HOMARD_Gen_i::InvalideBoundary(const char* BoundaryName)
 void HOMARD_Gen_i::InvalideHypo(const char* nomHypo)
 {
   MESSAGE( "InvalideHypo : nomHypo    = " << nomHypo  );
-  HOMARD::HOMARD_Hypothesis_var myHypo = myContextMap[GetCurrentStudyID()]._mesHypotheses[nomHypo];
+  HOMARD::HOMARD_Hypothesis_var myHypo = myStudyContext._mesHypotheses[nomHypo];
   if (CORBA::is_nil(myHypo))
   {
       SALOME::ExceptionStruct es;
@@ -598,7 +579,7 @@ void HOMARD_Gen_i::InvalideIterOption(const char* nomIter, CORBA::Long Option)
   //  Option = 0 : On ne supprime pas le fichier du maillage associe
   //  Option = 1 : On supprime le fichier du maillage associe
   MESSAGE ( "InvalideIterOption : nomIter = " << nomIter << ", avec option = " << Option );
-  HOMARD::HOMARD_Iteration_var myIteration = myContextMap[GetCurrentStudyID()]._mesIterations[nomIter];
+  HOMARD::HOMARD_Iteration_var myIteration = myStudyContext._mesIterations[nomIter];
   if (CORBA::is_nil(myIteration))
   {
       SALOME::ExceptionStruct es;
@@ -619,8 +600,8 @@ void HOMARD_Gen_i::InvalideIterOption(const char* nomIter, CORBA::Long Option)
 
   // On arrive ici pour une iteration sans fille
   MESSAGE ( "Invalidation effective de " << nomIter );
-  SALOMEDS::SObject_var aIterSO = SALOMEDS::SObject::_narrow(myCurrentStudy->FindObjectIOR(_orb->object_to_string(myIteration)));
-  SALOMEDS::ChildIterator_var  aIter = myCurrentStudy->NewChildIterator(aIterSO);
+  SALOMEDS::SObject_var aIterSO = SALOMEDS::SObject::_narrow(myStudy->FindObjectIOR(_orb->object_to_string(myIteration)));
+  SALOMEDS::ChildIterator_var  aIter = myStudy->NewChildIterator(aIterSO);
   for (; aIter->More(); aIter->Next())
   {
       SALOMEDS::SObject_var so = aIter->Value();
@@ -630,7 +611,7 @@ void HOMARD_Gen_i::InvalideIterOption(const char* nomIter, CORBA::Long Option)
       std::string value (aCommentAttr->Value());
       if(value == std::string("IterationHomard")) continue;
       if(value == std::string("HypoHomard")) continue;
-      SALOMEDS::StudyBuilder_var aStudyBuilder = myCurrentStudy->NewBuilder();
+      SALOMEDS::StudyBuilder_var aStudyBuilder = myStudy->NewBuilder();
       aStudyBuilder->RemoveObject(so);
   }
 
@@ -639,7 +620,7 @@ void HOMARD_Gen_i::InvalideIterOption(const char* nomIter, CORBA::Long Option)
   {
     SetEtatIter(nomIter,1);
     const char * nomCas = myIteration->GetCaseName();
-    HOMARD::HOMARD_Cas_var myCase = myContextMap[GetCurrentStudyID()]._mesCas[nomCas];
+    HOMARD::HOMARD_Cas_var myCase = myStudyContext._mesCas[nomCas];
     if (CORBA::is_nil(myCase))
     {
         SALOME::ExceptionStruct es;
@@ -671,7 +652,7 @@ void HOMARD_Gen_i::InvalideIterOption(const char* nomIter, CORBA::Long Option)
 void HOMARD_Gen_i::InvalideIterInfo(const char* nomIter)
 {
   MESSAGE("InvalideIterInfo : nomIter = " << nomIter);
-  HOMARD::HOMARD_Iteration_var myIteration = myContextMap[GetCurrentStudyID()]._mesIterations[nomIter];
+  HOMARD::HOMARD_Iteration_var myIteration = myStudyContext._mesIterations[nomIter];
   if (CORBA::is_nil(myIteration))
   {
       SALOME::ExceptionStruct es;
@@ -681,8 +662,8 @@ void HOMARD_Gen_i::InvalideIterInfo(const char* nomIter)
       return ;
   };
 
-  SALOMEDS::SObject_var aIterSO = SALOMEDS::SObject::_narrow(myCurrentStudy->FindObjectIOR(_orb->object_to_string(myIteration)));
-  SALOMEDS::ChildIterator_var  aIter = myCurrentStudy->NewChildIterator(aIterSO);
+  SALOMEDS::SObject_var aIterSO = SALOMEDS::SObject::_narrow(myStudy->FindObjectIOR(_orb->object_to_string(myIteration)));
+  SALOMEDS::ChildIterator_var  aIter = myStudy->NewChildIterator(aIterSO);
   for (; aIter->More(); aIter->Next())
   {
       SALOMEDS::SObject_var so = aIter->Value();
@@ -693,13 +674,13 @@ void HOMARD_Gen_i::InvalideIterInfo(const char* nomIter)
 /*      MESSAGE("... value = " << value);*/
       if( (value == std::string("logInfo")) || ( value == std::string("SummaryInfo")) )
       {
-        SALOMEDS::StudyBuilder_var aStudyBuilder = myCurrentStudy->NewBuilder();
+        SALOMEDS::StudyBuilder_var aStudyBuilder = myStudy->NewBuilder();
         aStudyBuilder->RemoveObject(so);
       }
   }
 
   const char * nomCas = myIteration->GetCaseName();
-  HOMARD::HOMARD_Cas_var myCase = myContextMap[GetCurrentStudyID()]._mesCas[nomCas];
+  HOMARD::HOMARD_Cas_var myCase = myStudyContext._mesCas[nomCas];
   if (CORBA::is_nil(myCase))
   {
       SALOME::ExceptionStruct es;
@@ -725,7 +706,7 @@ void HOMARD_Gen_i::InvalideIterInfo(const char* nomIter)
 void HOMARD_Gen_i::InvalideYACS(const char* YACSName)
 {
   MESSAGE( "InvalideYACS : YACSName    = " << YACSName );
-  HOMARD::HOMARD_YACS_var myYACS = myContextMap[GetCurrentStudyID()]._mesYACSs[YACSName];
+  HOMARD::HOMARD_YACS_var myYACS = myStudyContext._mesYACSs[YACSName];
   if (CORBA::is_nil(myYACS))
   {
       SALOME::ExceptionStruct es;
@@ -735,8 +716,8 @@ void HOMARD_Gen_i::InvalideYACS(const char* YACSName)
       return ;
   };
   //
-  SALOMEDS::SObject_var aYACSSO = SALOMEDS::SObject::_narrow(myCurrentStudy->FindObjectIOR(_orb->object_to_string(myYACS)));
-  SALOMEDS::ChildIterator_var  aYACS = myCurrentStudy->NewChildIterator(aYACSSO);
+  SALOMEDS::SObject_var aYACSSO = SALOMEDS::SObject::_narrow(myStudy->FindObjectIOR(_orb->object_to_string(myYACS)));
+  SALOMEDS::ChildIterator_var  aYACS = myStudy->NewChildIterator(aYACSSO);
   for (; aYACS->More(); aYACS->Next())
   {
     SALOMEDS::SObject_var so = aYACS->Value();
@@ -746,7 +727,7 @@ void HOMARD_Gen_i::InvalideYACS(const char* YACSName)
     std::string value (aCommentAttr->Value());
     if( value == std::string("xml") )
     {
-      SALOMEDS::StudyBuilder_var aStudyBuilder = myCurrentStudy->NewBuilder();
+      SALOMEDS::StudyBuilder_var aStudyBuilder = myStudy->NewBuilder();
       aStudyBuilder->RemoveObject(so);
     }
   }
@@ -766,7 +747,7 @@ void HOMARD_Gen_i::InvalideYACS(const char* YACSName)
 void HOMARD_Gen_i::InvalideZone(const char* ZoneName)
 {
   MESSAGE( "InvalideZone : ZoneName    = " << ZoneName );
-  HOMARD::HOMARD_Zone_var myZone = myContextMap[GetCurrentStudyID()]._mesZones[ZoneName];
+  HOMARD::HOMARD_Zone_var myZone = myStudyContext._mesZones[ZoneName];
   if (CORBA::is_nil(myZone))
   {
       SALOME::ExceptionStruct es;
@@ -797,7 +778,7 @@ void HOMARD_Gen_i::AssociateCaseIter(const char* nomCas, const char* nomIter, co
 {
   MESSAGE( "AssociateCaseIter : " << nomCas << ", " << nomIter << ", "  << labelIter );
 
-  HOMARD::HOMARD_Cas_var myCase = myContextMap[GetCurrentStudyID()]._mesCas[nomCas];
+  HOMARD::HOMARD_Cas_var myCase = myStudyContext._mesCas[nomCas];
   if (CORBA::is_nil(myCase))
   {
     SALOME::ExceptionStruct es;
@@ -807,7 +788,7 @@ void HOMARD_Gen_i::AssociateCaseIter(const char* nomCas, const char* nomIter, co
     return ;
   };
 
-  HOMARD::HOMARD_Iteration_var myIteration = myContextMap[GetCurrentStudyID()]._mesIterations[nomIter];
+  HOMARD::HOMARD_Iteration_var myIteration = myStudyContext._mesIterations[nomIter];
   if (CORBA::is_nil(myIteration))
   {
     SALOME::ExceptionStruct es;
@@ -817,8 +798,8 @@ void HOMARD_Gen_i::AssociateCaseIter(const char* nomCas, const char* nomIter, co
     return ;
   };
 
-  SALOMEDS::StudyBuilder_var aStudyBuilder = myCurrentStudy->NewBuilder();
-  SALOMEDS::SObject_var aCasSO = SALOMEDS::SObject::_narrow(myCurrentStudy->FindObjectIOR(_orb->object_to_string(myCase)));
+  SALOMEDS::StudyBuilder_var aStudyBuilder = myStudy->NewBuilder();
+  SALOMEDS::SObject_var aCasSO = SALOMEDS::SObject::_narrow(myStudy->FindObjectIOR(_orb->object_to_string(myCase)));
   if (CORBA::is_nil(aCasSO))
   {
     SALOME::ExceptionStruct es;
@@ -842,17 +823,17 @@ void HOMARD_Gen_i::AssociateHypoZone(const char* nomHypothesis, const char* Zone
 {
   MESSAGE ( "AssociateHypoZone : nomHypo = " << nomHypothesis << ", ZoneName= " << ZoneName << ", TypeUse = " << TypeUse);
 
-  HOMARD::HOMARD_Hypothesis_var myHypo = myContextMap[GetCurrentStudyID()]._mesHypotheses[nomHypothesis];
+  HOMARD::HOMARD_Hypothesis_var myHypo = myStudyContext._mesHypotheses[nomHypothesis];
   ASSERT(!CORBA::is_nil(myHypo));
-  SALOMEDS::SObject_var aHypoSO = SALOMEDS::SObject::_narrow(myCurrentStudy->FindObjectIOR(_orb->object_to_string(myHypo)));
+  SALOMEDS::SObject_var aHypoSO = SALOMEDS::SObject::_narrow(myStudy->FindObjectIOR(_orb->object_to_string(myHypo)));
   ASSERT(!CORBA::is_nil(aHypoSO));
 
-  HOMARD::HOMARD_Zone_var myZone = myContextMap[GetCurrentStudyID()]._mesZones[ZoneName];
+  HOMARD::HOMARD_Zone_var myZone = myStudyContext._mesZones[ZoneName];
   ASSERT(!CORBA::is_nil(myZone));
-  SALOMEDS::SObject_var aZoneSO = SALOMEDS::SObject::_narrow(myCurrentStudy->FindObjectIOR(_orb->object_to_string(myZone)));
+  SALOMEDS::SObject_var aZoneSO = SALOMEDS::SObject::_narrow(myStudy->FindObjectIOR(_orb->object_to_string(myZone)));
   ASSERT(!CORBA::is_nil(aZoneSO));
 
-  SALOMEDS::StudyBuilder_var aStudyBuilder = myCurrentStudy->NewBuilder();
+  SALOMEDS::StudyBuilder_var aStudyBuilder = myStudy->NewBuilder();
 
   aStudyBuilder->NewCommand();
 
@@ -870,19 +851,19 @@ void HOMARD_Gen_i::AssociateIterHypo(const char* nomIter, const char* nomHypo)
   MESSAGE("AssociateIterHypo : nomHypo = " << nomHypo << " nomIter = " << nomIter);
 
   // Verification de l'existence de l'hypothese
-  HOMARD::HOMARD_Hypothesis_var myHypo = myContextMap[GetCurrentStudyID()]._mesHypotheses[nomHypo];
+  HOMARD::HOMARD_Hypothesis_var myHypo = myStudyContext._mesHypotheses[nomHypo];
   ASSERT(!CORBA::is_nil(myHypo));
-  SALOMEDS::SObject_var aHypoSO = SALOMEDS::SObject::_narrow(myCurrentStudy->FindObjectIOR(_orb->object_to_string(myHypo)));
+  SALOMEDS::SObject_var aHypoSO = SALOMEDS::SObject::_narrow(myStudy->FindObjectIOR(_orb->object_to_string(myHypo)));
   ASSERT(!CORBA::is_nil(aHypoSO));
 
   // Verification de l'existence de l'iteration
-  HOMARD::HOMARD_Iteration_var myIteration = myContextMap[GetCurrentStudyID()]._mesIterations[nomIter];
+  HOMARD::HOMARD_Iteration_var myIteration = myStudyContext._mesIterations[nomIter];
   ASSERT(!CORBA::is_nil(myIteration));
-  SALOMEDS::SObject_var aIterSO = SALOMEDS::SObject::_narrow(myCurrentStudy->FindObjectIOR(_orb->object_to_string(myIteration)));
+  SALOMEDS::SObject_var aIterSO = SALOMEDS::SObject::_narrow(myStudy->FindObjectIOR(_orb->object_to_string(myIteration)));
   ASSERT(!CORBA::is_nil(aIterSO));
 
   // Gestion de l'arbre d'etudes
-  SALOMEDS::StudyBuilder_var aStudyBuilder = myCurrentStudy->NewBuilder();
+  SALOMEDS::StudyBuilder_var aStudyBuilder = myStudy->NewBuilder();
   aStudyBuilder->NewCommand();
   SALOMEDS::SObject_var aSubSO = aStudyBuilder->NewObject(aIterSO);
   aStudyBuilder->Addreference(aSubSO, aHypoSO);
@@ -915,19 +896,19 @@ void HOMARD_Gen_i::DissociateHypoZone(const char* nomHypothesis, const char* Zon
 {
   MESSAGE ( "DissociateHypoZone : ZoneName= " << ZoneName << ", nomHypo = " << nomHypothesis);
 
-  HOMARD::HOMARD_Hypothesis_var myHypo = myContextMap[GetCurrentStudyID()]._mesHypotheses[nomHypothesis];
+  HOMARD::HOMARD_Hypothesis_var myHypo = myStudyContext._mesHypotheses[nomHypothesis];
   ASSERT(!CORBA::is_nil(myHypo));
-  SALOMEDS::SObject_var aHypoSO = SALOMEDS::SObject::_narrow(myCurrentStudy->FindObjectIOR(_orb->object_to_string(myHypo)));
+  SALOMEDS::SObject_var aHypoSO = SALOMEDS::SObject::_narrow(myStudy->FindObjectIOR(_orb->object_to_string(myHypo)));
   ASSERT(!CORBA::is_nil(aHypoSO));
 
-  HOMARD::HOMARD_Zone_var myZone = myContextMap[GetCurrentStudyID()]._mesZones[ZoneName];
+  HOMARD::HOMARD_Zone_var myZone = myStudyContext._mesZones[ZoneName];
   ASSERT(!CORBA::is_nil(myZone));
-  SALOMEDS::SObject_var aZoneSO = SALOMEDS::SObject::_narrow(myCurrentStudy->FindObjectIOR(_orb->object_to_string(myZone)));
+  SALOMEDS::SObject_var aZoneSO = SALOMEDS::SObject::_narrow(myStudy->FindObjectIOR(_orb->object_to_string(myZone)));
   ASSERT(!CORBA::is_nil(aZoneSO));
 
-  SALOMEDS::StudyBuilder_var aStudyBuilder = myCurrentStudy->NewBuilder();
+  SALOMEDS::StudyBuilder_var aStudyBuilder = myStudy->NewBuilder();
 
-  SALOMEDS::ChildIterator_var it = myCurrentStudy->NewChildIterator(aHypoSO);
+  SALOMEDS::ChildIterator_var it = myStudy->NewChildIterator(aHypoSO);
   for (; it->More(); it->Next())
   {
     SALOMEDS::SObject_var aHypObj = it->Value();
@@ -962,11 +943,11 @@ HOMARD::listeBoundarys* HOMARD_Gen_i::GetAllBoundarysName()
   IsValidStudy () ;
 
   HOMARD::listeBoundarys_var ret = new HOMARD::listeBoundarys;
-  ret->length(myContextMap[GetCurrentStudyID()]._mesBoundarys.size());
+  ret->length(myStudyContext._mesBoundarys.size());
   std::map<std::string, HOMARD::HOMARD_Boundary_var>::const_iterator it;
   int i = 0;
-  for (it = myContextMap[GetCurrentStudyID()]._mesBoundarys.begin();
-  it != myContextMap[GetCurrentStudyID()]._mesBoundarys.end(); it++)
+  for (it = myStudyContext._mesBoundarys.begin();
+  it != myStudyContext._mesBoundarys.end(); it++)
   {
     ret[i++] = CORBA::string_dup((*it).first.c_str());
   }
@@ -980,11 +961,11 @@ HOMARD::listeCases* HOMARD_Gen_i::GetAllCasesName()
   IsValidStudy () ;
 
   HOMARD::listeCases_var ret = new HOMARD::listeCases;
-  ret->length(myContextMap[GetCurrentStudyID()]._mesCas.size());
+  ret->length(myStudyContext._mesCas.size());
   std::map<std::string, HOMARD::HOMARD_Cas_var>::const_iterator it;
   int i = 0;
-  for (it = myContextMap[GetCurrentStudyID()]._mesCas.begin();
-  it != myContextMap[GetCurrentStudyID()]._mesCas.end(); it++)
+  for (it = myStudyContext._mesCas.begin();
+  it != myStudyContext._mesCas.end(); it++)
   {
     ret[i++] = CORBA::string_dup((*it).first.c_str());
   }
@@ -998,11 +979,11 @@ HOMARD::listeHypotheses* HOMARD_Gen_i::GetAllHypothesesName()
   IsValidStudy () ;
 
   HOMARD::listeHypotheses_var ret = new HOMARD::listeHypotheses;
-  ret->length(myContextMap[GetCurrentStudyID()]._mesHypotheses.size());
+  ret->length(myStudyContext._mesHypotheses.size());
   std::map<std::string, HOMARD::HOMARD_Hypothesis_var>::const_iterator it;
   int i = 0;
-  for (it = myContextMap[GetCurrentStudyID()]._mesHypotheses.begin();
-  it != myContextMap[GetCurrentStudyID()]._mesHypotheses.end(); it++)
+  for (it = myStudyContext._mesHypotheses.begin();
+  it != myStudyContext._mesHypotheses.end(); it++)
   {
     ret[i++] = CORBA::string_dup((*it).first.c_str());
   }
@@ -1016,11 +997,11 @@ HOMARD::listeIterations* HOMARD_Gen_i::GetAllIterationsName()
   IsValidStudy () ;
 
   HOMARD::listeIterations_var ret = new HOMARD::listeIterations;
-  ret->length(myContextMap[GetCurrentStudyID()]._mesIterations.size());
+  ret->length(myStudyContext._mesIterations.size());
   std::map<std::string, HOMARD::HOMARD_Iteration_var>::const_iterator it;
   int i = 0;
-  for (it = myContextMap[GetCurrentStudyID()]._mesIterations.begin();
-  it != myContextMap[GetCurrentStudyID()]._mesIterations.end(); it++)
+  for (it = myStudyContext._mesIterations.begin();
+  it != myStudyContext._mesIterations.end(); it++)
   {
     ret[i++] = CORBA::string_dup((*it).first.c_str());
   }
@@ -1034,11 +1015,11 @@ HOMARD::listeYACSs* HOMARD_Gen_i::GetAllYACSsName()
   IsValidStudy () ;
 
   HOMARD::listeYACSs_var ret = new HOMARD::listeYACSs;
-  ret->length(myContextMap[GetCurrentStudyID()]._mesYACSs.size());
+  ret->length(myStudyContext._mesYACSs.size());
   std::map<std::string, HOMARD::HOMARD_YACS_var>::const_iterator it;
   int i = 0;
-  for (it = myContextMap[GetCurrentStudyID()]._mesYACSs.begin();
-  it != myContextMap[GetCurrentStudyID()]._mesYACSs.end(); it++)
+  for (it = myStudyContext._mesYACSs.begin();
+  it != myStudyContext._mesYACSs.end(); it++)
   {
     ret[i++] = CORBA::string_dup((*it).first.c_str());
   }
@@ -1052,11 +1033,11 @@ HOMARD::listeZones* HOMARD_Gen_i::GetAllZonesName()
   IsValidStudy () ;
 
   HOMARD::listeZones_var ret = new HOMARD::listeZones;
-  ret->length(myContextMap[GetCurrentStudyID()]._mesZones.size());
+  ret->length(myStudyContext._mesZones.size());
   std::map<std::string, HOMARD::HOMARD_Zone_var>::const_iterator it;
   int i = 0;
-  for (it = myContextMap[GetCurrentStudyID()]._mesZones.begin();
-  it != myContextMap[GetCurrentStudyID()]._mesZones.end(); it++)
+  for (it = myStudyContext._mesZones.begin();
+  it != myStudyContext._mesZones.end(); it++)
   {
     ret[i++] = CORBA::string_dup((*it).first.c_str());
   }
@@ -1073,42 +1054,42 @@ HOMARD::listeZones* HOMARD_Gen_i::GetAllZonesName()
 //=============================================================================
 HOMARD::HOMARD_Boundary_ptr HOMARD_Gen_i::GetBoundary(const char* nomBoundary)
 {
-  HOMARD::HOMARD_Boundary_var myBoundary = myContextMap[GetCurrentStudyID()]._mesBoundarys[nomBoundary];
+  HOMARD::HOMARD_Boundary_var myBoundary = myStudyContext._mesBoundarys[nomBoundary];
   ASSERT(!CORBA::is_nil(myBoundary));
   return HOMARD::HOMARD_Boundary::_duplicate(myBoundary);
 }
 //=============================================================================
 HOMARD::HOMARD_Cas_ptr HOMARD_Gen_i::GetCase(const char* nomCas)
 {
-  HOMARD::HOMARD_Cas_var myCase = myContextMap[GetCurrentStudyID()]._mesCas[nomCas];
+  HOMARD::HOMARD_Cas_var myCase = myStudyContext._mesCas[nomCas];
   ASSERT(!CORBA::is_nil(myCase));
   return HOMARD::HOMARD_Cas::_duplicate(myCase);
 }
 //=============================================================================
 HOMARD::HOMARD_Hypothesis_ptr HOMARD_Gen_i::GetHypothesis(const char* nomHypothesis)
 {
-  HOMARD::HOMARD_Hypothesis_var myHypothesis = myContextMap[GetCurrentStudyID()]._mesHypotheses[nomHypothesis];
+  HOMARD::HOMARD_Hypothesis_var myHypothesis = myStudyContext._mesHypotheses[nomHypothesis];
   ASSERT(!CORBA::is_nil(myHypothesis));
   return HOMARD::HOMARD_Hypothesis::_duplicate(myHypothesis);
 }
 //=============================================================================
 HOMARD::HOMARD_Iteration_ptr  HOMARD_Gen_i::GetIteration(const char* NomIterationation)
 {
-  HOMARD::HOMARD_Iteration_var myIteration = myContextMap[GetCurrentStudyID()]._mesIterations[NomIterationation];
+  HOMARD::HOMARD_Iteration_var myIteration = myStudyContext._mesIterations[NomIterationation];
   ASSERT(!CORBA::is_nil(myIteration));
   return HOMARD::HOMARD_Iteration::_duplicate(myIteration);
 }
 //=============================================================================
 HOMARD::HOMARD_YACS_ptr HOMARD_Gen_i::GetYACS(const char* nomYACS)
 {
-  HOMARD::HOMARD_YACS_var myYACS = myContextMap[GetCurrentStudyID()]._mesYACSs[nomYACS];
+  HOMARD::HOMARD_YACS_var myYACS = myStudyContext._mesYACSs[nomYACS];
   ASSERT(!CORBA::is_nil(myYACS));
   return HOMARD::HOMARD_YACS::_duplicate(myYACS);
 }
 //=============================================================================
 HOMARD::HOMARD_Zone_ptr HOMARD_Gen_i::GetZone(const char* ZoneName)
 {
-  HOMARD::HOMARD_Zone_var myZone = myContextMap[GetCurrentStudyID()]._mesZones[ZoneName];
+  HOMARD::HOMARD_Zone_var myZone = myStudyContext._mesZones[ZoneName];
   ASSERT(!CORBA::is_nil(myZone));
   return HOMARD::HOMARD_Zone::_duplicate(myZone);
 }
@@ -1146,7 +1127,7 @@ void HOMARD_Gen_i::MeshInfo(const char* nomCas, const char* MeshName, const char
 //=============================================================================
 HOMARD::HOMARD_Iteration_ptr HOMARD_Gen_i::LastIteration(const char* nomCas)
 {
-  HOMARD::HOMARD_Cas_var myCase = myContextMap[GetCurrentStudyID()]._mesCas[nomCas];
+  HOMARD::HOMARD_Cas_var myCase = myStudyContext._mesCas[nomCas];
   ASSERT(!CORBA::is_nil(myCase));
 //
   HOMARD::HOMARD_Iteration_var myIteration = myCase->LastIteration();
@@ -1323,13 +1304,13 @@ HOMARD::HOMARD_Cas_ptr HOMARD_Gen_i::CreateCaseFromIteration(const char* nomCas,
   char* MeshFile ;
   // le constructeur de ifstream permet d'ouvrir un fichier en lecture
   std::ifstream fichier( file_configuration.c_str() );
-  if ( fichier ) // ce test échoue si le fichier n'est pas ouvert
+  if ( fichier ) // ce test ??choue si le fichier n'est pas ouvert
   {
     std::string ligne; // variable contenant chaque ligne lue
     std::string mot_cle;
     std::string argument;
     int decalage;
-    // cette boucle sur les lignes s'arrête dès qu'une erreur de lecture survient
+    // cette boucle sur les lignes s'arr??te d??s qu'une erreur de lecture survient
     while ( std::getline( fichier, ligne ) )
     {
       // B.1. Pour la ligne courante, on identifie le premier mot : le mot-cle
@@ -1569,12 +1550,12 @@ std::string HOMARD_Gen_i::CreateCase1(const char* DirNameStart, CORBA::Long Numb
             CHDIR(DirName_1.c_str()) ;
 
             std::ifstream fichier( file_name_1.c_str() );
-            if ( fichier ) // ce test échoue si le fichier n'est pas ouvert
+            if ( fichier ) // ce test ??choue si le fichier n'est pas ouvert
             {
               int NumeIter ;
               std::string ligne; // variable contenant chaque ligne lue
               std::string mot_cle;
-              // cette boucle sur les lignes s'arrête dès qu'une erreur de lecture survient
+              // cette boucle sur les lignes s'arr??te d??s qu'une erreur de lecture survient
               while ( std::getline( fichier, ligne ) )
               {
                 // B.1. Pour la ligne courante, on identifie le premier mot : le mot-cle
@@ -1666,7 +1647,7 @@ HOMARD::HOMARD_Cas_ptr HOMARD_Gen_i::CreateCase0(const char* nomCas, const char*
   IsValidStudy () ;
 
   // A.2. Controle du nom :
-  if ((myContextMap[GetCurrentStudyID()]._mesCas).find(nomCas)!=(myContextMap[GetCurrentStudyID()]._mesCas).end())
+  if ((myStudyContext._mesCas).find(nomCas)!=(myStudyContext._mesCas).end())
   {
     SALOME::ExceptionStruct es;
     es.type = SALOME::BAD_PARAM;
@@ -1697,8 +1678,8 @@ HOMARD::HOMARD_Cas_ptr HOMARD_Gen_i::CreateCase0(const char* nomCas, const char*
   HOMARD::HOMARD_Cas_var myCase = newCase();
   myCase->SetName(nomCas);
   SALOMEDS::SObject_var aSO;
-  SALOMEDS::SObject_var aResultSO=PublishInStudy(myCurrentStudy, aSO, myCase, nomCas);
-  myContextMap[GetCurrentStudyID()]._mesCas[nomCas] = myCase;
+  SALOMEDS::SObject_var aResultSO=PublishInStudy(aSO, myCase, nomCas);
+  myStudyContext._mesCas[nomCas] = myCase;
 
   // C. Caracteristiques du maillage
   if ( existeMeshFile != 0 )
@@ -1730,7 +1711,7 @@ HOMARD::HOMARD_Cas_ptr HOMARD_Gen_i::CreateCase0(const char* nomCas, const char*
   // Si ce nom d'iteration existe deja, on incremente avec 0, 1, 2, etc.
   int monNum = 0;
   std::string NomIteration = std::string(MeshName) ;
-  while ( (myContextMap[GetCurrentStudyID()]._mesIterations).find(NomIteration) != (myContextMap[GetCurrentStudyID()]._mesIterations.end()) )
+  while ( (myStudyContext._mesIterations).find(NomIteration) != (myStudyContext._mesIterations.end()) )
   {
     std::ostringstream nom;
     nom << MeshName << monNum;
@@ -1741,7 +1722,7 @@ HOMARD::HOMARD_Cas_ptr HOMARD_Gen_i::CreateCase0(const char* nomCas, const char*
 
   // D.2. Creation de l'iteration
   HOMARD::HOMARD_Iteration_var anIter = newIteration();
-  myContextMap[GetCurrentStudyID()]._mesIterations[NomIteration] = anIter;
+  myStudyContext._mesIterations[NomIteration] = anIter;
   anIter->SetName(NomIteration.c_str());
   AssociateCaseIter (nomCas, NomIteration.c_str(), "IterationHomard");
 
@@ -1769,7 +1750,7 @@ HOMARD::HOMARD_Hypothesis_ptr HOMARD_Gen_i::CreateHypothesis(const char* nomHypo
   IsValidStudy () ;
 
   // A. Controle du nom :
-  if ((myContextMap[GetCurrentStudyID()]._mesHypotheses).find(nomHypothesis) != (myContextMap[GetCurrentStudyID()]._mesHypotheses).end())
+  if ((myStudyContext._mesHypotheses).find(nomHypothesis) != (myStudyContext._mesHypotheses).end())
   {
     SALOME::ExceptionStruct es;
     es.type = SALOME::BAD_PARAM;
@@ -1791,10 +1772,10 @@ HOMARD::HOMARD_Hypothesis_ptr HOMARD_Gen_i::CreateHypothesis(const char* nomHypo
   myHypothesis->SetName(nomHypothesis);
 
   // C. Enregistrement
-  myContextMap[GetCurrentStudyID()]._mesHypotheses[nomHypothesis] = myHypothesis;
+  myStudyContext._mesHypotheses[nomHypothesis] = myHypothesis;
 
   SALOMEDS::SObject_var aSO;
-  SALOMEDS::SObject_var aResultSO=PublishInStudy(myCurrentStudy, aSO, myHypothesis, nomHypothesis);
+  SALOMEDS::SObject_var aResultSO=PublishInStudy(aSO, myHypothesis, nomHypothesis);
 
   // D. Valeurs par defaut des options avancees
   myHypothesis->SetNivMax(-1);
@@ -1812,7 +1793,7 @@ HOMARD::HOMARD_Iteration_ptr HOMARD_Gen_i::CreateIteration(const char* NomIterat
   INFOS ("CreateIteration : NomIteration  = " << NomIteration << ", nomIterParent = " << nomIterParent);
   IsValidStudy () ;
 
-  HOMARD::HOMARD_Iteration_var myIterationParent = myContextMap[GetCurrentStudyID()]._mesIterations[nomIterParent];
+  HOMARD::HOMARD_Iteration_var myIterationParent = myStudyContext._mesIterations[nomIterParent];
   if (CORBA::is_nil(myIterationParent))
   {
     SALOME::ExceptionStruct es;
@@ -1824,7 +1805,7 @@ HOMARD::HOMARD_Iteration_ptr HOMARD_Gen_i::CreateIteration(const char* NomIterat
 
   const char* nomCas = myIterationParent->GetCaseName();
   MESSAGE ("CreateIteration : nomCas = " << nomCas);
-  HOMARD::HOMARD_Cas_var myCase = myContextMap[GetCurrentStudyID()]._mesCas[nomCas];
+  HOMARD::HOMARD_Cas_var myCase = myStudyContext._mesCas[nomCas];
   if (CORBA::is_nil(myCase))
   {
     SALOME::ExceptionStruct es;
@@ -1836,7 +1817,7 @@ HOMARD::HOMARD_Iteration_ptr HOMARD_Gen_i::CreateIteration(const char* NomIterat
   const char* nomDirCase = myCase->GetDirName();
 
   // Controle du nom :
-  if ((myContextMap[GetCurrentStudyID()]._mesIterations).find(NomIteration)!=(myContextMap[GetCurrentStudyID()]._mesIterations).end())
+  if ((myStudyContext._mesIterations).find(NomIteration)!=(myStudyContext._mesIterations).end())
   {
     SALOME::ExceptionStruct es;
     es.type = SALOME::BAD_PARAM;
@@ -1854,7 +1835,7 @@ HOMARD::HOMARD_Iteration_ptr HOMARD_Gen_i::CreateIteration(const char* NomIterat
     throw SALOME::SALOME_Exception(es);
     return 0;
   };
-  myContextMap[GetCurrentStudyID()]._mesIterations[std::string(NomIteration)] = myIteration;
+  myStudyContext._mesIterations[std::string(NomIteration)] = myIteration;
 // Nom de l'iteration et du maillage
   myIteration->SetName(NomIteration);
   myIteration->SetMeshName(NomIteration);
@@ -1894,9 +1875,9 @@ HOMARD::HOMARD_Iteration_ptr HOMARD_Gen_i::CreateIteration(const char* NomIterat
   myIterationParent->LinkNextIteration(NomIteration);
   myIteration->SetIterParentName(nomIterParent);
   // Gestion de l'arbre d'etudes
-  SALOMEDS::SObject_var aIterSOParent = SALOMEDS::SObject::_narrow(myCurrentStudy->FindObjectIOR(_orb->object_to_string(myIterationParent)));
-  SALOMEDS::SObject_var aIterSO = SALOMEDS::SObject::_narrow(myCurrentStudy->FindObjectIOR(_orb->object_to_string(myIteration)));
-  SALOMEDS::StudyBuilder_var aStudyBuilder = myCurrentStudy->NewBuilder();
+  SALOMEDS::SObject_var aIterSOParent = SALOMEDS::SObject::_narrow(myStudy->FindObjectIOR(_orb->object_to_string(myIterationParent)));
+  SALOMEDS::SObject_var aIterSO = SALOMEDS::SObject::_narrow(myStudy->FindObjectIOR(_orb->object_to_string(myIteration)));
+  SALOMEDS::StudyBuilder_var aStudyBuilder = myStudy->NewBuilder();
   aStudyBuilder->NewCommand();
   SALOMEDS::SObject_var aSubSO = aStudyBuilder->NewObject(aIterSO);
   aStudyBuilder->Addreference(aSubSO, aIterSOParent);
@@ -1911,7 +1892,7 @@ HOMARD::HOMARD_Boundary_ptr HOMARD_Gen_i::CreateBoundary(const char* BoundaryNam
   IsValidStudy () ;
 
   // Controle du nom :
-  if ((myContextMap[GetCurrentStudyID()]._mesBoundarys).find(BoundaryName)!=(myContextMap[GetCurrentStudyID()]._mesBoundarys).end())
+  if ((myStudyContext._mesBoundarys).find(BoundaryName)!=(myStudyContext._mesBoundarys).end())
   {
     MESSAGE ("CreateBoundary : la frontiere " << BoundaryName << " existe deja");
     SALOME::ExceptionStruct es;
@@ -1925,10 +1906,10 @@ HOMARD::HOMARD_Boundary_ptr HOMARD_Gen_i::CreateBoundary(const char* BoundaryNam
   myBoundary->SetName(BoundaryName);
   myBoundary->SetType(BoundaryType);
 
-  myContextMap[GetCurrentStudyID()]._mesBoundarys[BoundaryName] = myBoundary;
+  myStudyContext._mesBoundarys[BoundaryName] = myBoundary;
 
   SALOMEDS::SObject_var aSO;
-  SALOMEDS::SObject_var aResultSO=PublishInStudy(myCurrentStudy, aSO, myBoundary, BoundaryName);
+  SALOMEDS::SObject_var aResultSO=PublishInStudy(aSO, myBoundary, BoundaryName);
 
   return HOMARD::HOMARD_Boundary::_duplicate(myBoundary);
 }
@@ -2091,7 +2072,7 @@ HOMARD::HOMARD_Zone_ptr HOMARD_Gen_i::CreateZone(const char* ZoneName, CORBA::Lo
   IsValidStudy () ;
 
   // Controle du nom :
-  if ((myContextMap[GetCurrentStudyID()]._mesZones).find(ZoneName)!=(myContextMap[GetCurrentStudyID()]._mesZones).end())
+  if ((myStudyContext._mesZones).find(ZoneName)!=(myStudyContext._mesZones).end())
   {
     SALOME::ExceptionStruct es;
     es.type = SALOME::BAD_PARAM;
@@ -2104,10 +2085,10 @@ HOMARD::HOMARD_Zone_ptr HOMARD_Gen_i::CreateZone(const char* ZoneName, CORBA::Lo
   myZone->SetName(ZoneName);
   myZone->SetType(ZoneType);
 
-  myContextMap[GetCurrentStudyID()]._mesZones[ZoneName] = myZone;
+  myStudyContext._mesZones[ZoneName] = myZone;
 
   SALOMEDS::SObject_var aSO;
-  SALOMEDS::SObject_var aResultSO=PublishInStudy(myCurrentStudy, aSO, myZone, ZoneName);
+  SALOMEDS::SObject_var aResultSO=PublishInStudy(aSO, myZone, ZoneName);
 
   return HOMARD::HOMARD_Zone::_duplicate(myZone);
 }
@@ -2411,7 +2392,7 @@ CORBA::Long HOMARD_Gen_i::Compute(const char* NomIteration, CORBA::Long etatMena
   int codret = 0;
 
   // A.1. L'objet iteration
-  HOMARD::HOMARD_Iteration_var myIteration = myContextMap[GetCurrentStudyID()]._mesIterations[NomIteration];
+  HOMARD::HOMARD_Iteration_var myIteration = myStudyContext._mesIterations[NomIteration];
   ASSERT(!CORBA::is_nil(myIteration));
 
   // A.2. Controle de la possibilite d'agir
@@ -2478,7 +2459,7 @@ CORBA::Long HOMARD_Gen_i::Compute(const char* NomIteration, CORBA::Long etatMena
 
   // A.4. Le cas
   const char* nomCas = myIteration->GetCaseName();
-  HOMARD::HOMARD_Cas_var myCase = myContextMap[GetCurrentStudyID()]._mesCas[nomCas];
+  HOMARD::HOMARD_Cas_var myCase = myStudyContext._mesCas[nomCas];
   ASSERT(!CORBA::is_nil(myCase));
 
   // B. Les repertoires
@@ -2604,7 +2585,7 @@ CORBA::Long HOMARD_Gen_i::Compute(const char* NomIteration, CORBA::Long etatMena
         text = "Error during the adaptation.\n" ;
         bool stopvu = false ;
         std::ifstream fichier( LogFile.c_str() );
-        if ( fichier ) // ce test échoue si le fichier n'est pas ouvert
+        if ( fichier ) // ce test ??choue si le fichier n'est pas ouvert
         {
           std::string ligne; // variable contenant chaque ligne lue
           while ( std::getline( fichier, ligne ) )
@@ -2670,12 +2651,12 @@ CORBA::Long HOMARD_Gen_i::ComputeAdap(HOMARD::HOMARD_Cas_var myCase, HOMARD::HOM
       throw SALOME::SALOME_Exception(es);
       return 2;
   };
-  HOMARD::HOMARD_Hypothesis_var myHypo = myContextMap[GetCurrentStudyID()]._mesHypotheses[nomHypo];
+  HOMARD::HOMARD_Hypothesis_var myHypo = myStudyContext._mesHypotheses[nomHypo];
   ASSERT(!CORBA::is_nil(myHypo));
 
   // B. L'iteration parent
   const char* nomIterationParent = myIteration->GetIterParentName();
-  HOMARD::HOMARD_Iteration_var myIterationParent = myContextMap[GetCurrentStudyID()]._mesIterations[nomIterationParent];
+  HOMARD::HOMARD_Iteration_var myIterationParent = myStudyContext._mesIterations[nomIterationParent];
   ASSERT(!CORBA::is_nil(myIterationParent));
   // Si l'iteration parent n'est pas calculee, on le fait (recursivite amont)
   if ( myIterationParent->GetState() == 1 )
@@ -2993,7 +2974,7 @@ char* HOMARD_Gen_i::ComputeDirPaManagement(HOMARD::HOMARD_Cas_var myCase, HOMARD
   // Le sous-repertoire de l'iteration precedente
 
   const char* nomIterationParent = myIteration->GetIterParentName();
-  HOMARD::HOMARD_Iteration_var myIterationParent = myContextMap[GetCurrentStudyID()]._mesIterations[nomIterationParent];
+  HOMARD::HOMARD_Iteration_var myIterationParent = myStudyContext._mesIterations[nomIterationParent];
   const char* nomDirItPa = myIterationParent->GetDirNameLoc();
   std::stringstream DirComputePa ;
   DirComputePa << nomDirCase << "/" << nomDirItPa;
@@ -3016,7 +2997,7 @@ void HOMARD_Gen_i::DriverTexteZone(HOMARD::HOMARD_Hypothesis_var myHypo, HomardD
   {
     std::string ZoneName = std::string((*ListZone)[iaux]);
     MESSAGE ( "... ZoneName = " << ZoneName);
-    HOMARD::HOMARD_Zone_var myZone = myContextMap[GetCurrentStudyID()]._mesZones[ZoneName];
+    HOMARD::HOMARD_Zone_var myZone = myStudyContext._mesZones[ZoneName];
     ASSERT(!CORBA::is_nil(myZone));
 
     int ZoneType = myZone->GetType();
@@ -3127,7 +3108,7 @@ void HOMARD_Gen_i::DriverTexteBoundary(HOMARD::HOMARD_Cas_var myCase, HomardDriv
     if ( A_faire == 1 )
     {
       // 2.2.1. Caracteristiques de la frontiere
-      HOMARD::HOMARD_Boundary_var myBoundary = myContextMap[GetCurrentStudyID()]._mesBoundarys[BoundaryName];
+      HOMARD::HOMARD_Boundary_var myBoundary = myStudyContext._mesBoundarys[BoundaryName];
       ASSERT(!CORBA::is_nil(myBoundary));
       int BoundaryType = myBoundary->GetType();
       MESSAGE ( "... BoundaryType = " << BoundaryType );
@@ -3183,7 +3164,7 @@ void HOMARD_Gen_i::DriverTexteBoundary(HOMARD::HOMARD_Cas_var myCase, HomardDriv
   {
     std::string BoundaryName = std::string((*ListBoundaryGroupType)[NumBoundary]);
     MESSAGE ( "... BoundaryName = " << BoundaryName);
-    HOMARD::HOMARD_Boundary_var myBoundary = myContextMap[GetCurrentStudyID()]._mesBoundarys[BoundaryName];
+    HOMARD::HOMARD_Boundary_var myBoundary = myStudyContext._mesBoundarys[BoundaryName];
     ASSERT(!CORBA::is_nil(myBoundary));
     int BoundaryType = myBoundary->GetType();
     MESSAGE ( "... BoundaryType = " << BoundaryType );
@@ -3255,7 +3236,7 @@ void HOMARD_Gen_i::DriverTexteFieldInterp(HOMARD::HOMARD_Iteration_var myIterati
         // Le type d'interpolation
         std::string TypeInterpstr = std::string((*ListField)[iaux+1]) ;
         MESSAGE( "... FieldName = " << FieldName << ", TypeInterp = " << TypeInterpstr );
-        // On cherche à savoir si des instants ont été précisés pour cette itération
+        // On cherche ?? savoir si des instants ont ??t?? pr??cis??s pour cette it??ration
         int tsrvu = 0;
         for (int jaux = 0; jaux< numberOfFieldsx3; jaux++)
         {
@@ -3278,7 +3259,7 @@ void HOMARD_Gen_i::DriverTexteFieldInterp(HOMARD::HOMARD_Iteration_var myIterati
           }
           jaux += 2 ;
         }
-        // Si aucun instant n'a été défini
+        // Si aucun instant n'a ??t?? d??fini
         if ( tsrvu == 0 )
         {
           NumField += 1 ;
@@ -3299,14 +3280,13 @@ void HOMARD_Gen_i::DriverTexteFieldInterp(HOMARD::HOMARD_Iteration_var myIterati
 // Publications
 //===========================================================================
 //===========================================================================
-SALOMEDS::SObject_ptr HOMARD_Gen_i::PublishInStudy(SALOMEDS::Study_ptr theStudy,
-                                                   SALOMEDS::SObject_ptr theSObject,
+SALOMEDS::SObject_ptr HOMARD_Gen_i::PublishInStudy(SALOMEDS::SObject_ptr theSObject,
                                                    CORBA::Object_ptr theObject,
                                                    const char* theName)
 {
   MESSAGE("PublishInStudy pour " << theName);
   SALOMEDS::SObject_var aResultSO;
-  if (CORBA::is_nil(theStudy))
+  if (CORBA::is_nil(myStudy))
   {
     SALOME::ExceptionStruct es;
     es.type = SALOME::BAD_PARAM;
@@ -3323,12 +3303,12 @@ SALOMEDS::SObject_ptr HOMARD_Gen_i::PublishInStudy(SALOMEDS::Study_ptr theStudy,
   HOMARD::HOMARD_YACS_var       aYACS = HOMARD::HOMARD_YACS::_narrow(theObject);
   HOMARD::HOMARD_Zone_var       aZone = HOMARD::HOMARD_Zone::_narrow(theObject);
 
-   addInStudy(theStudy);
+  UpdateStudy();
 
 // Controle de la non publication d'un objet de meme nom
    if ( (!aBoundary->_is_nil()) || (!aHypo->_is_nil()) || (!aYACS->_is_nil()) || (!aZone->_is_nil()) )
   {
-    SALOMEDS::Study::ListOfSObject_var listSO = theStudy->FindObjectByName(theName, ComponentDataType());
+    SALOMEDS::Study::ListOfSObject_var listSO = myStudy->FindObjectByName(theName, ComponentDataType());
     if (listSO->length() >= 1)
     {
       MESSAGE("This name "<<theName<<" is already used "<<listSO->length()<<" time(s)");
@@ -3338,36 +3318,35 @@ SALOMEDS::SObject_ptr HOMARD_Gen_i::PublishInStudy(SALOMEDS::Study_ptr theStudy,
   }
 
   // Caracteristiques de l'etude
-  SALOMEDS::StudyBuilder_var aStudyBuilder = theStudy->NewBuilder();
+  SALOMEDS::StudyBuilder_var aStudyBuilder = myStudy->NewBuilder();
   aStudyBuilder->NewCommand();
   if(!aBoundary->_is_nil())
-    aResultSO = PublishBoundaryInStudy(theStudy, aStudyBuilder, aBoundary, theName);
+    aResultSO = PublishBoundaryInStudy(aStudyBuilder, aBoundary, theName);
   else if(!aCase->_is_nil())
-    aResultSO = PublishCaseInStudy(theStudy, aStudyBuilder, aCase, theName);
+    aResultSO = PublishCaseInStudy(aStudyBuilder, aCase, theName);
   else if(!aHypo->_is_nil())
-    aResultSO = PublishHypotheseInStudy(theStudy, aStudyBuilder, aHypo, theName);
+    aResultSO = PublishHypotheseInStudy(aStudyBuilder, aHypo, theName);
   else if(!aYACS->_is_nil())
-    aResultSO = PublishYACSInStudy(theStudy, aStudyBuilder, aYACS, theName);
+    aResultSO = PublishYACSInStudy(aStudyBuilder, aYACS, theName);
   else if(!aZone->_is_nil())
-    aResultSO = PublishZoneInStudy(theStudy, aStudyBuilder, aZone, theName);
+    aResultSO = PublishZoneInStudy(aStudyBuilder, aZone, theName);
 
   aStudyBuilder->CommitCommand();
 
   return aResultSO._retn();
 };
 //=============================================================================
-SALOMEDS::SObject_ptr HOMARD_Gen_i::PublishBoundaryInStudy(SALOMEDS::Study_ptr theStudy,
-                   SALOMEDS::StudyBuilder_var aStudyBuilder,
+SALOMEDS::SObject_ptr HOMARD_Gen_i::PublishBoundaryInStudy( SALOMEDS::StudyBuilder_var aStudyBuilder,
                    HOMARD::HOMARD_Boundary_ptr theObject, const char* theName)
 {
   MESSAGE("PublishBoundaryStudy pour "<<theName);
   SALOMEDS::SObject_var aResultSO;
 
   // Caracteristique de la Boundary
-  HOMARD::HOMARD_Boundary_var myBoundary = myContextMap[GetCurrentStudyID()]._mesBoundarys[theName];
+  HOMARD::HOMARD_Boundary_var myBoundary = myStudyContext._mesBoundarys[theName];
 
   // On recupere le module pere dans l etude
-  SALOMEDS::SComponent_var       theFatherHomard = theStudy->FindComponent(ComponentDataType());
+  SALOMEDS::SComponent_var       theFatherHomard = myStudy->FindComponent(ComponentDataType());
   if (theFatherHomard->_is_nil())
   {
     MESSAGE("theFatherHomard->_is_nil()");
@@ -3432,8 +3411,7 @@ SALOMEDS::SObject_ptr HOMARD_Gen_i::PublishBoundaryInStudy(SALOMEDS::Study_ptr t
   return aResultSO._retn();
 }
 //=============================================================================
-SALOMEDS::SObject_ptr HOMARD_Gen_i::PublishCaseInStudy(SALOMEDS::Study_ptr theStudy,
-                                                       SALOMEDS::StudyBuilder_var aStudyBuilder,
+SALOMEDS::SObject_ptr HOMARD_Gen_i::PublishCaseInStudy(SALOMEDS::StudyBuilder_var aStudyBuilder,
                                                        HOMARD::HOMARD_Cas_ptr theObject, const char* theName)
 {
   MESSAGE("PublishCaseInStudy pour "<<theName);
@@ -3443,13 +3421,13 @@ SALOMEDS::SObject_ptr HOMARD_Gen_i::PublishCaseInStudy(SALOMEDS::Study_ptr theSt
     MESSAGE("HOMARD_Gen_i::theObject->_is_nil()");
     return aResultSO._retn();
   }
-  if (theStudy->_is_nil()) {
-    MESSAGE("HOMARD_Gen_i::theStudy->_is_nil()");
+  if (myStudy->_is_nil()) {
+    MESSAGE("HOMARD_Gen_i::myStudy->_is_nil()");
     return aResultSO._retn();
   }
 
   // On recupere le module pere dans l etude
-  SALOMEDS::SComponent_var theFatherHomard = theStudy->FindComponent(ComponentDataType());
+  SALOMEDS::SComponent_var theFatherHomard = myStudy->FindComponent(ComponentDataType());
   if (theFatherHomard->_is_nil())
   {
     MESSAGE("theFatherHomard->_is_nil()");
@@ -3465,8 +3443,7 @@ SALOMEDS::SObject_ptr HOMARD_Gen_i::PublishCaseInStudy(SALOMEDS::Study_ptr theSt
   return aResultSO._retn();
 }
 //=============================================================================
-SALOMEDS::SObject_ptr HOMARD_Gen_i::PublishHypotheseInStudy(SALOMEDS::Study_ptr theStudy,
-                   SALOMEDS::StudyBuilder_var aStudyBuilder,
+SALOMEDS::SObject_ptr HOMARD_Gen_i::PublishHypotheseInStudy(SALOMEDS::StudyBuilder_var aStudyBuilder,
                    HOMARD::HOMARD_Hypothesis_ptr theObject, const char* theName)
 {
   MESSAGE("PublishHypotheseInStudy pour "<<theName);
@@ -3474,7 +3451,7 @@ SALOMEDS::SObject_ptr HOMARD_Gen_i::PublishHypotheseInStudy(SALOMEDS::Study_ptr
 
   // On recupere le module pere dans l etude
   // On ajoute la categorie des hypotheses dans l etude si necessaire
-  SALOMEDS::SComponent_var theFatherHomard = theStudy->FindComponent(ComponentDataType());
+  SALOMEDS::SComponent_var theFatherHomard = myStudy->FindComponent(ComponentDataType());
   if (theFatherHomard->_is_nil())
   {
     MESSAGE("theFatherHomard->_is_nil()");
@@ -3504,8 +3481,7 @@ SALOMEDS::SObject_ptr HOMARD_Gen_i::PublishHypotheseInStudy(SALOMEDS::Study_ptr
   return aResultSO._retn();
 }
 //=============================================================================
-SALOMEDS::SObject_ptr HOMARD_Gen_i::PublishYACSInStudy(SALOMEDS::Study_ptr theStudy,
-                   SALOMEDS::StudyBuilder_var aStudyBuilder,
+SALOMEDS::SObject_ptr HOMARD_Gen_i::PublishYACSInStudy(SALOMEDS::StudyBuilder_var aStudyBuilder,
                    HOMARD::HOMARD_YACS_ptr theObject, const char* theName)
 {
   MESSAGE("PublishYACSInStudy pour "<<theName);
@@ -3513,7 +3489,7 @@ SALOMEDS::SObject_ptr HOMARD_Gen_i::PublishYACSInStudy(SALOMEDS::Study_ptr theSt
 
   // On recupere le module pere dans l etude
   // On ajoute la categorie des schemas YACS dans l etude si necessaire
-  SALOMEDS::SComponent_var theFatherHomard = theStudy->FindComponent(ComponentDataType());
+  SALOMEDS::SComponent_var theFatherHomard = myStudy->FindComponent(ComponentDataType());
   if (theFatherHomard->_is_nil())
   {
     MESSAGE("theFatherHomard->_is_nil()");
@@ -3543,8 +3519,7 @@ SALOMEDS::SObject_ptr HOMARD_Gen_i::PublishYACSInStudy(SALOMEDS::Study_ptr theSt
 }
 
 //=============================================================================
-SALOMEDS::SObject_ptr HOMARD_Gen_i::PublishZoneInStudy(SALOMEDS::Study_ptr theStudy,
-                   SALOMEDS::StudyBuilder_var aStudyBuilder,
+SALOMEDS::SObject_ptr HOMARD_Gen_i::PublishZoneInStudy(SALOMEDS::StudyBuilder_var aStudyBuilder,
                    HOMARD::HOMARD_Zone_ptr theObject, const char* theName)
 {
   MESSAGE("PublishZoneStudy pour "<<theName);
@@ -3554,12 +3529,12 @@ SALOMEDS::SObject_ptr HOMARD_Gen_i::PublishZoneInStudy(SALOMEDS::Study_ptr theSt
     MESSAGE("PublishZoneInStudy : theObject->_is_nil()");
     return aResultSO._retn();
   }
-  if (theStudy->_is_nil())
+  if (myStudy->_is_nil())
   {
-    MESSAGE("PublishZoneInStudy : theStudy->_is_nil()");
+    MESSAGE("PublishZoneInStudy : myStudy->_is_nil()");
     return aResultSO._retn();
   }
-  SALOMEDS::SComponent_var theFatherHomard = theStudy->FindComponent(ComponentDataType());
+  SALOMEDS::SComponent_var theFatherHomard = myStudy->FindComponent(ComponentDataType());
   if (theFatherHomard->_is_nil())
   {
     MESSAGE("PublishZoneInStudy : theFatherHomard->_is_nil()");
@@ -3567,7 +3542,7 @@ SALOMEDS::SObject_ptr HOMARD_Gen_i::PublishZoneInStudy(SALOMEDS::Study_ptr theSt
   }
 
   // Caracteristique de la zone
-  HOMARD::HOMARD_Zone_var myZone = myContextMap[GetCurrentStudyID()]._mesZones[theName];
+  HOMARD::HOMARD_Zone_var myZone = myStudyContext._mesZones[theName];
   CORBA::Long ZoneType = myZone->GetType();
 
   // On ajoute la categorie des zones dans l etude si necessaire
@@ -3682,17 +3657,17 @@ void HOMARD_Gen_i::PublishBoundaryUnderCase(const char* CaseName, const char* Bo
 {
   MESSAGE ( "PublishBoundaryUnderCase : CaseName = " << CaseName << ", BoundaryName= " << BoundaryName );
 
-  HOMARD::HOMARD_Cas_var myCase = myContextMap[GetCurrentStudyID()]._mesCas[CaseName];
+  HOMARD::HOMARD_Cas_var myCase = myStudyContext._mesCas[CaseName];
   ASSERT(!CORBA::is_nil(myCase));
-  SALOMEDS::SObject_var aCaseSO = SALOMEDS::SObject::_narrow(myCurrentStudy->FindObjectIOR(_orb->object_to_string(myCase)));
+  SALOMEDS::SObject_var aCaseSO = SALOMEDS::SObject::_narrow(myStudy->FindObjectIOR(_orb->object_to_string(myCase)));
   ASSERT(!CORBA::is_nil(aCaseSO));
 
-  HOMARD::HOMARD_Boundary_var myBoundary = myContextMap[GetCurrentStudyID()]._mesBoundarys[BoundaryName];
+  HOMARD::HOMARD_Boundary_var myBoundary = myStudyContext._mesBoundarys[BoundaryName];
   ASSERT(!CORBA::is_nil(myBoundary));
-  SALOMEDS::SObject_var aBoundarySO = SALOMEDS::SObject::_narrow(myCurrentStudy->FindObjectIOR(_orb->object_to_string(myBoundary)));
+  SALOMEDS::SObject_var aBoundarySO = SALOMEDS::SObject::_narrow(myStudy->FindObjectIOR(_orb->object_to_string(myBoundary)));
   ASSERT(!CORBA::is_nil(aBoundarySO));
 
-  SALOMEDS::StudyBuilder_var aStudyBuilder = myCurrentStudy->NewBuilder();
+  SALOMEDS::StudyBuilder_var aStudyBuilder = myStudy->NewBuilder();
 
   aStudyBuilder->NewCommand();
 
@@ -3708,17 +3683,17 @@ void HOMARD_Gen_i::PublishCaseUnderYACS(const char* nomYACS, const char* CaseNam
 {
   MESSAGE ( "PublishCaseUnderYACS : nomYACS = " << nomYACS << ", CaseName= " << CaseName );
 
-  HOMARD::HOMARD_YACS_var myYACS = myContextMap[GetCurrentStudyID()]._mesYACSs[nomYACS];
+  HOMARD::HOMARD_YACS_var myYACS = myStudyContext._mesYACSs[nomYACS];
   ASSERT(!CORBA::is_nil(myYACS));
-  SALOMEDS::SObject_var aYACSSO = SALOMEDS::SObject::_narrow(myCurrentStudy->FindObjectIOR(_orb->object_to_string(myYACS)));
+  SALOMEDS::SObject_var aYACSSO = SALOMEDS::SObject::_narrow(myStudy->FindObjectIOR(_orb->object_to_string(myYACS)));
   ASSERT(!CORBA::is_nil(aYACSSO));
 
-  HOMARD::HOMARD_Cas_var myCase = myContextMap[GetCurrentStudyID()]._mesCas[CaseName];
+  HOMARD::HOMARD_Cas_var myCase = myStudyContext._mesCas[CaseName];
   ASSERT(!CORBA::is_nil(myCase));
-  SALOMEDS::SObject_var aCaseSO = SALOMEDS::SObject::_narrow(myCurrentStudy->FindObjectIOR(_orb->object_to_string(myCase)));
+  SALOMEDS::SObject_var aCaseSO = SALOMEDS::SObject::_narrow(myStudy->FindObjectIOR(_orb->object_to_string(myCase)));
   ASSERT(!CORBA::is_nil(aCaseSO));
 
-  SALOMEDS::StudyBuilder_var aStudyBuilder = myCurrentStudy->NewBuilder();
+  SALOMEDS::StudyBuilder_var aStudyBuilder = myStudy->NewBuilder();
 
   aStudyBuilder->NewCommand();
 
@@ -3734,7 +3709,7 @@ void HOMARD_Gen_i::PublishResultInSmesh(const char* NomFich, CORBA::Long Option)
 //  Option = 1 : fichier issu d'une execution HOMARD
 {
   MESSAGE( "PublishResultInSmesh " << NomFich << ", avec Option = " << Option);
-  if (CORBA::is_nil(myCurrentStudy))
+  if (CORBA::is_nil(myStudy))
   {
     SALOME::ExceptionStruct es;
     es.type = SALOME::BAD_PARAM;
@@ -3744,12 +3719,12 @@ void HOMARD_Gen_i::PublishResultInSmesh(const char* NomFich, CORBA::Long Option)
   };
 
 // Le module SMESH est-il actif ?
-  SALOMEDS::SObject_var aSmeshSO = myCurrentStudy->FindComponent("SMESH");
+  SALOMEDS::SObject_var aSmeshSO = myStudy->FindComponent("SMESH");
 //
   if (!CORBA::is_nil(aSmeshSO))
   {
 // On verifie que le fichier n est pas deja publie
-    SALOMEDS::ChildIterator_var aIter = myCurrentStudy->NewChildIterator(aSmeshSO);
+    SALOMEDS::ChildIterator_var aIter = myStudy->NewChildIterator(aSmeshSO);
     for (; aIter->More(); aIter->Next())
     {
       SALOMEDS::SObject_var  aSO = aIter->Value();
@@ -3783,7 +3758,7 @@ void HOMARD_Gen_i::PublishResultInSmesh(const char* NomFich, CORBA::Long Option)
   SALOME_LifeCycleCORBA* myLCC = new SALOME_LifeCycleCORBA(_NS);
   SMESH::SMESH_Gen_var aSmeshEngine = SMESH::SMESH_Gen::_narrow(myLCC->FindOrLoad_Component("FactoryServer","SMESH"));
   ASSERT(!CORBA::is_nil(aSmeshEngine));
-  aSmeshEngine->SetCurrentStudy(myCurrentStudy);
+  aSmeshEngine->UpdateStudy();
   SMESH::DriverMED_ReadStatus theStatus;
   //aSmeshEngine->CreateMeshesFromMED(NomFich, theStatus);
 
@@ -3793,8 +3768,8 @@ void HOMARD_Gen_i::PublishResultInSmesh(const char* NomFich, CORBA::Long Option)
   {
     MESSAGE( ". Mise a jour des attributs du maillage");
     SMESH::SMESH_Mesh_var monMaillage= (*mesMaillages)[i];
-    SALOMEDS::SObject_var aSO=SALOMEDS::SObject::_narrow(myCurrentStudy->FindObjectIOR(_orb->object_to_string(monMaillage)));
-    SALOMEDS::StudyBuilder_var aStudyBuilder = myCurrentStudy->NewBuilder();
+    SALOMEDS::SObject_var aSO=SALOMEDS::SObject::_narrow(myStudy->FindObjectIOR(_orb->object_to_string(monMaillage)));
+    SALOMEDS::StudyBuilder_var aStudyBuilder = myStudy->NewBuilder();
     SALOMEDS::GenericAttribute_var aGAttr = aStudyBuilder->FindOrCreateAttribute(aSO, "AttributeExternalFileDef");
     SALOMEDS::AttributeExternalFileDef_var anAttr = SALOMEDS::AttributeExternalFileDef::_narrow(aGAttr);
     anAttr->SetValue(NomFich);
@@ -3811,7 +3786,7 @@ void HOMARD_Gen_i::PublishResultInSmesh(const char* NomFich, CORBA::Long Option)
 void HOMARD_Gen_i::DeleteResultInSmesh(std::string NomFich, std::string MeshName)
 {
   MESSAGE ("DeleteResultInSmesh pour le maillage " << MeshName << " dans le fichier " << NomFich );
-  if (CORBA::is_nil(myCurrentStudy))
+  if (CORBA::is_nil(myStudy))
   {
       SALOME::ExceptionStruct es;
       es.type = SALOME::BAD_PARAM;
@@ -3821,15 +3796,15 @@ void HOMARD_Gen_i::DeleteResultInSmesh(std::string NomFich, std::string MeshName
   };
 
 // Le module SMESH est-il actif ?
-  SALOMEDS::SObject_var aSmeshSO = myCurrentStudy->FindComponent("SMESH");
+  SALOMEDS::SObject_var aSmeshSO = myStudy->FindComponent("SMESH");
 //
   if (CORBA::is_nil(aSmeshSO))
   {
       return ;
   };
 // On verifie que le fichier est deja publie
-  SALOMEDS::StudyBuilder_var myBuilder = myCurrentStudy->NewBuilder();
-  SALOMEDS::ChildIterator_var aIter = myCurrentStudy->NewChildIterator(aSmeshSO);
+  SALOMEDS::StudyBuilder_var myBuilder = myStudy->NewBuilder();
+  SALOMEDS::ChildIterator_var aIter = myStudy->NewChildIterator(aSmeshSO);
   for (; aIter->More(); aIter->Next())
   {
      SALOMEDS::SObject_var  aSO = aIter->Value();
@@ -3858,9 +3833,9 @@ void HOMARD_Gen_i::DeleteResultInSmesh(std::string NomFich, std::string MeshName
 void HOMARD_Gen_i::PublishMeshIterInSmesh(const char* NomIter)
 {
   MESSAGE( "PublishMeshIterInSmesh " << NomIter);
-  HOMARD::HOMARD_Iteration_var myIteration = myContextMap[GetCurrentStudyID()]._mesIterations[NomIter];
+  HOMARD::HOMARD_Iteration_var myIteration = myStudyContext._mesIterations[NomIter];
 
-  SALOMEDS::SObject_var aIterSO=SALOMEDS::SObject::_narrow(myCurrentStudy->FindObjectIOR(_orb->object_to_string(myIteration)));
+  SALOMEDS::SObject_var aIterSO=SALOMEDS::SObject::_narrow(myStudy->FindObjectIOR(_orb->object_to_string(myIteration)));
   if (CORBA::is_nil(myIteration))
   {
       SALOME::ExceptionStruct es;
@@ -3889,9 +3864,9 @@ void HOMARD_Gen_i::PublishMeshIterInSmesh(const char* NomIter)
 void HOMARD_Gen_i::PublishFileUnderIteration(const char* NomIter, const char* NomFich, const char* Commentaire)
 {
 //   MESSAGE ("PublishFileUnderIteration pour l'iteration " << NomIter << " du fichier " << NomFich << " avec le commentaire " << Commentaire );
-  HOMARD::HOMARD_Iteration_var myIteration = myContextMap[GetCurrentStudyID()]._mesIterations[NomIter];
+  HOMARD::HOMARD_Iteration_var myIteration = myStudyContext._mesIterations[NomIter];
 
-  SALOMEDS::SObject_var aIterSO=SALOMEDS::SObject::_narrow(myCurrentStudy->FindObjectIOR(_orb->object_to_string(myIteration)));
+  SALOMEDS::SObject_var aIterSO=SALOMEDS::SObject::_narrow(myStudy->FindObjectIOR(_orb->object_to_string(myIteration)));
   if (CORBA::is_nil(myIteration))
   {
       SALOME::ExceptionStruct es;
@@ -3901,7 +3876,7 @@ void HOMARD_Gen_i::PublishFileUnderIteration(const char* NomIter, const char* No
       return ;
   };
 
-  SALOMEDS::StudyBuilder_var aStudyBuilder = myCurrentStudy->NewBuilder();
+  SALOMEDS::StudyBuilder_var aStudyBuilder = myStudy->NewBuilder();
 
   aStudyBuilder->NewCommand();
 
@@ -3924,9 +3899,9 @@ void HOMARD_Gen_i::PublishFileUnderIteration(const char* NomIter, const char* No
 void HOMARD_Gen_i::PublishFileUnderYACS(const char* nomYACS, const char* NomFich, const char* Commentaire)
 {
 //   MESSAGE ("PublishFileUnderYACS pour le schema " << nomYACS << " du fichier " << NomFich << " avec le commentaire " << Commentaire );
-  HOMARD::HOMARD_YACS_var myYACS = myContextMap[GetCurrentStudyID()]._mesYACSs[nomYACS];
+  HOMARD::HOMARD_YACS_var myYACS = myStudyContext._mesYACSs[nomYACS];
 
-  SALOMEDS::SObject_var aYACSSO=SALOMEDS::SObject::_narrow(myCurrentStudy->FindObjectIOR(_orb->object_to_string(myYACS)));
+  SALOMEDS::SObject_var aYACSSO=SALOMEDS::SObject::_narrow(myStudy->FindObjectIOR(_orb->object_to_string(myYACS)));
   if (CORBA::is_nil(myYACS))
   {
       SALOME::ExceptionStruct es;
@@ -3936,7 +3911,7 @@ void HOMARD_Gen_i::PublishFileUnderYACS(const char* nomYACS, const char* NomFich
       return ;
   };
 
-  SALOMEDS::StudyBuilder_var aStudyBuilder = myCurrentStudy->NewBuilder();
+  SALOMEDS::StudyBuilder_var aStudyBuilder = myStudy->NewBuilder();
 
   aStudyBuilder->NewCommand();
 
@@ -3957,7 +3932,7 @@ void HOMARD_Gen_i::PublishFileUnderYACS(const char* nomYACS, const char* NomFich
 // Creation d'un schema YACS
 // nomCas : nom du cas a traiter
 // FileName : nom du fichier contenant le script de lancement du calcul
-// DirName : le repertoire de lancement des calculs du schéma
+// DirName : le repertoire de lancement des calculs du sch??ma
 //=============================================================================
 HOMARD::HOMARD_YACS_ptr HOMARD_Gen_i::CreateYACSSchema (const char* nomYACS, const char* nomCas, const char* ScriptFile, const char* DirName, const char* MeshFile)
 {
@@ -3968,7 +3943,7 @@ HOMARD::HOMARD_YACS_ptr HOMARD_Gen_i::CreateYACSSchema (const char* nomYACS, con
   INFOS ( ". MeshFile   : " << MeshFile);
 
   // A. Controle du nom :
-  if ((myContextMap[GetCurrentStudyID()]._mesYACSs).find(nomYACS) != (myContextMap[GetCurrentStudyID()]._mesYACSs).end())
+  if ((myStudyContext._mesYACSs).find(nomYACS) != (myStudyContext._mesYACSs).end())
   {
     SALOME::ExceptionStruct es;
     es.type = SALOME::BAD_PARAM;
@@ -3990,10 +3965,10 @@ HOMARD::HOMARD_YACS_ptr HOMARD_Gen_i::CreateYACSSchema (const char* nomYACS, con
   myYACS->SetName( nomYACS ) ;
 
   // C. Enregistrement
-  myContextMap[GetCurrentStudyID()]._mesYACSs[nomYACS] = myYACS;
+  myStudyContext._mesYACSs[nomYACS] = myYACS;
 
   SALOMEDS::SObject_var aSO;
-  SALOMEDS::SObject_var aResultSO=PublishInStudy(myCurrentStudy, aSO, myYACS, nomYACS);
+  SALOMEDS::SObject_var aResultSO=PublishInStudy(aSO, myYACS, nomYACS);
 
   PublishCaseUnderYACS(nomYACS, nomCas);
 
@@ -4030,7 +4005,7 @@ CORBA::Long HOMARD_Gen_i::YACSWrite(const char* nomYACS)
 {
   INFOS ( "YACSWrite : Ecriture de " << nomYACS );
 // Le repertoire du cas
-  HOMARD::HOMARD_YACS_var myYACS = myContextMap[GetCurrentStudyID()]._mesYACSs[nomYACS];
+  HOMARD::HOMARD_YACS_var myYACS = myStudyContext._mesYACSs[nomYACS];
   ASSERT(!CORBA::is_nil(myYACS));
 // Le nom du fichier du schema
   std::string XMLFile ;
@@ -4052,7 +4027,7 @@ CORBA::Long HOMARD_Gen_i::YACSWriteOnFile(const char* nomYACS, const char* XMLFi
 
   // B. L'objet YACS
   // B.1. L'objet
-  HOMARD::HOMARD_YACS_var myYACS = myContextMap[GetCurrentStudyID()]._mesYACSs[nomYACS];
+  HOMARD::HOMARD_YACS_var myYACS = myStudyContext._mesYACSs[nomYACS];
   ASSERT(!CORBA::is_nil(myYACS));
   // B.2. Les caracteristiques
   std::string DirName = myYACS->GetDirName() ;
@@ -4066,7 +4041,7 @@ CORBA::Long HOMARD_Gen_i::YACSWriteOnFile(const char* nomYACS, const char* XMLFi
   // C. Le cas
   // C.1. L'objet cas
   const char* nomCas = myYACS->GetCaseName();
-  HOMARD::HOMARD_Cas_var myCase = myContextMap[GetCurrentStudyID()]._mesCas[nomCas];
+  HOMARD::HOMARD_Cas_var myCase = myStudyContext._mesCas[nomCas];
   ASSERT(!CORBA::is_nil(myCase));
   // C.2. Les instructions python associees au cas
   CORBA::String_var dumpCorbaCase = myCase->GetDumpPython();
@@ -4105,7 +4080,7 @@ CORBA::Long HOMARD_Gen_i::YACSWriteOnFile(const char* nomYACS, const char* XMLFi
   // E.1. La structure
   std::string nomHypo = Iter1->GetHypoName();
   MESSAGE (". nomHypo = " << nomHypo);
-  HOMARD::HOMARD_Hypothesis_var myHypo = myContextMap[GetCurrentStudyID()]._mesHypotheses[nomHypo];
+  HOMARD::HOMARD_Hypothesis_var myHypo = myStudyContext._mesHypotheses[nomHypo];
   ASSERT(!CORBA::is_nil(myHypo));
   // E.2. Les caracteristiques de l'adaptation
   HOMARD::listeTypes* ListTypes = myHypo->GetAdapRefinUnRef();
@@ -4138,7 +4113,7 @@ CORBA::Long HOMARD_Gen_i::YACSWriteOnFile(const char* nomYACS, const char* XMLFi
   // G. Lecture du schema de reference et insertion des donnees propres au fil de la rencontre des mots-cles
   YACSDriver* myDriver = new YACSDriver(XMLFile, DirName);
   std::ifstream fichier( XMLFile_base.c_str() );
-  if ( fichier ) // ce test échoue si le fichier n'est pas ouvert
+  if ( fichier ) // ce test ??choue si le fichier n'est pas ouvert
   {
     // G.1. Lecture du schema de reference et insertion des donnees propres au fil de la rencontre des mots-cles
     std::string ligne; // variable contenant chaque ligne lue
@@ -4231,7 +4206,7 @@ std::string HOMARD_Gen_i::YACSDriverTexteZone(HOMARD::HOMARD_Hypothesis_var myHy
     // 1. Reperage de la zone
     std::string ZoneName = std::string((*ListZone)[iaux]);
     MESSAGE ( "\n. ZoneName = " << ZoneName << " - " <<iaux);
-    HOMARD::HOMARD_Zone_var myZone = myContextMap[GetCurrentStudyID()]._mesZones[ZoneName];
+    HOMARD::HOMARD_Zone_var myZone = myStudyContext._mesZones[ZoneName];
     ASSERT(!CORBA::is_nil(myZone));
     // 2. Les instructions python associees a la zone
     //    La premiere ligne est un commentaire a eliminer
@@ -4290,7 +4265,7 @@ std::string HOMARD_Gen_i::YACSDriverTexteBoundary(HOMARD::HOMARD_Cas_var myCase,
     if ( A_faire == 1 )
     {
     // 1. Caracteristiques de la frontiere
-      HOMARD::HOMARD_Boundary_var myBoundary = myContextMap[GetCurrentStudyID()]._mesBoundarys[BoundaryName];
+      HOMARD::HOMARD_Boundary_var myBoundary = myStudyContext._mesBoundarys[BoundaryName];
       ASSERT(!CORBA::is_nil(myBoundary));
       // 2. Les instructions python associees a la frontiere
       //    La premiere ligne est un commentaire a eliminer
@@ -4345,19 +4320,18 @@ SALOMEDS::TMPFile* HOMARD_Gen_i::Save(SALOMEDS::SComponent_ptr theComponent,
   // get temporary directory name
   std::string tmpDir = isMultiFile ? std::string(theURL) : SALOMEDS_Tool::GetTmpDir();
 
-  SALOMEDS::Study_var aStudy = theComponent->GetStudy();
-  StudyContext& context = myContextMap[ aStudy->StudyId() ];
+  StudyContext& context = myStudyContext;
 
   // HOMARD data file name
   std::string aFileName = "";
   if (isMultiFile)
-    aFileName = SALOMEDS_Tool::GetNameFromPath(aStudy->URL());
+    aFileName = SALOMEDS_Tool::GetNameFromPath(Kernel_Utils::encode(SMESH_Gen_i::getStudyServant()->URL()));
   aFileName += "_HOMARD.dat";
 
   // initialize sequence of file names
-  SALOMEDS::ListOfFileNames_var aFileSeq = new SALOMEDS::ListOfFileNames;
-  aFileSeq->length(1);
-  aFileSeq[0] = CORBA::string_dup(aFileName.c_str()) ;
+  SALOMEDS_Tool::ListOfFiles aFileSeq;
+  aFileSeq.reserve(1);
+  aFileSeq.push_back(CORBA::string_dup(aFileName.c_str())) ;
 
   // get full path to the data file
   aFileName = tmpDir + aFileName;
@@ -4432,11 +4406,11 @@ SALOMEDS::TMPFile* HOMARD_Gen_i::Save(SALOMEDS::SComponent_ptr theComponent,
 
   // put temporary files to the stream
   MESSAGE ("put temporary files to the stream");
-  aStreamFile = SALOMEDS_Tool::PutFilesToStream(tmpDir.c_str(), aFileSeq.in(), isMultiFile);
+  aStreamFile = SALOMEDS_Tool::PutFilesToStream(tmpDir.c_str(), aFileSeq, isMultiFile);
 
   // remove temporary files
   MESSAGE ("remove temporary files");
-  if (!isMultiFile) SALOMEDS_Tool::RemoveTemporaryFiles(tmpDir.c_str(), aFileSeq.in(), true);
+  if (!isMultiFile) SALOMEDS_Tool::RemoveTemporaryFiles(tmpDir.c_str(), aFileSeq, true);
 
   // return data stream
   MESSAGE ("return data stream");
@@ -4460,26 +4434,25 @@ CORBA::Boolean HOMARD_Gen_i::Load(SALOMEDS::SComponent_ptr theComponent,
                                   CORBA::Boolean isMultiFile)
 {
   MESSAGE ("Load pour theURL = "<< theURL);
-  SALOMEDS::Study_var aStudy = theComponent->GetStudy();
 
   // set current study
-  if (myCurrentStudy->_is_nil() || aStudy->StudyId() != myCurrentStudy->StudyId())
-    SetCurrentStudy(aStudy);
+  if (myStudy->_is_nil())
+    UpdateStudy();
 
   // get temporary directory name
   std::string tmpDir = isMultiFile ? std::string(theURL) : SALOMEDS_Tool::GetTmpDir();
 
   // Convert the stream into sequence of files to process
-  SALOMEDS::ListOfFileNames_var aFileSeq = SALOMEDS_Tool::PutStreamToFiles(theStream,
-                                                                            tmpDir.c_str(),
-                                                                            isMultiFile);
+  SALOMEDS_Tool::ListOfFiles aFileSeq = SALOMEDS_Tool::PutStreamToFiles(theStream,
+                                                                        tmpDir.c_str(),
+                                                                        isMultiFile);
   // HOMARD data file name
   std::string aFileName = "";
   if (isMultiFile)
-    aFileName = SALOMEDS_Tool::GetNameFromPath(aStudy->URL());
+    aFileName = SALOMEDS_Tool::GetNameFromPath(Kernel_Utils::encode(SMESH_Gen_i::getStudyServant()->URL()));
   aFileName = tmpDir + aFileName + "_HOMARD.dat";
 
-  StudyContext& context = myContextMap[ aStudy->StudyId() ];
+  StudyContext& context = myStudyContext;
 
   // save data
   // -> create file
@@ -4578,7 +4551,7 @@ CORBA::Boolean HOMARD_Gen_i::Load(SALOMEDS::SComponent_ptr theComponent,
 
   // Remove temporary files created from the stream
   if (!isMultiFile)
-    SALOMEDS_Tool::RemoveTemporaryFiles(tmpDir.c_str(), aFileSeq.in(), true);
+    SALOMEDS_Tool::RemoveTemporaryFiles(tmpDir.c_str(), aFileSeq, true);
 
   return true;
 };
@@ -4596,15 +4569,6 @@ CORBA::Boolean HOMARD_Gen_i::LoadASCII(SALOMEDS::SComponent_ptr theComponent,
 //===========================================================================
 void HOMARD_Gen_i::Close(SALOMEDS::SComponent_ptr theComponent)
 {
-  if (theComponent->GetStudy()->StudyId() == GetCurrentStudyID()) {
-    // clearing study context should be done here:
-    // - destroy all servants and related CORBA objects
-    // ... (TODO)
-    // - remove context from myContextMap
-    myContextMap.erase(theComponent->GetStudy()->StudyId());
-    // - nullify myCurrentStudy
-    myCurrentStudy = SALOMEDS::Study::_nil();
-  }
 };
 
 //===========================================================================
@@ -4621,7 +4585,7 @@ char* HOMARD_Gen_i::IORToLocalPersistentID(SALOMEDS::SObject_ptr theSObject,
 {
   CORBA::String_var aString("");
   if (!CORBA::is_nil(theSObject) && strcmp(IORString, "") != 0) {
-    StudyContext context = myContextMap[ theSObject->GetStudy()->StudyId() ];
+    StudyContext context = myStudyContext;
     CORBA::Object_var anObj = _orb->string_to_object(IORString);
     if (!CORBA::is_nil(anObj)) {
       PortableServer::ServantBase_var aServant = GetServant(anObj);
@@ -4649,7 +4613,7 @@ char* HOMARD_Gen_i::LocalPersistentIDToIOR(SALOMEDS::SObject_ptr theSObject,
 {
   CORBA::String_var aString("");
   if (!CORBA::is_nil(theSObject) && strcmp(aLocalPersistentID, "") != 0) {
-    StudyContext context = myContextMap[ theSObject->GetStudy()->StudyId() ];
+    StudyContext context = myStudyContext;
     int id = atoi(aLocalPersistentID);
     if (id > 0 && context._idmap.find(id) != context._idmap.end()) {
       CORBA::Object_var object = _poa->servant_to_reference(context._idmap[ id ]);
@@ -4664,7 +4628,7 @@ char* HOMARD_Gen_i::LocalPersistentIDToIOR(SALOMEDS::SObject_ptr theSObject,
 //===========================================================================
 CORBA::Boolean HOMARD_Gen_i::CanPublishInStudy(CORBA::Object_ptr theIOR)
 {
-  if(CORBA::is_nil(myCurrentStudy))
+  if(CORBA::is_nil(myStudy))
     return false;
 
   HOMARD::HOMARD_Cas_var aCas = HOMARD::HOMARD_Cas::_narrow(theIOR);
@@ -4740,18 +4704,14 @@ PortableServer::ServantBase_var HOMARD_Gen_i::GetServant(CORBA::Object_ptr theOb
 }
 
 //==========================================================================
-Engines::TMPFile* HOMARD_Gen_i::DumpPython(CORBA::Object_ptr theStudy,
-                                       CORBA::Boolean isPublished,
-                                       CORBA::Boolean isMultiFile,
-                                       CORBA::Boolean& isValidScript)
+Engines::TMPFile* HOMARD_Gen_i::DumpPython(CORBA::Boolean isPublished,
+                                           CORBA::Boolean isMultiFile,
+                                           CORBA::Boolean& isValidScript)
 {
    MESSAGE ("Entree dans DumpPython");
    isValidScript=1;
-   SALOMEDS::Study_var aStudy = SALOMEDS::Study::_narrow(theStudy);
-   if(CORBA::is_nil(aStudy))
-     return new Engines::TMPFile(0);
 
-   SALOMEDS::SObject_var aSO = aStudy->FindComponent("HOMARD");
+   SALOMEDS::SObject_var aSO = SMESH_Gen_i::getStudyServant()->FindComponent("HOMARD");
    if(CORBA::is_nil(aSO))
       return new Engines::TMPFile(0);
 
@@ -4764,24 +4724,19 @@ Engines::TMPFile* HOMARD_Gen_i::DumpPython(CORBA::Object_ptr theStudy,
    if( isMultiFile )
       aScript += "import salome\n";
    aScript += "homard = salome.lcc.FindOrLoadComponent('FactoryServer','HOMARD')\n";
-   if( isMultiFile ) {
-      aScript += "def RebuildData(theStudy):\n";
-      aScript += "\thomard.SetCurrentStudy(theStudy)\n";
-   }
-   else
-      aScript += "\thomard.SetCurrentStudy(salome.myStudy)\n";
+   aScript += "\thomard.UpdateStudy()\n";
    MESSAGE (". Au depart \n"<<aScript);
 
 
-   if (myContextMap[GetCurrentStudyID()]._mesBoundarys.size() > 0)
+   if (myStudyContext._mesBoundarys.size() > 0)
    {
     MESSAGE (". Ecritures des frontieres");
     aScript += "#\n# Creation of the boundaries";
     aScript +=  "\n# ==========================";
    }
    std::map<std::string, HOMARD::HOMARD_Boundary_var>::const_iterator it_boundary;
-   for (it_boundary  = myContextMap[GetCurrentStudyID()]._mesBoundarys.begin();
-        it_boundary != myContextMap[GetCurrentStudyID()]._mesBoundarys.end(); ++it_boundary)
+   for (it_boundary  = myStudyContext._mesBoundarys.begin();
+        it_boundary != myStudyContext._mesBoundarys.end(); ++it_boundary)
    {
     HOMARD::HOMARD_Boundary_var maBoundary = (*it_boundary).second;
     CORBA::String_var dumpCorbaBoundary = maBoundary->GetDumpPython();
@@ -4791,15 +4746,15 @@ Engines::TMPFile* HOMARD_Gen_i::DumpPython(CORBA::Object_ptr theStudy,
    }
 
 
-   if (myContextMap[GetCurrentStudyID()]._mesZones.size() > 0)
+   if (myStudyContext._mesZones.size() > 0)
    {
     MESSAGE (". Ecritures des zones");
     aScript += "#\n# Creation of the zones";
     aScript +=  "\n# =====================";
    }
    std::map<std::string, HOMARD::HOMARD_Zone_var>::const_iterator it_zone;
-   for ( it_zone  = myContextMap[GetCurrentStudyID()]._mesZones.begin();
-         it_zone != myContextMap[GetCurrentStudyID()]._mesZones.end(); ++it_zone)
+   for ( it_zone  = myStudyContext._mesZones.begin();
+         it_zone != myStudyContext._mesZones.end(); ++it_zone)
    {
     HOMARD::HOMARD_Zone_var myZone = (*it_zone).second;
     CORBA::String_var dumpCorbaZone = myZone->GetDumpPython();
@@ -4809,15 +4764,15 @@ Engines::TMPFile* HOMARD_Gen_i::DumpPython(CORBA::Object_ptr theStudy,
    }
 
 
-   if (myContextMap[GetCurrentStudyID()]._mesHypotheses.size() > 0)
+   if (myStudyContext._mesHypotheses.size() > 0)
    {
     MESSAGE (". Ecritures des hypotheses");
     aScript += "#\n# Creation of the hypotheses";
     aScript +=  "\n# ==========================";
    }
    std::map<std::string, HOMARD::HOMARD_Hypothesis_var>::const_iterator it_hypo;
-   for ( it_hypo  = myContextMap[GetCurrentStudyID()]._mesHypotheses.begin();
-         it_hypo != myContextMap[GetCurrentStudyID()]._mesHypotheses.end(); it_hypo++)
+   for ( it_hypo  = myStudyContext._mesHypotheses.begin();
+         it_hypo != myStudyContext._mesHypotheses.end(); it_hypo++)
    {
     HOMARD::HOMARD_Hypothesis_var monHypo = (*it_hypo).second;
     CORBA::String_var dumpCorbaHypo = monHypo->GetDumpPython();
@@ -4827,15 +4782,15 @@ Engines::TMPFile* HOMARD_Gen_i::DumpPython(CORBA::Object_ptr theStudy,
    }
 
 
-   if (myContextMap[GetCurrentStudyID()]._mesCas.size() > 0)
+   if (myStudyContext._mesCas.size() > 0)
    {
     MESSAGE (". Ecritures des cas");
     aScript += "#\n# Creation of the cases";
     aScript += "\n# =====================";
    }
    std::map<std::string, HOMARD::HOMARD_Cas_var>::const_iterator it_cas;
-   for (it_cas  = myContextMap[GetCurrentStudyID()]._mesCas.begin();
-        it_cas != myContextMap[GetCurrentStudyID()]._mesCas.end(); it_cas++)
+   for (it_cas  = myStudyContext._mesCas.begin();
+        it_cas != myStudyContext._mesCas.end(); it_cas++)
         {
            std::string nomCas = (*it_cas).first;
            std::string dumpCas = std::string("\n# Creation of the case ") ;
@@ -4847,7 +4802,7 @@ Engines::TMPFile* HOMARD_Gen_i::DumpPython(CORBA::Object_ptr theStudy,
            CORBA::String_var cIter0= myCase->GetIter0Name();
            std::string iter0 = cIter0.in();
 
-           HOMARD::HOMARD_Iteration_var myIteration = myContextMap[GetCurrentStudyID()]._mesIterations[iter0];
+           HOMARD::HOMARD_Iteration_var myIteration = myStudyContext._mesIterations[iter0];
            CORBA::String_var cMesh0= myIteration->GetMeshFile();
            std::string mesh0 = cMesh0.in();
            CORBA::String_var cMeshName0= myIteration->GetMeshName();
@@ -4861,15 +4816,15 @@ Engines::TMPFile* HOMARD_Gen_i::DumpPython(CORBA::Object_ptr theStudy,
         };
 
 
-   if (myContextMap[GetCurrentStudyID()]._mesIterations.size() > 0)
+   if (myStudyContext._mesIterations.size() > 0)
    {
     MESSAGE (". Ecritures des iterations");
     aScript += "#\n# Creation of the iterations" ;
     aScript += "\n# ==========================";
    }
    std::map<std::string, HOMARD::HOMARD_Iteration_var>::const_iterator it_iter;
-   for (it_iter  = myContextMap[GetCurrentStudyID()]._mesIterations.begin();
-        it_iter != myContextMap[GetCurrentStudyID()]._mesIterations.end(); ++it_iter)
+   for (it_iter  = myStudyContext._mesIterations.begin();
+        it_iter != myStudyContext._mesIterations.end(); ++it_iter)
    {
     HOMARD::HOMARD_Iteration_var aIter = (*it_iter).second;
     CORBA::String_var dumpCorbaIter = aIter->GetDumpPython();
@@ -4879,15 +4834,15 @@ Engines::TMPFile* HOMARD_Gen_i::DumpPython(CORBA::Object_ptr theStudy,
    }
 
 
-   if (myContextMap[GetCurrentStudyID()]._mesYACSs.size() > 0)
+   if (myStudyContext._mesYACSs.size() > 0)
    {
     MESSAGE (". Ecritures des schemas YACS");
     aScript += "#\n# Creation of the schemas YACS";
     aScript +=  "\n# ============================";
    }
    std::map<std::string, HOMARD::HOMARD_YACS_var>::const_iterator it_yacs;
-   for ( it_yacs  = myContextMap[GetCurrentStudyID()]._mesYACSs.begin();
-         it_yacs != myContextMap[GetCurrentStudyID()]._mesYACSs.end(); ++it_yacs)
+   for ( it_yacs  = myStudyContext._mesYACSs.begin();
+         it_yacs != myStudyContext._mesYACSs.end(); ++it_yacs)
    {
     HOMARD::HOMARD_YACS_var myYACS = (*it_yacs).second;
     CORBA::String_var dumpCorbaYACS = myYACS->GetDumpPython();
@@ -4925,7 +4880,7 @@ Engines::TMPFile* HOMARD_Gen_i::DumpPython(CORBA::Object_ptr theStudy,
 void HOMARD_Gen_i::IsValidStudy( )
 {
 //   MESSAGE( "IsValidStudy" );
-  if (CORBA::is_nil(myCurrentStudy))
+  if (CORBA::is_nil(SMESH_Gen_i::getStudyServant()))
   {
     SALOME::ExceptionStruct es;
     es.type = SALOME::BAD_PARAM;
@@ -4940,8 +4895,8 @@ char* HOMARD_Gen_i::VerifieDir(const char* nomDir)
 {
   std::string casename = std::string("") ;
   std::map<std::string, HOMARD::HOMARD_Cas_var>::const_iterator it;
-  for (it = myContextMap[GetCurrentStudyID()]._mesCas.begin();
-  it != myContextMap[GetCurrentStudyID()]._mesCas.end(); it++)
+  for (it = myStudyContext._mesCas.begin();
+  it != myStudyContext._mesCas.end(); it++)
   {
    if (std::string(nomDir) == std::string(it->second->GetDirName()))
    {
@@ -5030,7 +4985,7 @@ void HOMARD_Gen_i::SetPreferences( )
   File += "/bin/salome/VERSION" ;
   MESSAGE ( "File = "<<File ) ;
   std::ifstream fichier0( File.c_str() ) ;
-  if ( fichier0 ) // ce test échoue si le fichier n'est pas ouvert
+  if ( fichier0 ) // ce test ??choue si le fichier n'est pas ouvert
   {
     std::string ligne; // variable contenant chaque ligne lue
     while ( std::getline( fichier0, ligne ) )
@@ -5056,7 +5011,7 @@ void HOMARD_Gen_i::SetPreferences( )
     MESSAGE ( "PrefFile = "<<PrefFile ) ;
 
     std::ifstream fichier( PrefFile.c_str() );
-    if ( fichier ) // ce test échoue si le fichier n'est pas ouvert
+    if ( fichier ) // ce test ??choue si le fichier n'est pas ouvert
     {
       bool section_langue = false ;
       bool section_homard = false ;
index 9063b9a23911b3ac550822dbcbd980f21bd28068..856e25f148c0b497c83b9c0a3e40b10e21436e1a 100644 (file)
@@ -141,9 +141,7 @@ public:
   HOMARD::HOMARD_Iteration_ptr    LastIteration  (const char* nomCas);
 
 // L'etude
-  SALOMEDS::Study_ptr             GetCurrentStudy();
-  void                            SetCurrentStudy(SALOMEDS::Study_ptr theStudy);
-  CORBA::Long                     GetCurrentStudyID();
+  void                            UpdateStudy();
   void                            IsValidStudy();
 
 // Liens entre structures
@@ -256,8 +254,7 @@ public:
   // --> Data publishing
   virtual CORBA::Boolean          CanPublishInStudy(CORBA::Object_ptr theIOR);
 
-  virtual SALOMEDS::SObject_ptr   PublishInStudy(SALOMEDS::Study_ptr theStudy,
-                                                 SALOMEDS::SObject_ptr theSObject,
+  virtual SALOMEDS::SObject_ptr   PublishInStudy(SALOMEDS::SObject_ptr theSObject,
                                                  CORBA::Object_ptr theObject,
                                                  const char* theName);
 
@@ -276,16 +273,15 @@ public:
 //   virtual void SALOMEException( std::string message );
 
 private:
-  void                            addInStudy(SALOMEDS::Study_ptr theStudy);
-  SALOMEDS::SObject_ptr           PublishBoundaryInStudy(SALOMEDS::Study_ptr theStudy, SALOMEDS::StudyBuilder_var aStudyBuilder,
+  SALOMEDS::SObject_ptr           PublishBoundaryInStudy(SALOMEDS::StudyBuilder_var aStudyBuilder,
                                                      HOMARD::HOMARD_Boundary_ptr theObject, const char* theName);
-  SALOMEDS::SObject_ptr           PublishCaseInStudy(SALOMEDS::Study_ptr theStudy, SALOMEDS::StudyBuilder_var aStudyBuilder,
+  SALOMEDS::SObject_ptr           PublishCaseInStudy(SALOMEDS::StudyBuilder_var aStudyBuilder,
                                                      HOMARD::HOMARD_Cas_ptr theObject, const char* theName);
-  SALOMEDS::SObject_ptr           PublishHypotheseInStudy(SALOMEDS::Study_ptr theStudy, SALOMEDS::StudyBuilder_var aStudyBuilder,
+  SALOMEDS::SObject_ptr           PublishHypotheseInStudy(SALOMEDS::StudyBuilder_var aStudyBuilder,
                                                      HOMARD::HOMARD_Hypothesis_ptr theObject, const char* theName);
-  SALOMEDS::SObject_ptr           PublishYACSInStudy(SALOMEDS::Study_ptr theStudy, SALOMEDS::StudyBuilder_var aStudyBuilder,
+  SALOMEDS::SObject_ptr           PublishYACSInStudy(SALOMEDS::StudyBuilder_var aStudyBuilder,
                                                      HOMARD::HOMARD_YACS_ptr theObject, const char* theName);
-  SALOMEDS::SObject_ptr           PublishZoneInStudy(SALOMEDS::Study_ptr theStudy, SALOMEDS::StudyBuilder_var aStudyBuilder,
+  SALOMEDS::SObject_ptr           PublishZoneInStudy(SALOMEDS::StudyBuilder_var aStudyBuilder,
                                                      HOMARD::HOMARD_Zone_ptr theObject, const char* theName);
   virtual void                    PublishInStudyAttr(SALOMEDS::StudyBuilder_var aStudyBuilder,
                                                      SALOMEDS::SObject_var aResultSO,
@@ -301,10 +297,9 @@ private:
   HOMARD::HOMARD_Zone_ptr         newZone();
 
 
-  virtual Engines::TMPFile*       DumpPython(CORBA::Object_ptr theStudy,
-                                            CORBA::Boolean isPublished,
-                                            CORBA::Boolean isMultiFile,
-                                            CORBA::Boolean& isValidScript);
+  virtual Engines::TMPFile*       DumpPython(CORBA::Boolean isPublished,
+                                                                CORBA::Boolean isMultiFile,
+                                                                CORBA::Boolean& isValidScript);
 
   virtual char*                   getVersion();
   std::string GetStringInTexte( const std::string Texte, const std::string String, int option ) ;
@@ -320,11 +315,10 @@ private:
     std::map<std::string, HOMARD::HOMARD_Zone_var>       _mesZones;
     std::map<int, PortableServer::ServantBase*>          _idmap;
   };
-  typedef std::map<int, StudyContext> ContextMap;
 
   ::HOMARD_Gen*                 myHomard;
-  SALOMEDS::Study_var           myCurrentStudy;
-  ContextMap                    myContextMap;
+  SALOMEDS::Study_var           myStudy;
+  StudyContext                  myStudyContext;
   SALOME_NamingService*         _NS;
 
   int _tag_gene ;
index dab7822c38466457105d09053e998a8c895f37d6..ed29dda9d569e9647914a45a0b0354513f3d9b92 100644 (file)
@@ -29,7 +29,7 @@
 # see salome_shared_modules.py
 # (avoids incomplete import at run time)
 
-print "============== import HOMARD ======================="
+print("============== import HOMARD =======================")
 
 import HOMARD
 
index dd221ebc8816a4fcb94ddfaa1cd899004d7e7074..9690918fe9e0e9f9bee9de6c97267c2134437ea2 100755 (executable)
@@ -62,7 +62,7 @@ IPAR.append("AP_MODULES_LIST", "Homard")
 #
 #========================================================================
 #========================================================================
-def homard_exec(theStudy):
+def homard_exec():
   """
 Python script for HOMARD
   """
@@ -70,7 +70,7 @@ Python script for HOMARD
 #
   while not error :
   #
-    HOMARD.SetCurrentStudy(theStudy)
+    HOMARD.UpdateStudy()
   #
   # Creation of the zones
   # =====================
@@ -107,7 +107,7 @@ Python script for HOMARD
     zones_1_et_2.AddZone('Zone_1_1', 1)
     zones_1_et_2.AddZone('Zone_1_2', 1)
     laux = zones_1_et_2.GetZones()
-    nbzone = len(laux)/2
+    nbzone = len(laux) // 2
     jaux = 0
     for iaux in range(nbzone) :
       print(hyponame_2, " : ", dico[laux[jaux+1]], "sur la zone", laux[jaux])
@@ -202,11 +202,11 @@ HOMARD.SetLanguageShort("fr")
 # Exec of HOMARD-SALOME
 #
 try :
-  ERROR = homard_exec(salome.myStudy)
+  ERROR = homard_exec()
   if ERROR :
     raise Exception('Pb in homard_exec at iteration %d' %ERROR )
 except Exception as eee:
-  raise Exception('Pb in homard_exec: '+eee.message)
+  raise Exception('Pb in homard_exec: '+str(eee.message))
 #
 # Test of the results
 #
@@ -215,6 +215,6 @@ DESTROY_DIR = not DEBUG
 test_results(REP_DATA, TEST_NAME, DIRCASE, N_ITER_TEST_FILE, N_REP_TEST_FILE, DESTROY_DIR)
 #
 if salome.sg.hasDesktop():
-  salome.sg.updateObjBrowser(True)
+  salome.sg.updateObjBrowser()
   iparameters.getSession().restoreVisualState(1)
 
index c73f71fa05f519533d1e78445c2d9385f8c481b6..f4f58a2189c3c26c1c0c1d1ff386186d34b7cd97 100755 (executable)
@@ -62,7 +62,7 @@ IPAR.append("AP_MODULES_LIST", "Homard")
 #
 #========================================================================
 #========================================================================
-def homard_exec(theStudy):
+def homard_exec():
   """
 Python script for HOMARD
   """
@@ -70,7 +70,7 @@ Python script for HOMARD
 #
   while not error :
   #
-    HOMARD.SetCurrentStudy(theStudy)
+    HOMARD.UpdateStudy()
   #
   # Creation of the boundaries
   # ==========================
@@ -174,7 +174,7 @@ HOMARD.SetLanguageShort("fr")
 # Exec of HOMARD-SALOME
 #
 try :
-  ERROR = homard_exec(salome.myStudy)
+  ERROR = homard_exec()
   if ERROR :
     raise Exception('Pb in homard_exec at iteration %d' %ERROR )
 except Exception as eee:
@@ -187,6 +187,6 @@ DESTROY_DIR = not DEBUG
 test_results(REP_DATA, TEST_NAME, DIRCASE, N_ITER_TEST_FILE, N_REP_TEST_FILE, DESTROY_DIR)
 #
 if salome.sg.hasDesktop():
-  salome.sg.updateObjBrowser(True)
+  salome.sg.updateObjBrowser()
   iparameters.getSession().restoreVisualState(1)
 
index 04dbec62269a641c4e93217175a7dce91355b5f5..cb324205722acdfedfb622482b40c99ce006f124 100755 (executable)
@@ -63,7 +63,7 @@ IPAR.append("AP_MODULES_LIST", "Homard")
 #
 #========================================================================
 #========================================================================
-def homard_exec(theStudy):
+def homard_exec():
   """
 Python script for HOMARD
   """
@@ -71,7 +71,7 @@ Python script for HOMARD
 #
   while not error :
   #
-    HOMARD.SetCurrentStudy(theStudy)
+    HOMARD.UpdateStudy()
   #
   # Creation of the boundaries
   # ==========================
@@ -208,7 +208,7 @@ HOMARD.SetLanguageShort("fr")
 # Exec of HOMARD-SALOME
 #
 try :
-  ERROR = homard_exec(salome.myStudy)
+  ERROR = homard_exec()
   if ERROR :
     raise Exception('Pb in homard_exec at iteration %d' %ERROR )
 except Exception as eee:
@@ -221,6 +221,6 @@ DESTROY_DIR = not DEBUG
 test_results(REP_DATA, TEST_NAME, DIRCASE, N_ITER_TEST_FILE, N_REP_TEST_FILE, DESTROY_DIR)
 #
 if salome.sg.hasDesktop():
-  salome.sg.updateObjBrowser(True)
+  salome.sg.updateObjBrowser()
   iparameters.getSession().restoreVisualState(1)
 
index c3d870c24dea815057f53d86caf5c6d39fe34f12..6a83c6f8e1bd60aa7dd1a724e63f6ce32907790f 100755 (executable)
@@ -78,7 +78,7 @@ IPAR.append("AP_MODULES_LIST", "Homard")
 #
 #========================================================================
 #========================================================================
-def geom_smesh_exec(theStudy):
+def geom_smesh_exec():
   """
 Python script for GEOM and SMESH
   """
@@ -86,7 +86,7 @@ Python script for GEOM and SMESH
 #
   while not error :
   #
-    geompy = geomBuilder.New(theStudy)
+    geompy = geomBuilder.New()
   #
   # Creation of the box
   # ===================
@@ -94,7 +94,7 @@ Python script for GEOM and SMESH
 
   # Creation of the mesh
   # ====================
-    smesh = smeshBuilder.New(theStudy)
+    smesh = smeshBuilder.New()
     box_m = smesh.Mesh(box_g)
     smesh.SetName(box_m.GetMesh(), 'MESH')
   #
@@ -127,10 +127,10 @@ Python script for GEOM and SMESH
   #
     try:
       ficmed = os.path.join(DIRCASE, 'maill.00.med')
-      box_m.ExportMED( ficmed, 0, SMESH.MED_V2_2, 1, None, 1)
+      box_m.ExportMED(ficmed)
     except Exception as eee:
       error = 2
-      raise Exception('ExportToMEDX() failed. '+eee.message)
+      raise Exception('ExportMED() failed. ' + str(eee))
   #
     break
   #
@@ -139,7 +139,7 @@ Python script for GEOM and SMESH
 #========================================================================
 #
 #========================================================================
-def field_exec(theStudy, niter):
+def field_exec(niter):
   """
 Python script for MEDCoupling
   """
@@ -185,7 +185,7 @@ Python script for MEDCoupling
 
 #========================================================================
 #========================================================================
-def homard_exec(theStudy):
+def homard_exec():
   """
 Python script for HOMARD
   """
@@ -193,7 +193,7 @@ Python script for HOMARD
 #
   while not error :
   #
-    HOMARD.SetCurrentStudy(theStudy)
+    HOMARD.UpdateStudy()
   #
   # Creation of the zones
   # =====================
@@ -218,7 +218,7 @@ Python script for HOMARD
     hypo_4_1.AddZone('Zone_4_1', 1)
     hypo_4_1.SetExtraOutput(2)
     laux = hypo_4_1.GetZones()
-    nbzone = len(laux)/2
+    nbzone = len(laux) // 2
     jaux = 0
     for iaux in range(nbzone) :
       print(hyponame_1, " : ", dico[laux[jaux+1]], "sur la zone", laux[jaux])
@@ -230,7 +230,7 @@ Python script for HOMARD
     hypo_4_2.AddZone('Zone_4_2', 1)
     hypo_4_2.SetExtraOutput(2)
     laux = hypo_4_2.GetZones()
-    nbzone = len(laux)/2
+    nbzone = len(laux) // 2
     jaux = 0
     for iaux in range(nbzone) :
       print(hyponame_2, " : ", dico[laux[jaux+1]], "sur la zone", laux[jaux])
@@ -290,7 +290,7 @@ Python script for HOMARD
 
   # Creation of the iteration 3
   #
-    error = field_exec(theStudy, 2)
+    error = field_exec(2)
     if error :
       error = 30
       break
@@ -317,11 +317,11 @@ Python script for HOMARD
 # Geometry and Mesh
 #
 try :
-  ERROR = geom_smesh_exec(salome.myStudy)
+  ERROR = geom_smesh_exec()
   if ERROR :
     raise Exception('Pb in geom_smesh_exec')
 except Exception as eee:
-  raise Exception('Pb in geom_smesh_exec: '+eee.message)
+  raise Exception('Pb in geom_smesh_exec: '+str(eee.message))
 
 HOMARD = salome.lcc.FindOrLoadComponent('FactoryServer', 'HOMARD')
 assert HOMARD is not None, "Impossible to load homard engine"
@@ -330,11 +330,11 @@ HOMARD.SetLanguageShort("fr")
 # Exec of HOMARD-SALOME
 #
 try :
-  ERROR = homard_exec(salome.myStudy)
+  ERROR = homard_exec()
   if ERROR :
     raise Exception('Pb in homard_exec at iteration %d' %ERROR )
 except Exception as eee:
-  raise Exception('Pb in homard_exec: '+eee.message)
+  raise Exception('Pb in homard_exec: '+str(eee.message))
 #
 # Test of the results
 #
@@ -343,6 +343,6 @@ DESTROY_DIR = not DEBUG
 test_results(REP_DATA, TEST_NAME, DIRCASE, N_ITER_TEST_FILE, N_REP_TEST_FILE, DESTROY_DIR)
 #
 if salome.sg.hasDesktop():
-  salome.sg.updateObjBrowser(True)
+  salome.sg.updateObjBrowser()
   iparameters.getSession().restoreVisualState(1)
 
index 1c131ce30f8228857cf7474aa2b32066b10d631a..439426c02ef8b994aa0f19c1aa8fd115cc1fc963 100755 (executable)
@@ -77,7 +77,7 @@ IPAR.append("AP_MODULES_LIST", "Homard")
 #
 #========================================================================
 #========================================================================
-def mesh_exec(theStudy):
+def mesh_exec():
   """
 Python script for MED
   """
@@ -169,7 +169,7 @@ Python script for MED
       meshMEDFile3D.write(ficmed, 2)
     except Exception as eee:
       error = 2
-      raise Exception('ExportToMEDX() failed. '+eee.message)
+      raise Exception('MEDFileUMesh.write() failed. ' + str(eee))
   #
     break
   #
@@ -178,7 +178,7 @@ Python script for MED
 #========================================================================
 #
 #========================================================================
-def field_exec(theStudy, niter):
+def field_exec(niter):
   """
 Python script for MEDCoupling
   """
@@ -233,7 +233,7 @@ Python script for MEDCoupling
 
 #========================================================================
 #========================================================================
-def homard_exec(theStudy):
+def homard_exec():
   """
 Python script for HOMARD
   """
@@ -241,7 +241,7 @@ Python script for HOMARD
 #
   while not error :
   #
-    HOMARD.SetCurrentStudy(theStudy)
+    HOMARD.UpdateStudy()
   #
   # Creation of the hypothese DISTANCE INVERSE
   # ==========================================
@@ -274,7 +274,7 @@ Python script for HOMARD
     #
     # Creation of the indicator
     #
-      error, ficmed_indic = field_exec(theStudy, niter)
+      error, ficmed_indic = field_exec(niter)
       if error :
         error = 10
         break
@@ -305,11 +305,11 @@ Python script for HOMARD
 # Geometry and Mesh
 #
 try :
-  ERROR = mesh_exec(salome.myStudy)
+  ERROR = mesh_exec()
   if ERROR :
     raise Exception('Pb in mesh_exec')
 except Exception as eee:
-  raise Exception('Pb in mesh_exec: '+eee.message)
+  raise Exception('Pb in mesh_exec: '+str(eee.message))
 
 HOMARD = salome.lcc.FindOrLoadComponent('FactoryServer', 'HOMARD')
 assert HOMARD is not None, "Impossible to load homard engine"
@@ -318,11 +318,11 @@ HOMARD.SetLanguageShort("fr")
 # Exec of HOMARD-SALOME
 #
 try :
-  ERROR = homard_exec(salome.myStudy)
+  ERROR = homard_exec()
   if ERROR :
     raise Exception('Pb in homard_exec at iteration %d' %ERROR )
 except Exception as eee:
-  raise Exception('Pb in homard_exec: '+eee.message)
+  raise Exception('Pb in homard_exec: '+str(eee.message))
 #
 # Test of the results
 #
@@ -331,6 +331,6 @@ DESTROY_DIR = not DEBUG
 test_results(REP_DATA, TEST_NAME, DIRCASE, N_ITER_TEST_FILE, N_REP_TEST_FILE, DESTROY_DIR)
 #
 if salome.sg.hasDesktop():
-  salome.sg.updateObjBrowser(True)
+  salome.sg.updateObjBrowser()
   iparameters.getSession().restoreVisualState(1)
 
index b227bd2aba1bf6729694a831689b040bdf2bb48f..96a3868a970a8658e09f62034a8548b047625ee0 100755 (executable)
@@ -69,12 +69,12 @@ IPAR.append("AP_MODULES_LIST", "Homard")
 #
 #========================================================================
 #========================================================================
-def homard_exec(theStudy):
+def homard_exec():
   """
 Python script for HOMARD
   """
   #
-  homard.SetCurrentStudy(theStudy)
+  homard.UpdateStudy()
   #
   # Hypotheses
   # ==========
@@ -120,7 +120,7 @@ homard.SetLanguageShort("fr")
 # Exec of HOMARD-SALOME
 #
 try :
-  ERROR = homard_exec(salome.myStudy)
+  ERROR = homard_exec()
   if ERROR :
     raise Exception('Pb in homard_exec at iteration %d' %ERROR )
 except Exception as eee:
@@ -137,6 +137,6 @@ gzip_gunzip(DATA_TUTORIAL, 1, 1)
 # ==================================
 #
 if salome.sg.hasDesktop():
-  salome.sg.updateObjBrowser(True)
+  salome.sg.updateObjBrowser()
   iparameters.getSession().restoreVisualState(1)
 
index ca731ac5cc17f648e40c370563e38bbf82f16817..585523c117eb64916232836df192a7e79fc2decc 100755 (executable)
@@ -69,12 +69,12 @@ IPAR.append("AP_MODULES_LIST", "Homard")
 #
 #========================================================================
 #========================================================================
-def homard_exec(theStudy):
+def homard_exec():
   """
 Python script for HOMARD
   """
   #
-  HOMARD.SetCurrentStudy(theStudy)
+  HOMARD.UpdateStudy()
   #
   # Creation des zones
   # ==================
@@ -131,7 +131,7 @@ HOMARD.SetLanguageShort("fr")
 # Exec of HOMARD-SALOME
 #
 try :
-  ERROR = homard_exec(salome.myStudy)
+  ERROR = homard_exec()
   if ERROR :
     raise Exception('Pb in homard_exec at iteration %d' %ERROR )
 except Exception as eee:
@@ -148,6 +148,6 @@ gzip_gunzip(DATA_TUTORIAL, 2, 1)
 # ==================================
 #
 if salome.sg.hasDesktop():
-  salome.sg.updateObjBrowser(True)
+  salome.sg.updateObjBrowser()
   iparameters.getSession().restoreVisualState(1)
 
index c4efe620b192392d47444b2cfc04920b0e372729..d9b843715087a5b55de52a002d80581f77c1da0e 100755 (executable)
@@ -69,12 +69,12 @@ IPAR.append("AP_MODULES_LIST", "Homard")
 #
 #========================================================================
 #========================================================================
-def homard_exec(theStudy):
+def homard_exec():
   """
 Python script for HOMARD
   """
   #
-  HOMARD.SetCurrentStudy(theStudy)
+  HOMARD.UpdateStudy()
   #
   # Hypothese "hypo_0vers1"
   # =======================
@@ -160,7 +160,7 @@ HOMARD.SetLanguageShort("fr")
 # Exec of HOMARD-SALOME
 #
 try :
-  ERROR = homard_exec(salome.myStudy)
+  ERROR = homard_exec()
   if ERROR :
     raise Exception('Pb in homard_exec at iteration %d' %ERROR )
 except Exception as eee:
@@ -177,6 +177,6 @@ gzip_gunzip(DATA_TUTORIAL, 3, 1)
 # ==================================
 #
 if salome.sg.hasDesktop():
-  salome.sg.updateObjBrowser(True)
+  salome.sg.updateObjBrowser()
   iparameters.getSession().restoreVisualState(1)
 
index 3816780d7a7463eebfc0ca1089817dd05869e22b..1853abe37ebe0de6ac537196adb8f553c9cc4a71 100755 (executable)
@@ -69,12 +69,12 @@ IPAR.append("AP_MODULES_LIST", "Homard")
 #
 #========================================================================
 #========================================================================
-def homard_exec(theStudy):
+def homard_exec():
   """
 Python script for HOMARD
   """
   #
-  HOMARD.SetCurrentStudy(theStudy)
+  HOMARD.UpdateStudy()
 #
   # Frontieres
   # ==========
@@ -147,7 +147,7 @@ HOMARD.SetLanguageShort("fr")
 # Exec of HOMARD-SALOME
 #
 try :
-  ERROR = homard_exec(salome.myStudy)
+  ERROR = homard_exec()
   if ERROR :
     raise Exception('Pb in homard_exec at iteration %d' %ERROR )
 except Exception as eee:
@@ -164,6 +164,6 @@ gzip_gunzip(DATA_TUTORIAL, 4, 1)
 # ==================================
 #
 if salome.sg.hasDesktop():
-  salome.sg.updateObjBrowser(True)
+  salome.sg.updateObjBrowser()
   iparameters.getSession().restoreVisualState(1)
 
index 1ffd27205d3d8ef20a3bc9ed840afc041e4e93eb..00234d92fb2d8ff8ef17af2d77a0a0b754ae903a 100755 (executable)
@@ -69,12 +69,12 @@ IPAR.append("AP_MODULES_LIST", "Homard")
 #
 #========================================================================
 #========================================================================
-def homard_exec(theStudy):
+def homard_exec():
   """
 Python script for HOMARD
   """
   #
-  HOMARD.SetCurrentStudy(theStudy)
+  HOMARD.UpdateStudy()
 #
   # Frontiere
   # =========
@@ -131,7 +131,7 @@ HOMARD.SetLanguageShort("fr")
 # Exec of HOMARD-SALOME
 #
 try :
-  ERROR = homard_exec(salome.myStudy)
+  ERROR = homard_exec()
   if ERROR :
     raise Exception('Pb in homard_exec at iteration %d' %ERROR )
 except Exception as eee:
@@ -148,6 +148,6 @@ gzip_gunzip(DATA_TUTORIAL, 5, 1)
 # ==================================
 #
 if salome.sg.hasDesktop():
-  salome.sg.updateObjBrowser(True)
+  salome.sg.updateObjBrowser()
   iparameters.getSession().restoreVisualState(1)