mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Allow linking of contour map views
* Place copy of contour map in correct collection * Allow linking of contour maps * Improve handling of contour views and 3D views * Guard nullptr * Guard assert seen on Linux * Zoom all on contour map when unlinked to reset zoom If a contour map is linked to a 3D view, the view can get distorted. Call ZoomAll to reset to sensible defaults. * Remove default rainbow legend
This commit is contained in:
@@ -263,6 +263,25 @@ void RimViewLinker::removeOverrides()
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimViewLinker::updateScaleWidgetVisibility()
|
||||
{
|
||||
// Create new display model that will call RimEclipseContourMapView::onUpdateLegends() where the visibility of scale
|
||||
// widgets is controlled
|
||||
|
||||
if ( masterView() ) masterView()->scheduleCreateDisplayModelAndRedraw();
|
||||
|
||||
for ( RimViewController* viewLink : m_viewControllers )
|
||||
{
|
||||
if ( viewLink->managedView() )
|
||||
{
|
||||
viewLink->managedView()->scheduleCreateDisplayModelAndRedraw();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -349,8 +368,10 @@ RimGridView* RimViewLinker::masterView() const
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimViewLinker::allViews( std::vector<RimGridView*>& views ) const
|
||||
std::vector<RimGridView*> RimViewLinker::allViews() const
|
||||
{
|
||||
std::vector<RimGridView*> views;
|
||||
|
||||
views.push_back( m_masterView() );
|
||||
|
||||
for ( const auto& viewController : m_viewControllers )
|
||||
@@ -360,6 +381,8 @@ void RimViewLinker::allViews( std::vector<RimGridView*>& views ) const
|
||||
views.push_back( viewController->managedView() );
|
||||
}
|
||||
}
|
||||
|
||||
return views;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -535,6 +558,8 @@ void RimViewLinker::onChildDeleted( caf::PdmChildArrayFieldHandle* childArr
|
||||
RimViewLinkerCollection* viewLinkerCollection = nullptr;
|
||||
this->firstAncestorOrThisOfType( viewLinkerCollection );
|
||||
if ( viewLinkerCollection ) viewLinkerCollection->updateConnectedEditors();
|
||||
|
||||
updateScaleWidgetVisibility();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -644,6 +669,8 @@ void RimViewLinker::addDependentView( RimGridView* view )
|
||||
|
||||
viewContr->setManagedView( view );
|
||||
}
|
||||
|
||||
updateScaleWidgetVisibility();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user