1 ## Copyright (C) 2014-2017 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
18 ## email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
25 #[Scenario] Sketch_004
26 #[Topic] 'Distance' constraint
27 #[Tested functionality]
28 #[Summary description]
32 source(findFile("scripts", "common.py"))
34 #[section] Application start
36 startApplication("salome_run.sh")
40 #[step] Open 'for_sketch_004.hdf'
41 open(os.path.join(DATA_PATH, "for_sketch_004.hdf"))
43 #[step] Activate SHAPER
44 clickButton(waitForObject(":SALOME*.Shaper_QToolButton"))
46 #[step] Activate Part_1
47 waitForObjectItem(":Object browser_XGUI_DataTree", "Part\\_1 (Not loaded)")
48 clickItem(":Object browser_XGUI_DataTree", "Part\\_1 (Not loaded)", 51, 7, 0, Qt.LeftButton)
49 openItemContextMenu(waitForObject(":Object browser_XGUI_DataTree"), "Part\\_1 (Not loaded)", 51, 7, 0)
50 activateItem(waitForObjectItem(":_QMenu", "Activate"))
53 waitForObjectItem(":Object browser_XGUI_DataTree", "Part\\_1.Sketch\\_1")
54 clickItem(":Object browser_XGUI_DataTree", "Part\\_1.Sketch\\_1", 54, 11, 0, Qt.LeftButton)
55 openItemContextMenu(waitForObject(":Object browser_XGUI_DataTree"), "Part\\_1.Sketch\\_1", 54, 11, 0)
56 activateItem(waitForObjectItem(":_QMenu", "Edit..."))
58 #[step] Click '+OY' view button
59 clickButton(waitForObject(":SALOME*.+OY_QToolButton"))
61 #[step] Set constraint 'Distance' between circle and point
62 distance((44, 224), (601, 259), (561, 195))
63 #[check] Check that constraint has been set
65 #[step] Change distance to 500
66 change_distance((324, 176), 500)
67 #[check] Check that distance is 500
69 #[step] Delete constraint
70 mouseClick(waitForObject(":SALOME*.3D View Operations_OCCViewer_ViewPort3d"), 302, 270, 0, Qt.LeftButton)
71 mouseClick(waitForObject(":SALOME*.3D View Operations_OCCViewer_ViewPort3d"), 326, 181, 0, Qt.LeftButton)
72 type(waitForObject(":SALOME*.3D View Operations_OCCViewer_ViewPort3d"), "<Del>")
73 #[check] Check that constraint has been removed
75 #[step] Close application