Salome HOME
Fix for Bug IPAL8945
[modules/visu.git] / src / VISU_SWIG / VISU_Example_02.py
index be71fa7693cf4df3af95ec39fb38da72b9e84dd1..38f2b6b6099ac26e04f76c6d81661222227bbe08 100644 (file)
@@ -222,28 +222,37 @@ file = str+'/VISU_005.hdf'
 
 salome.myStudyManager.SaveAs(file, salome.myStudy, 0)
 study_id = salome.myStudy._get_StudyId()
-#salome.sg.CloseStudy(study_id)
-#salome.myStudyManager.Close(salome.myStudy)
-#salome.myStudy.Close()
 print "OK"
 
-print "Opening just saved study..............",
+file_new = str+'/VISU_005_new.hdf'
+command = "mv " + file + " " + file_new
+os.system(command)
+file = file_new
 
-openedStudy = salome.myStudyManager.Open(file)
-myVisu.SetCurrentStudy(openedStudy)
+# Opening a study tempoparily commented due to a problem
+# with python initialization. To be restored after bug 10000 fixing.
+
+#print "Opening just saved study..............",
+#
+#openedStudy = salome.myStudyManager.Open(file)]
+openedStudy = salome.myStudy # temporarily
+#myVisu.SetCurrentStudy(openedStudy)
 myViewManager = myVisu.GetViewManager()
 myView1 = myViewManager.Create3DView()
 if myView1 is None : print "Error"
 else : print "OK"
 
+import time
+time.sleep(1)
+
 print "Restoring first view parameters.......",
 aRestoreRes = myView1.RestoreViewParams(aViewParamsName1)
 if aRestoreRes != 1 : print "Error"
 else : print "OK"
 
 Builder = openedStudy.NewBuilder()
-SCom = openedStudy.FindComponent("VISU")
-Builder.LoadWith(SCom ,myVisu)
+#SCom = openedStudy.FindComponent("VISU")
+#Builder.LoadWith(SCom ,myVisu)
 
 print "Displaying Scalar Map.................",
 SObj = openedStudy.FindObject('ScalarMap')
@@ -346,3 +355,6 @@ aRestoreRes = myView1.RestoreViewParams(aViewParamsName2)
 if aRestoreRes != 1 : print "Error"
 else : print "OK"
 
+# Remove the study file
+command = "rm -r " + file
+os.system(command)