X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FPlugins%2FMEDReader%2FTest%2FtestMEDReader15.py;h=a68d7010a33c8128526ab600c0cd76ce9d97cec5;hb=83e68ef1b0f94647b24e0774aa2db40e8233a225;hp=3adc65ea56411fcc48bc41d0a12b062be3bbc4d1;hpb=216b73d56a11d0b5f0ef26acfd85936f92c5f8ac;p=modules%2Fparavis.git diff --git a/src/Plugins/MEDReader/Test/testMEDReader15.py b/src/Plugins/MEDReader/Test/testMEDReader15.py index 3adc65ea..a68d7010 100644 --- a/src/Plugins/MEDReader/Test/testMEDReader15.py +++ b/src/Plugins/MEDReader/Test/testMEDReader15.py @@ -1,5 +1,5 @@ # -*- coding: iso-8859-1 -*- -# Copyright (C) 2007-2015 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 @@ -38,7 +38,7 @@ f.setName(zeName) f.setArray(DataArrayDouble([(-1.,1.,0.),(0.,1.,0.),(1.,1.,0.)])) tmp=MEDCouplingUMesh.Build0DMeshFromCoords(m.getCoords()) ; tmp.setName(zeName) f.setMesh(tmp) -MEDLoader.WriteFieldUsingAlreadyWrittenMesh(fname,f) +WriteFieldUsingAlreadyWrittenMesh(fname,f) # from paraview.simple import * @@ -48,7 +48,6 @@ reader=MEDReader(FileName=fname) ExpectedEntries=['TS0/zeName/ComSup0/zeName@@][@@P1','TS0/zeName/ComSup0/MESH@zeName@@][@@P1'] assert(reader.GetProperty("FieldsTreeInfo")[::2]==ExpectedEntries) - # glyph1=Glyph(Input=reader,GlyphType='Arrow',Scalars='FamilyIdNode',Vectors='zeName',GlyphMode='All Points',ScaleFactor=0.1,GlyphTransform='Transform2') @@ -62,13 +61,6 @@ zeNameLUT.VectorMode = 'Component' glyph1Display=Show(glyph1,renderView1) glyph1Display.ColorArrayName = ['POINTS', 'FamilyIdNode'] glyph1Display.LookupTable = zeNameLUT -glyph1Display.OpacityArray = [None, ''] -glyph1Display.RadiusArray = [None, ''] -glyph1Display.RadiusRange = [-0.0707106813788414, 1.0099999904632568] -glyph1Display.ConstantRadius = 1.0099999904632568 -glyph1Display.PointSpriteDefaultsInitialized = 1 -glyph1Display.SelectInputVectors = ['POINTS', 'GlyphVector'] -glyph1Display.WriteLog = '' # show color bar/color legend glyph1Display.SetScalarBarVisibility(renderView1, True) # set scalar coloring @@ -78,5 +70,22 @@ glyph1Display.RescaleTransferFunctionToDataRange(True) # show color bar/color legend glyph1Display.SetScalarBarVisibility(renderView1, True) # +renderView1.ViewSize =[300,300] +renderView1.GetRenderWindow().DoubleBufferOff() Render() -WriteImage(outImgName) + +# 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, "testMEDReader15.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()