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

@@ -96,8 +96,7 @@ caf::PdmFieldHandle* RimIntersectionCollection::objectToggleField()
//--------------------------------------------------------------------------------------------------
void RimIntersectionCollection::defineUiTreeOrdering( caf::PdmUiTreeOrdering& uiTreeOrdering, QString uiConfigName /*= "" */ )
{
RimGridView* gridView = nullptr;
this->firstAncestorOfType( gridView );
auto gridView = firstAncestorOfType<RimGridView>();
if ( gridView )
{
auto uiTree = gridView->separateIntersectionResultsCollection()->uiTreeOrdering();
@@ -251,7 +250,7 @@ void RimIntersectionCollection::rebuildGeometry()
//--------------------------------------------------------------------------------------------------
std::vector<RimExtrudedCurveIntersection*> RimIntersectionCollection::intersections() const
{
return m_intersections.children();
return m_intersections.childrenByType();
}
//--------------------------------------------------------------------------------------------------
@@ -259,7 +258,7 @@ std::vector<RimExtrudedCurveIntersection*> RimIntersectionCollection::intersecti
//--------------------------------------------------------------------------------------------------
std::vector<RimBoxIntersection*> RimIntersectionCollection::intersectionBoxes() const
{
return m_intersectionBoxes.children();
return m_intersectionBoxes.childrenByType();
}
//--------------------------------------------------------------------------------------------------
@@ -306,8 +305,7 @@ void RimIntersectionCollection::appendIntersectionNoUpdate( RimExtrudedCurveInte
//--------------------------------------------------------------------------------------------------
void RimIntersectionCollection::syncronize2dIntersectionViews()
{
RimCase* ownerCase = nullptr;
this->firstAncestorOrThisOfTypeAsserted( ownerCase );
auto ownerCase = firstAncestorOrThisOfTypeAsserted<RimCase>();
ownerCase->intersectionViewCollection()->syncFromExistingIntersections( true );
}
@@ -508,9 +506,7 @@ void RimIntersectionCollection::defineEditorAttribute( const caf::PdmFieldHandle
//--------------------------------------------------------------------------------------------------
RimEclipseView* RimIntersectionCollection::eclipseView() const
{
RimEclipseView* eclipseView = nullptr;
firstAncestorOrThisOfType( eclipseView );
return eclipseView;
return firstAncestorOrThisOfType<RimEclipseView>();
}
//--------------------------------------------------------------------------------------------------
@@ -518,8 +514,7 @@ RimEclipseView* RimIntersectionCollection::eclipseView() const
//--------------------------------------------------------------------------------------------------
void RimIntersectionCollection::rebuild3dView() const
{
Rim3dView* rimView = nullptr;
firstAncestorOrThisOfType( rimView );
auto rimView = firstAncestorOrThisOfType<Rim3dView>();
if ( rimView )
{
rimView->scheduleCreateDisplayModelAndRedraw();