Main¶
- class discopygal_tools.scene_designer.scene_designer_main.MainWindowSceneDesigner(gui)¶
Bases:
MainWindowPlusAdd additional signal functionality to the scene designer main window
- keyPressEvent(event)¶
Handle key press events
- Parameters:
event (
QEvent) – key press event
- signal_drop¶
Signal when user drags a file to the app
- class discopygal_tools.scene_designer.scene_designer_main.SceneDesignerGUI¶
Bases:
Ui_MainWindow,GUI- about_dialog() None¶
Open the about dialog
- ask_unsaved_changes() bool¶
Check if user has unsaved changes and ask if to save, dicard changes or abort. Return True if user prompted abort
- clear_scene() None¶
Clear the scene
- delete_selected_object() None¶
Delete the selected object (if exists)
- deselect_selected_object()¶
Deselect the currently selected object (ESC key)
- get_object_properties() None¶
Return a dict of the current object’s properties (misc data)
- load_scene() None¶
Load a scene.
- new_scene() None¶
Discard current scene and create a new one.
- object_properties_enabled_fields(obj_type, select: bool) None¶
Given the currect object type we draw or edit, set which fields are availabe
- object_property_updated(text: str, property: str) None¶
Called when user updates a property of an object
- on_scene_mouse_double_click(x, y) None¶
Handle double-click in scene
- on_scene_mouse_move(x, y) None¶
Handle mouse movement in scene
- on_scene_mouse_press(x, y) None¶
Handle mouse press in scene
- on_scene_mouse_release() None¶
Handle mouse release in scene
- on_scene_right_click(x, y) None¶
Handle right-click in scene
- preferences_dialog() None¶
Open the preferences dialog
- random_hsv() None¶
Return a random HSV color
- randomize_colors() None¶
Randomize the color of a selected robot. If none is selected - randomize all the colors
- redo()¶
Redo the last undone action (Ctrl+Y)
- save_scene(save_as: bool = False) None¶
Save the current scene. If the given path is set - then save without prompt, otherwise prompt a file save dialog.
- save_state()¶
Save the current scene state to the undo stack and clear the redo stack
- scene_changed() None¶
This function is called everytime there was made (even minor) change to the scene
- scene_metadata_load() None¶
Load metadata variables to GUI when loading a scene
- setupUi() None¶
Setup the UI layout of the application. Should be overridded by any GUI application and define a custom layout.
- start_polygon_edit() None¶
Enter edit mode for selected polygon obstacle
- toggle_grid() None¶
Draw the grid, using the given grid options
- undo()¶
Undo the last action (Ctrl+Z)
- update_object_properties(select: bool) None¶
Update the object properties panel. Clear object metadata when deselcting.
If select is true, we also show the object’s properties
- update_window_title() None¶
Update the window title (to include filename + changes)