Commit 49cf46fa authored by sumpfralle's avatar sumpfralle

updated release information

added example key handler for 3d window


git-svn-id: https://pycam.svn.sourceforge.net/svnroot/pycam/trunk@170 bbaffbd6-741e-11dd-a85d-61de82d9cad9
parent 179d81bc
...@@ -10,8 +10,8 @@ pycam currently offers two GUI versions: ...@@ -10,8 +10,8 @@ pycam currently offers two GUI versions:
The GTK interface is a recent development. It will replace the Tk interface The GTK interface is a recent development. It will replace the Tk interface
in the long term. All features are available. in the long term. All features are available.
Add the commandline switch "--gtk" if you want to use the GTK interface instead Add the commandline switch "--tk" if you want to use the Tk interface instead
of the default Tk interface. of the default GTK interface.
Please verify below, that you install the specific requirements for the GUI of Please verify below, that you install the specific requirements for the GUI of
your choice. your choice.
......
...@@ -6,10 +6,12 @@ Version 0.2 - UNRELEASED ...@@ -6,10 +6,12 @@ Version 0.2 - UNRELEASED
* load/save processing settings from/to a file * load/save processing settings from/to a file
* handling of multiple processing templates (e.g. "Rough", "Semi-finish" and "Finish") * handling of multiple processing templates (e.g. "Rough", "Semi-finish" and "Finish")
* configure "material allowance" for a minimum distance between drill and model * configure "material allowance" for a minimum distance between drill and model
* configure the "safety height" for the machine
* based on GtkGlExt (for OpenGL) * based on GtkGlExt (for OpenGL)
* visualize conflicting processing settings * visualize conflicting processing settings
* configure "overlap" instead of "lines" and "samples" * configure "overlap" instead of "lines" and "samples"
* configure "maximum step down" instead of "layers" * configure "maximum step down" instead of "layers"
* show a progress bar during calculations
* improved performance by (optionally) using the "Open Dynamics Engine" (ODE) for * improved performance by (optionally) using the "Open Dynamics Engine" (ODE) for
collision detection collision detection
* added basic lightning to the OpenGL view * added basic lightning to the OpenGL view
......
...@@ -70,6 +70,8 @@ class GLView: ...@@ -70,6 +70,8 @@ class GLView:
self.gui.get_object("Back View").connect("clicked", self.rotate_view, ogl_tools.VIEWS["back"]) self.gui.get_object("Back View").connect("clicked", self.rotate_view, ogl_tools.VIEWS["back"])
self.gui.get_object("Top View").connect("clicked", self.rotate_view, ogl_tools.VIEWS["top"]) self.gui.get_object("Top View").connect("clicked", self.rotate_view, ogl_tools.VIEWS["top"])
self.gui.get_object("Bottom View").connect("clicked", self.rotate_view, ogl_tools.VIEWS["bottom"]) self.gui.get_object("Bottom View").connect("clicked", self.rotate_view, ogl_tools.VIEWS["bottom"])
# key binding
self.window.connect("key-press-event", self.key_handler)
# OpenGL stuff # OpenGL stuff
glconfig = gtk.gdkgl.Config(mode=gtk.gdkgl.MODE_RGB|gtk.gdkgl.MODE_DEPTH|gtk.gdkgl.MODE_DOUBLE) glconfig = gtk.gdkgl.Config(mode=gtk.gdkgl.MODE_RGB|gtk.gdkgl.MODE_DEPTH|gtk.gdkgl.MODE_DOUBLE)
self.area = gtk.gtkgl.DrawingArea(glconfig) self.area = gtk.gtkgl.DrawingArea(glconfig)
...@@ -99,6 +101,19 @@ class GLView: ...@@ -99,6 +101,19 @@ class GLView:
self._position = self.window.get_position() self._position = self.window.get_position()
self.window.hide() self.window.hide()
def key_handler(self, widget=None, event=None):
if event is None:
return
try:
keyval = getattr(event, "keyval")
get_state = getattr(event, "get_state")
except AttributeError:
return
if not (0 <= keyval <= 255):
# e.g. "shift" key
return
print "Key pressed: %s (%s)" % (chr(keyval), get_state())
def check_busy(func): def check_busy(func):
def busy_wrapper(self, *args, **kwargs): def busy_wrapper(self, *args, **kwargs):
if not self.enabled or self.busy: if not self.enabled or self.busy:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment