#7107 Ensemble curves : Remove obsolete update signals

This commit is contained in:
Magne Sjaastad 2020-12-11 19:21:40 +01:00
parent b5729d538f
commit 3b231a0bb6
4 changed files with 17 additions and 32 deletions

View File

@ -28,10 +28,7 @@ CAF_PDM_SOURCE_INIT( RimCustomObjectiveFunctionCollection, "RimCustomObjectiveFu
///
//--------------------------------------------------------------------------------------------------
RimCustomObjectiveFunctionCollection::RimCustomObjectiveFunctionCollection()
: objectiveFunctionAdded( this )
, objectiveFunctionChanged( this )
, objectiveFunctionAboutToBeDeleted( this )
, objectiveFunctionDeleted( this )
: objectiveFunctionChanged( this )
{
CAF_PDM_InitObject( "Custom Objective Functions", ":/ObjectiveFunctionCollection.svg", "", "" );
@ -45,7 +42,6 @@ RimCustomObjectiveFunction* RimCustomObjectiveFunctionCollection::addObjectiveFu
{
auto newFunction = new RimCustomObjectiveFunction();
m_objectiveFunctions.push_back( newFunction );
objectiveFunctionAdded.send( newFunction );
return newFunction;
}
@ -54,7 +50,7 @@ RimCustomObjectiveFunction* RimCustomObjectiveFunctionCollection::addObjectiveFu
//--------------------------------------------------------------------------------------------------
void RimCustomObjectiveFunctionCollection::onObjectiveFunctionChanged( RimCustomObjectiveFunction* objectiveFunction )
{
objectiveFunctionChanged.send( objectiveFunction );
objectiveFunctionChanged.send();
}
//--------------------------------------------------------------------------------------------------
@ -77,3 +73,12 @@ void RimCustomObjectiveFunctionCollection::defineUiTreeOrdering( caf::PdmUiTreeO
}
uiTreeOrdering.skipRemainingChildren( true );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimCustomObjectiveFunctionCollection::onChildDeleted( caf::PdmChildArrayFieldHandle* childArray,
std::vector<caf::PdmObjectHandle*>& referringObjects )
{
objectiveFunctionChanged.send();
}

View File

@ -35,10 +35,7 @@ class RimCustomObjectiveFunctionCollection : public caf::PdmObject
CAF_PDM_HEADER_INIT;
public:
caf::Signal<RimCustomObjectiveFunction*> objectiveFunctionAdded;
caf::Signal<RimCustomObjectiveFunction*> objectiveFunctionChanged;
caf::Signal<RimCustomObjectiveFunction*> objectiveFunctionAboutToBeDeleted;
caf::Signal<> objectiveFunctionDeleted;
caf::Signal<> objectiveFunctionChanged;
public:
RimCustomObjectiveFunctionCollection();
@ -48,7 +45,9 @@ public:
std::vector<RimCustomObjectiveFunction*> objectiveFunctions() const;
private:
void defineUiTreeOrdering( caf::PdmUiTreeOrdering& uiTreeOrdering, QString uiConfigName /* = "" */ ) override;
void onChildDeleted( caf::PdmChildArrayFieldHandle* childArray,
std::vector<caf::PdmObjectHandle*>& referringObjects ) override;
void defineUiTreeOrdering( caf::PdmUiTreeOrdering& uiTreeOrdering, QString uiConfigName ) override;
private:
caf::PdmChildArrayField<RimCustomObjectiveFunction*> m_objectiveFunctions;

View File

@ -198,8 +198,6 @@ RimEnsembleCurveSet::RimEnsembleCurveSet()
"" );
m_customObjectiveFunctions = new RimCustomObjectiveFunctionCollection();
m_customObjectiveFunctions->objectiveFunctionChanged.connect( this, &RimEnsembleCurveSet::onObjectiveFunctionChanged );
m_customObjectiveFunctions->objectiveFunctionAboutToBeDeleted
.connect( this, &RimEnsembleCurveSet::onObjectiveFunctionAboutToBeDeleted );
CAF_PDM_InitFieldNoDefault( &m_statistics, "Statistics", "Statistics", "", "", "" );
m_statistics = new RimEnsembleStatistics();
@ -914,27 +912,12 @@ void RimEnsembleCurveSet::updateMaxMinAndDefaultValues()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimEnsembleCurveSet::onObjectiveFunctionChanged( const caf::SignalEmitter* emitter,
RimCustomObjectiveFunction* objectiveFunction )
void RimEnsembleCurveSet::onObjectiveFunctionChanged( const caf::SignalEmitter* emitter )
{
updateCurveColors();
updateFilterLegend();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimEnsembleCurveSet::onObjectiveFunctionAboutToBeDeleted( const caf::SignalEmitter* emitter,
RimCustomObjectiveFunction* objectiveFunction )
{
if ( objectiveFunction == m_customObjectiveFunction )
{
m_customObjectiveFunction = nullptr;
}
updateCurveColors();
updateFilterLegend();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------

View File

@ -183,9 +183,7 @@ private:
void updateTimeAnnotations();
void updateAddressesUiField();
void onObjectiveFunctionChanged( const caf::SignalEmitter* emitter, RimCustomObjectiveFunction* objectiveFunction );
void onObjectiveFunctionAboutToBeDeleted( const caf::SignalEmitter* emitter,
RimCustomObjectiveFunction* objectiveFunction );
void onObjectiveFunctionChanged( const caf::SignalEmitter* emitter );
private:
caf::PdmField<bool> m_showCurves;