Salome HOME
Copyright update: 2016
[modules/paravis.git] / test / VisuPrs / 2D_viewer / A1.py
1 # Copyright (C) 2010-2016  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 *
23 from presentations import *
24 from pvsimple import *
25
26 # Create view
27 aXYPlot = CreateXYPlotView()
28 Render(aXYPlot)
29
30 error = 0
31
32 # Apply custom axes range
33 Etvalue = (1, 1, 1, 1)
34 aXYPlot.LeftAxisUseCustomRange, aXYPlot.BottomAxisUseCustomRange, aXYPlot.RightAxisUseCustomRange, aXYPlot.TopAxisUseCustomRange = 1, 1, 1, 1
35 Ranges = aXYPlot.LeftAxisUseCustomRange, aXYPlot.BottomAxisUseCustomRange, aXYPlot.RightAxisUseCustomRange, aXYPlot.TopAxisUseCustomRange
36 error = error + test_values(Ranges, Etvalue)
37
38 # Set custom axes range
39 aXYPlot.LeftAxisUseCustomRange = 1
40 aXYPlot.BottomAxisUseCustomRange = 1
41
42 # Left axis range
43 Etvalue = (200., 800.)
44 aXYPlot.LeftAxisRangeMinimum, aXYPlot.LeftAxisRangeMaximum = Etvalue
45 Ranges = aXYPlot.LeftAxisRangeMinimum, aXYPlot.LeftAxisRangeMaximum
46 error = error + test_values(Ranges, Etvalue)
47
48 # Bottom axis range
49 Etvalue = (350., 750.)
50 aXYPlot.BottomAxisRangeMinimum, aXYPlot.BottomAxisRangeMaximum = Etvalue
51 Ranges = aXYPlot.BottomAxisRangeMinimum, aXYPlot.BottomAxisRangeMaximum
52 error = error + test_values(Ranges, Etvalue)
53
54 # Right axis range
55 Etvalue = (0., 300.)
56 aXYPlot.RightAxisRangeMinimum, aXYPlot.RightAxisRangeMaximum = Etvalue
57 Ranges = aXYPlot.RightAxisRangeMinimum, aXYPlot.RightAxisRangeMaximum
58 error = error + test_values(Ranges, Etvalue)
59
60 # Top axis range
61 Etvalue = (100., 450.)
62 aXYPlot.TopAxisRangeMinimum, aXYPlot.TopAxisRangeMaximum = Etvalue
63 Ranges = aXYPlot.TopAxisRangeMinimum, aXYPlot.TopAxisRangeMaximum
64 error = error + test_values(Ranges, Etvalue)
65
66 if error > 0:
67     raise RuntimeError, "There is(are) some error(s) was(were) found... For more info see ERRORs above..."