From: rnv Date: Wed, 16 Aug 2017 12:18:06 +0000 (+0300) Subject: Fix for '23471: [CEA 2162] Upgrade of the test salome_test.py' issue. X-Git-Tag: V8_4_0a1^0 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=0860ce56d332c54a9d56a585045f683e6f7fee8a;p=modules%2Fkernel.git Fix for '23471: [CEA 2162] Upgrade of the test salome_test.py' issue. --- diff --git a/src/KERNEL_PY/salome_test.py b/src/KERNEL_PY/salome_test.py index e0bdd983f..13f46c1b8 100755 --- a/src/KERNEL_PY/salome_test.py +++ b/src/KERNEL_PY/salome_test.py @@ -352,12 +352,9 @@ print "======================================================================" if salome.hasDesktop(): # in gui mode print "**** Importing pvserver... It can take some time." - from presentations import * import pvserver import pvsimple - my_paravis = pvserver.myPVServerService - #====================Stage1: Importing MED file==================== print "**** Stage1: Importing MED file" @@ -373,75 +370,34 @@ if salome.hasDesktop(): # in gui mode else: print "OK" - cell_entity = EntityType.CELL - node_entity = EntityType.NODE - - #====================Stage2: Displaying vector field=============== + #====================Stage2: Displaying presentation=============== - print "**** Stage3: Displaying vector field" + print "**** Stage2: Displaying presentation" print 'Get view...................', view = pvsimple.GetRenderView() if view is None: print "FAILED" else: - reset_view(view) print "OK" - print "Creating Scalar Map.......", - scalarmap = ScalarMapOnField(med_reader, node_entity, 'vitesse', 2) - if scalarmap is None: + print "Creating presentation.......", + prs = pvsimple.GetRepresentation(med_reader) + if prs is None: print "FAILED" else: - bar = get_bar() - bar.Orientation = 'Horizontal' - bar.Position = [0.1, 0.1] - bar.Position2 = [0.1, 0.25] - bar.AspectRatio = 3 + rep_list = view.Representations + for rep in rep_list: + if hasattr(rep, 'Visibility'): + rep.Visibility = (rep == prs) + pvsimple.Render(view=view) - display_only(scalarmap, view) - print "OK" - - view.ResetCamera() - - print "Creating Vectors..........", - vectors = VectorsOnField(med_reader, node_entity, 'vitesse', 2) - if vectors is None: - print "FAILED" - else: - display_only(vectors, view) - print "OK" - - print "Creating Iso Surfaces.....", - isosurfaces = IsoSurfacesOnField(med_reader, node_entity, 'vitesse', 2) - if isosurfaces is None: - print "FAILED" - else: - display_only(isosurfaces, view) - print "OK" - - print "Creating Cut Planes.......", - cutplanes = CutPlanesOnField(med_reader, node_entity, 'vitesse', 2, - nb_planes=30, orientation=Orientation.YZ) - if cutplanes is None: - print "FAILED" - else: - display_only(cutplanes, view) + # ---- surface representation + prs.SetRepresentationType('Surface') + view.ResetCamera() + print "OK" - print "Creating Scalar Map On Deformed Shape.......", - scalarmapondefshape = DeformedShapeAndScalarMapOnField(med_reader, - node_entity, - 'vitesse', 2, - None, - cell_entity, - 'pression') - if scalarmapondefshape is None: - print "FAILED" - else: - display_only(scalarmapondefshape, view) - print "OK" - else: # not in gui mode, Paravis can not be tested print