1 # Copyright (C) 2014-2019 CEA/DEN, EDF R&D
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.
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.
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
17 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
24 #[Scenario] Sketch_004
25 #[Topic] 'Distance' constraint
26 #[Tested functionality]
27 #[Summary description]
31 source(findFile("scripts", "common.py"))
33 #[section] Application start
35 startApplication("salome_run.sh")
39 #[step] Open 'for_sketch_004.hdf'
40 open(os.path.join(DATA_PATH, "for_sketch_004.hdf"))
42 #[step] Activate SHAPER
43 clickButton(waitForObject(":SALOME*.Shaper_QToolButton"))
45 #[step] Activate Part_1
46 waitForObjectItem(":Object browser_XGUI_DataTree", "Part\\_1 (Not loaded)")
47 clickItem(":Object browser_XGUI_DataTree", "Part\\_1 (Not loaded)", 51, 7, 0, Qt.LeftButton)
48 openItemContextMenu(waitForObject(":Object browser_XGUI_DataTree"), "Part\\_1 (Not loaded)", 51, 7, 0)
49 activateItem(waitForObjectItem(":_QMenu", "Activate"))
52 waitForObjectItem(":Object browser_XGUI_DataTree", "Part\\_1.Sketch\\_1")
53 clickItem(":Object browser_XGUI_DataTree", "Part\\_1.Sketch\\_1", 54, 11, 0, Qt.LeftButton)
54 openItemContextMenu(waitForObject(":Object browser_XGUI_DataTree"), "Part\\_1.Sketch\\_1", 54, 11, 0)
55 activateItem(waitForObjectItem(":_QMenu", "Edit..."))
57 #[step] Click '+OY' view button
58 clickButton(waitForObject(":SALOME*.+OY_QToolButton"))
60 #[step] Set constraint 'Distance' between circle and point
61 distance((44, 224), (601, 259), (561, 195))
62 #[check] Check that constraint has been set
64 #[step] Change distance to 500
65 change_distance((324, 176), 500)
66 #[check] Check that distance is 500
68 #[step] Delete constraint
69 mouseClick(waitForObject(":SALOME*.3D View Operations_OCCViewer_ViewPort3d"), 302, 270, 0, Qt.LeftButton)
70 mouseClick(waitForObject(":SALOME*.3D View Operations_OCCViewer_ViewPort3d"), 326, 181, 0, Qt.LeftButton)
71 type(waitForObject(":SALOME*.3D View Operations_OCCViewer_ViewPort3d"), "<Del>")
72 #[check] Check that constraint has been removed
74 #[step] Close application