schrodinger.maestro_utils.surface_manager.surface_table module¶
- class schrodinger.maestro_utils.surface_manager.surface_table.SurfaceTable(parent=None)¶
Bases:
TreeViewWithoutFilterSub-class of maestro_ui.maestro.TreeViewWithoutFilter. We have 4 columns in the table: 1. Checkbox column 2. Entry / Surface Name column 3. Type column 4. Volume column
We can have two types of rows in the table: 1. EntryNodeItem (parent nodes) 2. SurfaceNodeItem (child nodes)
- Variables:
displayedSurfacesUpdated (QtCore.pyqtSignal) – Signal emitted when the displayed surfaces are updated.
notifyToChangeDisplay (QtCore.pyqtSignal) – Signal to notify client to change display.
notifyToModifyVolume (QtCore.pyqtSignal) – Signal to notify client to modify volume.
notifyToViewInfo (QtCore.pyqtSignal) – Signal to notify client to view info.
- displayedSurfacesUpdated¶
A
pyqtSignalemitted by instances of the class.
- notifyToChangeDisplay¶
A
pyqtSignalemitted by instances of the class.
- notifyToModifyVolume¶
A
pyqtSignalemitted by instances of the class.
- notifyToViewInfo¶
A
pyqtSignalemitted by instances of the class.
- __init__(parent=None)¶
Constructor for SurfaceTable.
- Parameters:
parent – The parent widget.
- setupConnections()¶
Setup the connections.
- reorderHeader()¶
Reorders the header.
- refresh()¶
Refresh the surface table. This will repopulate the model with the current project data.
- showEvent(event)¶
Overridden showEvent method. See Qt documentation for more information. Populates the surface table.
- Parameters:
event – The event.
- setCheckedOnNodes(indices: list[PyQt6.QtCore.QModelIndex], value: CheckState)¶
Set the checked state on the nodes.
- Parameters:
indices – The indices of the items.
value – The value to set.
- removeRowsAndDeleteSurfaces(indices: list[PyQt6.QtCore.QModelIndex]) None¶
Remove the rows from the model and delete the corresponding surfaces. Batch dependency logic: - Surfaces belonging to a fully-selected entry node are deleted unconditionally — all intra-entry dependencies go away together. - For individually selected surface nodes, if a surface’s volume is coloring another surface that is NOT also being deleted, deletion of that source surface is blocked. - Unblocked surfaces are deleted normally. - If any surfaces are blocked, a warning is shown to the user. - Blocked surfaces are left selected so the user can identify them. - If all dependencies are also being deleted, deletion proceeds silently. Note: This method expects the caller to send either all entry node indices, or all surface node indices.
- Parameters:
indices – The indices of the items to delete.
- deleteAllSurfacesAndRows()¶
Remove all rows from the model. This will delete all the underlying surfaces and remove their rows from the table.
- getSelectedSurfaceInfos() list[SurfaceInfo]¶
Get the SurfaceInfo objects for selected surfaces.
- Returns:
The SurfaceInfo objects for selected surfaces.
- hasSelection() bool¶
Check if there is a non-empty selection in the surface table.
- Returns:
True if there is a non-empty selection, False otherwise.
- exportAllData()¶
Exports all surface data.
- selectIndices(indices: list[PyQt6.QtCore.QModelIndex])¶
Selects the given indices in the workspace surfaces table.
- Parameters:
indices – List of QModelIndex to select.
- selectEntries(entry_ids: list[int])¶
Selects the given entry_ids in the workspace surfaces table. Also clears the previous selection.
- Parameters:
entry_ids – List of entry IDs to select.
- selectSurfaces(entry_to_surface_names: dict[int, set[str]])¶
Selects the given surfaces in the workspace surfaces table. Also clears the previous selection.
- Parameters:
entry_to_surface_names – Dictionary mapping entry IDs to sets of surface names to select.
- getEntryIdsOfSelectedSurfaces() set[int]¶
Get the entry IDs of entries corresponding to currently selected surfaces in the surface table.
- Returns:
Set of entry IDs for selected surfaces.