From: dmv Date: Mon, 21 Dec 2009 14:30:47 +0000 (+0000) Subject: 0020623: EDF 1209 SMESH: Load script/execfile add the objects in the wrong study X-Git-Tag: V5_1_main_20091223 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=bdad154dcf0220d9a8cdc7a33c3da39c302133b6;p=modules%2Fvisu.git 0020623: EDF 1209 SMESH: Load script/execfile add the objects in the wrong study --- diff --git a/src/VISU_SWIG/VISU_Example_03.py b/src/VISU_SWIG/VISU_Example_03.py index 0b9c878c..dd9c9bf7 100644 --- a/src/VISU_SWIG/VISU_Example_03.py +++ b/src/VISU_SWIG/VISU_Example_03.py @@ -34,6 +34,7 @@ medFile = os.getenv("DATA_DIR") + "/MedFiles/TimeStamps.med" print 'Importing "TimeStamps.med"................', myVisu = visu_gui.myVisu +myVisu.SetCurrentStudy(salome.myStudy) myResult = myVisu.ImportFile(medFile) if myResult is None : print "Error" else : print "OK" diff --git a/src/VISU_SWIG/VISU_Example_04.py b/src/VISU_SWIG/VISU_Example_04.py index 9daefdb2..66fa11f5 100644 --- a/src/VISU_SWIG/VISU_Example_04.py +++ b/src/VISU_SWIG/VISU_Example_04.py @@ -35,6 +35,8 @@ from visu_gui import * aDelay = 1 +myVisu.SetCurrentStudy(salome.myStudy) + myViewManager = myVisu.GetViewManager(); myView = myViewManager.Create3DView(); diff --git a/src/VISU_SWIG/batchmode_visu.py b/src/VISU_SWIG/batchmode_visu.py index c4df1281..dc7e8e3d 100644 --- a/src/VISU_SWIG/batchmode_visu.py +++ b/src/VISU_SWIG/batchmode_visu.py @@ -25,12 +25,15 @@ # Module : VISU # from batchmode_salome import * +import salome import visu myVisu = visu.Initialize(orb,naming_service,lcc,myStudyManager,myStudy,10) if myVisu is None: raise RuntimeError, "myVisu is none, VISU component is not loaded or found" - + +myVisu.SetCurrentStudy(salome.myStudy) + def try_mesh_parameters(theMeshPattern): aResult = [] if theMeshPattern is None : return aResult ; diff --git a/src/VISU_SWIG/batchmode_visu_view.py b/src/VISU_SWIG/batchmode_visu_view.py index 1f675398..2334bd74 100644 --- a/src/VISU_SWIG/batchmode_visu_view.py +++ b/src/VISU_SWIG/batchmode_visu_view.py @@ -28,6 +28,8 @@ from VISU import * from batchmode_visu_table import * +myVisu.SetCurrentStudy(salome.myStudy) + myViewMan = myVisu.GetViewManager() myTable = myViewMan.CreateTableView(myVisuTableReal) diff --git a/src/VISU_SWIG/batchmode_visu_view3d.py b/src/VISU_SWIG/batchmode_visu_view3d.py index e07c4acc..28a71342 100644 --- a/src/VISU_SWIG/batchmode_visu_view3d.py +++ b/src/VISU_SWIG/batchmode_visu_view3d.py @@ -35,6 +35,8 @@ aDelay = 0 #mySession = batchmode_visu.mySession +myVisu.SetCurrentStudy(salome.myStudy) + myViewManager = myVisu.GetViewManager(); myView = myViewManager.Create3DView(); diff --git a/src/VISU_SWIG/visu_apply_properties.py b/src/VISU_SWIG/visu_apply_properties.py index cadd2006..17bd33f3 100644 --- a/src/VISU_SWIG/visu_apply_properties.py +++ b/src/VISU_SWIG/visu_apply_properties.py @@ -33,6 +33,8 @@ from visu_gui import * aDelay = 0 +myVisu.SetCurrentStudy(salome.myStudy) + myViewManager = myVisu.GetViewManager(); myView = myViewManager.Create3DView(); diff --git a/src/VISU_SWIG/visu_apply_properties_successive.py b/src/VISU_SWIG/visu_apply_properties_successive.py index ee02ca61..d01b63ef 100644 --- a/src/VISU_SWIG/visu_apply_properties_successive.py +++ b/src/VISU_SWIG/visu_apply_properties_successive.py @@ -33,6 +33,8 @@ from visu_gui import * aDelay = 0 +myVisu.SetCurrentStudy(salome.myStudy) + myViewManager = myVisu.GetViewManager(); myView = myViewManager.Create3DView(); diff --git a/src/VISU_SWIG/visu_delete.py b/src/VISU_SWIG/visu_delete.py index ac996c3a..bf1d9905 100644 --- a/src/VISU_SWIG/visu_delete.py +++ b/src/VISU_SWIG/visu_delete.py @@ -24,6 +24,7 @@ import VISU import SALOMEDS from visu_gui import * +myVisu.SetCurrentStudy(salome.myStudy) myViewManager = myVisu.GetViewManager(); myView = myViewManager.Create3DView(); diff --git a/src/VISU_SWIG/visu_evolution.py b/src/VISU_SWIG/visu_evolution.py index cf17eeef..bd78885b 100755 --- a/src/VISU_SWIG/visu_evolution.py +++ b/src/VISU_SWIG/visu_evolution.py @@ -28,6 +28,7 @@ import os import VISU from visu_gui import * +myVisu.SetCurrentStudy(salome.myStudy) myViewManager = myVisu.GetViewManager(); myView = myViewManager.CreateXYPlot(); diff --git a/src/VISU_SWIG/visu_med.py b/src/VISU_SWIG/visu_med.py index 77282a6d..c3b26e3f 100644 --- a/src/VISU_SWIG/visu_med.py +++ b/src/VISU_SWIG/visu_med.py @@ -73,6 +73,7 @@ def importMed(medFile): #med_obj = getMedObjectFromStudy() myVisu = salome.lcc.FindOrLoadComponent("FactoryServer", "VISU") +myVisu.SetCurrentStudy(salome.myStudy) print "Use importMed(medFile) or importMedFrom(medDir,medFile) functions !" #myField = getFieldObjectFromStudy(2,1) diff --git a/src/VISU_SWIG/visu_pointmap3d.py b/src/VISU_SWIG/visu_pointmap3d.py index 171b5ced..0c97e6ab 100755 --- a/src/VISU_SWIG/visu_pointmap3d.py +++ b/src/VISU_SWIG/visu_pointmap3d.py @@ -24,6 +24,8 @@ import os import VISU from visu_gui import * +myVisu.SetCurrentStudy(salome.myStudy) + aTableFile = os.getenv('DATA_DIR') + '/Tables/table_test.xls' aTableSObject = myVisu.ImportTables(aTableFile) diff --git a/src/VISU_SWIG/visu_prs_example.py b/src/VISU_SWIG/visu_prs_example.py index 7ec93a76..bbcc2d32 100644 --- a/src/VISU_SWIG/visu_prs_example.py +++ b/src/VISU_SWIG/visu_prs_example.py @@ -38,6 +38,8 @@ if salome.hasDesktop(): import visu_gui myVisu = visu_gui.myVisu +myVisu.SetCurrentStudy(salome.myStudy) + medFile = "pointe.med" medFile = os.getenv('DATA_DIR') + '/MedFiles/' + medFile print medFile diff --git a/src/VISU_SWIG/visu_split_views.py b/src/VISU_SWIG/visu_split_views.py index 6101c99e..b86a7c24 100644 --- a/src/VISU_SWIG/visu_split_views.py +++ b/src/VISU_SWIG/visu_split_views.py @@ -27,6 +27,8 @@ from time import sleep DELAY = 2 +myVisu.SetCurrentStudy(salome.myStudy) + myViewManager = myVisu.GetViewManager() ################################################ diff --git a/src/VISU_SWIG/visu_succcessive_animation.py b/src/VISU_SWIG/visu_succcessive_animation.py index 950386bf..b046b9d4 100644 --- a/src/VISU_SWIG/visu_succcessive_animation.py +++ b/src/VISU_SWIG/visu_succcessive_animation.py @@ -33,6 +33,8 @@ from visu_gui import * aDelay = 0 +myVisu.SetCurrentStudy(salome.myStudy) + myViewManager = myVisu.GetViewManager(); myView = myViewManager.Create3DView(); diff --git a/src/VISU_SWIG/visu_view.py b/src/VISU_SWIG/visu_view.py index f191637d..3287ed13 100644 --- a/src/VISU_SWIG/visu_view.py +++ b/src/VISU_SWIG/visu_view.py @@ -34,6 +34,8 @@ from VISU import * from visu_table import * +myVisu.SetCurrentStudy(salome.myStudy) + myViewMan = myVisu.GetViewManager() myTable = myViewMan.CreateTableView(myVisuTableReal) diff --git a/src/VISU_SWIG/visu_view3d.py b/src/VISU_SWIG/visu_view3d.py index f22d176c..26691712 100644 --- a/src/VISU_SWIG/visu_view3d.py +++ b/src/VISU_SWIG/visu_view3d.py @@ -35,6 +35,8 @@ aDelay = 0 #mySession = batchmode_visu.mySession +myVisu.SetCurrentStudy(salome.myStudy) + myViewManager = myVisu.GetViewManager(); myView = myViewManager.Create3DView(); diff --git a/src/VISU_SWIG/visu_view3d_parameters.py b/src/VISU_SWIG/visu_view3d_parameters.py index 2399f3d2..2d769b7e 100755 --- a/src/VISU_SWIG/visu_view3d_parameters.py +++ b/src/VISU_SWIG/visu_view3d_parameters.py @@ -36,6 +36,7 @@ medFile = os.getenv("DATA_DIR") + "/MedFiles/fra.med" #%====================Stage1: Creating a study====================% print "Creating a new study... " +myVisu.SetCurrentStudy(salome.myStudy) myVisu = visu_gui.myVisu myVisu.SetCurrentStudy(salome.myStudy)