mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#2903 Plot Name and Legend Text : Update all plot text when curve changes
This commit is contained in:
parent
f75995e933
commit
4c1bcf9613
@ -365,6 +365,8 @@ void RimEnsembleCurveSet::fieldChangedByUi(const caf::PdmFieldHandle* changedFie
|
|||||||
firstAncestorOrThisOfType(plot);
|
firstAncestorOrThisOfType(plot);
|
||||||
CVF_ASSERT(plot);
|
CVF_ASSERT(plot);
|
||||||
|
|
||||||
|
bool updateTextInPlot = false;
|
||||||
|
|
||||||
if (changedField == &m_showCurves)
|
if (changedField == &m_showCurves)
|
||||||
{
|
{
|
||||||
loadDataAndUpdate(true);
|
loadDataAndUpdate(true);
|
||||||
@ -374,22 +376,27 @@ void RimEnsembleCurveSet::fieldChangedByUi(const caf::PdmFieldHandle* changedFie
|
|||||||
RimSummaryPlot* summaryPlot = nullptr;
|
RimSummaryPlot* summaryPlot = nullptr;
|
||||||
this->firstAncestorOrThisOfTypeAsserted(summaryPlot);
|
this->firstAncestorOrThisOfTypeAsserted(summaryPlot);
|
||||||
summaryPlot->updateConnectedEditors();
|
summaryPlot->updateConnectedEditors();
|
||||||
|
|
||||||
|
updateTextInPlot = true;
|
||||||
}
|
}
|
||||||
else if (changedField == &m_yValuesUiFilterResultSelection)
|
else if (changedField == &m_yValuesUiFilterResultSelection)
|
||||||
{
|
{
|
||||||
m_yValuesCurveVariable->setAddress(m_yValuesUiFilterResultSelection());
|
m_yValuesCurveVariable->setAddress(m_yValuesUiFilterResultSelection());
|
||||||
|
|
||||||
updateAllCurves();
|
updateAllCurves();
|
||||||
|
updateTextInPlot = true;
|
||||||
}
|
}
|
||||||
else if (changedField == &m_yValuesSummaryGroup)
|
else if (changedField == &m_yValuesSummaryGroup)
|
||||||
{
|
{
|
||||||
// Empty address cache
|
// Empty address cache
|
||||||
m_allAddressesCache.clear();
|
m_allAddressesCache.clear();
|
||||||
updateAllCurves();
|
updateAllCurves();
|
||||||
|
updateTextInPlot = true;
|
||||||
}
|
}
|
||||||
else if (changedField == &m_color)
|
else if (changedField == &m_color)
|
||||||
{
|
{
|
||||||
updateCurveColors();
|
updateCurveColors();
|
||||||
|
updateTextInPlot = true;
|
||||||
}
|
}
|
||||||
else if (changedField == &m_ensembleParameter)
|
else if (changedField == &m_ensembleParameter)
|
||||||
{
|
{
|
||||||
@ -413,10 +420,16 @@ void RimEnsembleCurveSet::fieldChangedByUi(const caf::PdmFieldHandle* changedFie
|
|||||||
}
|
}
|
||||||
updateQwtPlotAxis();
|
updateQwtPlotAxis();
|
||||||
plot->updateAxes();
|
plot->updateAxes();
|
||||||
|
updateTextInPlot = true;
|
||||||
}
|
}
|
||||||
else if (changedField == &m_isUsingAutoName && !m_isUsingAutoName)
|
else if (changedField == &m_isUsingAutoName && !m_isUsingAutoName)
|
||||||
{
|
{
|
||||||
m_userDefinedName = createAutoName();
|
if (!m_isUsingAutoName)
|
||||||
|
{
|
||||||
|
m_userDefinedName = createAutoName();
|
||||||
|
}
|
||||||
|
|
||||||
|
updateTextInPlot = true;
|
||||||
}
|
}
|
||||||
else if (changedField == &m_yPushButtonSelectSummaryAddress)
|
else if (changedField == &m_yPushButtonSelectSummaryAddress)
|
||||||
{
|
{
|
||||||
@ -449,12 +462,7 @@ void RimEnsembleCurveSet::fieldChangedByUi(const caf::PdmFieldHandle* changedFie
|
|||||||
m_yPushButtonSelectSummaryAddress = false;
|
m_yPushButtonSelectSummaryAddress = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (updateTextInPlot)
|
||||||
if (changedField == &m_isUsingAutoName ||
|
|
||||||
changedField == &m_userDefinedName ||
|
|
||||||
changedField == &m_showCurves ||
|
|
||||||
changedField == &m_colorMode ||
|
|
||||||
changedField == &m_color)
|
|
||||||
{
|
{
|
||||||
updateEnsembleLegendItem();
|
updateEnsembleLegendItem();
|
||||||
|
|
||||||
@ -462,7 +470,7 @@ void RimEnsembleCurveSet::fieldChangedByUi(const caf::PdmFieldHandle* changedFie
|
|||||||
this->firstAncestorOrThisOfTypeAsserted(summaryPlot);
|
this->firstAncestorOrThisOfTypeAsserted(summaryPlot);
|
||||||
if (summaryPlot->qwtPlot())
|
if (summaryPlot->qwtPlot())
|
||||||
{
|
{
|
||||||
summaryPlot->qwtPlot()->updateLegend();
|
summaryPlot->updatePlotTitle();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user