geom.gui.structure_gui

Native Qt GUI for creating and visualizing GEOM XYZ structures.

Attributes

missing_dependency

APP_TITLE

SUPPORTED_VIEWER_SUFFIXES

CHATGPT_GREEN

TEXT

MUTED

SURFACE

CANVAS

BORDER

SIDEBAR

SOFT_BORDER

PANEL

ACCENT_VIOLET

ACCENT_INDIGO

ACCENT_SOFT

GL_COLOR_BUFFER_BIT

GL_DEPTH_BUFFER_BIT

GL_TRIANGLE_STRIP

GL_COMPILE

GL_LEQUAL

GL_FRONT_AND_BACK

GL_FRONT

GL_BACK

GL_CULL_FACE

GL_DEPTH_TEST

GL_LIGHTING

GL_LIGHT0

GL_COLOR_MATERIAL

GL_NORMALIZE

GL_POLYGON_OFFSET_FILL

GL_LINE

GL_FILL

GL_MODELVIEW

GL_PROJECTION

GL_AMBIENT

GL_DIFFUSE

GL_POSITION

GL_SPECULAR

GL_SHININESS

GL_AMBIENT_AND_DIFFUSE

GL_SMOOTH

VMD_ELEMENT_LABELS

VMD_VDW_RADII

VDW_RADII

DEFAULT_VMD_PINK

ELEMENT_COLORS

CPK_COLORS

CPK_DEFAULT

METAL_ELEMENTS

COVALENT_RADII

STRUCTURES

GRAPHENE_VARIANTS

Classes

ProjectedAtom

ProjectedBond

GenerationWorker

VdwCanvas

ViewerStepper

ViewerTabBar

Compact tab bar with drag reordering and wheel navigation.

StructureWindow

Functions

atom_matches_selection(→ bool)

Evaluate a VMD-like coordinate selection expression for one atom.

_normalize_selection_expression(→ str)

_evaluate_selection_node(→ bool | float | str)

_compare_selection_values(→ bool)

main(→ int)

Module Contents

geom.gui.structure_gui.missing_dependency[source]
geom.gui.structure_gui.APP_TITLE = 'GEOM Structure Studio'[source]
geom.gui.structure_gui.SUPPORTED_VIEWER_SUFFIXES[source]
geom.gui.structure_gui.CHATGPT_GREEN = '#10A37F'[source]
geom.gui.structure_gui.TEXT = '#202123'[source]
geom.gui.structure_gui.MUTED = '#6E6E80'[source]
geom.gui.structure_gui.SURFACE = '#FFFFFF'[source]
geom.gui.structure_gui.CANVAS = '#F7F7F8'[source]
geom.gui.structure_gui.BORDER = '#D9D9E3'[source]
geom.gui.structure_gui.SIDEBAR = '#ECECF1'[source]
geom.gui.structure_gui.SOFT_BORDER = '#ECECF1'[source]
geom.gui.structure_gui.PANEL = '#FFFFFF'[source]
geom.gui.structure_gui.ACCENT_VIOLET = '#4F00B5'[source]
geom.gui.structure_gui.ACCENT_INDIGO = '#0600A0'[source]
geom.gui.structure_gui.ACCENT_SOFT = '#F4F0FF'[source]
geom.gui.structure_gui.GL_COLOR_BUFFER_BIT = 16384[source]
geom.gui.structure_gui.GL_DEPTH_BUFFER_BIT = 256[source]
geom.gui.structure_gui.GL_TRIANGLE_STRIP = 5[source]
geom.gui.structure_gui.GL_COMPILE = 4864[source]
geom.gui.structure_gui.GL_LEQUAL = 515[source]
geom.gui.structure_gui.GL_FRONT_AND_BACK = 1032[source]
geom.gui.structure_gui.GL_FRONT = 1028[source]
geom.gui.structure_gui.GL_BACK = 1029[source]
geom.gui.structure_gui.GL_CULL_FACE = 2884[source]
geom.gui.structure_gui.GL_DEPTH_TEST = 2929[source]
geom.gui.structure_gui.GL_LIGHTING = 2896[source]
geom.gui.structure_gui.GL_LIGHT0 = 16384[source]
geom.gui.structure_gui.GL_COLOR_MATERIAL = 2903[source]
geom.gui.structure_gui.GL_NORMALIZE = 2977[source]
geom.gui.structure_gui.GL_POLYGON_OFFSET_FILL = 32823[source]
geom.gui.structure_gui.GL_LINE = 6913[source]
geom.gui.structure_gui.GL_FILL = 6914[source]
geom.gui.structure_gui.GL_MODELVIEW = 5888[source]
geom.gui.structure_gui.GL_PROJECTION = 5889[source]
geom.gui.structure_gui.GL_AMBIENT = 4608[source]
geom.gui.structure_gui.GL_DIFFUSE = 4609[source]
geom.gui.structure_gui.GL_POSITION = 4611[source]
geom.gui.structure_gui.GL_SPECULAR = 4610[source]
geom.gui.structure_gui.GL_SHININESS = 5633[source]
geom.gui.structure_gui.GL_AMBIENT_AND_DIFFUSE = 5634[source]
geom.gui.structure_gui.GL_SMOOTH = 7425[source]
geom.gui.structure_gui.VMD_ELEMENT_LABELS = ('X', 'H', 'He', 'Li', 'Be', 'B', 'C', 'N', 'O', 'F', 'Ne', 'Na', 'Mg', 'Al', 'Si', 'P', 'S',...[source]
geom.gui.structure_gui.VMD_VDW_RADII = (1.5, 1.0, 1.4, 1.82, 2.0, 2.0, 1.7, 1.55, 1.52, 1.47, 1.54, 1.36, 1.18, 2.0, 2.1, 1.8, 1.8,...[source]
geom.gui.structure_gui.VDW_RADII[source]
geom.gui.structure_gui.DEFAULT_VMD_PINK[source]
geom.gui.structure_gui.ELEMENT_COLORS[source]
geom.gui.structure_gui.CPK_COLORS[source]
geom.gui.structure_gui.CPK_DEFAULT[source]
geom.gui.structure_gui.METAL_ELEMENTS[source]
geom.gui.structure_gui.COVALENT_RADII[source]
geom.gui.structure_gui.STRUCTURES[source]
geom.gui.structure_gui.GRAPHENE_VARIANTS[source]
class geom.gui.structure_gui.ProjectedAtom[source]
index: int[source]
element: str[source]
x: float[source]
y: float[source]
z: float[source]
radius: float[source]
depth_radius: float[source]
cpk: bool[source]
ox: float[source]
oy: float[source]
oz: float[source]
class geom.gui.structure_gui.ProjectedBond[source]
first: ProjectedAtom[source]
second: ProjectedAtom[source]
z: float[source]
width: float[source]
geom.gui.structure_gui.atom_matches_selection(atom: geom.gui.structure_generator.AtomRecord, expression: str) bool[source]

Evaluate a VMD-like coordinate selection expression for one atom.

geom.gui.structure_gui._normalize_selection_expression(expression: str) str[source]
geom.gui.structure_gui._evaluate_selection_node(node: ast.AST, values: dict[str, float | str]) bool | float | str[source]
geom.gui.structure_gui._compare_selection_values(left: bool | float | str, operator: ast.cmpop, right: bool | float | str) bool[source]
class geom.gui.structure_gui.GenerationWorker(command_args: list[str], output_root: pathlib.Path, parent=None)[source]

Bases: PySide6.QtCore.QThread

generated[source]
failed[source]
command_args[source]
output_root[source]
run()[source]
class geom.gui.structure_gui.VdwCanvas(parent=None)[source]

Bases: PySide6.QtOpenGLWidgets.QOpenGLWidget

files_dropped[source]
atoms: tuple[geom.gui.structure_generator.AtomRecord, Ellipsis] = ()[source]
source_atoms: tuple[geom.gui.structure_generator.AtomRecord, Ellipsis] = ()[source]
selection_expression = ''[source]
rotation_x = 0.0[source]
rotation_y = 0.0[source]
zoom = 1.0[source]
pan_x = 0.0[source]
pan_y = 0.0[source]
vdw_scale = 1.45[source]
bond_width_scale = 1.65[source]
render_resolution = 1[source]
translate_mode = False[source]
_is_interacting = False[source]
_last_pos: PySide6.QtCore.QPoint | None = None[source]
_sphere_cache: dict[tuple[str, int, int, bool], PySide6.QtGui.QPixmap][source]
_gl = None[source]
_sphere_list = 0[source]
_sphere_mesh = [][source]
_interaction_timer[source]
set_atoms(atoms: tuple[geom.gui.structure_generator.AtomRecord, Ellipsis])[source]
set_visible_atoms(atoms: tuple[geom.gui.structure_generator.AtomRecord, Ellipsis])[source]
reset_view()[source]
set_vdw_scale(value: float)[source]
set_bond_width_scale(value: float)[source]
set_render_resolution(value: int)[source]
_begin_interaction()[source]
_finish_interaction()[source]
mousePressEvent(event)[source]
mouseMoveEvent(event)[source]
mouseReleaseEvent(event)[source]
wheelEvent(event)[source]
keyPressEvent(event)[source]
_is_reset_view_key(event) bool[source]
dragEnterEvent(event)[source]
dropEvent(event)[source]
_structure_paths_from_event(event) list[pathlib.Path][source]
initializeGL()[source]
resizeGL(width: int, height: int)[source]
paintGL()[source]
_make_painter(fine_render: bool) PySide6.QtGui.QPainter[source]
_paint_axes_overlay()[source]
_paint_background(painter: PySide6.QtGui.QPainter)[source]
_project_atoms() list[ProjectedAtom][source]
_atom_uses_cpk(element: str) bool[source]
_scene_has_cpk() bool[source]
_uses_vdw_opengl(projected: list[ProjectedAtom]) bool[source]
_uses_mixed_vdw_cpk(projected: list[ProjectedAtom]) bool[source]
_paint_mixed_vdw_cpk(projected: list[ProjectedAtom])[source]
_paint_bonds_and_atoms(painter: PySide6.QtGui.QPainter, bond_source: list[ProjectedAtom], atoms: list[ProjectedAtom])[source]
_paint_vdw_opengl(projected: list[ProjectedAtom])[source]
_build_sphere_mesh(stacks: int, slices: int) list[list[tuple[float, float, float]]][source]
_draw_unit_sphere(gl)[source]
_draw_unit_sphere_mesh(gl)[source]
_uses_vdw_impostors(projected: list[ProjectedAtom]) bool[source]
_uses_vdw_surface_buffer(projected: list[ProjectedAtom]) bool[source]
_paint_vdw_surface_buffer(painter: PySide6.QtGui.QPainter, projected: list[ProjectedAtom])[source]
_vdw_surface_render_scale(width: int, height: int, atom_count: int) float[source]
_paint_vdw_impostors(painter: PySide6.QtGui.QPainter, projected: list[ProjectedAtom])[source]
_sphere_pixmap(atom: ProjectedAtom) PySide6.QtGui.QPixmap[source]
_paint_vdw_depth_buffer(painter: PySide6.QtGui.QPainter, projected: list[ProjectedAtom])[source]
_vdw_depth_render_scale(width: int, height: int, atom_count: int) float[source]
_view_light_vector() tuple[float, float, float][source]
_projected_bonds(projected: list[ProjectedAtom]) list[ProjectedBond][source]
_paint_bond(painter: PySide6.QtGui.QPainter, bond: ProjectedBond)[source]
_paint_atom(painter: PySide6.QtGui.QPainter, atom: ProjectedAtom)[source]
_use_lit_atom_rendering(atom: ProjectedAtom) bool[source]
_rotate_point(x: float, y: float, z: float) tuple[float, float, float][source]
_paint_axes(painter: PySide6.QtGui.QPainter)[source]
class geom.gui.structure_gui.ViewerStepper(value: int, minimum: int, maximum: int, suffix: str, parent=None)[source]

Bases: PySide6.QtWidgets.QWidget

valueChanged[source]
spin[source]
up_button[source]
down_button[source]
setValue(value: int)[source]
value() int[source]
class geom.gui.structure_gui.ViewerTabBar(parent=None)[source]

Bases: PySide6.QtWidgets.QTabBar

Compact tab bar with drag reordering and wheel navigation.

wheelEvent(event)[source]
class geom.gui.structure_gui.StructureWindow[source]

Bases: PySide6.QtWidgets.QMainWindow

worker: GenerationWorker | None = None[source]
current_result: geom.gui.structure_generator.StructureResult | None = None[source]
output_root: pathlib.Path | None = None[source]
empty_canvas: VdwCanvas | None = None[source]
pending_generation_meta: dict[str, object][source]
vdw_scale = 1.45[source]
bond_width_scale = 1.65[source]
render_resolution = 1[source]
_build_ui()[source]
_field_label(text: str) PySide6.QtWidgets.QLabel[source]
_configure_dropdown_popups()[source]
_section_label(text: str) PySide6.QtWidgets.QLabel[source]
_make_canvas() VdwCanvas[source]
_make_viewer_spin(value: int, minimum: int, maximum: int, suffix: str) ViewerStepper[source]
reset_current_view()[source]
keyPressEvent(event)[source]
_make_manipulator_spin(value: float, minimum: float, maximum: float, suffix: str) PySide6.QtWidgets.QDoubleSpinBox[source]
_make_option_spin(value: float, minimum: float, maximum: float) PySide6.QtWidgets.QDoubleSpinBox[source]
_material_items() list[str][source]
_refresh_material_controls()[source]
_available_structures_for_material(material: str) list[str][source]
_refresh_structure_controls()[source]
_configure_parameter_widget(label: PySide6.QtWidgets.QLabel, spin: PySide6.QtWidgets.QDoubleSpinBox, text: str, value: float, minimum: float, maximum: float)[source]
_ordered_metals(metals: list[str]) list[str][source]
_refresh_option_controls()[source]
_set_optional_row_enabled(widgets, enabled: bool)[source]
_apply_atom_selection(*_args)[source]
_sync_atom_selection_input()[source]
_set_atom_selection_invalid(invalid: bool)[source]
_set_vdw_scale_from_input(value: int)[source]
_set_render_resolution_from_input(value: int)[source]
_set_bond_width_from_input(value: int)[source]
_refresh_smiles_button_state()[source]
_all_canvases() list[VdwCanvas][source]
_apply_styles()[source]
create_structure()[source]
load_files_from_dialog()[source]
load_files(paths: list[pathlib.Path])[source]
load_smiles_from_input()[source]
_add_structure_tab(title: str, atoms: tuple[geom.gui.structure_generator.AtomRecord, Ellipsis], path: pathlib.Path | None = None, metadata: dict[str, object] | None = None)[source]
_install_tab_menu(tab_index: int, canvas: VdwCanvas)[source]
save_structure(canvas: VdwCanvas)[source]
_save_source_for_canvas(canvas: VdwCanvas) pathlib.Path | None | bool[source]
_write_xyz(path: pathlib.Path, atoms: tuple[geom.gui.structure_generator.AtomRecord, Ellipsis])[source]
delete_structure_tab(canvas: VdwCanvas)[source]
_refresh_manipulator_sources(sync_to_current_tab: bool = False)[source]
_refresh_manipulator_actions(*_args)[source]
_center_to_origin_available() bool[source]
_current_viewer_tab_is_joint() bool[source]
_atoms_are_centered(atoms: tuple[geom.gui.structure_generator.AtomRecord, Ellipsis], tolerance: float = 1e-06) bool[source]
_selected_manipulator_path() pathlib.Path[source]
_run_manipulation(command_builder)[source]
center_selected_structure()[source]
mirror_selected_structure()[source]
rotate_selected_structure()[source]
translate_selected_structure()[source]
translate_pair_selected_structures()[source]
_minimum_distance(first: tuple[geom.gui.structure_generator.AtomRecord, Ellipsis], second: tuple[geom.gui.structure_generator.AtomRecord, Ellipsis]) float[source]
_short_tab_title(title: str) str[source]
_sync_current_tab_meta()[source]
_generation_metadata() dict[str, object][source]
_metadata_for_generated_atoms(atoms: tuple[geom.gui.structure_generator.AtomRecord, Ellipsis]) dict[str, object][source]
_build_command_args() list[str][source]
_fmt(value: float) str[source]
_structure_ready(result: geom.gui.structure_generator.StructureResult)[source]
_structure_failed(details: str)[source]
closeEvent(event)[source]
geom.gui.structure_gui.main() int[source]