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.
SelectionEditor
(name, value, description, world, robot=None)[source]¶ Bases:
klampt.vis.editors.VisualEditorBase
-
click_robot
(x, y)[source]¶ Helper: returns a list of robot objects sorted in order of increasing distance.
-
-
class
klampt.vis.editors.
VisualEditorBase
(name, value, description, world)[source]¶ Bases:
klampt.vis.glcommon.GLWidgetPlugin
A base class for editing resources.
-
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.
-
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)