mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Merge pull request #4907 from OPM/feature-picking-in-comparison-view
Feature fix picking in comparison view step 1
This commit is contained in:
commit
63917a61b5
@ -84,6 +84,9 @@
|
||||
#include "RimWellPltPlot.h"
|
||||
#include "RimWellRftPlot.h"
|
||||
|
||||
#include "RiuViewer.h"
|
||||
#include "RiuViewerCommands.h"
|
||||
|
||||
#include "cafPdmSettings.h"
|
||||
#include "cafPdmUiModelChangeDetector.h"
|
||||
#include "cafProgressInfo.h"
|
||||
@ -258,6 +261,25 @@ RimGridView* RiaApplication::activeGridView()
|
||||
return dynamic_cast<RimGridView*>( m_activeReservoirView.p() );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimGridView* RiaApplication::activeMainOrComparisonGridView()
|
||||
{
|
||||
RimGridView* activeView = RiaApplication::instance()->activeGridView();
|
||||
RimGridView* viewOrComparisonView = activeView;
|
||||
|
||||
if ( activeView->viewer()->viewerCommands()->isCurrentPickInComparisonView() )
|
||||
{
|
||||
if ( RimGridView* compView = dynamic_cast<RimGridView*>( activeView->activeComparisonView() ) )
|
||||
{
|
||||
viewOrComparisonView = compView;
|
||||
}
|
||||
}
|
||||
|
||||
return viewOrComparisonView;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -112,6 +112,7 @@ public:
|
||||
Rim3dView* activeReservoirView();
|
||||
const Rim3dView* activeReservoirView() const;
|
||||
RimGridView* activeGridView();
|
||||
RimGridView* activeMainOrComparisonGridView();
|
||||
|
||||
RimProject* project();
|
||||
|
||||
|
@ -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 );
|
||||
}
|
||||
}
|
||||
|
@ -225,7 +225,10 @@ void RimAnnotationCollection::updateViewAnnotationCollections()
|
||||
|
||||
for ( const auto* view : views )
|
||||
{
|
||||
view->annotationCollection()->onGlobalCollectionChanged( this );
|
||||
if (view->annotationCollection())
|
||||
{
|
||||
view->annotationCollection()->onGlobalCollectionChanged( this );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -131,13 +131,6 @@ Rim3dView::Rim3dView( void )
|
||||
|
||||
CAF_PDM_InitField( &m_isComparisonViewEnabled, "EnableComparisonView", false, "Enable", "", "", "" );
|
||||
CAF_PDM_InitFieldNoDefault( &m_comparisonView, "ComparisonView", "Comparison View", "", "", "" );
|
||||
CAF_PDM_InitField( &m_isComparisonViewLinkingTimestep,
|
||||
"EnableComparisonViewTimestepLinking",
|
||||
true,
|
||||
"Link Timestep",
|
||||
"",
|
||||
"",
|
||||
"" );
|
||||
|
||||
m_crossSectionVizModel = new cvf::ModelBasicList;
|
||||
m_crossSectionVizModel->setName( "CrossSectionModel" );
|
||||
@ -332,13 +325,13 @@ void Rim3dView::defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOr
|
||||
|
||||
caf::PdmUiGroup* gridGroup = uiOrdering.addNewGroup( "Grid Appearance" );
|
||||
gridGroup->add( &scaleZ );
|
||||
scaleZ.uiCapability()->setUiReadOnly( !this->isScaleZEditable() );
|
||||
gridGroup->add( &meshMode );
|
||||
gridGroup->add( &surfaceMode );
|
||||
|
||||
caf::PdmUiGroup* compViewGroup = uiOrdering.addNewGroup( "Comparison View" );
|
||||
compViewGroup->add( &m_isComparisonViewEnabled );
|
||||
compViewGroup->add( &m_comparisonView );
|
||||
compViewGroup->add( &m_isComparisonViewLinkingTimestep );
|
||||
|
||||
uiOrdering.skipRemainingFields( true );
|
||||
}
|
||||
@ -410,6 +403,15 @@ std::set<Rim3dView*> Rim3dView::viewsUsingThisAsComparisonView()
|
||||
return containingViews;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool Rim3dView::isScaleZEditable()
|
||||
{
|
||||
return ( this->viewsUsingThisAsComparisonView().empty() ||
|
||||
( this->viewController() && this->viewController()->isCameraLinked() ) );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -497,7 +499,7 @@ void Rim3dView::updateCurrentTimeStepAndRedraw()
|
||||
}
|
||||
|
||||
std::set<Rim3dView*> containerViews = this->viewsUsingThisAsComparisonView();
|
||||
if ( !containerViews.empty() && !isUsingOverrideViewer())
|
||||
if ( !containerViews.empty() && !isUsingOverrideViewer() )
|
||||
{
|
||||
for ( auto view : containerViews )
|
||||
{
|
||||
@ -815,13 +817,7 @@ void Rim3dView::fieldChangedByUi( const caf::PdmFieldHandle* changedField,
|
||||
createDisplayModelAndRedraw();
|
||||
}
|
||||
}
|
||||
else if ( changedField == &m_isComparisonViewLinkingTimestep )
|
||||
{
|
||||
if ( m_isComparisonViewEnabled() && m_comparisonView() )
|
||||
{
|
||||
createDisplayModelAndRedraw();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -912,19 +908,6 @@ void Rim3dView::addMeasurementToModel( cvf::ModelBasicList* wellPathModelBasicLi
|
||||
wellPathModelBasicList->updateBoundingBoxesRecursive();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void Rim3dView::setScaleZAndUpdate( double scalingFactor )
|
||||
{
|
||||
this->scaleZ = scalingFactor;
|
||||
updateScaleTransform();
|
||||
|
||||
this->updateGridBoxData();
|
||||
|
||||
this->scheduleCreateDisplayModelAndRedraw();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -986,6 +969,16 @@ void Rim3dView::updateAnnotationItems()
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void Rim3dView::setScaleZAndUpdate( double scalingFactor )
|
||||
{
|
||||
this->scaleZ = scalingFactor;
|
||||
|
||||
updateScaling();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -1006,14 +999,18 @@ void Rim3dView::updateScaling()
|
||||
|
||||
viewer()->mainCamera()->setFromLookAt( eye, eye + dir, up );
|
||||
viewer()->setPointOfInterest( poi );
|
||||
|
||||
updateScaleTransform();
|
||||
createDisplayModelAndRedraw();
|
||||
|
||||
viewer()->update();
|
||||
|
||||
updateZScaleLabel();
|
||||
}
|
||||
|
||||
if (activeComparisonView())
|
||||
{
|
||||
activeComparisonView()->setScaleZAndUpdate(scaleZ);
|
||||
}
|
||||
|
||||
updateScaleTransform();
|
||||
updateGridBoxData();
|
||||
updateZScaleLabel();
|
||||
|
||||
this->scheduleCreateDisplayModelAndRedraw();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -1023,7 +1020,8 @@ void Rim3dView::updateZScaleLabel()
|
||||
{
|
||||
// Update Z scale label
|
||||
int scale = static_cast<int>( scaleZ() );
|
||||
nativeOrOverrideViewer()->setZScale( scale );
|
||||
|
||||
if ( viewer() ) viewer()->setZScale( scale );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -1045,6 +1043,12 @@ void Rim3dView::createHighlightAndGridBoxDisplayModelWithRedraw()
|
||||
{
|
||||
createHighlightAndGridBoxDisplayModel();
|
||||
|
||||
if ( Rim3dView* depView = prepareComparisonView() )
|
||||
{
|
||||
depView->createHighlightAndGridBoxDisplayModel();
|
||||
restoreComparisonView();
|
||||
}
|
||||
|
||||
if ( nativeOrOverrideViewer() )
|
||||
{
|
||||
nativeOrOverrideViewer()->update();
|
||||
@ -1419,12 +1423,11 @@ Rim3dView* Rim3dView::prepareComparisonView()
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
m_comparisonViewOrgTimestep = depView->currentTimeStep();
|
||||
depView->m_currentTimeStep = currentTimeStep();
|
||||
depView->clampCurrentTimestep();
|
||||
|
||||
m_comparisonViewOrgZScale = depView->scaleZ();
|
||||
depView->scaleZ = scaleZ();
|
||||
if ( depView->scaleZ() != scaleZ() )
|
||||
{
|
||||
depView->setScaleZAndUpdate( scaleZ() );
|
||||
}
|
||||
|
||||
viewer()->setComparisonViewEyePointOffset( RimViewManipulator::calculateEquivalentCamPosOffset( this, depView ) );
|
||||
|
||||
@ -1442,6 +1445,6 @@ void Rim3dView::restoreComparisonView()
|
||||
CVF_ASSERT( depView );
|
||||
|
||||
depView->setOverrideViewer( nullptr );
|
||||
depView->m_currentTimeStep = m_comparisonViewOrgTimestep;
|
||||
depView->scaleZ = m_comparisonViewOrgZScale;
|
||||
viewer()->setCurrentComparisonFrame(depView->currentTimeStep());
|
||||
|
||||
}
|
||||
|
@ -163,7 +163,11 @@ public:
|
||||
void updateZScaleLabel();
|
||||
void updateMeasurement();
|
||||
|
||||
bool isMasterView() const;
|
||||
bool isMasterView() const;
|
||||
Rim3dView* activeComparisonView() const;
|
||||
bool isScaleZEditable();
|
||||
|
||||
std::set<Rim3dView*> viewsUsingThisAsComparisonView();
|
||||
|
||||
cvf::ref<caf::DisplayCoordTransform> displayCoordTransform() const override;
|
||||
|
||||
@ -296,9 +300,7 @@ private:
|
||||
|
||||
// Pure private methods : Override viewer and comparison view
|
||||
|
||||
void setOverrideViewer( RiuViewer* overrideViewer );
|
||||
Rim3dView* activeComparisonView() const;
|
||||
std::set<Rim3dView*> viewsUsingThisAsComparisonView();
|
||||
void setOverrideViewer( RiuViewer* overrideViewer );
|
||||
|
||||
Rim3dView* prepareComparisonView();
|
||||
void restoreComparisonView();
|
||||
@ -319,5 +321,4 @@ private:
|
||||
caf::PdmField<bool> m_showZScaleLabel;
|
||||
caf::PdmField<bool> m_isComparisonViewEnabled;
|
||||
caf::PdmPtrField<Rim3dView*> m_comparisonView;
|
||||
caf::PdmField<bool> m_isComparisonViewLinkingTimestep;
|
||||
};
|
||||
|
@ -294,7 +294,7 @@ void RimEclipseView::fieldChangedByUi( const caf::PdmFieldHandle* changedField,
|
||||
const QVariant& oldValue,
|
||||
const QVariant& newValue )
|
||||
{
|
||||
Rim3dView::fieldChangedByUi( changedField, oldValue, newValue );
|
||||
RimGridView::fieldChangedByUi( changedField, oldValue, newValue );
|
||||
|
||||
if ( changedField == &m_showInvalidCells )
|
||||
{
|
||||
@ -1169,16 +1169,12 @@ void RimEclipseView::updateLegends()
|
||||
}
|
||||
else
|
||||
{
|
||||
nativeOrOverrideViewer()->removeColorLegend( this->cellEdgeResult()->legendConfig()->titledOverlayFrame() );
|
||||
nativeOrOverrideViewer()->removeColorLegend( fractureColors()->activeLegend()->titledOverlayFrame() );
|
||||
nativeOrOverrideViewer()->removeColorLegend(
|
||||
m_virtualPerforationResult->legendConfig()->titledOverlayFrame() );
|
||||
nativeOrOverrideViewer()->removeColorLegend( this->cellResult()->legendConfig()->titledOverlayFrame() );
|
||||
nativeOrOverrideViewer()->removeColorLegend( this->cellResult()->ternaryLegendConfig()->titledOverlayFrame() );
|
||||
nativeOrOverrideViewer()->removeColorLegend(
|
||||
this->currentFaultResultColors()->legendConfig()->titledOverlayFrame() );
|
||||
nativeOrOverrideViewer()->removeColorLegend(
|
||||
this->currentFaultResultColors()->ternaryLegendConfig()->titledOverlayFrame() );
|
||||
std::vector<RimLegendConfig*> legendConfs = this->legendConfigs();
|
||||
|
||||
for (auto legendConf : legendConfs)
|
||||
{
|
||||
nativeOrOverrideViewer()->removeColorLegend(legendConf->titledOverlayFrame());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -440,8 +440,12 @@ void RimGeoMechView::updateLegends()
|
||||
}
|
||||
else
|
||||
{
|
||||
nativeOrOverrideViewer()->removeColorLegend( cellResult()->legendConfig->titledOverlayFrame() );
|
||||
nativeOrOverrideViewer()->removeColorLegend( m_tensorResults->arrowColorLegendConfig->titledOverlayFrame() );
|
||||
std::vector<RimLegendConfig*> legendConfs = this->legendConfigs();
|
||||
|
||||
for (auto legendConf : legendConfs)
|
||||
{
|
||||
nativeOrOverrideViewer()->removeColorLegend(legendConf->titledOverlayFrame());
|
||||
}
|
||||
}
|
||||
|
||||
this->updateLegendTextAndRanges( cellResult()->legendConfig(), m_currentTimeStep() );
|
||||
@ -752,7 +756,7 @@ void RimGeoMechView::fieldChangedByUi( const caf::PdmFieldHandle* changedField,
|
||||
const QVariant& oldValue,
|
||||
const QVariant& newValue )
|
||||
{
|
||||
Rim3dView::fieldChangedByUi( changedField, oldValue, newValue );
|
||||
RimGridView::fieldChangedByUi( changedField, oldValue, newValue );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -418,14 +418,6 @@ void RimGridView::fieldChangedByUi( const caf::PdmFieldHandle* changedField,
|
||||
viewLinker->updateCamera( this );
|
||||
}
|
||||
}
|
||||
else if ( changedField == &m_currentTimeStep )
|
||||
{
|
||||
RimViewLinker* viewLinker = this->assosiatedViewLinker();
|
||||
if ( viewLinker )
|
||||
{
|
||||
viewLinker->updateTimeStep( this, m_currentTimeStep );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -255,7 +255,7 @@ void RimIntersectionCollection::appendIntersectionBoxAndUpdate( RimIntersectionB
|
||||
m_intersectionBoxes.push_back( intersectionBox );
|
||||
|
||||
updateConnectedEditors();
|
||||
Riu3DMainWindowTools::selectAsCurrentItem( intersectionBox );
|
||||
Riu3DMainWindowTools::selectAsCurrentItem( intersectionBox, false );
|
||||
|
||||
Rim3dView* rimView = nullptr;
|
||||
firstAncestorOrThisOfType( rimView );
|
||||
|
@ -286,12 +286,7 @@ QString RimViewLinker::displayNameForView( RimGridView* view )
|
||||
|
||||
if ( view )
|
||||
{
|
||||
RimCase* rimCase = nullptr;
|
||||
view->firstAncestorOrThisOfType( rimCase );
|
||||
if ( rimCase )
|
||||
{
|
||||
displayName = rimCase->caseUserDescription() + ": " + view->name();
|
||||
}
|
||||
displayName = view->autoName();
|
||||
}
|
||||
|
||||
return displayName;
|
||||
@ -437,29 +432,8 @@ void RimViewLinker::findNameAndIconFromView( QString* name, caf::QIconProvider*
|
||||
CVF_ASSERT( name && icon );
|
||||
|
||||
*name = displayNameForView( view );
|
||||
*icon = view->uiIconProvider();
|
||||
|
||||
if ( view )
|
||||
{
|
||||
RimCase* rimCase = nullptr;
|
||||
view->firstAncestorOrThisOfType( rimCase );
|
||||
|
||||
if ( dynamic_cast<RimGeoMechCase*>( rimCase ) )
|
||||
{
|
||||
*icon = caf::QIconProvider( ":/GeoMechCase48x48.png" );
|
||||
}
|
||||
else if ( dynamic_cast<RimEclipseResultCase*>( rimCase ) )
|
||||
{
|
||||
*icon = caf::QIconProvider( ":/Case48x48.png" );
|
||||
}
|
||||
else if ( dynamic_cast<RimEclipseInputCase*>( rimCase ) )
|
||||
{
|
||||
*icon = caf::QIconProvider( ":/EclipseInput48x48.png" );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
*icon = caf::QIconProvider();
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -55,18 +55,7 @@ bool RiuCadNavigation::handleInputEvent( QInputEvent* inputEvent )
|
||||
|
||||
if ( me->button() == Qt::MidButton && me->modifiers() == Qt::NoModifier && isRotationEnabled() )
|
||||
{
|
||||
cvf::HitItemCollection hic;
|
||||
bool hitSomething = m_viewer->rayPick( me->x(), me->y(), &hic );
|
||||
|
||||
if ( hitSomething )
|
||||
{
|
||||
cvf::Vec3d pointOfInterest = hic.firstItem()->intersectionPoint();
|
||||
this->setPointOfInterest( pointOfInterest );
|
||||
}
|
||||
else
|
||||
{
|
||||
initializeRotationCenter();
|
||||
}
|
||||
this->pickAndSetPointOfInterest(me->x(), me->y());
|
||||
|
||||
m_trackball->startNavigation( cvf::ManipulatorTrackball::ROTATE, translatedMousePosX, translatedMousePosY );
|
||||
m_isNavigating = true;
|
||||
|
@ -55,18 +55,7 @@ bool RiuGeoQuestNavigation::handleInputEvent( QInputEvent* inputEvent )
|
||||
|
||||
if ( me->button() == Qt::LeftButton && isRotationEnabled() )
|
||||
{
|
||||
cvf::HitItemCollection hic;
|
||||
bool hitSomething = m_viewer->rayPick( me->x(), me->y(), &hic );
|
||||
|
||||
if ( hitSomething )
|
||||
{
|
||||
cvf::Vec3d pointOfInterest = hic.firstItem()->intersectionPoint();
|
||||
this->setPointOfInterest( pointOfInterest );
|
||||
}
|
||||
else
|
||||
{
|
||||
initializeRotationCenter();
|
||||
}
|
||||
this->pickAndSetPointOfInterest(me->x(), me->y());
|
||||
|
||||
m_trackball->startNavigation( cvf::ManipulatorTrackball::ROTATE, translatedMousePosX, translatedMousePosY );
|
||||
m_isNavigating = true;
|
||||
|
@ -1790,7 +1790,7 @@ void RiuMainWindow::updateScaleValue()
|
||||
{
|
||||
Rim3dView* view = RiaApplication::instance()->activeReservoirView();
|
||||
bool isRegularReservoirView = view && dynamic_cast<RimEclipseContourMapView*>( view ) == nullptr;
|
||||
if ( isRegularReservoirView )
|
||||
if ( isRegularReservoirView && view->isScaleZEditable() )
|
||||
{
|
||||
m_scaleFactor->setEnabled( true );
|
||||
|
||||
|
@ -55,18 +55,7 @@ bool RiuRmsNavigation::handleInputEvent( QInputEvent* inputEvent )
|
||||
|
||||
if ( me->button() == Qt::MidButton && isRotationEnabled() )
|
||||
{
|
||||
cvf::HitItemCollection hic;
|
||||
bool hitSomething = m_viewer->rayPick( me->x(), me->y(), &hic );
|
||||
|
||||
if ( hitSomething )
|
||||
{
|
||||
cvf::Vec3d pointOfInterest = hic.firstItem()->intersectionPoint();
|
||||
this->setPointOfInterest( pointOfInterest );
|
||||
}
|
||||
else
|
||||
{
|
||||
initializeRotationCenter();
|
||||
}
|
||||
this->pickAndSetPointOfInterest(me->x(), me->y());
|
||||
|
||||
m_trackball->startNavigation( cvf::ManipulatorTrackball::ROTATE, translatedMousePosX, translatedMousePosY );
|
||||
m_isNavigating = true;
|
||||
|
@ -182,6 +182,7 @@ RiuViewer::RiuViewer( const QGLFormat& format, QWidget* parent )
|
||||
m_scaleLegend->setOrientation( caf::OverlayScaleLegend::HORIZONTAL );
|
||||
|
||||
m_comparisonWindowMover = new RiuComparisonViewMover( this );
|
||||
this->setComparisonViewToFollowAnimation(false);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -309,6 +310,18 @@ void RiuViewer::slotSetCurrentFrame( int frameIndex )
|
||||
{
|
||||
viewLinker->updateTimeStep( dynamic_cast<RimGridView*>( m_rimView.p() ), frameIndex );
|
||||
}
|
||||
|
||||
// Update views using this as comparison
|
||||
Rim3dView* view = dynamic_cast<Rim3dView*>( m_rimView.p() );
|
||||
if (view)
|
||||
{
|
||||
std::set<Rim3dView*> containingViews = view->viewsUsingThisAsComparisonView();
|
||||
|
||||
for ( auto contView : containingViews )
|
||||
{
|
||||
contView->updateCurrentTimeStepAndRedraw();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -974,13 +987,11 @@ void RiuViewer::setAxisLabels( const cvf::String& xLabel, const cvf::String& yLa
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
cvf::Vec3d RiuViewer::lastPickPositionInDomainCoords() const
|
||||
RiuViewerCommands* RiuViewer::viewerCommands() const
|
||||
{
|
||||
CVF_ASSERT( m_viewerCommands );
|
||||
|
||||
return m_viewerCommands->lastPickPositionInDomainCoords();
|
||||
return m_viewerCommands;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -120,7 +120,7 @@ public:
|
||||
void showAxisCross( bool enable );
|
||||
void setAxisLabels( const cvf::String& xLabel, const cvf::String& yLabel, const cvf::String& zLabel );
|
||||
|
||||
cvf::Vec3d lastPickPositionInDomainCoords() const;
|
||||
RiuViewerCommands* viewerCommands() const;
|
||||
|
||||
cvf::OverlayItem* pickFixedPositionedLegend( int winPosX, int winPosY );
|
||||
|
||||
|
@ -165,6 +165,10 @@ void RiuViewerCommands::displayContextMenu( QMouseEvent* event )
|
||||
}
|
||||
}
|
||||
|
||||
m_isCurrentPickInComparisonView = m_viewer->isMousePosWithinComparisonView( event->x(), event->y() );
|
||||
Rim3dView* mainOrComparisonView = m_isCurrentPickInComparisonView ? m_reservoirView->activeComparisonView()
|
||||
: m_reservoirView.p();
|
||||
|
||||
// Find the following data
|
||||
|
||||
const cvf::Part* firstHitPart = nullptr;
|
||||
@ -202,9 +206,9 @@ void RiuViewerCommands::displayContextMenu( QMouseEvent* event )
|
||||
|
||||
cvf::Vec3d displayModelOffset = cvf::Vec3d::ZERO;
|
||||
|
||||
if ( m_reservoirView.p() )
|
||||
if ( mainOrComparisonView )
|
||||
{
|
||||
cvf::ref<caf::DisplayCoordTransform> transForm = m_reservoirView.p()->displayCoordTransform();
|
||||
cvf::ref<caf::DisplayCoordTransform> transForm = mainOrComparisonView->displayCoordTransform();
|
||||
m_currentPickPositionInDomainCoords = transForm->transformToDomainCoord( globalIntersectionPoint );
|
||||
}
|
||||
}
|
||||
@ -218,8 +222,8 @@ void RiuViewerCommands::displayContextMenu( QMouseEvent* event )
|
||||
|
||||
// Check type of view
|
||||
|
||||
RimGridView* gridView = dynamic_cast<RimGridView*>( m_reservoirView.p() );
|
||||
Rim2dIntersectionView* int2dView = dynamic_cast<Rim2dIntersectionView*>( m_reservoirView.p() );
|
||||
RimGridView* gridView = dynamic_cast<RimGridView*>( mainOrComparisonView );
|
||||
Rim2dIntersectionView* int2dView = dynamic_cast<Rim2dIntersectionView*>( mainOrComparisonView );
|
||||
|
||||
if ( firstHitPart && firstPartTriangleIndex != cvf::UNDEFINED_UINT )
|
||||
{
|
||||
@ -250,7 +254,8 @@ void RiuViewerCommands::displayContextMenu( QMouseEvent* event )
|
||||
}
|
||||
else if ( crossSectionSourceInfo )
|
||||
{
|
||||
findCellAndGridIndex( crossSectionSourceInfo,
|
||||
findCellAndGridIndex( mainOrComparisonView,
|
||||
crossSectionSourceInfo,
|
||||
firstPartTriangleIndex,
|
||||
&m_currentCellIndex,
|
||||
&m_currentGridIdx );
|
||||
@ -273,7 +278,8 @@ void RiuViewerCommands::displayContextMenu( QMouseEvent* event )
|
||||
}
|
||||
else if ( intersectionBoxSourceInfo )
|
||||
{
|
||||
findCellAndGridIndex( intersectionBoxSourceInfo,
|
||||
findCellAndGridIndex( mainOrComparisonView,
|
||||
intersectionBoxSourceInfo,
|
||||
firstPartTriangleIndex,
|
||||
&m_currentCellIndex,
|
||||
&m_currentGridIdx );
|
||||
@ -290,12 +296,12 @@ void RiuViewerCommands::displayContextMenu( QMouseEvent* event )
|
||||
{
|
||||
// IJK -slice commands
|
||||
RimViewController* viewController = nullptr;
|
||||
if ( m_reservoirView ) viewController = m_reservoirView->viewController();
|
||||
if ( mainOrComparisonView ) viewController = mainOrComparisonView->viewController();
|
||||
|
||||
if ( !viewController || !viewController->isRangeFiltersControlled() )
|
||||
{
|
||||
size_t i, j, k;
|
||||
ijkFromCellIndex( m_currentGridIdx, m_currentCellIndex, &i, &j, &k );
|
||||
ijkFromCellIndex( mainOrComparisonView, m_currentGridIdx, m_currentCellIndex, &i, &j, &k );
|
||||
|
||||
QVariantList iSliceList;
|
||||
iSliceList.push_back( 0 );
|
||||
@ -314,13 +320,13 @@ void RiuViewerCommands::displayContextMenu( QMouseEvent* event )
|
||||
|
||||
menuBuilder.subMenuStart( "Range Filter Slice", QIcon( ":/CellFilter_Range.png" ) );
|
||||
|
||||
menuBuilder.addCmdFeatureWithUserData( "RicNewSliceRangeFilterFeature",
|
||||
menuBuilder.addCmdFeatureWithUserData( "RicNewSliceRangeFilter3dViewFeature",
|
||||
"I-slice Range Filter",
|
||||
iSliceList );
|
||||
menuBuilder.addCmdFeatureWithUserData( "RicNewSliceRangeFilterFeature",
|
||||
menuBuilder.addCmdFeatureWithUserData( "RicNewSliceRangeFilter3dViewFeature",
|
||||
"J-slice Range Filter",
|
||||
jSliceList );
|
||||
menuBuilder.addCmdFeatureWithUserData( "RicNewSliceRangeFilterFeature",
|
||||
menuBuilder.addCmdFeatureWithUserData( "RicNewSliceRangeFilter3dViewFeature",
|
||||
"K-slice Range Filter",
|
||||
kSliceList );
|
||||
|
||||
@ -347,7 +353,7 @@ void RiuViewerCommands::displayContextMenu( QMouseEvent* event )
|
||||
|
||||
menuBuilder.addSeparator();
|
||||
|
||||
RimEclipseView* eclipseView = dynamic_cast<RimEclipseView*>( m_reservoirView.p() );
|
||||
RimEclipseView* eclipseView = dynamic_cast<RimEclipseView*>( mainOrComparisonView );
|
||||
if ( eclipseView )
|
||||
{
|
||||
// Hide faults command
|
||||
@ -582,11 +588,15 @@ void RiuViewerCommands::handlePickAction( int winPosX, int winPosY, Qt::Keyboard
|
||||
}
|
||||
}
|
||||
|
||||
m_isCurrentPickInComparisonView = m_viewer->isMousePosWithinComparisonView( winPosX, winPosY );
|
||||
Rim3dView* mainOrComparisonView = m_isCurrentPickInComparisonView ? m_reservoirView->activeComparisonView()
|
||||
: m_reservoirView.p();
|
||||
|
||||
// Make pickEventHandlers do their stuff
|
||||
|
||||
if ( pickItemInfos.size() )
|
||||
{
|
||||
Ric3dPickEvent viewerEventObject( pickItemInfos, m_reservoirView );
|
||||
Ric3dPickEvent viewerEventObject( pickItemInfos, mainOrComparisonView );
|
||||
|
||||
if ( sm_overridingPickHandler && sm_overridingPickHandler->handle3dPickEvent( viewerEventObject ) )
|
||||
{
|
||||
@ -630,7 +640,7 @@ void RiuViewerCommands::handlePickAction( int winPosX, int winPosY, Qt::Keyboard
|
||||
size_t indexToNncItemNearFirstItem = cvf::UNDEFINED_SIZE_T;
|
||||
;
|
||||
|
||||
findFirstItems( pickItemInfos, &indexToFirstNoneNncItem, &indexToNncItemNearFirstItem );
|
||||
findFirstItems( mainOrComparisonView, pickItemInfos, &indexToFirstNoneNncItem, &indexToNncItemNearFirstItem );
|
||||
|
||||
if ( indexToFirstNoneNncItem != cvf::UNDEFINED_SIZE_T )
|
||||
{
|
||||
@ -716,10 +726,10 @@ void RiuViewerCommands::handlePickAction( int winPosX, int winPosY, Qt::Keyboard
|
||||
// Set fracture resultInfo text
|
||||
QString resultInfoText;
|
||||
|
||||
cvf::ref<caf::DisplayCoordTransform> transForm = m_reservoirView->displayCoordTransform();
|
||||
cvf::ref<caf::DisplayCoordTransform> transForm = mainOrComparisonView->displayCoordTransform();
|
||||
cvf::Vec3d domainCoord = transForm->transformToDomainCoord( globalIntersectionPoint );
|
||||
|
||||
RimEclipseView* eclView = dynamic_cast<RimEclipseView*>( m_reservoirView.p() );
|
||||
RimEclipseView* eclView = dynamic_cast<RimEclipseView*>( mainOrComparisonView );
|
||||
RivWellFracturePartMgr* partMgr = fracture->fracturePartManager();
|
||||
if ( eclView ) resultInfoText = partMgr->resultInfoText( *eclView, domainCoord );
|
||||
|
||||
@ -763,7 +773,11 @@ void RiuViewerCommands::handlePickAction( int winPosX, int winPosY, Qt::Keyboard
|
||||
}
|
||||
else if ( crossSectionSourceInfo )
|
||||
{
|
||||
findCellAndGridIndex( crossSectionSourceInfo, firstPartTriangleIndex, &cellIndex, &gridIndex );
|
||||
findCellAndGridIndex( mainOrComparisonView,
|
||||
crossSectionSourceInfo,
|
||||
firstPartTriangleIndex,
|
||||
&cellIndex,
|
||||
&gridIndex );
|
||||
intersectionHit = true;
|
||||
intersectionTriangleHit = crossSectionSourceInfo->triangle( firstPartTriangleIndex );
|
||||
|
||||
@ -775,7 +789,11 @@ void RiuViewerCommands::handlePickAction( int winPosX, int winPosY, Qt::Keyboard
|
||||
}
|
||||
else if ( intersectionBoxSourceInfo )
|
||||
{
|
||||
findCellAndGridIndex( intersectionBoxSourceInfo, firstPartTriangleIndex, &cellIndex, &gridIndex );
|
||||
findCellAndGridIndex( mainOrComparisonView,
|
||||
intersectionBoxSourceInfo,
|
||||
firstPartTriangleIndex,
|
||||
&cellIndex,
|
||||
&gridIndex );
|
||||
intersectionHit = true;
|
||||
intersectionTriangleHit = intersectionBoxSourceInfo->triangle( firstPartTriangleIndex );
|
||||
|
||||
@ -796,7 +814,7 @@ void RiuViewerCommands::handlePickAction( int winPosX, int winPosY, Qt::Keyboard
|
||||
size_t globalCellIndex = wellConnectionSourceInfo->globalCellIndexFromTriangleIndex(
|
||||
firstPartTriangleIndex );
|
||||
|
||||
RimEclipseView* eclipseView = dynamic_cast<RimEclipseView*>( m_reservoirView.p() );
|
||||
RimEclipseView* eclipseView = dynamic_cast<RimEclipseView*>( mainOrComparisonView );
|
||||
if ( eclipseView )
|
||||
{
|
||||
RimEclipseCase* eclipseCase = nullptr;
|
||||
@ -875,7 +893,7 @@ void RiuViewerCommands::handlePickAction( int winPosX, int winPosY, Qt::Keyboard
|
||||
double connectionFactor = simWellConnectionSourceInfo->connectionFactorFromTriangleIndex(
|
||||
firstPartTriangleIndex );
|
||||
|
||||
RimEclipseView* eclipseView = dynamic_cast<RimEclipseView*>( m_reservoirView.p() );
|
||||
RimEclipseView* eclipseView = dynamic_cast<RimEclipseView*>( mainOrComparisonView );
|
||||
if ( eclipseView )
|
||||
{
|
||||
RimEclipseCase* eclipseCase = nullptr;
|
||||
@ -949,9 +967,9 @@ void RiuViewerCommands::handlePickAction( int winPosX, int winPosY, Qt::Keyboard
|
||||
|
||||
RiuSelectionItem* selItem = nullptr;
|
||||
{
|
||||
Rim2dIntersectionView* intersectionView = dynamic_cast<Rim2dIntersectionView*>( m_reservoirView.p() );
|
||||
RimEclipseView* eclipseView = dynamic_cast<RimEclipseView*>( m_reservoirView.p() );
|
||||
RimGeoMechView* geomView = dynamic_cast<RimGeoMechView*>( m_reservoirView.p() );
|
||||
Rim2dIntersectionView* intersectionView = dynamic_cast<Rim2dIntersectionView*>( mainOrComparisonView );
|
||||
RimEclipseView* eclipseView = dynamic_cast<RimEclipseView*>( mainOrComparisonView );
|
||||
RimGeoMechView* geomView = dynamic_cast<RimGeoMechView*>( mainOrComparisonView );
|
||||
|
||||
if ( intersectionView )
|
||||
{
|
||||
@ -1033,6 +1051,14 @@ cvf::Vec3d RiuViewerCommands::lastPickPositionInDomainCoords() const
|
||||
return m_currentPickPositionInDomainCoords;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RiuViewerCommands::isCurrentPickInComparisonView() const
|
||||
{
|
||||
return m_isCurrentPickInComparisonView;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -1063,14 +1089,15 @@ void RiuViewerCommands::removeDefaultPickEventHandler( RicDefaultPickEventHandle
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuViewerCommands::findCellAndGridIndex( const RivIntersectionSourceInfo* crossSectionSourceInfo,
|
||||
void RiuViewerCommands::findCellAndGridIndex( Rim3dView* mainOrComparisonView,
|
||||
const RivIntersectionSourceInfo* crossSectionSourceInfo,
|
||||
cvf::uint firstPartTriangleIndex,
|
||||
size_t* cellIndex,
|
||||
size_t* gridIndex )
|
||||
{
|
||||
CVF_ASSERT( cellIndex && gridIndex );
|
||||
|
||||
RimCase* ownerCase = m_reservoirView->ownerCase();
|
||||
RimCase* ownerCase = mainOrComparisonView->ownerCase();
|
||||
RimEclipseCase* eclipseCase = dynamic_cast<RimEclipseCase*>( ownerCase );
|
||||
RimGeoMechCase* geomCase = dynamic_cast<RimGeoMechCase*>( ownerCase );
|
||||
if ( eclipseCase )
|
||||
@ -1094,15 +1121,17 @@ void RiuViewerCommands::findCellAndGridIndex( const RivIntersectionSourceInfo* c
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuViewerCommands::findCellAndGridIndex( const RivIntersectionBoxSourceInfo* intersectionBoxSourceInfo,
|
||||
void RiuViewerCommands::findCellAndGridIndex( Rim3dView* mainOrComparisonView,
|
||||
const RivIntersectionBoxSourceInfo* intersectionBoxSourceInfo,
|
||||
cvf::uint firstPartTriangleIndex,
|
||||
size_t* cellIndex,
|
||||
size_t* gridIndex )
|
||||
{
|
||||
CVF_ASSERT( cellIndex && gridIndex );
|
||||
|
||||
RimEclipseView* eclipseView = dynamic_cast<RimEclipseView*>( m_reservoirView.p() );
|
||||
RimGeoMechView* geomView = dynamic_cast<RimGeoMechView*>( m_reservoirView.p() );
|
||||
RimEclipseView* eclipseView = dynamic_cast<RimEclipseView*>( mainOrComparisonView );
|
||||
RimGeoMechView* geomView = dynamic_cast<RimGeoMechView*>( mainOrComparisonView );
|
||||
|
||||
if ( eclipseView )
|
||||
{
|
||||
size_t globalCellIndex = intersectionBoxSourceInfo->triangleToCellIndex()[firstPartTriangleIndex];
|
||||
@ -1121,7 +1150,8 @@ void RiuViewerCommands::findCellAndGridIndex( const RivIntersectionBoxSourceInfo
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuViewerCommands::findFirstItems( const std::vector<RiuPickItemInfo>& pickItemInfos,
|
||||
void RiuViewerCommands::findFirstItems( Rim3dView* mainOrComparisonView,
|
||||
const std::vector<RiuPickItemInfo>& pickItemInfos,
|
||||
size_t* indexToFirstNoneNncItem,
|
||||
size_t* indexToNncItemNearFirsItem )
|
||||
{
|
||||
@ -1131,7 +1161,7 @@ void RiuViewerCommands::findFirstItems( const std::vector<RiuPickItemInfo>& pick
|
||||
|
||||
double pickDepthThresholdSquared = 0.05 * 0.05;
|
||||
{
|
||||
RimEclipseView* eclipseView = dynamic_cast<RimEclipseView*>( m_reservoirView.p() );
|
||||
RimEclipseView* eclipseView = dynamic_cast<RimEclipseView*>( mainOrComparisonView );
|
||||
|
||||
if ( eclipseView && eclipseView->mainGrid() )
|
||||
{
|
||||
@ -1195,10 +1225,11 @@ void RiuViewerCommands::findFirstItems( const std::vector<RiuPickItemInfo>& pick
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuViewerCommands::ijkFromCellIndex( size_t gridIdx, size_t cellIndex, size_t* i, size_t* j, size_t* k )
|
||||
void RiuViewerCommands::ijkFromCellIndex(
|
||||
Rim3dView* mainOrComparisonView, size_t gridIdx, size_t cellIndex, size_t* i, size_t* j, size_t* k )
|
||||
{
|
||||
RimEclipseView* eclipseView = dynamic_cast<RimEclipseView*>( m_reservoirView.p() );
|
||||
RimGeoMechView* geomView = dynamic_cast<RimGeoMechView*>( m_reservoirView.p() );
|
||||
RimEclipseView* eclipseView = dynamic_cast<RimEclipseView*>( mainOrComparisonView );
|
||||
RimGeoMechView* geomView = dynamic_cast<RimGeoMechView*>( mainOrComparisonView );
|
||||
|
||||
if ( eclipseView && eclipseView->eclipseCase() )
|
||||
{
|
||||
@ -1232,6 +1263,13 @@ bool RiuViewerCommands::handleOverlayItemPicking( int winPosX, int winPosY )
|
||||
else
|
||||
{
|
||||
std::vector<RimLegendConfig*> legendConfigs = m_reservoirView->legendConfigs();
|
||||
if ( m_reservoirView->activeComparisonView() )
|
||||
{
|
||||
std::vector<RimLegendConfig*> compViewLegendConfigs = m_reservoirView->activeComparisonView()
|
||||
->legendConfigs();
|
||||
legendConfigs.insert( legendConfigs.end(), compViewLegendConfigs.begin(), compViewLegendConfigs.end() );
|
||||
}
|
||||
|
||||
for ( const auto& legendConfig : legendConfigs )
|
||||
{
|
||||
if ( legendConfig && legendConfig->titledOverlayFrame() == pickedOverlayItem )
|
||||
@ -1254,10 +1292,13 @@ void RiuViewerCommands::handleTextPicking( int winPosX, int winPosY, cvf::HitIte
|
||||
{
|
||||
using namespace cvf;
|
||||
|
||||
m_isCurrentPickInComparisonView = m_viewer->isMousePosWithinComparisonView( winPosX, winPosY );
|
||||
|
||||
int translatedMousePosX = winPosX;
|
||||
int translatedMousePosY = m_viewer->height() - winPosY;
|
||||
|
||||
Scene* scene = m_viewer->currentScene();
|
||||
Scene* scene = m_viewer->currentScene( m_isCurrentPickInComparisonView );
|
||||
|
||||
if ( !scene ) return;
|
||||
|
||||
Collection<Part> partCollection;
|
||||
|
@ -66,20 +66,24 @@ public:
|
||||
static void removePickEventHandlerIfActive( Ric3dViewPickEventHandler* pickEventHandler );
|
||||
|
||||
cvf::Vec3d lastPickPositionInDomainCoords() const;
|
||||
bool isCurrentPickInComparisonView() const;
|
||||
|
||||
private:
|
||||
void findCellAndGridIndex( const RivIntersectionSourceInfo* crossSectionSourceInfo,
|
||||
void findCellAndGridIndex( Rim3dView* mainOrComparisonView,
|
||||
const RivIntersectionSourceInfo* crossSectionSourceInfo,
|
||||
cvf::uint firstPartTriangleIndex,
|
||||
size_t* cellIndex,
|
||||
size_t* gridIndex );
|
||||
void findCellAndGridIndex( const RivIntersectionBoxSourceInfo* intersectionBoxSourceInfo,
|
||||
void findCellAndGridIndex( Rim3dView* mainOrComparisonView,
|
||||
const RivIntersectionBoxSourceInfo* intersectionBoxSourceInfo,
|
||||
cvf::uint firstPartTriangleIndex,
|
||||
size_t* cellIndex,
|
||||
size_t* gridIndex );
|
||||
void ijkFromCellIndex(
|
||||
Rim3dView* mainOrComparisonView, size_t gridIdx, size_t cellIndex, size_t* i, size_t* j, size_t* k );
|
||||
|
||||
void ijkFromCellIndex( size_t gridIdx, size_t cellIndex, size_t* i, size_t* j, size_t* k );
|
||||
|
||||
void findFirstItems( const std::vector<RiuPickItemInfo>& pickItemInfos,
|
||||
void findFirstItems( Rim3dView* mainOrComparisonView,
|
||||
const std::vector<RiuPickItemInfo>& pickItemInfos,
|
||||
size_t* indexToFirstNoneNncItem,
|
||||
size_t* indexToNncItemNearFirsItem );
|
||||
|
||||
@ -93,6 +97,7 @@ private:
|
||||
size_t m_currentCellIndex;
|
||||
cvf::StructGridInterface::FaceType m_currentFaceIndex;
|
||||
cvf::Vec3d m_currentPickPositionInDomainCoords;
|
||||
bool m_isCurrentPickInComparisonView;
|
||||
caf::PdmPointer<Rim3dView> m_reservoirView;
|
||||
QPointer<RiuViewer> m_viewer;
|
||||
|
||||
|
@ -79,18 +79,7 @@ bool caf::CadNavigation::handleInputEvent(QInputEvent* inputEvent)
|
||||
|
||||
if (me->button() == Qt::MidButton && me->modifiers() == Qt::NoModifier && isRotationEnabled())
|
||||
{
|
||||
cvf::HitItemCollection hic;
|
||||
bool hitSomething = m_viewer->rayPick( me->x(), me->y(), &hic);
|
||||
|
||||
if (hitSomething)
|
||||
{
|
||||
cvf::Vec3d pointOfInterest = hic.firstItem()->intersectionPoint();
|
||||
this->setPointOfInterest(pointOfInterest);
|
||||
}
|
||||
else
|
||||
{
|
||||
initializeRotationCenter();
|
||||
}
|
||||
this->pickAndSetPointOfInterest(me->x(), me->y());
|
||||
|
||||
m_trackball->startNavigation(cvf::ManipulatorTrackball::ROTATE, translatedMousePosX, translatedMousePosY);
|
||||
m_roationSensitivityCalculator.init(me);
|
||||
|
@ -81,18 +81,7 @@ bool caf::CeetronPlusNavigation::handleInputEvent(QInputEvent* inputEvent)
|
||||
|
||||
if (me->button() == Qt::RightButton && isRotationEnabled())
|
||||
{
|
||||
cvf::HitItemCollection hic;
|
||||
bool hitSomething = m_viewer->rayPick( me->x(), me->y(), &hic);
|
||||
|
||||
if (hitSomething)
|
||||
{
|
||||
cvf::Vec3d pointOfInterest = hic.firstItem()->intersectionPoint();
|
||||
this->setPointOfInterest(pointOfInterest);
|
||||
}
|
||||
else
|
||||
{
|
||||
initializeRotationCenter();
|
||||
}
|
||||
this->pickAndSetPointOfInterest(me->x(), me->y());
|
||||
|
||||
m_trackball->startNavigation(cvf::ManipulatorTrackball::ROTATE, translatedMousePosX, translatedMousePosY);
|
||||
m_roationSensitivityCalculator.init(me);
|
||||
|
@ -157,21 +157,22 @@ void caf::TrackBallBasedNavigation::setPointOfInterest(cvf::Vec3d poi)
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void caf::TrackBallBasedNavigation::updatePointOfInterestDuringZoomIfNecessary(int zoomX, int zoomY)
|
||||
void caf::TrackBallBasedNavigation::pickAndSetPointOfInterest(int winPosX, int winPosY)
|
||||
{
|
||||
bool hitSomething = false;
|
||||
cvf::HitItemCollection hic;
|
||||
if (shouldRaytraceForNewPoiDuringWheelZoom(zoomX, zoomY))
|
||||
{
|
||||
hitSomething = m_viewer->rayPick(zoomX, zoomY, &hic);
|
||||
updateWheelZoomPosition(zoomX, zoomY);
|
||||
}
|
||||
bool hitSomething = m_viewer->rayPick( winPosX, winPosY, &hic);
|
||||
|
||||
if (hitSomething)
|
||||
{
|
||||
{
|
||||
cvf::Vec3d pointOfInterest = hic.firstItem()->intersectionPoint();
|
||||
|
||||
if (m_viewer->isMousePosWithinComparisonView( winPosX, winPosY ))
|
||||
{
|
||||
pointOfInterest -= m_viewer->comparisonViewEyePointOffset();
|
||||
}
|
||||
|
||||
this->setPointOfInterest(pointOfInterest);
|
||||
}
|
||||
else
|
||||
@ -180,6 +181,22 @@ void caf::TrackBallBasedNavigation::updatePointOfInterestDuringZoomIfNecessary(i
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void caf::TrackBallBasedNavigation::updatePointOfInterestDuringZoomIfNecessary(int winPosX, int winPosY)
|
||||
{
|
||||
if (shouldRaytraceForNewPoiDuringWheelZoom(winPosX, winPosY))
|
||||
{
|
||||
this->pickAndSetPointOfInterest(winPosX, winPosY);
|
||||
updateWheelZoomPosition(winPosX, winPosY);
|
||||
}
|
||||
else
|
||||
{
|
||||
initializeRotationCenter();
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -271,24 +288,24 @@ cvf::ref<cvf::Ray> caf::TrackBallBasedNavigation::createZoomRay(int cvfXPos, int
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void caf::TrackBallBasedNavigation::updateWheelZoomPosition(int zoomX, int zoomY)
|
||||
void caf::TrackBallBasedNavigation::updateWheelZoomPosition(int winPosX, int winPosY)
|
||||
{
|
||||
m_lastWheelZoomPosX = zoomX;
|
||||
m_lastWheelZoomPosY = zoomY;
|
||||
m_lastWheelZoomPosX = winPosX;
|
||||
m_lastWheelZoomPosY = winPosY;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool caf::TrackBallBasedNavigation::shouldRaytraceForNewPoiDuringWheelZoom(int zoomX, int zoomY) const
|
||||
bool caf::TrackBallBasedNavigation::shouldRaytraceForNewPoiDuringWheelZoom(int winPosX, int winPosY) const
|
||||
{
|
||||
// Raytrace if the last zoom position isn't set
|
||||
if (m_lastWheelZoomPosX == -1 || m_lastWheelZoomPosY == -1)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
int diffX = zoomX - m_lastWheelZoomPosX;
|
||||
int diffY = zoomY - m_lastWheelZoomPosY;
|
||||
int diffX = winPosX - m_lastWheelZoomPosX;
|
||||
int diffY = winPosY - m_lastWheelZoomPosY;
|
||||
|
||||
const int pixelThreshold = 5;
|
||||
if (diffX * diffX + diffY * diffY > pixelThreshold * pixelThreshold)
|
||||
|
@ -107,7 +107,8 @@ protected:
|
||||
void setView( const cvf::Vec3d& alongDirection, const cvf::Vec3d& upDirection ) override;
|
||||
cvf::Vec3d pointOfInterest() override;
|
||||
void setPointOfInterest(cvf::Vec3d poi) override;
|
||||
void updatePointOfInterestDuringZoomIfNecessary(int zoomX, int zoomY);
|
||||
void pickAndSetPointOfInterest(int winPosX, int winPosY);
|
||||
void updatePointOfInterestDuringZoomIfNecessary(int winPosX, int winPosY);
|
||||
void forcePointOfInterestUpdateDuringNextWheelZoom();
|
||||
|
||||
// Track ball navigation specific
|
||||
@ -134,8 +135,8 @@ protected:
|
||||
bool isRotationEnabled() { return m_isRotationEnabled; }
|
||||
|
||||
private:
|
||||
void updateWheelZoomPosition(int zoomX, int zoomY);
|
||||
bool shouldRaytraceForNewPoiDuringWheelZoom(int zoomX, int zoomY) const;
|
||||
void updateWheelZoomPosition(int winPosX, int winPosY);
|
||||
bool shouldRaytraceForNewPoiDuringWheelZoom(int winPosX, int winPosY) const;
|
||||
|
||||
private:
|
||||
bool m_consumeEvents;
|
||||
|
@ -131,7 +131,8 @@ caf::Viewer::Viewer(const QGLFormat& format, QWidget* parent)
|
||||
m_offscreenViewportHeight(0),
|
||||
m_parallelProjectionLightDirection(0, 0, -1), // Light directly from behind
|
||||
m_comparisonViewOffset(0, 0, 0),
|
||||
m_comparisonWindowNormalizedRect(0.5f, 0.0f, 0.5f, 1.0f)
|
||||
m_comparisonWindowNormalizedRect(0.5f, 0.0f, 0.5f, 1.0f),
|
||||
m_isComparisonFollowingAnimation(true)
|
||||
{
|
||||
#if QT_VERSION >= 0x050000
|
||||
m_layoutWidget = new QWidget(parent);
|
||||
@ -474,6 +475,7 @@ void caf::Viewer::optimizeClippingPlanes()
|
||||
camEye += m_comparisonViewOffset;
|
||||
camViewRefPoint += m_comparisonViewOffset;
|
||||
m_comparisonMainCamera->setFromLookAt(camEye, camViewRefPoint, camUp);
|
||||
navPointOfinterest += m_comparisonViewOffset;
|
||||
|
||||
if ( calculateNearFarPlanes(m_comparisonMainRendering.p(), navPointOfinterest, &farPlaneDist, &nearPlaneDist) )
|
||||
{
|
||||
@ -650,10 +652,14 @@ bool caf::Viewer::rayPick(int winPosX, int winPosY, cvf::HitItemCollection* pick
|
||||
int translatedMousePosX = winPosX;
|
||||
int translatedMousePosY = height() - winPosY;
|
||||
|
||||
cvf::ref<cvf::RayIntersectSpec> ris = m_mainRendering->rayIntersectSpecFromWindowCoordinates(translatedMousePosX, translatedMousePosY);
|
||||
bool mousePosIsWithinComparisonView = isMousePosWithinComparisonView(winPosX, winPosY);
|
||||
|
||||
cvf::Rendering* renderingToInvestigate = mousePosIsWithinComparisonView ? m_comparisonMainRendering.p(): m_mainRendering.p();
|
||||
|
||||
cvf::ref<cvf::RayIntersectSpec> ris = renderingToInvestigate->rayIntersectSpecFromWindowCoordinates(translatedMousePosX, translatedMousePosY);
|
||||
if (ris.notNull())
|
||||
{
|
||||
bool retVal = m_mainRendering->rayIntersect(*ris, pickedPoints);
|
||||
bool retVal = renderingToInvestigate->rayIntersect(*ris, pickedPoints);
|
||||
if (retVal && globalRayOrigin)
|
||||
{
|
||||
CVF_ASSERT(ris->ray() != nullptr);
|
||||
@ -665,8 +671,35 @@ bool caf::Viewer::rayPick(int winPosX, int winPosY, cvf::HitItemCollection* pick
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool caf::Viewer::isMousePosWithinComparisonView(int winPosX, int winPosY)
|
||||
{
|
||||
bool mousePosIsWithinComparisonView = false;
|
||||
|
||||
int translatedMousePosX = winPosX;
|
||||
int translatedMousePosY = height() - winPosY;
|
||||
|
||||
if ( m_comparisonMainRendering.notNull() && m_comparisonMainRendering->scene() )
|
||||
{
|
||||
if ( cvf::RenderingScissor* sciss = m_comparisonMainRendering->renderingScissor() )
|
||||
{
|
||||
cvf::Recti scissorRect(sciss->x(), sciss->y(), sciss->width(), sciss->height());
|
||||
if ( scissorRect.contains(cvf::Vec2i(translatedMousePosX, translatedMousePosY)) )
|
||||
{
|
||||
mousePosIsWithinComparisonView = true;
|
||||
}
|
||||
}
|
||||
else // Whole screen is covered
|
||||
{
|
||||
mousePosIsWithinComparisonView = true;
|
||||
}
|
||||
}
|
||||
|
||||
return mousePosIsWithinComparisonView;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -933,6 +966,40 @@ bool caf::Viewer::isAnimationActive()
|
||||
return true;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void caf::Viewer::setCurrentComparisonFrame(int frameIndex)
|
||||
{
|
||||
if (m_frameScenes.size() == 0) return;
|
||||
|
||||
int clampedFrameIndex = clampFrameIndex(frameIndex);
|
||||
|
||||
if (m_releaseOGLResourcesEachFrame)
|
||||
{
|
||||
releaseOGlResourcesForCurrentFrame();
|
||||
}
|
||||
|
||||
if ( m_comparisonFrameScenes.size() > clampedFrameIndex && m_comparisonFrameScenes.at(clampedFrameIndex) != nullptr )
|
||||
{
|
||||
m_comparisonMainRendering->setScene(m_comparisonFrameScenes.at(clampedFrameIndex));
|
||||
}
|
||||
else
|
||||
{
|
||||
m_comparisonMainRendering->setScene(nullptr);
|
||||
}
|
||||
|
||||
update();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void caf::Viewer::setComparisonViewToFollowAnimation(bool isToFollow)
|
||||
{
|
||||
m_isComparisonFollowingAnimation = isToFollow;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -957,14 +1024,19 @@ void caf::Viewer::slotSetCurrentFrame(int frameIndex)
|
||||
{
|
||||
m_mainRendering->setScene(nullptr);
|
||||
}
|
||||
if (m_comparisonFrameScenes.size() > clampedFrameIndex && m_comparisonFrameScenes.at(clampedFrameIndex) != nullptr )
|
||||
|
||||
if ( m_isComparisonFollowingAnimation )
|
||||
{
|
||||
m_comparisonMainRendering->setScene(m_comparisonFrameScenes.at(clampedFrameIndex));
|
||||
}
|
||||
else
|
||||
{
|
||||
m_comparisonMainRendering->setScene(nullptr);
|
||||
if ( m_comparisonFrameScenes.size() > clampedFrameIndex && m_comparisonFrameScenes.at(clampedFrameIndex) != nullptr )
|
||||
{
|
||||
m_comparisonMainRendering->setScene(m_comparisonFrameScenes.at(clampedFrameIndex));
|
||||
}
|
||||
else
|
||||
{
|
||||
m_comparisonMainRendering->setScene(nullptr);
|
||||
}
|
||||
}
|
||||
|
||||
update();
|
||||
}
|
||||
|
||||
|
@ -151,6 +151,8 @@ public:
|
||||
bool canRender() const;
|
||||
|
||||
bool rayPick(int winPosX, int winPosY, cvf::HitItemCollection* pickedPoints, cvf::Vec3d* rayGlobalOrigin = nullptr) ;
|
||||
bool isMousePosWithinComparisonView(int winPosX, int winPosY);
|
||||
|
||||
cvf::OverlayItem* overlayItem(int winPosX, int winPosY);
|
||||
|
||||
// QPainter based drawing on top of the OpenGL graphics
|
||||
@ -172,6 +174,9 @@ public:
|
||||
|
||||
static void copyCameraView(cvf::Camera* srcCamera, cvf::Camera* dstCamera);
|
||||
|
||||
void setCurrentComparisonFrame(int frameIndex);
|
||||
void setComparisonViewToFollowAnimation(bool isToFollow);
|
||||
|
||||
public slots:
|
||||
virtual void slotSetCurrentFrame(int frameIndex);
|
||||
virtual void slotEndAnimation();
|
||||
@ -255,6 +260,7 @@ private:
|
||||
cvf::ref<cvf::Scene> m_comparisonMainScene;
|
||||
cvf::Collection<cvf::Scene> m_comparisonFrameScenes;
|
||||
cvf::Collection<cvf::Model> m_comparisonStaticModels;
|
||||
bool m_isComparisonFollowingAnimation;
|
||||
|
||||
cvf::Vec3d m_comparisonViewOffset;
|
||||
cvf::ref<cvf::RenderingScissor> m_comparisonRenderingScissor;
|
||||
|
@ -686,6 +686,14 @@ void Rendering::setRenderingScissor(RenderingScissor* scissor)
|
||||
m_renderingScissor = scissor;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
cvf::RenderingScissor* Rendering::renderingScissor()
|
||||
{
|
||||
return m_renderingScissor.p();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -107,6 +107,7 @@ public:
|
||||
void setClearMode(Viewport::ClearMode clearMode);
|
||||
Viewport::ClearMode clearMode() const;
|
||||
void setRenderingScissor(RenderingScissor* scissor);
|
||||
RenderingScissor* renderingScissor();
|
||||
|
||||
void setEffectOverride(Effect* effect);
|
||||
Effect* effectOverride();
|
||||
|
16
doc/view_linking.plantuml
Normal file
16
doc/view_linking.plantuml
Normal file
@ -0,0 +1,16 @@
|
||||
@startuml
|
||||
|
||||
RimViewLinkerCollection --* "1" RimViewLinker
|
||||
RimViewLinker --* "n" RimViewController
|
||||
RimViewLinker "masterView" ---> RimGridView
|
||||
|
||||
RimViewController "managedView" ---> RimGridView
|
||||
|
||||
Rim3dView <|-- RimGridView
|
||||
|
||||
|
||||
RimViewLinker .> RimViewManipulator
|
||||
Rim3dView -* RiuViewer
|
||||
RimViewManipulator ...> RiuViewer
|
||||
|
||||
@enduml
|
Loading…
Reference in New Issue
Block a user