X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FPlugins%2FMEDReader%2FTest%2FtestMEDReader3.py;h=f6fd880dd861142ca2bbbb824dd72338b2631b5e;hb=aca1d12b1c75afad8ed53308b3c4a7d6cc826a79;hp=fea2e7bab47e4e560f6a75eb21216ed21af81a91;hpb=9dbade0021c7a8e21aedcfb28be257886abed924;p=modules%2Fparavis.git diff --git a/src/Plugins/MEDReader/Test/testMEDReader3.py b/src/Plugins/MEDReader/Test/testMEDReader3.py index fea2e7ba..f6fd880d 100644 --- a/src/Plugins/MEDReader/Test/testMEDReader3.py +++ b/src/Plugins/MEDReader/Test/testMEDReader3.py @@ -1,10 +1,10 @@ # -*- coding: iso-8859-1 -*- -# Copyright (C) 2007-2014 CEA/DEN, EDF R&D +# Copyright (C) 2007-2016 CEA/DEN, EDF R&D # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either -# version 2.1 of the License. +# version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -96,7 +96,6 @@ assert(list(testMEDReader3.TimestepValues)==[1.,2.,3.,4.,5.]) ## <- the test is RenderView1=GetRenderView() RenderView1.ViewTime=3.0 RenderView1.CameraPosition=[0.5,0.5,5.7320508075688776] -RenderView1.CameraClippingRange=[2.704730299493189,2.7730315696824106] RenderView1.ViewSize=[300,300] DataRepresentation2=Show() @@ -115,7 +114,30 @@ a1_ANodeField_PVLookupTable.ScalarOpacityFunction=a1_ANodeField_PiecewiseFunctio DataRepresentation2.ScalarOpacityFunction=a1_ANodeField_PiecewiseFunction DataRepresentation2.ColorArrayName='ANodeField' DataRepresentation2.LookupTable=a1_ANodeField_PVLookupTable -### -WriteImage(outImgName) +# Triangulate so rendring always the same with different gpu or graphic backend. +extSurf = ExtractSurface(Input=testMEDReader3) +triangulate = Triangulate(Input=extSurf) +Hide(testMEDReader3, RenderView1) +Show(triangulate, RenderView1) +triangulate1Display = GetDisplayProperties(triangulate, view=RenderView1) +ColorBy(triangulate1Display, ('POINTS', 'ANodeField')) + +Render() +### +# compare with baseline image +import os +import sys +try: + baselineIndex = sys.argv.index('-B')+1 + baselinePath = sys.argv[baselineIndex] +except: + print "Could not get baseline directory. Test failed." + exit(1) +baseline_file = os.path.join(baselinePath, "testMEDReader3.png") +import vtk.test.Testing +vtk.test.Testing.VTK_TEMP_DIR = vtk.util.misc.vtkGetTempDir() +vtk.test.Testing.compareImage(GetActiveView().GetRenderWindow(), baseline_file, + threshold=25) +vtk.test.Testing.interact()