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.
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.
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.
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.
* 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.
* 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.
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.
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.
* #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.
* 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.
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.
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.
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.