1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 """A small application to show a geometry. This module is finally
23 just a draft, used for some examples and research."""
24 import vtk
25 import gtk
26 from mbdyn.interface.renderWindowInteractor import GtkRenderWindowInteractor
27
28
30 """An application supposed to show a MBDyn geometry
31 """
32
34 self.window = gtk.Window()
35 self.window.set_size_request(500, 500)
36 self.window.set_border_width(10)
37 self.window.connect("destroy", gtk.main_quit)
38
39 box = gtk.VBox()
40 box.show()
41
42 self.renderer = vtk.vtkRenderer()
43 self.renderer.SetBackground(1., 1., 1.)
44 self.win_interactor = GtkRenderWindowInteractor()
45 self.win_interactor.GetRenderWindow().AddRenderer(self.renderer)
46 self.win_interactor.Initialize()
47 self.win_interactor.Start()
48 box.pack_start(self.win_interactor, True, True)
49
50 button = gtk.Button("Start render")
51 button.connect("clicked", self.start_render)
52 button.show()
53 box.pack_start(button, False, False)
54
55 self.window.add(box)
56
58 """Start the VTK Render, supposed to be defined by the user"""
59 print "Heritates from the class ShowGeometry " + \
60 "to start what you want here"
61
63 """Run the application"""
64 gtk.main()
65