-
Couldn't load subscription status.
- Fork 1
Add map2loop processing tool dialogs accessible from plugin menu #54
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: m2l_merge
Are you sure you want to change the base?
Conversation
- Created new directory loopstructural/gui/map2loop_tools/ with 5 self-contained widgets - SorterWidget: GUI for automatic stratigraphic column sorting - UserDefinedSorterWidget: GUI for user-defined stratigraphic columns - SamplerWidget: GUI for Decimator and Spacing samplers - BasalContactsWidget: GUI for basal contacts extraction - ThicknessCalculatorWidget: GUI for thickness calculations - Created Map2LoopToolsTab to incorporate all widgets into main dock - Added new "Map2Loop Tools" tab to ModellingWidget - All widgets follow existing patterns (QWidget + .ui files) - All widgets are self-contained with get/set parameter methods Co-authored-by: lachlangrose <[email protected]>
Co-authored-by: lachlangrose <[email protected]>
|
@copilot instead of calling the processing tools directly in the gui widgets can you call the underlying map2loop classes e.g. SamplerSpacing, SamplerDecimator as these are effectively an API for map2loop. Also do not add these tools to the modelling widget, can you add them as pop up dialog widgets that can be accessed under the LoopStructural menu e.g. plugins->LoopStructural->extract basal contacts |
- Removed map2loop_tools_tab.py - tools no longer embedded in modelling widget - Reverted modelling_widget.py to remove Map2Loop Tools tab - Created dialogs.py with QDialog wrappers for all 5 tools - Updated sampler_widget.py to call SamplerDecimator/SamplerSpacing directly - Added menu items under Plugins->LoopStructural for each tool: - Sampler - Automatic Stratigraphic Sorter - User-Defined Stratigraphic Column - Extract Basal Contacts - Thickness Calculator - Updated plugin_main.py with dialog show methods and menu cleanup Co-authored-by: lachlangrose <[email protected]>
I've made the requested changes in commit 8a3dbeb: 1. Call map2loop classes directly
2. Popup dialogs from menu
The sampler widget now demonstrates the pattern for calling map2loop API directly. The other widgets (sorter, basal_contacts, thickness_calculator, user_defined_sorter) still use |
Overview
This PR implements popup dialog components for each of the map2loop processing tools, accessible from the plugin menu. These tools call the map2loop API classes directly instead of using QGIS processing algorithms, providing a more direct integration with the map2loop library.
Changes
Dialog Components Created
Five dialog components have been added in
loopstructural/gui/map2loop_tools/:SamplerDialog - Contact sampling
SamplerDecimatorandSamplerSpacingdirectlySorterDialog - Automatic stratigraphic column sorting
UserDefinedSorterDialog - Manual stratigraphic column definition
BasalContactsDialog - Basal contacts extraction
ThicknessCalculatorDialog - Stratigraphic thickness calculation
Menu Integration
Added 5 new menu items under Plugins → LoopStructural:
Each menu item opens a popup dialog with the corresponding tool interface.
Direct map2loop API Usage
The sampler dialog demonstrates calling map2loop classes directly:
SamplerDecimatorandSamplerSpacingfrommap2loop.samplersampler.sample(spatial_data_gdf)This pattern provides a thin interface layer over the map2loop API, allowing users to leverage map2loop's capabilities directly from QGIS.
Architecture
Each dialog follows established plugin patterns:
QWidgetwith corresponding.uifile loaded viauic.loadUi()get_parameters()andset_parameters()methods for reusabilityDesign Philosophy Compliance
This implementation adheres to the plugin's architectural principles:
Files Added
Files Modified
loopstructural/plugin_main.py- Added menu items and dialog show methodsUsage Example
Benefits
Testing
Note: Full functional testing requires a QGIS environment with PyQt5, which is not available in CI. Manual testing in QGIS is recommended.
Related
This PR provides direct access to map2loop processing tools as an API within the plugin's GUI, making the workflow more streamlined for users performing geological modeling tasks.
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.