Merge pull request #4968 from OPM/feaure-fix-point-picking-in-comparison-view

Fixes several issues from #4857
#4956 Fix List editor background setting
#4880 Fix annotations missing in comparison view
This commit is contained in:
Jacob Støren
2019-11-04 09:44:56 +01:00
committed by GitHub
43 changed files with 489 additions and 382 deletions

View File

@@ -1230,7 +1230,7 @@ void RiuMainWindow::slotViewFromBelow()
//--------------------------------------------------------------------------------------------------
void RiuMainWindow::slotSubWindowActivated( QMdiSubWindow* subWindow )
{
if ( blockSubWindowActivation() ) return;
if ( isBlockingSubWindowActivatedSignal() ) return;
Rim3dView* previousActiveReservoirView = RiaApplication::instance()->activeReservoirView();
Rim3dView* activatedView = dynamic_cast<Rim3dView*>( findViewWindowFromSubWindow( subWindow ) );
@@ -1238,9 +1238,9 @@ void RiuMainWindow::slotSubWindowActivated( QMdiSubWindow* subWindow )
if ( !activatedView ) return;
RiaApplication::instance()->setActiveReservoirView( activatedView );
if ( !blockSubWindowProjectTreeSelection() )
if ( !isBlockingViewSelectionOnSubWindowActivated() )
{
selectViewInProjectTree( previousActiveReservoirView, activatedView );
selectViewInProjectTreePreservingSubItemSelection( previousActiveReservoirView, activatedView );
}
slotRefreshViewActions();
@@ -1251,7 +1251,8 @@ void RiuMainWindow::slotSubWindowActivated( QMdiSubWindow* subWindow )
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RiuMainWindow::selectViewInProjectTree( const Rim3dView* previousActiveReservoirView, Rim3dView* activatedView )
void RiuMainWindow::selectViewInProjectTreePreservingSubItemSelection( const Rim3dView* previousActiveReservoirView,
Rim3dView* activatedView )
{
bool is3dViewCurrentlySelected = false;
if ( caf::SelectionManager::instance()->selectedItem() )
@@ -1442,9 +1443,9 @@ void RiuMainWindow::selectedObjectsChanged()
// Set focus in MDI area to this window if it exists
if ( selectedReservoirView->viewer() )
{
setBlockSubWindowProjectTreeSelection( true );
setBlockViewSelectionOnSubWindowActivated( true );
setActiveViewer( selectedReservoirView->viewer()->layoutWidget() );
setBlockSubWindowProjectTreeSelection( false );
setBlockViewSelectionOnSubWindowActivated( false );
isActiveViewChanged = true;
}
@@ -2001,14 +2002,14 @@ void RiuMainWindow::tileSubWindows()
// Based on workaround described here
// https://forum.qt.io/topic/50053/qmdiarea-tilesubwindows-always-places-widgets-in-activationhistoryorder-in-subwindowview-mode
bool prevActivationBlock = blockSubWindowActivation();
bool prevActivationBlock = isBlockingSubWindowActivatedSignal();
QMdiSubWindow* a = m_mdiArea->activeSubWindow();
// Force activation order so they end up in the order of the loop.
m_mdiArea->setActivationOrder( QMdiArea::ActivationHistoryOrder );
setBlockSubWindowActivation( true );
setBlockSubWindowActivatedSignal( true );
// Activate in reverse order
for ( auto it = windowList.rbegin(); it != windowList.rend(); ++it )
@@ -2020,7 +2021,7 @@ void RiuMainWindow::tileSubWindows()
// Set back the original activation order to avoid messing with the standard ordering
m_mdiArea->setActivationOrder( currentActivationOrder );
m_mdiArea->setActiveSubWindow( a );
setBlockSubWindowActivation( prevActivationBlock );
setBlockSubWindowActivatedSignal( prevActivationBlock );
storeSubWindowTiling( true );
}
@@ -2039,7 +2040,7 @@ void RiuMainWindow::storeSubWindowTiling( bool tiled )
//--------------------------------------------------------------------------------------------------
void RiuMainWindow::clearWindowTiling()
{
setBlockSubWindowActivation( true );
setBlockSubWindowActivatedSignal( true );
QMdiArea::WindowOrder currentActivationOrder = m_mdiArea->activationOrder();
for ( QMdiSubWindow* subWindow : m_mdiArea->subWindowList( currentActivationOrder ) )
@@ -2048,7 +2049,7 @@ void RiuMainWindow::clearWindowTiling()
subWindow->showNormal();
}
storeSubWindowTiling( false );
setBlockSubWindowActivation( false );
setBlockSubWindowActivatedSignal( false );
}
//--------------------------------------------------------------------------------------------------

View File

@@ -233,11 +233,13 @@ private slots:
void slotBuildWindowActions();
void slotSubWindowActivated( QMdiSubWindow* subWindow );
void selectViewInProjectTree( const Rim3dView* previousActiveReservoirView, Rim3dView* activatedView );
void selectedObjectsChanged();
void customMenuRequested( const QPoint& pos );
private:
void selectViewInProjectTreePreservingSubItemSelection( const Rim3dView* previousActiveReservoirView,
Rim3dView* activatedView );
// Pdm System :
public:
void setPdmRoot( caf::PdmObject* pdmRoot );

View File

@@ -246,7 +246,7 @@ void RiuMainWindowBase::enableShowFirstVisibleMdiWindowMaximized( bool enable )
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RiuMainWindowBase::setBlockSubWindowActivation( bool block )
void RiuMainWindowBase::setBlockSubWindowActivatedSignal( bool block )
{
m_blockSubWindowActivation = block;
}
@@ -254,7 +254,7 @@ void RiuMainWindowBase::setBlockSubWindowActivation( bool block )
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RiuMainWindowBase::blockSubWindowActivation() const
bool RiuMainWindowBase::isBlockingSubWindowActivatedSignal() const
{
return m_blockSubWindowActivation;
}
@@ -262,7 +262,7 @@ bool RiuMainWindowBase::blockSubWindowActivation() const
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RiuMainWindowBase::setBlockSubWindowProjectTreeSelection( bool block )
void RiuMainWindowBase::setBlockViewSelectionOnSubWindowActivated( bool block )
{
m_blockSubWindowProjectTreeSelection = block;
}
@@ -270,7 +270,7 @@ void RiuMainWindowBase::setBlockSubWindowProjectTreeSelection( bool block )
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RiuMainWindowBase::blockSubWindowProjectTreeSelection() const
bool RiuMainWindowBase::isBlockingViewSelectionOnSubWindowActivated() const
{
return m_blockSubWindowProjectTreeSelection;
}

View File

@@ -76,11 +76,11 @@ public:
virtual void clearWindowTiling() = 0;
virtual bool subWindowsAreTiled() const = 0;
void setBlockSubWindowActivation( bool block );
bool blockSubWindowActivation() const;
void setBlockSubWindowActivatedSignal( bool block );
bool isBlockingSubWindowActivatedSignal() const;
void setBlockSubWindowProjectTreeSelection( bool block );
bool blockSubWindowProjectTreeSelection() const;
void setBlockViewSelectionOnSubWindowActivated( bool block );
bool isBlockingViewSelectionOnSubWindowActivated() const;
protected:
void removeViewerFromMdiArea( QMdiArea* mdiArea, QWidget* viewer );

View File

@@ -58,7 +58,7 @@ void RiuMdiArea::resizeEvent( QResizeEvent* resizeEvent )
}
RiuMainWindowBase* mainWindow = dynamic_cast<RiuMainWindowBase*>( window() );
mainWindow->setBlockSubWindowActivation( true );
mainWindow->setBlockSubWindowActivatedSignal( true );
// Workaround for Qt bug #51761: https://bugreports.qt.io/browse/QTBUG-51761
// Set the first window to be the active window then perform resize event and set back.
@@ -70,7 +70,7 @@ void RiuMdiArea::resizeEvent( QResizeEvent* resizeEvent )
setActiveSubWindow( a );
mainWindow->setBlockSubWindowActivation( false );
mainWindow->setBlockSubWindowActivatedSignal( false );
for ( auto subWindow : subWindowList() )
{

View File

@@ -684,14 +684,14 @@ void RiuPlotMainWindow::setPdmRoot( caf::PdmObject* pdmRoot )
//--------------------------------------------------------------------------------------------------
void RiuPlotMainWindow::slotSubWindowActivated( QMdiSubWindow* subWindow )
{
if ( blockSubWindowActivation() ) return;
if ( isBlockingSubWindowActivatedSignal() ) return;
RimViewWindow* activatedView = findViewWindowFromSubWindow( subWindow );
if ( !activatedView ) return;
m_activePlotViewWindow = activatedView;
if ( !blockSubWindowProjectTreeSelection() )
if ( !isBlockingViewSelectionOnSubWindowActivated() )
{
std::vector<caf::PdmUiItem*> currentSelection;
m_projectTreeView->selectedUiItems( currentSelection );
@@ -809,9 +809,9 @@ void RiuPlotMainWindow::selectedObjectsChanged()
{
if ( selectedWindow->viewWidget() )
{
setBlockSubWindowProjectTreeSelection( true );
setBlockViewSelectionOnSubWindowActivated( true );
setActiveViewer( selectedWindow->viewWidget() );
setBlockSubWindowProjectTreeSelection( false );
setBlockViewSelectionOnSubWindowActivated( false );
}
m_activePlotViewWindow = selectedWindow;
@@ -913,12 +913,12 @@ void RiuPlotMainWindow::tileSubWindows()
// Based on workaround described here
// https://forum.qt.io/topic/50053/qmdiarea-tilesubwindows-always-places-widgets-in-activationhistoryorder-in-subwindowview-mode
bool prevActivationBlock = blockSubWindowActivation();
bool prevActivationBlock = isBlockingSubWindowActivatedSignal();
// Force activation order so they end up in the order of the loop.
m_mdiArea->setActivationOrder( QMdiArea::ActivationHistoryOrder );
QMdiSubWindow* a = m_mdiArea->activeSubWindow();
setBlockSubWindowActivation( true );
setBlockSubWindowActivatedSignal( true );
// Activate in reverse order
for ( auto it = windowList.rbegin(); it != windowList.rend(); ++it )
{
@@ -929,7 +929,7 @@ void RiuPlotMainWindow::tileSubWindows()
// Set back the original activation order to avoid messing with the standard ordering
m_mdiArea->setActivationOrder( currentActivationOrder );
m_mdiArea->setActiveSubWindow( a );
setBlockSubWindowActivation( prevActivationBlock );
setBlockSubWindowActivatedSignal( prevActivationBlock );
storeSubWindowTiling( true );
}
@@ -948,7 +948,7 @@ void RiuPlotMainWindow::storeSubWindowTiling( bool tiled )
//--------------------------------------------------------------------------------------------------
void RiuPlotMainWindow::clearWindowTiling()
{
setBlockSubWindowActivation( true );
setBlockSubWindowActivatedSignal( true );
QMdiArea::WindowOrder currentActivationOrder = m_mdiArea->activationOrder();
for ( QMdiSubWindow* subWindow : m_mdiArea->subWindowList( currentActivationOrder ) )
@@ -957,7 +957,7 @@ void RiuPlotMainWindow::clearWindowTiling()
subWindow->showNormal();
}
storeSubWindowTiling( false );
setBlockSubWindowActivation( false );
setBlockSubWindowActivatedSignal( false );
}
//--------------------------------------------------------------------------------------------------

View File

@@ -323,7 +323,7 @@ void RiuSelectionChangedHandler::scheduleUpdateForAllVisibleViews() const
for ( size_t i = 0; i < visibleViews.size(); i++ )
{
visibleViews[i]->createHighlightAndGridBoxDisplayModelWithRedraw();
visibleViews[i]->createHighlightAndGridBoxDisplayModelAndRedraw();
visibleViews[i]->createMeasurementDisplayModelAndRedraw();
}
}

View File

@@ -319,7 +319,7 @@ void RiuViewer::slotSetCurrentFrame( int frameIndex )
for ( auto contView : containingViews )
{
contView->updateCurrentTimeStepAndRedraw();
contView->updateDisplayModelForCurrentTimeStepAndRedraw();
}
}
}

View File

@@ -57,8 +57,6 @@ public:
virtual cvf::ref<caf::DisplayCoordTransform> displayCoordTransform() const = 0;
virtual void setCurrentTimeStepAndUpdate( int frameIndex ) = 0;
virtual void updateCurrentTimeStepAndRedraw() = 0;
virtual void updateLegends() = 0;
virtual void endAnimation() = 0;
};