# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2014 CEA/DEN, EDF R&D
+# Copyright (C) 2007-2017 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
################### MED write is done -> Go to MEDReader
from paraview.simple import *
-
myMedReader=MEDReader(FileName=fname)
myMedReader.AllArrays = ['TS0/mesh/ComSup0/fNode@@][@@P1']
assert(list(myMedReader.TimestepValues)==[0.,1.,2.,3.])
RenderView1.CameraPosition = [1.5, 1.5, 10000.0]
RenderView1.InteractionMode = '3D'
RenderView1.CameraPosition = [1.5, 1.5, 8.196152422706632]
-RenderView1.CameraClippingRange = [7.825640906782493, 8.682319698595558]
RenderView1.CameraParallelScale = 2.1213203435596424
RenderView1.CenterOfRotation = [1.5, 1.5, 0.0]
RenderView1.CacheKey = 1.0
RenderView1.UseCache = 1
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, "testMEDReader7.png")
+import vtk.test.Testing
+vtk.test.Testing.VTK_TEMP_DIR = vtk.util.misc.vtkGetTempDir()
+vtk.test.Testing.compareImage(GetActiveView().GetRenderWindow(), baseline_file,
+ threshold=6)
+vtk.test.Testing.interact()