diff --git a/ApplicationLibCode/Application/RiaResultNames.cpp b/ApplicationLibCode/Application/RiaResultNames.cpp index 183c0d5ef5..348917de64 100644 --- a/ApplicationLibCode/Application/RiaResultNames.cpp +++ b/ApplicationLibCode/Application/RiaResultNames.cpp @@ -392,17 +392,17 @@ QString RiaResultNames::formationAllanResultName() //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -QString RiaResultNames::indexIResultName() +QString RiaResultNames::indexIResultName( bool isRadial ) { - return "INDEX_I"; + return isRadial ? "INDEX_RADIAL" : "INDEX_I"; } //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -QString RiaResultNames::indexJResultName() +QString RiaResultNames::indexJResultName( bool isRadial ) { - return "INDEX_J"; + return isRadial ? "INDEX_THETA" : "INDEX_J"; } //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationLibCode/Application/RiaResultNames.h b/ApplicationLibCode/Application/RiaResultNames.h index 1a7a382900..740e7fed02 100644 --- a/ApplicationLibCode/Application/RiaResultNames.h +++ b/ApplicationLibCode/Application/RiaResultNames.h @@ -75,8 +75,8 @@ QString faultReactAssessmentPrefix(); QString completionTypeResultName(); -QString indexIResultName(); -QString indexJResultName(); +QString indexIResultName( bool isRadial ); +QString indexJResultName( bool isRadial ); QString indexKResultName(); RigEclipseResultAddress staticIntegerAddress( const QString& resultName ); diff --git a/ApplicationLibCode/ReservoirDataModel/ResultCalculators/RigIndexIjkResultCalculator.cpp b/ApplicationLibCode/ReservoirDataModel/ResultCalculators/RigIndexIjkResultCalculator.cpp index 0fc1cc80ec..55a7d0d8dc 100644 --- a/ApplicationLibCode/ReservoirDataModel/ResultCalculators/RigIndexIjkResultCalculator.cpp +++ b/ApplicationLibCode/ReservoirDataModel/ResultCalculators/RigIndexIjkResultCalculator.cpp @@ -45,7 +45,8 @@ RigIndexIjkResultCalculator::~RigIndexIjkResultCalculator() //-------------------------------------------------------------------------------------------------- bool RigIndexIjkResultCalculator::isMatching( const RigEclipseResultAddress& resVarAddr ) const { - return ( resVarAddr.resultName() == RiaResultNames::indexIResultName() || resVarAddr.resultName() == RiaResultNames::indexJResultName() || + return ( resVarAddr.resultName() == RiaResultNames::indexIResultName( m_resultsData->isRadialModel() ) || + resVarAddr.resultName() == RiaResultNames::indexJResultName( m_resultsData->isRadialModel() ) || resVarAddr.resultName() == RiaResultNames::indexKResultName() ) && resVarAddr.resultCatType() == RiaDefines::ResultCatType::STATIC_NATIVE; } @@ -59,10 +60,10 @@ void RigIndexIjkResultCalculator::calculate( const RigEclipseResultAddress& resV const size_t activeCellCount = activeReservoirCellIndices.size(); if ( activeCellCount == 0 ) return; - size_t iResultIndex = - m_resultsData->findScalarResultIndexFromAddress( RiaResultNames::staticIntegerAddress( RiaResultNames::indexIResultName() ) ); - size_t jResultIndex = - m_resultsData->findScalarResultIndexFromAddress( RiaResultNames::staticIntegerAddress( RiaResultNames::indexJResultName() ) ); + size_t iResultIndex = m_resultsData->findScalarResultIndexFromAddress( + RiaResultNames::staticIntegerAddress( RiaResultNames::indexIResultName( m_resultsData->isRadialModel() ) ) ); + size_t jResultIndex = m_resultsData->findScalarResultIndexFromAddress( + RiaResultNames::staticIntegerAddress( RiaResultNames::indexJResultName( m_resultsData->isRadialModel() ) ) ); size_t kResultIndex = m_resultsData->findScalarResultIndexFromAddress( RiaResultNames::staticIntegerAddress( RiaResultNames::indexKResultName() ) ); diff --git a/ApplicationLibCode/ReservoirDataModel/RigCaseCellResultsData.cpp b/ApplicationLibCode/ReservoirDataModel/RigCaseCellResultsData.cpp index 94b11a0ab9..371e249288 100644 --- a/ApplicationLibCode/ReservoirDataModel/RigCaseCellResultsData.cpp +++ b/ApplicationLibCode/ReservoirDataModel/RigCaseCellResultsData.cpp @@ -466,6 +466,8 @@ QStringList RigCaseCellResultsData::resultNames( RiaDefines::ResultCatType resTy if ( resultAddress.isDeltaTimeStepActive() || resultAddress.isDeltaCaseActive() || resultAddress.isDivideByCellFaceAreaActive() ) continue; + if ( isRadialModel() && ( it->resultName() == "DX" || it->resultName() == "DY" ) ) continue; + if ( it->resultType() == resType ) { varList.push_back( it->resultName() ); @@ -1136,8 +1138,10 @@ void RigCaseCellResultsData::createPlaceholderResultEntries() // I/J/K indexes { - findOrCreateScalarResultIndex( RiaResultNames::staticIntegerAddress( RiaResultNames::indexIResultName() ), needsToBeStored ); - findOrCreateScalarResultIndex( RiaResultNames::staticIntegerAddress( RiaResultNames::indexJResultName() ), needsToBeStored ); + findOrCreateScalarResultIndex( RiaResultNames::staticIntegerAddress( RiaResultNames::indexIResultName( isRadialModel() ) ), + needsToBeStored ); + findOrCreateScalarResultIndex( RiaResultNames::staticIntegerAddress( RiaResultNames::indexJResultName( isRadialModel() ) ), + needsToBeStored ); findOrCreateScalarResultIndex( RiaResultNames::staticIntegerAddress( RiaResultNames::indexKResultName() ), needsToBeStored ); } @@ -1378,8 +1382,8 @@ size_t RigCaseCellResultsData::findOrLoadKnownScalarResult( const RigEclipseResu } RigAllanUtil::computeAllanResults( this, m_ownerMainGrid, includeInactiveCells ); } - else if ( resultName == RiaResultNames::indexIResultName() || resultName == RiaResultNames::indexJResultName() || - resultName == RiaResultNames::indexKResultName() ) + else if ( resultName == RiaResultNames::indexIResultName( isRadialModel() ) || + resultName == RiaResultNames::indexJResultName( isRadialModel() ) || resultName == RiaResultNames::indexKResultName() ) { computeIndexResults(); } @@ -1945,7 +1949,7 @@ void RigCaseCellResultsData::computeDepthRelatedResults() //-------------------------------------------------------------------------------------------------- void RigCaseCellResultsData::computeIndexResults() { - RigEclipseResultAddress addr( RiaDefines::ResultCatType::STATIC_NATIVE, RiaResultNames::indexIResultName() ); + RigEclipseResultAddress addr( RiaDefines::ResultCatType::STATIC_NATIVE, RiaResultNames::indexIResultName( isRadialModel() ) ); RigIndexIjkResultCalculator calculator( *this ); calculator.calculate( addr, 0 ); } @@ -2999,6 +3003,16 @@ RigStatisticsDataCache* RigCaseCellResultsData::statistics( const RigEclipseResu return m_statisticsDataCache[scalarResultIndex].p(); } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +bool RigCaseCellResultsData::isRadialModel() const +{ + if ( !m_ownerMainGrid ) return false; + + return m_ownerMainGrid->isRadial(); +} + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationLibCode/ReservoirDataModel/RigCaseCellResultsData.h b/ApplicationLibCode/ReservoirDataModel/RigCaseCellResultsData.h index ce88d390f5..05dfd4f218 100644 --- a/ApplicationLibCode/ReservoirDataModel/RigCaseCellResultsData.h +++ b/ApplicationLibCode/ReservoirDataModel/RigCaseCellResultsData.h @@ -213,6 +213,8 @@ private: RigStatisticsDataCache* statistics( const RigEclipseResultAddress& resVarAddr ); + bool isRadialModel() const; + private: cvf::ref m_readerInterface; cvf::cref m_activeFormationNamesData; diff --git a/ApplicationLibCode/UserInterface/RiuViewerCommands.cpp b/ApplicationLibCode/UserInterface/RiuViewerCommands.cpp index dda44232f6..4adb97c8a4 100644 --- a/ApplicationLibCode/UserInterface/RiuViewerCommands.cpp +++ b/ApplicationLibCode/UserInterface/RiuViewerCommands.cpp @@ -377,8 +377,16 @@ void RiuViewerCommands::displayContextMenu( QMouseEvent* event ) menuBuilder.subMenuStart( "Range Filter", QIcon( ":/CellFilter_Range.png" ) ); - menuBuilder.addCmdFeatureWithUserData( "RicNewRangeFilterSlice3dviewFeature", "I Slice", iSliceList ); - menuBuilder.addCmdFeatureWithUserData( "RicNewRangeFilterSlice3dviewFeature", "J Slice", jSliceList ); + if ( isRadialGrid( mainOrComparisonView, m_currentGridIdx ) ) + { + menuBuilder.addCmdFeatureWithUserData( "RicNewRangeFilterSlice3dviewFeature", "Radial Slice", iSliceList ); + menuBuilder.addCmdFeatureWithUserData( "RicNewRangeFilterSlice3dviewFeature", "Theta Slice", jSliceList ); + } + else + { + menuBuilder.addCmdFeatureWithUserData( "RicNewRangeFilterSlice3dviewFeature", "I Slice", iSliceList ); + menuBuilder.addCmdFeatureWithUserData( "RicNewRangeFilterSlice3dviewFeature", "J Slice", jSliceList ); + } menuBuilder.addCmdFeatureWithUserData( "RicNewRangeFilterSlice3dviewFeature", "K Slice", kSliceList ); menuBuilder.addCmdFeature( "RicNewCellRangeFilterFeature", "IJK Filter" ); @@ -1184,6 +1192,20 @@ void RiuViewerCommands::ijkFromCellIndex( Rim3dView* mainOrComparisonView, size_ } } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +bool RiuViewerCommands::isRadialGrid( Rim3dView* mainOrComparisonView, size_t gridIdx ) +{ + RimEclipseView* eclipseView = dynamic_cast( mainOrComparisonView ); + if ( eclipseView && eclipseView->eclipseCase() && eclipseView->eclipseCase()->eclipseCaseData() ) + { + return eclipseView->eclipseCase()->eclipseCaseData()->grid( gridIdx )->isRadial(); + } + + return false; +} + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationLibCode/UserInterface/RiuViewerCommands.h b/ApplicationLibCode/UserInterface/RiuViewerCommands.h index 4d69ca482e..aaf8878b64 100644 --- a/ApplicationLibCode/UserInterface/RiuViewerCommands.h +++ b/ApplicationLibCode/UserInterface/RiuViewerCommands.h @@ -83,6 +83,7 @@ public: private: void ijkFromCellIndex( Rim3dView* mainOrComparisonView, size_t gridIdx, size_t cellIndex, size_t* i, size_t* j, size_t* k ); + bool isRadialGrid( Rim3dView* mainOrComparisonView, size_t gridIdx ); bool handleOverlayItemPicking( int winPosX, int winPosY ); void handleTextPicking( int winPosX, int winPosY, cvf::HitItemCollection* hitItems );