From 2cc822399b6fc8b0590ec2c85b10be7d2acc3075 Mon Sep 17 00:00:00 2001 From: Gaute Lindkvist Date: Thu, 3 Oct 2019 14:57:46 +0200 Subject: [PATCH] Renames following review --- .../RimWellLogExtractionCurve.cpp | 26 ++++++++++++++----- .../RimWellLogExtractionCurve.h | 4 ++- .../ProjectDataModel/RimWellLogWbsCurve.cpp | 2 +- .../RigGeoMechWellLogExtractor.cpp | 24 +++++++++-------- .../RigGeoMechWellLogExtractor.h | 10 +++---- 5 files changed, 42 insertions(+), 24 deletions(-) diff --git a/ApplicationCode/ProjectDataModel/RimWellLogExtractionCurve.cpp b/ApplicationCode/ProjectDataModel/RimWellLogExtractionCurve.cpp index fec94d0ff1..6382d67cbd 100644 --- a/ApplicationCode/ProjectDataModel/RimWellLogExtractionCurve.cpp +++ b/ApplicationCode/ProjectDataModel/RimWellLogExtractionCurve.cpp @@ -403,7 +403,9 @@ void RimWellLogExtractionCurve::performDataExtraction( bool* isUsingPseudoLength //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -void RimWellLogExtractionCurve::extractData( bool* isUsingPseudoLength, bool smoothData, double smoothingThreshold ) +void RimWellLogExtractionCurve::extractData( bool* isUsingPseudoLength, + bool performDataSmoothing /*= false*/, + double smoothingThreshold /*= -1.0 */ ) { CAF_ASSERT( isUsingPseudoLength ); @@ -503,9 +505,13 @@ void RimWellLogExtractionCurve::extractData( bool* isUsingPseudoLength, bool smo m_geomResultDefinition->loadResult(); geomExtractor->curveData( m_geomResultDefinition->resultAddress(), m_timeStep, &values ); - if ( smoothData ) + if ( performDataSmoothing ) { - geomExtractor->smoothCurveData( m_timeStep, &measuredDepthValues, &tvDepthValues, &values, smoothingThreshold ); + geomExtractor->performCurveDataSmoothing( m_timeStep, + &measuredDepthValues, + &tvDepthValues, + &values, + smoothingThreshold ); } } @@ -513,11 +519,11 @@ void RimWellLogExtractionCurve::extractData( bool* isUsingPseudoLength, bool smo { if ( !tvDepthValues.size() ) { - this->setValuesAndMD( values, measuredDepthValues, depthUnit, !smoothData ); + this->setValuesAndMD( values, measuredDepthValues, depthUnit, !performDataSmoothing ); } else { - this->setValuesWithTVD( values, measuredDepthValues, tvDepthValues, depthUnit, !smoothData ); + this->setValuesWithTVD( values, measuredDepthValues, tvDepthValues, depthUnit, !performDataSmoothing ); } } } @@ -674,7 +680,7 @@ void RimWellLogExtractionCurve::defineUiOrdering( QString uiConfigName, caf::Pdm { RimPlotCurve::updateOptionSensitivity(); - caf::PdmUiGroup* curveDataGroup = uiOrdering.addNewGroupWithKeyword( "Curve Data", "CurveData" ); + caf::PdmUiGroup* curveDataGroup = uiOrdering.addNewGroupWithKeyword( "Data Source", dataSourceGroupKeyword() ); curveDataGroup->add( &m_case ); @@ -743,6 +749,14 @@ void RimWellLogExtractionCurve::initAfterRead() m_geomResultDefinition->setGeoMechCase( geomCase ); } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +QString RimWellLogExtractionCurve::dataSourceGroupKeyword() +{ + return "DataSource"; +} + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationCode/ProjectDataModel/RimWellLogExtractionCurve.h b/ApplicationCode/ProjectDataModel/RimWellLogExtractionCurve.h index ce6097f424..4988d6fd7e 100644 --- a/ApplicationCode/ProjectDataModel/RimWellLogExtractionCurve.h +++ b/ApplicationCode/ProjectDataModel/RimWellLogExtractionCurve.h @@ -92,7 +92,7 @@ protected: QString createCurveAutoName() override; void onLoadDataAndUpdate( bool updateParentPlot ) override; virtual void performDataExtraction( bool* isUsingPseudoLength ); - void extractData( bool* isUsingPseudoLength, bool smoothData = false, double smoothingThreshold = -1.0 ); + void extractData( bool* isUsingPseudoLength, bool performDataSmoothing = false, double smoothingThreshold = -1.0 ); void fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, @@ -103,6 +103,8 @@ protected: bool* useOptionsOnly ) override; void initAfterRead() override; + static QString dataSourceGroupKeyword(); + private: void setLogScaleFromSelectedResult(); void clampTimestep(); diff --git a/ApplicationCode/ProjectDataModel/RimWellLogWbsCurve.cpp b/ApplicationCode/ProjectDataModel/RimWellLogWbsCurve.cpp index 0d922cb732..ec2661714e 100644 --- a/ApplicationCode/ProjectDataModel/RimWellLogWbsCurve.cpp +++ b/ApplicationCode/ProjectDataModel/RimWellLogWbsCurve.cpp @@ -65,7 +65,7 @@ void RimWellLogWbsCurve::defineUiOrdering( QString uiConfigName, caf::PdmUiOrder { RimWellLogExtractionCurve::defineUiOrdering( uiConfigName, uiOrdering ); - caf::PdmUiGroup* dataGroup = uiOrdering.findGroup( "CurveData" ); + caf::PdmUiGroup* dataGroup = uiOrdering.findGroup( dataSourceGroupKeyword() ); dataGroup->add( &m_smoothCurve ); dataGroup->add( &m_smoothingThreshold ); } diff --git a/ApplicationCode/ReservoirDataModel/RigGeoMechWellLogExtractor.cpp b/ApplicationCode/ReservoirDataModel/RigGeoMechWellLogExtractor.cpp index 7f9132408d..845e34e551 100644 --- a/ApplicationCode/ReservoirDataModel/RigGeoMechWellLogExtractor.cpp +++ b/ApplicationCode/ReservoirDataModel/RigGeoMechWellLogExtractor.cpp @@ -61,11 +61,11 @@ RigGeoMechWellLogExtractor::RigGeoMechWellLogExtractor( RigGeoMechCaseData* aCas //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -void RigGeoMechWellLogExtractor::smoothCurveData( int frameIndex, - std::vector* mds, - std::vector* tvds, - std::vector* values, - const double smoothingTreshold ) +void RigGeoMechWellLogExtractor::performCurveDataSmoothing( int frameIndex, + std::vector* mds, + std::vector* tvds, + std::vector* values, + const double smoothingTreshold ) { CVF_ASSERT( mds && tvds && values ); @@ -1172,14 +1172,16 @@ void RigGeoMechWellLogExtractor::filterShortSegments( std::vector* std::vector* filterSegments, std::vector*>& vectorOfDependentValues ) { + const double lengthEpsilon = 1.0e-3; + std::vector simplerXValues; std::vector simplerYValues; - std::vector simpledFilterSegments; + std::vector simplerFilterSegments; std::vector> simplerDependentValues( vectorOfDependentValues.size() ); simplerXValues.push_back( xValues->front() ); simplerYValues.push_back( yValues->front() ); - simpledFilterSegments.push_back( filterSegments->front() ); + simplerFilterSegments.push_back( filterSegments->front() ); for ( size_t n = 0; n < vectorOfDependentValues.size(); ++n ) { simplerDependentValues[n].push_back( vectorOfDependentValues[n]->front() ); @@ -1188,11 +1190,11 @@ void RigGeoMechWellLogExtractor::filterShortSegments( std::vector* { cvf::Vec2d vecIn( ( ( *xValues )[i] - simplerXValues.back() ) / std::max( 1.0, simplerXValues.back() ), ( ( *yValues )[i] - simplerYValues.back() ) / std::max( 1.0, simplerYValues.back() ) ); - if ( ( *filterSegments )[i] == 0u || vecIn.length() > 1.0e-3 ) + if ( ( *filterSegments )[i] == 0u || vecIn.length() > lengthEpsilon ) { simplerXValues.push_back( ( *xValues )[i] ); simplerYValues.push_back( ( *yValues )[i] ); - simpledFilterSegments.push_back( ( *filterSegments )[i] ); + simplerFilterSegments.push_back( ( *filterSegments )[i] ); for ( size_t n = 0; n < vectorOfDependentValues.size(); ++n ) { simplerDependentValues[n].push_back( ( *vectorOfDependentValues[n] )[i] ); @@ -1201,7 +1203,7 @@ void RigGeoMechWellLogExtractor::filterShortSegments( std::vector* } simplerXValues.push_back( xValues->back() ); simplerYValues.push_back( yValues->back() ); - simpledFilterSegments.push_back( filterSegments->back() ); + simplerFilterSegments.push_back( filterSegments->back() ); for ( size_t i = 0; i < vectorOfDependentValues.size(); ++i ) { simplerDependentValues[i].push_back( vectorOfDependentValues[i]->back() ); @@ -1209,7 +1211,7 @@ void RigGeoMechWellLogExtractor::filterShortSegments( std::vector* xValues->swap( simplerXValues ); yValues->swap( simplerYValues ); - filterSegments->swap( simpledFilterSegments ); + filterSegments->swap( simplerFilterSegments ); for ( size_t n = 0; n < vectorOfDependentValues.size(); ++n ) { vectorOfDependentValues[n]->swap( simplerDependentValues[n] ); diff --git a/ApplicationCode/ReservoirDataModel/RigGeoMechWellLogExtractor.h b/ApplicationCode/ReservoirDataModel/RigGeoMechWellLogExtractor.h index 5665674e5f..a2c37b97ef 100644 --- a/ApplicationCode/ReservoirDataModel/RigGeoMechWellLogExtractor.h +++ b/ApplicationCode/ReservoirDataModel/RigGeoMechWellLogExtractor.h @@ -64,11 +64,11 @@ public: const RigWellPath* wellpath, const std::string& wellCaseErrorMsgName ); - void smoothCurveData( int frameIndex, - std::vector* mds, - std::vector* tvds, - std::vector* values, - const double smoothingTreshold ); + void performCurveDataSmoothing( int frameIndex, + std::vector* mds, + std::vector* tvds, + std::vector* values, + const double smoothingTreshold ); void curveData( const RigFemResultAddress& resAddr, int frameIndex, std::vector* values ); const RigGeoMechCaseData* caseData();