klampt.vis.glinterface module¶
Defines the GLPluginInterface class, which is a unified base class for plugins to the klampt.vis module.
-
class
klampt.vis.glinterface.
GLPluginInterface
[source]¶ Bases:
object
Users can add their own hooks into the visualizer by overloading this class’s methods. Each method should return True if the user event was processed. A return value of True stops cascading events to a parent interface.
-
window
¶ the window to which this plugin is attached. May be None if not attached to an OpenGL window.
- Type
-
view
¶ the viewport that is currently being used for this plugin.
- Type
-
actions
¶ internally used.
- Type
list
-
add_action
(callback, short_name, key, description=None)[source]¶ Defines a new generic GUI action. The action will be available in a menu in Qt or as keyboard commands in GLUT.
-
click_ray
(x, y)[source]¶ Returns the world-space ray associated with the camera click at pixel coordinates x,y.
-
draw_text
(point, text, size=12, color=None)[source]¶ Draws text of the given size and color at the point (x,y) or (x,y,z). The former method is usually called during display_screen.
-
initialize
()[source]¶ Called by backend after the GL context is created but before the event loop starts.
-