#2903 Plot Name and Legend Text : Add updateAllTextInPlot

This commit is contained in:
Magne Sjaastad 2018-05-11 19:44:01 +02:00
parent 4c1bcf9613
commit 4bd7b1eeb6
3 changed files with 24 additions and 9 deletions

View File

@ -422,7 +422,7 @@ void RimEnsembleCurveSet::fieldChangedByUi(const caf::PdmFieldHandle* changedFie
plot->updateAxes();
updateTextInPlot = true;
}
else if (changedField == &m_isUsingAutoName && !m_isUsingAutoName)
else if (changedField == &m_isUsingAutoName)
{
if (!m_isUsingAutoName)
{
@ -431,6 +431,10 @@ void RimEnsembleCurveSet::fieldChangedByUi(const caf::PdmFieldHandle* changedFie
updateTextInPlot = true;
}
else if (changedField == &m_userDefinedName)
{
updateTextInPlot = true;
}
else if (changedField == &m_yPushButtonSelectSummaryAddress)
{
RiuSummaryCurveDefSelectionDialog dlg(nullptr);
@ -464,14 +468,7 @@ void RimEnsembleCurveSet::fieldChangedByUi(const caf::PdmFieldHandle* changedFie
if (updateTextInPlot)
{
updateEnsembleLegendItem();
RimSummaryPlot* summaryPlot = nullptr;
this->firstAncestorOrThisOfTypeAsserted(summaryPlot);
if (summaryPlot->qwtPlot())
{
summaryPlot->updatePlotTitle();
}
updateAllTextInPlot();
}
}
@ -883,6 +880,21 @@ void RimEnsembleCurveSet::showCurves(bool show)
m_showCurves = show;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimEnsembleCurveSet::updateAllTextInPlot()
{
updateEnsembleLegendItem();
RimSummaryPlot* summaryPlot = nullptr;
this->firstAncestorOrThisOfTypeAsserted(summaryPlot);
if (summaryPlot->qwtPlot())
{
summaryPlot->updatePlotTitle();
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------

View File

@ -93,6 +93,8 @@ public:
RimEnsembleCurveSet* clone() const;
void showCurves(bool show);
void updateAllTextInPlot();
private:
caf::PdmFieldHandle* userDescriptionField() override;
caf::PdmFieldHandle* objectToggleField();

View File

@ -362,6 +362,7 @@ void RimSummaryCurveAutoName::fieldChangedByUi(const caf::PdmFieldHandle* change
auto ensembleCurveSet = dynamic_cast<RimEnsembleCurveSet*>(this->parentField()->ownerObject());
if (ensembleCurveSet)
{
ensembleCurveSet->updateAllTextInPlot();
ensembleCurveSet->updateConnectedEditors();
return;