From 477ae02382891542b4a3edec39ab7bf4a44623e3 Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Mon, 14 Feb 2022 11:49:37 +0100 Subject: [PATCH] Logarithmic curve support and renaming (#8546) * Add test for both positive and negative numbers * Remove redundant sample count from parameter list * Propagate useLogarithmicScale * Renaming --- .../RicNewStimPlanModelPlotFeature.cpp | 28 +- .../RicNewWellBoreStabilityPlotFeature.cpp | 26 +- .../RicWellLogPlotTrackFeatureImpl.cpp | 4 +- .../AnalysisPlots/RimAnalysisPlot.h | 4 +- .../RimAbstractCorrelationPlot.h | 4 +- .../Flow/RimWellAllocationPlot.cpp | 2 +- .../Flow/RimWellDistributionPlot.cpp | 4 +- .../Flow/RimWellDistributionPlot.h | 4 +- .../Flow/RimWellFlowRateCurve.cpp | 9 +- .../ProjectDataModel/Flow/RimWellPltPlot.cpp | 8 +- .../GridCrossPlots/RimGridCrossPlot.cpp | 12 +- .../GridCrossPlots/RimGridCrossPlot.h | 4 +- .../GridCrossPlots/RimGridCrossPlotCurve.cpp | 4 +- .../ProjectDataModel/RimDepthTrackPlot.cpp | 4 +- .../RimGridTimeHistoryCurve.cpp | 14 +- .../ProjectDataModel/RimMultiPlot.cpp | 4 +- ApplicationLibCode/ProjectDataModel/RimPlot.h | 6 +- .../ProjectDataModel/RimPlotCurve.cpp | 16 +- .../ProjectDataModel/RimPlotCurve.h | 10 +- .../ProjectDataModel/RimVfpPlot.cpp | 8 +- .../ProjectDataModel/RimVfpPlot.h | 4 +- .../StimPlanModel/RimStimPlanModelCurve.cpp | 12 +- .../Summary/RimAsciiDataCurve.cpp | 8 +- .../Summary/RimSummaryCurve.cpp | 18 +- .../Summary/RimSummaryPlot.cpp | 12 +- .../ProjectDataModel/Summary/RimSummaryPlot.h | 4 +- .../WellLog/Rim3dWellLogRftCurve.cpp | 2 +- .../RimEnsembleWellLogStatisticsCurve.cpp | 3 +- .../WellLog/RimWellLogCurve.cpp | 98 ++++--- .../WellLog/RimWellLogCurve.h | 57 ++-- .../WellLog/RimWellLogExtractionCurve.cpp | 51 ++-- .../WellLog/RimWellLogFileCurve.cpp | 14 +- .../WellLog/RimWellLogRftCurve.cpp | 35 +-- .../WellLog/RimWellLogTrack.cpp | 264 +++++++++--------- .../WellLog/RimWellLogTrack.h | 46 +-- .../RimWellMeasurementCollection.cpp | 2 +- .../RimWellMeasurementCurve.cpp | 36 +-- .../RimcWellLogPlot.cpp | 4 +- .../RimcWellLogTrack.cpp | 4 +- .../ReservoirDataModel/RigLasFileExporter.cpp | 8 +- .../RigWellLogCurveData.cpp | 85 +++--- .../ReservoirDataModel/RigWellLogCurveData.h | 31 +- .../RimWellLogExtractionCurveImpl-Test.cpp | 34 ++- .../RiuFlowCharacteristicsPlot.cpp | 10 +- .../UserInterface/RiuPlotCurve.cpp | 22 +- .../UserInterface/RiuPlotCurve.h | 13 +- .../UserInterface/RiuQtChartsPlotCurve.cpp | 8 +- .../UserInterface/RiuQtChartsPlotCurve.h | 2 +- .../UserInterface/RiuQwtPlotCurve.cpp | 12 +- .../UserInterface/RiuQwtPlotCurve.h | 4 +- 50 files changed, 597 insertions(+), 481 deletions(-) diff --git a/ApplicationLibCode/Commands/CompletionCommands/RicNewStimPlanModelPlotFeature.cpp b/ApplicationLibCode/Commands/CompletionCommands/RicNewStimPlanModelPlotFeature.cpp index 8dcd3badb9..184768440d 100644 --- a/ApplicationLibCode/Commands/CompletionCommands/RicNewStimPlanModelPlotFeature.cpp +++ b/ApplicationLibCode/Commands/CompletionCommands/RicNewStimPlanModelPlotFeature.cpp @@ -224,15 +224,15 @@ void RicNewStimPlanModelPlotFeature::createFormationTrack( RimStimPlanModelPlot* formationTrack->setFormationWellPath( stimPlanModel->thicknessDirectionWellPath() ); formationTrack->setFormationCase( eclipseCase ); formationTrack->setAnnotationType( RiuPlotAnnotationTool::RegionAnnotationType::FORMATION_ANNOTATIONS ); - formationTrack->setXAxisGridVisibility( RimWellLogPlot::AxisGridVisibility::AXIS_GRID_NONE ); + formationTrack->setPropertyValueAxisGridVisibility( RimWellLogPlot::AxisGridVisibility::AXIS_GRID_NONE ); formationTrack->setShowWellPathAttributes( true ); formationTrack->setShowBothSidesOfWell( false ); formationTrack->setWellPathAttributesSource( stimPlanModel->thicknessDirectionWellPath() ); - formationTrack->setVisibleXRange( 0.0, 0.0 ); + formationTrack->setVisiblePropertyValueRange( 0.0, 0.0 ); formationTrack->setOverburdenHeight( stimPlanModel->overburdenHeight() ); formationTrack->setUnderburdenHeight( stimPlanModel->underburdenHeight() ); formationTrack->setColSpan( RimPlot::ONE ); - formationTrack->setXAxisTitle( stimPlanModel->unitForProperty( RiaDefines::CurveProperty::FORMATIONS ) ); + formationTrack->setPropertyValueAxisTitle( stimPlanModel->unitForProperty( RiaDefines::CurveProperty::FORMATIONS ) ); formationTrack->setLegendsVisible( true ); } @@ -260,18 +260,18 @@ void RicNewStimPlanModelPlotFeature::createFaciesTrack( RimStimPlanModelPlot* pl faciesTrack->setAnnotationDisplay( RiuPlotAnnotationTool::COLOR_SHADING ); faciesTrack->setOverburdenHeight( stimPlanModel->overburdenHeight() ); faciesTrack->setUnderburdenHeight( stimPlanModel->underburdenHeight() ); - faciesTrack->setXAxisTitle( stimPlanModel->unitForProperty( RiaDefines::CurveProperty::FACIES ) ); + faciesTrack->setPropertyValueAxisTitle( stimPlanModel->unitForProperty( RiaDefines::CurveProperty::FACIES ) ); faciesTrack->setLegendsVisible( false ); faciesTrack->setPlotTitleVisible( true ); RimColorLegend* faciesColors = faciesProperties->colorLegend(); if ( faciesColors ) faciesTrack->setColorShadingLegend( faciesColors ); - faciesTrack->setVisibleXRange( 0.0, 0.0 ); + faciesTrack->setVisiblePropertyValueRange( 0.0, 0.0 ); faciesTrack->setColSpan( RimPlot::ONE ); - faciesTrack->setAutoScaleXEnabled( false ); - faciesTrack->setVisibleXRange( 0.0, 0.0 ); - faciesTrack->setXAxisGridVisibility( RimWellLogPlot::AxisGridVisibility::AXIS_GRID_NONE ); + faciesTrack->setAutoScalePropertyValuesEnabled( false ); + faciesTrack->setVisiblePropertyValueRange( 0.0, 0.0 ); + faciesTrack->setPropertyValueAxisGridVisibility( RimWellLogPlot::AxisGridVisibility::AXIS_GRID_NONE ); caf::ColorTable colors = RiaColorTables::wellLogPlotPaletteColors(); @@ -320,7 +320,7 @@ void RicNewStimPlanModelPlotFeature::createLayersTrack( RimStimPlanModelPlot* pl RimColorLegend* faciesColors = faciesProperties->colorLegend(); if ( faciesColors ) faciesTrack->setColorShadingLegend( faciesColors ); - faciesTrack->setVisibleXRange( 0.0, 0.0 ); + faciesTrack->setVisiblePropertyValueRange( 0.0, 0.0 ); faciesTrack->setColSpan( RimPlot::ONE ); caf::ColorTable colors = RiaColorTables::wellLogPlotPaletteColors(); @@ -334,8 +334,8 @@ void RicNewStimPlanModelPlotFeature::createLayersTrack( RimStimPlanModelPlot* pl curve->setAutoNameComponents( false, true, false, false, false ); faciesTrack->addCurve( curve ); - faciesTrack->setAutoScaleXEnabled( true ); - faciesTrack->setXAxisTitle( stimPlanModel->unitForProperty( RiaDefines::CurveProperty::LAYERS ) ); + faciesTrack->setAutoScalePropertyValuesEnabled( true ); + faciesTrack->setPropertyValueAxisTitle( stimPlanModel->unitForProperty( RiaDefines::CurveProperty::LAYERS ) ); curve->loadDataAndUpdate( true ); @@ -420,12 +420,12 @@ void RicNewStimPlanModelPlotFeature::createParametersTrack( RimStimPlanModelPlot colorIndex++; } - plotTrack->setXAxisGridVisibility( RimWellLogPlot::AXIS_GRID_MAJOR ); + plotTrack->setPropertyValueAxisGridVisibility( RimWellLogPlot::AXIS_GRID_MAJOR ); plotTrack->setShowRegionLabels( true ); plotTrack->setLogarithmicScale( isPlotLogarithmic ); - plotTrack->setAutoScaleXEnabled( true ); + plotTrack->setAutoScalePropertyValuesEnabled( true ); plotTrack->setMinAndMaxTicksOnly( useMinMaxTicksOnly( propertyTypes[0] ) ); - plotTrack->setXAxisTitle( stimPlanModel->unitForProperty( propertyTypes[0] ) ); + plotTrack->setPropertyValueAxisTitle( stimPlanModel->unitForProperty( propertyTypes[0] ) ); plotTrack->updateConnectedEditors(); plot->updateConnectedEditors(); diff --git a/ApplicationLibCode/Commands/WellLogCommands/RicNewWellBoreStabilityPlotFeature.cpp b/ApplicationLibCode/Commands/WellLogCommands/RicNewWellBoreStabilityPlotFeature.cpp index b0841f9dca..7891b7fe54 100644 --- a/ApplicationLibCode/Commands/WellLogCommands/RicNewWellBoreStabilityPlotFeature.cpp +++ b/ApplicationLibCode/Commands/WellLogCommands/RicNewWellBoreStabilityPlotFeature.cpp @@ -220,7 +220,7 @@ void RicNewWellBoreStabilityPlotFeature::createFormationTrack( RimWellBoreStabil formationTrack->setFormationWellPath( wellPath ); formationTrack->setFormationCase( geoMechCase ); formationTrack->setAnnotationType( RiuPlotAnnotationTool::RegionAnnotationType::FORMATION_ANNOTATIONS ); - formationTrack->setVisibleXRange( 0.0, 0.0 ); + formationTrack->setVisiblePropertyValueRange( 0.0, 0.0 ); formationTrack->setColSpan( RimPlot::ONE ); } @@ -242,8 +242,8 @@ void RicNewWellBoreStabilityPlotFeature::createCasingShoeTrack( RimWellBoreStabi casingShoeTrack->setShowBothSidesOfWell( false ); casingShoeTrack->setAnnotationTransparency( 90 ); casingShoeTrack->setWellPathAttributesSource( wellPath ); - casingShoeTrack->setVisibleXRange( 0.0, 0.0 ); - casingShoeTrack->setAutoScaleXEnabled( true ); + casingShoeTrack->setVisiblePropertyValueRange( 0.0, 0.0 ); + casingShoeTrack->setAutoScalePropertyValuesEnabled( true ); casingShoeTrack->loadDataAndUpdate(); } @@ -258,10 +258,10 @@ void RicNewWellBoreStabilityPlotFeature::createParametersTrack( RimWellBoreStabi RimWellLogTrack* paramCurvesTrack = RicNewWellLogPlotFeatureImpl::createWellLogPlotTrack( false, "WBS Parameters", plot ); paramCurvesTrack->setColSpan( RimPlot::TWO ); - paramCurvesTrack->setVisibleXRange( 0.0, 2.0 ); - paramCurvesTrack->setAutoScaleXEnabled( true ); + paramCurvesTrack->setVisiblePropertyValueRange( 0.0, 2.0 ); + paramCurvesTrack->setAutoScalePropertyValuesEnabled( true ); paramCurvesTrack->setTickIntervals( 1.0, 0.2 ); - paramCurvesTrack->setXAxisGridVisibility( RimWellLogPlot::AXIS_GRID_MAJOR_AND_MINOR ); + paramCurvesTrack->setPropertyValueAxisGridVisibility( RimWellLogPlot::AXIS_GRID_MAJOR_AND_MINOR ); paramCurvesTrack->setFormationWellPath( wellPath ); paramCurvesTrack->setFormationCase( geoMechCase ); paramCurvesTrack->setShowRegionLabels( true ); @@ -290,7 +290,7 @@ void RicNewWellBoreStabilityPlotFeature::createParametersTrack( RimWellBoreStabi curve->setCustomName( param.name() ); i++; } - paramCurvesTrack->setAutoScaleXEnabled( true ); + paramCurvesTrack->setAutoScalePropertyValuesEnabled( true ); } //-------------------------------------------------------------------------------------------------- @@ -305,11 +305,11 @@ void RicNewWellBoreStabilityPlotFeature::createStabilityCurvesTrack( RimWellBore "Stability Curves", plot ); - stabilityCurvesTrack->setVisibleXRange( 0.0, 2.5 ); + stabilityCurvesTrack->setVisiblePropertyValueRange( 0.0, 2.5 ); stabilityCurvesTrack->setColSpan( RimPlot::THREE ); - stabilityCurvesTrack->setAutoScaleXEnabled( true ); + stabilityCurvesTrack->setAutoScalePropertyValuesEnabled( true ); stabilityCurvesTrack->setTickIntervals( 1.0, 0.2 ); - stabilityCurvesTrack->setXAxisGridVisibility( RimWellLogPlot::AXIS_GRID_MAJOR_AND_MINOR ); + stabilityCurvesTrack->setPropertyValueAxisGridVisibility( RimWellLogPlot::AXIS_GRID_MAJOR_AND_MINOR ); stabilityCurvesTrack->setFormationWellPath( wellPath ); stabilityCurvesTrack->setFormationCase( geoMechCase ); stabilityCurvesTrack->setAnnotationType( RiuPlotAnnotationTool::RegionAnnotationType::FORMATION_ANNOTATIONS ); @@ -368,7 +368,7 @@ void RicNewWellBoreStabilityPlotFeature::createStabilityCurvesTrack( RimWellBore } } - stabilityCurvesTrack->setAutoScaleXEnabled( true ); + stabilityCurvesTrack->setAutoScalePropertyValuesEnabled( true ); } //-------------------------------------------------------------------------------------------------- @@ -426,9 +426,9 @@ void RicNewWellBoreStabilityPlotFeature::createAnglesTrack( RimWellBoreStability minValue = cvf::Math::clamp( minValue, 0.0, maxValue - 90.0 ); } wellPathAnglesTrack->setColSpan( RimPlot::TWO ); - wellPathAnglesTrack->setVisibleXRange( minValue, maxValue ); + wellPathAnglesTrack->setVisiblePropertyValueRange( minValue, maxValue ); wellPathAnglesTrack->setTickIntervals( 180.0, 45.0 ); - wellPathAnglesTrack->setXAxisGridVisibility( RimWellLogPlot::AXIS_GRID_MAJOR_AND_MINOR ); + wellPathAnglesTrack->setPropertyValueAxisGridVisibility( RimWellLogPlot::AXIS_GRID_MAJOR_AND_MINOR ); wellPathAnglesTrack->setFormationWellPath( wellPath ); wellPathAnglesTrack->setFormationCase( geoMechCase ); wellPathAnglesTrack->setAnnotationType( RiuPlotAnnotationTool::RegionAnnotationType::FORMATION_ANNOTATIONS ); diff --git a/ApplicationLibCode/Commands/WellLogCommands/RicWellLogPlotTrackFeatureImpl.cpp b/ApplicationLibCode/Commands/WellLogCommands/RicWellLogPlotTrackFeatureImpl.cpp index c940cdaa7e..a09e17fb77 100644 --- a/ApplicationLibCode/Commands/WellLogCommands/RicWellLogPlotTrackFeatureImpl.cpp +++ b/ApplicationLibCode/Commands/WellLogCommands/RicWellLogPlotTrackFeatureImpl.cpp @@ -73,7 +73,7 @@ void RicWellLogPlotTrackFeatureImpl::moveCurvesToWellLogPlotTrack( RimWellLogTra for ( auto track : srcTracks ) { - track->setAutoScaleXEnabled( true ); + track->setAutoScalePropertyValuesEnabled( true ); track->updateParentPlotZoom(); track->updateStackedCurveData(); track->updateConnectedEditors(); @@ -86,7 +86,7 @@ void RicWellLogPlotTrackFeatureImpl::moveCurvesToWellLogPlotTrack( RimWellLogTra destTrack->loadDataAndUpdate(); destTrack->updateStackedCurveData(); - destTrack->setAutoScaleXEnabled( true ); + destTrack->setAutoScalePropertyValuesEnabled( true ); destTrack->updateParentPlotZoom(); destTrack->updateConnectedEditors(); } diff --git a/ApplicationLibCode/ProjectDataModel/AnalysisPlots/RimAnalysisPlot.h b/ApplicationLibCode/ProjectDataModel/AnalysisPlots/RimAnalysisPlot.h index 53a70a0636..f104e69bb4 100644 --- a/ApplicationLibCode/ProjectDataModel/AnalysisPlots/RimAnalysisPlot.h +++ b/ApplicationLibCode/ProjectDataModel/AnalysisPlots/RimAnalysisPlot.h @@ -136,8 +136,8 @@ private: void reattachAllCurves() override {} void updateAxes() override; void onAxisSelected( int axis, bool toggle ) override; - void setAutoScaleXEnabled( bool enabled ) override {} - void setAutoScaleYEnabled( bool enabled ) override {} + void setAutoScalePropertyValuesEnabled( bool enabled ) override {} + void setAutoScaleDepthValuesEnabled( bool enabled ) override {} void updateLegend() override{}; QString asciiDataForPlotExport() const override { return ""; } diff --git a/ApplicationLibCode/ProjectDataModel/CorrelationPlots/RimAbstractCorrelationPlot.h b/ApplicationLibCode/ProjectDataModel/CorrelationPlots/RimAbstractCorrelationPlot.h index f134284d07..f764d7f118 100644 --- a/ApplicationLibCode/ProjectDataModel/CorrelationPlots/RimAbstractCorrelationPlot.h +++ b/ApplicationLibCode/ProjectDataModel/CorrelationPlots/RimAbstractCorrelationPlot.h @@ -107,8 +107,8 @@ protected: RiuPlotWidget* doCreatePlotViewWidget( QWidget* mainWindowParent = nullptr ) override; void reattachAllCurves() override {} - void setAutoScaleXEnabled( bool enabled ) override {} - void setAutoScaleYEnabled( bool enabled ) override {} + void setAutoScalePropertyValuesEnabled( bool enabled ) override {} + void setAutoScaleDepthValuesEnabled( bool enabled ) override {} void updateLegend() override; QString asciiDataForPlotExport() const override { return ""; } diff --git a/ApplicationLibCode/ProjectDataModel/Flow/RimWellAllocationPlot.cpp b/ApplicationLibCode/ProjectDataModel/Flow/RimWellAllocationPlot.cpp index 4b6fb36b0a..39164c138e 100644 --- a/ApplicationLibCode/ProjectDataModel/Flow/RimWellAllocationPlot.cpp +++ b/ApplicationLibCode/ProjectDataModel/Flow/RimWellAllocationPlot.cpp @@ -481,7 +481,7 @@ void RimWellAllocationPlot::updateWellFlowPlotXAxisTitle( RimWellLogTrack* plotT : RimWellLogFile::WELL_FLOW_COND_STANDARD; QString axisTitle = RimWellPlotTools::flowPlotAxisTitle( condition, unitSet ); - plotTrack->setXAxisTitle( axisTitle ); + plotTrack->setPropertyValueAxisTitle( axisTitle ); #if 0 if (m_flowDiagSolution) diff --git a/ApplicationLibCode/ProjectDataModel/Flow/RimWellDistributionPlot.cpp b/ApplicationLibCode/ProjectDataModel/Flow/RimWellDistributionPlot.cpp index b7d01acf39..71f9872698 100644 --- a/ApplicationLibCode/ProjectDataModel/Flow/RimWellDistributionPlot.cpp +++ b/ApplicationLibCode/ProjectDataModel/Flow/RimWellDistributionPlot.cpp @@ -127,7 +127,7 @@ RiuPlotWidget* RimWellDistributionPlot::plotWidget() //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -void RimWellDistributionPlot::setAutoScaleXEnabled( bool /*enabled*/ ) +void RimWellDistributionPlot::setAutoScalePropertyValuesEnabled( bool /*enabled*/ ) { // cvf::Trace::show("RimWellDistributionPlot::setAutoScaleXEnabled()"); } @@ -135,7 +135,7 @@ void RimWellDistributionPlot::setAutoScaleXEnabled( bool /*enabled*/ ) //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -void RimWellDistributionPlot::setAutoScaleYEnabled( bool /*enabled*/ ) +void RimWellDistributionPlot::setAutoScaleDepthValuesEnabled( bool /*enabled*/ ) { // cvf::Trace::show("RimWellDistributionPlot::setAutoScaleYEnabled()"); } diff --git a/ApplicationLibCode/ProjectDataModel/Flow/RimWellDistributionPlot.h b/ApplicationLibCode/ProjectDataModel/Flow/RimWellDistributionPlot.h index 1949837277..879ccb39f3 100644 --- a/ApplicationLibCode/ProjectDataModel/Flow/RimWellDistributionPlot.h +++ b/ApplicationLibCode/ProjectDataModel/Flow/RimWellDistributionPlot.h @@ -50,8 +50,8 @@ public: // RimPlot implementations RiuPlotWidget* plotWidget() override; - void setAutoScaleXEnabled( bool enabled ) override; - void setAutoScaleYEnabled( bool enabled ) override; + void setAutoScalePropertyValuesEnabled( bool enabled ) override; + void setAutoScaleDepthValuesEnabled( bool enabled ) override; void updateAxes() override; void updateLegend() override; void updateZoomInParentPlot() override; diff --git a/ApplicationLibCode/ProjectDataModel/Flow/RimWellFlowRateCurve.cpp b/ApplicationLibCode/ProjectDataModel/Flow/RimWellFlowRateCurve.cpp index 0574c63a42..83d18d5af3 100644 --- a/ApplicationLibCode/ProjectDataModel/Flow/RimWellFlowRateCurve.cpp +++ b/ApplicationLibCode/ProjectDataModel/Flow/RimWellFlowRateCurve.cpp @@ -300,7 +300,14 @@ void RimWellFlowRateCurve::setFlowValuesPrDepthValue( const QString& const std::vector& depthValues, const std::vector& flowRates ) { - this->setValuesAndDepths( flowRates, depthValues, depthType, 0.0, RiaDefines::DepthUnitType::UNIT_NONE, false ); + bool useLogarithmicScale = false; + this->setPropertyValuesAndDepths( flowRates, + depthValues, + depthType, + 0.0, + RiaDefines::DepthUnitType::UNIT_NONE, + false, + useLogarithmicScale ); m_curveAutoName = curveName; } diff --git a/ApplicationLibCode/ProjectDataModel/Flow/RimWellPltPlot.cpp b/ApplicationLibCode/ProjectDataModel/Flow/RimWellPltPlot.cpp index 87cc43993b..4fb250e1d8 100644 --- a/ApplicationLibCode/ProjectDataModel/Flow/RimWellPltPlot.cpp +++ b/ApplicationLibCode/ProjectDataModel/Flow/RimWellPltPlot.cpp @@ -188,7 +188,7 @@ void RimWellPltPlot::setPlotXAxisTitles( RimWellLogTrack* plotTrack ) if ( m_useStandardConditionCurves ) axisTitle += RimWellPlotTools::flowPlotAxisTitle( RimWellLogFile::WELL_FLOW_COND_STANDARD, unitSet ); - plotTrack->setXAxisTitle( axisTitle ); + plotTrack->setPropertyValueAxisTitle( axisTitle ); #if 0 QString unitText; @@ -685,7 +685,7 @@ void RimWellPltPlot::syncCurvesFromUiSelection() curveGroupId++; } - plotTrack->setAutoScaleXEnabled( true ); + plotTrack->setAutoScalePropertyValuesEnabled( true ); RimWellLogPlot::onLoadDataAndUpdate(); } @@ -918,7 +918,7 @@ void RimWellPltPlot::fieldChangedByUi( const caf::PdmFieldHandle* changedField, RimWellLogTrack* const plotTrack = dynamic_cast( plotByIndex( 0 ) ); if ( plotTrack ) { - plotTrack->setAutoScaleXEnabled( true ); + plotTrack->setAutoScalePropertyValuesEnabled( true ); } updateZoom(); } @@ -931,7 +931,7 @@ void RimWellPltPlot::fieldChangedByUi( const caf::PdmFieldHandle* changedField, RimWellLogTrack* const plotTrack = dynamic_cast( plotByIndex( 0 ) ); if ( plotTrack ) { - plotTrack->setAutoScaleXEnabled( true ); + plotTrack->setAutoScalePropertyValuesEnabled( true ); } updateZoom(); } diff --git a/ApplicationLibCode/ProjectDataModel/GridCrossPlots/RimGridCrossPlot.cpp b/ApplicationLibCode/ProjectDataModel/GridCrossPlots/RimGridCrossPlot.cpp index 87821173b8..9103c6c967 100644 --- a/ApplicationLibCode/ProjectDataModel/GridCrossPlots/RimGridCrossPlot.cpp +++ b/ApplicationLibCode/ProjectDataModel/GridCrossPlots/RimGridCrossPlot.cpp @@ -183,8 +183,8 @@ QImage RimGridCrossPlot::snapshotWindowContent() //-------------------------------------------------------------------------------------------------- void RimGridCrossPlot::zoomAll() { - setAutoScaleXEnabled( true ); - setAutoScaleYEnabled( true ); + setAutoScalePropertyValuesEnabled( true ); + setAutoScaleDepthValuesEnabled( true ); updateZoomInParentPlot(); } @@ -338,7 +338,7 @@ void RimGridCrossPlot::detachAllCurves() //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -void RimGridCrossPlot::setAutoScaleXEnabled( bool enabled ) +void RimGridCrossPlot::setAutoScalePropertyValuesEnabled( bool enabled ) { m_xAxisProperties->setAutoZoom( enabled ); } @@ -346,7 +346,7 @@ void RimGridCrossPlot::setAutoScaleXEnabled( bool enabled ) //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -void RimGridCrossPlot::setAutoScaleYEnabled( bool enabled ) +void RimGridCrossPlot::setAutoScaleDepthValuesEnabled( bool enabled ) { m_yAxisProperties->setAutoZoom( enabled ); } @@ -457,8 +457,8 @@ void RimGridCrossPlot::axisLogarithmicChanged( const caf::SignalEmitter* emitter //-------------------------------------------------------------------------------------------------- void RimGridCrossPlot::onPlotZoomed() { - setAutoScaleXEnabled( false ); - setAutoScaleYEnabled( false ); + setAutoScalePropertyValuesEnabled( false ); + setAutoScaleDepthValuesEnabled( false ); updateZoomFromParentPlot(); } diff --git a/ApplicationLibCode/ProjectDataModel/GridCrossPlots/RimGridCrossPlot.h b/ApplicationLibCode/ProjectDataModel/GridCrossPlots/RimGridCrossPlot.h index 36d460f79d..f50d2c0d09 100644 --- a/ApplicationLibCode/ProjectDataModel/GridCrossPlots/RimGridCrossPlot.h +++ b/ApplicationLibCode/ProjectDataModel/GridCrossPlots/RimGridCrossPlot.h @@ -102,8 +102,8 @@ public: void updateZoomInParentPlot() override; void updateZoomFromParentPlot() override; - void setAutoScaleXEnabled( bool enabled ) override; - void setAutoScaleYEnabled( bool enabled ) override; + void setAutoScalePropertyValuesEnabled( bool enabled ) override; + void setAutoScaleDepthValuesEnabled( bool enabled ) override; caf::PdmObject* findPdmObjectFromPlotCurve( const RiuPlotCurve* curve ) const override; void onAxisSelected( int axis, bool toggle ) override; diff --git a/ApplicationLibCode/ProjectDataModel/GridCrossPlots/RimGridCrossPlotCurve.cpp b/ApplicationLibCode/ProjectDataModel/GridCrossPlots/RimGridCrossPlotCurve.cpp index abd2f86bea..6c079924c3 100644 --- a/ApplicationLibCode/ProjectDataModel/GridCrossPlots/RimGridCrossPlotCurve.cpp +++ b/ApplicationLibCode/ProjectDataModel/GridCrossPlots/RimGridCrossPlotCurve.cpp @@ -57,8 +57,8 @@ void RimGridCrossPlotCurve::setSamples( const std::vector& xValues, cons if ( xValues.empty() || yValues.empty() || !m_plotCurve ) return; - bool isLogCurve = false; - m_plotCurve->setSamplesFromXValuesAndYValues( xValues, yValues, isLogCurve ); + bool useLogarithmicScale = false; + m_plotCurve->setSamplesFromXValuesAndYValues( xValues, yValues, useLogarithmicScale ); } //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationLibCode/ProjectDataModel/RimDepthTrackPlot.cpp b/ApplicationLibCode/ProjectDataModel/RimDepthTrackPlot.cpp index 4649a113ed..f9fed18592 100644 --- a/ApplicationLibCode/ProjectDataModel/RimDepthTrackPlot.cpp +++ b/ApplicationLibCode/ProjectDataModel/RimDepthTrackPlot.cpp @@ -315,7 +315,7 @@ void RimDepthTrackPlot::updateZoom() for ( RimPlot* plot : plots() ) { - static_cast( plot )->setVisibleYRange( m_minVisibleDepth(), m_maxVisibleDepth() ); + static_cast( plot )->setVisibleDepthRange( m_minVisibleDepth(), m_maxVisibleDepth() ); plot->updateZoomInParentPlot(); } @@ -1183,7 +1183,7 @@ void RimDepthTrackPlot::setAutoScaleXEnabled( bool enabled ) { for ( RimPlot* plot : plots() ) { - plot->setAutoScaleXEnabled( enabled ); + plot->setAutoScalePropertyValuesEnabled( enabled ); } } diff --git a/ApplicationLibCode/ProjectDataModel/RimGridTimeHistoryCurve.cpp b/ApplicationLibCode/ProjectDataModel/RimGridTimeHistoryCurve.cpp index 654b6e88f9..40fae50a12 100644 --- a/ApplicationLibCode/ProjectDataModel/RimGridTimeHistoryCurve.cpp +++ b/ApplicationLibCode/ProjectDataModel/RimGridTimeHistoryCurve.cpp @@ -408,18 +408,20 @@ void RimGridTimeHistoryCurve::onLoadDataAndUpdate( bool updateParentPlot ) RimSummaryPlot* plot = nullptr; firstAncestorOrThisOfType( plot ); - bool isLogCurve = plot->isLogarithmicScaleEnabled( yAxis() ); + bool useLogarithmicScale = plot->isLogarithmicScaleEnabled( yAxis() ); if ( plot->timeAxisProperties()->timeMode() == RimSummaryTimeAxisProperties::DATE ) { std::vector dateTimes = timeStepValues(); if ( dateTimes.size() > 0 && dateTimes.size() == values.size() ) { - m_plotCurve->setSamplesFromTimeTAndYValues( dateTimes, values, isLogCurve ); + m_plotCurve->setSamplesFromTimeTAndYValues( dateTimes, values, useLogarithmicScale ); } else { - m_plotCurve->setSamplesFromTimeTAndYValues( std::vector(), std::vector(), isLogCurve ); + m_plotCurve->setSamplesFromTimeTAndYValues( std::vector(), + std::vector(), + useLogarithmicScale ); } } else @@ -435,11 +437,13 @@ void RimGridTimeHistoryCurve::onLoadDataAndUpdate( bool updateParentPlot ) times.push_back( timeScale * day ); } - m_plotCurve->setSamplesFromXValuesAndYValues( times, values, isLogCurve ); + m_plotCurve->setSamplesFromXValuesAndYValues( times, values, useLogarithmicScale ); } else { - m_plotCurve->setSamplesFromTimeTAndYValues( std::vector(), std::vector(), isLogCurve ); + m_plotCurve->setSamplesFromTimeTAndYValues( std::vector(), + std::vector(), + useLogarithmicScale ); } } diff --git a/ApplicationLibCode/ProjectDataModel/RimMultiPlot.cpp b/ApplicationLibCode/ProjectDataModel/RimMultiPlot.cpp index 15d9c5248d..fe263fd2e9 100644 --- a/ApplicationLibCode/ProjectDataModel/RimMultiPlot.cpp +++ b/ApplicationLibCode/ProjectDataModel/RimMultiPlot.cpp @@ -406,7 +406,7 @@ void RimMultiPlot::setAutoScaleXEnabled( bool enabled ) { for ( RimPlot* plot : plots() ) { - plot->setAutoScaleXEnabled( enabled ); + plot->setAutoScalePropertyValuesEnabled( enabled ); } } @@ -417,7 +417,7 @@ void RimMultiPlot::setAutoScaleYEnabled( bool enabled ) { for ( RimPlot* plot : plots() ) { - plot->setAutoScaleYEnabled( enabled ); + plot->setAutoScaleDepthValuesEnabled( enabled ); } } diff --git a/ApplicationLibCode/ProjectDataModel/RimPlot.h b/ApplicationLibCode/ProjectDataModel/RimPlot.h index 5f84ce8d9b..d792075e98 100644 --- a/ApplicationLibCode/ProjectDataModel/RimPlot.h +++ b/ApplicationLibCode/ProjectDataModel/RimPlot.h @@ -71,9 +71,9 @@ public: void updateAfterInsertingIntoMultiPlot(); // Pure virtual interface methods - virtual void setAutoScaleXEnabled( bool enabled ) = 0; - virtual void setAutoScaleYEnabled( bool enabled ) = 0; - virtual void updateAxes() = 0; + virtual void setAutoScalePropertyValuesEnabled( bool enabled ) = 0; + virtual void setAutoScaleDepthValuesEnabled( bool enabled ) = 0; + virtual void updateAxes() = 0; virtual void updateLegend() = 0; diff --git a/ApplicationLibCode/ProjectDataModel/RimPlotCurve.cpp b/ApplicationLibCode/ProjectDataModel/RimPlotCurve.cpp index bc24d94bd7..c144df4a13 100644 --- a/ApplicationLibCode/ProjectDataModel/RimPlotCurve.cpp +++ b/ApplicationLibCode/ProjectDataModel/RimPlotCurve.cpp @@ -684,11 +684,11 @@ bool RimPlotCurve::hasParentPlot() const //-------------------------------------------------------------------------------------------------- void RimPlotCurve::setSamplesFromXYValues( const std::vector& xValues, const std::vector& yValues, - bool isLogCurve ) + bool useLogarithmicScale ) { if ( m_plotCurve ) { - m_plotCurve->setSamplesFromXValuesAndYValues( xValues, yValues, isLogCurve ); + m_plotCurve->setSamplesFromXValuesAndYValues( xValues, yValues, useLogarithmicScale ); } } @@ -697,11 +697,11 @@ void RimPlotCurve::setSamplesFromXYValues( const std::vector& xValues, //-------------------------------------------------------------------------------------------------- void RimPlotCurve::setSamplesFromDatesAndYValues( const std::vector& dateTimes, const std::vector& yValues, - bool isLogCurve ) + bool useLogarithmicScale ) { if ( m_plotCurve ) { - m_plotCurve->setSamplesFromDatesAndYValues( dateTimes, yValues, isLogCurve ); + m_plotCurve->setSamplesFromDatesAndYValues( dateTimes, yValues, useLogarithmicScale ); } } @@ -710,11 +710,11 @@ void RimPlotCurve::setSamplesFromDatesAndYValues( const std::vector& //-------------------------------------------------------------------------------------------------- void RimPlotCurve::setSamplesFromTimeTAndYValues( const std::vector& dateTimes, const std::vector& yValues, - bool isLogCurve ) + bool useLogarithmicScale ) { if ( m_plotCurve ) { - m_plotCurve->setSamplesFromTimeTAndYValues( dateTimes, yValues, isLogCurve ); + m_plotCurve->setSamplesFromTimeTAndYValues( dateTimes, yValues, useLogarithmicScale ); } } @@ -724,12 +724,12 @@ void RimPlotCurve::setSamplesFromTimeTAndYValues( const std::vector& dat void RimPlotCurve::setSamplesFromXYErrorValues( const std::vector& xValues, const std::vector& yValues, const std::vector& errorValues, - bool isLogCurve, + bool useLogarithmicScale, RiaCurveDataTools::ErrorAxis errorAxis ) { if ( m_plotCurve ) { - m_plotCurve->setSamplesFromXYErrorValues( xValues, yValues, errorValues, isLogCurve, errorAxis ); + m_plotCurve->setSamplesFromXYErrorValues( xValues, yValues, errorValues, useLogarithmicScale, errorAxis ); } } diff --git a/ApplicationLibCode/ProjectDataModel/RimPlotCurve.h b/ApplicationLibCode/ProjectDataModel/RimPlotCurve.h index dc54be2993..bb367a6ebe 100644 --- a/ApplicationLibCode/ProjectDataModel/RimPlotCurve.h +++ b/ApplicationLibCode/ProjectDataModel/RimPlotCurve.h @@ -141,18 +141,20 @@ protected: void setSamplesFromXYErrorValues( const std::vector& xValues, const std::vector& yValues, const std::vector& errorValues, - bool isLogCurve, + bool useLogarithmicScale, RiaCurveDataTools::ErrorAxis errorAxis = RiaCurveDataTools::ErrorAxis::ERROR_ALONG_Y_AXIS ); - void setSamplesFromXYValues( const std::vector& xValues, const std::vector& yValues, bool isLogCurve ); + void setSamplesFromXYValues( const std::vector& xValues, + const std::vector& yValues, + bool useLogarithmicScale ); void setSamplesFromDatesAndYValues( const std::vector& dateTimes, const std::vector& yValues, - bool isLogCurve ); + bool useLogarithmicScale ); void setSamplesFromTimeTAndYValues( const std::vector& dateTimes, const std::vector& yValues, - bool isLogCurve ); + bool useLogarithmicScale ); protected: // Overridden PDM methods diff --git a/ApplicationLibCode/ProjectDataModel/RimVfpPlot.cpp b/ApplicationLibCode/ProjectDataModel/RimVfpPlot.cpp index e4ffe06f58..78f5d39043 100644 --- a/ApplicationLibCode/ProjectDataModel/RimVfpPlot.cpp +++ b/ApplicationLibCode/ProjectDataModel/RimVfpPlot.cpp @@ -175,14 +175,14 @@ RiuPlotWidget* RimVfpPlot::plotWidget() //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -void RimVfpPlot::setAutoScaleXEnabled( bool /*enabled*/ ) +void RimVfpPlot::setAutoScalePropertyValuesEnabled( bool /*enabled*/ ) { } //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -void RimVfpPlot::setAutoScaleYEnabled( bool /*enabled*/ ) +void RimVfpPlot::setAutoScaleDepthValuesEnabled( bool /*enabled*/ ) { } @@ -573,8 +573,8 @@ void RimVfpPlot::populatePlotWidgetWithPlotData( RiuPlotWidget* plotWidget, cons symbol->setSize( 6, 6 ); curve->setSymbol( symbol ); - bool isLogCurve = false; - curve->setSamplesFromXValuesAndYValues( plotData.xData( idx ), plotData.yData( idx ), isLogCurve ); + bool useLogarithmicScale = false; + curve->setSamplesFromXValuesAndYValues( plotData.xData( idx ), plotData.yData( idx ), useLogarithmicScale ); curve->attachToPlot( plotWidget ); curve->showInPlot(); } diff --git a/ApplicationLibCode/ProjectDataModel/RimVfpPlot.h b/ApplicationLibCode/ProjectDataModel/RimVfpPlot.h index ca832c04b7..991391e107 100644 --- a/ApplicationLibCode/ProjectDataModel/RimVfpPlot.h +++ b/ApplicationLibCode/ProjectDataModel/RimVfpPlot.h @@ -48,8 +48,8 @@ public: // RimPlot implementations RiuPlotWidget* plotWidget() override; - void setAutoScaleXEnabled( bool enabled ) override; - void setAutoScaleYEnabled( bool enabled ) override; + void setAutoScalePropertyValuesEnabled( bool enabled ) override; + void setAutoScaleDepthValuesEnabled( bool enabled ) override; void updateAxes() override; void updateLegend() override; QString asciiDataForPlotExport() const override; diff --git a/ApplicationLibCode/ProjectDataModel/StimPlanModel/RimStimPlanModelCurve.cpp b/ApplicationLibCode/ProjectDataModel/StimPlanModel/RimStimPlanModelCurve.cpp index 0ed60b1d52..c4ccf87eb8 100644 --- a/ApplicationLibCode/ProjectDataModel/StimPlanModel/RimStimPlanModelCurve.cpp +++ b/ApplicationLibCode/ProjectDataModel/StimPlanModel/RimStimPlanModelCurve.cpp @@ -158,7 +158,17 @@ void RimStimPlanModelCurve::performDataExtraction( bool* isUsingPseudoLength ) filterInvalidValuesForLogarithmicScale( values ); } - this->setValuesWithMdAndTVD( values, measuredDepthValues, tvDepthValues, rkbDiff, depthUnit, !performDataSmoothing, xUnits ); + // TOOD: Consider rewrite, as RigWellLogCurveData can do logarithmic filtering + + bool useLogarithmicScale = false; + this->setPropertyValuesWithMdAndTVD( values, + measuredDepthValues, + tvDepthValues, + rkbDiff, + depthUnit, + !performDataSmoothing, + useLogarithmicScale, + xUnits ); } } diff --git a/ApplicationLibCode/ProjectDataModel/Summary/RimAsciiDataCurve.cpp b/ApplicationLibCode/ProjectDataModel/Summary/RimAsciiDataCurve.cpp index 6d6b6a5e71..993a2280ae 100644 --- a/ApplicationLibCode/ProjectDataModel/Summary/RimAsciiDataCurve.cpp +++ b/ApplicationLibCode/ProjectDataModel/Summary/RimAsciiDataCurve.cpp @@ -134,13 +134,13 @@ void RimAsciiDataCurve::onLoadDataAndUpdate( bool updateParentPlot ) RimSummaryPlot* plot = nullptr; firstAncestorOrThisOfType( plot ); - bool isLogCurve = plot->isLogarithmicScaleEnabled( this->yAxis() ); + bool useLogarithmicScale = plot->isLogarithmicScaleEnabled( this->yAxis() ); if ( dateTimes.size() > 0 && dateTimes.size() == values.size() ) { if ( plot->timeAxisProperties()->timeMode() == RimSummaryTimeAxisProperties::DATE ) { - m_plotCurve->setSamplesFromTimeTAndYValues( dateTimes, values, isLogCurve ); + m_plotCurve->setSamplesFromTimeTAndYValues( dateTimes, values, useLogarithmicScale ); } else { @@ -156,12 +156,12 @@ void RimAsciiDataCurve::onLoadDataAndUpdate( bool updateParentPlot ) } } - m_plotCurve->setSamplesFromXValuesAndYValues( times, values, isLogCurve ); + m_plotCurve->setSamplesFromXValuesAndYValues( times, values, useLogarithmicScale ); } } else { - m_plotCurve->setSamplesFromTimeTAndYValues( std::vector(), std::vector(), isLogCurve ); + m_plotCurve->setSamplesFromTimeTAndYValues( std::vector(), std::vector(), useLogarithmicScale ); } updateZoomInParentPlot(); diff --git a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCurve.cpp b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCurve.cpp index 22d021c7e3..38e627f727 100644 --- a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCurve.cpp +++ b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCurve.cpp @@ -601,7 +601,7 @@ void RimSummaryCurve::onLoadDataAndUpdate( bool updateParentPlot ) RimSummaryPlot* plot = nullptr; firstAncestorOrThisOfTypeAsserted( plot ); - bool isLogCurve = plot->isLogarithmicScaleEnabled( this->axisY() ); + bool useLogarithmicScale = plot->isLogarithmicScaleEnabled( this->axisY() ); bool shouldPopulateViewWithEmptyData = false; @@ -627,7 +627,7 @@ void RimSummaryCurve::onLoadDataAndUpdate( bool updateParentPlot ) { this->setSamplesFromXYValues( curveMerger.interpolatedYValuesForAllXValues( 0 ), curveMerger.interpolatedYValuesForAllXValues( 1 ), - isLogCurve ); + useLogarithmicScale ); } else { @@ -655,11 +655,11 @@ void RimSummaryCurve::onLoadDataAndUpdate( bool updateParentPlot ) if ( !errValues.empty() ) { - this->setSamplesFromXYErrorValues( timeSteps, curveValuesY, errValues, isLogCurve ); + this->setSamplesFromXYErrorValues( timeSteps, curveValuesY, errValues, useLogarithmicScale ); } else { - this->setSamplesFromXYValues( timeSteps, curveValuesY, isLogCurve ); + this->setSamplesFromXYValues( timeSteps, curveValuesY, useLogarithmicScale ); } } else @@ -681,12 +681,14 @@ void RimSummaryCurve::onLoadDataAndUpdate( bool updateParentPlot ) resampledTimeSteps.insert( resampledTimeSteps.begin(), curveTimeStepsY.front() ); resampledValues.insert( resampledValues.begin(), resampledValues.front() ); - this->setSamplesFromTimeTAndYValues( resampledTimeSteps, resampledValues, isLogCurve ); + this->setSamplesFromTimeTAndYValues( resampledTimeSteps, + resampledValues, + useLogarithmicScale ); } } else { - this->setSamplesFromTimeTAndYValues( curveTimeStepsY, curveValuesY, isLogCurve ); + this->setSamplesFromTimeTAndYValues( curveTimeStepsY, curveValuesY, useLogarithmicScale ); } } } @@ -705,7 +707,7 @@ void RimSummaryCurve::onLoadDataAndUpdate( bool updateParentPlot ) } } - this->setSamplesFromXYValues( timeFromSimulationStart, curveValuesY, isLogCurve ); + this->setSamplesFromXYValues( timeFromSimulationStart, curveValuesY, useLogarithmicScale ); } } else @@ -716,7 +718,7 @@ void RimSummaryCurve::onLoadDataAndUpdate( bool updateParentPlot ) if ( shouldPopulateViewWithEmptyData ) { - this->setSamplesFromXYValues( std::vector(), std::vector(), isLogCurve ); + this->setSamplesFromXYValues( std::vector(), std::vector(), useLogarithmicScale ); } if ( updateParentPlot && hasParentPlot() ) diff --git a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryPlot.cpp b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryPlot.cpp index 2816449962..09bd36d1dd 100644 --- a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryPlot.cpp +++ b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryPlot.cpp @@ -1134,8 +1134,8 @@ void RimSummaryPlot::removeAllTimeAnnotations() //-------------------------------------------------------------------------------------------------- void RimSummaryPlot::zoomAll() { - setAutoScaleXEnabled( true ); - setAutoScaleYEnabled( true ); + setAutoScalePropertyValuesEnabled( true ); + setAutoScaleDepthValuesEnabled( true ); updateZoomInParentPlot(); } @@ -1828,8 +1828,8 @@ void RimSummaryPlot::handleDroppedObjects( const std::vector RimSummaryPlot::fieldsToShowInToolbar() //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -void RimSummaryPlot::setAutoScaleXEnabled( bool enabled ) +void RimSummaryPlot::setAutoScalePropertyValuesEnabled( bool enabled ) { for ( auto ap : m_axisProperties ) { @@ -2258,7 +2258,7 @@ void RimSummaryPlot::setAutoScaleXEnabled( bool enabled ) //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -void RimSummaryPlot::setAutoScaleYEnabled( bool enabled ) +void RimSummaryPlot::setAutoScaleDepthValuesEnabled( bool enabled ) { for ( auto ap : m_axisProperties ) { diff --git a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryPlot.h b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryPlot.h index 4778503e58..0f640ca81e 100644 --- a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryPlot.h +++ b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryPlot.h @@ -161,8 +161,8 @@ public: virtual RimSummaryPlotSourceStepping* sourceSteppingObjectForKeyEventHandling() const; virtual std::vector fieldsToShowInToolbar(); - void setAutoScaleXEnabled( bool enabled ) override; - void setAutoScaleYEnabled( bool enabled ) override; + void setAutoScalePropertyValuesEnabled( bool enabled ) override; + void setAutoScaleDepthValuesEnabled( bool enabled ) override; RiuPlotWidget* plotWidget() override; void zoomAll() override; void updateZoomInParentPlot() override; diff --git a/ApplicationLibCode/ProjectDataModel/WellLog/Rim3dWellLogRftCurve.cpp b/ApplicationLibCode/ProjectDataModel/WellLog/Rim3dWellLogRftCurve.cpp index 66cb1f11b0..7461dd2745 100644 --- a/ApplicationLibCode/ProjectDataModel/WellLog/Rim3dWellLogRftCurve.cpp +++ b/ApplicationLibCode/ProjectDataModel/WellLog/Rim3dWellLogRftCurve.cpp @@ -79,7 +79,7 @@ void Rim3dWellLogRftCurve::curveValuesAndMds( std::vector* values, std:: const RigWellLogCurveData* curveData = m_2dWellLogRftCurve->curveData(); // These values are for a simulation well - *values = curveData->xValues(); + *values = curveData->propertyValues(); *measuredDepthValues = curveData->depths( RiaDefines::DepthTypeEnum::MEASURED_DEPTH ); } diff --git a/ApplicationLibCode/ProjectDataModel/WellLog/RimEnsembleWellLogStatisticsCurve.cpp b/ApplicationLibCode/ProjectDataModel/WellLog/RimEnsembleWellLogStatisticsCurve.cpp index 27d3932da5..c35d643e78 100644 --- a/ApplicationLibCode/ProjectDataModel/WellLog/RimEnsembleWellLogStatisticsCurve.cpp +++ b/ApplicationLibCode/ProjectDataModel/WellLog/RimEnsembleWellLogStatisticsCurve.cpp @@ -150,7 +150,8 @@ void RimEnsembleWellLogStatisticsCurve::performDataExtraction( bool* isUsingPseu validDepths.insert( std::make_pair( RiaDefines::DepthTypeEnum::TRUE_VERTICAL_DEPTH_RKB, tvDepthValues ) ); } - this->setValuesAndDepths( values, validDepths, rkbDiff, depthUnit, false ); + bool useLogarithmicScale = false; + this->setPropertyValuesAndDepths( values, validDepths, rkbDiff, depthUnit, false, useLogarithmicScale ); } } } diff --git a/ApplicationLibCode/ProjectDataModel/WellLog/RimWellLogCurve.cpp b/ApplicationLibCode/ProjectDataModel/WellLog/RimWellLogCurve.cpp index 28b827251a..19da3c84d7 100644 --- a/ApplicationLibCode/ProjectDataModel/WellLog/RimWellLogCurve.cpp +++ b/ApplicationLibCode/ProjectDataModel/WellLog/RimWellLogCurve.cpp @@ -49,7 +49,8 @@ RimWellLogCurve::RimWellLogCurve() m_curveData = new RigWellLogCurveData; - m_curveDataXRange = std::make_pair( std::numeric_limits::infinity(), -std::numeric_limits::infinity() ); + m_curveDataPropertyValueRange = + std::make_pair( std::numeric_limits::infinity(), -std::numeric_limits::infinity() ); setDeletable( true ); } @@ -72,7 +73,7 @@ void RimWellLogCurve::setDepthUnit( RiaDefines::DepthUnitType depthUnit ) //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -bool RimWellLogCurve::xValueRangeInData( double* minimumValue, double* maximumValue ) const +bool RimWellLogCurve::propertyValueRangeInData( double* minimumValue, double* maximumValue ) const { CAF_ASSERT( minimumValue && maximumValue ); @@ -81,14 +82,14 @@ bool RimWellLogCurve::xValueRangeInData( double* minimumValue, double* maximumVa return false; } - if ( m_curveDataXRange.first == -std::numeric_limits::infinity() || - m_curveDataXRange.second == std::numeric_limits::infinity() ) + if ( m_curveDataPropertyValueRange.first == -std::numeric_limits::infinity() || + m_curveDataPropertyValueRange.second == std::numeric_limits::infinity() ) { return false; } - *minimumValue = m_curveDataXRange.first; - *maximumValue = m_curveDataXRange.second; + *minimumValue = m_curveDataPropertyValueRange.first; + *maximumValue = m_curveDataPropertyValueRange.second; return true; } @@ -96,7 +97,7 @@ bool RimWellLogCurve::xValueRangeInData( double* minimumValue, double* maximumVa //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -bool RimWellLogCurve::yValueRangeInData( double* minimumValue, double* maximumValue ) const +bool RimWellLogCurve::depthValueRangeInData( double* minimumValue, double* maximumValue ) const { CAF_ASSERT( minimumValue && maximumValue ); @@ -116,50 +117,54 @@ bool RimWellLogCurve::yValueRangeInData( double* minimumValue, double* maximumVa //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -void RimWellLogCurve::setValuesAndDepths( const std::vector& xValues, - const std::vector& depths, - RiaDefines::DepthTypeEnum depthType, - double rkbDiff, - RiaDefines::DepthUnitType depthUnit, - bool isExtractionCurve, - const QString& xUnits ) +void RimWellLogCurve::setPropertyValuesAndDepths( const std::vector& propertyValues, + const std::vector& depths, + RiaDefines::DepthTypeEnum depthType, + double rkbDiff, + RiaDefines::DepthUnitType depthUnit, + bool isExtractionCurve, + bool useLogarithmicScale, + const QString& propertyUnit ) { - m_curveData->setValuesAndDepths( xValues, depths, depthType, rkbDiff, depthUnit, isExtractionCurve ); - m_curveData->setXUnits( xUnits ); - calculateCurveDataXRange(); + m_curveData->setValuesAndDepths( propertyValues, depths, depthType, rkbDiff, depthUnit, isExtractionCurve, useLogarithmicScale ); + m_curveData->setPropertyValueUnit( propertyUnit ); + calculateCurveDataPropertyValueRange(); } //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -void RimWellLogCurve::setValuesAndDepths( const std::vector& xValues, - const std::map>& depths, - double rkbDiff, - RiaDefines::DepthUnitType depthUnit, - bool isExtractionCurve, - const QString& xUnits ) +void RimWellLogCurve::setPropertyValuesAndDepths( const std::vector& propertyValues, + const std::map>& depths, + double rkbDiff, + RiaDefines::DepthUnitType depthUnit, + bool isExtractionCurve, + bool useLogarithmicScale, + + const QString& propertyUnit ) { - m_curveData->setValuesAndDepths( xValues, depths, rkbDiff, depthUnit, isExtractionCurve ); - m_curveData->setXUnits( xUnits ); - calculateCurveDataXRange(); + m_curveData->setValuesAndDepths( propertyValues, depths, rkbDiff, depthUnit, isExtractionCurve, useLogarithmicScale ); + m_curveData->setPropertyValueUnit( propertyUnit ); + calculateCurveDataPropertyValueRange(); } //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -void RimWellLogCurve::setValuesWithMdAndTVD( const std::vector& xValues, - const std::vector& measuredDepths, - const std::vector& tvdMSL, - double rkbDiff, - RiaDefines::DepthUnitType depthUnit, - bool isExtractionCurve, - const QString& xUnits ) +void RimWellLogCurve::setPropertyValuesWithMdAndTVD( const std::vector& propertyValues, + const std::vector& measuredDepths, + const std::vector& tvdMSL, + double rkbDiff, + RiaDefines::DepthUnitType depthUnit, + bool isExtractionCurve, + bool useLogarithmicScale, + const QString& propertyUnit ) { std::map> depths = { { RiaDefines::DepthTypeEnum::MEASURED_DEPTH, measuredDepths }, { RiaDefines::DepthTypeEnum::TRUE_VERTICAL_DEPTH, tvdMSL } }; - setValuesAndDepths( xValues, depths, rkbDiff, depthUnit, isExtractionCurve, xUnits ); + setPropertyValuesAndDepths( propertyValues, depths, rkbDiff, depthUnit, isExtractionCurve, useLogarithmicScale, propertyUnit ); } //-------------------------------------------------------------------------------------------------- @@ -214,15 +219,15 @@ QString RimWellLogCurve::wellLogCurveIconName() //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -void RimWellLogCurve::setOverrideCurveData( const std::vector& xValues, +void RimWellLogCurve::setOverrideCurveData( const std::vector& propertyValues, const std::vector& depthValues, const RiaCurveDataTools::CurveIntervals& curveIntervals ) { - auto minmax_it = std::minmax_element( xValues.begin(), xValues.end() ); - this->setOverrideCurveDataXRange( *( minmax_it.first ), *( minmax_it.second ) ); + auto minmax_it = std::minmax_element( propertyValues.begin(), propertyValues.end() ); + this->setOverrideCurveDataPropertyValueRange( *( minmax_it.first ), *( minmax_it.second ) ); if ( m_plotCurve ) { - m_plotCurve->setSamplesValues( xValues, depthValues ); + m_plotCurve->setSamplesValues( propertyValues, depthValues ); m_plotCurve->setLineSegmentStartStopIndices( curveIntervals ); } } @@ -247,7 +252,7 @@ void RimWellLogCurve::updateZoomInParentPlot() if ( wellLogTrack ) { - wellLogTrack->setAutoScaleXIfNecessary(); + wellLogTrack->setAutoScalePropertyValuesIfNecessary(); RimDepthTrackPlot* wellLogPlot; wellLogTrack->firstAncestorOrThisOfType( wellLogPlot ); @@ -299,24 +304,25 @@ void RimWellLogCurve::updateLegendsInPlot() //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -void RimWellLogCurve::setOverrideCurveDataXRange( double minimumValue, double maximumValue ) +void RimWellLogCurve::setOverrideCurveDataPropertyValueRange( double minimumValue, double maximumValue ) { - m_curveDataXRange = std::make_pair( minimumValue, maximumValue ); + m_curveDataPropertyValueRange = std::make_pair( minimumValue, maximumValue ); } //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -void RimWellLogCurve::calculateCurveDataXRange() +void RimWellLogCurve::calculateCurveDataPropertyValueRange() { // Invalidate range first - m_curveDataXRange = std::make_pair( std::numeric_limits::infinity(), -std::numeric_limits::infinity() ); - for ( double xValue : m_curveData->xValues() ) + m_curveDataPropertyValueRange = + std::make_pair( std::numeric_limits::infinity(), -std::numeric_limits::infinity() ); + for ( double xValue : m_curveData->propertyValues() ) { if ( RiaCurveDataTools::isValidValue( xValue, false ) ) { - m_curveDataXRange.first = std::min( m_curveDataXRange.first, xValue ); - m_curveDataXRange.second = std::max( m_curveDataXRange.second, xValue ); + m_curveDataPropertyValueRange.first = std::min( m_curveDataPropertyValueRange.first, xValue ); + m_curveDataPropertyValueRange.second = std::max( m_curveDataPropertyValueRange.second, xValue ); } } } diff --git a/ApplicationLibCode/ProjectDataModel/WellLog/RimWellLogCurve.h b/ApplicationLibCode/ProjectDataModel/WellLog/RimWellLogCurve.h index 578a4641a3..e4398f3c80 100644 --- a/ApplicationLibCode/ProjectDataModel/WellLog/RimWellLogCurve.h +++ b/ApplicationLibCode/ProjectDataModel/WellLog/RimWellLogCurve.h @@ -42,29 +42,34 @@ public: void setDepthUnit( RiaDefines::DepthUnitType depthUnit ); - bool xValueRangeInData( double* minimumValue, double* maximumValue ) const; - bool yValueRangeInData( double* minimumValue, double* maximumValue ) const; + bool propertyValueRangeInData( double* minimumValue, double* maximumValue ) const; + bool depthValueRangeInData( double* minimumValue, double* maximumValue ) const; - void setValuesAndDepths( const std::vector& xValues, - const std::vector& depths, - RiaDefines::DepthTypeEnum depthType, - double rkbDiff, - RiaDefines::DepthUnitType depthUnit, - bool isExtractionCurve, - const QString& xUnits = RiaWellLogUnitTools::noUnitString() ); - void setValuesWithMdAndTVD( const std::vector& xValues, - const std::vector& measuredDepths, - const std::vector& tvDepths, - double rkbDiff, - RiaDefines::DepthUnitType depthUnit, - bool isExtractionCurve, - const QString& xUnits = RiaWellLogUnitTools::noUnitString() ); - void setValuesAndDepths( const std::vector& xValues, - const std::map>& depths, - double rkbDiff, - RiaDefines::DepthUnitType depthUnit, - bool isExtractionCurve, - const QString& xUnits = RiaWellLogUnitTools::noUnitString() ); + void setPropertyValuesAndDepths( const std::vector& propertyValues, + const std::vector& depths, + RiaDefines::DepthTypeEnum depthType, + double rkbDiff, + RiaDefines::DepthUnitType depthUnit, + bool isExtractionCurve, + bool useLogarithmicScale, + const QString& propertyUnit = RiaWellLogUnitTools::noUnitString() ); + + void setPropertyValuesWithMdAndTVD( const std::vector& propertyValues, + const std::vector& measuredDepths, + const std::vector& tvDepths, + double rkbDiff, + RiaDefines::DepthUnitType depthUnit, + bool isExtractionCurve, + bool useLogarithmicScale, + const QString& propertyUnit = RiaWellLogUnitTools::noUnitString() ); + + void setPropertyValuesAndDepths( const std::vector& propertyValues, + const std::map>& depths, + double rkbDiff, + RiaDefines::DepthUnitType depthUnit, + bool isExtractionCurve, + bool useLogarithmicScale, + const QString& propertyUnit = RiaWellLogUnitTools::noUnitString() ); const RigWellLogCurveData* curveData() const; @@ -78,7 +83,7 @@ public: static QString wellLogCurveIconName(); - void setOverrideCurveData( const std::vector& xValues, + void setOverrideCurveData( const std::vector& propertyValues, const std::vector& depthValues, const RiaCurveDataTools::CurveIntervals& curveIntervals ); @@ -87,11 +92,11 @@ public: protected: void updateZoomInParentPlot() override; void updateLegendsInPlot() override; - void setOverrideCurveDataXRange( double minimumValue, double maximumValue ); - void calculateCurveDataXRange(); + void setOverrideCurveDataPropertyValueRange( double minimumValue, double maximumValue ); + void calculateCurveDataPropertyValueRange(); void fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue ) override; private: cvf::ref m_curveData; - std::pair m_curveDataXRange; + std::pair m_curveDataPropertyValueRange; }; diff --git a/ApplicationLibCode/ProjectDataModel/WellLog/RimWellLogExtractionCurve.cpp b/ApplicationLibCode/ProjectDataModel/WellLog/RimWellLogExtractionCurve.cpp index 91fe5fdb6c..0fcd109ffd 100644 --- a/ApplicationLibCode/ProjectDataModel/WellLog/RimWellLogExtractionCurve.cpp +++ b/ApplicationLibCode/ProjectDataModel/WellLog/RimWellLogExtractionCurve.cpp @@ -357,24 +357,24 @@ void RimWellLogExtractionCurve::onLoadDataAndUpdate( bool updateParentPlot ) isUsingPseudoLength = false; } - bool isLogCurve = false; + bool useLogarithmicScale = false; RimWellLogTrack* track = nullptr; firstAncestorOfType( track ); if ( track ) { - isLogCurve = track->isLogarithmicScale(); + useLogarithmicScale = track->isLogarithmicScale(); } - std::vector xPlotValues = curveData()->xPlotValues(); - std::vector depthPlotValues = curveData()->depthPlotValues( depthType, displayUnit ); + std::vector xPlotValues = curveData()->propertyValuesByIntervals(); + std::vector depthPlotValues = curveData()->depthValuesByIntervals( depthType, displayUnit ); CAF_ASSERT( xPlotValues.size() == depthPlotValues.size() ); if ( wellLogPlot->depthOrientation() == RimDepthTrackPlot::DepthOrientation::HORIZONTAL ) - m_plotCurve->setSamplesFromXValuesAndYValues( depthPlotValues, xPlotValues, isLogCurve ); + m_plotCurve->setSamplesFromXValuesAndYValues( depthPlotValues, xPlotValues, useLogarithmicScale ); else - m_plotCurve->setSamplesFromXValuesAndYValues( xPlotValues, depthPlotValues, isLogCurve ); + m_plotCurve->setSamplesFromXValuesAndYValues( xPlotValues, depthPlotValues, useLogarithmicScale ); m_plotCurve->setLineSegmentStartStopIndices( curveData()->polylineStartStopIndices() ); @@ -539,25 +539,36 @@ void RimWellLogExtractionCurve::extractData( bool* isUsingPseudoLength, if ( !values.empty() && !measuredDepthValues.empty() ) { + bool useLogarithmicScale = false; + + RimWellLogTrack* track = nullptr; + firstAncestorOfType( track ); + if ( track ) + { + useLogarithmicScale = track->isLogarithmicScale(); + } + if ( tvDepthValues.empty() ) { - this->setValuesAndDepths( values, - measuredDepthValues, - RiaDefines::DepthTypeEnum::MEASURED_DEPTH, - 0.0, - depthUnit, - !performDataSmoothing, - xUnits ); + this->setPropertyValuesAndDepths( values, + measuredDepthValues, + RiaDefines::DepthTypeEnum::MEASURED_DEPTH, + 0.0, + depthUnit, + !performDataSmoothing, + useLogarithmicScale, + xUnits ); } else { - this->setValuesWithMdAndTVD( values, - measuredDepthValues, - tvDepthValues, - rkbDiff, - depthUnit, - !performDataSmoothing, - xUnits ); + this->setPropertyValuesWithMdAndTVD( values, + measuredDepthValues, + tvDepthValues, + rkbDiff, + depthUnit, + !performDataSmoothing, + useLogarithmicScale, + xUnits ); } } } diff --git a/ApplicationLibCode/ProjectDataModel/WellLog/RimWellLogFileCurve.cpp b/ApplicationLibCode/ProjectDataModel/WellLog/RimWellLogFileCurve.cpp index 751eba2695..80cc39f649 100644 --- a/ApplicationLibCode/ProjectDataModel/WellLog/RimWellLogFileCurve.cpp +++ b/ApplicationLibCode/ProjectDataModel/WellLog/RimWellLogFileCurve.cpp @@ -150,7 +150,15 @@ void RimWellLogFileCurve::onLoadDataAndUpdate( bool updateParentPlot ) validDepths.insert( std::make_pair( RiaDefines::DepthTypeEnum::TRUE_VERTICAL_DEPTH_RKB, tvdRkbValues ) ); } - this->setValuesAndDepths( values, validDepths, rkbDiff, wellLogFile->depthUnit(), false ); + bool useLogarithmicScale = false; + RimWellLogTrack* track = nullptr; + firstAncestorOfType( track ); + if ( track ) + { + useLogarithmicScale = track->isLogarithmicScale(); + } + + this->setPropertyValuesAndDepths( values, validDepths, rkbDiff, wellLogFile->depthUnit(), false, useLogarithmicScale ); QString errMsg; if ( wellLogPlot && !this->curveData()->availableDepthTypes().count( wellLogPlot->depthType() ) ) @@ -188,8 +196,8 @@ void RimWellLogFileCurve::onLoadDataAndUpdate( bool updateParentPlot ) depthType = wellLogPlot->depthType(); } - m_plotCurve->setSamplesValues( this->curveData()->xPlotValues(), - this->curveData()->depthPlotValues( depthType, displayUnit ) ); + m_plotCurve->setSamplesValues( this->curveData()->propertyValuesByIntervals(), + this->curveData()->depthValuesByIntervals( depthType, displayUnit ) ); m_plotCurve->setLineSegmentStartStopIndices( this->curveData()->polylineStartStopIndices() ); if ( updateParentPlot ) diff --git a/ApplicationLibCode/ProjectDataModel/WellLog/RimWellLogRftCurve.cpp b/ApplicationLibCode/ProjectDataModel/WellLog/RimWellLogRftCurve.cpp index a51268f849..b295dbf6c4 100644 --- a/ApplicationLibCode/ProjectDataModel/WellLog/RimWellLogRftCurve.cpp +++ b/ApplicationLibCode/ProjectDataModel/WellLog/RimWellLogRftCurve.cpp @@ -451,12 +451,14 @@ void RimWellLogRftCurve::onLoadDataAndUpdate( bool updateParentPlot ) rkbDiff = wellPath->wellPathGeometry()->rkbDiff(); } - this->setValuesWithMdAndTVD( values, - measuredDepthVector, - tvDepthVector, - rkbDiff, - RiaDefines::fromEclipseUnit( unitSystem ), - false ); + bool useLogarithmicScale = false; + this->setPropertyValuesWithMdAndTVD( values, + measuredDepthVector, + tvDepthVector, + rkbDiff, + RiaDefines::fromEclipseUnit( unitSystem ), + false, + useLogarithmicScale ); RiaDefines::DepthUnitType displayUnit = RiaDefines::DepthUnitType::UNIT_METER; if ( wellLogPlot ) @@ -468,21 +470,22 @@ void RimWellLogRftCurve::onLoadDataAndUpdate( bool updateParentPlot ) { m_plotCurve->setPerPointLabels( perPointLabels ); - auto xValues = this->curveData()->xPlotValues(); - auto yValues = this->curveData()->depthPlotValues( RiaDefines::DepthTypeEnum::MEASURED_DEPTH, displayUnit ); - bool isLogCurve = false; + auto xValues = this->curveData()->propertyValuesByIntervals(); + auto yValues = + this->curveData()->depthValuesByIntervals( RiaDefines::DepthTypeEnum::MEASURED_DEPTH, displayUnit ); + bool useLogarithmicScale = false; if ( !errors.empty() ) { this->setSamplesFromXYErrorValues( xValues, yValues, errors, - isLogCurve, + useLogarithmicScale, RiaCurveDataTools::ErrorAxis::ERROR_ALONG_X_AXIS ); } else { - m_plotCurve->setSamplesFromXValuesAndYValues( xValues, yValues, isLogCurve ); + m_plotCurve->setSamplesFromXValuesAndYValues( xValues, yValues, useLogarithmicScale ); } RimWellLogTrack* wellLogTrack; @@ -513,22 +516,22 @@ void RimWellLogRftCurve::onLoadDataAndUpdate( bool updateParentPlot ) { m_plotCurve->setPerPointLabels( perPointLabels ); - auto xValues = this->curveData()->xPlotValues(); + auto xValues = this->curveData()->propertyValuesByIntervals(); auto yValues = - this->curveData()->depthPlotValues( RiaDefines::DepthTypeEnum::TRUE_VERTICAL_DEPTH, displayUnit ); - bool isLogCurve = false; + this->curveData()->depthValuesByIntervals( RiaDefines::DepthTypeEnum::TRUE_VERTICAL_DEPTH, displayUnit ); + bool useLogarithmicScale = false; if ( !errors.empty() ) { this->setSamplesFromXYErrorValues( xValues, yValues, errors, - isLogCurve, + useLogarithmicScale, RiaCurveDataTools::ErrorAxis::ERROR_ALONG_X_AXIS ); } else { - m_plotCurve->setSamplesFromXValuesAndYValues( xValues, yValues, isLogCurve ); + m_plotCurve->setSamplesFromXValuesAndYValues( xValues, yValues, useLogarithmicScale ); } } diff --git a/ApplicationLibCode/ProjectDataModel/WellLog/RimWellLogTrack.cpp b/ApplicationLibCode/ProjectDataModel/WellLog/RimWellLogTrack.cpp index 1289dc303b..893b4bd838 100644 --- a/ApplicationLibCode/ProjectDataModel/WellLog/RimWellLogTrack.cpp +++ b/ApplicationLibCode/ProjectDataModel/WellLog/RimWellLogTrack.cpp @@ -119,9 +119,9 @@ void AppEnum::setUp() template <> void AppEnum::setUp() { - addItem( RimWellLogTrack::CASE, "CASE", "Case" ); - addItem( RimWellLogTrack::WELL_PICK_FILTER, "WELL_PICK_FILTER", "Well Picks for Well Path" ); - setDefault( RimWellLogTrack::CASE ); + addItem( RimWellLogTrack::FormationSource::CASE, "CASE", "Case" ); + addItem( RimWellLogTrack::FormationSource::WELL_PICK_FILTER, "WELL_PICK_FILTER", "Well Picks for Well Path" ); + setDefault( RimWellLogTrack::FormationSource::CASE ); } template <> @@ -170,8 +170,8 @@ void AppEnum::setUp() /// //-------------------------------------------------------------------------------------------------- RimWellLogTrack::RimWellLogTrack() - : m_availableXRangeMin( RI_LOGPLOTTRACK_MINX_DEFAULT ) - , m_availableXRangeMax( RI_LOGPLOTTRACK_MAXX_DEFAULT ) + : m_availablePropertyValueRangeMin( RI_LOGPLOTTRACK_MINX_DEFAULT ) + , m_availablePropertyValueRangeMax( RI_LOGPLOTTRACK_MAXX_DEFAULT ) , m_availableDepthRangeMin( RI_LOGPLOTTRACK_MINX_DEFAULT ) , m_availableDepthRangeMax( RI_LOGPLOTTRACK_MAXX_DEFAULT ) @@ -187,8 +187,8 @@ RimWellLogTrack::RimWellLogTrack() auto reorderability = caf::PdmFieldReorderCapability::addToField( &m_curves ); reorderability->orderChanged.connect( this, &RimWellLogTrack::curveDataChanged ); - CAF_PDM_InitField( &m_visibleXRangeMin, "VisibleXRangeMin", RI_LOGPLOTTRACK_MINX_DEFAULT, "Min" ); - CAF_PDM_InitField( &m_visibleXRangeMax, "VisibleXRangeMax", RI_LOGPLOTTRACK_MAXX_DEFAULT, "Max" ); + CAF_PDM_InitField( &m_visiblePropertyValueRangeMin, "VisibleXRangeMin", RI_LOGPLOTTRACK_MINX_DEFAULT, "Min" ); + CAF_PDM_InitField( &m_visiblePropertyValueRangeMax, "VisibleXRangeMax", RI_LOGPLOTTRACK_MAXX_DEFAULT, "Max" ); CAF_PDM_InitField( &m_visibleDepthRangeMin, "VisibleYRangeMin", RI_LOGPLOTTRACK_MINX_DEFAULT, "Min" ); CAF_PDM_InitField( &m_visibleDepthRangeMax, "VisibleYRangeMax", RI_LOGPLOTTRACK_MAXX_DEFAULT, "Max" ); m_visibleDepthRangeMin.uiCapability()->setUiHidden( true ); @@ -196,12 +196,12 @@ RimWellLogTrack::RimWellLogTrack() m_visibleDepthRangeMax.uiCapability()->setUiHidden( true ); m_visibleDepthRangeMax.xmlCapability()->disableIO(); - CAF_PDM_InitField( &m_isAutoScaleXEnabled, "AutoScaleX", true, "Auto Scale" ); - m_isAutoScaleXEnabled.uiCapability()->setUiHidden( true ); + CAF_PDM_InitField( &m_isAutoScalePropertyValuesEnabled, "AutoScaleX", true, "Auto Scale" ); + m_isAutoScalePropertyValuesEnabled.uiCapability()->setUiHidden( true ); CAF_PDM_InitField( &m_isLogarithmicScaleEnabled, "LogarithmicScaleX", false, "Logarithmic Scale" ); - CAF_PDM_InitFieldNoDefault( &m_xAxisGridVisibility, "ShowXGridLines", "Show Grid Lines" ); + CAF_PDM_InitFieldNoDefault( &m_propertyValueAxisGridVisibility, "ShowXGridLines", "Show Grid Lines" ); CAF_PDM_InitField( &m_explicitTickIntervals, "ExplicitTickIntervals", false, "Manually Set Tick Intervals" ); CAF_PDM_InitField( &m_minAndMaxTicksOnly, "MinAndMaxTicksOnly", false, "Show Ticks at Min and Max" ); @@ -357,7 +357,7 @@ void RimWellLogTrack::detachAllPlotItems() //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -void RimWellLogTrack::calculateXZoomRange() +void RimWellLogTrack::calculatePropertyValueZoomRange() { updateStackedCurveData(); @@ -373,7 +373,7 @@ void RimWellLogTrack::calculateXZoomRange() if ( curve->isCurveVisible() ) { visibleCurves++; - if ( curve->xValueRangeInData( &minCurveValue, &maxCurveValue ) ) + if ( curve->propertyValueRangeInData( &minCurveValue, &maxCurveValue ) ) { if ( minCurveValue < minValue ) { @@ -399,14 +399,14 @@ void RimWellLogTrack::calculateXZoomRange() std::tie( minValue, maxValue ) = adjustXRange( minValue, maxValue, m_minorTickInterval() ); } - m_availableXRangeMin = minValue; - m_availableXRangeMax = maxValue; + m_availablePropertyValueRangeMin = minValue; + m_availablePropertyValueRangeMax = maxValue; } //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -void RimWellLogTrack::calculateYZoomRange() +void RimWellLogTrack::calculateDepthZoomRange() { double minDepth = HUGE_VAL; double maxDepth = -HUGE_VAL; @@ -416,7 +416,7 @@ void RimWellLogTrack::calculateYZoomRange() double minCurveDepth = HUGE_VAL; double maxCurveDepth = -HUGE_VAL; - if ( curve->isCurveVisible() && curve->yValueRangeInData( &minCurveDepth, &maxCurveDepth ) ) + if ( curve->isCurveVisible() && curve->depthValueRangeInData( &minCurveDepth, &maxCurveDepth ) ) { if ( minCurveDepth < minDepth ) { @@ -458,28 +458,28 @@ void RimWellLogTrack::calculateYZoomRange() //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -void RimWellLogTrack::updateXZoom() +void RimWellLogTrack::updatePropertyValueZoom() { if ( !m_plotWidget ) return; - calculateXZoomRange(); + calculatePropertyValueZoomRange(); - if ( m_isAutoScaleXEnabled ) + if ( m_isAutoScalePropertyValuesEnabled ) { - m_visibleXRangeMin = m_availableXRangeMin; - m_visibleXRangeMax = m_availableXRangeMax; + m_visiblePropertyValueRangeMin = m_availablePropertyValueRangeMin; + m_visiblePropertyValueRangeMax = m_availablePropertyValueRangeMax; if ( !visibleStackedCurves().empty() && !m_isLogarithmicScaleEnabled ) { // Try to ensure we include the base line whether the values are negative or positive. - m_visibleXRangeMin = std::min( m_visibleXRangeMin(), 0.0 ); - m_visibleXRangeMax = std::max( m_visibleXRangeMax(), 0.0 ); + m_visiblePropertyValueRangeMin = std::min( m_visiblePropertyValueRangeMin(), 0.0 ); + m_visiblePropertyValueRangeMax = std::max( m_visiblePropertyValueRangeMax(), 0.0 ); } - computeAndSetXRangeMinForLogarithmicScale(); + computeAndSetPropertyValueRangeMinForLogarithmicScale(); updateEditors(); } - updateXAxisAndGridTickIntervals(); + updatePropertyValueAxisAndGridTickIntervals(); // Attribute range. Fixed range where well components are positioned [-1, 1]. // Set an extended range here to allow for some label space. @@ -501,7 +501,7 @@ void RimWellLogTrack::updateXZoom() //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -void RimWellLogTrack::updateYZoom() +void RimWellLogTrack::updateDepthZoom() { if ( !m_plotWidget ) return; @@ -549,32 +549,32 @@ void RimWellLogTrack::fieldChangedByUi( const caf::PdmFieldHandle* changedField, m_minorTickInterval.uiCapability()->setUiHidden( !m_explicitTickIntervals() ); if ( !m_explicitTickIntervals() ) { - updateXAxisAndGridTickIntervals(); + updatePropertyValueAxisAndGridTickIntervals(); } } - else if ( changedField == &m_xAxisGridVisibility || changedField == &m_majorTickInterval || + else if ( changedField == &m_propertyValueAxisGridVisibility || changedField == &m_majorTickInterval || changedField == &m_minorTickInterval || changedField == &m_minAndMaxTicksOnly ) { - updateXAxisAndGridTickIntervals(); + updatePropertyValueAxisAndGridTickIntervals(); } - else if ( changedField == &m_visibleXRangeMin || changedField == &m_visibleXRangeMax ) + else if ( changedField == &m_visiblePropertyValueRangeMin || changedField == &m_visiblePropertyValueRangeMax ) { bool emptyRange = isEmptyVisibleXRange(); m_explicitTickIntervals.uiCapability()->setUiReadOnly( emptyRange ); - m_xAxisGridVisibility.uiCapability()->setUiReadOnly( emptyRange ); + m_propertyValueAxisGridVisibility.uiCapability()->setUiReadOnly( emptyRange ); - m_isAutoScaleXEnabled = false; + m_isAutoScalePropertyValuesEnabled = false; - updateXZoom(); + updatePropertyValueZoom(); m_plotWidget->scheduleReplot(); updateEditors(); } - else if ( changedField == &m_isAutoScaleXEnabled ) + else if ( changedField == &m_isAutoScalePropertyValuesEnabled ) { - if ( m_isAutoScaleXEnabled() ) + if ( m_isAutoScalePropertyValuesEnabled() ) { - updateXZoom(); + updatePropertyValueZoom(); m_plotWidget->scheduleReplot(); } } @@ -587,14 +587,14 @@ void RimWellLogTrack::fieldChangedByUi( const caf::PdmFieldHandle* changedField, } m_explicitTickIntervals.uiCapability()->setUiHidden( m_isLogarithmicScaleEnabled() ); - updateXZoom(); + updatePropertyValueZoom(); loadDataAndUpdate(); } else if ( changedField == &m_regionAnnotationType || changedField == &m_regionAnnotationDisplay || changedField == &m_formationSource || changedField == &m_colorShadingTransparency || changedField == &m_colorShadingLegend ) { - if ( changedField == &m_formationSource && m_formationSource == WELL_PICK_FILTER ) + if ( changedField == &m_formationSource && m_formationSource == FormationSource::WELL_PICK_FILTER ) { std::vector wellPaths; RimTools::wellPathWithFormations( &wellPaths ); @@ -749,15 +749,15 @@ void RimWellLogTrack::curveStackingChanged( const caf::SignalEmitter* emitter, b { updateStackedCurveData(); - m_isAutoScaleXEnabled = true; - updateXZoom(); + m_isAutoScalePropertyValuesEnabled = true; + updatePropertyValueZoom(); m_plotWidget->scheduleReplot(); } //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -void RimWellLogTrack::updateXAxisAndGridTickIntervals() +void RimWellLogTrack::updatePropertyValueAxisAndGridTickIntervals() { if ( !m_plotWidget ) return; @@ -788,16 +788,16 @@ void RimWellLogTrack::updateXAxisAndGridTickIntervals() return std::ceil( value * factor ) / factor; }; - auto div = QwtScaleDiv( m_visibleXRangeMin(), m_visibleXRangeMax() ); + auto div = QwtScaleDiv( m_visiblePropertyValueRangeMin(), m_visiblePropertyValueRangeMax() ); QList majorTicks; - auto min = roundToDigits( m_visibleXRangeMin(), 2, false ); - auto max = roundToDigits( m_visibleXRangeMax(), 2, true ); + auto min = roundToDigits( m_visiblePropertyValueRangeMin(), 2, false ); + auto max = roundToDigits( m_visiblePropertyValueRangeMax(), 2, true ); if ( min == max ) { - min = roundToDigits( m_visibleXRangeMin(), 3, false ); - max = roundToDigits( m_visibleXRangeMax(), 3, true ); + min = roundToDigits( m_visiblePropertyValueRangeMin(), 3, false ); + max = roundToDigits( m_visiblePropertyValueRangeMax(), 3, true ); } majorTicks.push_back( min ); @@ -812,20 +812,20 @@ void RimWellLogTrack::updateXAxisAndGridTickIntervals() m_plotWidget->setMajorAndMinorTickIntervals( getValueAxis(), m_majorTickInterval(), m_minorTickInterval(), - m_visibleXRangeMin(), - m_visibleXRangeMax() ); + m_visiblePropertyValueRangeMin(), + m_visiblePropertyValueRangeMax() ); } else { int majorTickIntervals = 5; int minorTickIntervals = 10; m_plotWidget->setAutoTickIntervalCounts( getValueAxis(), majorTickIntervals, minorTickIntervals ); - m_plotWidget->setAxisRange( getValueAxis(), m_visibleXRangeMin, m_visibleXRangeMax ); + m_plotWidget->setAxisRange( getValueAxis(), m_visiblePropertyValueRangeMin, m_visiblePropertyValueRangeMax ); } m_plotWidget->enableGridLines( getValueAxis(), - m_xAxisGridVisibility() & RimWellLogPlot::AXIS_GRID_MAJOR, - m_xAxisGridVisibility() & RimWellLogPlot::AXIS_GRID_MINOR ); + m_propertyValueAxisGridVisibility() & RimWellLogPlot::AXIS_GRID_MAJOR, + m_propertyValueAxisGridVisibility() & RimWellLogPlot::AXIS_GRID_MINOR ); } RimDepthTrackPlot* wellLogPlot = nullptr; @@ -887,10 +887,10 @@ QString RimWellLogTrack::asciiDataForPlotExport() const if ( curveNames.size() == 1 ) { - curveDepths = curveData->depthPlotValues( depthType, depthUnit ); + curveDepths = curveData->depthValuesByIntervals( depthType, depthUnit ); } - std::vector xPlotValues = curveData->xPlotValues(); + std::vector xPlotValues = curveData->propertyValuesByIntervals(); if ( xPlotValues.empty() ) { curveNames.pop_back(); @@ -907,7 +907,7 @@ QString RimWellLogTrack::asciiDataForPlotExport() const foundNonMatchingDepths = true; } - std::vector depths = curveData->depthPlotValues( depthType, depthUnit ); + std::vector depths = curveData->depthValuesByIntervals( depthType, depthUnit ); curveMerger.addCurveData( depths, xPlotValues ); curvesPlotXValues.push_back( xPlotValues ); @@ -1011,10 +1011,10 @@ void RimWellLogTrack::updateZoomFromParentPlot() auto [xIntervalMin, xIntervalMax] = m_plotWidget->axisRange( getValueAxis() ); auto [depthIntervalMin, depthIntervalMax] = m_plotWidget->axisRange( getDepthAxis() ); - m_visibleXRangeMin = xIntervalMin; - m_visibleXRangeMax = xIntervalMax; - m_visibleDepthRangeMin = depthIntervalMin; - m_visibleDepthRangeMax = depthIntervalMax; + m_visiblePropertyValueRangeMin = xIntervalMin; + m_visiblePropertyValueRangeMax = xIntervalMax; + m_visibleDepthRangeMin = depthIntervalMin; + m_visibleDepthRangeMax = depthIntervalMax; } //-------------------------------------------------------------------------------------------------- @@ -1037,7 +1037,7 @@ void RimWellLogTrack::onAxisSelected( int axis, bool toggle ) //-------------------------------------------------------------------------------------------------- void RimWellLogTrack::updateAxes() { - updateXZoom(); + updatePropertyValueZoom(); } //-------------------------------------------------------------------------------------------------- @@ -1172,11 +1172,11 @@ void RimWellLogTrack::deleteAllCurves() //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -void RimWellLogTrack::availableXAxisRange( double* minX, double* maxX ) +void RimWellLogTrack::availablePropertyValueRange( double* minX, double* maxX ) { - calculateXZoomRange(); - *minX = m_availableXRangeMin; - *maxX = m_availableXRangeMax; + calculatePropertyValueZoomRange(); + *minX = m_availablePropertyValueRangeMin; + *maxX = m_availablePropertyValueRangeMax; } //-------------------------------------------------------------------------------------------------- @@ -1184,7 +1184,7 @@ void RimWellLogTrack::availableXAxisRange( double* minX, double* maxX ) //-------------------------------------------------------------------------------------------------- void RimWellLogTrack::availableDepthRange( double* minimumDepth, double* maximumDepth ) { - calculateYZoomRange(); + calculateDepthZoomRange(); *minimumDepth = m_availableDepthRangeMin; *maximumDepth = m_availableDepthRangeMax; } @@ -1192,11 +1192,11 @@ void RimWellLogTrack::availableDepthRange( double* minimumDepth, double* maximum //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -void RimWellLogTrack::visibleXAxisRange( double* minX, double* maxX ) +void RimWellLogTrack::visiblePropertyValueRange( double* minX, double* maxX ) { CAF_ASSERT( minX && maxX ); - *minX = m_visibleXRangeMin; - *maxX = m_visibleXRangeMax; + *minX = m_visiblePropertyValueRangeMin; + *maxX = m_visiblePropertyValueRangeMax; } //-------------------------------------------------------------------------------------------------- @@ -1214,8 +1214,8 @@ void RimWellLogTrack::visibleDepthRange( double* minDepth, double* maxDepth ) //-------------------------------------------------------------------------------------------------- bool RimWellLogTrack::isEmptyVisibleXRange() const { - return std::abs( m_visibleXRangeMax() - m_visibleXRangeMin ) < - 1.0e-6 * std::max( 1.0, std::max( m_visibleXRangeMax(), m_visibleXRangeMin() ) ); + return std::abs( m_visiblePropertyValueRangeMax() - m_visiblePropertyValueRangeMin ) < + 1.0e-6 * std::max( 1.0, std::max( m_visiblePropertyValueRangeMax(), m_visiblePropertyValueRangeMin() ) ); } //-------------------------------------------------------------------------------------------------- @@ -1228,7 +1228,7 @@ void RimWellLogTrack::onLoadDataAndUpdate() if ( wellLogPlot && m_plotWidget ) { - m_plotWidget->setAxisTitleText( getValueAxis(), m_xAxisTitle ); + m_plotWidget->setAxisTitleText( getValueAxis(), m_propertyValueAxisTitle ); m_plotWidget->setAxisTitleText( getDepthAxis(), wellLogPlot->depthAxisTitle() ); } @@ -1259,16 +1259,16 @@ void RimWellLogTrack::onLoadDataAndUpdate() this->updateAxisScaleEngine(); this->updateRegionAnnotationsOnPlot(); - this->updateXZoom(); + this->updatePropertyValueZoom(); } - this->updateXAxisAndGridTickIntervals(); + this->updatePropertyValueAxisAndGridTickIntervals(); m_majorTickInterval.uiCapability()->setUiHidden( !m_explicitTickIntervals() ); m_minorTickInterval.uiCapability()->setUiHidden( !m_explicitTickIntervals() ); bool emptyRange = isEmptyVisibleXRange(); m_explicitTickIntervals.uiCapability()->setUiReadOnly( emptyRange ); - m_xAxisGridVisibility.uiCapability()->setUiReadOnly( emptyRange ); + m_propertyValueAxisGridVisibility.uiCapability()->setUiReadOnly( emptyRange ); updateLegend(); } @@ -1327,15 +1327,15 @@ void RimWellLogTrack::setAndUpdateSimWellFormationNamesData( RimCase* rimCase, c //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -void RimWellLogTrack::setAutoScaleXEnabled( bool enabled ) +void RimWellLogTrack::setAutoScalePropertyValuesEnabled( bool enabled ) { - m_isAutoScaleXEnabled = enabled; + m_isAutoScalePropertyValuesEnabled = enabled; } //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -void RimWellLogTrack::setAutoScaleYEnabled( bool enabled ) +void RimWellLogTrack::setAutoScaleDepthValuesEnabled( bool enabled ) { if ( enabled ) { @@ -1347,41 +1347,42 @@ void RimWellLogTrack::setAutoScaleYEnabled( bool enabled ) //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -void RimWellLogTrack::setAutoScaleXIfNecessary() +void RimWellLogTrack::setAutoScalePropertyValuesIfNecessary() { // Avoid resetting if visible range has set to empty by user bool emptyRange = isEmptyVisibleXRange(); - if ( !m_isAutoScaleXEnabled && emptyRange ) return; + if ( !m_isAutoScalePropertyValuesEnabled && emptyRange ) return; const double eps = 1.0e-8; - calculateXZoomRange(); + calculatePropertyValueZoomRange(); - double maxRange = std::max( m_visibleXRangeMax - m_visibleXRangeMin, m_availableXRangeMax - m_availableXRangeMin ); + double maxRange = std::max( m_visiblePropertyValueRangeMax - m_visiblePropertyValueRangeMin, + m_availablePropertyValueRangeMax - m_availablePropertyValueRangeMin ); - double maxLow = std::max( m_visibleXRangeMin(), m_availableXRangeMin ); - double minHigh = std::min( m_visibleXRangeMax(), m_availableXRangeMax ); + double maxLow = std::max( m_visiblePropertyValueRangeMin(), m_availablePropertyValueRangeMin ); + double minHigh = std::min( m_visiblePropertyValueRangeMax(), m_availablePropertyValueRangeMax ); double overlap = minHigh - maxLow; if ( maxRange < eps || overlap < eps * maxRange ) { - setAutoScaleXEnabled( true ); + setAutoScalePropertyValuesEnabled( true ); } - updateXZoom(); + updatePropertyValueZoom(); } //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -void RimWellLogTrack::setXAxisTitle( const QString& text ) +void RimWellLogTrack::setPropertyValueAxisTitle( const QString& text ) { - m_xAxisTitle = text; + m_propertyValueAxisTitle = text; } //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -QString RimWellLogTrack::yAxisTitle() const +QString RimWellLogTrack::depthAxisTitle() const { RimDepthTrackPlot* parent; this->firstAncestorOrThisOfType( parent ); @@ -1581,17 +1582,17 @@ void RimWellLogTrack::updateEditors() //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -void RimWellLogTrack::setVisibleXRange( double minValue, double maxValue ) +void RimWellLogTrack::setVisiblePropertyValueRange( double minValue, double maxValue ) { - this->setAutoScaleXEnabled( false ); - m_visibleXRangeMin = minValue; - m_visibleXRangeMax = maxValue; + this->setAutoScalePropertyValuesEnabled( false ); + m_visiblePropertyValueRangeMin = minValue; + m_visiblePropertyValueRangeMax = maxValue; } //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -void RimWellLogTrack::setVisibleYRange( double minValue, double maxValue ) +void RimWellLogTrack::setVisibleDepthRange( double minValue, double maxValue ) { m_visibleDepthRangeMin = minValue; m_visibleDepthRangeMax = maxValue; @@ -1602,8 +1603,8 @@ void RimWellLogTrack::setVisibleYRange( double minValue, double maxValue ) //-------------------------------------------------------------------------------------------------- void RimWellLogTrack::updateZoomInParentPlot() { - updateXZoom(); - updateYZoom(); + updatePropertyValueZoom(); + updateDepthZoom(); m_plotWidget->scheduleReplot(); } @@ -1628,9 +1629,9 @@ void RimWellLogTrack::setMinAndMaxTicksOnly( bool enable ) //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -void RimWellLogTrack::setXAxisGridVisibility( RimWellLogPlot::AxisGridVisibility gridLines ) +void RimWellLogTrack::setPropertyValueAxisGridVisibility( RimWellLogPlot::AxisGridVisibility gridLines ) { - m_xAxisGridVisibility = gridLines; + m_propertyValueAxisGridVisibility = gridLines; } //-------------------------------------------------------------------------------------------------- @@ -1799,8 +1800,8 @@ QImage RimWellLogTrack::snapshotWindowContent() //-------------------------------------------------------------------------------------------------- void RimWellLogTrack::zoomAll() { - setAutoScaleXEnabled( true ); - setAutoScaleYEnabled( true ); + setAutoScalePropertyValuesEnabled( true ); + setAutoScaleDepthValuesEnabled( true ); updateZoomInParentPlot(); } @@ -1852,10 +1853,10 @@ void RimWellLogTrack::defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering } else { - m_formationSource = CASE; + m_formationSource = FormationSource::CASE; } - if ( m_formationSource() == CASE ) + if ( m_formationSource() == FormationSource::CASE ) { annotationGroup->add( &m_formationCase ); @@ -1879,7 +1880,7 @@ void RimWellLogTrack::defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering m_formationBranchIndex ); } } - else if ( m_formationSource() == WELL_PICK_FILTER ) + else if ( m_formationSource() == FormationSource::WELL_PICK_FILTER ) { annotationGroup->add( &m_formationWellPathForSourceWellPath ); if ( m_formationWellPathForSourceWellPath() ) @@ -1922,9 +1923,9 @@ void RimWellLogTrack::initAfterRead() m_resultDefinition->setEclipseCase( dynamic_cast( eclipseCase ) ); } - if ( m_xAxisGridVisibility() == RimWellLogPlot::AXIS_GRID_MINOR ) + if ( m_propertyValueAxisGridVisibility() == RimWellLogPlot::AXIS_GRID_MINOR ) { - m_xAxisGridVisibility = RimWellLogPlot::AXIS_GRID_MAJOR_AND_MINOR; + m_propertyValueAxisGridVisibility = RimWellLogPlot::AXIS_GRID_MAJOR_AND_MINOR; } for ( auto curve : m_curves ) @@ -2115,9 +2116,9 @@ void RimWellLogTrack::connectCurveSignals( RimWellLogCurve* curve ) //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -void RimWellLogTrack::computeAndSetXRangeMinForLogarithmicScale() +void RimWellLogTrack::computeAndSetPropertyValueRangeMinForLogarithmicScale() { - if ( m_isAutoScaleXEnabled && m_isLogarithmicScaleEnabled ) + if ( m_isAutoScalePropertyValuesEnabled && m_isLogarithmicScaleEnabled ) { double pos = HUGE_VAL; double neg = -HUGE_VAL; @@ -2126,13 +2127,15 @@ void RimWellLogTrack::computeAndSetXRangeMinForLogarithmicScale() { if ( m_curves[cIdx]->isCurveVisible() && m_curves[cIdx]->curveData() ) { - RigStatisticsCalculator::posNegClosestToZero( m_curves[cIdx]->curveData()->xPlotValues(), pos, neg ); + RigStatisticsCalculator::posNegClosestToZero( m_curves[cIdx]->curveData()->propertyValuesByIntervals(), + pos, + neg ); } } if ( pos != HUGE_VAL ) { - m_visibleXRangeMin = pos; + m_visiblePropertyValueRangeMin = pos; } } } @@ -2145,7 +2148,7 @@ void RimWellLogTrack::setLogarithmicScale( bool enable ) m_isLogarithmicScaleEnabled = enable; updateAxisScaleEngine(); - computeAndSetXRangeMinForLogarithmicScale(); + computeAndSetPropertyValueRangeMinForLogarithmicScale(); } //-------------------------------------------------------------------------------------------------- @@ -2217,11 +2220,11 @@ void RimWellLogTrack::uiOrderingForRftPltFormations( caf::PdmUiOrdering& uiOrder formationGroup->add( &m_regionAnnotationType ); formationGroup->add( &m_regionAnnotationDisplay ); formationGroup->add( &m_formationSource ); - if ( m_formationSource == CASE ) + if ( m_formationSource == FormationSource::CASE ) { formationGroup->add( &m_formationCase ); } - if ( m_formationSource == WELL_PICK_FILTER ) + if ( m_formationSource == FormationSource::WELL_PICK_FILTER ) { if ( m_formationWellPathForSourceWellPath() && m_formationWellPathForSourceWellPath()->hasFormations() ) { @@ -2238,9 +2241,9 @@ void RimWellLogTrack::uiOrderingForXAxisSettings( caf::PdmUiOrdering& uiOrdering { caf::PdmUiGroup* gridGroup = uiOrdering.addNewGroup( "X Axis Settings" ); gridGroup->add( &m_isLogarithmicScaleEnabled ); - gridGroup->add( &m_visibleXRangeMin ); - gridGroup->add( &m_visibleXRangeMax ); - gridGroup->add( &m_xAxisGridVisibility ); + gridGroup->add( &m_visiblePropertyValueRangeMin ); + gridGroup->add( &m_visiblePropertyValueRangeMax ); + gridGroup->add( &m_propertyValueAxisGridVisibility ); gridGroup->add( &m_minAndMaxTicksOnly ); // TODO Revisit if these settings are required @@ -2490,7 +2493,7 @@ void RimWellLogTrack::updateStackedCurveData() for ( auto curve : stackedCurvesInGroup ) { auto interpolatedCurveValues = curve->curveData()->calculateResampledCurveData( depthType, allDepthValues ); - auto xValues = interpolatedCurveValues->xValues(); + auto xValues = interpolatedCurveValues->propertyValues(); for ( size_t i = 0; i < xValues.size(); ++i ) { if ( xValues[i] != HUGE_VAL ) @@ -2500,8 +2503,15 @@ void RimWellLogTrack::updateStackedCurveData() } RigWellLogCurveData tempCurveData; - tempCurveData.setValuesAndDepths( allStackedValues, allDepthValues, depthType, 0.0, displayUnit, false ); - auto plotDepthValues = tempCurveData.depthPlotValues( depthType, displayUnit ); + tempCurveData.setValuesAndDepths( allStackedValues, + allDepthValues, + depthType, + 0.0, + displayUnit, + false, + m_isLogarithmicScaleEnabled ); + + auto plotDepthValues = tempCurveData.depthValuesByIntervals( depthType, displayUnit ); auto polyLineStartStopIndices = tempCurveData.polylineStartStopIndices(); curve->setOverrideCurveData( allStackedValues, plotDepthValues, polyLineStartStopIndices ); @@ -2583,7 +2593,7 @@ void RimWellLogTrack::updateFormationNamesOnPlot() RiaDefines::DepthUnitType fromDepthUnit = plot->caseDepthUnit(); RiaDefines::DepthUnitType toDepthUnit = plot->depthUnit(); - if ( m_formationSource() == WELL_PICK_FILTER ) + if ( m_formationSource() == FormationSource::WELL_PICK_FILTER ) { if ( m_formationWellPathForSourceWellPath == nullptr ) return; @@ -2676,7 +2686,8 @@ void RimWellLogTrack::updateFormationNamesOnPlot() if ( geoMechWellLogExtractor ) { // Attach water and rock base formations - const std::pair xRange = std::make_pair( m_visibleXRangeMin(), m_visibleXRangeMax() ); + const std::pair xRange = + std::make_pair( m_visiblePropertyValueRangeMin(), m_visiblePropertyValueRangeMax() ); const caf::ColorTable waterAndRockColors = RiaColorTables::waterAndRockPaletteColors(); const std::vector> waterAndRockIntervals = @@ -2697,7 +2708,7 @@ void RimWellLogTrack::updateFormationNamesOnPlot() { Qt::SolidPattern, Qt::Dense6Pattern } ); } - if ( m_formationSource == CASE && m_plotWidget ) + if ( m_formationSource == FormationSource::CASE && m_plotWidget ) { if ( ( m_formationSimWellName == QString( "None" ) && m_formationWellPathForSourceCase == nullptr ) || m_formationCase == nullptr ) @@ -2724,7 +2735,8 @@ void RimWellLogTrack::updateFormationNamesOnPlot() &formationNamesToPlot, &yValues ); - const std::pair xRange = std::make_pair( m_visibleXRangeMin(), m_visibleXRangeMax() ); + const std::pair xRange = + std::make_pair( m_visiblePropertyValueRangeMin(), m_visiblePropertyValueRangeMax() ); std::vector> convertedYValues = RiaWellLogUnitTools::convertDepths( yValues, fromDepthUnit, toDepthUnit ); @@ -2785,9 +2797,10 @@ void RimWellLogTrack::updateResultPropertyNamesOnPlot() CurveSamplingPointData curveData = RimWellLogTrack::curveSamplingPointData( eclWellLogExtractor, resultAccessor.p() ); // Attach water and rock base formations - const std::pair xRange = std::make_pair( m_visibleXRangeMin(), m_visibleXRangeMax() ); + const std::pair xRange = + std::make_pair( m_visiblePropertyValueRangeMin(), m_visiblePropertyValueRangeMax() ); - if ( m_formationSource == CASE ) + if ( m_formationSource == FormationSource::CASE ) { if ( ( m_formationSimWellName == QString( "None" ) && m_formationWellPathForSourceCase == nullptr ) || m_formationCase == nullptr ) @@ -2896,7 +2909,8 @@ void RimWellLogTrack::updateCurveDataRegionsOnPlot() RiaExtractionTools::findOrCreateWellLogExtractor( wellPath, dynamic_cast( geoMechCase ) ); if ( !geoMechWellLogExtractor ) return; - std::pair xRange = std::make_pair( m_visibleXRangeMin(), m_visibleXRangeMax() ); + std::pair xRange = + std::make_pair( m_visiblePropertyValueRangeMin(), m_visiblePropertyValueRangeMax() ); CurveSamplingPointData curveData; curveData.md = geoMechWellLogExtractor->cellIntersectionMDs(); @@ -3098,7 +3112,7 @@ void RimWellLogTrack::updateWellPathAttributesOnPlot() attributePlotObject->setParentPlotNoReplot( m_plotWidget->qwtPlot() ); } } - updateXZoom(); + updatePropertyValueZoom(); } //-------------------------------------------------------------------------------------------------- @@ -3127,7 +3141,7 @@ void RimWellLogTrack::doUpdateLayout() void RimWellLogTrack::onChildDeleted( caf::PdmChildArrayFieldHandle* childArray, std::vector& referringObjects ) { - setAutoScaleXEnabled( true ); + setAutoScalePropertyValuesEnabled( true ); updateZoomInParentPlot(); RiuPlotMainWindow* mainPlotWindow = RiaGuiApplication::instance()->mainPlotWindow(); mainPlotWindow->updateWellLogPlotToolBar(); diff --git a/ApplicationLibCode/ProjectDataModel/WellLog/RimWellLogTrack.h b/ApplicationLibCode/ProjectDataModel/WellLog/RimWellLogTrack.h index 125b313736..a15aaf3ff8 100644 --- a/ApplicationLibCode/ProjectDataModel/WellLog/RimWellLogTrack.h +++ b/ApplicationLibCode/ProjectDataModel/WellLog/RimWellLogTrack.h @@ -111,8 +111,8 @@ public: size_t curveIndex( RimWellLogCurve* curve ); size_t curveCount() { return m_curves.size(); } - void setXAxisTitle( const QString& text ); - QString yAxisTitle() const; + void setPropertyValueAxisTitle( const QString& text ); + QString depthAxisTitle() const; void setFormationWellPath( RimWellPath* wellPath ); RimWellPath* formationWellPath() const; @@ -139,18 +139,18 @@ public: bool useBranchDetection ); void setAndUpdateSimWellFormationNamesData( RimCase* rimCase, const QString& simWellName ); - void setAutoScaleXEnabled( bool enabled ) override; - void setAutoScaleYEnabled( bool enabled ) override; - void setAutoScaleXIfNecessary(); + void setAutoScalePropertyValuesEnabled( bool enabled ) override; + void setAutoScaleDepthValuesEnabled( bool enabled ) override; + void setAutoScalePropertyValuesIfNecessary(); - void availableXAxisRange( double* minX, double* maxX ); + void availablePropertyValueRange( double* minX, double* maxX ); void availableDepthRange( double* minimumDepth, double* maximumDepth ); - void visibleXAxisRange( double* minX, double* maxX ); + void visiblePropertyValueRange( double* minX, double* maxX ); void visibleDepthRange( double* minimumDepth, double* maximumDepth ); - void setVisibleXRange( double minValue, double maxValue ); - void setVisibleYRange( double minValue, double maxValue ); + void setVisiblePropertyValueRange( double minValue, double maxValue ); + void setVisibleDepthRange( double minValue, double maxValue ); void updateZoomInParentPlot() override; void updateZoomFromParentPlot() override; @@ -161,7 +161,7 @@ public: void setTickIntervals( double majorTickInterval, double minorTickInterval ); void setMinAndMaxTicksOnly( bool enable ); - void setXAxisGridVisibility( RimWellLogPlot::AxisGridVisibility gridLines ); + void setPropertyValueAxisGridVisibility( RimWellLogPlot::AxisGridVisibility gridLines ); void setAnnotationType( RiuPlotAnnotationTool::RegionAnnotationType annotationType ); void setAnnotationDisplay( RiuPlotAnnotationTool::RegionDisplay annotationDisplay ); @@ -201,7 +201,7 @@ public: void uiOrderingForXAxisSettings( caf::PdmUiOrdering& uiOrdering ); void setFormationsForCaseWithSimWellOnly( bool caseWithSimWellOnly ); - void updateXAxisAndGridTickIntervals(); + void updatePropertyValueAxisAndGridTickIntervals(); void updateLegend() override; @@ -244,11 +244,11 @@ private: void cleanupBeforeClose(); void detachAllPlotItems(); - void calculateXZoomRange(); - void calculateYZoomRange(); + void calculatePropertyValueZoomRange(); + void calculateDepthZoomRange(); - void updateXZoom(); - void updateYZoom(); + void updatePropertyValueZoom(); + void updateDepthZoom(); RiuPlotAxis getDepthAxis() const; RiuPlotAxis getValueAxis() const; @@ -272,7 +272,7 @@ private: caf::PdmFieldHandle* userDescriptionField() override; - void computeAndSetXRangeMinForLogarithmicScale(); + void computeAndSetPropertyValueRangeMinForLogarithmicScale(); static void simWellOptionItems( QList* options, RimCase* eclCase ); @@ -308,19 +308,19 @@ private: bool isEmptyVisibleXRange() const; private: - QString m_xAxisTitle; + QString m_propertyValueAxisTitle; caf::PdmField m_description; caf::PdmChildArrayField m_curves; - caf::PdmField m_visibleXRangeMin; - caf::PdmField m_visibleXRangeMax; + caf::PdmField m_visiblePropertyValueRangeMin; + caf::PdmField m_visiblePropertyValueRangeMax; caf::PdmField m_visibleDepthRangeMin; caf::PdmField m_visibleDepthRangeMax; - caf::PdmField m_isAutoScaleXEnabled; + caf::PdmField m_isAutoScalePropertyValuesEnabled; caf::PdmField m_isLogarithmicScaleEnabled; - caf::PdmField m_xAxisGridVisibility; + caf::PdmField m_propertyValueAxisGridVisibility; caf::PdmField m_explicitTickIntervals; caf::PdmField m_minAndMaxTicksOnly; @@ -365,8 +365,8 @@ private: QPointer m_plotWidget; std::unique_ptr m_annotationTool; - double m_availableXRangeMin; - double m_availableXRangeMax; + double m_availablePropertyValueRangeMin; + double m_availablePropertyValueRangeMax; double m_availableDepthRangeMin; double m_availableDepthRangeMax; }; diff --git a/ApplicationLibCode/ProjectDataModel/WellMeasurement/RimWellMeasurementCollection.cpp b/ApplicationLibCode/ProjectDataModel/WellMeasurement/RimWellMeasurementCollection.cpp index ac44380a75..84741e2120 100644 --- a/ApplicationLibCode/ProjectDataModel/WellMeasurement/RimWellMeasurementCollection.cpp +++ b/ApplicationLibCode/ProjectDataModel/WellMeasurement/RimWellMeasurementCollection.cpp @@ -89,7 +89,7 @@ void RimWellMeasurementCollection::deleteAllEmptyCurves() for ( auto curve : measurementCurves ) { - if ( curve->curveData()->xValues().empty() ) + if ( curve->curveData()->propertyValues().empty() ) { RimWellLogTrack* track = nullptr; curve->firstAncestorOrThisOfTypeAsserted( track ); diff --git a/ApplicationLibCode/ProjectDataModel/WellMeasurement/RimWellMeasurementCurve.cpp b/ApplicationLibCode/ProjectDataModel/WellMeasurement/RimWellMeasurementCurve.cpp index b7781a5371..20107e572c 100644 --- a/ApplicationLibCode/ProjectDataModel/WellMeasurement/RimWellMeasurementCurve.cpp +++ b/ApplicationLibCode/ProjectDataModel/WellMeasurement/RimWellMeasurementCurve.cpp @@ -116,21 +116,25 @@ void RimWellMeasurementCurve::onLoadDataAndUpdate( bool updateParentPlot ) -rigWellPath->interpolatedPointAlongWellPath( measuredDepthValue ).z() ); } - this->setValuesWithMdAndTVD( values, - measuredDepthValues, - trueVerticalDepthValues, - m_wellPath->wellPathGeometry()->rkbDiff(), - RiaDefines::DepthUnitType::UNIT_METER, - false ); + bool useLogarithmicScale = false; + this->setPropertyValuesWithMdAndTVD( values, + measuredDepthValues, + trueVerticalDepthValues, + m_wellPath->wellPathGeometry()->rkbDiff(), + RiaDefines::DepthUnitType::UNIT_METER, + false, + useLogarithmicScale ); } else { - this->setValuesAndDepths( values, - measuredDepthValues, - RiaDefines::DepthTypeEnum::MEASURED_DEPTH, - 0.0, - RiaDefines::DepthUnitType::UNIT_METER, - false ); + bool useLogarithmicScale = false; + this->setPropertyValuesAndDepths( values, + measuredDepthValues, + RiaDefines::DepthTypeEnum::MEASURED_DEPTH, + 0.0, + RiaDefines::DepthUnitType::UNIT_METER, + false, + useLogarithmicScale ); } } @@ -156,10 +160,10 @@ void RimWellMeasurementCurve::onLoadDataAndUpdate( bool updateParentPlot ) depthType = wellLogPlot->depthType(); } - bool isLogCurve = false; - m_plotCurve->setSamplesFromXValuesAndYValues( this->curveData()->xPlotValues(), - this->curveData()->depthPlotValues( depthType, displayUnit ), - isLogCurve ); + bool useLogarithmicScale = false; + m_plotCurve->setSamplesFromXValuesAndYValues( this->curveData()->propertyValuesByIntervals(), + this->curveData()->depthValuesByIntervals( depthType, displayUnit ), + useLogarithmicScale ); m_plotCurve->setLineSegmentStartStopIndices( this->curveData()->polylineStartStopIndices() ); } diff --git a/ApplicationLibCode/ProjectDataModelCommands/RimcWellLogPlot.cpp b/ApplicationLibCode/ProjectDataModelCommands/RimcWellLogPlot.cpp index 9f3176f494..f791049b21 100644 --- a/ApplicationLibCode/ProjectDataModelCommands/RimcWellLogPlot.cpp +++ b/ApplicationLibCode/ProjectDataModelCommands/RimcWellLogPlot.cpp @@ -74,9 +74,9 @@ RimWellLogTrack* RimcWellLogPlot_newWellLogTrack::createWellLogTrack( RimWellLog plotTrack->setLegendsVisible( true ); plotTrack->setPlotTitleVisible( true ); plotTrack->setShowWindow( true ); - plotTrack->setXAxisGridVisibility( RimWellLogPlot::AXIS_GRID_MAJOR ); + plotTrack->setPropertyValueAxisGridVisibility( RimWellLogPlot::AXIS_GRID_MAJOR ); plotTrack->setShowRegionLabels( true ); - plotTrack->setAutoScaleXEnabled( true ); + plotTrack->setAutoScalePropertyValuesEnabled( true ); plotTrack->updateConnectedEditors(); wellLogPlot->setShowWindow( true ); wellLogPlot->updateConnectedEditors(); diff --git a/ApplicationLibCode/ProjectDataModelCommands/RimcWellLogTrack.cpp b/ApplicationLibCode/ProjectDataModelCommands/RimcWellLogTrack.cpp index 61e2d26a81..49fba32210 100644 --- a/ApplicationLibCode/ProjectDataModelCommands/RimcWellLogTrack.cpp +++ b/ApplicationLibCode/ProjectDataModelCommands/RimcWellLogTrack.cpp @@ -100,9 +100,9 @@ RimWellLogExtractionCurve* curve->updateConnectedEditors(); - wellLogTrack->setXAxisGridVisibility( RimWellLogPlot::AXIS_GRID_MAJOR ); + wellLogTrack->setPropertyValueAxisGridVisibility( RimWellLogPlot::AXIS_GRID_MAJOR ); wellLogTrack->setShowRegionLabels( true ); - wellLogTrack->setAutoScaleXEnabled( true ); + wellLogTrack->setAutoScalePropertyValuesEnabled( true ); wellLogTrack->updateConnectedEditors(); wellLogTrack->setShowWindow( true ); diff --git a/ApplicationLibCode/ReservoirDataModel/RigLasFileExporter.cpp b/ApplicationLibCode/ReservoirDataModel/RigLasFileExporter.cpp index a761724fc5..ef6f64a1c9 100644 --- a/ApplicationLibCode/ReservoirDataModel/RigLasFileExporter.cpp +++ b/ApplicationLibCode/ReservoirDataModel/RigLasFileExporter.cpp @@ -60,9 +60,9 @@ public: { CVF_ASSERT( lasFile ); - if ( !m_curveData->xValues().empty() ) + if ( !m_curveData->propertyValues().empty() ) { - std::vector wellLogValues = m_curveData->xValues( QString::fromStdString( m_unit ) ); + std::vector wellLogValues = m_curveData->propertyValues( QString::fromStdString( m_unit ) ); for ( size_t vIdx = 0; vIdx < wellLogValues.size(); vIdx++ ) { double value = wellLogValues[vIdx]; @@ -119,7 +119,7 @@ public: { m_logCurveData.push_back( SingleChannelData( channelName, unit, comment, curveData ) ); - for ( double xValue : curveData->xValues() ) + for ( double xValue : curveData->propertyValues() ) { if ( xValue < m_minimumCurveValue ) { @@ -536,7 +536,7 @@ void RigLasFileExporter::appendLasFileDescriptions( const std::vectorcurveData(); } - QString units = curve->curveData()->xUnits(); + QString units = curve->curveData()->propertyValueUnit(); if ( convertCurveUnits || units == RiaWellLogUnitTools::barX100UnitString() ) { diff --git a/ApplicationLibCode/ReservoirDataModel/RigWellLogCurveData.cpp b/ApplicationLibCode/ReservoirDataModel/RigWellLogCurveData.cpp index f4b929ce8b..aa30bbc07b 100644 --- a/ApplicationLibCode/ReservoirDataModel/RigWellLogCurveData.cpp +++ b/ApplicationLibCode/ReservoirDataModel/RigWellLogCurveData.cpp @@ -31,11 +31,13 @@ /// //-------------------------------------------------------------------------------------------------- RigWellLogCurveData::RigWellLogCurveData() + : m_isExtractionCurve( false ) + , m_rkbDiff( 0.0 ) + , m_useLogarithmicScale( false ) + , m_depthUnit( RiaDefines::DepthUnitType::UNIT_METER ) + , m_propertyValueUnitString( RiaWellLogUnitTools::noUnitString() ) + { - m_isExtractionCurve = false; - m_rkbDiff = 0.0; - m_depthUnit = RiaDefines::DepthUnitType::UNIT_METER; - m_xUnitString = RiaWellLogUnitTools::noUnitString(); } //-------------------------------------------------------------------------------------------------- @@ -61,14 +63,16 @@ void RigWellLogCurveData::setValuesAndDepths( const std::vector& xValues RiaDefines::DepthTypeEnum depthType, double rkbDiff, RiaDefines::DepthUnitType depthUnit, - bool isExtractionCurve ) + bool isExtractionCurve, + bool useLogarithmicScale ) { CVF_ASSERT( xValues.size() == depths.size() ); - m_xValues = xValues; - m_depths[depthType] = depths; - m_depthUnit = depthUnit; - m_rkbDiff = rkbDiff; + m_propertyValues = xValues; + m_depths[depthType] = depths; + m_depthUnit = depthUnit; + m_rkbDiff = rkbDiff; + m_useLogarithmicScale = useLogarithmicScale; // Disable depth value filtering is intended to be used for // extraction curve data @@ -84,17 +88,19 @@ void RigWellLogCurveData::setValuesAndDepths( const std::vector& const std::map>& depths, double rkbDiff, RiaDefines::DepthUnitType depthUnit, - bool isExtractionCurve ) + bool isExtractionCurve, + bool useLogarithmicScale ) { for ( auto it = depths.begin(); it != depths.end(); ++it ) { CVF_ASSERT( xValues.size() == it->second.size() ); } - m_xValues = xValues; - m_depths = depths; - m_depthUnit = depthUnit; - m_rkbDiff = rkbDiff; + m_propertyValues = xValues; + m_depths = depths; + m_depthUnit = depthUnit; + m_rkbDiff = rkbDiff; + m_useLogarithmicScale = useLogarithmicScale; // Disable depth value filtering is intended to be used for // extraction curve data @@ -106,43 +112,43 @@ void RigWellLogCurveData::setValuesAndDepths( const std::vector& //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -void RigWellLogCurveData::setXUnits( const QString& xUnitString ) +void RigWellLogCurveData::setPropertyValueUnit( const QString& propertyValueUnitString ) { - m_xUnitString = xUnitString; + m_propertyValueUnitString = propertyValueUnitString; } //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -std::vector RigWellLogCurveData::xValues() const +std::vector RigWellLogCurveData::propertyValues() const { - return m_xValues; + return m_propertyValues; } //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -std::vector RigWellLogCurveData::xValues( const QString& units ) const +std::vector RigWellLogCurveData::propertyValues( const QString& units ) const { std::vector convertedValues; - if ( units != m_xUnitString && + if ( units != m_propertyValueUnitString && RiaWellLogUnitTools::convertValues( depths( RiaDefines::DepthTypeEnum::TRUE_VERTICAL_DEPTH_RKB ), - m_xValues, + m_propertyValues, &convertedValues, - m_xUnitString, + m_propertyValueUnitString, units ) ) { return convertedValues; } - return m_xValues; + return m_propertyValues; } //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -QString RigWellLogCurveData::xUnits() const +QString RigWellLogCurveData::propertyValueUnit() const { - return m_xUnitString; + return m_propertyValueUnitString; } //-------------------------------------------------------------------------------------------------- @@ -212,10 +218,10 @@ std::set RigWellLogCurveData::availableDepthTypes() c //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -std::vector RigWellLogCurveData::xPlotValues() const +std::vector RigWellLogCurveData::propertyValuesByIntervals() const { std::vector filteredValues; - RiaCurveDataTools::getValuesByIntervals( m_xValues, m_intervalsOfContinousValidValues, &filteredValues ); + RiaCurveDataTools::getValuesByIntervals( m_propertyValues, m_intervalsOfContinousValidValues, &filteredValues ); return filteredValues; } @@ -223,8 +229,8 @@ std::vector RigWellLogCurveData::xPlotValues() const //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -std::vector RigWellLogCurveData::depthPlotValues( RiaDefines::DepthTypeEnum depthType, - RiaDefines::DepthUnitType destinationDepthUnit ) const +std::vector RigWellLogCurveData::depthValuesByIntervals( RiaDefines::DepthTypeEnum depthType, + RiaDefines::DepthUnitType destinationDepthUnit ) const { std::vector filteredValues; @@ -279,8 +285,8 @@ cvf::ref RigWellLogCurveData::calculateResampledCurveData( { double segmentStartMd = mdIt->second[segmentStartIdx]; double segmentEndMd = mdIt->second[segmentStartIdx + 1]; - double segmentStartX = m_xValues[segmentStartIdx]; - double segmentEndX = m_xValues[segmentStartIdx + 1]; + double segmentStartX = m_propertyValues[segmentStartIdx]; + double segmentEndX = m_propertyValues[segmentStartIdx + 1]; double segmentStartTvd = 0.0; double segmentEndTvd = 0.0; @@ -318,7 +324,7 @@ cvf::ref RigWellLogCurveData::calculateResampledCurveData( std::map> resampledDepths = { { RiaDefines::DepthTypeEnum::TRUE_VERTICAL_DEPTH, tvDepths }, { RiaDefines::DepthTypeEnum::MEASURED_DEPTH, measuredDepths } }; - reSampledData->setValuesAndDepths( xValues, resampledDepths, m_rkbDiff, m_depthUnit, true ); + reSampledData->setValuesAndDepths( xValues, resampledDepths, m_rkbDiff, m_depthUnit, true, m_useLogarithmicScale ); } else { @@ -327,7 +333,8 @@ cvf::ref RigWellLogCurveData::calculateResampledCurveData( RiaDefines::DepthTypeEnum::MEASURED_DEPTH, 0.0, m_depthUnit, - m_isExtractionCurve ); + m_isExtractionCurve, + m_useLogarithmicScale ); } return reSampledData; @@ -346,8 +353,8 @@ void RigWellLogCurveData::interpolateSegment( RiaDefines::DepthTypeEnum resampli double depth0 = depthIt->second[firstIndex]; double depth1 = depthIt->second[secondIndex]; - double x0 = m_xValues[firstIndex]; - double x1 = m_xValues[secondIndex]; + double x0 = m_propertyValues[firstIndex]; + double x1 = m_propertyValues[secondIndex]; double slope = 0.0; if ( std::fabs( depth1 - depth0 ) > eps ) { @@ -412,7 +419,7 @@ cvf::ref RigWellLogCurveData::calculateResampledCurveData( if ( std::fabs( depthIt->second[segmentStartIdx] - depth ) < eps ) // already have this depth point, // reuse it { - xValues.push_back( m_xValues[segmentStartIdx] ); + xValues.push_back( m_propertyValues[segmentStartIdx] ); // Copy all depth types for this segment for ( auto depthTypeValuesPair : m_depths ) { @@ -458,7 +465,7 @@ cvf::ref RigWellLogCurveData::calculateResampledCurveData( CAF_ASSERT( foundPoint ); } - reSampledData->setValuesAndDepths( xValues, resampledDepths, m_rkbDiff, m_depthUnit, true ); + reSampledData->setValuesAndDepths( xValues, resampledDepths, m_rkbDiff, m_depthUnit, true, m_useLogarithmicScale ); return reSampledData; } @@ -468,7 +475,7 @@ cvf::ref RigWellLogCurveData::calculateResampledCurveData( void RigWellLogCurveData::calculateIntervalsOfContinousValidValues() { std::vector> intervalsOfValidValues = - RiaCurveDataTools::calculateIntervalsOfValidValues( m_xValues, false ); + RiaCurveDataTools::calculateIntervalsOfValidValues( m_propertyValues, m_useLogarithmicScale ); m_intervalsOfContinousValidValues.clear(); @@ -557,7 +564,7 @@ bool RigWellLogCurveData::calculateDepthRange( RiaDefines::DepthTypeEnum depthTy double minValue = HUGE_VAL; double maxValue = -HUGE_VAL; - std::vector depthValues = depthPlotValues( depthType, depthUnit ); + std::vector depthValues = depthValuesByIntervals( depthType, depthUnit ); for ( size_t vIdx = 0; vIdx < depthValues.size(); vIdx++ ) { double value = depthValues[vIdx]; diff --git a/ApplicationLibCode/ReservoirDataModel/RigWellLogCurveData.h b/ApplicationLibCode/ReservoirDataModel/RigWellLogCurveData.h index 20194c5126..807b7c9d96 100644 --- a/ApplicationLibCode/ReservoirDataModel/RigWellLogCurveData.h +++ b/ApplicationLibCode/ReservoirDataModel/RigWellLogCurveData.h @@ -43,22 +43,26 @@ public: void setDepthUnit( RiaDefines::DepthUnitType depthUnit ); - void setValuesAndDepths( const std::vector& xValues, + void setValuesAndDepths( const std::vector& propertyValues, const std::vector& depths, RiaDefines::DepthTypeEnum depthType, double rkbDiff, RiaDefines::DepthUnitType depthUnit, - bool isExtractionCurve ); - void setValuesAndDepths( const std::vector& xValues, + bool isExtractionCurve, + bool useLogarithmicScale ); + + void setValuesAndDepths( const std::vector& propertyValues, const std::map>& depths, double rkbDiff, RiaDefines::DepthUnitType depthUnit, - bool isExtractionCurve ); - void setXUnits( const QString& xUnitString ); + bool isExtractionCurve, + bool useLogarithmicScale ); - std::vector xValues() const; - std::vector xValues( const QString& units ) const; - QString xUnits() const; + void setPropertyValueUnit( const QString& propertyValueUnitString ); + + std::vector propertyValues() const; + std::vector propertyValues( const QString& units ) const; + QString propertyValueUnit() const; std::vector depths( RiaDefines::DepthTypeEnum depthType ) const; @@ -71,9 +75,9 @@ public: RiaDefines::DepthUnitType depthUnit() const; - std::vector xPlotValues() const; - std::vector depthPlotValues( RiaDefines::DepthTypeEnum depthType, - RiaDefines::DepthUnitType destinationDepthUnit ) const; + std::vector propertyValuesByIntervals() const; + std::vector depthValuesByIntervals( RiaDefines::DepthTypeEnum depthType, + RiaDefines::DepthUnitType destinationDepthUnit ) const; std::vector> polylineStartStopIndices() const; cvf::ref calculateResampledCurveData( double newMeasuredDepthStepSize ) const; @@ -95,13 +99,14 @@ private: std::vector>* intervals ); private: - std::vector m_xValues; + std::vector m_propertyValues; std::map> m_depths; bool m_isExtractionCurve; double m_rkbDiff; + bool m_useLogarithmicScale; std::vector> m_intervalsOfContinousValidValues; RiaDefines::DepthUnitType m_depthUnit; - QString m_xUnitString; + QString m_propertyValueUnitString; }; diff --git a/ApplicationLibCode/UnitTests/RimWellLogExtractionCurveImpl-Test.cpp b/ApplicationLibCode/UnitTests/RimWellLogExtractionCurveImpl-Test.cpp index 274557a9d5..cd7400679f 100644 --- a/ApplicationLibCode/UnitTests/RimWellLogExtractionCurveImpl-Test.cpp +++ b/ApplicationLibCode/UnitTests/RimWellLogExtractionCurveImpl-Test.cpp @@ -18,7 +18,8 @@ TEST( RimWellLogExtractionCurveImplTest, StripOffInvalidValAtEndsOfVector ) values.push_back( 3.0 ); values.push_back( HUGE_VAL ); - auto valuesIntervals = RiaCurveDataTools::calculateIntervalsOfValidValues( values, false ); + bool includePositiveValuesOnly = false; + auto valuesIntervals = RiaCurveDataTools::calculateIntervalsOfValidValues( values, includePositiveValuesOnly ); EXPECT_EQ( 1, static_cast( valuesIntervals.size() ) ); EXPECT_EQ( 2, static_cast( valuesIntervals[0].first ) ); @@ -40,7 +41,8 @@ TEST( RimWellLogExtractionCurveImplTest, StripOffHugeValAtEndsAndInteriorOfVecto values.push_back( 3.0 ); values.push_back( HUGE_VAL ); - auto valuesIntervals = RiaCurveDataTools::calculateIntervalsOfValidValues( values, false ); + bool includePositiveValuesOnly = false; + auto valuesIntervals = RiaCurveDataTools::calculateIntervalsOfValidValues( values, includePositiveValuesOnly ); EXPECT_EQ( 2, static_cast( valuesIntervals.size() ) ); EXPECT_EQ( 2, static_cast( valuesIntervals[0].first ) ); @@ -48,3 +50,31 @@ TEST( RimWellLogExtractionCurveImplTest, StripOffHugeValAtEndsAndInteriorOfVecto EXPECT_EQ( 5, static_cast( valuesIntervals[1].first ) ); EXPECT_EQ( 6, static_cast( valuesIntervals[1].second ) ); } + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +TEST( RimWellLogExtractionCurveImplTest, PositiveValuesOnly ) +{ + std::vector values; + values.push_back( HUGE_VAL ); + values.push_back( HUGE_VAL ); + values.push_back( -1.0 ); + values.push_back( 0.0 ); + values.push_back( 0.1 ); + values.push_back( 0.2 ); + values.push_back( -1.0 ); + values.push_back( HUGE_VAL ); + values.push_back( 2.0 ); + values.push_back( 3.0 ); + values.push_back( HUGE_VAL ); + + bool includePositiveValuesOnly = true; + auto valuesIntervals = RiaCurveDataTools::calculateIntervalsOfValidValues( values, includePositiveValuesOnly ); + + EXPECT_EQ( 2, static_cast( valuesIntervals.size() ) ); + EXPECT_EQ( 4, static_cast( valuesIntervals[0].first ) ); + EXPECT_EQ( 5, static_cast( valuesIntervals[0].second ) ); + EXPECT_EQ( 8, static_cast( valuesIntervals[1].first ) ); + EXPECT_EQ( 9, static_cast( valuesIntervals[1].second ) ); +} diff --git a/ApplicationLibCode/UserInterface/RiuFlowCharacteristicsPlot.cpp b/ApplicationLibCode/UserInterface/RiuFlowCharacteristicsPlot.cpp index f63b998a68..324e217fa7 100644 --- a/ApplicationLibCode/UserInterface/RiuFlowCharacteristicsPlot.cpp +++ b/ApplicationLibCode/UserInterface/RiuFlowCharacteristicsPlot.cpp @@ -239,8 +239,8 @@ void RiuFlowCharacteristicsPlot::addFlowCapStorageCapCurve( const QDateTime& RiuQwtPlotCurve* plotCurve = createEmptyCurve( m_flowCapVsStorageCapPlot, dateTime.toString(), m_dateToColorMap[dateTime] ); - bool isLogCurve = false; - plotCurve->setSamplesFromXValuesAndYValues( xVals, yVals, isLogCurve ); + bool useLogarithmicScale = false; + plotCurve->setSamplesFromXValuesAndYValues( xVals, yVals, useLogarithmicScale ); m_flowCapVsStorageCapPlot->replot(); } @@ -253,9 +253,9 @@ void RiuFlowCharacteristicsPlot::addSweepEfficiencyCurve( const QDateTime& { CVF_ASSERT( !m_dateToColorMap.empty() ); - RiuQwtPlotCurve* plotCurve = createEmptyCurve( m_sweepEffPlot, dateTime.toString(), m_dateToColorMap[dateTime] ); - bool isLogCurve = false; - plotCurve->setSamplesFromXValuesAndYValues( xVals, yVals, isLogCurve ); + RiuQwtPlotCurve* plotCurve = createEmptyCurve( m_sweepEffPlot, dateTime.toString(), m_dateToColorMap[dateTime] ); + bool useLogarithmicScale = false; + plotCurve->setSamplesFromXValuesAndYValues( xVals, yVals, useLogarithmicScale ); m_sweepEffPlot->replot(); } diff --git a/ApplicationLibCode/UserInterface/RiuPlotCurve.cpp b/ApplicationLibCode/UserInterface/RiuPlotCurve.cpp index e528ab9497..7de827ffa1 100644 --- a/ApplicationLibCode/UserInterface/RiuPlotCurve.cpp +++ b/ApplicationLibCode/UserInterface/RiuPlotCurve.cpp @@ -49,7 +49,7 @@ RiuPlotCurve::~RiuPlotCurve() //-------------------------------------------------------------------------------------------------- void RiuPlotCurve::setSamplesValues( const std::vector& xValues, const std::vector& yValues ) { - setSamplesInPlot( xValues, yValues, static_cast( xValues.size() ) ); + setSamplesInPlot( xValues, yValues ); } //-------------------------------------------------------------------------------------------------- @@ -57,9 +57,9 @@ void RiuPlotCurve::setSamplesValues( const std::vector& xValues, const s //-------------------------------------------------------------------------------------------------- void RiuPlotCurve::setSamplesFromXValuesAndYValues( const std::vector& xValues, const std::vector& yValues, - bool isLogCurve ) + bool useLogarithmicScale ) { - computeValidIntervalsAndSetCurveData( xValues, yValues, isLogCurve ); + computeValidIntervalsAndSetCurveData( xValues, yValues, useLogarithmicScale ); } //-------------------------------------------------------------------------------------------------- @@ -67,11 +67,11 @@ void RiuPlotCurve::setSamplesFromXValuesAndYValues( const std::vector& x //-------------------------------------------------------------------------------------------------- void RiuPlotCurve::setSamplesFromDatesAndYValues( const std::vector& dateTimes, const std::vector& yValues, - bool isLogCurve ) + bool useLogarithmicScale ) { auto xValues = RiuPlotCurve::fromQDateTime( dateTimes ); - computeValidIntervalsAndSetCurveData( xValues, yValues, isLogCurve ); + computeValidIntervalsAndSetCurveData( xValues, yValues, useLogarithmicScale ); } //-------------------------------------------------------------------------------------------------- @@ -79,11 +79,11 @@ void RiuPlotCurve::setSamplesFromDatesAndYValues( const std::vector& //-------------------------------------------------------------------------------------------------- void RiuPlotCurve::setSamplesFromTimeTAndYValues( const std::vector& dateTimes, const std::vector& yValues, - bool isLogCurve ) + bool useLogarithmicScale ) { auto xValues = RiuPlotCurve::fromTime_t( dateTimes ); - computeValidIntervalsAndSetCurveData( xValues, yValues, isLogCurve ); + computeValidIntervalsAndSetCurveData( xValues, yValues, useLogarithmicScale ); } //-------------------------------------------------------------------------------------------------- @@ -123,9 +123,9 @@ void RiuPlotCurve::setBlackAndWhiteLegendIcon( bool blackAndWhite ) //-------------------------------------------------------------------------------------------------- void RiuPlotCurve::computeValidIntervalsAndSetCurveData( const std::vector& xValues, const std::vector& yValues, - bool isLogCurve ) + bool useLogarithmicScale ) { - auto intervalsOfValidValues = RiaCurveDataTools::calculateIntervalsOfValidValues( yValues, isLogCurve ); + auto intervalsOfValidValues = RiaCurveDataTools::calculateIntervalsOfValidValues( yValues, useLogarithmicScale ); std::vector validYValues; std::vector validXValues; @@ -133,7 +133,7 @@ void RiuPlotCurve::computeValidIntervalsAndSetCurveData( const std::vector( validXValues.size() ) ); + setSamplesInPlot( validXValues, validYValues ); setLineSegmentStartStopIndices( RiaCurveDataTools::computePolyLineStartStopIndices( intervalsOfValidValues ) ); } @@ -184,7 +184,7 @@ std::vector RiuPlotCurve::fromTime_t( const std::vector& timeSte void RiuPlotCurve::setSamplesFromXYErrorValues( const std::vector& xValues, const std::vector& yValues, const std::vector& errorValues, - bool isLogCurve, + bool useLogarithmicScale, RiaCurveDataTools::ErrorAxis errorAxis ) { } diff --git a/ApplicationLibCode/UserInterface/RiuPlotCurve.h b/ApplicationLibCode/UserInterface/RiuPlotCurve.h index 47144a35d5..f770b52fa4 100644 --- a/ApplicationLibCode/UserInterface/RiuPlotCurve.h +++ b/ApplicationLibCode/UserInterface/RiuPlotCurve.h @@ -65,21 +65,21 @@ public: void setSamplesFromXValuesAndYValues( const std::vector& xValues, const std::vector& yValues, - bool isLogCurve ); + bool useLogarithmicScale ); void setSamplesFromDatesAndYValues( const std::vector& dateTimes, const std::vector& yValues, - bool isLogCurve ); + bool useLogarithmicScale ); void setSamplesFromTimeTAndYValues( const std::vector& dateTimes, const std::vector& yValues, - bool isLogCurve ); + bool useLogarithmicScale ); virtual void setSamplesFromXYErrorValues( const std::vector& xValues, const std::vector& yValues, const std::vector& errorValues, - bool isLogCurve, + bool useLogarithmicScale, RiaCurveDataTools::ErrorAxis errorAxis = RiaCurveDataTools::ErrorAxis::ERROR_ALONG_Y_AXIS ); void setLineSegmentStartStopIndices( const std::vector>& lineSegmentStartStopIndices ); @@ -130,13 +130,12 @@ public: virtual RiuPlotCurveSymbol* createSymbol( RiuPlotCurveSymbol::PointSymbolEnum symbol ) const = 0; protected: - virtual void - setSamplesInPlot( const std::vector& xValues, const std::vector& yValues, int numSamples ) = 0; + virtual void setSamplesInPlot( const std::vector& xValues, const std::vector& yValues ) = 0; private: void computeValidIntervalsAndSetCurveData( const std::vector& xValues, const std::vector& yValues, - bool isLogCurve ); + bool useLogarithmicScale ); protected: float m_symbolSkipPixelDistance; diff --git a/ApplicationLibCode/UserInterface/RiuQtChartsPlotCurve.cpp b/ApplicationLibCode/UserInterface/RiuQtChartsPlotCurve.cpp index cbe1e3f5e2..7fa055b28b 100644 --- a/ApplicationLibCode/UserInterface/RiuQtChartsPlotCurve.cpp +++ b/ApplicationLibCode/UserInterface/RiuQtChartsPlotCurve.cpp @@ -179,22 +179,18 @@ void RiuQtChartsPlotCurve::showInPlot() //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -void RiuQtChartsPlotCurve::setSamplesInPlot( const std::vector& xValues, - const std::vector& yValues, - int numValues ) +void RiuQtChartsPlotCurve::setSamplesInPlot( const std::vector& xValues, const std::vector& yValues ) { if ( !isQtChartObjectsPresent() ) return; CAF_ASSERT( xValues.size() == yValues.size() ); - CAF_ASSERT( numValues <= static_cast( xValues.size() ) ); - CAF_ASSERT( numValues >= 0 ); QtCharts::QLineSeries* line = lineSeries(); QtCharts::QScatterSeries* scatter = scatterSeries(); line->clear(); scatter->clear(); - for ( int i = 0; i < numValues; i++ ) + for ( int i = 0; i < static_cast( xValues.size() ); i++ ) { line->append( xValues[i], yValues[i] ); scatter->append( xValues[i], yValues[i] ); diff --git a/ApplicationLibCode/UserInterface/RiuQtChartsPlotCurve.h b/ApplicationLibCode/UserInterface/RiuQtChartsPlotCurve.h index 9b95e94953..4c2c476c20 100644 --- a/ApplicationLibCode/UserInterface/RiuQtChartsPlotCurve.h +++ b/ApplicationLibCode/UserInterface/RiuQtChartsPlotCurve.h @@ -78,7 +78,7 @@ public: RiuPlotCurveSymbol* createSymbol( RiuPlotCurveSymbol::PointSymbolEnum symbol ) const override; private: - void setSamplesInPlot( const std::vector&, const std::vector&, int ) override; + void setSamplesInPlot( const std::vector&, const std::vector& ) override; bool isQtChartObjectsPresent() const; QtCharts::QLineSeries* lineSeries() const; diff --git a/ApplicationLibCode/UserInterface/RiuQwtPlotCurve.cpp b/ApplicationLibCode/UserInterface/RiuQwtPlotCurve.cpp index 2d670f15d1..5a352fdb0e 100644 --- a/ApplicationLibCode/UserInterface/RiuQwtPlotCurve.cpp +++ b/ApplicationLibCode/UserInterface/RiuQwtPlotCurve.cpp @@ -337,9 +337,11 @@ void RiuQwtPlotCurve::showInPlot() //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -void RiuQwtPlotCurve::setSamplesInPlot( const std::vector& xValues, const std::vector& yValues, int numValues ) +void RiuQwtPlotCurve::setSamplesInPlot( const std::vector& xValues, const std::vector& yValues ) { - setSamples( xValues.data(), yValues.data(), numValues ); + CAF_ASSERT( xValues.size() == yValues.size() ); + + setSamples( xValues.data(), yValues.data(), static_cast( xValues.size() ) ); } //-------------------------------------------------------------------------------------------------- @@ -415,13 +417,13 @@ std::pair RiuQwtPlotCurve::yDataRange() const void RiuQwtPlotCurve::setSamplesFromXYErrorValues( const std::vector& xValues, const std::vector& yValues, const std::vector& errorValues, - bool isLogCurve, + bool useLogarithmicScale, RiaCurveDataTools::ErrorAxis errorAxis ) { CVF_ASSERT( xValues.size() == yValues.size() ); CVF_ASSERT( xValues.size() == errorValues.size() ); - auto intervalsOfValidValues = RiaCurveDataTools::calculateIntervalsOfValidValues( yValues, isLogCurve ); + auto intervalsOfValidValues = RiaCurveDataTools::calculateIntervalsOfValidValues( yValues, useLogarithmicScale ); std::vector filteredYValues; std::vector filteredXValues; @@ -454,7 +456,7 @@ void RiuQwtPlotCurve::setSamplesFromXYErrorValues( const std::vector& } } - setSamplesInPlot( filteredXValues, filteredYValues, static_cast( filteredXValues.size() ) ); + setSamplesInPlot( filteredXValues, filteredYValues ); setLineSegmentStartStopIndices( intervalsOfValidValues ); diff --git a/ApplicationLibCode/UserInterface/RiuQwtPlotCurve.h b/ApplicationLibCode/UserInterface/RiuQwtPlotCurve.h index 538d1cca13..13ee0a5a68 100644 --- a/ApplicationLibCode/UserInterface/RiuQwtPlotCurve.h +++ b/ApplicationLibCode/UserInterface/RiuQwtPlotCurve.h @@ -71,7 +71,7 @@ public: const std::vector& xValues, const std::vector& yValues, const std::vector& errorValues, - bool isLogCurve, + bool useLogarithmicScale, RiaCurveDataTools::ErrorAxis errorAxis = RiaCurveDataTools::ErrorAxis::ERROR_ALONG_Y_AXIS ) override; void setXAxis( RiuPlotAxis axis ) override; @@ -97,7 +97,7 @@ protected: int from, int to ) const override; - void setSamplesInPlot( const std::vector&, const std::vector&, int ) override; + void setSamplesInPlot( const std::vector&, const std::vector& ) override; QwtPlotIntervalCurve* m_qwtCurveErrorBars; bool m_showErrorBars;