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
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
select_skeleton(key: SkeletonKey, *, add: bool = False) -> NoneSelect 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
clear_blocking_selection() -> NoneMainWindow.ogrid_selection method
ogrid_selection(factor: float = 0.5, nodes: int = 5) -> NoneRun 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
delete_selection() -> NoneRun Project.delete_blocks on the selected blocks.
MainWindow.move_selection method
move_selection(xyz: Any) -> NoneRun 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
move_selection_to_pick() -> NoneMove the selected blocking vertex to the last picked geometry point.
MainWindow.associate_blocking_selection method
associate_blocking_selection() -> NoneAssociate each selected blocking face or edge with the geometry selected in the Association dock (Project.associate_blocking).
MainWindow.split_selection method
split_selection() -> NoneRun 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
edge_info() -> dict[str, Any] | NoneThe selected edge: block, edge, axis, nodes, length, first and last cell.
MainWindow.redistribute_selection method
redistribute_selection(law: str = 'uniform', **params: Any) -> NoneRun Project.redistribute on the selected edge (making its component current first if needed).
MainWindow.select_form method
select_form(method: str) -> NoneShow the form of method in the Command dock.
MainWindow.refresh method
refresh() -> NoneBring the tree, the journal and the viewport in line with the session.
MainWindow.set_visible method
set_visible(kind: str, visible: bool) -> NoneShow or hide all blocks, geometries, slices or the blocking (its skeleton and markers).
MainWindow.add_slice method
add_slice(block: BlockKey, axis: str, index: int) -> SliceKeyShow the constant-axis plane index of block.
MainWindow.remove_slice method
remove_slice(key: SliceKey) -> NoneMainWindow.refresh_quality method
refresh_quality() -> NoneColour boundary quads by the scaled Jacobian of their cells, or clear.
MainWindow.run_form method
run_form(method: str, values: dict[str, Any] | None = None) -> NoneRun the form of method with values (field name -> text or value).
MainWindow.cancel method
cancel() -> NoneMainWindow.wait_idle method
wait_idle(timeout: float = 600.0) -> NoneProcess events until no command runs (tests and scripted use).
MainWindow.undo method
undo() -> NoneMainWindow.redo method
redo() -> NoneMainWindow.new_project method
new_project() -> NoneMainWindow.open_project method
open_project(directory: str | None = None, *, replay: bool = True) -> NoneMainWindow.save_project method
save_project(directory: str | None = None, *, ask: bool = False) -> NoneMainWindow.pick_at method
pick_at(x: float, y: float, *, add: bool = False) -> AnyPick at pixel (x, y) as a double click does (shift: add).
MainWindow.associate_selection method
associate_selection() -> NoneAssociate the selected block entity with the selected geometry entities.
MainWindow.clear_association method
clear_association() -> Nonemain function
main(project: str | None = None, *, replay: bool = True, smoke: bool = False) -> intRun the GUI; smoke builds the window, shows it briefly and exits.