Salome HOME
ExtractGroup is now a multiblock filter and not an unstructured like MEDReader. For...
[modules/paravis.git] / src / Plugins / MEDReader / Test / testMEDReader4.py
index 488a4e9b47418b2031c50646174a44fb2911b686..4b0541ed617458c7e75a4f9443ecfa647d1454bf 100644 (file)
@@ -1,10 +1,10 @@
 #  -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2014  CEA/DEN, EDF R&D
+# Copyright (C) 2007-2015  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
@@ -68,9 +68,9 @@ testMEDReader4_med=MEDReader(FileName=fname)
 testMEDReader4_med.AllArrays=['TS0/mesh/ComSup0/f0NoPfl@@][@@P1','TS0/mesh/ComSup0/mesh@@][@@P1']
 #testMEDReader4_med.AllTimeSteps=['0000']
 
-Glyph1=Glyph(GlyphType="Sphere",GlyphTransform="Transform2" )
+Glyph1=Glyph(Input=testMEDReader4_med,GlyphType='Sphere')
 Glyph1.Scalars=['POINTS','f0NoPfl']
-Glyph1.SetScaleFactor=0.3
+Glyph1.ScaleFactor=0.3
 Glyph1.Vectors=['POINTS', '']
 Glyph1.GlyphTransform="Transform2"
 
@@ -92,4 +92,20 @@ RenderView1.CameraFocalPoint = [0.8087292125440382, 1.3325993334207897, 0.0]
 RenderView1.CameraParallelScale = 3.712804729456109
 
 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, "testMEDReader4.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()