mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Support linking of 2D intersection views
* Major refactor from RimGridView to Rim3dView * Move view linker/controller functions to Rim3dView * Add bitmask to define the content of a 3D view * Link views based on matching content * Enable bit mask operators at global scope * Make it possible to use 2d intersection views as comparison views * Fix crash when a view used as comparison view is deleted * Move unlinking to Rim3dView * Add options to snapshot only 3D views/plots as part of regression testing * WBS plot: Improve default name, hide axis for some tracks
This commit is contained in:
@@ -354,24 +354,21 @@ void RiuViewer::slotSetCurrentFrame( int frameIndex )
|
||||
{
|
||||
setCurrentFrame( frameIndex );
|
||||
|
||||
if ( m_rimView )
|
||||
auto* view = dynamic_cast<Rim3dView*>( m_rimView.p() );
|
||||
if ( view )
|
||||
{
|
||||
RimViewLinker* viewLinker = m_rimView->assosiatedViewLinker();
|
||||
RimViewLinker* viewLinker = view->assosiatedViewLinker();
|
||||
if ( viewLinker )
|
||||
{
|
||||
viewLinker->updateTimeStep( dynamic_cast<RimGridView*>( m_rimView.p() ), frameIndex );
|
||||
viewLinker->updateTimeStep( view, frameIndex );
|
||||
}
|
||||
|
||||
// Update views using this as comparison
|
||||
Rim3dView* view = dynamic_cast<Rim3dView*>( m_rimView.p() );
|
||||
if ( view )
|
||||
{
|
||||
std::set<Rim3dView*> containingViews = view->viewsUsingThisAsComparisonView();
|
||||
std::set<Rim3dView*> containingViews = view->viewsUsingThisAsComparisonView();
|
||||
|
||||
for ( auto contView : containingViews )
|
||||
{
|
||||
contView->updateDisplayModelForCurrentTimeStepAndRedraw();
|
||||
}
|
||||
for ( auto contView : containingViews )
|
||||
{
|
||||
contView->updateDisplayModelForCurrentTimeStepAndRedraw();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -982,7 +979,7 @@ void RiuViewer::navigationPolicyUpdate()
|
||||
RimViewLinker* viewLinker = m_rimView->assosiatedViewLinker();
|
||||
if ( viewLinker )
|
||||
{
|
||||
viewLinker->updateCamera( dynamic_cast<RimGridView*>( m_rimView.p() ) );
|
||||
viewLinker->updateCamera( dynamic_cast<Rim3dView*>( m_rimView.p() ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1090,7 +1087,8 @@ void RiuViewer::mouseMoveEvent( QMouseEvent* mouseEvent )
|
||||
cvf::ref<caf::DisplayCoordTransform> trans = m_rimView->displayCoordTransform();
|
||||
cvf::Vec3d domainCoord = trans->transformToDomainCoord( displayCoord );
|
||||
|
||||
viewLinker->updateCursorPosition( dynamic_cast<RimGridView*>( m_rimView.p() ), domainCoord );
|
||||
auto view = dynamic_cast<Rim3dView*>( m_rimView.p() );
|
||||
if ( view ) viewLinker->updateCursorPosition( view, domainCoord );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1120,7 +1118,9 @@ void RiuViewer::leaveEvent( QEvent* )
|
||||
if ( m_rimView && m_rimView->assosiatedViewLinker() )
|
||||
{
|
||||
RimViewLinker* viewLinker = m_rimView->assosiatedViewLinker();
|
||||
viewLinker->updateCursorPosition( dynamic_cast<RimGridView*>( m_rimView.p() ), cvf::Vec3d::UNDEFINED );
|
||||
|
||||
auto view = dynamic_cast<Rim3dView*>( m_rimView.p() );
|
||||
if ( view ) viewLinker->updateCursorPosition( view, cvf::Vec3d::UNDEFINED );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -160,7 +160,7 @@ void RiuViewerCommands::setOwnerView( Rim3dView* owner )
|
||||
|
||||
void RiuViewerCommands::addCompareToViewMenu( caf::CmdFeatureMenuBuilder* menuBuilder )
|
||||
{
|
||||
RimGridView* mainGridView = dynamic_cast<RimGridView*>( m_reservoirView.p() );
|
||||
auto* mainGridView = m_reservoirView.p();
|
||||
if ( mainGridView && !mainGridView->activeComparisonView() )
|
||||
{
|
||||
std::vector<Rim3dView*> validComparisonViews;
|
||||
@@ -169,8 +169,6 @@ void RiuViewerCommands::addCompareToViewMenu( caf::CmdFeatureMenuBuilder* menuBu
|
||||
RimProject::current()->allViews( views );
|
||||
for ( auto view : views )
|
||||
{
|
||||
if ( !dynamic_cast<RimGridView*>( view ) ) continue;
|
||||
|
||||
if ( view != mainGridView )
|
||||
{
|
||||
validComparisonViews.push_back( view );
|
||||
@@ -596,7 +594,7 @@ void RiuViewerCommands::displayContextMenu( QMouseEvent* event )
|
||||
// View Link commands
|
||||
if ( !firstHitPart )
|
||||
{
|
||||
if ( gridView )
|
||||
if ( gridView || int2dView )
|
||||
{
|
||||
menuBuilder << "RicLinkViewFeature";
|
||||
menuBuilder << "RicShowLinkOptionsFeature";
|
||||
@@ -605,9 +603,7 @@ void RiuViewerCommands::displayContextMenu( QMouseEvent* event )
|
||||
menuBuilder.addSeparator();
|
||||
menuBuilder << "RicUnLinkViewFeature";
|
||||
menuBuilder << "RicRemoveComparison3dViewFeature";
|
||||
}
|
||||
else if ( int2dView )
|
||||
{
|
||||
menuBuilder.addSeparator();
|
||||
menuBuilder << "RicSelectColorResult";
|
||||
}
|
||||
}
|
||||
@@ -637,9 +633,6 @@ void RiuViewerCommands::displayContextMenu( QMouseEvent* event )
|
||||
menuBuilder << "RicShowGridStatisticsFeature";
|
||||
menuBuilder << "RicSelectColorResult";
|
||||
}
|
||||
else if ( int2dView )
|
||||
{
|
||||
}
|
||||
|
||||
menuBuilder << "RicExportContourMapToTextFeature";
|
||||
|
||||
|
||||
Reference in New Issue
Block a user