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

No files matched your search

@@ -95,8 +95,7 @@ void RimWellPathAttribute::setDepthsFromWellPath( gsl::not_null<const RimWellPat
//--------------------------------------------------------------------------------------------------
bool RimWellPathAttribute::isEnabled() const
{
RimWellPathAttributeCollection* collection = nullptr;
this->firstAncestorOrThisOfTypeAsserted( collection );
auto collection = firstAncestorOrThisOfTypeAsserted<RimWellPathAttributeCollection>();
return collection->isChecked();
}
@@ -260,9 +259,8 @@ void RimWellPathAttribute::fieldChangedByUi( const caf::PdmFieldHandle* changedF
{
if ( m_type() == RiaDefines::WellPathComponentType::CASING )
{
RimWellPath* wellPath = nullptr;
this->firstAncestorOrThisOfTypeAsserted( wellPath );
m_startMD = wellPath->startMD();
auto wellPath = firstAncestorOrThisOfTypeAsserted<RimWellPath>();
m_startMD = wellPath->startMD();
if ( !supportedDiameters( m_type() ).count( m_diameterInInches() ) )
{
@@ -290,13 +288,11 @@ void RimWellPathAttribute::fieldChangedByUi( const caf::PdmFieldHandle* changedF
}
{
RimWellPathAttributeCollection* collection = nullptr;
this->firstAncestorOrThisOfTypeAsserted( collection );
auto collection = firstAncestorOrThisOfTypeAsserted<RimWellPathAttributeCollection>();
collection->updateAllReferringTracks();
}
{
RimProject* proj;
this->firstAncestorOrThisOfTypeAsserted( proj );
RimProject* proj = RimProject::current();
proj->reloadCompletionTypeResultsInAllViews();
}
}