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

Picking in comparison view fixes
This commit is contained in:
Jacob Støren
2019-10-29 12:41:14 +01:00
committed by GitHub
24 changed files with 107 additions and 62 deletions

View File

@@ -21,6 +21,7 @@
#include "RiaApplication.h"
#include "Rim3dView.h"
#include "RimGridView.h"
#include "MeasurementCommands/RicMeasurementPickEventHandler.h"
@@ -89,7 +90,7 @@ RimMeasurement::MeasurementMode RimMeasurement::measurementMode() const
//--------------------------------------------------------------------------------------------------
void RimMeasurement::addPointInDomainCoords( const Vec3d& domainCoord )
{
auto activeView = RiaApplication::instance()->activeReservoirView();
auto activeView = dynamic_cast<Rim3dView*>( RiaApplication::instance()->activeMainOrComparisonGridView() );
if ( m_sourceView.p() != activeView )
{
@@ -194,8 +195,6 @@ RimMeasurement::Lengths RimMeasurement::calculateLenghts() const
//--------------------------------------------------------------------------------------------------
void RimMeasurement::updateView() const
{
if ( m_sourceView )
{
m_sourceView->updateMeasurement();
}
Rim3dView* rimView = RiaApplication::instance()->activeReservoirView();
rimView->createMeasurementDisplayModelAndRedraw();
}

View File

@@ -1027,11 +1027,18 @@ void Rim3dView::updateZScaleLabel()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void Rim3dView::updateMeasurement()
void Rim3dView::createMeasurementDisplayModelAndRedraw()
{
if ( m_viewer )
appendMeasurementToModel();
if ( Rim3dView* depView = prepareComparisonView() )
{
depView->appendMeasurementToModel();
restoreComparisonView();
}
if ( nativeOrOverrideViewer() )
{
appendMeasurementToModel();
nativeOrOverrideViewer()->update();
}
}

View File

@@ -161,7 +161,7 @@ public:
void updateAnnotationItems();
void updateScaling();
void updateZScaleLabel();
void updateMeasurement();
void createMeasurementDisplayModelAndRedraw();
bool isMasterView() const;
Rim3dView* activeComparisonView() const;

View File

@@ -198,14 +198,14 @@ void RimIntersectionCollection::recomputeSimWellBranchData()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimIntersectionCollection::appendIntersectionAndUpdate( RimIntersection* intersection )
void RimIntersectionCollection::appendIntersectionAndUpdate( RimIntersection* intersection, bool allowActiveViewChange )
{
m_intersections.push_back( intersection );
syncronize2dIntersectionViews();
updateConnectedEditors();
Riu3DMainWindowTools::selectAsCurrentItem( intersection );
Riu3DMainWindowTools::selectAsCurrentItem( intersection, allowActiveViewChange );
Rim3dView* rimView = nullptr;
firstAncestorOrThisOfType( rimView );

View File

@@ -52,7 +52,7 @@ public:
caf::PdmField<bool> isActive;
void appendIntersectionAndUpdate( RimIntersection* intersection );
void appendIntersectionAndUpdate( RimIntersection* intersection, bool allowActiveViewChange = true );
void appendIntersectionNoUpdate( RimIntersection* intersection );
void appendIntersectionBoxAndUpdate( RimIntersectionBox* intersectionBox );