+# VISU VISU_SWIG : binding of C++ implementation and Python
+#
+# Copyright (C) 2003 CEA/DEN, EDF R&D
+#
+#
+#
+# File : visu_view3d.py
+# Module : VISU
+
+import visu_gui
import os
-import salome
-from VISU import *
+import VISU
import SALOMEDS
+
from libSALOME_Swig import *
sg = SALOMEGUI_Swig()
-myVisu = salome.lcc.FindOrLoadComponent("FactoryServer", "VISU")
+myVisu = visu_gui.myVisu
+
+medFile = "fra.med"
+myFieldName = "VITESSE";
-#medFile = "fra.med"
-#myFieldName = "VITESSE";
+medFile = os.getenv('SALOME_ROOT_DIR') + '/data/' + medFile
+myResult = myVisu.ImportFile(medFile)
-medFile = "minimail.dat"
-myFieldName = "Pressures";
+aMeshName ="LE VOLUME"
+anEntity = VISU.NODE
+aMesh = myVisu.MeshOnEntity(myResult, aMeshName, anEntity)
-medFile = "brideResultats.dat"
-myFieldName = "VM_Elem.";
+aTimeStampId = 1
-medFile = os.getenv('SALOME_ROOT_DIR') + '/../SALOME_ROOT/data/' + medFile
-myResult = myVisu.ImportFile(medFile)
+#
+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"
-aMesh = myVisu.CreateMesh(myResult);
-aScalarMap = myVisu.CreateScalarMap(myResult,myFieldName,0)
-aScalarMap.SetScaling(LOGARITHMIC)
-aCutPlanes = myVisu.CreateCutPlanes(myResult,myFieldName,0)
-aCutPlanes.SetScaling(LOGARITHMIC)
-aIsoSurfaces = myVisu.CreateIsoSurfaces(myResult,myFieldName,0)
-aIsoSurfaces.SetScaling(LINEAR)
+#
+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.GetCurrent3DView();
+myView = myViewManager.GetCurrentView();
myView.SetFocalPoint([0,0,0]);
myView.SetParallelScale(2);
aPoint = myView.GetPointOfView();
aPoint[0] = aPoint[0] + 10;
myView.SetPointOfView(aPoint);
-myView.ScaleView(View3D.YAxis,10.0);
-myView.ScaleView(View3D.XAxis,3.0);
+myView.ScaleView(VISU.View3D.YAxis,10.0);
+myView.ScaleView(VISU.View3D.XAxis,3.0);
aColor = SALOMEDS.Color(0.0,0.3,1.0)
myView.SetBackground(aColor);
myView.Update();
aColor = SALOMEDS.Color(1.0,1.0,1.0)
myView.SetBackground(aColor);
-myView.ScaleView(View3D.ZAxis,0.5);
+myView.ScaleView(VISU.View3D.ZAxis,0.5);
myView.SaveViewParams('CCC');
myView.RestoreViewParams('AAA');