Skip to content

Prevent model init with unset bounding box and persist flag#74

Merged
lachlangrose merged 3 commits intodev-0.1.12from
copilot/update-bounding-box-logic
Jan 26, 2026
Merged

Prevent model init with unset bounding box and persist flag#74
lachlangrose merged 3 commits intodev-0.1.12from
copilot/update-bounding-box-logic

Conversation

Copy link
Contributor

Copilot AI commented Jan 26, 2026

Bounding box defaults could trigger huge model extents; prevent initialization until the user explicitly sets an extent and persist that state.

  • Data Manager
    • Track a bounding_box_set flag, persist it in project save/load, and mark it when users change the box.
  • UI/Validation
    • Block “Initialize Model” when the bounding box isn’t set and show a clear error.
    • Visually flag unset bounding boxes by outlining extent spin boxes in red until set.

Example:

# Persisted flag
data_manager.set_bounding_box(xmin=10, xmax=100, ymin=20, ymax=120, mark_set=True)
data_manager.is_bounding_box_set()  # True

# UI guard
if not data_manager.is_bounding_box_set():
    QMessageBox.critical(self, "Bounding box required", "Please set the bounding box before initializing the model.")
Original prompt

Update the bounding box logic to include a flag that keeps track of whether the bounding box has been set, this flag should be stored in the data manager and should be saved in the project. Currently the default bounding box is min 0 max 1000 in x and y. But the model will use this bounding box and then expand to keep all of the data points. This can cause a massive model support and crash the plugin. What we need to do is have a flag that the bounding box has not been set and in this case it should not allow the user to initialise their model. It should give and error and tell them to update the bounding box. IT would also be good to visually show the bounding box has not been changed by adding a red box to the extent spin boxes.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Co-authored-by: lachlangrose <7371904+lachlangrose@users.noreply.github.com>
Copilot AI changed the title [WIP] Update bounding box logic with tracking flag Prevent model init with unset bounding box and persist flag Jan 26, 2026
Copilot AI requested a review from lachlangrose January 26, 2026 07:25
@lachlangrose lachlangrose marked this pull request as ready for review January 26, 2026 07:46
@lachlangrose lachlangrose merged commit 42f175d into dev-0.1.12 Jan 26, 2026
1 check passed
@lachlangrose lachlangrose deleted the copilot/update-bounding-box-logic branch January 26, 2026 07:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants