Object Editor¶
Object Editor for Scene Designer Handles editing of existing objects after creation (e.g., polygon vertices)
- class discopygal_tools.scene_designer.object_editor.ObjectEditor(gui)¶
Bases:
objectHandles editing of existing objects (primarily polygons) in the scene
- on_double_click(x, y)¶
Handle double-click to add vertex on edge
- Parameters:
x – Mouse x coordinate
y – Mouse y coordinate
- on_key_press(key)¶
Handle keyboard input during edit mode
- Parameters:
key – Qt key code or string
- on_mouse_move(x, y)¶
Handle mouse movement during edit mode
- Parameters:
x – Mouse x coordinate
y – Mouse y coordinate
- on_mouse_press(x, y)¶
Handle mouse press during edit mode
- Parameters:
x – Mouse x coordinate
y – Mouse y coordinate
- on_mouse_release()¶
Handle mouse release during edit mode
- on_right_click(x, y)¶
Handle right-click while in edit mode. If a vertex is selected, relocate it to the clicked position.
- start_editing_polygon(poly_obstacle)¶
Enter edit mode for a polygon obstacle
- Parameters:
poly_obstacle – ObstaclePolygon object to edit
- stop_editing(save=True)¶
Exit edit mode
- Parameters:
save – If True, save changes and add to undo stack
- class discopygal_tools.scene_designer.object_editor.PolygonEditState(obstacle, original_vertices)¶
Bases:
objectRepresents the state of a polygon edit for undo/redo functionality
- apply_new_vertices(vertices)¶
Store the new vertices after editing
- redo()¶
Restore edited vertices
- undo()¶
Restore original vertices