# Module : VISU
import os
-import batchmode_visu
+import time
import VISU
import SALOMEDS
+from batchmode_visu import *
+
+aDelay = 1
#mySession = batchmode_visu.mySession
-myVisu = batchmode_visu.myVisu
medFile = "fra.med"
myFieldName = "VITESSE";
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.Minimize()
+print "myView.Minimize()"
+time.sleep(aDelay)
+
+myView.Maximize()
+print "myView.Maximize()"
+time.sleep(aDelay)
+
+myView.Restore()
+print "myView.Restore()"
+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');
+print "myView.RestoreViewParams('AAA')"