- Camera::fitView/computeFitViewEyePosition: derive one corrected, non-parallel up vector and use it consistently for right, upNorm, planeTop and the final setFromLookAt(), instead of only repairing the right vector. Previously the degenerate (parallel dir/up) case still produced a singular view matrix because up itself was never corrected. Added a regression test exercising fitView() end-to-end (not just computeFitViewEyePosition()) that checks the resulting direction/up/right form a valid orthonormal basis.
- RimViewController::updateCameraLink/updateTimeStepLink: guard against ownerViewLinker()->masterView() being null (RimViewLinker::setMasterView(nullptr) is a supported state), not only against a null view linker.
- RicHistogramPlotTools: use RiaGuiApplication::isRunning() before calling RiaGuiApplication::instance(), since instance() itself asserts when there is no running GUI application.
- RimDockWindowController::updateViewerWidget: create the view widget before the dock widget, so a failed view-widget creation does not leave a dock widget allocated without a dock manager (which deleteDockWidget() cannot clean up).
- RimStimPlanModelCalculator::calculateFormation: avoid continue via a small lambda, and reject double values outside the range of int before the static_cast to avoid undefined behavior.
dir^up becomes a zero vector when the view direction and up vector are parallel, producing an invalid zero-normal plane. Plane::distanceToOrigin() then asserts/aborts (CVF_ASSERT, always active). Fall back to an arbitrary axis to compute a valid right vector in this degenerate case.
Building the cell search tree was dominated by one small std::vector<int>
allocation per leaf, and a tree with one cell per leaf becomes very deep for
large grids.
- BoundingBoxTree: Store leaf ids in flat arrays, and move the input data
instead of copying it. The tree shape is unchanged. Queries no longer copy
the ids of each leaf.
- RigMainGrid: Always group at least 8 cells along K in each leaf.
findIntersectingCells() removes cells not intersecting the query bounding
box, so the result is the same set of cells as for a tree with one cell per
leaf. This also applies to very large grids, which previously got the
cells of the whole leaf.
- Include cells of nested LGRs and LGR cells in invalid main grid cells in
the grouped tree, as the previous tree with one cell per leaf did.
Add fetch og polygons from cloud using ri-cloud-api service as submodule
Current version of submodule fetches polygons from Sumo, prodviding polygons with standard results tag.
* #14654 Fix Linux Release build defining NO_DEBUG instead of NDEBUG
CMAKE_CXX_FLAGS_RELEASE was overwritten with -DNO_DEBUG on Linux in
both CMakeLists.txt and Fwk/CMakeLists.txt. NO_DEBUG is not a standard
macro, so NDEBUG was never defined in Linux Release builds.
As a result, cafAssert.h fell back to CAF_ENABLE_ASSERTS 1, keeping
CAF_ASSERT (and standard assert()) active in Release and aborting the
app, even though RESINSIGHT_ENABLE_ASSERTS_IN_RELEASE defaults to OFF.
Windows and macOS Release builds were unaffected.
Drop the override entirely so CMake supplies its default Release
flags (-O3 -DNDEBUG) on Linux, matching Windows and macOS.
Also simplify CEE_USE_QT5/CEE_USE_QT6 handling: set them directly
instead of via option() with malformed NOT DEFINED(...) guards.
Fixed missing initialization in VfpValueSelection and WellPathCellIntersectionInfo
RimGridCalculation::AdditionalCasesType::ALL_CASES and
RimIntersectionFilterEnum::INTERSECT_FILTER_BETWEEN both reused the
serialization text of a sibling enum value (NONE and
INTERSECT_SHOW_BELOW respectively), so they would silently round-trip
as the wrong value when read back from a project file.
AppEnumMapperBase::addItem only asserted alias uniqueness, not text
uniqueness, so this class of bug went undetected. Add a CAF_ASSERT
checking that a new enum value's serialization text does not match an
existing value's text or aliases.
Found while investigating the AppEnum alias-duplication note in #14654.
Two 3D views docked in the same tab group render black after switching
between tabs. Tracing the render path shows it completes correctly every
time: the offscreen FBO is complete, no OpenGL context is created or
destroyed on a tab switch, and the blit lands on the widget's own default
framebuffer in the widget's own context. The pixels are produced and never
reach the screen.
Without a native window a QOpenGLWidget is composited into the top-level
backing store, and that composition is not refreshed when the dock system
hides one viewer and shows another in the same tab group. A native surface
skips compositing, and the black view goes away.
On Wayland a native child widget becomes a subsurface with its own
rendering and stacking problems, so this is opt-in rather than default.
Set RESINSIGHT_ENABLE_NATIVE_GL_WIDGET=1 to enable it.
cafViewer now links cafPdmCore so the viewer can log through caf, which is
bridged to RiaLogging and therefore reaches the ResInsight log file.
A quote or an opening bracket is only given special meaning when it is the first character of a value. Brackets and parentheses are treated as ordinary characters for text based values, as nested containers are not possible for these types. Text values are then parsed as before, also when they contain unbalanced brackets, parentheses or quotes.
Items in a tuple are not quoted by the Python client, as the tuple parser does not support quoted strings.
Add unit tests for text values containing separator characters, white space, file paths, numbers, nested containers and 3D vectors.
Lists sent from Python over gRPC are serialized as text, and the list parser split on every comma, also commas inside a string. A category name like "Coal,Calcite" was therefore split in two, and set_discrete_property_category_names() failed with "CategoryValues and CategoryNames must have matching sizes".
The list parser is now quote-aware, and ignores commas inside quoted strings and inside nested brackets and parentheses. A quoted item is parsed as a quoted string also when the surrounding text is unquoted, as is the case for text coming from Python. The Python client quotes and escapes strings in lists and tuples when they contain separator characters.
Add unit tests for the field serialization and a Python test for the category names.
All unnamed critical regions map to the same implicit name, so a single process wide lock was shared by summary import, geometry generation, grid bounding box computation and NNC merging. Unrelated parallel loops therefore serialized against each other.
Give each region a critical_section_ name describing what it protects. The two regions guarding RifOpmCommonEclipseSummary::sm_createdEsmryFileCount deliberately share one name, as they protect the same counter.
The pragma had no enclosing parallel region, so it did not parallelize anything and only added confusion.
This code caused a deadlock on Windows for the following workflow:
1. import a grid model
2. Import a large summary ensemble with no ESMRY that triggers display of a progress dialog. Make sure the progress dialog is displayed on top of the 3D models -> deadlock
RenderStateTextureBindings::setupTextures() ignores the return value of
Texture::setupTexture(). When setup fails, the texture is deleted and left
without a valid OpenGL id, but applyOpenGL() still calls Texture::bind(),
where CVF_ASSERT on the id aborts the application.
Skip bindings without a valid texture id and log a render error instead.
The group boxes were destroyed with a raw delete, which destroys the child widgets immediately and defeats the deleteLater() used by PdmUiFieldEditorHandle to keep field editor widgets alive. When the rebuild is triggered from fieldChangedByUi(), Qt is still using those widgets further up the stack, giving a use-after-free.
Hide and detach the group box before scheduling a deferred delete, so it leaves the layout, the visual tree and the focus chain immediately. Detaching first is what plain deleteLater() did not do in issue 9719.
The tool button and the layout are owned by m_placeholder, which is not returned as the editor widget when auto value is not supported. Nothing tracks m_placeholder in that case, so it can be destroyed together with a parent widget while the reparented m_lineEdit survives. A later configureAndUpdateUi() then found a non-null m_lineEdit and a null m_autoValueToolButton, and crashed on hide().
Guard both pointers before use, matching how m_label and m_lineEdit are already guarded in the same function. This is a separate defect from the use-after-free in issue 14505, found while reproducing it in cafTestApplication.
Adds a ReentrantEditorRebuild demo object that rebuilds all property editors from inside fieldChangedByUi(), while Qt is still executing QLineEdit::focusOutEvent. Type a value into Realization Filter and press Tab to trigger. The change handler drops both the line edit field and its parent group from the ui ordering, so PdmUiFormLayoutObjectEditor::configureAndUpdateUi() tears down widgets that are still in use further up the stack. Uncheck Rebuild Layout On Change to run the same edit without the reentrant rebuild.
Qt is distributed both with and without pdb files. When they are present,
copy them next to the Qt dlls so symbols are available when debugging.
Pass --pdb to windeployqt for the configurations built with debug
information, and copy the matching pdb file in the AppFwk test
applications and unit tests using a helper script that skips missing
files.
Deleting PDM objects on a worker thread is not safe. PdmObjectHandle::prepareForDelete()
mutates state owned by other objects, it nulls the guarded pointers held by other objects
and clears m_pointersReferencingMe, an unsynchronised std::set that every PdmPointer
construction and destruction touches. Destroying an object off the main thread therefore
races with the main thread on the shared object graph. See issue 14491.
Profiling a summary ensemble teardown shows the mechanism does not pay for itself. Releasing
397 Drogon realizations takes 0.24 s sequentially and 0.24 s in parallel, and for a heavy
case the parallel release is slower than the sequential one, because free() is serialised
inside the allocator. The PDM bookkeeping itself is 0.4 to 2.8 percent of the teardown.
Remove the class and deleteChildrenAsync(), and delete synchronously instead. The call sites
that used clearWithoutDelete() and a manual delete loop to work around the race can now call
deleteChildren() directly. Add caf::PdmObjectHandleTools::deleteObjects() for the case where
the objects are no longer owned by a child array field.
The observer disconnection from issue 12262 does not depend on clearWithoutDelete(). ~Signal()
unregisters itself from every observer, so a deleted child detaches itself. That fix addressed
the async race, where ~Signal() mutated the observer list from a worker thread. The unit test
is updated to assert the observed signal count directly instead of relying on a crash.
cvfAssert.h tests CVF_ENABLE_ASSERTS but did not include cvfConfigCore.h, which
is where that macro gets its default value of 1. A translation unit processing
cvfAssert.h before cvfConfigCore.h evaluated the undefined identifier as 0 and
silently compiled every CVF_ASSERT, CVF_ASSERT_MSG and CVF_FAIL_MSG in that unit
into a no-op, without any warning and without evaluating the expressions.
Because the header uses pragma once, including cvfConfigCore.h later in the same
unit did not recover the macros. Alphabetical include sorting actively produces
the broken order, since cvfAssert.h sorts before cvfBase.h.
Include cvfConfigCore.h before the macro definitions. It only defines macros, has
pragma once and no dependencies, so this is immune to future include reordering.
This turns the asserts back on in the affected translation units, in both debug
and release builds, and immediately exposed one assert that had never compiled:
in RigFemPartResultCalculatorNormalized::calculate, isNormalizableResult was
called unqualified even though it is a static member of
RigFemPartResultsCollection. Qualify it, matching isMatching in the same file.
CAF_ASSERT was unconditionally active in every build configuration. Make it
follow the semantics of the standard assert(): active in Debug, compiled out in
optimized builds (NDEBUG).
Add the CMake option RESINSIGHT_ENABLE_ASSERTS_IN_RELEASE (default OFF) for
developers who want the asserts to stay active in an optimized build, which is
useful when reproducing a problem in RelWithDebInfo with a debugger attached.
When compiled out, the expression is kept inside an unevaluated sizeof rather
than discarded. It is not evaluated, so there is no run-time cost and no side
effects, but it is still type checked and any variable used only by the assert
still counts as referenced, avoiding a wave of unused-variable warnings.
CAF_ENABLE_ASSERTS is given a default in cafAssert.h so the header stays
self-contained and include order can never silently switch the asserts off.
Document in docs/agents/coding-style.md that CAF_ASSERT is the assert to use,
that CVF_ASSERT is legacy, and that asserts are for broken invariants rather
than for run-time conditions that need real error handling.
* #14411 Enforce name uniqueness for surfaces, polygons and folders
Names must be unique among siblings sharing the same parent folder. Items in different folders may keep identical names, and comparison is case sensitive.
Siblings are the objects held by the same caf::PdmChildArrayField. Items and folders live in two distinct child arrays in caf::PdmNestedCollection, so a folder and an item may share a name under the same parent.
The Python API gets an OnNameConflict flag on AddFolder, CreatePolygon, ImportSurface and NewRegularSurface, supporting FAIL (default), AUTO_RENAME and OVERWRITE. NewSurface is left out, as grid case surfaces derive their tree label from the case and K index and carry no name of their own.
Dropping on an empty area of a table view calls dropMimeData with an invalid parent index, where row and column are -1. PdmUiTableViewQModel::getField() and pdmObjectForRow() used these values to index the child array field, reading out of bounds and returning a garbage object pointer.
Cloud services are configured from RiaApplication::initialize(), which runs before the subclasses append their logger instances. All messages from the cloud config file search were therefore dropped. Add a virtual initializeLoggers() called before the cloud configuration is read, and move creation of the file logger and the std out logger into the overrides. The message panel logger depends on the main windows, and is still created in RiaGuiApplication::initialize().
Do not write fields with IO disabled to the application store, mirroring the check already present when reading. This stops the cloud service configuration from being persisted into the user preferences file.
Valid Qt column indices are 0..columnCount()-1, but the bottom-right
model index was constructed with column columnCount(). Since
QAbstractItemModel::index() validates its arguments, this produced an
invalid QModelIndex(-1,-1) passed to dataChanged(), causing a console
warning on every table row update, e.g. when adding or moving 3D well
path pick targets. Fix the same off-by-one in modelIndexFromPdmObject().
Fixes#14274.
The tree view in PdmUiTreeSelectionEditor is deleted using deleteLater(),
while the models are children of the editor and are deleted immediately.
Detach the view from the models in the destructor, otherwise pending events
in the view may operate on a selection model whose model has been destroyed.
Driving caf::ProgressInfo from worker threads inside the OpenMP loop in
loadFileSummaryCaseData() marshaled setProgress() to the GUI thread via a
queued connection. These updates could be delivered after the ProgressInfo
scope had ended and the progress stacks were popped, accessing an empty stack
and resurrecting the just-closed dialog stuck at 0% with no way to close it.
Only update the progress dialog from the master thread, using an atomic
counter for a monotonic progress value, and guard the ProgressInfo mutators
against stale updates delivered after the stacks are empty.
The GUI thread deadlocked on a non-recursive QMutex during OSDU well
import. The download-completion slots and DataLoadController::onTaskFinished
held a mutex while triggering progress updates, which call
QApplication::processEvents(). That re-enters the event loop and dispatches
another queued parquet-download-complete event for a different well, whose
handler then blocks trying to lock the same mutex.
Release the mutex before emitting taskDone in the OSDU well path and well
log data loaders, and before calling incrementProgress() in onTaskFinished.
The map access that the mutex protects stays inside the locked scope; the
captured ProgressInfo outlives the call (kept alive by blockUntilDone) and
incrementProgress() is thread-safe via self-marshaling to the GUI thread.
Fixes#14230.
The table model shares one field editor handle per column across all rows.
When an edit ends, the view schedules the editor widget for deletion with
deleteLater(), but the handle's QPointer stays valid until the deferred
deletion runs. Clicking a cell in the same column of another row reused that
doomed widget as the new cell editor, so it was destroyed right after
opening and the user had to click again. Moving horizontally was unaffected
since a different column uses a different editor handle.
Cancel the pending deferred deletion before handing the widget out again,
and guard against a null editor widget.
The boundary conditions table required several clicks in each cell before
a value could be changed, because the table view used Qt's default edit
triggers. Add an opt-in editOnSingleClick attribute to the table view
editor that starts editing on a single click and opens combo box popups
immediately, and enable it for the BCPROP keywords table.
The bounding box tree is destroyed by deleteInternalNodesBottomUp, which
recursed once per tree level. For deep or unbalanced trees this overflowed
the call stack during project close (RigMainGrid destruction).
Replace the recursion with an explicit stack. Deleting an internal node does
not touch its children, so the child pointers are read before the node is
deleted and the deletion order is irrelevant. Leaf nodes remain pooled and
are not deleted individually.
The integer slider editor cross-updated the spin box and slider without blocking signals, so a single user interaction wrote to the PDM field twice. The first (nested) write could trigger a field-changed callback that rebuilt the property panel and destroyed the spin box internal line edit, after which the second write dereferenced the dangling line edit in QAbstractSpinBox::text() and crashed.
Block the other widget signals while programmatically syncing in slotSliderValueChanged and updateSliderPosition, restoring the previous blocked state so it nests safely with configureAndUpdateUi. Add null guards in updateSliderPosition and writeValueToField.
The export property dialogs that rely solely on sizeHint() could open collapsed when shown on a screen whose DPI differs from the screen they were built on. Recompute the layout on first show, after the dialog is associated with its destination screen, by calling adjustSize() in showEvent when no stored size is restored. Also give RiuPropertyViewTabWidget a minimum size floor so the inner scroll area's artificially small minimum width cannot collapse the dialog.
Replace the binary QWidget::saveGeometry()/restoreGeometry() encoding used by PdmUiPropertyViewDialog and RiuPropertyViewTabWidget with plain integer width and height values in QSettings, restored with resize(). The stored values are human-readable and not tied to Qt internal geometry-stream version. Only the size is persisted; the window position is left to the window manager to avoid restoring dialogs off-screen or on a disconnected monitor.
The tree selection editor can grow to a large height, which is useful when it is the last field editor in the property dialog. When other field editors are located below, the heightHint is now used as the maximum height instead. The form layout tracks whether an editor occupies the bottom-most row of the form and passes this to the editor. In the Analysis Plot, the time step selection is constrained to its height hint because other input fields are located below it.
Persist the geometry of PdmUiPropertyViewDialog and RiuPropertyViewTabWidget to the application settings on close and restore it on the next show. Restoring is done in showEvent rather than the constructor so it is applied reliably for a modal dialog. The settings key includes the bound object class keyword so distinct dialogs that share a window title do not collide.
This behaviour is gated behind a new "Remember Dialog Size" experimental feature, disabled by default. PdmUiPropertyViewDialog cannot access RiaPreferencesSystem, so the application pushes the current setting via the static enableGeometryPersistence(), following the existing pattern used for class-name display. RiuPropertyViewTabWidget queries the feature directly.