Commit Graph
633 Commits
Author SHA1 Message Date
Magne Sjaastad 1c4c304064 #14476 ApplicationLibCode: Remove unused cvf includes
Remove 95 cvf include lines that the including file does not use. Found by
extracting the symbols declared by every VizFwk header, including symbols they
re-export, and flagging includes where none of those symbols appear anywhere in
the file. Each removal is verified by a full build.

Most of them are cvfVector3.h and cvfObject.h, left behind as the files they
were once needed by changed.

pch.h is left untouched. It includes cvfObject.h and cvfVector3.h on purpose, so
that the files using the precompiled header do not have to.

Note that a clean build after removing an include does not prove the include was
unnecessary, only that the declarations still arrive some other way. That path
can differ between platforms and with RESINSIGHT_ENABLE_UNITY_BUILD, so this
needs a CI round on Linux as well.
2026-08-07 15:05:57 +02:00
Magne Sjaastad 0a4bebcd41 #14476 ApplicationLibCode: Remove includes of cvfBase.h
cvfBase.h includes cvfAssert.h, so these six files were the last indirect route
into the assert header that the previous commit removed from ApplicationLibCode.

Five files dropped the include with no further change. RimSeismicAlphaMapper
declared alphaValue as returning cvf::ubyte, a typedef defined in cvfBase.h
itself, so no smaller VizFwk header provides it. Since cvf::ubyte is
unsigned char, use that directly in the declaration, the definition and the
cast. The type is identical, so callers are unaffected, and the class no longer
depends on VizFwk at all.
2026-08-07 15:05:57 +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 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 d30d5e7817 Fix crashes reported by crash telemetry
* Use guarded pointer for delayed plot updates

The cached result definition can be deleted before the delayed update is
executed, causing a crash in the PVT and relative permeability plot panels.

* Guard against fracture definition without conductivity result

The list of conductivity result names is empty for some fracture
definitions, causing an out of range access when computing statistics.

* Guard against missing data source in custom VFP plot

The data source of a VFP table can be null, and the VFP tables are not
available until the data has been imported.
2026-08-07 12:14:03 +02:00
Magne Sjaastad 318659e130 Fix crashes reported by crash telemetry
* Recompute well cell arrays when the grids change

computeWellCellsPrGrid() returned early whenever the arrays had been computed once, so the
size check below it was unreachable and a stale array was kept when the grids changed. The
too-short array triggered an assert in RivReservoirViewPartMgr::computeNativeVisibility.

Return early only when the cached arrays still match the current set of grids.

* Guard against missing GUI application when applying style sheet

RiaGuiApplication::instance() does a dynamic_cast and returns null outside a GUI context. The
assert guarding this is compiled out in release, so the null pointer was dereferenced.

* Guard against missing case in flow characteristics plot field change

The case field can be set to nothing from the UI. RimEclipseResultCase::defaultFlowDiagSolution()
and reservoirViews() were then called on a null pointer.

* Guard against missing case and out of range time steps when updating flow characteristics plot

onLoadDataAndUpdate() dereferenced the case without checking, although the same function handles
a missing case further down. The time step indices come from the flow diagnostics solution, and
were used to index arrays sized by the number of case time steps without a range check.
2026-08-07 12:12:31 +02:00
Magne Sjaastad 1aa95936fc #14362 Allow arbitrary Z-scale factor
Make the Z-scale combo boxes in the toolbar and property editor editable, so any positive scale value can be entered as text. Invalid input is rejected and the previous value is restored.

Add keyboard shortcuts Ctrl+Shift+Up and Ctrl+Shift+Down to step the Z-scale of the active view through the predefined scale values.
2026-08-04 12:50:34 +02:00
Magne Sjaastad 4c39ce3e6c #14404 Guard against whitespace in AppEnum serialization text and fix affected enums 2026-07-30 08:41:27 +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
Kristian Bendiksen 5dc3374733 #14226 intersection along ijk axis
* #14226 Add intersection along i/j/k axis

Add a new persistent intersection type that follows the grid pillars at a
fixed i, j or k index. Unlike the axis-aligned intersection box, the surface
is built from the grid cell faces and therefore steps along faults and curved
pillars, which is useful for structural restoration analysis.

The user selects the axis, the fixed index, the two perpendicular index
ranges and which cell face (front/back pillar) to use. The geometry generator
emits the chosen cell face of every cell in the index plane directly from the
native pillar corners, so cell result colors map exactly.

The feature is available from the Intersections context menu for Eclipse
views and supports 3D-view picking and cell result readout.
2026-07-27 11:21:05 +02:00
JJ 82aa009378 Dock system selection improvements and fixes (#14305)
* Make sure we don't trigger another select when a view in the project tree is selected.
* Fix for #14255 and related issues
* Make sure we can close and open a main window, keeping the layout when reopened.
2026-06-24 16:07:21 +02:00
Magne Sjaastad 06cafed9bc #14275 Fix crash in multi-plot axis alignment when a plot lacks the queried axis
QwtPlot::axisWidget() returns NULL for an axis id that is not valid for a
given plot. RiuMultiPlotPage::alignAxis dereferenced the returned
QwtScaleWidget without a null check, causing a segmentation fault when a
plot in the grid does not have the queried axis. Guard the pointer in both
alignment loops, matching the existing null-check style in the function.
2026-06-22 15:29:44 +02:00
jonjenssen 947680fdf9 Do not activate a 3d view that already is active. 2026-06-22 14:16:47 +02:00
Magne Sjaastad 033c2e06b0 #14262 Fix missing grid statistics context menu entries
The grid statistics plot and show commands were only added to the context menu when the cursor was inside the overlay info box, so right-clicking on the grid geometry no longer offered them. Always add the create and show commands, and keep only the copy-to-clipboard command gated by the info box position.
2026-06-22 12:13:53 +02:00
Magne Sjaastad 8369fad029 Fix crash on project reset when accessing null project during teardown
RimProject::current() can return null while the project is being torn down. Guard the project access in the view-window lookups and valid-comparison-views query with an if-init statement so they return empty instead of dereferencing null.
2026-06-19 16:38:41 +02:00
JJ b187bf85a7 Add context menu to empty plot window area (#14243)
* Add context menu to empty plot window area
Improve drag'n'drop into empty plot window area
2026-06-19 09:25:33 +02:00
Jon Jenssen 113c39a02e Make sure we track all 3d views when changing active windows in 3d viewer 2026-06-19 02:08:49 +02:00
Jon Jenssen 13fdf40a36 Fix regression test crash 2026-06-18 15:06:29 +02:00
Jon Jenssen 0973dfd62b Some cleanup 2026-06-17 13:55:32 +02:00
Jon Jenssen 789f433d9d Support toggle titlebar on/off for plots and 3d viewers 2026-06-17 13:55:32 +02:00
Jon Jenssen b11727b546 Work in progress- hide/show titlebars 2026-06-17 13:55:32 +02:00
Jon Jenssen b42979c136 Track selection in 3d viewers 2026-06-17 13:55:32 +02:00
Jon Jenssen 82ad7d61f8 Trigger selection update when a new tab is activated 2026-06-17 13:55:32 +02:00
Jon Jenssen 18cf162ce0 Some cleanup 2026-06-17 13:55:32 +02:00
Jon Jenssen 255576d53d Clean up delete 3d views and project close/open
Update to latest qtadv docking
2026-06-17 13:55:32 +02:00
Jon Jenssen 361b4bc3db Work in progress: Support capturing snapshots with a given size. 2026-06-17 13:55:32 +02:00
Jon Jenssen 3b43dac7d4 Use unique id for all 3d and plot dock widgets. 2026-06-17 13:55:32 +02:00
jonjenssen ba5308881b Some fixes 2026-06-17 13:55:32 +02:00
jonjenssen 2faa1cd149 Some cleanup 2026-06-17 13:55:32 +02:00
jonjenssen a82b8f5753 Fix reading old projects and restore plot views
Fix crash at exit in plot window
2026-06-17 13:55:32 +02:00
Jon Jenssen 09ea2e7028 Store dock state in project 2026-06-17 13:55:32 +02:00
jonjenssen 7bd429b937 Plot window default dock states 2026-06-17 13:55:32 +02:00
Jon Jenssen bb2e0d2948 Work in progress 2026-06-17 13:55:32 +02:00
Jon Jenssen a1fe3739d1 Remove last traces of MDI 2026-06-17 13:55:32 +02:00
jonjenssen ff4a54121f Clean up main window ids 2026-06-17 13:55:32 +02:00
jonjenssen 27af39f614 Fix fullscreen in 3d window 2026-06-17 13:55:32 +02:00
jonjenssen 797d9ac2db Work in progress 2026-06-17 13:55:32 +02:00
jonjenssen 650bac4002 Add default layouts for 3d window 2026-06-17 13:55:32 +02:00
jonjenssen 9b93e4addc Minor updates 2026-06-17 13:55:32 +02:00
jonjenssen 3b4a732cb5 Work in progress 2026-06-17 13:55:32 +02:00
Jon Jenssen 551d0d8e55 Minor fix 2026-06-17 13:55:32 +02:00
Jon Jenssen 7fd55a0b91 Active view tracking for 3d window 2026-06-17 13:55:32 +02:00
jonjenssen ad73f8d26c Work in progress 2026-06-17 13:55:32 +02:00
jonjenssen fce05bdb81 Work in progress 2026-06-17 13:55:32 +02:00
jonjenssen ff40662366 Work in progress 2026-06-17 13:55:32 +02:00
Jon Jenssen 122cb01592 Work in progress 2026-06-17 13:55:32 +02:00
Jon Jenssen d2d7c6ac61 First non-MDI version. Still some missing links and features. 2026-06-17 13:55:32 +02:00
jonjenssen fee0599139 Work in progress 2026-06-17 13:55:32 +02:00
Jon Jenssen a28340063f Work in progress 2026-06-17 13:55:32 +02:00
jonjenssen 2c9e148fc6 Work in progress 2026-06-17 13:55:32 +02:00