#8991 3D grid cross plot: Select correct grid model.

This commit is contained in:
Kristian Bendiksen 2022-06-08 23:17:16 +02:00
parent 2fdd5875ea
commit 5b4434439e
2 changed files with 24 additions and 9 deletions

View File

@ -68,8 +68,12 @@ void RicCreateGridCrossPlotFeature::onActionTriggered( bool isChecked )
}
else
{
// Triggered from context menu: get the selected view
// TODO: get the filter from somewhere
caf::PdmObject* selectedObject = dynamic_cast<caf::PdmObject*>( caf::SelectionManager::instance()->selectedItem() );
if ( !selectedObject ) return;
RimGridView* cellFilterView = nullptr;
selectedObject->firstAncestorOrThisOfType( cellFilterView );
if ( cellFilterView ) dataSet->setCellFilterView( cellFilterView );
}
plot->loadDataAndUpdate();

View File

@ -165,18 +165,29 @@ void RimGridCrossPlotDataSet::setCellFilterView( RimGridView* cellFilterView )
RigEclipseResultAddress resAddr = eclipseView->cellResult()->eclipseResultAddress();
if ( resAddr.isValid() )
{
m_xAxisProperty->setResultType( resAddr.resultCatType() );
m_xAxisProperty->setResultVariable( resAddr.resultName() );
m_yAxisProperty->setResultType( RiaDefines::ResultCatType::STATIC_NATIVE );
m_yAxisProperty->setResultVariable( "DEPTH" );
m_timeStep = eclipseView->currentTimeStep();
m_grouping = NO_GROUPING;
if ( eclipseView->eclipseCase() && eclipseView->eclipseCase()->activeFormationNames() )
RimEclipseCase* eclipseCase = eclipseView->eclipseCase();
if ( eclipseCase )
{
m_case = eclipseCase;
m_xAxisProperty->setEclipseCase( eclipseCase );
m_yAxisProperty->setEclipseCase( eclipseCase );
m_groupingProperty->setEclipseCase( eclipseCase );
if ( eclipseCase->activeFormationNames() )
{
m_grouping = GROUP_BY_FORMATION;
m_groupingProperty->legendConfig()->setColorLegend(
RimRegularLegendConfig::mapToColorLegend( RimRegularLegendConfig::ColorRangesType::CATEGORY ) );
}
}
m_xAxisProperty->setResultType( resAddr.resultCatType() );
m_xAxisProperty->setResultVariable( resAddr.resultName() );
m_yAxisProperty->setResultType( RiaDefines::ResultCatType::STATIC_NATIVE );
m_yAxisProperty->setResultVariable( "DEPTH" );
m_timeStep = eclipseView->currentTimeStep();
RimGridCrossPlot* parentPlot = nullptr;
firstAncestorOrThisOfType( parentPlot );