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

@@ -283,7 +283,7 @@ void RimWellPathCollection::addWellPath( gsl::not_null<RimWellPath*> wellPath )
//--------------------------------------------------------------------------------------------------
std::vector<RimWellPath*> RimWellPathCollection::allWellPaths() const
{
return m_wellPaths.children();
return m_wellPaths.childrenByType();
}
//--------------------------------------------------------------------------------------------------
@@ -485,8 +485,7 @@ caf::PdmFieldHandle* RimWellPathCollection::objectToggleField()
//--------------------------------------------------------------------------------------------------
void RimWellPathCollection::scheduleRedrawAffectedViews()
{
RimProject* proj;
this->firstAncestorOrThisOfType( proj );
RimProject* proj = RimProject::current();
if ( proj ) proj->reloadCompletionTypeResultsInAllViews();
}
@@ -760,8 +759,7 @@ void RimWellPathCollection::sortWellsByName()
//--------------------------------------------------------------------------------------------------
caf::AppEnum<RiaDefines::EclipseUnitSystem> RimWellPathCollection::findUnitSystemForWellPath( const RimWellPath* wellPath )
{
RimProject* project;
firstAncestorOrThisOfTypeAsserted( project );
RimProject* project = RimProject::current();
if ( project->activeOilField()->analysisModels->cases.empty() )
{
return RiaDefines::EclipseUnitSystem::UNITS_UNKNOWN;
@@ -790,7 +788,7 @@ void RimWellPathCollection::rebuildWellPathNodes()
{
m_wellPathNodes.deleteChildren();
std::map<QString, std::vector<RimWellPath*>> rootWells = wellPathsForWellNameStem( m_wellPaths.children() );
std::map<QString, std::vector<RimWellPath*>> rootWells = wellPathsForWellNameStem( m_wellPaths.childrenByType() );
for ( auto [groupName, wellPathGroup] : rootWells )
{
if ( groupName == unGroupedText() )