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:
@@ -123,7 +123,7 @@ void RimAnalysisPlotCollection::updateSummaryNameHasChanged()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<RimAnalysisPlot*> RimAnalysisPlotCollection::plots() const
|
||||
{
|
||||
return m_analysisPlots.children();
|
||||
return m_analysisPlots.childrenByType();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -164,8 +164,7 @@ void RimAnalysisPlotCollection::applyFirstSummaryCaseCollectionAndFieldAddresses
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimAnalysisPlotCollection::applyAllSummaryCasesAndFieldAddressesToPlot( RimAnalysisPlot* plot, const std::string& quantityName /*= "" */ )
|
||||
{
|
||||
std::vector<RimSummaryCase*> allSummaryCases;
|
||||
RimProject::current()->descendantsOfType( allSummaryCases );
|
||||
std::vector<RimSummaryCase*> allSummaryCases = RimProject::current()->descendantsOfType<RimSummaryCase>();
|
||||
|
||||
if ( !allSummaryCases.empty() )
|
||||
{
|
||||
@@ -223,8 +222,7 @@ void RimAnalysisPlotCollection::applySummaryCaseCollectionAndFieldAddressToPlot(
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimSummaryCaseCollection* RimAnalysisPlotCollection::firstEnsemble() const
|
||||
{
|
||||
std::vector<RimSummaryCaseCollection*> allSummaryCaseCollections;
|
||||
RimProject::current()->descendantsOfType( allSummaryCaseCollections );
|
||||
std::vector<RimSummaryCaseCollection*> allSummaryCaseCollections = RimProject::current()->descendantsOfType<RimSummaryCaseCollection>();
|
||||
for ( auto summaryCaseCollection : allSummaryCaseCollections )
|
||||
{
|
||||
if ( summaryCaseCollection->isEnsemble() ) return summaryCaseCollection;
|
||||
@@ -237,8 +235,7 @@ RimSummaryCaseCollection* RimAnalysisPlotCollection::firstEnsemble() const
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimSummaryCaseCollection* RimAnalysisPlotCollection::firstSummaryCaseCollection() const
|
||||
{
|
||||
std::vector<RimSummaryCaseCollection*> allSummaryCaseCollections;
|
||||
RimProject::current()->descendantsOfType( allSummaryCaseCollections );
|
||||
std::vector<RimSummaryCaseCollection*> allSummaryCaseCollections = RimProject::current()->descendantsOfType<RimSummaryCaseCollection>();
|
||||
|
||||
if ( !allSummaryCaseCollections.empty() ) return allSummaryCaseCollections.front();
|
||||
|
||||
|
||||
@@ -67,7 +67,7 @@ void RimPlotDataFilterCollection::removeFilter( RimPlotDataFilterItem* filter )
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<RimPlotDataFilterItem*> RimPlotDataFilterCollection::filters() const
|
||||
{
|
||||
return m_filters.children();
|
||||
return m_filters.childrenByType();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -270,8 +270,7 @@ void RimPlotDataFilterItem::fieldChangedByUi( const caf::PdmFieldHandle* changed
|
||||
QList<caf::PdmOptionItemInfo> RimPlotDataFilterItem::calculateValueOptions( const caf::PdmFieldHandle* fieldNeedingOptions )
|
||||
{
|
||||
QList<caf::PdmOptionItemInfo> options;
|
||||
RimAnalysisPlot* parentPlot;
|
||||
this->firstAncestorOrThisOfTypeAsserted( parentPlot );
|
||||
auto parentPlot = firstAncestorOrThisOfTypeAsserted<RimAnalysisPlot>();
|
||||
|
||||
if ( fieldNeedingOptions == &m_filterQuantityUiField )
|
||||
{
|
||||
@@ -417,8 +416,7 @@ void RimPlotDataFilterItem::defineEditorAttribute( const caf::PdmFieldHandle* fi
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimPlotDataFilterItem::updateMaxMinAndDefaultValues( bool forceDefault )
|
||||
{
|
||||
RimAnalysisPlot* parentPlot;
|
||||
this->firstAncestorOrThisOfTypeAsserted( parentPlot );
|
||||
auto parentPlot = firstAncestorOrThisOfTypeAsserted<RimAnalysisPlot>();
|
||||
|
||||
if ( m_filterTarget == ENSEMBLE_CASE )
|
||||
{
|
||||
@@ -471,7 +469,6 @@ void RimPlotDataFilterItem::updateMaxMinAndDefaultValues( bool forceDefault )
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RigEnsembleParameter RimPlotDataFilterItem::selectedEnsembleParameter() const
|
||||
{
|
||||
RimAnalysisPlot* parentPlot;
|
||||
this->firstAncestorOrThisOfTypeAsserted( parentPlot );
|
||||
auto parentPlot = firstAncestorOrThisOfTypeAsserted<RimAnalysisPlot>();
|
||||
return parentPlot->ensembleParameter( m_filterEnsembleParameter );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user