Skip to content

shore.gui.window ​

SHORE's main window (ADR 0006, 0037): model tree, viewport, command forms, console.

Every action goes through :class:shore.gui.session.Session, so it is a Project command and a journal line (ADR 0004). Long commands run on a worker thread with the ADR 0004 progress and cancel hooks; the window refreshes from the session when they finish.

Layout (ADR 0006): model tree on the left, the viewport in the centre, command forms on the right, the journal and the log at the bottom.

MainWindow class ​

python
MainWindow(
    session: Session | None = None,
    *,
    ask_path: AskPath = _ask_path,
    offscreen_viewport: bool = False,
)

Bases: QMainWindow
source

The SHORE GUI over one :class:Session.

MainWindow.select_skeleton method ​

python
select_skeleton(key: SkeletonKey, *, add: bool = False) -> None

source

Select a blocking edge, face or block (key.edge: an edge or face name, "" for a block); add toggles it in the selection.

MainWindow.clear_blocking_selection method ​

python
clear_blocking_selection() -> None

source

MainWindow.ogrid_selection method ​

python
ogrid_selection(factor: float = 0.5, nodes: int = 5) -> None

source

Run Project.ogrid on the selection: the selected blocks are the set (every block when none is selected), the selected faces the layered faces (else the set's whole boundary), each named by its block in the set.

MainWindow.delete_selection method ​

python
delete_selection() -> None

source

Run Project.delete_blocks on the selected blocks.

MainWindow.move_selection method ​

python
move_selection(xyz: Any) -> None

source

Run Project.move_vertex for the one selected blocking vertex (ADR 0045): to xyz, onto its association if it has one.

MainWindow.move_selection_to_pick method ​

python
move_selection_to_pick() -> None

source

Move the selected blocking vertex to the last picked geometry point.

MainWindow.associate_blocking_selection method ​

python
associate_blocking_selection() -> None

source

Associate each selected blocking face or edge with the geometry selected in the Association dock (Project.associate_blocking).

MainWindow.split_selection method ​

python
split_selection() -> None

source

Run Project.split_blocking through the selected skeleton node: the picked edge's block, its axis and the node's fraction along it (making the edge's component current first if needed).

MainWindow.edge_info method ​

python
edge_info() -> dict[str, Any] | None

source

The selected edge: block, edge, axis, nodes, length, first and last cell.

MainWindow.redistribute_selection method ​

python
redistribute_selection(law: str = 'uniform', **params: Any) -> None

source

Run Project.redistribute on the selected edge (making its component current first if needed).

MainWindow.select_form method ​

python
select_form(method: str) -> None

source

Show the form of method in the Command dock.

MainWindow.refresh method ​

python
refresh() -> None

source

Bring the tree, the journal and the viewport in line with the session.

MainWindow.set_visible method ​

python
set_visible(kind: str, visible: bool) -> None

source

Show or hide all blocks, geometries, slices or the blocking (its skeleton and markers).

MainWindow.add_slice method ​

python
add_slice(block: BlockKey, axis: str, index: int) -> SliceKey

source

Show the constant-axis plane index of block.

MainWindow.remove_slice method ​

python
remove_slice(key: SliceKey) -> None

source

MainWindow.refresh_quality method ​

python
refresh_quality() -> None

source

Colour boundary quads by the scaled Jacobian of their cells, or clear.

MainWindow.run_form method ​

python
run_form(method: str, values: dict[str, Any] | None = None) -> None

source

Run the form of method with values (field name -> text or value).

MainWindow.cancel method ​

python
cancel() -> None

source

MainWindow.wait_idle method ​

python
wait_idle(timeout: float = 600.0) -> None

source

Process events until no command runs (tests and scripted use).

MainWindow.undo method ​

python
undo() -> None

source

MainWindow.redo method ​

python
redo() -> None

source

MainWindow.new_project method ​

python
new_project() -> None

source

MainWindow.open_project method ​

python
open_project(directory: str | None = None, *, replay: bool = True) -> None

source

MainWindow.save_project method ​

python
save_project(directory: str | None = None, *, ask: bool = False) -> None

source

MainWindow.pick_at method ​

python
pick_at(x: float, y: float, *, add: bool = False) -> Any

source

Pick at pixel (x, y) as a double click does (shift: add).

MainWindow.associate_selection method ​

python
associate_selection() -> None

source

Associate the selected block entity with the selected geometry entities.

MainWindow.clear_association method ​

python
clear_association() -> None

source

main function ​

python
main(project: str | None = None, *, replay: bool = True, smoke: bool = False) -> int

source

Run the GUI; smoke builds the window, shows it briefly and exits.

Released under the MIT License.