Salome HOME
Update copyrights 2014.
[modules/paravis.git] / test / VisuPrs / 2D_viewer / A1.py
1 # Copyright (C) 2010-2014  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, or (at your option) any later version.
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 error = 0
29
30 aXYPlot.AxisUseCustomRange = [1, 1, 0, 0]
31 # Left axis range
32 axisRange = aXYPlot.LeftAxisRange
33 axisRange[0:2] = [200., 800.]
34 Ranges = aXYPlot.LeftAxisRange
35 Etvalue = [200, 800]
36 error = error + test_values(Ranges, Etvalue)
37 # Bottom axis range
38 axisRange = aXYPlot.BottomAxisRange
39 axisRange[0:2] = [350.,750.]
40 Ranges = aXYPlot.BottomAxisRange
41 Etvalue = [350, 750]
42 error = error + test_values(Ranges, Etvalue)
43 # Left and bottom axis range
44 aXYPlot.LeftAxisRange[0:2] = [1350.,2750.]
45 aXYPlot.BottomAxisRange[0:2] = [240.,2230.]
46 Etvalue=[1350.,2750.,240.,2230.]
47 Ranges=aXYPlot.LeftAxisRange
48 error = error + test_values(Ranges, Etvalue[0:2])
49 Ranges=aXYPlot.BottomAxisRange
50 error = error + test_values(Ranges, Etvalue[2:4])
51
52 try:
53     aXYPlot.ShowAxis = [1, 1, 1, 1]
54 except:
55     print "Error: ShowAxis property is not avaliable for XYPlotView"
56     error = error + 1
57
58 aXYPlot.AxisUseCustomRange = [1, 1, 1, 1]
59 # Left, bottom, right and top axis range
60 aXYPlot.LeftAxisRange = [0, 200]
61 aXYPlot.BottomAxisRange = [100, 450]
62 aXYPlot.RightAxisRange = [0, 200]
63 aXYPlot.TopAxisRange = [100, 450]
64 Etvalue = [0, 200, 100, 450, 0, 200, 100, 450]
65 Ranges=aXYPlot.LeftAxisRange
66 error = error + test_values(Ranges, Etvalue[0:2])
67 Ranges=aXYPlot.BottomAxisRange
68 error = error + test_values(Ranges, Etvalue[2:4])
69 Ranges=aXYPlot.RightAxisRange
70 error = error + test_values(Ranges, Etvalue[4:6])
71 Ranges=aXYPlot.TopAxisRange
72 error = error + test_values(Ranges, Etvalue[6:8])
73
74 if error > 0:
75     raise RuntimeError, "There is(are) some error(s) was(were) found... For more info see ERRORs above..."