Bounds-check every gridResultValues access in interpolateGridResultValue
to prevent segfaults observed in interpolateInterfaceValues' OMP loop
when a result vector was empty or sized for a different result position
type. OOB now returns the infinity sentinel that matches the existing
undefined-value path and the initializeResultValues pre-fill, so
downstream invalid-value checks correctly skip these slots.
interpolateInterfaceValues additionally short-circuits and logs a
warning with the field/component name when the input result vector is
empty, instead of failing silently.
Camera::computeViewFrustum() returns an empty Frustum if the projection
matrix is degenerate (e.g., on the first paint after project open, before
a valid near/far has been set). The per-model culling introduced by
82c7172c1 calls Frustum::isOutside() unconditionally, which asserts when
the frustum has fewer than 6 planes. Skip culling when the frustum is
not fully populated; all valid models then contribute to the near/far
calculation, matching the pre-82c7172c1 behaviour.
Address review feedback: replace the long conjunction guards added in the
previous commit with early-return statements for readability. Hoist the
legendConfig pointer into a local so the body reuses it instead of calling
legendConfig() repeatedly.
Mirror the nullptr guards added to RimContourMapProjection::generateGeometryIfNecessary
(commit fdc8608a29) in the three sibling RimEclipseContourMapView and
RimGeoMechContourMapView "append ... to model" methods, which were still
unconditionally dereferencing mapGrid() and legendConfig()->scalarMapper().
The K layer returned by findEclipseKLayer is computed against one grid
(usually the main grid), but updateCellsForEclipse then forwards it to
every grid including LGRs whose cellCountK can be smaller. Inside
updateCellsKIndexEclipse the unguarded cellIndexFromIJKUnguarded call
combined with the bounds-unchecked cell() accessor produced an
out-of-range cell whose corner indices crashed RigCell::center() and
cellCornerVertices.
Fixes#13922.
Add shouldBeVisibleInTree() to RimRefinementRegionCollection (true only
when at least one region exists) and consult it from
RimEclipseView::defineUiTreeOrdering. Refresh the parent view's
connected editors from addNewRegion, removeRegion, and onChildDeleted so
the folder appears and disappears as regions are added or removed via
the generic delete-item action.
The "New Refinement Region" action remains reachable from the Eclipse
view's context menu while the folder is hidden.
Skip pick items with no cvf source info in both pick paths
(displayContextMenu and findFirstItems). Without this, the refinement
region wireframe — which has no source info — became the topmost hit,
causing the picking handler to bail out and leaving Result Info empty
instead of falling through to the underlying cell.
Initialize new refinement regions with a small box (~1/4 of grid I/J
extent) centered in I/J and spanning the full K range, so the wireframe
is clearly visible against the parent grid edges instead of coinciding
with the grid bounds.
Promote sector-export refinement from inline wizard fields to first-class
PDM objects so users can create, edit, and preview refinement regions in
the 3D view before opening the export dialog.
The four single-add cell-filter features (CellIndex, UserDefined,
UserDefinedIndex, RangeSlice) repeated the same combined-filter
dispatch: detect a selected RimCombinedFilter, resolve its case, add
the new filter, select it, and bail out. Move that boilerplate into a
templated helper so each feature shrinks to a single call.
Addresses PR #13911 review feedback.
Replace the six typed addNewXxxFilter factories with a single generic
addNewFilter<T>(init) template. The combined filter no longer references
any concrete RimCellFilter subclass; callers supply the type and an init
lambda for type-specific configuration, while the combined filter handles
cycle checks, parent-case propagation, signal wiring, and host notification.
Addresses PR #13911 review feedback.
Add RimCombinedFilter, a node placed under the Eclipse property-filter
collection that holds child filters (cell or property) and combines their
results with a user-chosen AND or OR mode. Supports nesting and is exposed
to Python via the generated rips CombinedFilter class.
To let the same evaluation machinery handle any filter type, introduce a
unified applyToCellVisibility(cellVis, grid, timeStep) virtual on
RimCellFilter with a default implementation that bridges the existing
range/index dispatch. RimEclipsePropertyFilter overrides it with the body
extracted from RivReservoirViewPartMgr::computePropertyVisibility, which
collapses to a generic per-child call and preserves the prior behavior
for ordinary property filters.
Loosen RimEclipsePropertyFilterCollection::m_propertyFilters to
PdmChildArrayField<RimCellFilter*>, keeping the XML tag "PropertyFilters"
and the typed propertyFilters() accessor. Add recursive helpers
(hasActiveEvaluatableDescendant, hasActiveDynamicPropertyDescendant,
hasActiveFormationNamesPropertyDescendant) so hasActiveFilters,
hasActiveDynamicFilters and isUsingFormationNames see property filters
nested inside a combined filter. Bridge filter changes inside a combined
filter to updateDisplayModelNotifyManagedViews, since the property-filter
collection doesn't subscribe to filterChanged signals.
The existing RicNew* cell-filter creation features now route the new child
into a selected combined filter when one is selected, otherwise into the
top-level cell-filter collection as before. The combined filter's context
menu offers the full mixed set: property, polygon, range, index,
user-defined, and nested combined filter.
Read the ROFF "subgrids.nLayers" array and expand it into a 1-based per-cell integer property (SUBGRIDS) so ROFF zonation becomes a regular grid property. If a companion "subgrids.names" array is present, zone names are surfaced as category code-names via the existing color-legend flow.
Change the cache key prefix from `clang++-19` to `clang-tidy-19` to ensure the vcpkg cache for the clang-tidy job is isolated from standard build caches.
Pad-model extension assumed OPM-style "Z+" for the positive-Z exterior face,
but ResInsight emits "Z" (OPM-Flow short form). The K1/K2 shift never fired,
leaving the bottom boundary face at the original NZ instead of the new
padded NZ. Match both "Z" and "Z+" so the extension applies.
Adds a regression test verifying that with BCCON_BCPROP and padding the "Z"
exterior face is shifted by nzUpper + nzLower while the "Z-" face remains
at K=1, and documents the exterior-face semantics of the direction mapping.
Expose well logs attached to a well path through the Python API. A new
`well_path.well_logs()` returns the list of well logs, and each
`WellLog` gains `channel_names()` and `well_log_data()` for reading
channel names, measured depth, optional TVD MSL/RKB, and channel
values.
The read methods are registered on the abstract `RimWellLog` base
class and use the common `RigWellLogData` interface so they work for
imported, LAS and OSDU well logs alike.
Introduce set_discrete_property_category_names on Case to bind integer
result values to text labels and optional colors. Internally it creates a
custom ColorLegend, appends one item per value (with an auto-assigned
palette color when the caller does not provide one) and registers the
legend as the default for the (case, resultName) pair.
Also add Project.color_legend_collection() as a dedicated accessor for
the project's ColorLegendCollection, pytest coverage for legend creation
and the default-legend-for-result binding, and two PythonExamples
demonstrating the end-to-end discrete property + category label flow.
#13806 Python: Silence mypy warnings for category_mapping module
The Python class generator previously emitted cvf::Color3f defaults using
the raw QTextStream operator ("r g b" floats), which is not valid Python
and does not match the hex-string form that scriptable color fields
expect on writeToField.
Convert Color3f defaults to their QColor::name() hex representation and
quote any non-QString value mapped to "str" (e.g. Color3f, caf::FilePath)
so the generated Python is syntactically valid.
Expose RimColorLegendCollection and RimColorLegend to Python via
CAF_PDM_OBJECT_METHOD entries that let callers create a legend, append
category items with a hex-string color, bind a legend to a (case,
resultName) pair and delete that binding.
Scriptable fields on RimColorLegend and RimColorLegendItem make the
created objects inspectable from Python.
The (case, resultName) binding interface in RimColorLegendCollection,
RimRegularLegendConfig and RimEclipseCellColors now takes a const RimCase*
instead of a case id, matching the caller patterns and avoiding ambiguity
when multiple cases share an id domain.
Add a data_type parameter to set_active_cell_property, set_active_cell_property_async
and set_grid_property so callers can upload INTEGER-typed discrete properties in
addition to the existing FLOAT properties. Previously a discrete property required
the result name to end with "NUM"; the explicit data type makes the intent
independent of the name.
The gRPC service now forwards the selected data type to
RigCaseCellResultsData::createCategoryResult, and the Python tests cover both
float and integer property uploads.
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.
After migrating m_enablePicking from a PdmField<bool> to a PdmUiButton callback, the RimPolygonFilter parent was no longer notified via childFieldChangedByUi, so its 3D editor did not register or unregister the pick event handler and the button label did not refresh. Route the toggle through a helper that also calls updateEditorsAndVisualization on the owning RimPolylinePickerInterface.
The range-based loop used the outer column index 'i' as the element index, causing only one slot to be written while all others remained zero. Extracted scaleColumnIfModulus() helper to remove duplication between both branches.
Use field name constants S_VTK/E_VTK with a shared separator constant to
derive internal storage keys, filter them from the flat result list, and
expose them as folders with S11-S23 / E11-E23 sub-items in the UI.
* 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.
ecl_file_get_restart_view can return null when a timestep has no restart
view, and the result was passed unchecked into ERT functions. Also added a
null guard for grid and summaryView at the entry of transferNncFluxData to
prevent a crash in ecl_nnc_geometry_alloc on null grid.
deleteChildrenAsync() spawns a std::thread that deletes old RimFileSummaryCase
objects concurrently with the OpenMP parallel loop in loadFileSummaryCaseData().
#pragma omp critical only synchronizes OMP threads, not std::threads, so OPM/HDF5
library state was accessed simultaneously from both, causing crashes.
Replace with clearWithoutDelete() + synchronous delete to preserve the observer
signal disconnection fix from #12262 while eliminating the thread race.
Replace CVF_ASSERT with an early return guard to prevent crash when
view is null or equals the master view. Also guard null pointer use
in RicSetMasterViewFeature.
Replace CVF_ASSERT with bounds checks returning std::unexpected with
descriptive error messages. Call site updated with TODO to propagate
the error when the receiving system is ready.