mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Fix crashes when dropping analysis plots into Multiplots
This commit is contained in:
committed by
Magne Sjaastad
parent
ab3e43d8fb
commit
93baf776a1
@@ -135,7 +135,6 @@ private:
|
||||
void detachAllCurves() override;
|
||||
|
||||
void reattachAllCurves() override {}
|
||||
void doRemoveFromCollection() override {}
|
||||
void updateAxes() override;
|
||||
void onAxisSelected( int axis, bool toggle ) override;
|
||||
void updateZoomInQwt() override {}
|
||||
@@ -176,7 +175,7 @@ private:
|
||||
void buildTestPlot( RiuGroupedBarChartBuilder& chartBuilder );
|
||||
|
||||
int barTextFontSize() const;
|
||||
void initAfterRead();
|
||||
void initAfterRead() override;
|
||||
|
||||
private:
|
||||
void onCaseRemoved( const SignalEmitter* emitter, RimSummaryCase* summaryCase );
|
||||
|
||||
@@ -53,7 +53,7 @@ RimAnalysisPlot* RimAnalysisPlotCollection::createAnalysisPlot()
|
||||
applyFirstEnsembleFieldAddressesToPlot( plot, "FOPT" );
|
||||
|
||||
// plot->enableAutoPlotTitle( true );
|
||||
m_analysisPlots.push_back( plot );
|
||||
addPlot( plot );
|
||||
|
||||
plot->loadDataAndUpdate();
|
||||
|
||||
@@ -79,7 +79,7 @@ RimAnalysisPlot* RimAnalysisPlotCollection::createAnalysisPlot( RimSummaryCaseCo
|
||||
applyEnsembleFieldAndTimeStepToPlot( plot, ensemble, quantityName.toStdString(), timeStep );
|
||||
|
||||
// plot->enableAutoPlotTitle( true );
|
||||
m_analysisPlots.push_back( plot );
|
||||
addPlot( plot );
|
||||
|
||||
plot->loadDataAndUpdate();
|
||||
|
||||
@@ -106,15 +106,7 @@ void RimAnalysisPlotCollection::updateSummaryNameHasChanged()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimAnalysisPlotCollection::removeSummaryPlot( RimAnalysisPlot* analysisPlot )
|
||||
{
|
||||
m_analysisPlots.removeChildObject( analysisPlot );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<RimAnalysisPlot*> RimAnalysisPlotCollection::plots()
|
||||
std::vector<RimAnalysisPlot*> RimAnalysisPlotCollection::plots() const
|
||||
{
|
||||
return m_analysisPlots.childObjects();
|
||||
}
|
||||
@@ -122,9 +114,9 @@ std::vector<RimAnalysisPlot*> RimAnalysisPlotCollection::plots()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimAnalysisPlotCollection::deleteAllChildObjects()
|
||||
size_t RimAnalysisPlotCollection::plotCount() const
|
||||
{
|
||||
m_analysisPlots.deleteAllChildObjects();
|
||||
return m_analysisPlots.size();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -156,6 +148,9 @@ void RimAnalysisPlotCollection::applyFirstEnsembleFieldAddressesToPlot( RimAnaly
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimAnalysisPlotCollection::applyEnsembleFieldAndTimeStepToPlot( RimAnalysisPlot* plot,
|
||||
RimSummaryCaseCollection* ensemble,
|
||||
const std::string& quantityName,
|
||||
@@ -182,3 +177,19 @@ void RimAnalysisPlotCollection::applyEnsembleFieldAndTimeStepToPlot( RimAnalysis
|
||||
plot->setTimeSteps( {timeStep} );
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimAnalysisPlotCollection::insertPlot( RimAnalysisPlot* analysisPlot, size_t index )
|
||||
{
|
||||
m_analysisPlots.insert( index, analysisPlot );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimAnalysisPlotCollection::removePlot( RimAnalysisPlot* analysisPlot )
|
||||
{
|
||||
m_analysisPlots.removeChildObject( analysisPlot );
|
||||
}
|
||||
|
||||
@@ -18,19 +18,21 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "RimAbstractPlotCollection.h"
|
||||
#include "RimAnalysisPlot.h"
|
||||
|
||||
#include "cafPdmChildArrayField.h"
|
||||
#include "cafPdmObject.h"
|
||||
|
||||
#include <ctime>
|
||||
|
||||
class RimAnalysisPlot;
|
||||
class RimSummaryCaseCollection;
|
||||
|
||||
//==================================================================================================
|
||||
///
|
||||
///
|
||||
//==================================================================================================
|
||||
class RimAnalysisPlotCollection : public caf::PdmObject
|
||||
class RimAnalysisPlotCollection : public caf::PdmObject, public RimTypedPlotCollection<RimAnalysisPlot>
|
||||
{
|
||||
CAF_PDM_HEADER_INIT;
|
||||
|
||||
@@ -43,11 +45,11 @@ public:
|
||||
createAnalysisPlot( RimSummaryCaseCollection* ensemble, const QString& quantityName, std::time_t timeStep );
|
||||
|
||||
void updateSummaryNameHasChanged();
|
||||
void removeSummaryPlot( RimAnalysisPlot* analysisPlot );
|
||||
|
||||
std::vector<RimAnalysisPlot*> plots();
|
||||
|
||||
void deleteAllChildObjects();
|
||||
std::vector<RimAnalysisPlot*> plots() const final;
|
||||
size_t plotCount() const final;
|
||||
void insertPlot( RimAnalysisPlot* analysisPlot, size_t index ) final;
|
||||
void removePlot( RimAnalysisPlot* analysisPlot ) final;
|
||||
|
||||
private:
|
||||
void applyFirstEnsembleFieldAddressesToPlot( RimAnalysisPlot* plot, const std::string& quantityName = "" );
|
||||
|
||||
Reference in New Issue
Block a user