#
#
#
-# File : visu_view3d.py
+# File : batchmode_visu_view3d.py
# Module : VISU
-import visu_gui
import os
+import time
import VISU
import SALOMEDS
+from visu_gui import *
-from libSALOME_Swig import *
-sg = SALOMEGUI_Swig()
+aDelay = 1
-myVisu = visu_gui.myVisu
+#mySession = batchmode_visu.mySession
medFile = "fra.med"
myFieldName = "VITESSE";
-medFile = os.getenv('SALOME_ROOT_DIR') + '/data/' + medFile
+medFile = os.getenv('KERNEL_ROOT_DIR') + '/examples/' + medFile
myResult = myVisu.ImportFile(medFile)
+
aMeshName ="LE VOLUME"
anEntity = VISU.NODE
aMesh = myVisu.MeshOnEntity(myResult, aMeshName, anEntity)
aTimeStampId = 1
-#
aScalarMap = myVisu.ScalarMapOnField(myResult,aMeshName,anEntity,myFieldName,aTimeStampId)
-if aScalarMap is not None:
- aScalarMap.SetScaling(VISU.LOGARITHMIC)
-else:
- print "Null scalar map is created"
-#
aCutPlanes = myVisu.CutPlanesOnField(myResult,aMeshName,anEntity,myFieldName,aTimeStampId)
-if aCutPlanes is not None:
- aCutPlanes.SetScaling(VISU.LOGARITHMIC)
-else: print "Null aCutPlanes is created"
-#
aIsoSurfaces = myVisu.IsoSurfacesOnField(myResult, aMeshName, anEntity, myFieldName, aTimeStampId)
-if aIsoSurfaces is not None:
- aIsoSurfaces.SetScaling(VISU.LINEAR)
-else: print "Null aIsoSurfaces is created"
myViewManager = myVisu.GetViewManager();
-#myView = myViewManager.Create3DView();
-myView = myViewManager.GetCurrentView();
+
+#myView = myViewManager.GetCurrentView();
+myView = myViewManager.Create3DView();
+myView.SetTitle("The window will be soon destroyed!")
+print "myViewManager.Create3DView()"
+time.sleep(aDelay)
+
+myView.Maximize()
+print "myView.Maximize()"
+time.sleep(aDelay)
+
+myView.Restore()
+print "myView.Restore()"
+time.sleep(aDelay)
+
+myView.Minimize()
+print "myView.Minimize()"
+time.sleep(aDelay)
+
+myViewManager.Destroy(myView)
+print "myViewManager.Destroy(myView)"
+time.sleep(aDelay)
+
+myView = myViewManager.Create3DView();
+myView.SetTitle("The window will be set to 'AAA' view params")
+print "myViewManager.Create3DView()"
+time.sleep(aDelay)
+
+myView.Display(aScalarMap);
+print "myView.Display(aScalarMap)"
myView.SetFocalPoint([0,0,0]);
+print "myView.SetFocalPoint(...)"
+time.sleep(aDelay)
myView.SetParallelScale(2);
+print "myView.SetParallelScale(...)"
+time.sleep(aDelay)
+
aPoint = myView.GetPointOfView();
aPoint[0] = aPoint[0] + 10;
myView.SetPointOfView(aPoint);
+print "myView.SetPointOfView(...)"
myView.ScaleView(VISU.View3D.YAxis,10.0);
myView.ScaleView(VISU.View3D.XAxis,3.0);
+print "myView.ScaleView(...)"
+time.sleep(aDelay)
+
aColor = SALOMEDS.Color(0.0,0.3,1.0)
myView.SetBackground(aColor);
+print "myView.SetBackground(...)"
myView.Update();
-myView.Display(aScalarMap);
-#myView.Erase(aScalarMap);
-#myView.DisplayOnly(aCutPlanes);
+print "myView.Update()"
+time.sleep(aDelay)
+
+myView.FitAll();
+print "myView.FitAll()"
+time.sleep(aDelay)
+
+myView.Erase(aScalarMap);
+print "myView.Erase(aScalarMap)"
+time.sleep(aDelay)
+
+myView.DisplayOnly(aCutPlanes);
+print "myView.DisplayOnly(aCutPlanes)"
myView.SaveViewParams('AAA')
+print "myView.SaveViewParams('AAA')"
+time.sleep(aDelay)
+
+myView = myViewManager.Create3DView();
+myView.SetTitle("The window will be set to 'BBB' view params")
+print "myViewManager.Create3DView()"
+time.sleep(aDelay)
+
+myView.DisplayOnly(aIsoSurfaces);
+print "myView.DisplayOnly(aCutPlanes)"
+time.sleep(aDelay)
+myView.RestoreViewParams('AAA')
myView.RemoveScale();
-myView.FitAll();
+print "myView.RemoveScale()"
+time.sleep(aDelay)
+
aColor = SALOMEDS.Color(0.0,0.0,0.0)
myView.SetBackground(aColor);
+print "myView.SetBackground(...)"
myView.SaveViewParams('BBB');
+print "myView.SaveViewParams('BBB')"
+time.sleep(aDelay)
aColor = SALOMEDS.Color(1.0,1.0,1.0)
myView.SetBackground(aColor);
+print "myView.SetBackground(...)"
+time.sleep(aDelay)
+
myView.ScaleView(VISU.View3D.ZAxis,0.5);
+print "myView.SetBackground(...)"
myView.SaveViewParams('CCC');
+print "myView.SaveViewParams('CCC')"
+time.sleep(aDelay)
-myView.RestoreViewParams('AAA');
-
-sg.updateObjBrowser(0)
-
-
-
+myView.RestoreViewParams('BBB');
+print "myView.RestoreViewParams('BBB')"