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:
Magne Sjaastad
2023-05-12 21:41:34 +02:00
committed by GitHub
parent 37e29a0f68
commit 0c90f67dcc
510 changed files with 1651 additions and 3111 deletions

View File

@@ -178,7 +178,7 @@ RimCase* Rim2dIntersectionView::ownerCase() const
if ( !rimCase )
{
this->firstAncestorOrThisOfTypeAsserted( rimCase );
rimCase = firstAncestorOrThisOfTypeAsserted<RimCase>();
}
return rimCase;
@@ -198,8 +198,7 @@ bool Rim2dIntersectionView::isTimeStepDependentDataVisible() const
}
else
{
RimGridView* gridView = nullptr;
m_intersection->firstAncestorOrThisOfTypeAsserted( gridView );
RimGridView* gridView = m_intersection->firstAncestorOrThisOfTypeAsserted<RimGridView>();
return gridView->isTimeStepDependentDataVisibleInThisOrComparisonView();
}
}
@@ -221,10 +220,8 @@ void Rim2dIntersectionView::update3dInfo()
RimEclipseResultDefinition* eclResDef = nullptr;
{
RimEclipseView* originEclView = nullptr;
m_intersection->firstAncestorOrThisOfType( originEclView );
RimGeoMechView* originGeoView = nullptr;
m_intersection->firstAncestorOrThisOfType( originGeoView );
RimEclipseView* originEclView = m_intersection->firstAncestorOrThisOfType<RimEclipseView>();
RimGeoMechView* originGeoView = m_intersection->firstAncestorOrThisOfType<RimGeoMechView>();
if ( originEclView )
{
@@ -350,8 +347,7 @@ void Rim2dIntersectionView::updateName()
{
if ( m_intersection )
{
Rim3dView* parentView = nullptr;
m_intersection->firstAncestorOrThisOfTypeAsserted( parentView );
Rim3dView* parentView = m_intersection->firstAncestorOrThisOfTypeAsserted<Rim3dView>();
this->setName( parentView->name() + ": " + m_intersection->name() );
}
}
@@ -453,15 +449,13 @@ bool Rim2dIntersectionView::hasResults()
}
}
RimEclipseView* eclView = nullptr;
m_intersection->firstAncestorOrThisOfType( eclView );
RimEclipseView* eclView = m_intersection->firstAncestorOrThisOfType<RimEclipseView>();
if ( eclView )
{
return ( eclView->cellResult()->hasResult() || eclView->cellResult()->isTernarySaturationSelected() );
}
RimGeoMechView* geoView = nullptr;
m_intersection->firstAncestorOrThisOfType( geoView );
RimGeoMechView* geoView = m_intersection->firstAncestorOrThisOfType<RimGeoMechView>();
if ( geoView )
{
return geoView->cellResult()->hasResult();
@@ -556,21 +550,14 @@ void Rim2dIntersectionView::onCreateDisplayModel()
if ( m_intersection->type() == RimExtrudedCurveIntersection::CrossSectionEnum::CS_SIMULATION_WELL && m_intersection->simulationWell() )
{
RimEclipseView* eclipseView = nullptr;
m_intersection->firstAncestorOrThisOfType( eclipseView );
// if ( eclipseView ) Do we need this ?
{
m_flatSimWellPipePartMgr = new RivSimWellPipesPartMgr( m_intersection->simulationWell() );
m_flatWellHeadPartMgr = new RivWellHeadPartMgr( m_intersection->simulationWell() );
}
m_flatSimWellPipePartMgr = new RivSimWellPipesPartMgr( m_intersection->simulationWell() );
m_flatWellHeadPartMgr = new RivWellHeadPartMgr( m_intersection->simulationWell() );
}
m_flatWellpathPartMgr = nullptr;
if ( m_intersection->type() == RimExtrudedCurveIntersection::CrossSectionEnum::CS_WELL_PATH && m_intersection->wellPath() )
{
Rim3dView* settingsView = nullptr;
m_intersection->firstAncestorOrThisOfType( settingsView );
Rim3dView* settingsView = m_intersection->firstAncestorOrThisOfType<Rim3dView>();
if ( settingsView )
{
m_flatWellpathPartMgr = new RivWellPathPartMgr( m_intersection->wellPath(), settingsView );
@@ -690,10 +677,8 @@ void Rim2dIntersectionView::onUpdateLegends()
RimTernaryLegendConfig* ternaryLegendConfig = nullptr;
{
RimEclipseView* originEclView = nullptr;
m_intersection->firstAncestorOrThisOfType( originEclView );
RimGeoMechView* originGeoView = nullptr;
m_intersection->firstAncestorOrThisOfType( originGeoView );
RimEclipseView* originEclView = m_intersection->firstAncestorOrThisOfType<RimEclipseView>();
RimGeoMechView* originGeoView = m_intersection->firstAncestorOrThisOfType<RimGeoMechView>();
if ( originEclView )
{