mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
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:
@@ -253,8 +253,7 @@ void RivBoxIntersectionGeometryGenerator::calculateArrays()
|
||||
|
||||
cvf::Vec3d displayOffset( 0, 0, 0 );
|
||||
{
|
||||
RimGridView* gridView = nullptr;
|
||||
m_intersectionBoxDefinition->firstAncestorOrThisOfType( gridView );
|
||||
auto gridView = m_intersectionBoxDefinition->firstAncestorOrThisOfType<RimGridView>();
|
||||
if ( gridView && gridView->ownerCase() )
|
||||
{
|
||||
displayOffset = gridView->ownerCase()->displayModelOffset();
|
||||
|
||||
@@ -51,9 +51,7 @@
|
||||
|
||||
cvf::ref<caf::DisplayCoordTransform> displayCoordTransform( const RimExtrudedCurveIntersection* intersection )
|
||||
{
|
||||
Rim3dView* rimView = nullptr;
|
||||
intersection->firstAncestorOrThisOfType( rimView );
|
||||
CVF_ASSERT( rimView );
|
||||
auto rimView = intersection->firstAncestorOrThisOfTypeAsserted<Rim3dView>();
|
||||
|
||||
cvf::ref<caf::DisplayCoordTransform> transForm = rimView->displayCoordTransform();
|
||||
return transForm;
|
||||
@@ -114,8 +112,7 @@ void RivExtrudedCurveIntersectionGeometryGenerator::calculateLineSegementTransfo
|
||||
|
||||
cvf::Vec3d displayOffset( 0, 0, 0 );
|
||||
{
|
||||
RimGridView* gridView = nullptr;
|
||||
m_intersection->firstAncestorOrThisOfType( gridView );
|
||||
auto gridView = m_intersection->firstAncestorOrThisOfType<RimGridView>();
|
||||
if ( gridView && gridView->ownerCase() )
|
||||
{
|
||||
displayOffset = gridView->ownerCase()->displayModelOffset();
|
||||
|
||||
@@ -341,8 +341,7 @@ void RivExtrudedCurveIntersectionPartMgr::createFaultLabelParts( const std::vect
|
||||
|
||||
if ( !m_rimIntersection->activeSeparateResultDefinition() )
|
||||
{
|
||||
RimEclipseView* eclipseView = nullptr;
|
||||
m_rimIntersection->firstAncestorOrThisOfType( eclipseView );
|
||||
auto eclipseView = m_rimIntersection->firstAncestorOrThisOfType<RimEclipseView>();
|
||||
if ( eclipseView )
|
||||
{
|
||||
faultInViewColl = eclipseView->faultCollection();
|
||||
|
||||
@@ -62,9 +62,7 @@ void RivIntersectionResultsColoringTools::calculateIntersectionResultColors( int
|
||||
{
|
||||
if ( !intersectionGeomGenIF || !intersectionGeomGenIF->isAnyGeometryPresent() ) return;
|
||||
|
||||
RimGridView* gridView = nullptr;
|
||||
rimIntersectionHandle->firstAncestorOrThisOfType( gridView );
|
||||
|
||||
auto gridView = rimIntersectionHandle->firstAncestorOrThisOfType<RimGridView>();
|
||||
if ( !gridView ) return;
|
||||
|
||||
bool isLightingDisabled = gridView->isLightingDisabled();
|
||||
@@ -100,9 +98,7 @@ void RivIntersectionResultsColoringTools::calculateIntersectionResultColors( int
|
||||
|
||||
if ( !eclipseResDef && !geomResultDef )
|
||||
{
|
||||
RimEclipseView* eclipseView = nullptr;
|
||||
rimIntersectionHandle->firstAncestorOrThisOfType( eclipseView );
|
||||
|
||||
auto eclipseView = rimIntersectionHandle->firstAncestorOrThisOfType<RimEclipseView>();
|
||||
if ( eclipseView )
|
||||
{
|
||||
eclipseResDef = eclipseView->cellResult();
|
||||
@@ -110,9 +106,7 @@ void RivIntersectionResultsColoringTools::calculateIntersectionResultColors( int
|
||||
if ( !ternaryColorMapper ) ternaryColorMapper = eclipseView->cellResult()->ternaryLegendConfig()->scalarMapper();
|
||||
}
|
||||
|
||||
RimGeoMechView* geoView;
|
||||
rimIntersectionHandle->firstAncestorOrThisOfType( geoView );
|
||||
|
||||
auto geoView = rimIntersectionHandle->firstAncestorOrThisOfType<RimGeoMechView>();
|
||||
if ( geoView )
|
||||
{
|
||||
geomResultDef = geoView->cellResult();
|
||||
|
||||
Reference in New Issue
Block a user