Merge pull request #4907 from OPM/feature-picking-in-comparison-view

Feature fix picking in comparison view step 1
This commit is contained in:
Jacob Støren authored and GitHub committed 2019-10-22 16:07:59 +02:00
commit 63917a61b5
45 files changed
+513 -360

No files matched your search

@@ -28,6 +28,7 @@
#include "RiuMainWindow.h"
#include "RiuViewer.h"
#include "RiuViewerCommands.h"
#include "cvfBoundingBox.h"
#include "cvfCamera.h"
@@ -57,12 +58,14 @@ void RicCreateTextAnnotationIn3dViewFeature::onActionTriggered( bool isChecked )
if ( activeView )
{
cvf::Vec3d domainCoord = activeView->viewer()->lastPickPositionInDomainCoords();
cvf::BoundingBox bbox = activeView->ownerCase()->activeCellsBoundingBox();
RimGridView* viewOrComparisonView = RiaApplication::instance()->activeMainOrComparisonGridView();
cvf::Vec3d domainCoord = activeView->viewer()->viewerCommands()->lastPickPositionInDomainCoords();
cvf::BoundingBox bbox = viewOrComparisonView->ownerCase()->activeCellsBoundingBox();
if ( contMapView ) domainCoord[2] = bbox.max().z() - bbox.extent().z() * 0.2;
auto coll = activeView->annotationCollection();
auto coll = viewOrComparisonView->annotationCollection();
if ( coll )
{
@@ -70,7 +73,9 @@ void RicCreateTextAnnotationIn3dViewFeature::onActionTriggered( bool isChecked )
newAnnotation->setAnchorPoint( domainCoord );
cvf::Vec3d labelPos = domainCoord;
if ( activeView->viewer()->mainCamera()->direction().z() <= 0 )
cvf::Camera* viewCamera = activeView->viewer()->mainCamera();
if ( viewCamera->direction().z() <= 0 )
{
labelPos.z() = bbox.max().z();
}
@@ -79,10 +84,10 @@ void RicCreateTextAnnotationIn3dViewFeature::onActionTriggered( bool isChecked )
labelPos.z() = bbox.min().z();
}
cvf::Vec3d horizontalRight = activeView->viewer()->mainCamera()->direction() ^ cvf::Vec3d::Z_AXIS;
cvf::Vec3d horizontalUp = activeView->viewer()->mainCamera()->up() -
( cvf::Vec3d::Z_AXIS *
( activeView->viewer()->mainCamera()->up() * cvf::Vec3d::Z_AXIS ) );
cvf::Vec3d horizontalRight = viewCamera->direction() ^ cvf::Vec3d::Z_AXIS;
cvf::Vec3d horizontalUp = viewCamera->up() -
( cvf::Vec3d::Z_AXIS * ( viewCamera->up() * cvf::Vec3d::Z_AXIS ) );
bool isOk = horizontalRight.normalize();
if ( !isOk ) horizontalRight = {1.0, 0.0, 0.0};
@@ -93,7 +98,7 @@ void RicCreateTextAnnotationIn3dViewFeature::onActionTriggered( bool isChecked )
coll->scheduleRedrawOfRelevantViews();
coll->updateConnectedEditors();
RiuMainWindow::instance()->selectAsCurrentItem( newAnnotation );
RiuMainWindow::instance()->selectAsCurrentItem( newAnnotation, false );
}
}
}
@@ -58,7 +58,7 @@ bool RicNewAzimuthDipIntersectionFeature::isCommandEnabled()
//--------------------------------------------------------------------------------------------------
void RicNewAzimuthDipIntersectionFeature::onActionTriggered( bool isChecked )
{
RimGridView* activeView = RiaApplication::instance()->activeGridView();
RimGridView* activeView = RiaApplication::instance()->activeMainOrComparisonGridView();
if ( !activeView ) return;
RicNewAzimuthDipIntersectionFeatureCmd* cmd = new RicNewAzimuthDipIntersectionFeatureCmd(
@@ -122,7 +122,7 @@ void RicNewAzimuthDipIntersectionFeatureCmd::redo()
m_intersectionCollection->appendIntersectionAndUpdate( intersection );
Riu3dSelectionManager::instance()->deleteAllItems();
Riu3DMainWindowTools::selectAsCurrentItem( intersection );
Riu3DMainWindowTools::selectAsCurrentItem( intersection, false );
}
//--------------------------------------------------------------------------------------------------
@@ -57,7 +57,7 @@ bool RicNewPolylineIntersectionFeature::isCommandEnabled()
//--------------------------------------------------------------------------------------------------
void RicNewPolylineIntersectionFeature::onActionTriggered( bool isChecked )
{
RimGridView* activeView = RiaApplication::instance()->activeGridView();
RimGridView* activeView = RiaApplication::instance()->activeMainOrComparisonGridView();
if ( !activeView ) return;
RicNewPolylineIntersectionFeatureCmd* cmd = new RicNewPolylineIntersectionFeatureCmd(
@@ -112,7 +112,7 @@ void RicNewPolylineIntersectionFeatureCmd::redo()
Riu3dSelectionManager::instance()->deleteAllItems();
Riu3DMainWindowTools::selectAsCurrentItem( intersection );
Riu3DMainWindowTools::selectAsCurrentItem( intersection, false );
}
//--------------------------------------------------------------------------------------------------
@@ -66,7 +66,7 @@ void RicEclipsePropertyFilterFeatureImpl::addPropertyFilter( RimEclipsePropertyF
propertyFilterCollection->reservoirView()->scheduleCreateDisplayModelAndRedraw();
propertyFilterCollection->updateConnectedEditors();
Riu3DMainWindowTools::selectAsCurrentItem( propertyFilter );
Riu3DMainWindowTools::selectAsCurrentItem( propertyFilter, false );
}
//--------------------------------------------------------------------------------------------------
@@ -83,7 +83,7 @@ void RicEclipsePropertyFilterFeatureImpl::insertPropertyFilter( RimEclipseProper
propertyFilterCollection->reservoirView()->scheduleCreateDisplayModelAndRedraw();
propertyFilterCollection->updateConnectedEditors();
Riu3DMainWindowTools::selectAsCurrentItem( propertyFilter );
Riu3DMainWindowTools::selectAsCurrentItem( propertyFilter, false );
}
//--------------------------------------------------------------------------------------------------
@@ -39,7 +39,7 @@ CAF_CMD_SOURCE_INIT( RicEclipsePropertyFilterNewInViewFeature, "RicEclipseProper
//--------------------------------------------------------------------------------------------------
bool RicEclipsePropertyFilterNewInViewFeature::isCommandEnabled()
{
Rim3dView* view = RiaApplication::instance()->activeReservoirView();
Rim3dView* view = RiaApplication::instance()->activeMainOrComparisonGridView();
if ( !view ) return false;
RimEclipseView* eclView = dynamic_cast<RimEclipseView*>( view );
@@ -64,7 +64,7 @@ bool RicEclipsePropertyFilterNewInViewFeature::isCommandEnabled()
//--------------------------------------------------------------------------------------------------
void RicEclipsePropertyFilterNewInViewFeature::onActionTriggered( bool isChecked )
{
Rim3dView* view = RiaApplication::instance()->activeReservoirView();
Rim3dView* view = RiaApplication::instance()->activeMainOrComparisonGridView();
if ( !view ) return;
RimEclipseView* eclView = dynamic_cast<RimEclipseView*>( view );
if ( !eclView ) return;
@@ -1,5 +1,6 @@
set (SOURCE_GROUP_HEADER_FILES
${CMAKE_CURRENT_LIST_DIR}/RicIntersectionFeatureImpl.h
${CMAKE_CURRENT_LIST_DIR}/RicBoxManipulatorEventHandler.h
${CMAKE_CURRENT_LIST_DIR}/RicAppendIntersectionBoxFeature.h
${CMAKE_CURRENT_LIST_DIR}/RicIntersectionBoxXSliceFeature.h
@@ -9,6 +10,7 @@ ${CMAKE_CURRENT_LIST_DIR}/RicIntersectionBoxAtPosFeature.h
)
set (SOURCE_GROUP_SOURCE_FILES
${CMAKE_CURRENT_LIST_DIR}/RicIntersectionFeatureImpl.cpp
${CMAKE_CURRENT_LIST_DIR}/RicBoxManipulatorEventHandler.cpp
${CMAKE_CURRENT_LIST_DIR}/RicAppendIntersectionBoxFeature.cpp
${CMAKE_CURRENT_LIST_DIR}/RicIntersectionBoxXSliceFeature.cpp
@@ -27,6 +27,7 @@
#include "RiuMainWindow.h"
#include "RiuViewer.h"
#include "RiuViewerCommands.h"
#include "cafCmdExecCommandManager.h"
#include "cafSelectionManager.h"
@@ -51,9 +52,10 @@ bool RicIntersectionBoxAtPosFeature::isCommandEnabled()
void RicIntersectionBoxAtPosFeature::onActionTriggered( bool isChecked )
{
RimGridView* activeView = RiaApplication::instance()->activeGridView();
if ( activeView )
RimGridView* activeMainOrComparisonView = RiaApplication::instance()->activeMainOrComparisonGridView();
if ( activeMainOrComparisonView )
{
RimIntersectionCollection* coll = activeView->crossSectionCollection();
RimIntersectionCollection* coll = activeMainOrComparisonView->crossSectionCollection();
CVF_ASSERT( coll );
RimIntersectionBox* intersectionBox = new RimIntersectionBox();
@@ -61,21 +63,17 @@ void RicIntersectionBoxAtPosFeature::onActionTriggered( bool isChecked )
coll->appendIntersectionBoxAndUpdate( intersectionBox );
cvf::Vec3d domainCoord = activeView->viewer()->lastPickPositionInDomainCoords();
cvf::Vec3d domainCoord = activeView->viewer()->viewerCommands()->lastPickPositionInDomainCoords();
intersectionBox->setToDefaultSizeSlice( RimIntersectionBox::PLANE_STATE_NONE, domainCoord );
coll->updateConnectedEditors();
RiuMainWindow::instance()->selectAsCurrentItem( intersectionBox );
RiuMainWindow::instance()->selectAsCurrentItem( intersectionBox, false );
RimGridView* rimView = nullptr;
coll->firstAncestorOrThisOfType( rimView );
if ( rimView )
{
rimView->showGridCells( false );
RiuMainWindow::instance()->refreshDrawStyleActions();
activeMainOrComparisonView->showGridCells(false);
RiuMainWindow::instance()->refreshDrawStyleActions();
rimView->scheduleCreateDisplayModelAndRedraw();
}
activeView->scheduleCreateDisplayModelAndRedraw();
}
}
@@ -18,12 +18,15 @@
#include "RicIntersectionBoxXSliceFeature.h"
#include "RicIntersectionFeatureImpl.h"
#include "RiaApplication.h"
#include "RimCase.h"
#include "RimGridView.h"
#include "RimIntersectionBox.h"
#include "RimIntersectionCollection.h"
#include "RiuViewerCommands.h"
#include "RiuMainWindow.h"
#include "RiuViewer.h"
@@ -50,33 +53,7 @@ bool RicIntersectionBoxXSliceFeature::isCommandEnabled()
//--------------------------------------------------------------------------------------------------
void RicIntersectionBoxXSliceFeature::onActionTriggered( bool isChecked )
{
RimGridView* activeView = RiaApplication::instance()->activeGridView();
if ( activeView )
{
RimIntersectionCollection* coll = activeView->crossSectionCollection();
CVF_ASSERT( coll );
RimIntersectionBox* intersectionBox = new RimIntersectionBox();
intersectionBox->name = QString( "X-slice (Intersection box)" );
coll->appendIntersectionBoxAndUpdate( intersectionBox );
cvf::Vec3d domainCoord = activeView->viewer()->lastPickPositionInDomainCoords();
intersectionBox->setToDefaultSizeSlice( RimIntersectionBox::PLANE_STATE_X, domainCoord );
coll->updateConnectedEditors();
RiuMainWindow::instance()->selectAsCurrentItem( intersectionBox );
RimGridView* rimView = nullptr;
coll->firstAncestorOrThisOfType( rimView );
if ( rimView )
{
rimView->showGridCells( false );
RiuMainWindow::instance()->refreshDrawStyleActions();
rimView->scheduleCreateDisplayModelAndRedraw();
}
}
RicIntersectionFeatureImpl::createIntersectionBoxSlize("X-slice (Intersection box)", RimIntersectionBox::PLANE_STATE_X);
}
//--------------------------------------------------------------------------------------------------
@@ -18,6 +18,8 @@
#include "RicIntersectionBoxYSliceFeature.h"
#include "RicIntersectionFeatureImpl.h"
#include "RiaApplication.h"
#include "RimCase.h"
@@ -27,6 +29,7 @@
#include "RiuMainWindow.h"
#include "RiuViewer.h"
#include "RiuViewerCommands.h"
#include "cafCmdExecCommandManager.h"
#include "cafSelectionManager.h"
@@ -50,33 +53,7 @@ bool RicIntersectionBoxYSliceFeature::isCommandEnabled()
//--------------------------------------------------------------------------------------------------
void RicIntersectionBoxYSliceFeature::onActionTriggered( bool isChecked )
{
RimGridView* activeView = RiaApplication::instance()->activeGridView();
if ( activeView )
{
RimIntersectionCollection* coll = activeView->crossSectionCollection();
CVF_ASSERT( coll );
RimIntersectionBox* intersectionBox = new RimIntersectionBox();
intersectionBox->name = QString( "Y-slice (Intersection box)" );
coll->appendIntersectionBoxAndUpdate( intersectionBox );
cvf::Vec3d domainCoord = activeView->viewer()->lastPickPositionInDomainCoords();
intersectionBox->setToDefaultSizeSlice( RimIntersectionBox::PLANE_STATE_Y, domainCoord );
coll->updateConnectedEditors();
RiuMainWindow::instance()->selectAsCurrentItem( intersectionBox );
RimGridView* rimView = nullptr;
coll->firstAncestorOrThisOfType( rimView );
if ( rimView )
{
rimView->showGridCells( false );
RiuMainWindow::instance()->refreshDrawStyleActions();
rimView->scheduleCreateDisplayModelAndRedraw();
}
}
RicIntersectionFeatureImpl::createIntersectionBoxSlize("Y-slice (Intersection box)", RimIntersectionBox::PLANE_STATE_Y);
}
//--------------------------------------------------------------------------------------------------
@@ -18,12 +18,15 @@
#include "RicIntersectionBoxZSliceFeature.h"
#include "RicIntersectionFeatureImpl.h"
#include "RiaApplication.h"
#include "RimCase.h"
#include "RimGridView.h"
#include "RimIntersectionBox.h"
#include "RimIntersectionCollection.h"
#include "RiuViewerCommands.h"
#include "RiuMainWindow.h"
#include "RiuViewer.h"
@@ -50,32 +53,7 @@ bool RicIntersectionBoxZSliceFeature::isCommandEnabled()
//--------------------------------------------------------------------------------------------------
void RicIntersectionBoxZSliceFeature::onActionTriggered( bool isChecked )
{
RimGridView* activeView = RiaApplication::instance()->activeGridView();
if ( activeView )
{
RimIntersectionCollection* coll = activeView->crossSectionCollection();
CVF_ASSERT( coll );
RimIntersectionBox* intersectionBox = new RimIntersectionBox();
intersectionBox->name = QString( "Z-slice (Intersection box)" );
coll->appendIntersectionBoxAndUpdate( intersectionBox );
cvf::Vec3d domainCoord = activeView->viewer()->lastPickPositionInDomainCoords();
intersectionBox->setToDefaultSizeSlice( RimIntersectionBox::PLANE_STATE_Z, domainCoord );
coll->updateConnectedEditors();
RiuMainWindow::instance()->selectAsCurrentItem( intersectionBox );
RimGridView* rimView = nullptr;
coll->firstAncestorOrThisOfType( rimView );
if ( rimView )
{
rimView->showGridCells( false );
RiuMainWindow::instance()->refreshDrawStyleActions();
rimView->scheduleCreateDisplayModelAndRedraw();
}
}
RicIntersectionFeatureImpl::createIntersectionBoxSlize("Z-slice (Intersection box)", RimIntersectionBox::PLANE_STATE_Z);
}
//--------------------------------------------------------------------------------------------------
@@ -0,0 +1,59 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2019- Equinor ASA
//
// ResInsight is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE.
//
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
#include "RicIntersectionFeatureImpl.h"
#include "RiaApplication.h"
#include "RimGridView.h"
#include "RimIntersectionBox.h"
#include "RimIntersectionCollection.h"
#include "RiuMainWindow.h"
#include "RiuViewer.h"
#include "RiuViewerCommands.h"
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicIntersectionFeatureImpl::createIntersectionBoxSlize(const QString& name, RimIntersectionBox::SinglePlaneState plane)
{
RimGridView* activeView = RiaApplication::instance()->activeGridView();
RimGridView* activeMainOrComparisonView = RiaApplication::instance()->activeMainOrComparisonGridView();
if ( activeMainOrComparisonView )
{
RimIntersectionCollection* coll = activeMainOrComparisonView->crossSectionCollection();
CVF_ASSERT( coll );
cvf::Vec3d domainCoord = activeView->viewer()->viewerCommands()->lastPickPositionInDomainCoords();
RimIntersectionBox* intersectionBox = new RimIntersectionBox();
intersectionBox->name = name;
coll->appendIntersectionBoxNoUpdate( intersectionBox );
intersectionBox->setToDefaultSizeSlice( plane, domainCoord );
coll->updateConnectedEditors();
activeMainOrComparisonView->showGridCells(false);
activeMainOrComparisonView->scheduleCreateDisplayModelAndRedraw();
activeView->scheduleCreateDisplayModelAndRedraw();
RiuMainWindow::instance()->selectAsCurrentItem( intersectionBox, false );
RiuMainWindow::instance()->refreshDrawStyleActions();
}
}
@@ -0,0 +1,29 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2019- Equinor ASA
//
// ResInsight is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE.
//
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
#pragma once
#include "RimIntersectionBox.h"
class QString;
class RicIntersectionFeatureImpl
{
public :
static void createIntersectionBoxSlize(const QString& name, RimIntersectionBox::SinglePlaneState plane );
};
@@ -68,7 +68,7 @@ void RicGeoMechPropertyFilterFeatureImpl::addPropertyFilter( RimGeoMechPropertyF
propertyFilterCollection->reservoirView()->scheduleCreateDisplayModelAndRedraw();
propertyFilterCollection->updateConnectedEditors();
Riu3DMainWindowTools::selectAsCurrentItem( propertyFilter );
Riu3DMainWindowTools::selectAsCurrentItem( propertyFilter , false);
}
//--------------------------------------------------------------------------------------------------
@@ -85,7 +85,7 @@ void RicGeoMechPropertyFilterFeatureImpl::insertPropertyFilter( RimGeoMechProper
propertyFilterCollection->reservoirView()->scheduleCreateDisplayModelAndRedraw();
propertyFilterCollection->updateConnectedEditors();
Riu3DMainWindowTools::selectAsCurrentItem( propertyFilter );
Riu3DMainWindowTools::selectAsCurrentItem( propertyFilter , false);
}
//--------------------------------------------------------------------------------------------------
@@ -39,7 +39,7 @@ CAF_CMD_SOURCE_INIT( RicGeoMechPropertyFilterNewInViewFeature, "RicGeoMechProper
//--------------------------------------------------------------------------------------------------
bool RicGeoMechPropertyFilterNewInViewFeature::isCommandEnabled()
{
Rim3dView* view = RiaApplication::instance()->activeReservoirView();
Rim3dView* view = RiaApplication::instance()->activeMainOrComparisonGridView();
if ( !view ) return false;
RimGeoMechView* geoMechView = dynamic_cast<RimGeoMechView*>( view );
@@ -62,7 +62,7 @@ bool RicGeoMechPropertyFilterNewInViewFeature::isCommandEnabled()
//--------------------------------------------------------------------------------------------------
void RicGeoMechPropertyFilterNewInViewFeature::onActionTriggered( bool isChecked )
{
Rim3dView* view = RiaApplication::instance()->activeReservoirView();
Rim3dView* view = RiaApplication::instance()->activeMainOrComparisonGridView();
if ( !view ) return;
RimGeoMechView* eclView = dynamic_cast<RimGeoMechView*>( view );
if ( !eclView ) return;
@@ -26,23 +26,28 @@
#include "RimGridView.h"
#include "RimViewController.h"
#include "RiuViewer.h"
#include "RiuViewerCommands.h"
#include "cafCmdExecCommandManager.h"
#include <QAction>
#include <QList>
#include <QVariant>
CAF_CMD_SOURCE_INIT( RicNewSliceRangeFilterFeature, "RicNewSliceRangeFilterFeature" );
CAF_CMD_SOURCE_INIT( RicNewSliceRangeFilter3dViewFeature, "RicNewSliceRangeFilter3dViewFeature" );
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RicNewSliceRangeFilterFeature::isCommandEnabled()
bool RicNewSliceRangeFilter3dViewFeature::isCommandEnabled()
{
RimGridView* view = RiaApplication::instance()->activeGridView();
if ( !view ) return false;
RimViewController* vc = view->viewController();
RimGridView* viewOrComparisonView = RiaApplication::instance()->activeMainOrComparisonGridView();
RimViewController* vc = viewOrComparisonView->viewController();
if ( !vc ) return true;
return ( !vc->isRangeFiltersControlled() );
@@ -51,14 +56,16 @@ bool RicNewSliceRangeFilterFeature::isCommandEnabled()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicNewSliceRangeFilterFeature::onActionTriggered( bool isChecked )
void RicNewSliceRangeFilter3dViewFeature::onActionTriggered( bool isChecked )
{
QVariant userData = this->userData();
if ( !userData.isNull() && userData.type() == QVariant::List )
{
RimGridView* view = RiaApplication::instance()->activeGridView();
RimCellRangeFilterCollection* rangeFilterCollection = view->rangeFilterCollection();
RimGridView* activeView = RiaApplication::instance()->activeGridView();
RimGridView* viewOrComparisonView = RiaApplication::instance()->activeMainOrComparisonGridView();
RimCellRangeFilterCollection* rangeFilterCollection = viewOrComparisonView->rangeFilterCollection();
RicRangeFilterNewExec* filterExec = new RicRangeFilterNewExec( rangeFilterCollection );
@@ -87,14 +94,14 @@ void RicNewSliceRangeFilterFeature::onActionTriggered( bool isChecked )
}
caf::CmdExecCommandManager::instance()->processExecuteCommand( filterExec );
view->setSurfaceDrawstyle();
activeView->setSurfaceDrawstyle();
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicNewSliceRangeFilterFeature::setupActionLook( QAction* actionToSetup )
void RicNewSliceRangeFilter3dViewFeature::setupActionLook( QAction* actionToSetup )
{
actionToSetup->setIcon( QIcon( ":/CellFilter_Range.png" ) );
}
@@ -23,7 +23,7 @@
//==================================================================================================
///
//==================================================================================================
class RicNewSliceRangeFilterFeature : public caf::CmdFeature
class RicNewSliceRangeFilter3dViewFeature : public caf::CmdFeature
{
CAF_CMD_HEADER_INIT;
@@ -73,7 +73,7 @@ void RicRangeFilterNewExec::redo()
m_cellRangeFilterCollection->updateConnectedEditors();
Riu3DMainWindowTools::selectAsCurrentItem( rangeFilter );
Riu3DMainWindowTools::selectAsCurrentItem( rangeFilter, false );
// Trigger update of view following the range filter update
RimGridView* view = nullptr;
@@ -68,7 +68,9 @@ bool RicSelectColorResult::isCommandEnabled()
//--------------------------------------------------------------------------------------------------
void RicSelectColorResult::onActionTriggered( bool isChecked )
{
Rim3dView* activeView = RiaApplication::instance()->activeReservoirView();
Rim3dView* activeView = RiaApplication::instance()->activeMainOrComparisonGridView();
bool isComparisonView = (activeView != RiaApplication::instance()->activeGridView());
Rim2dIntersectionView* int2dView = dynamic_cast<Rim2dIntersectionView*>( activeView );
RimGridView* gridView = nullptr;
@@ -80,13 +82,13 @@ void RicSelectColorResult::onActionTriggered( bool isChecked )
RimEclipseView* eclView = dynamic_cast<RimEclipseView*>( gridView );
if ( eclView )
{
Riu3DMainWindowTools::selectAsCurrentItem( eclView->cellResult(), int2dView == nullptr );
Riu3DMainWindowTools::selectAsCurrentItem( eclView->cellResult(), int2dView == nullptr && !isComparisonView );
return;
}
RimGeoMechView* geoMechView = dynamic_cast<RimGeoMechView*>( gridView );
if ( geoMechView )
{
Riu3DMainWindowTools::selectAsCurrentItem( geoMechView->cellResult(), int2dView == nullptr );
Riu3DMainWindowTools::selectAsCurrentItem( geoMechView->cellResult(), int2dView == nullptr && !isComparisonView );
}
}