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

@@ -64,8 +64,7 @@ RimSeismicSectionCollection::~RimSeismicSectionCollection()
//--------------------------------------------------------------------------------------------------
RimSeismicSection* RimSeismicSectionCollection::addNewSection( RiaDefines::SeismicSectionType sectionType )
{
Rim3dView* view = nullptr;
firstAncestorOrThisOfType( view );
auto view = firstAncestorOrThisOfType<Rim3dView>();
if ( view == nullptr ) return nullptr;
RimSeismicData* defaultSeis = nullptr;
@@ -146,7 +145,7 @@ void RimSeismicSectionCollection::defineUiOrdering( QString uiConfigName, caf::P
//--------------------------------------------------------------------------------------------------
std::vector<RimSeismicSection*> RimSeismicSectionCollection::seismicSections() const
{
return m_seismicSections.children();
return m_seismicSections.childrenByType();
}
//--------------------------------------------------------------------------------------------------
@@ -254,8 +253,7 @@ void RimSeismicSectionCollection::onChildDeleted( caf::PdmChildArrayFieldHandle*
//--------------------------------------------------------------------------------------------------
void RimSeismicSectionCollection::updateView()
{
Rim3dView* view = nullptr;
firstAncestorOrThisOfType( view );
auto view = firstAncestorOrThisOfType<Rim3dView>();
if ( view ) view->scheduleCreateDisplayModelAndRedraw();
}