Files
ResInsight/ApplicationLibCode/ProjectDataModel/RimSummaryCalculationCollection.h
T
Magne Sjaastad 135ed69369 #14559 Summary Calculator: Update dependent data when the last calculation is deleted
deleteCalculation() removes the calculation before rebuildCaseMetaData() is called, and updateDataDependingOnCalculations() returned early for an empty collection. The addresses created by the last calculation were then left behind in the readers until the next refresh or a reload of the project.

Perform one more update after the last calculation is deleted, and keep the early return for the case where no calculations have been present.
2026-08-21 15:54:28 +02:00

51 lines
1.6 KiB
C++

/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2017 Statoil ASA
//
// ResInsight is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE.
//
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
#pragma once
#include "RimSummaryCalculation.h"
#include "RimUserDefinedCalculationCollection.h"
#include "cafPdmObject.h"
class RimSummaryCase;
class RimCalculatedSummaryCase;
//==================================================================================================
///
///
//==================================================================================================
class RimSummaryCalculationCollection : public RimUserDefinedCalculationCollection
{
CAF_PDM_HEADER_INIT;
public:
RimSummaryCalculationCollection();
void rebuildCaseMetaData() override;
RimSummaryCalculation* createCalculation() const override;
private:
void updateDataDependingOnCalculations();
private:
// True if the last update was performed with calculations present. Used to detect deletion of the last calculation.
bool m_hasDataFromCalculations = false;
};