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:
Magne Sjaastad
2022-11-04 15:48:25 +01:00
committed by GitHub
parent f77b3673b0
commit d4086ee371
20 changed files with 157 additions and 159 deletions

View File

@@ -21,8 +21,6 @@
#include "RicLinkVisibleViewsFeatureUi.h"
#include "RimEclipseContourMapView.h"
#include "RimGeoMechContourMapView.h"
#include "RimGridView.h"
#include "RimProject.h"
#include "RimViewController.h"
@@ -59,7 +57,7 @@ bool RicLinkVisibleViewsFeature::isCommandEnabled()
if ( proj->viewLinkerCollection() && proj->viewLinkerCollection()->viewLinker() )
{
proj->viewLinkerCollection()->viewLinker()->allViews( linkedviews );
linkedviews = proj->viewLinkerCollection()->viewLinker()->allViews();
}
if ( visibleGridViews.size() >= 2 && ( linkedviews.size() < visibleGridViews.size() ) )
@@ -94,18 +92,6 @@ void RicLinkVisibleViewsFeature::setupActionLook( QAction* actionToSetup )
actionToSetup->setIcon( QIcon( ":/LinkView.svg" ) );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicLinkVisibleViewsFeature::allLinkedViews( std::vector<RimGridView*>& views )
{
RimProject* proj = RimProject::current();
if ( proj->viewLinkerCollection()->viewLinker() )
{
proj->viewLinkerCollection()->viewLinker()->allViews( views );
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@@ -113,17 +99,12 @@ void RicLinkVisibleViewsFeature::findLinkableVisibleViews( std::vector<RimGridVi
{
RimProject* proj = RimProject::current();
std::vector<RimGridView*> alreadyLinkedViews;
allLinkedViews( alreadyLinkedViews );
std::vector<RimGridView*> visibleGridViews;
proj->allVisibleGridViews( visibleGridViews );
for ( auto gridView : visibleGridViews )
{
if ( !gridView ) continue;
if ( dynamic_cast<RimEclipseContourMapView*>( gridView ) ) continue;
if ( dynamic_cast<RimGeoMechContourMapView*>( gridView ) ) continue;
if ( gridView->assosiatedViewLinker() ) continue;
views.push_back( gridView );