Skip to content

Commit b5efbd5

Browse files
committed
Added a wx/qt display test
1 parent ed23e89 commit b5efbd5

2 files changed

Lines changed: 32 additions & 0 deletions

File tree

.travis.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ before_install:
77
- sudo add-apt-repository "deb http://ppa.launchpad.net/freecad-maintainers/oce-release/ubuntu precise main" -y
88
- sudo apt-get update -q
99
- sudo apt-get install liboce-ocaf-dev oce-draw
10+
- sudo apt-get install python-wxgtk2.8
11+
- sudo apt-get install python-qt4
1012
before_script:
1113
- mkdir cmake-build
1214
- cd cmake-build
@@ -17,6 +19,7 @@ after_script:
1719
# run unittest suite
1820
- cd ../test
1921
- python run_tests.py
22+
- xvfb-run -s "-screen 0 1024x768x16" core_display_unittest.py
2023
branches:
2124
only:
2225
- master

test/core_display_unittest.py

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
##Copyright 2010-2014 Thomas Paviot (tpaviot@gmail.com)
2+
##
3+
##This file is part of pythonOCC.
4+
##
5+
##pythonOCC is free software: you can redistribute it and/or modify
6+
##it under the terms of the GNU Lesser General Public License as published by
7+
##the Free Software Foundation, either version 3 of the License, or
8+
##(at your option) any later version.
9+
##
10+
##pythonOCC is distributed in the hope that it will be useful,
11+
##but WITHOUT ANY WARRANTY; without even the implied warranty of
12+
##MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13+
##GNU Lesser General Public License for more details.
14+
##
15+
##You should have received a copy of the GNU Lesser General Public License
16+
##along with pythonOCC. If not, see <http://www.gnu.org/licenses/>.
17+
18+
from OCC.Display.SimpleGui import init_display
19+
from OCC.BRepPrimAPI import BRepPrimAPI_MakeBox
20+
21+
# wx test
22+
wx_display, start_display, add_menu, add_function_to_menu = init_display('wx')
23+
my_box = BRepPrimAPI_MakeBox(10., 20., 30.).Shape()
24+
wx_display.DisplayShape(my_box, update=True)
25+
26+
# qt test
27+
qt_display, start_display, add_menu, add_function_to_menu = init_display('qt')
28+
my_box = BRepPrimAPI_MakeBox(10., 20., 30.).Shape()
29+
qt_display.DisplayShape(my_box, update=True)

0 commit comments

Comments
 (0)