PageRenderTime 17ms CodeModel.GetById 10ms app.highlight 5ms RepoModel.GetById 1ms app.codeStats 0ms

/src/examples/Level2/Display/wx_demo.py

http://pythonocc.googlecode.com/
Python | 49 lines | 16 code | 9 blank | 24 comment | 0 complexity | 4fac737367f07d38258de17d8551214b MD5 | raw file
 1#!/usr/bin/env python
 2
 3##Copyright 2009-2011 Thomas Paviot (tpaviot@gmail.com)
 4##
 5##This file is part of pythonOCC.
 6##
 7##pythonOCC is free software: you can redistribute it and/or modify
 8##it under the terms of the GNU Lesser General Public License as published by
 9##the Free Software Foundation, either version 3 of the License, or
10##(at your option) any later version.
11##
12##pythonOCC is distributed in the hope that it will be useful,
13##but WITHOUT ANY WARRANTY; without even the implied warranty of
14##MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15##GNU Lesser General Public License for more details.
16##
17##You should have received a copy of the GNU Lesser General Public License
18##along with pythonOCC.  If not, see <http://www.gnu.org/licenses/>.
19
20from OCC.BRepPrimAPI import *
21from OCC.Display.SimpleGui import *
22
23set_backend('wx')
24display, start_display, add_menu, add_function_to_menu = init_display()
25
26#from OCC.Graphic3d import *
27from OCC.BRepPrimAPI import *
28#from OCC.Utils.Image import Texture
29#import os, os.path
30
31def simple_test(event=None):
32    display.Test()
33
34def simple_cylinder(event=None):
35    s = BRepPrimAPI_MakeCylinder(60, 200)
36    display.DisplayShape(s.Shape())
37
38# set up menus
39add_menu('wx tests')
40add_function_to_menu('wx tests',simple_test)
41add_function_to_menu('wx tests',simple_cylinder)
42
43#
44# Display settings
45#
46display.View_Iso()
47display.FitAll()
48start_display()
49