mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Link view updates
This commit is contained in:
parent
feba066b49
commit
e0058a0872
@ -28,6 +28,7 @@
|
||||
#include "RimViewLinkerCollection.h"
|
||||
|
||||
#include "Riu3DMainWindowTools.h"
|
||||
#include "RiuViewer.h"
|
||||
|
||||
#include "cafPdmUiPropertyViewDialog.h"
|
||||
|
||||
@ -113,13 +114,15 @@ void RicLinkVisibleViewsFeature::linkViews( std::vector<Rim3dView*>& linkableVie
|
||||
|
||||
Rim3dView* primaryView = viewLinker->masterView();
|
||||
|
||||
auto matchingViews = RicLinkVisibleViewsFeature::matchingViews( primaryView, linkableViews );
|
||||
bool enableRotation = primaryView->viewer()->isNavigationRotationEnabled();
|
||||
auto matchingViews = RicLinkVisibleViewsFeature::matchingViews( primaryView, linkableViews );
|
||||
for ( auto v : matchingViews )
|
||||
{
|
||||
enableRotation = enableRotation && v->viewer()->isNavigationRotationEnabled();
|
||||
viewLinker->addDependentView( v );
|
||||
}
|
||||
|
||||
viewLinker->updateDependentViews();
|
||||
viewLinker->updateDependentViews( enableRotation );
|
||||
viewLinker->updateUiNameAndIcon();
|
||||
|
||||
proj->viewLinkerCollection.uiCapability()->updateConnectedEditors();
|
||||
|
@ -29,6 +29,8 @@
|
||||
#include "RimViewLinker.h"
|
||||
#include "RimViewLinkerCollection.h"
|
||||
|
||||
#include "RiuViewer.h"
|
||||
|
||||
#include "cafCmdFeatureManager.h"
|
||||
#include "cafSelectionManager.h"
|
||||
|
||||
@ -90,11 +92,36 @@ void RicUnLinkViewFeature::onActionTriggered( bool isChecked )
|
||||
RimProject::current()->viewLinkerCollection->viewLinker.removeChild( viewLinker );
|
||||
|
||||
delete viewLinker;
|
||||
viewLinker = nullptr;
|
||||
}
|
||||
activeView->updateAutoName();
|
||||
}
|
||||
|
||||
if ( dynamic_cast<RimEclipseContourMapView*>( activeView ) ) activeView->zoomAll();
|
||||
if ( dynamic_cast<RimEclipseContourMapView*>( activeView ) )
|
||||
{
|
||||
activeView->zoomAll();
|
||||
}
|
||||
else
|
||||
{
|
||||
activeView->viewer()->enableNavigationRotation( true );
|
||||
}
|
||||
|
||||
if ( viewLinker )
|
||||
{
|
||||
Rim3dView* primaryView = viewLinker->masterView();
|
||||
|
||||
bool enableRotation = dynamic_cast<RimEclipseContourMapView*>( primaryView ) != nullptr;
|
||||
auto linkedViews = viewLinker->allViews();
|
||||
for ( auto v : linkedViews )
|
||||
{
|
||||
enableRotation = enableRotation && dynamic_cast<RimEclipseContourMapView*>( v ) != nullptr;
|
||||
}
|
||||
if ( primaryView && primaryView->viewer() ) primaryView->viewer()->enableNavigationRotation( enableRotation );
|
||||
for ( auto v : linkedViews )
|
||||
{
|
||||
if ( v->viewer() ) v->viewer()->enableNavigationRotation( enableRotation );
|
||||
}
|
||||
}
|
||||
|
||||
RimProject::current()->viewLinkerCollection.uiCapability()->updateConnectedEditors();
|
||||
RimProject::current()->uiCapability()->updateConnectedEditors();
|
||||
|
@ -314,15 +314,17 @@ void RimViewLinker::allViewsForCameraSync( const Rim3dView* source, std::vector<
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimViewLinker::updateDependentViews()
|
||||
void RimViewLinker::updateDependentViews( bool enableRotation /*=true*/ )
|
||||
{
|
||||
if ( m_viewControllers.empty() ) return;
|
||||
|
||||
m_masterView->viewer()->enableNavigationRotation( enableRotation );
|
||||
|
||||
updateOverrides();
|
||||
updateDuplicatedPropertyFilters();
|
||||
updateCellResult();
|
||||
updateScaleZ( m_masterView, m_masterView->scaleZ() );
|
||||
updateCamera( m_masterView );
|
||||
updateCamera( m_masterView, enableRotation );
|
||||
updateTimeStep( m_masterView, m_masterView->currentTimeStep() );
|
||||
}
|
||||
|
||||
@ -592,7 +594,7 @@ QList<caf::PdmOptionItemInfo> RimViewLinker::calculateValueOptions( const caf::P
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimViewLinker::updateCamera( Rim3dView* sourceView )
|
||||
void RimViewLinker::updateCamera( Rim3dView* sourceView, bool enableRotation /*=true*/ )
|
||||
{
|
||||
if ( !sourceView || !sourceView->viewer() ) return;
|
||||
|
||||
@ -609,6 +611,10 @@ void RimViewLinker::updateCamera( Rim3dView* sourceView )
|
||||
|
||||
std::vector<Rim3dView*> viewsToUpdate;
|
||||
allViewsForCameraSync( sourceView, viewsToUpdate );
|
||||
for ( auto v : viewsToUpdate )
|
||||
{
|
||||
v->viewer()->enableNavigationRotation( enableRotation );
|
||||
}
|
||||
|
||||
RimViewManipulator::applySourceViewCameraOnDestinationViews( sourceView, viewsToUpdate );
|
||||
}
|
||||
|
@ -62,7 +62,7 @@ public:
|
||||
Rim3dView* masterView() const;
|
||||
void addDependentView( Rim3dView* view );
|
||||
bool isFirstViewDependentOnSecondView( const Rim3dView* firstView, const Rim3dView* secondView ) const;
|
||||
void updateDependentViews();
|
||||
void updateDependentViews( bool enableRotation = true );
|
||||
void removeViewController( RimViewController* viewController );
|
||||
Rim3dView* firstControlledView();
|
||||
|
||||
@ -70,7 +70,7 @@ public:
|
||||
void updateWindowTitles();
|
||||
void updateDuplicatedPropertyFilters();
|
||||
|
||||
void updateCamera( Rim3dView* sourceView );
|
||||
void updateCamera( Rim3dView* sourceView, bool enableRoatation = true );
|
||||
void updateTimeStep( Rim3dView* sourceView, int timeStep );
|
||||
void updateScaleZ( Rim3dView* sourceView, double scaleZ );
|
||||
|
||||
|
@ -954,6 +954,10 @@ void RiuMainWindow::slotRefreshViewActions()
|
||||
RimGridView* gridView = RiaApplication::instance()->activeGridView();
|
||||
RimEclipseContourMapView* view2d = dynamic_cast<RimEclipseContourMapView*>( gridView );
|
||||
bool enabled = gridView != nullptr && view2d == nullptr;
|
||||
if ( ( gridView != nullptr ) && gridView->viewer() )
|
||||
{
|
||||
enabled = enabled && gridView->viewer()->isNavigationRotationEnabled();
|
||||
}
|
||||
m_viewFromNorth->setEnabled( enabled );
|
||||
m_viewFromSouth->setEnabled( enabled );
|
||||
m_viewFromEast->setEnabled( enabled );
|
||||
|
@ -950,6 +950,14 @@ void RiuViewer::enableNavigationRotation( bool enable )
|
||||
if ( tbNavPol ) tbNavPol->enableRotation( m_isNavigationRotationEnabled );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RiuViewer::isNavigationRotationEnabled() const
|
||||
{
|
||||
return m_isNavigationRotationEnabled;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -110,8 +110,9 @@ public:
|
||||
void addColorLegendToBottomLeftCorner( caf::TitledOverlayFrame* legend, bool isForComparisonView );
|
||||
void removeColorLegend( caf::TitledOverlayFrame* legend );
|
||||
|
||||
void enableNavigationRotation( bool disable );
|
||||
void enableNavigationRotation( bool enable );
|
||||
void updateNavigationPolicy();
|
||||
bool isNavigationRotationEnabled() const;
|
||||
|
||||
void navigationPolicyUpdate() override;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user