#2112 Avoid updating legend for each curve. Generalize and roll out the solution found for summary curves

This commit is contained in:
Jacob Støren 2017-11-11 23:15:13 +01:00
parent 9070a97815
commit 324d6d72e3
10 changed files with 34 additions and 26 deletions

View File

@ -134,7 +134,7 @@ QString RimWellFlowRateCurve::createCurveAutoName()
//--------------------------------------------------------------------------------------------------
void RimWellFlowRateCurve::onLoadDataAndUpdate(bool updateParentPlot)
{
RimWellLogCurve::updateCurvePresentation();
this->RimPlotCurve::updateCurvePresentation(updateParentPlot);
if (isCurveVisible())
{

View File

@ -293,7 +293,7 @@ void RimGridTimeHistoryCurve::updateZoomInParentPlot()
//--------------------------------------------------------------------------------------------------
void RimGridTimeHistoryCurve::onLoadDataAndUpdate(bool updateParentPlot)
{
this->RimPlotCurve::updateCurvePresentation();
this->RimPlotCurve::updateCurvePresentation(updateParentPlot);
if (isCurveVisible())
{

View File

@ -210,13 +210,20 @@ void RimPlotCurve::updateCurveVisibility()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimPlotCurve::updateCurvePresentation()
void RimPlotCurve::updateCurvePresentation(bool updatePlotLegend)
{
this->updateCurveVisibility();
this->updateCurveNameAndUpdatePlotLegend();
if (updatePlotLegend)
{
this->updateCurveNameAndUpdatePlotLegend();
}
else
{
this->updateCurveNameNoLegendUpdate();
}
updateCurveAppearance();
// Todo: Rest of the curve setup controlled from this class
}
//--------------------------------------------------------------------------------------------------

View File

@ -106,7 +106,7 @@ protected:
virtual void updateZoomInParentPlot() = 0;
virtual void onLoadDataAndUpdate(bool updateParentPlot) = 0;
void updateCurvePresentation();
void updateCurvePresentation(bool updatePlotLegend);
virtual void updateCurveAppearance();
void updateOptionSensitivity();

View File

@ -291,7 +291,7 @@ void RimWellLogExtractionCurve::fieldChangedByUi(const caf::PdmFieldHandle* chan
//--------------------------------------------------------------------------------------------------
void RimWellLogExtractionCurve::onLoadDataAndUpdate(bool updateParentPlot)
{
RimWellLogCurve::updateCurvePresentation();
this->RimPlotCurve::updateCurvePresentation(updateParentPlot);
if (isCurveVisible())
{

View File

@ -76,7 +76,7 @@ RimWellLogFileCurve::~RimWellLogFileCurve()
//--------------------------------------------------------------------------------------------------
void RimWellLogFileCurve::onLoadDataAndUpdate(bool updateParentPlot)
{
RimWellLogCurve::updateCurvePresentation();
this->RimPlotCurve::updateCurvePresentation(updateParentPlot);
if (isCurveVisible())
{

View File

@ -265,7 +265,7 @@ QString RimWellLogRftCurve::createCurveAutoName()
//--------------------------------------------------------------------------------------------------
void RimWellLogRftCurve::onLoadDataAndUpdate(bool updateParentPlot)
{
RimWellLogCurve::updateCurvePresentation();
this->RimPlotCurve::updateCurvePresentation(updateParentPlot);
m_isUsingPseudoLength = false;
@ -322,8 +322,11 @@ void RimWellLogRftCurve::onLoadDataAndUpdate(bool updateParentPlot)
m_qwtPlotCurve->setLineSegmentStartStopIndices(m_curveData->polylineStartStopIndices());
updateZoomInParentPlot();
if (m_parentQwtPlot) m_parentQwtPlot->replot();
if ( updateParentPlot && m_parentQwtPlot)
{
updateZoomInParentPlot();
m_parentQwtPlot->replot();
}
}
}

View File

@ -449,14 +449,16 @@ void RimWellLogTrack::loadDataAndUpdate()
{
RimWellLogPlot* wellLogPlot;
firstAncestorOrThisOfType(wellLogPlot);
if (wellLogPlot && m_wellLogTrackPlotWidget)
{
m_wellLogTrackPlotWidget->setDepthTitle(wellLogPlot->depthPlotTitle());
m_wellLogTrackPlotWidget->setXTitle(m_xAxisTitle);
}
for (size_t cIdx = 0; cIdx < curves.size(); ++cIdx)
{
curves[cIdx]->loadDataAndUpdate(true);
curves[cIdx]->loadDataAndUpdate(false);
}
if (m_showFormations)
@ -467,8 +469,14 @@ void RimWellLogTrack::loadDataAndUpdate()
{
setFormationFieldsUiReadOnly(true);
}
updateFormationNamesOnPlot();
if ( m_wellLogTrackPlotWidget )
{
m_wellLogTrackPlotWidget->updateLegend();
this->updateAxisScaleEngine();
this->updateFormationNamesOnPlot();
this->updateXZoomAndParentPlotDepthZoom();
}
}
//--------------------------------------------------------------------------------------------------

View File

@ -130,7 +130,7 @@ void RimAsciiDataCurve::updateZoomInParentPlot()
//--------------------------------------------------------------------------------------------------
void RimAsciiDataCurve::onLoadDataAndUpdate(bool updateParentPlot)
{
this->RimPlotCurve::updateCurvePresentation();
this->RimPlotCurve::updateCurvePresentation(updateParentPlot);
if (isCurveVisible())
{

View File

@ -377,17 +377,7 @@ void RimSummaryCurve::updateZoomInParentPlot()
//--------------------------------------------------------------------------------------------------
void RimSummaryCurve::onLoadDataAndUpdate(bool updateParentPlot)
{
this->updateCurveVisibility();
if (updateParentPlot)
{
this->updateCurveNameAndUpdatePlotLegend();
}
else
{
this->updateCurveNameNoLegendUpdate();
}
updateCurveAppearance();
this->RimPlotCurve::updateCurvePresentation(updateParentPlot);
m_selectedVariableDisplayField = QString::fromStdString(m_curveVariable->address().uiText());