Commit Graph
84 Commits
Author SHA1 Message Date
Magne Sjaastad 593f27dcf4 Guard against null case and view when painting overlay and creating intersections
Four crashes reported from release builds share the same shape: a pointer that
is null during teardown or before a view is fully created is dereferenced
without a check.

RiuViewer::paintOverlayItems() used the owner case of the view and of the
comparison view without checking it, and dereferenced the result of a
dynamic_cast directly. The owner case is null while a case is being closed.

RicIntersectionFeatureImpl::createIntersectionBoxSlize() checked
activeMainOrComparisonGridView() but dereferenced activeGridView(), which is a
different object and can be null or have no viewer.

RimEclipseContourMapView::onCreateDisplayModel() called viewer()->mainCamera()
before the viewer exists.

RimCorrelationPlotCollection::applyFirstEnsembleFieldAddressesToPlot() called
front() on the ensemble parameter vector, which is empty for an ensemble
without realization parameters.
2026-08-07 12:21:41 +02:00
Magne Sjaastad 931c8d066c #14235 Correlation report: synchronise all sub-plots and control data source from the report
Selecting a summary vector in a correlation report now propagates to the contained tornado, cross and summary plots by selecting the first matrix cell, which sends the existing selection signal handled by the report. A virtual onDataSourceChanged() hook on the abstract correlation plot is called after the summary vector selection dialog, and the matrix and tornado plots override it to re-select their first item so dependent plots update.

When a plot is used as a sub-plot of a correlation report, the data source and correlation settings are controlled from the report, so its property editor exposes only the plot settings. Used individually the plots show the complete set of options. Whether a plot is a report sub-plot is tracked with a flag set by the owning report on construction and after read.

Use updateAllRequiredEditors() for sub-plot interactions and for time step changes driven from the summary plot, so the project tree text and property panel reflect the updated auto-generated titles. Re-apply the configured dock title bar visibility after toggling a sub-plot dock, so the title bar stays hidden when a hidden sub-plot is shown again.
2026-06-26 17:09:26 +02:00
Jon Jenssen d2d7c6ac61 First non-MDI version. Still some missing links and features. 2026-06-17 13:55:32 +02:00
Magne Sjaastad 01ce94d539 #14174 Fix crash when creating Correlation Report Plot
Guard against empty curve definitions and time steps in
RimCorrelationPlotCollection. When the first ensemble has no FOPT
summary vector, the tornado/cross-plot curve definition vector was
empty and calling .front() on it dereferenced invalid memory,
causing a segfault in RiaSummaryCurveDefinition::summaryAddressY().
2026-06-10 13:09:43 +02:00
Magne Sjaastad 071d6cc19e #14050 CMake: Remove dead variable definitions and references
* CMake: Remove dead CODE_HEADER_FILES variable
* CMake: Remove dead COMMAND_CODE_HEADER_FILES and COMMAND_MOC_SOURCE_FILES
* CMake: Remove dead MOC_SOURCE_FILES and FORM_FILES_CPP references
* CMake: Remove dead HEADER_FILES reference
* CMake: Delete unused CustomPCH.cmake superseded by target_precompile_headers
2026-05-26 13:10:20 +02:00
Kristian Bendiksen cc574e7a7b #14006 CorrelationPlot: Guard against empty time steps in fieldChangedByUi
Changing the time step filter combo box crashed when the plot had no
available time steps: filteredTimeStepIndices returned an empty vector
and .back() invoked undefined behaviour. Skip the m_timeStep assignment
when either allDateTimes or filteredTimeStepIndices is empty.

Fixes #14006.
2026-05-20 18:04:01 +02:00
Magne Sjaastad b27199f4ba RimRftCorrelationReportPlot: Rename correlation plot field and accessor to tornado plot 2026-04-29 10:16:24 +02:00
Magne Sjaastad 42a11da26b Correlation: Sync depth range to tornado and use RFT curve depth values for filtering 2026-04-29 10:16:24 +02:00
Magne Sjaastad 72b6aafa01 Correlation: Sync report plots, fix stale annotations and selection highlight, tune RFT defaults 2026-04-27 15:44:14 +02:00
Magne Sjaastad bd3836ba25 #13901 ShowPlotData: Invert dependencies via capability mixins and text-dialog signal 2026-04-20 14:09:25 +02:00
Magne Sjaastad 99910c3d7d #13903 Harmonize correlation and tornado bar-chart behavior
Extract shared helpers into a new RimCorrelationBarChartTools
namespace so RimCorrelationPlot and RimRftTornadoPlot share a
single source of truth for:

- highlightSelectedParameterBar and the click-to-parameter-name
  lookup
- the axis-label format, abs/sort-value math, and the
  addBarEntry call (with the "legendText must equal parameter
  name" convention) via addCorrelationBar

Also enable click-to-select on RimCorrelationPlot: use the
parameter name as the bar chart title so click-to-select works,
and recolor the selected bar via a new HighlightBarColor field,
mirroring the pattern used in RimRftTornadoPlot.
2026-04-20 11:41:26 +02:00
Magne Sjaastad 387b19ef62 #12276 Add RFT correlation report plot with cross-plot and tornado plot
* Fix defensive guards and TVD interpolation

Guard against out-of-bounds IJK and invalid cells in RifReaderRftInterface.
Guard against null eclCase in RimDataSourceForRftPlt::address.
Guard against null plot widgets in RiuMultiPlotPage.
Fix interpolateMdFromTvd corrupting valid entries after infinity TVD values
by skipping infinity entries in the first pass and tracking only the last
two valid MD values for the startMD adjustment.

* Add RiuQwtCurveSelectorFilter for click-to-select realization in Qwt plots

New shared event filter class that installs on a QwtPlot canvas and calls a
user-supplied callback with the closest data point on each click.

Migrate the local CurveSelectorFilter in RimParameterResultCrossPlot to use
the new shared class. Add Z_HIGHLIGHTED_CURVE to ZIndex enum and replace all
raw z-order integers in RiuQwtPlotCurveDefines with named constants.

* Add RFT correlation report plot with cross-plot and tornado plot

New classes:
- RimRftCorrelationReportPlot: composite plot showing an RFT well log track
  alongside a parameter cross-plot and a tornado plot sub-plot.
- RimParameterRftCrossPlot: cross-plot of ensemble parameters vs RFT-derived
  measured depth values, with click-to-select realization support.
- RimRftTornadoPlot: tornado plot with correlation-sorted parameter list and
  click-to-select realization support.
- RicCreateRftCorrelationReportFeature: context menu command on RimWellRftPlot
  that creates a RimRftCorrelationReportPlot in the correlation plot collection.

Wire up in RimCorrelationPlotCollection and RimContextCommandBuilder.

* Add click-to-select and highlight selected realization in RFT plots

Install RiuQwtCurveSelectorFilter on RimWellRftPlot canvas to support
click-to-select realization. Highlight the selected realization using a
contrast color (orange-red) and increased line thickness. React to both
click-to-select in the plot and selection changes in the Data Sources panel.

Add Z_HIGHLIGHTED_CURVE z-order and replace raw z-order integers with
named constants in RimWellRftPlot.

Highlight selected realization with XCROSS symbol in RimParameterRftCrossPlot
via RimSummaryEnsembleTools::findSummaryCase.

* RimWellRftPlot: add Create RFT Correlation Report to canvas right-click menu

Override appendMenuItems in RimWellRftPlot to add RicCreateRftCorrelationReportFeature.
Call appendMenuItems from RiuMultiPlotPage::contextMenuEvent so any plot type
can contribute canvas menu items without modifying RiuMultiPlotPage.

* RicShowPlotDataFeature: support RimRftCorrelationReportPlot

Add RimRftCorrelationReportPlot to the isCommandEnabled check and expand
it into its cross-plot and tornado sub-plots in onActionTriggered, matching
the pattern used for RimCorrelationReportPlot.
2026-04-16 16:45:44 +02:00
Magne Sjaastad 791a58c9a7 #13874 CorrelationPlot: Fix crash when text parameters are present in ensemble
Add parameter.isNumeric() guard and bounds check in RimCorrelationMatrixPlot::createMatrix(). Text parameters deduplicate values into fewer entries than ensemble cases, causing out-of-bounds access. Add defensive bounds check in RimParameterResultCrossPlot::createCaseData() for consistency.
2026-04-16 16:43:36 +02:00
Magne Sjaastad 2f63230c61 Refactor CorrelationReportPlot: replace showSummaryPlot/AddressSelector with child visibility and dock title bar toggle
- Remove RimSummaryAddressSelector; sync summary plot address directly from curve definitions
- Add defineUiTreeOrdering to expose sub-plots as tree children with showWindow toggle
- Dock widgets now reflect showWindow() state and close signal updates the model
- Add m_showDockTitleBars field to toggle dock area title bar visibility
- Update auto plot title for correlation matrix to 'Pearson Correlation'
2026-04-09 15:18:36 +02:00
Magne Sjaastad f96e509c05 Add click-to-select realization in ParameterResultCrossPlot
Clicking near a data point in the cross plot selects the closest
summary case in the plot main window data source tree view.
2026-04-09 15:18:36 +02:00
Magne Sjaastad a8ac98ce06 Replace PdmUiPushButtonEditor fields with dynamic buttons
Replace boolean push button fields used as UI triggers with dynamic buttons
added via addNewButton in defineUiOrdering, removing unnecessary field
boilerplate across multiple classes.
2026-03-31 09:16:52 +02:00
Magne Sjaastad ba1055fbc4 #13813 Remove duplicated snapshotWindowContent overrides that replicate base class behavior 2026-03-30 17:59:01 +02:00
Magne Sjaastad 4798a879d0 Refactor based on review
Harmonize plot title enablement for sub-plots
Encapsulate tracking annotation management in RimCorrelationReportPlot
Improve snapshot capture in RimCorrelationReportPlot
2026-03-30 12:06:57 +02:00
Magne Sjaastad c49b6986c0 CorrelationReportPlot: Refinements, fixes, and simplifications
- Use RimViewWindow in RiuCorrelationReportPlotWidget constructor
- Update default dock layout to match desired screenshot
- Generalize context menu selection fixer to use caf::PdmObject
- Simplify code, fix event filter lifetime, plot titles, and disable summary plot zoom

RiuSummaryQwtPlot: Add missing override keyword to setZoomEnabled
2026-03-30 12:06:57 +02:00
Magne Sjaastad 3fa91d2d6b CorrelationReportPlot: Add time readout, fix context menus, and improve layout
- Add time readout to summary plot with static and tracking lines
- Fix unstable context menus by setting selection before menu build
- Support global default dock layout and enable summary plot
- Fix snapshot and hide tracking annotation on mouse leave
2026-03-30 12:06:57 +02:00
Magne Sjaastad d64dcefc07 CorrelationReportPlot: Add optional summary plot with ADS dock manager layout
- Add optional summary plot in upper right corner
- Replace fixed grid layout with ADS dock manager for flexible layout
- Show plot titles and set splitter width to 1px
- Use setupBeforeSave to persist dock layout state
2026-03-30 12:06:57 +02:00
Magne Sjaastad d52f595c41 Refactor: Rename RiaStatisticsTools to RigStatisticsTools
Replaced all references to RiaStatisticsTools with RigStatisticsTools across the codebase, including header includes, static method calls, and test files. Updated CMake configuration to remove RiaStatisticsTools and add RigStatisticsTools. Renamed and updated related unit tests. No changes to logic or algorithms; this is a namespace and organizational refactor for consistency. Also added ApplicationLibCode include directories as PRIVATE to relevant targets.
2026-02-18 09:22:39 +01:00
JJ 3e06a61ed5 Popup window placement improvements (#13464)
* Improve parent settings for message boxes and progress info
2026-01-21 19:11:41 +01:00
Magne Sjaastad cfd634e206 Updates PDM UI label positioning
Updates the way UI label positions are set for PDM fields.
2026-01-08 21:44:58 +01:00
Magne Sjaastad 5f2e2919c8 Avoids iterator invalidation in QwtPlot item lists
When working with a summary ensemble in a Debug build on Windows, a crash happened in RiuQwtPlotWidget::resetPlotCurveHighlighting(). When iterating over list of plot items, one pointer to item pointed to 0xddddddd, a clear indication that the underlying list had been updated during the loop and the iterator invalidated.

The change ensures that modifications to the item list during iteration do not cause unexpected behavior, particularly in scenarios involving grid lines and curve highlighting.

This is achieved by making a copy of the item list before iteration when modifications may occur. For cases where no add/remove will be performed during the iteration, a comment is added to clarify that it is safe to access the reference to the list.
2025-10-14 12:52:24 +02:00
Magne Sjaastad 546edadf35 Refactors font size handling using RimFontSizeField
Replaces direct PdmField usage for font sizes with the new
RimFontSizeField. This provides a consistent way to manage font
size options across different plot types.

The RimFontSizeField encapsulates the logic for generating font size
options based on the default plot font size from preferences. This
removes redundant code in various plot classes and ensures that font
size settings are synchronized with user preferences.
2025-08-25 12:43:36 +02:00
Kristian Bendiksen 923a44d75e Add new and more general histogram plots. 2025-06-26 08:25:34 +02:00
Magne Sjaastad b6b1bf053e Show selected realizations using X-cross symbol 2025-04-11 15:38:52 +02:00
Magne Sjaastad 0635d5870a #12291 Several minor adjustments
* Use same naming for ensemble grid cases as ensemble summary cases
* Create Polygons: Ask for polygon area cutoff when polygon count is high
* Show Create Polygons from Contour Map in polygon collection menu
* Update titles in crossplots
* Clear message panel when project is closed
* Show text message for start and complete of replace ensemble
2025-03-26 21:50:39 +01:00
Magne Sjaastad d592b29090 #12270 Create a summary ensemble based on a selection of realizations
Add RicCreateSummaryEnsembleFeature used to create an ensemble based on a selection of realizations. Delete obsolete features to create summary groups.

Add context menu in parameter cross plots to create ensemble from filtered summary cases.
2025-03-18 12:55:19 +01:00
Magne Sjaastad 4f87b911a8 Improve naming of correlation plots 2025-03-18 12:55:19 +01:00
Magne Sjaastad 27951cf20c #12269 User interface improvements
- set significant digits to 4
- cache the parameter filter values
- move the parameter filter above plot settings
2025-03-18 12:55:19 +01:00
Magne Sjaastad 42342e0a1a #12235 Correlation Plot: Add range filter for x and y values
Add range filter for x and y axis, and compute the correlation based on the values inside the range window. Show the excluded realizations as text.
2025-03-14 14:03:09 +01:00
Magne Sjaastad 9e4da38087 Remove legend and show realization text when close to sample 2025-03-11 09:05:42 +01:00
Magne Sjaastad 5f7823b8d3 Use point size when defining font size
Avoid pixel size for easier config across multiple environments
Set default font size for plots to 10 points
Use Small instead of XSmall for default font in plot
Remove pt postfix to indicate point size
2025-03-10 16:56:16 +01:00
Magne Sjaastad 559599c72d Set max number of correlations to 5 2025-03-10 13:18:23 +01:00
Magne Sjaastad ca0179d118 Remove obsolete CMake statements
When using modern CMake and Qt6 we can remove obsolete source_group() and QT_MOC_HEADERS
2025-01-28 07:01:42 +01:00
Magne Sjaastad 7550b8702c Rename delta ensemble and case
Rename to RimDeltaSummaryCase and inherit RifSummaryReaderInterface
Rename to RimDeltaSummaryEnsemble

Remove obsolete RifDerivedEnsembleReader
2024-11-13 15:18:10 +01:00
Magne Sjaastad 275526a64a Remove unused includes
Remove unused includes, mostly AppEnum.h
2024-11-04 09:54:23 +01:00
Magne Sjaastad df091336e0 Move summary tools into separate folder 2024-10-22 07:28:43 +02:00
Kristian Bendiksen e9c46c5cec Rename RimSummaryCaseCollection to RimSummaryEnsemble. 2024-07-30 08:55:12 +02:00
Magne Sjaastad 16215585be Refactoring to prepare for renaming of RimSummaryCaseCollection
Move functions into RimSummaryEnsembleTools
Use enum class instead of plain enum
2024-06-24 15:33:38 +02:00
Magne Sjaastad b8391e6f92 Remove pure virtual from RimPlotCurve
Make it possible to use RimPlotCurve directly. Remove depnendencies on special implementation in derived classes.
2024-05-13 15:45:55 +02:00
Magne Sjaastad bfda6519db Cleanup includes
Use new tools in Visual Studio to help cleaning up includes and remove redundant includes.
2024-03-07 19:45:43 +01:00
Magne Sjaastad 6fe997b3c9 Add and use caf::PdmUiPushButtonEditor::configureEditorLabelHidden 2024-02-23 08:47:52 +01:00
Magne Sjaastad ce513be638 Remove all use of .uiCapability()->setUiTreeHidden( true ); 2024-02-05 10:15:36 +01:00
Magne Sjaastad 678a368361 Refactor LayoutOptions to improve readability
* Make it possible to use designated initializer list
- remove default constructor
- move static member to outer scope

* Add helper function to add field on same row
2023-11-10 14:48:56 +01:00
Magne Sjaastad cdda7480f3 Show Plot Data missing for some plots
* Add plotContentAsText() to bar chart builder
* Add show plot data to analysis plot
* Refactor analysis plot
* Enable context menu in Analysis Plot
* Add show plot data for general RimPlots
* Show plot data for correlation report in three separate text dialogs
2023-10-11 08:54:52 +02:00
Kristian Bendiksen d177491843 #10648 Refactor summary reader: return std::vector<double> instead of taking ptr. 2023-10-02 09:16:52 +02:00
Magne Sjaastad f07a5db559 Use post fix Y in RiaSummaryCurveDefinition 2023-09-20 09:58:48 +02:00