klampt.vis.editors module

Functions for visual editing. Used by the klampt.io.resource module in resource.get(...) and resource.edit(...).

A couple editors, SelectionEditor and WorldEditor, cannot be launched from the resource module. To use these, call:

from klampt.vis import editors
ed = editors.SelectionEditor("Some links",[],"Select the links that you want to modify",world))
indices = editors.run(ed)
class klampt.vis.editors.ConfigEditor(name, value, description, world, robot=None)[source]

Bases: klampt.vis.editors.VisualEditorBase

display()[source]
instructions()[source]
mousefunc(button, state, x, y)[source]
class klampt.vis.editors.ConfigsEditor(name, value, description, world, robot=None)[source]

Bases: klampt.vis.editors.VisualEditorBase

addDialogItems(parent, ui='qt')[source]
delete()[source]
display()[source]
indexChanged(index)[source]
insert()[source]
instructions()[source]
keyboardfunc(c, x, y)[source]
mousefunc(button, state, x, y)[source]
class klampt.vis.editors.ObjectTransformEditor(name, value, description, world, object)[source]

Bases: klampt.vis.editors.VisualEditorBase

instructions()[source]
mousefunc(button, state, x, y)[source]
class klampt.vis.editors.PointEditor(name, value, description, world, frame=None)[source]

Bases: klampt.vis.editors.VisualEditorBase

instructions()[source]
mousefunc(button, state, x, y)[source]
class klampt.vis.editors.RigidTransformEditor(name, value, description, world, frame=None)[source]

Bases: klampt.vis.editors.VisualEditorBase

attach(object)[source]
disableRotation()[source]
disableTranslation()[source]
display()[source]
instructions()[source]
motionfunc(x, y, dx, dy)[source]
mousefunc(button, state, x, y)[source]
class klampt.vis.editors.SelectionEditor(name, value, description, world, robot=None)[source]

Bases: klampt.vis.editors.VisualEditorBase

addDialogItems(parent, ui='qt')[source]
add_selection(id)[source]
clear()[source]
click_robot(x, y)[source]

Helper: returns a list of robot objects sorted in order of increasing distance.

click_world(x, y)[source]

Helper: returns a list of world objects sorted in order of increasing distance.

display()[source]
instructions()[source]
keyboardfunc(c, x, y)[source]
mousefunc(button, state, x, y)[source]
remove_selection(id)[source]
selectAll()[source]
selectionListChanged()[source]
toggle_selection(id)[source]
class klampt.vis.editors.TrajectoryEditor(name, value, description, world, robot=None)[source]

Bases: klampt.vis.editors.VisualEditorBase

addDialogItems(parent, ui='qt')[source]
animSelectorChanged(value)[source]
delete()[source]
display()[source]
durationChanged(value)[source]
idle()[source]
indexChanged(index)[source]
insert()[source]
instructions()[source]
keyboardfunc(c, x, y)[source]
mousefunc(button, state, x, y)[source]
onDurationsChanged()[source]

Update the trajectory times

timeDriverChanged(value)[source]
togglePlay(value)[source]
updateAnimTrajectory()[source]
class klampt.vis.editors.VisualEditorBase(name, value, description, world)[source]

Bases: klampt.vis.glcommon.GLWidgetPlugin

A base class for editing resources.

addDialogItems(parent, ui='qt')[source]
display()[source]
display_screen()[source]
instructions()[source]
class klampt.vis.editors.WorldEditor(name, value, description)[source]

Bases: klampt.vis.editors.VisualEditorBase

Edits poses of robots, rigid objects, and terrains in a world.

Note: need to call finalize() in order to get terrain geometries updated.

display()[source]
finalize()[source]

Applies the transforms to all the terrain geometries.

instructions()[source]
motionfunc(button, state, x, y)[source]
klampt.vis.editors.run(editorObject)[source]
Parameters:editorObject (VisualEditorBase) – some subclass of VisualEditorBase
Returns:A pair (res,value) containing:
  • res (bool):True / False if OK / Cancel was pressed, respectively,
  • value: the return value of the editor object
Return type:(tuple)