klampt.vis.glcommon module
Defines GLWidgetPlugin, GLMultiViewportProgram, and CachedGLObject, which
are used by the core visualization module. They may be useful for writing
your own GLPluginInterface classes, too.
-
class
klampt.vis.glcommon.
CachedGLObject
[source]
An object whose drawing is accelerated by means of a display list.
The draw function may draw the object in the local frame, and the
object may be transformed without having to recompile the display list.
-
destroy
()[source]
Must be called to free up resources used by this object
-
draw
(renderFunction, transform=None, args=None, parameters=None)[source]
Given the function that actually makes OpenGL calls, this
will draw the object.
If parameters is given, the object’s local appearance is assumed
to be defined deterministically from these parameters. The display
list will be redrawn if the parameters change.
-
markChanged
()[source]
Marked by an outside source to indicate the object has changed and
should be redrawn.
-
class
klampt.vis.glcommon.
GLMultiViewportProgram
[source]
Bases: klampt.vis.glprogram.GLProgram
-
addView
(view)[source]
-
clearViews
()[source]
-
click_ray
(x, y)[source]
-
display
()[source]
-
display_screen
()[source]
-
displayfunc
()[source]
-
draw_text
(point, text, size=12, color=None)[source]
Draws text of the given size and color at the given point. Usually
called during display_screen.
-
fit
()[source]
-
get_view
()[source]
-
idlefunc
()[source]
-
initialize
()[source]
-
keyboardfunc
(c, x, y)[source]
-
keyboardupfunc
(c, x, y)[source]
-
motionfunc
(x, y, dx, dy)[source]
-
mousefunc
(button, state, x, y)[source]
-
refresh
()[source]
Spoofs the window’s refresh function
-
removeView
(view)[source]
-
reshape
(w, h)[source]
Spoofs the window’s reshape function
-
reshapefunc
(w, h)[source]
-
set_view
(vp)[source]
-
updateActive
(x, y)[source]
-
class
klampt.vis.glcommon.
GLWidgetPlugin
[source]
Bases: klampt.vis.glinterface.GLPluginInterface
A GL plugin that sends user events to one or more Klamp’t widgets.
To use, add this to a GLPluginProgram and call addWidget to add widgets
-
addWidget
(widget)[source]
-
display
()[source]
-
idlefunc
()[source]
-
keyboardfunc
(c, x, y)[source]
-
keyboardupfunc
(c, x, y)[source]
-
motionfunc
(x, y, dx, dy)[source]
-
mousefunc
(button, state, x, y)[source]
-
widgetchangefunc
(event)[source]
Called whenever a widget is clicked or dragged.
event can be ‘mousedown’, ‘mousedrag’, ‘mouseup’.
Subclasses can use this to respond to widget click events
-
widgethoverfunc
()[source]
Called whenever a widget changes appearance due to hover.
Subclasses can use this to respond to widget click events