#836 Fixed missing/wrong zoom update for well log plots when opening project.

Refactored the zoom update method names
This commit is contained in:
Jacob Støren 2016-09-13 09:59:34 +02:00
parent 2ea167337f
commit 9041e4a582
14 changed files with 41 additions and 23 deletions

View File

@ -132,7 +132,7 @@ void RicDeleteItemExec::redo()
parentObj->firstAnchestorOrThisOfType(wellLogPlotTrack);
if (wellLogPlotTrack)
{
wellLogPlotTrack->zoomAllXAxisIfAutoScale();
wellLogPlotTrack->updateXZoom();
}
// Update due to delete plots

View File

@ -70,11 +70,11 @@ void RicWellLogPlotTrackFeatureImpl::moveCurvesToWellLogPlotTrack(RimWellLogTrac
for (std::set<RimWellLogTrack*>::iterator tIt = srcTracks.begin(); tIt != srcTracks.end(); ++tIt)
{
(*tIt)->zoomAllXAndZoomAllDepthOnOwnerPlot();
(*tIt)->updateXZoomAndParentPlotDepthZoom();
}
destTrack->loadDataAndUpdate();
destTrack->zoomAllXAndZoomAllDepthOnOwnerPlot();
destTrack->updateXZoomAndParentPlotDepthZoom();
destTrack->updateConnectedEditors();
}

View File

@ -164,7 +164,7 @@ void RimPlotCurve::updateCurveVisibility()
m_qwtPlotCurve->detach();
}
zoomAllParentPlot();
updateZoomInParentPlot();
}
//--------------------------------------------------------------------------------------------------

View File

@ -80,7 +80,7 @@ public:
protected:
virtual QString createCurveAutoName() = 0;
virtual void zoomAllParentPlot() = 0;
virtual void updateZoomInParentPlot() = 0;
virtual void onLoadDataAndUpdate() = 0;
void updateCurvePresentation();

View File

@ -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<QDateTime>(), std::vector<double>());
}
zoomAllParentPlot();
updateZoomInParentPlot();
if (m_parentQwtPlot) m_parentQwtPlot->replot();
}

View File

@ -83,7 +83,7 @@ protected:
// RimPlotCurve overrides
virtual QString createCurveAutoName() override;
virtual void zoomAllParentPlot() override;
virtual void updateZoomInParentPlot() override;
virtual void onLoadDataAndUpdate() override;
private:

View File

@ -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]);

View File

@ -52,6 +52,9 @@ public:
RimSummaryCurve* findRimCurveFromQwtCurve(const QwtPlotCurve* curve) const;
void loadDataAndUpdate();
void updateZoom();
void handleViewerDeletion();
void updateYAxisUnit();
void updateCaseNameHasChanged();

View File

@ -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();
}
}

View File

@ -47,7 +47,7 @@ public:
virtual QString wellDate() const { return ""; };
protected:
virtual void zoomAllParentPlot();
virtual void updateZoomInParentPlot();
cvf::ref<RigWellLogCurveData> m_curveData;
};

View File

@ -285,7 +285,7 @@ void RimWellLogExtractionCurve::onLoadDataAndUpdate()
m_qwtPlotCurve->setLineSegmentStartStopIndices(m_curveData->polylineStartStopIndices());
zoomAllParentPlot();
updateZoomInParentPlot();
setLogScaleFromSelectedResult();

View File

@ -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->setLineSegmentStartStopIndices(m_curveData->polylineStartStopIndices());
zoomAllParentPlot();
updateZoomInParentPlot();
if (m_parentQwtPlot) m_parentQwtPlot->replot();
}

View File

@ -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;

View File

@ -57,8 +57,8 @@ public:
void loadDataAndUpdate();
void availableDepthRange(double* minimumDepth, double* maximumDepth);
void zoomAllXAndZoomAllDepthOnOwnerPlot();
void zoomAllXAxisIfAutoScale();
void updateXZoomAndParentPlotDepthZoom();
void updateXZoom();
RiuWellLogTrack* viewer();