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:
QtGLWindow or GLUTWindow
- view
the viewport that is currently being used for this plugin.
- Type:
- actions
internally used.
- Type:
list
- initialize()[source]
Called by backend after the GL context is created but before the event loop starts.
- Return type:
bool
- eventfunc(type, args='')[source]
Generic hook for other events, e.g., button presses, from the GUI
- Return type:
bool
- 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.
- Return type:
None
- modifiers()[source]
Retrieves a list of currently pressed keyboard modifiers. Values can be any combination of ‘ctrl’, ‘shift’, ‘alt’.
- Return type:
List
[str
]
- 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.
- Return type:
None