#2045 Curve Creator : Clear last curve selection when creating a new plot

This commit is contained in:
Magne Sjaastad
2017-10-27 09:01:49 +02:00
parent 0be241eb59
commit 1fb6d87c82

View File

@@ -125,7 +125,7 @@ RimSummaryPlot* RicSummaryCurveCreator::previewPlot() const
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
void RicSummaryCurveCreator::updateFromSummaryPlot(RimSummaryPlot* targetPlot) void RicSummaryCurveCreator::updateFromSummaryPlot(RimSummaryPlot* targetPlot)
{ {
if (m_targetPlot != targetPlot) if (targetPlot == nullptr || m_targetPlot != targetPlot)
{ {
resetAllFields(); resetAllFields();
} }
@@ -136,9 +136,10 @@ void RicSummaryCurveCreator::updateFromSummaryPlot(RimSummaryPlot* targetPlot)
if (m_targetPlot) if (m_targetPlot)
{ {
populateCurveCreator(*m_targetPlot); populateCurveCreator(*m_targetPlot);
syncPreviewCurvesFromUiSelection();
} }
syncPreviewCurvesFromUiSelection();
caf::PdmUiItem::updateConnectedEditors(); caf::PdmUiItem::updateConnectedEditors();
} }
@@ -548,6 +549,9 @@ void RicSummaryCurveCreator::copyCurveAndAddToPlot(const RimSummaryCurve *curve,
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
void RicSummaryCurveCreator::resetAllFields() void RicSummaryCurveCreator::resetAllFields()
{ {
std::vector<RiaSummaryCurveDefinition> curveDefinitions;
m_summaryCurveSelectionEditor->summaryAddressSelection()->setSelectedCurveDefinitions(curveDefinitions);
m_previewPlot->deleteAllSummaryCurves(); m_previewPlot->deleteAllSummaryCurves();
m_targetPlot = nullptr; m_targetPlot = nullptr;
} }