mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Change API for PdmObjectHandle and PdmFieldHandle
* Refactor interface to PdmObjectHandle and PdmFieldHandle Return objects instead of passing in structures as parameters * Add nodiscard to several functions * Remove redundant this-> * Rename to ptrReferencedObjectsByType
This commit is contained in:
@@ -115,8 +115,7 @@ void RimSummaryCurveCollection::loadDataAndUpdate( bool updateParentPlot )
|
||||
|
||||
if ( updateParentPlot )
|
||||
{
|
||||
RimSummaryPlot* parentPlot;
|
||||
firstAncestorOrThisOfTypeAsserted( parentPlot );
|
||||
auto parentPlot = firstAncestorOrThisOfTypeAsserted<RimSummaryPlot>();
|
||||
parentPlot->updateAll();
|
||||
}
|
||||
}
|
||||
@@ -133,8 +132,7 @@ void RimSummaryCurveCollection::onChildrenUpdated( caf::PdmChildArrayFieldHandle
|
||||
curve->updateCurveAppearance();
|
||||
}
|
||||
|
||||
RimSummaryPlot* parentPlot;
|
||||
firstAncestorOrThisOfTypeAsserted( parentPlot );
|
||||
auto parentPlot = firstAncestorOrThisOfTypeAsserted<RimSummaryPlot>();
|
||||
parentPlot->plotWidget()->scheduleReplot();
|
||||
}
|
||||
}
|
||||
@@ -252,7 +250,7 @@ void RimSummaryCurveCollection::removeCurve( RimSummaryCurve* curve )
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<RimSummaryCurve*> RimSummaryCurveCollection::curves() const
|
||||
{
|
||||
return m_curves.children();
|
||||
return m_curves.childrenByType();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -362,8 +360,7 @@ void RimSummaryCurveCollection::updateCaseNameHasChanged()
|
||||
curve->updateConnectedEditors();
|
||||
}
|
||||
|
||||
RimSummaryPlot* parentPlot;
|
||||
firstAncestorOrThisOfTypeAsserted( parentPlot );
|
||||
auto parentPlot = firstAncestorOrThisOfTypeAsserted<RimSummaryPlot>();
|
||||
|
||||
parentPlot->updatePlotTitle();
|
||||
if ( parentPlot->plotWidget() ) parentPlot->plotWidget()->updateLegend();
|
||||
@@ -384,9 +381,7 @@ void RimSummaryCurveCollection::setCurrentSummaryCurve( RimSummaryCurve* curve )
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<caf::PdmFieldHandle*> RimSummaryCurveCollection::fieldsToShowInToolbar()
|
||||
{
|
||||
RimSummaryCrossPlot* parentCrossPlot;
|
||||
firstAncestorOrThisOfType( parentCrossPlot );
|
||||
|
||||
auto parentCrossPlot = firstAncestorOrThisOfType<RimSummaryCrossPlot>();
|
||||
if ( parentCrossPlot )
|
||||
{
|
||||
return m_unionSourceStepping->fieldsToShowInToolbar();
|
||||
@@ -463,8 +458,7 @@ void RimSummaryCurveCollection::fieldChangedByUi( const caf::PdmFieldHandle* cha
|
||||
}
|
||||
else if ( changedField == &m_editPlot )
|
||||
{
|
||||
RimSummaryPlot* plot = nullptr;
|
||||
this->firstAncestorOrThisOfType( plot );
|
||||
auto plot = firstAncestorOrThisOfType<RimSummaryPlot>();
|
||||
if ( plot )
|
||||
{
|
||||
RicEditSummaryPlotFeature::editSummaryPlot( plot );
|
||||
|
||||
Reference in New Issue
Block a user