How qpg-mit/optiverse works
Optiverse is a PyQt6 desktop tool for building 2D optical assemblies, editing components, and interactively tracing and viewing rays. Users place and configure optical elements and sources on a canvas; the ray-tracing controller invokes the engine and rendering displays propagation. File workflows save and reload assemblies, while separate features support component libraries, Zemax import, linked assemblies, measurements, and live collaboration. Edges are limited to relationships explicit in the README or source index; many UI and domain integrations are not excerpted, so omitted links should not be read as absent.
Main entry points: main_window.py Application window · scene_file_manager.py Assembly save and load · collaboration_manager.py Collaboration manager · undo_stack.py Undo stack
Components 32
Desktop interaction
- Application window
src/optiverse/ui/views/main_window.py - Scene interaction
src/optiverse/ui/views/scene_event_handler.py - Component placement
src/optiverse/ui/views/placement_handler.py - Move and rotate
src/optiverse/ui/controllers/item_drag_handler.py - Measurement tools
src/optiverse/ui/views/tool_handlers.py - Canvas views
src/optiverse/objects/views/graphics_view.py - Theme management
src/optiverse/ui/theme_manager.py
Optical modeling
- Optical objects
src/optiverse/objects/base_obj.py - Component creation
src/optiverse/objects/component_factory.py - Ray tracing control
src/optiverse/ui/controllers/raytracing_controller.py - Ray tracing engine
src/optiverse/raytracing/engine.py - Ray models
src/optiverse/raytracing/ray.py - Ray rendering
src/optiverse/ui/controllers/ray_renderer.py
Assembly and libraries
- Assembly save and load
src/optiverse/services/scene_file_manager.py - Persistent storage
src/optiverse/services/storage_service.py - Component library
src/optiverse/services/library_service.py - Serializable type registry
src/optiverse/objects/type_registry.py - Zemax import
src/optiverse/services/zemax_parser.py - Linked assemblies
src/optiverse/services/linked_assembly_service.py
Collaboration and services
- Collaboration controls
src/optiverse/ui/controllers/collaboration_controller.py - Collaboration manager
src/optiverse/services/collaboration_manager.py - Collaboration service
src/optiverse/services/collaboration_service.py - Logging service
src/optiverse/services/log_service.py - Error handling
src/optiverse/services/error_handler.py
Shared application state
- Layer tree state
src/optiverse/core/layer_tree_state.py - Undo commands
src/optiverse/core/undo_commands.py - Undo stack
src/optiverse/core/undo_stack.py - Optical models
src/optiverse/core/models.py - Preferences
src/optiverse/core/preferences.py - Platform paths
src/optiverse/platform/paths.py
Other components
- Optics designer
- Collaboration peers
Connections 41
- Optics designer → Application window: uses
README.md - Application window → Theme management: applies
src/optiverse/app/main.py - Application window → Scene interaction: handles scene events
- Scene interaction → Component placement: dispatches tools
src/optiverse/ui/views/scene_event_handler.py - Scene interaction → Move and rotate: delegates drags
src/optiverse/ui/views/scene_event_handler.py - Component placement → Component creation: creates items
src/optiverse/ui/views/placement_handler.py - Component placement → Undo stack: records placement
src/optiverse/ui/views/placement_handler.py - Move and rotate → Undo stack: records moves
src/optiverse/ui/controllers/item_drag_handler.py - Move and rotate → Layer tree state: reads group state
src/optiverse/ui/controllers/item_drag_handler.py - Measurement tools → Undo stack: records measurements
src/optiverse/ui/views/tool_handlers.py - Measurement tools → Ray models: reads ray paths
src/optiverse/ui/views/tool_handlers.py - Application window → Ray tracing control: coordinates tracing
- Ray tracing control → Ray tracing engine: traces rays
src/optiverse/ui/controllers/raytracing_controller.py - Ray tracing control → Ray rendering: updates display
src/optiverse/ui/controllers/raytracing_controller.py - Ray tracing engine → Ray models: produces paths
src/optiverse/raytracing/engine.py - Ray tracing engine → Optical models: uses optical models
src/optiverse/raytracing/engine.py - Application window → Assembly save and load: saves assemblies
- Assembly save and load → Serializable type registry: serializes items
src/optiverse/services/scene_file_manager.py - Assembly save and load → Layer tree state: loads layer state
src/optiverse/services/scene_file_manager.py - Assembly save and load → Linked assemblies: resolves linked data
src/optiverse/services/scene_file_manager.py - Assembly save and load → Persistent storage: persists data
- Serializable type registry → Component creation: restores item types
- Application window → Component library: manages library
- Component library → Persistent storage: uses storage
src/optiverse/ui/controllers/library_manager.py - Application window → Zemax import: imports designs
- Optics designer → Linked assemblies: references assemblies
README.md - Optics designer → Zemax import: imports Zemax
README.md - Optics designer → Measurement tools: measures optics
README.md - Optics designer → Collaboration controls: starts collaboration
README.md - Collaboration controls → Collaboration manager: controls session
src/optiverse/ui/controllers/collaboration_controller.py - Collaboration manager → Collaboration service: synchronizes state
src/optiverse/services/collaboration_manager.py - Collaboration manager → Layer tree state: updates scene state
src/optiverse/services/collaboration_manager.py - Collaboration peers → Collaboration service: connects
README.md - Preferences → Persistent storage: loads settings
- Assembly save and load → Platform paths: resolves file paths
src/optiverse/services/scene_file_manager.py - Collaboration manager → Logging service: logs activity
src/optiverse/services/collaboration_manager.py - Error handling → Logging service: reports errors
src/optiverse/services/error_handler.py - Application window → Error handling: installs handling
src/optiverse/app/main.py - Application window → Canvas views: presents canvas
- Optics designer → Optical objects: configures optics
README.md - Undo stack → Undo commands: executes commands
src/optiverse/core/undo_stack.py