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:
@@ -24,8 +24,6 @@
|
||||
#include "RicLinkVisibleViewsFeature.h"
|
||||
|
||||
#include "Rim3dView.h"
|
||||
#include "RimEclipseContourMapView.h"
|
||||
#include "RimGeoMechContourMapView.h"
|
||||
#include "RimGridView.h"
|
||||
#include "RimProject.h"
|
||||
#include "RimViewLinker.h"
|
||||
@@ -57,8 +55,6 @@ public:
|
||||
// Link only the active view to an existing view link collection.
|
||||
RimGridView* activeView = RiaApplication::instance()->activeGridView();
|
||||
if ( !activeView ) return false;
|
||||
if ( dynamic_cast<RimEclipseContourMapView*>( activeView ) ) return false;
|
||||
if ( dynamic_cast<RimGeoMechContourMapView*>( activeView ) ) return false;
|
||||
|
||||
if ( activeView->assosiatedViewLinker() ) return false;
|
||||
|
||||
@@ -69,30 +65,17 @@ public:
|
||||
std::vector<RimGridView*> selectedGridViews;
|
||||
|
||||
caf::SelectionManager::instance()->objectsByTypeStrict( &selectedGridViews );
|
||||
bool hasAnyUnlinkableViews = false;
|
||||
for ( auto gridView : selectedGridViews )
|
||||
{
|
||||
if ( !gridView ) continue;
|
||||
|
||||
if ( dynamic_cast<RimEclipseContourMapView*>( gridView ) )
|
||||
{
|
||||
hasAnyUnlinkableViews = true;
|
||||
break;
|
||||
}
|
||||
|
||||
if ( dynamic_cast<RimGeoMechContourMapView*>( gridView ) )
|
||||
{
|
||||
hasAnyUnlinkableViews = true;
|
||||
break;
|
||||
}
|
||||
|
||||
if ( !gridView->assosiatedViewLinker() )
|
||||
{
|
||||
m_viewsToLink.push_back( gridView );
|
||||
}
|
||||
}
|
||||
|
||||
if ( !m_viewsToLink.empty() && !hasAnyUnlinkableViews )
|
||||
if ( !m_viewsToLink.empty() )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user