Commit Graph
48 Commits
Author SHA1 Message Date
Magne Sjaastad 064ac45da0 ResInsight: Migrate project data model to attribute map 2026-10-17 13:23:22 +02:00
Magne Sjaastad b0e8d0b62c Make RicHistogramPlotTools robust against null plots, data sources, and missing singletons
Guard all public entry points against null plot/data-source/curve/ensemble arguments, null-check RiaGuiApplication::instance() and RimMainPlotCollection::current() before dereferencing, and skip null curves/data sources when collecting existing data sources.
2026-10-05 19:56:10 +02:00
Kristian Bendiksen a7bd331bb3 #14524 Histogram: Hide filter info with curve collection 2026-08-19 12:23:07 +02:00
Kristian Bendiksen 488d631d81 #14524 Histogram: Start a user-defined bin range at the data range
Initialize the min and max cutoffs to the data range of the selected result
when the bin range mode is set to User Defined. The previous fixed default of
[0..1] excluded most values for results like PERMX.

The data range is computed by the same statistics query as the histogram,
respecting the selected time step and an active visible-cells filter, but
without custom binning so min and max are the range of the data.
2026-08-19 12:23:07 +02:00
Kristian Bendiksen 05588f4327 #14524 Histogram: Reset user-defined bin range on property change
A user-defined bin range is tied to the value range of a specific result: a
range set up for FLUXNUM does not apply to PERMX. Reset the bin range mode to
Automatic and the min/max cutoffs to their defaults when another property is
selected, and reset the stale cutoffs when the user sets the bin range mode
back to Automatic.
2026-08-19 12:23:07 +02:00
Kristian Bendiksen 5f465bf19a #14524 Histogram: Set linear binning when selecting a non-logarithmic property
Make the property-driven binning mode symmetric: selecting a non-logarithmic
result (e.g. FLUXNUM) after a logarithmic one (e.g. PERMX) sets the binning mode
and x-axis back to linear.

Replace the one-way logarithmicBinningEnabled signal with a binningModeChanged
signal carrying the new mode, so the x-axis scale follows the binning mode in
both directions, also when the binning mode itself is changed in the UI.
2026-08-19 12:23:07 +02:00
Kristian Bendiksen aaaf5689aa #14524 Histogram: Enable logarithmic binning when selecting a logarithmic property
Selecting a logarithmic result manually in the grid statistics data source
property editor now enables logarithmic binning and a logarithmic x-axis, the
same as creating the plot from a 3D view.

The previously selected result variable is tracked so that only an actual
property change enables logarithmic binning: other property edits leave a
user-selected binning mode alone, and binning modes stored in project files are
kept as-is on load.
2026-08-19 12:23:07 +02:00
Kristian Bendiksen 6c2c13770e #14524 Histogram: Auto-select logarithmic binning and show filter info text
Select logarithmic binning and a logarithmic x-axis automatically when creating a
grid statistics histogram plot from a 3D view showing a logarithmic result
(RiaResultNames::isLogarithmicResult).

Show a plot info label at the top right of the plot canvas describing active data
filters: "Filter: Visible cells in 3D view" when a cell filter view is set, and
"Filter: User defined x-range [min..max]" when the bin range is user-defined. The
label collects unique filter descriptions from the data sources of all visible
curves and is removed when no filters are active.
2026-08-19 12:23:07 +02:00
Kristian Bendiksen 5674130504 #12720 Histogram: Recreate summary vector curves when dropping an ensemble
When an ensemble is dropped on a histogram plot showing summary vector curves,
create a new curve per distinct vector and time step for the dropped ensemble,
matching the existing behavior for ensemble parameter curves.
2026-08-13 07:19:18 +02:00
Kristian Bendiksen 2a19af2321 #12720 Histogram: Accept summary vector drag'n'drop on histogram multi plot
Add a virtual RimMultiPlot::handleDroppedObjects so RiuMultiPlotBook routes drop
events to any multi plot type instead of only RimSummaryMultiPlot. Implement the
handler in RimHistogramMultiPlot: each dropped ensemble summary vector, ensemble
parameter or file set ensemble creates its own new histogram subplot, following
the behavior of the summary multi plot. Extract RimHistogramPlot::isDroppableObject
so unsupported dropped objects do not create empty subplots.
2026-08-13 07:19:18 +02:00
Kristian Bendiksen 329b7e7876 #7750 Histogram Plot: Group bin settings in a 'Bins' property group
Move Number of Bins and the new binning fields into a shared UI group created by
RimHistogramDataSource::appendBinningUiOrdering().
2026-08-13 07:19:18 +02:00
Kristian Bendiksen d96159fb7c #7750 Histogram Plot: Add logarithmic binning and user-defined bin range
Add BinningMode (Linear/Logarithmic) and OutOfRangeHandling (Exclude/Include in
Boundary Bins) to RigHistogramCalculator, with defaulted constructor arguments so
existing callers are unaffected. All four histogram plot data sources get shared
options for binning mode and an optional user-defined bin range through new PDM
fields on RimHistogramDataSource.

The grid statistics data source computes non-default histograms through a new
non-caching RigStatisticsDataCache::computeHistogram() pass-through, leaving the
cached statistics used by the 3D overlay and the P10/P90/mean annotation lines
untouched.

Selecting logarithmic binning enables logarithmic scale on the plot X axis once,
via a new signal handled by RimHistogramCurve.

Also fix the bin index computation to use uniform bins of width range/nBins,
consistent with calculatePercentil() and the bin edges drawn by the plots. The
previous divisor (nBins - 1) shifted counts by up to one bin width relative to
the drawn bars and slightly biased histogram-based percentile estimates.
2026-08-13 07:19:18 +02:00
Magne Sjaastad 56e98ba1c4 #14476 ApplicationLibCode: Replace CVF_ASSERT with CAF_ASSERT
Migrate all assert macros in ApplicationLibCode to CAF_ASSERT and remove every
use of cvfAssert.h.

CVF_ASSERT is replaced one to one. CVF_TIGHT_ASSERT is also replaced by
CAF_ASSERT, which is semantically exact: CVF_ENABLE_TIGHT_ASSERTS is 1 only
under _DEBUG, and that is what CAF_ASSERT now does. The two CVF_FAIL_MSG sites
become CAF_ASSERT( false && "message" ), preserving the message with the idiom
already used elsewhere in the code base.

Counts before and after: CVF_ASSERT 1044 to 0, CVF_TIGHT_ASSERT 66 to 0,
CVF_FAIL_MSG 2 to 0, cvfAssert.h references 154 to 0.

Include handling: files that included cvfAssert.h directly now include
cafAssert.h instead, includes left dead by the migration are removed, and files
that were relying on cvfAssert.h transitively get an explicit cafAssert.h. Files
that reach cafAssert.h through another caf header are left unchanged; a missing
include here is a compile error, not a silently disabled assert.

ResultStatisticsCache links only LibCore and therefore had no path to
cafAssert.h. Add the cafPdmCore directory as a private include path rather than
linking the library, since cafAssert.h is header only.

Note that this stops these asserts from firing in Release and RelWithDebInfo,
where CVF_ASSERT was previously active.
2026-08-07 15:05:57 +02:00
Magne Sjaastad 4f5e320a65 #14403 Show histogram statistics lines when only the cumulative curve is visible
The P10/P90/Mean annotations were tied to the visibility of the histogram curve, making it impossible to show only the cumulative curve together with the statistics lines. The annotations are now drawn by the non-cumulative curve as long as either it or its cumulative counterpart curve is visible, and the statistics settings are presented only by the non-cumulative curve.
2026-07-31 08:23:18 +02:00
Magne Sjaastad b1e741d5c3 #14398 Guard against out of range time step in well allocation plot 2026-07-29 11:27:34 +02:00
Kristian Bendiksen 280763f4c0 #14203 Add cumulative curve option to Grid Statistics plot
A new "Show Cumulative Curve" checkbox on the grid statistics data source adds a cumulative curve on the right axis, in addition to the regular histogram curve. The cumulative curve shares the data source of its non-cumulative counterpart and follows all changes to it. The cumulative sum works with all frequency types and both graph types.

Remove the legacy Grid Statistics dialog (RicGridStatisticsDialog) and its context menu command, which provided the previous cumulative display.
2026-07-27 12:37:59 +02:00
Magne Sjaastad 2ebefe73b6 #14360 Histogram Plots: Implement Show Plot Data 2026-07-27 10:56:41 +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 277d8a4da8 #14075 Histogram: Compute percentiles and mean in a single call 2026-05-29 12:34:51 +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
Magne Sjaastad f9a081eb87 Migrate more classes to dynamic buttons 2026-03-31 10:52:29 +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 08af803a0e Delete unused functions and fields 2026-03-18 13:54:06 +01:00
Kristian Bendiksen d00d3f20b1 #13282 Histogram Plots: Add option for Logarithmic axis scale
Fixes #13282.
2026-01-20 11:44:01 +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
JJ 393917e6f3 Histogram drag/drop and paste improvements (#12851)
* Add drag'n'drop support for ensemble summary vectors and ensembles into histogram plots

* Make sure histogram plot is shown and all update signals are connected when loading a project.

* Support ensemble parameter drag'n'drop from data sources into histogram plots. 

* Show ensemble parameters in data sources tree.

* Add copy/paste of histogram curves

* Re-use all existing parameters in a plot when dragging a new ensemble into it
2025-08-29 15:12:32 +02:00
Magne Sjaastad 4d9a723e32 #12790 Replaces transparency with opacity settings
Simplifies color handling by replacing transparency settings with opacity for curve and fill colors.

This change provides a more intuitive user experience and ensures consistent behavior across the application.

- Renames "ColorTransparency" to "ColorOpacity" for RimCurveSetAppearance.
- Introduces "CurveColorOpacity" for RimPlotCurveAppearance.
- Updates blending calculations to correctly use opacity.
- Adjusts UI slider attributes for opacity settings, including minimum, maximum and decimals.
2025-08-27 13:50:36 +02:00
Kristian Bendiksen 9ae03cc633 Check for valid ensemble fracture statistics before use 2025-08-11 15:26:10 +02:00
Kristian Bendiksen 7977ed1dc0 Histogram: Provide filtering for ensemble parameter. 2025-08-11 15:26:10 +02:00
Kristian Bendiksen 814f94f1b4 Histogram: fix missing update when removing curve. 2025-08-11 15:26:10 +02:00
Kristian Bendiksen c9fedefea7 Histogram: Fix crash when toggling histogram plot check box.
The std::unique_ptr<RiuPlotWidget> would delete the widget when
RimHistogramPlot object was recreated. This would lead to a
double-delete since the RiuPlotWidget was already deleted by Qt
through the parent-child relationship.

Fixed by using QPointer, and leaving the cleanup to Qt.
2025-08-11 15:26:10 +02:00
Kristian Bendiksen 9f6e2ba665 Histogram: remove unused right axis. 2025-08-11 15:26:10 +02:00
Kristian Bendiksen f004cda2a1 Histogram: apply axis properties, and hide irrelevant options. 2025-08-11 15:26:10 +02:00
Kristian Bendiksen 6265e18186 Histogram: Hide irrelevant appearance options. 2025-08-11 15:26:10 +02:00
Kristian Bendiksen 4bec16aa83 #12614 Histogram: improve config grouping. 2025-08-11 15:26:10 +02:00
Kristian Bendiksen 35a77b9778 #12614 Histogram: make it easier to create histograms. 2025-08-11 15:26:10 +02:00
Kristian Bendiksen 0da6e3ccb5 Histogram: add data source for ensemble fracture statistics histograms. 2025-07-04 16:57:41 +02:00
Kristian Bendiksen 11d85583dd Histogram: Use new plot for "Create Grid Statistics in 3d view". 2025-07-04 16:57:41 +02:00
Kristian Bendiksen d6b79ae328 Histogram: Update grid statistics histogram when filter changes. 2025-07-04 16:57:41 +02:00
Kristian Bendiksen f743394d8b Histogram: provide more reasonable default for data sources. 2025-07-03 08:35:10 +02:00
Kristian Bendiksen 5662b43ec5 Grid Statistics Histogram: make sure reloading project works. 2025-07-03 08:35:10 +02:00
Kristian Bendiksen e095f524c8 Histogram: Use vertical labels. 2025-07-03 08:35:10 +02:00
Kristian Bendiksen 9066dd0011 Histogram: add individual check boxes for P10, Mean, and P90. 2025-07-03 08:35:10 +02:00
Kristian Bendiksen c3e68c1125 Histogram: close sides of first and last bar. 2025-07-03 08:35:10 +02:00
Kristian Bendiksen b46e55bc21 Histogram Plot: add P10, mean and P90. 2025-06-30 21:49:29 +02:00
Kristian Bendiksen a878d947e8 Curve Appearance: add transparency slider. 2025-06-26 08:25:34 +02:00
Kristian Bendiksen 26e8282546 Histogram Plot: add time step to summary data source. 2025-06-26 08:25:34 +02:00
Kristian Bendiksen 923a44d75e Add new and more general histogram plots. 2025-06-26 08:25:34 +02:00