Refactor depth property handling for regular surfaces

- Introduce RimRegularFileSurface::propertyName() as canonical property key for file-based surfaces.
- Change RimRegularSurface::setPropertyAsDepth() to void and remove existence check; error handling is now in updateSurfaceData().
- Update all usages to match new setPropertyAsDepth() behavior.
- Log and handle missing depth property in updateSurfaceData().
- Update tests to reflect new error handling approach.
- Minor includes and logging improvements.
This commit is contained in:
Magne Sjaastad committed 2026-01-20 18:21:56 +01:00
1 parent a6ce2b3a65
commit 4b9f94efb8
7 files changed
+25 -16

No files matched your search

@@ -18,6 +18,8 @@
#include "RimRegularSurface.h"
#include "RiaLogging.h"
#include "Surface/RigSurface.h"
#include "RimSurfaceCollection.h"
@@ -208,6 +210,14 @@ void RimRegularSurface::clearCachedNativeData()
//--------------------------------------------------------------------------------------------------
bool RimRegularSurface::updateSurfaceData()
{
if ( m_depthProperty() != internal::fixedDepth() && !m_properties.contains( m_depthProperty() ) )
{
RiaLogging::warning( QString( "Surface '%1': Depth property '%2' not found." ).arg( userDescription(), m_depthProperty() ) );
setSurfaceData( nullptr );
return false;
}
// Adapted from xtgeo surf_xyz_from_ij
auto computeXyzFromIj =
[]( int i, int j, double depth, double xori, double yori, double xinc, double yinc, double rotationDegrees ) -> cvf::Vec3d
@@ -390,12 +400,9 @@ void RimRegularSurface::setProperty( const QString& key, const std::vector<float
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RimRegularSurface::setPropertyAsDepth( const QString& key )
void RimRegularSurface::setPropertyAsDepth( const QString& key )
{
if ( !m_properties.contains( key ) ) return false;
m_depthProperty = key;
return true;
}
//--------------------------------------------------------------------------------------------------