diff --git a/ApplicationCode/Commands/RicDeleteItemExec.cpp b/ApplicationCode/Commands/RicDeleteItemExec.cpp index d9aea835da..1caaf6d766 100644 --- a/ApplicationCode/Commands/RicDeleteItemExec.cpp +++ b/ApplicationCode/Commands/RicDeleteItemExec.cpp @@ -132,7 +132,7 @@ void RicDeleteItemExec::redo() parentObj->firstAnchestorOrThisOfType(wellLogPlotTrack); if (wellLogPlotTrack) { - wellLogPlotTrack->zoomAllXAxisIfAutoScale(); + wellLogPlotTrack->updateXZoom(); } // Update due to delete plots diff --git a/ApplicationCode/Commands/WellLogCommands/RicWellLogPlotTrackFeatureImpl.cpp b/ApplicationCode/Commands/WellLogCommands/RicWellLogPlotTrackFeatureImpl.cpp index eaadf959ca..b835b90c09 100644 --- a/ApplicationCode/Commands/WellLogCommands/RicWellLogPlotTrackFeatureImpl.cpp +++ b/ApplicationCode/Commands/WellLogCommands/RicWellLogPlotTrackFeatureImpl.cpp @@ -70,11 +70,11 @@ void RicWellLogPlotTrackFeatureImpl::moveCurvesToWellLogPlotTrack(RimWellLogTrac for (std::set::iterator tIt = srcTracks.begin(); tIt != srcTracks.end(); ++tIt) { - (*tIt)->zoomAllXAndZoomAllDepthOnOwnerPlot(); + (*tIt)->updateXZoomAndParentPlotDepthZoom(); } destTrack->loadDataAndUpdate(); - destTrack->zoomAllXAndZoomAllDepthOnOwnerPlot(); + destTrack->updateXZoomAndParentPlotDepthZoom(); destTrack->updateConnectedEditors(); } diff --git a/ApplicationCode/ProjectDataModel/RimPlotCurve.cpp b/ApplicationCode/ProjectDataModel/RimPlotCurve.cpp index 2a2bb8ea83..07988756d1 100644 --- a/ApplicationCode/ProjectDataModel/RimPlotCurve.cpp +++ b/ApplicationCode/ProjectDataModel/RimPlotCurve.cpp @@ -164,7 +164,7 @@ void RimPlotCurve::updateCurveVisibility() m_qwtPlotCurve->detach(); } - zoomAllParentPlot(); + updateZoomInParentPlot(); } //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationCode/ProjectDataModel/RimPlotCurve.h b/ApplicationCode/ProjectDataModel/RimPlotCurve.h index 7c8d69acca..f2a7ba94e8 100644 --- a/ApplicationCode/ProjectDataModel/RimPlotCurve.h +++ b/ApplicationCode/ProjectDataModel/RimPlotCurve.h @@ -80,7 +80,7 @@ public: protected: virtual QString createCurveAutoName() = 0; - virtual void zoomAllParentPlot() = 0; + virtual void updateZoomInParentPlot() = 0; virtual void onLoadDataAndUpdate() = 0; void updateCurvePresentation(); diff --git a/ApplicationCode/ProjectDataModel/RimSummaryCurve.cpp b/ApplicationCode/ProjectDataModel/RimSummaryCurve.cpp index 0e42c6a93b..3bc2b2ff50 100644 --- a/ApplicationCode/ProjectDataModel/RimSummaryCurve.cpp +++ b/ApplicationCode/ProjectDataModel/RimSummaryCurve.cpp @@ -318,12 +318,12 @@ QString RimSummaryCurve::createCurveAutoName() //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -void RimSummaryCurve::zoomAllParentPlot() +void RimSummaryCurve::updateZoomInParentPlot() { RimSummaryPlot* plot = nullptr; firstAnchestorOrThisOfType(plot); - plot->zoomAll(); + plot->updateZoom(); } //-------------------------------------------------------------------------------------------------- @@ -349,7 +349,7 @@ void RimSummaryCurve::onLoadDataAndUpdate() m_qwtPlotCurve->setSamplesFromDateAndValues(std::vector(), std::vector()); } - zoomAllParentPlot(); + updateZoomInParentPlot(); if (m_parentQwtPlot) m_parentQwtPlot->replot(); } diff --git a/ApplicationCode/ProjectDataModel/RimSummaryCurve.h b/ApplicationCode/ProjectDataModel/RimSummaryCurve.h index 366aaea942..f93df958a0 100644 --- a/ApplicationCode/ProjectDataModel/RimSummaryCurve.h +++ b/ApplicationCode/ProjectDataModel/RimSummaryCurve.h @@ -83,7 +83,7 @@ protected: // RimPlotCurve overrides virtual QString createCurveAutoName() override; - virtual void zoomAllParentPlot() override; + virtual void updateZoomInParentPlot() override; virtual void onLoadDataAndUpdate() override; private: diff --git a/ApplicationCode/ProjectDataModel/RimSummaryPlot.cpp b/ApplicationCode/ProjectDataModel/RimSummaryPlot.cpp index 73fccc754a..1c337160ad 100644 --- a/ApplicationCode/ProjectDataModel/RimSummaryPlot.cpp +++ b/ApplicationCode/ProjectDataModel/RimSummaryPlot.cpp @@ -296,7 +296,17 @@ void RimSummaryPlot::loadDataAndUpdate() this->updateYAxisUnit(); - if (m_visibleWindow().size() == 4) + updateZoom(); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimSummaryPlot::updateZoom() +{ + // Todo: introduce autoscale + + if(m_visibleWindow().size() == 4) { QRectF visibleWindow(m_visibleWindow()[0], m_visibleWindow()[1], m_visibleWindow()[2], m_visibleWindow()[3]); diff --git a/ApplicationCode/ProjectDataModel/RimSummaryPlot.h b/ApplicationCode/ProjectDataModel/RimSummaryPlot.h index 85564fb975..1c57aa79af 100644 --- a/ApplicationCode/ProjectDataModel/RimSummaryPlot.h +++ b/ApplicationCode/ProjectDataModel/RimSummaryPlot.h @@ -52,6 +52,9 @@ public: RimSummaryCurve* findRimCurveFromQwtCurve(const QwtPlotCurve* curve) const; void loadDataAndUpdate(); + + void updateZoom(); + void handleViewerDeletion(); void updateYAxisUnit(); void updateCaseNameHasChanged(); diff --git a/ApplicationCode/ProjectDataModel/RimWellLogCurve.cpp b/ApplicationCode/ProjectDataModel/RimWellLogCurve.cpp index 0a54d0efd7..f842d44d7b 100644 --- a/ApplicationCode/ProjectDataModel/RimWellLogCurve.cpp +++ b/ApplicationCode/ProjectDataModel/RimWellLogCurve.cpp @@ -106,7 +106,7 @@ bool RimWellLogCurve::valueRange(double* minimumValue, double* maximumValue) con //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -void RimWellLogCurve::zoomAllParentPlot() +void RimWellLogCurve::updateZoomInParentPlot() { RimWellLogPlot* wellLogPlot; firstAnchestorOrThisOfType(wellLogPlot); @@ -120,7 +120,7 @@ void RimWellLogCurve::zoomAllParentPlot() firstAnchestorOrThisOfType(plotTrack); if (plotTrack) { - plotTrack->zoomAllXAndZoomAllDepthOnOwnerPlot(); + plotTrack->updateXZoomAndParentPlotDepthZoom(); } } diff --git a/ApplicationCode/ProjectDataModel/RimWellLogCurve.h b/ApplicationCode/ProjectDataModel/RimWellLogCurve.h index 7f78fc3dc5..df1dff236f 100644 --- a/ApplicationCode/ProjectDataModel/RimWellLogCurve.h +++ b/ApplicationCode/ProjectDataModel/RimWellLogCurve.h @@ -47,7 +47,7 @@ public: virtual QString wellDate() const { return ""; }; protected: - virtual void zoomAllParentPlot(); + virtual void updateZoomInParentPlot(); cvf::ref m_curveData; }; diff --git a/ApplicationCode/ProjectDataModel/RimWellLogExtractionCurve.cpp b/ApplicationCode/ProjectDataModel/RimWellLogExtractionCurve.cpp index ede1d646b1..59bc3da31f 100644 --- a/ApplicationCode/ProjectDataModel/RimWellLogExtractionCurve.cpp +++ b/ApplicationCode/ProjectDataModel/RimWellLogExtractionCurve.cpp @@ -285,7 +285,7 @@ void RimWellLogExtractionCurve::onLoadDataAndUpdate() m_qwtPlotCurve->setLineSegmentStartStopIndices(m_curveData->polylineStartStopIndices()); - zoomAllParentPlot(); + updateZoomInParentPlot(); setLogScaleFromSelectedResult(); diff --git a/ApplicationCode/ProjectDataModel/RimWellLogFileCurve.cpp b/ApplicationCode/ProjectDataModel/RimWellLogFileCurve.cpp index d1b8b41d4a..64c4b148d3 100644 --- a/ApplicationCode/ProjectDataModel/RimWellLogFileCurve.cpp +++ b/ApplicationCode/ProjectDataModel/RimWellLogFileCurve.cpp @@ -123,7 +123,7 @@ void RimWellLogFileCurve::onLoadDataAndUpdate() m_qwtPlotCurve->setSamples(m_curveData->xPlotValues().data(), m_curveData->measuredDepthPlotValues(displayUnit).data(), static_cast(m_curveData->xPlotValues().size())); m_qwtPlotCurve->setLineSegmentStartStopIndices(m_curveData->polylineStartStopIndices()); - zoomAllParentPlot(); + updateZoomInParentPlot(); if (m_parentQwtPlot) m_parentQwtPlot->replot(); } diff --git a/ApplicationCode/ProjectDataModel/RimWellLogTrack.cpp b/ApplicationCode/ProjectDataModel/RimWellLogTrack.cpp index 26d87b1c8c..4549bdc2ea 100644 --- a/ApplicationCode/ProjectDataModel/RimWellLogTrack.cpp +++ b/ApplicationCode/ProjectDataModel/RimWellLogTrack.cpp @@ -114,7 +114,7 @@ void RimWellLogTrack::fieldChangedByUi(const caf::PdmFieldHandle* changedField, { if (m_isAutoScaleXEnabled()) { - this->zoomAllXAxisIfAutoScale(); + this->updateXZoom(); computeAndSetXRangeMinForLogarithmicScale(); if (m_wellLogTrackPlotWidget) m_wellLogTrackPlotWidget->replot(); @@ -124,7 +124,7 @@ void RimWellLogTrack::fieldChangedByUi(const caf::PdmFieldHandle* changedField, { updateAxisScaleEngine(); - this->zoomAllXAxisIfAutoScale(); + this->updateXZoom(); computeAndSetXRangeMinForLogarithmicScale(); m_wellLogTrackPlotWidget->setXRange(m_visibleXRangeMin, m_visibleXRangeMax); @@ -282,7 +282,7 @@ void RimWellLogTrack::detachAllCurves() //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -void RimWellLogTrack::zoomAllXAndZoomAllDepthOnOwnerPlot() +void RimWellLogTrack::updateXZoomAndParentPlotDepthZoom() { if (m_wellLogTrackPlotWidget) { @@ -293,7 +293,7 @@ void RimWellLogTrack::zoomAllXAndZoomAllDepthOnOwnerPlot() wellLogPlot->updateDepthZoom(); } - zoomAllXAxisIfAutoScale(); + updateXZoom(); m_wellLogTrackPlotWidget->replot(); } @@ -302,9 +302,14 @@ void RimWellLogTrack::zoomAllXAndZoomAllDepthOnOwnerPlot() //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -void RimWellLogTrack::zoomAllXAxisIfAutoScale() +void RimWellLogTrack::updateXZoom() { - if (!m_isAutoScaleXEnabled()) return; + if (!m_isAutoScaleXEnabled()) + { + m_wellLogTrackPlotWidget->setXRange(m_visibleXRangeMin, m_visibleXRangeMax); + m_wellLogTrackPlotWidget->replot(); + return; + } double minValue = HUGE_VAL; double maxValue = -HUGE_VAL; diff --git a/ApplicationCode/ProjectDataModel/RimWellLogTrack.h b/ApplicationCode/ProjectDataModel/RimWellLogTrack.h index 0080fe58d0..fb23a715ea 100644 --- a/ApplicationCode/ProjectDataModel/RimWellLogTrack.h +++ b/ApplicationCode/ProjectDataModel/RimWellLogTrack.h @@ -57,8 +57,8 @@ public: void loadDataAndUpdate(); void availableDepthRange(double* minimumDepth, double* maximumDepth); - void zoomAllXAndZoomAllDepthOnOwnerPlot(); - void zoomAllXAxisIfAutoScale(); + void updateXZoomAndParentPlotDepthZoom(); + void updateXZoom(); RiuWellLogTrack* viewer();