Decompose InteractiveViewer into composed subsystem objects#68
Merged
brendancol merged 1 commit intomasterfrom Feb 28, 2026
Merged
Decompose InteractiveViewer into composed subsystem objects#68brendancol merged 1 commit intomasterfrom
brendancol merged 1 commit intomasterfrom
Conversation
Break the 6500-line god class into 10 focused subsystem modules under rtxpy/viewer/, using @Property delegation so all existing code paths (ViewerProxy, JupyterViewer, _MeshChunkManager, accessor.py) work unchanged. New subsystem classes: - InputState: keyboard/mouse input tracking - CameraState: position, orientation, FOV, time presets - RenderSettings: shadows, AO, colormap, denoiser, DOF - OverlayManager: overlay layers, basemap cycling, tile service - GeometryLayerManager: geometry groups, point cloud colors, chunks - TerrainState: raster data, spacing, elevation stats, mesh caches - ObserverManager + Observer: multi-observer system, viewshed, drones - WindState: wind particle simulation + GPU buffers - HUDState: title, legend, help pages, minimap Also: - Declarative key-binding dispatch tables replace ~300-line if/elif chain - 30 thin action methods for table-driven dispatch - reset_accumulation() replaces 10+ inline copies - Main loop: poll_events() moved before _tick(), extracted _drain_command_queue() and _present_if_dirty() Implements #61, #62, #63, #64.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
InteractiveViewergod class (~150 instance variables) into 10 focused subsystem modules underrtxpy/viewer/, using@propertydelegation so all existing code paths (ViewerProxy, JupyterViewer,_MeshChunkManager, accessor.py) work unchanged with zero modifications_handle_key_pressif/elif chain with declarative key-binding dispatch tables (SHIFT_BINDINGS,KEY_BINDINGS,SPECIAL_BINDINGS) and 30 thin action methodspoll_events()before_tick()(fixes one-frame input lag), extracts_drain_command_queue()and_present_if_dirty()New subsystem classes
input_state.pyInputStatecamera.pyCameraStaterender_settings.pyRenderSettingsreset_accumulation()overlays.pyOverlayManagergeometry_layers.pyGeometryLayerManagerterrain.pyTerrainStateobservers.pyObserverManager+Observerwind.pyWindStatehud.pyHUDStatekeybindings.pyImplements #61, #62, #63, #64.
Test plan
pytest rtxpy/tests/ -x)from rtxpy.engine import InteractiveViewer, exploreworksfrom rtxpy import exploreworksfrom rtxpy.notebook import JupyterViewerworks