mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#836 Fixed missing/wrong zoom update for well log plots when opening project.
Refactored the zoom update method names
This commit is contained in:
parent
2ea167337f
commit
9041e4a582
@ -132,7 +132,7 @@ void RicDeleteItemExec::redo()
|
|||||||
parentObj->firstAnchestorOrThisOfType(wellLogPlotTrack);
|
parentObj->firstAnchestorOrThisOfType(wellLogPlotTrack);
|
||||||
if (wellLogPlotTrack)
|
if (wellLogPlotTrack)
|
||||||
{
|
{
|
||||||
wellLogPlotTrack->zoomAllXAxisIfAutoScale();
|
wellLogPlotTrack->updateXZoom();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update due to delete plots
|
// Update due to delete plots
|
||||||
|
@ -70,11 +70,11 @@ void RicWellLogPlotTrackFeatureImpl::moveCurvesToWellLogPlotTrack(RimWellLogTrac
|
|||||||
|
|
||||||
for (std::set<RimWellLogTrack*>::iterator tIt = srcTracks.begin(); tIt != srcTracks.end(); ++tIt)
|
for (std::set<RimWellLogTrack*>::iterator tIt = srcTracks.begin(); tIt != srcTracks.end(); ++tIt)
|
||||||
{
|
{
|
||||||
(*tIt)->zoomAllXAndZoomAllDepthOnOwnerPlot();
|
(*tIt)->updateXZoomAndParentPlotDepthZoom();
|
||||||
}
|
}
|
||||||
|
|
||||||
destTrack->loadDataAndUpdate();
|
destTrack->loadDataAndUpdate();
|
||||||
destTrack->zoomAllXAndZoomAllDepthOnOwnerPlot();
|
destTrack->updateXZoomAndParentPlotDepthZoom();
|
||||||
destTrack->updateConnectedEditors();
|
destTrack->updateConnectedEditors();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -164,7 +164,7 @@ void RimPlotCurve::updateCurveVisibility()
|
|||||||
m_qwtPlotCurve->detach();
|
m_qwtPlotCurve->detach();
|
||||||
}
|
}
|
||||||
|
|
||||||
zoomAllParentPlot();
|
updateZoomInParentPlot();
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
@ -80,7 +80,7 @@ public:
|
|||||||
protected:
|
protected:
|
||||||
|
|
||||||
virtual QString createCurveAutoName() = 0;
|
virtual QString createCurveAutoName() = 0;
|
||||||
virtual void zoomAllParentPlot() = 0;
|
virtual void updateZoomInParentPlot() = 0;
|
||||||
virtual void onLoadDataAndUpdate() = 0;
|
virtual void onLoadDataAndUpdate() = 0;
|
||||||
|
|
||||||
void updateCurvePresentation();
|
void updateCurvePresentation();
|
||||||
|
@ -318,12 +318,12 @@ QString RimSummaryCurve::createCurveAutoName()
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RimSummaryCurve::zoomAllParentPlot()
|
void RimSummaryCurve::updateZoomInParentPlot()
|
||||||
{
|
{
|
||||||
RimSummaryPlot* plot = nullptr;
|
RimSummaryPlot* plot = nullptr;
|
||||||
firstAnchestorOrThisOfType(plot);
|
firstAnchestorOrThisOfType(plot);
|
||||||
|
|
||||||
plot->zoomAll();
|
plot->updateZoom();
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@ -349,7 +349,7 @@ void RimSummaryCurve::onLoadDataAndUpdate()
|
|||||||
m_qwtPlotCurve->setSamplesFromDateAndValues(std::vector<QDateTime>(), std::vector<double>());
|
m_qwtPlotCurve->setSamplesFromDateAndValues(std::vector<QDateTime>(), std::vector<double>());
|
||||||
}
|
}
|
||||||
|
|
||||||
zoomAllParentPlot();
|
updateZoomInParentPlot();
|
||||||
|
|
||||||
if (m_parentQwtPlot) m_parentQwtPlot->replot();
|
if (m_parentQwtPlot) m_parentQwtPlot->replot();
|
||||||
}
|
}
|
||||||
|
@ -83,7 +83,7 @@ protected:
|
|||||||
// RimPlotCurve overrides
|
// RimPlotCurve overrides
|
||||||
|
|
||||||
virtual QString createCurveAutoName() override;
|
virtual QString createCurveAutoName() override;
|
||||||
virtual void zoomAllParentPlot() override;
|
virtual void updateZoomInParentPlot() override;
|
||||||
virtual void onLoadDataAndUpdate() override;
|
virtual void onLoadDataAndUpdate() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -296,7 +296,17 @@ void RimSummaryPlot::loadDataAndUpdate()
|
|||||||
|
|
||||||
this->updateYAxisUnit();
|
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]);
|
QRectF visibleWindow(m_visibleWindow()[0], m_visibleWindow()[1], m_visibleWindow()[2], m_visibleWindow()[3]);
|
||||||
|
|
||||||
|
@ -52,6 +52,9 @@ public:
|
|||||||
RimSummaryCurve* findRimCurveFromQwtCurve(const QwtPlotCurve* curve) const;
|
RimSummaryCurve* findRimCurveFromQwtCurve(const QwtPlotCurve* curve) const;
|
||||||
|
|
||||||
void loadDataAndUpdate();
|
void loadDataAndUpdate();
|
||||||
|
|
||||||
|
void updateZoom();
|
||||||
|
|
||||||
void handleViewerDeletion();
|
void handleViewerDeletion();
|
||||||
void updateYAxisUnit();
|
void updateYAxisUnit();
|
||||||
void updateCaseNameHasChanged();
|
void updateCaseNameHasChanged();
|
||||||
|
@ -106,7 +106,7 @@ bool RimWellLogCurve::valueRange(double* minimumValue, double* maximumValue) con
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RimWellLogCurve::zoomAllParentPlot()
|
void RimWellLogCurve::updateZoomInParentPlot()
|
||||||
{
|
{
|
||||||
RimWellLogPlot* wellLogPlot;
|
RimWellLogPlot* wellLogPlot;
|
||||||
firstAnchestorOrThisOfType(wellLogPlot);
|
firstAnchestorOrThisOfType(wellLogPlot);
|
||||||
@ -120,7 +120,7 @@ void RimWellLogCurve::zoomAllParentPlot()
|
|||||||
firstAnchestorOrThisOfType(plotTrack);
|
firstAnchestorOrThisOfType(plotTrack);
|
||||||
if (plotTrack)
|
if (plotTrack)
|
||||||
{
|
{
|
||||||
plotTrack->zoomAllXAndZoomAllDepthOnOwnerPlot();
|
plotTrack->updateXZoomAndParentPlotDepthZoom();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -47,7 +47,7 @@ public:
|
|||||||
virtual QString wellDate() const { return ""; };
|
virtual QString wellDate() const { return ""; };
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual void zoomAllParentPlot();
|
virtual void updateZoomInParentPlot();
|
||||||
|
|
||||||
cvf::ref<RigWellLogCurveData> m_curveData;
|
cvf::ref<RigWellLogCurveData> m_curveData;
|
||||||
};
|
};
|
||||||
|
@ -285,7 +285,7 @@ void RimWellLogExtractionCurve::onLoadDataAndUpdate()
|
|||||||
|
|
||||||
m_qwtPlotCurve->setLineSegmentStartStopIndices(m_curveData->polylineStartStopIndices());
|
m_qwtPlotCurve->setLineSegmentStartStopIndices(m_curveData->polylineStartStopIndices());
|
||||||
|
|
||||||
zoomAllParentPlot();
|
updateZoomInParentPlot();
|
||||||
|
|
||||||
setLogScaleFromSelectedResult();
|
setLogScaleFromSelectedResult();
|
||||||
|
|
||||||
|
@ -123,7 +123,7 @@ void RimWellLogFileCurve::onLoadDataAndUpdate()
|
|||||||
m_qwtPlotCurve->setSamples(m_curveData->xPlotValues().data(), m_curveData->measuredDepthPlotValues(displayUnit).data(), static_cast<int>(m_curveData->xPlotValues().size()));
|
m_qwtPlotCurve->setSamples(m_curveData->xPlotValues().data(), m_curveData->measuredDepthPlotValues(displayUnit).data(), static_cast<int>(m_curveData->xPlotValues().size()));
|
||||||
m_qwtPlotCurve->setLineSegmentStartStopIndices(m_curveData->polylineStartStopIndices());
|
m_qwtPlotCurve->setLineSegmentStartStopIndices(m_curveData->polylineStartStopIndices());
|
||||||
|
|
||||||
zoomAllParentPlot();
|
updateZoomInParentPlot();
|
||||||
|
|
||||||
if (m_parentQwtPlot) m_parentQwtPlot->replot();
|
if (m_parentQwtPlot) m_parentQwtPlot->replot();
|
||||||
}
|
}
|
||||||
|
@ -114,7 +114,7 @@ void RimWellLogTrack::fieldChangedByUi(const caf::PdmFieldHandle* changedField,
|
|||||||
{
|
{
|
||||||
if (m_isAutoScaleXEnabled())
|
if (m_isAutoScaleXEnabled())
|
||||||
{
|
{
|
||||||
this->zoomAllXAxisIfAutoScale();
|
this->updateXZoom();
|
||||||
computeAndSetXRangeMinForLogarithmicScale();
|
computeAndSetXRangeMinForLogarithmicScale();
|
||||||
|
|
||||||
if (m_wellLogTrackPlotWidget) m_wellLogTrackPlotWidget->replot();
|
if (m_wellLogTrackPlotWidget) m_wellLogTrackPlotWidget->replot();
|
||||||
@ -124,7 +124,7 @@ void RimWellLogTrack::fieldChangedByUi(const caf::PdmFieldHandle* changedField,
|
|||||||
{
|
{
|
||||||
updateAxisScaleEngine();
|
updateAxisScaleEngine();
|
||||||
|
|
||||||
this->zoomAllXAxisIfAutoScale();
|
this->updateXZoom();
|
||||||
computeAndSetXRangeMinForLogarithmicScale();
|
computeAndSetXRangeMinForLogarithmicScale();
|
||||||
|
|
||||||
m_wellLogTrackPlotWidget->setXRange(m_visibleXRangeMin, m_visibleXRangeMax);
|
m_wellLogTrackPlotWidget->setXRange(m_visibleXRangeMin, m_visibleXRangeMax);
|
||||||
@ -282,7 +282,7 @@ void RimWellLogTrack::detachAllCurves()
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RimWellLogTrack::zoomAllXAndZoomAllDepthOnOwnerPlot()
|
void RimWellLogTrack::updateXZoomAndParentPlotDepthZoom()
|
||||||
{
|
{
|
||||||
if (m_wellLogTrackPlotWidget)
|
if (m_wellLogTrackPlotWidget)
|
||||||
{
|
{
|
||||||
@ -293,7 +293,7 @@ void RimWellLogTrack::zoomAllXAndZoomAllDepthOnOwnerPlot()
|
|||||||
wellLogPlot->updateDepthZoom();
|
wellLogPlot->updateDepthZoom();
|
||||||
}
|
}
|
||||||
|
|
||||||
zoomAllXAxisIfAutoScale();
|
updateXZoom();
|
||||||
|
|
||||||
m_wellLogTrackPlotWidget->replot();
|
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 minValue = HUGE_VAL;
|
||||||
double maxValue = -HUGE_VAL;
|
double maxValue = -HUGE_VAL;
|
||||||
|
@ -57,8 +57,8 @@ public:
|
|||||||
void loadDataAndUpdate();
|
void loadDataAndUpdate();
|
||||||
|
|
||||||
void availableDepthRange(double* minimumDepth, double* maximumDepth);
|
void availableDepthRange(double* minimumDepth, double* maximumDepth);
|
||||||
void zoomAllXAndZoomAllDepthOnOwnerPlot();
|
void updateXZoomAndParentPlotDepthZoom();
|
||||||
void zoomAllXAxisIfAutoScale();
|
void updateXZoom();
|
||||||
|
|
||||||
RiuWellLogTrack* viewer();
|
RiuWellLogTrack* viewer();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user