Salome HOME
17fc4c806872b712e5ef3291f58c689a633ce703
[modules/paravis.git] / test / VisuPrs / 2D_viewer / A1.py
1 # Copyright (C) 2010-2012  CEA/DEN, EDF R&D
2 #
3 # This library is free software; you can redistribute it and/or
4 # modify it under the terms of the GNU Lesser General Public
5 # License as published by the Free Software Foundation; either
6 # version 2.1 of the License.
7 #
8 # This library is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11 # Lesser General Public License for more details.
12 #
13 # You should have received a copy of the GNU Lesser General Public
14 # License along with this library; if not, write to the Free Software
15 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
16 #
17 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 #
19
20 # This case corresponds to: /visu/2D_viewer/A1 case
21
22 from paravistest import test_values
23 from pvsimple import CreateXYPlotView
24
25 # Create view
26 aXYPlot = CreateXYPlotView()
27
28 # Set range
29 axisRange = aXYPlot.AxisRange
30 # Left axis range
31 axisRange[0:2] = [200., 800.]
32 Ranges = aXYPlot.AxisRange
33 Etvalue = [200, 800, axisRange[2], axisRange[3],
34            axisRange[4], axisRange[5], axisRange[6], axisRange[7] ]
35 error = test_values(Ranges, Etvalue)
36 # Bottom axis range
37 aXYPlot.AxisRange[2:4] = [350.,750.]
38 Ranges = aXYPlot.AxisRange
39 Etvalue = [200, 800, 350, 750,
40            axisRange[4], axisRange[5], axisRange[6], axisRange[7]]
41 error = error + test_values(Ranges, Etvalue)
42 # Left and bottom axis range
43 aXYPlot.AxisRange[0:4] = [1350.,2750.,240.,2230.]
44 Ranges=aXYPlot.AxisRange
45 Etvalue=[1350.,2750.,240.,2230.,
46          axisRange[4], axisRange[5], axisRange[6], axisRange[7]]
47 error = error + test_values(Ranges, Etvalue)
48 # Left, bottom, right and top axis range
49 aXYPlot.AxisRange = [0, 200, 100, 450, 0, 200, 100, 450]
50 Ranges = aXYPlot.AxisRange
51 Etvalue = [0, 200, 100, 450, 0, 200, 100, 450]
52 error = error + test_values(Ranges, Etvalue)
53
54 if error > 0:
55     raise RuntimeError, "There is(are) some error(s) was(were) found... For more info see ERRORs above..."