X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FPlugins%2FMEDReader%2FTest%2FtestMEDReader5.py;h=0248a1c710f10b2b696bde096811f00d68ba9df0;hb=0bf9fea22904ebe22b3c4ef1acffb262d9a85265;hp=9fbf6eb9b49d5684536f8402519262275e31f4af;hpb=d170abf6cb7fa44827057ce004760d1ef45d9f2d;p=modules%2Fparavis.git diff --git a/src/Plugins/MEDReader/Test/testMEDReader5.py b/src/Plugins/MEDReader/Test/testMEDReader5.py index 9fbf6eb9..0248a1c7 100644 --- a/src/Plugins/MEDReader/Test/testMEDReader5.py +++ b/src/Plugins/MEDReader/Test/testMEDReader5.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 @@ -32,7 +32,7 @@ arr=DataArrayDouble(5) ; arr.iota() c=MEDCouplingCMesh("mesh") c.setCoords(arr,arr,arr) m=c.buildUnstructured() -mbis=m.deepCpy() ; mbis.translate([5,0,0]) ; mbis.tetrahedrize(PLANAR_FACE_5) +mbis=m.deepCopy() ; mbis.translate([5,0,0]) ; mbis.tetrahedrize(PLANAR_FACE_5) m=MEDCouplingUMesh.MergeUMeshes([mbis,m]) ; m.setName(c.getName()) mm=MEDFileUMesh() mm.setMeshAtLevel(0,m) @@ -78,8 +78,7 @@ myMedReader=MEDReader(FileName=fname) myMedReader.AllArrays = ['TS0/mesh/ComSup1/fNode@@][@@P1'] myMedReader.AllTimeSteps = ['0000'] -Clip1=Clip(ClipType="Plane") -Clip1.Input=myMedReader +Clip1=Clip(ClipType="Plane",Input=myMedReader) Clip1.Scalars = ['POINTS', 'FamilyIdNode'] Clip1.ClipType.Origin = [2.0, 2.0, 2.0] Clip1.ClipType = "Plane" @@ -96,7 +95,6 @@ RenderView1=GetRenderView() RenderView1.CenterOfRotation=[2.,2.,2.] RenderView1.CameraViewUp=[0.24562884954787187,0.6907950752417243,-0.680050463047831] RenderView1.CameraPosition=[-2.5085697461776486,11.6185941755061,10.14210560568201] -RenderView1.CameraClippingRange=[5.269050059274764,23.64024625330183] RenderView1.CameraFocalPoint=[2.,2.,2.] RenderView1.CameraParallelScale=5.071791174723188 @@ -106,10 +104,24 @@ DataRepresentation2.EdgeColor = [0.0, 0.0, 0.5000076295109483] DataRepresentation2.ScalarOpacityUnitDistance = 1.5768745057161244 DataRepresentation2.ExtractedBlockIndex = 1 DataRepresentation2.ScaleFactor = 0.4 -DataRepresentation2.ColorArrayName='fNode' +DataRepresentation2.ColorArrayName=('POINTS','fNode') DataRepresentation2.LookupTable=LookupTable -DataRepresentation2.ColorAttributeType='POINT_DATA' - RenderView1.ViewSize=[300,300] -WriteImage(outImgName) +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, "testMEDReader5.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()