Salome HOME
Fix tests 532 boolean_001,2,3 construction_001 extrusion_001,2,3,4,6 partition_001...
[modules/shaper.git] / test.squish / suite_ISSUES_SALOME / tst_532 / test.py
1 def sketch_circle():
2     circle_create((0, 0), 300)
3
4 def sketch_lines():
5     clickButton(waitForObject(":SALOME*.Line_QToolButton"))
6     points = [(647, 441), (419, 214), (725, 140), (578, 243), (647, 441)]
7     for point in points:
8         mouseClick(waitForObject(":SALOME*.3D View Operations_OCCViewer_ViewPort3d"), point[0], point[1], 0, Qt.LeftButton)
9
10 def main():
11     source(findFile("scripts", "common.py"))
12     
13     startApplication("salome_run.sh")
14     set_defaults()
15     
16     activate_newgeom()
17     
18     sketch_create(help_points("XY_plane"), lambda: sketch_circle())
19     sketch_create(help_points("XY_plane"), lambda: sketch_lines())
20     test.vp("VP_SKETCHES")
21     
22     part_create()
23
24     #[step] Create circle sketch
25     extrusion((299, 159), 10, 0)
26     #[step] Create V-shape sketch
27     extrusion((642, 176), 10, 0)
28
29     test.vp("VP_EXTRUSIONS")
30
31     #[step] Create plane: inner right for V-shape
32     activateItem(waitForObjectItem(":SALOME*_QMenuBar", "Construction"))
33     activateItem(waitForObjectItem(":_QMenu", "Plane"))
34     type(waitForObject(":SALOME*.3D View Operations_OCCViewer_ViewPort3d"), "<Control>")
35     mouseDrag(waitForObject(":SALOME*.3D View Operations_OCCViewer_ViewPort3d"), 305, 263, -2, -165, 67108866, Qt.RightButton)
36     mouseClick(waitForObject(":SALOME*.3D View Operations_OCCViewer_ViewPort3d"), 651, 229, 0, Qt.LeftButton)
37     clickButton(waitForObject(":Plane.property_panel_ok_QToolButton"))
38     test.vp("VP_INNER_RIGHT_PLANE")
39     
40     #[step] Create plane: outer right for V-shape
41     activateItem(waitForObjectItem(":SALOME*_QMenuBar", "Construction"))
42     activateItem(waitForObjectItem(":_QMenu", "Plane"))
43     type(waitForObject(":SALOME*.3D View Operations_OCCViewer_ViewPort3d"), "<Control>")
44     mouseDrag(waitForObject(":SALOME*.3D View Operations_OCCViewer_ViewPort3d"), 467, 171, -6, 319, 67108866, Qt.RightButton)
45     mouseClick(waitForObject(":SALOME*.3D View Operations_OCCViewer_ViewPort3d"), 641, 209, 0, Qt.LeftButton)
46     type(waitForObject(":SALOME*.3D View Operations_OCCViewer_ViewPort3d"), "<Control>")
47     mouseDrag(waitForObject(":SALOME*.3D View Operations_OCCViewer_ViewPort3d"), 515, 402, -7, -305, 67108866, Qt.RightButton)
48     clickButton(waitForObject(":Plane.property_panel_ok_QToolButton"))
49     test.vp("VP_OUTER_RIGHT_PLANE")
50     
51     #[step] Activate Partition feature
52     activateItem(waitForObjectItem(":SALOME*_QMenuBar", "Features"))
53     activateItem(waitForObjectItem(":_QMenu", "Partition"))
54     #[step] Select circle and V-shape
55     mouseClick(waitForObject(":SALOME*.3D View Operations_OCCViewer_ViewPort3d"), 304, 293, 0, Qt.LeftButton)
56     type(waitForObject(":SALOME*.3D View Operations_OCCViewer_ViewPort3d"), "<Shift>")
57     mouseClick(waitForObject(":SALOME*.3D View Operations_OCCViewer_ViewPort3d"), 541, 265, 33554432, Qt.LeftButton)
58     #[step] Select inner right and outer right V-shape planes
59     mouseClick(waitForObject(":Partition.Tool object_QListWidget"), 201, 90, 0, Qt.LeftButton)
60     type(waitForObject(":Partition.Tool object_QListWidget"), "<Shift>")
61     mouseClick(waitForObject(":SALOME*.3D View Operations_OCCViewer_ViewPort3d"), 667, 217, 33554432, Qt.LeftButton)
62     type(waitForObject(":SALOME*.3D View Operations_OCCViewer_ViewPort3d"), "<Control>")
63     mouseDrag(waitForObject(":SALOME*.3D View Operations_OCCViewer_ViewPort3d"), 655, 270, 8, 353, 67108866, Qt.RightButton)
64     type(waitForObject(":SALOME*.3D View Operations_OCCViewer_ViewPort3d"), "<Shift>")
65     mouseClick(waitForObject(":SALOME*.3D View Operations_OCCViewer_ViewPort3d"), 639, 210, 33554432, Qt.LeftButton)
66     type(waitForObject(":SALOME*.3D View Operations_OCCViewer_ViewPort3d"), "<Control>")
67     mouseDrag(waitForObject(":SALOME*.3D View Operations_OCCViewer_ViewPort3d"), 567, 436, -11, -351, 67108866, Qt.RightButton)
68
69     #[step] Apply Partition
70     clickButton(waitForObject(":Partition.property_panel_ok_QToolButton"))
71     
72     test.vp("VP_PARTITION")
73
74     close_application()