mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Support linking of 2D intersection views
* Major refactor from RimGridView to Rim3dView * Move view linker/controller functions to Rim3dView * Add bitmask to define the content of a 3D view * Link views based on matching content * Enable bit mask operators at global scope * Make it possible to use 2d intersection views as comparison views * Fix crash when a view used as comparison view is deleted * Move unlinking to Rim3dView * Add options to snapshot only 3D views/plots as part of regression testing * WBS plot: Improve default name, hide axis for some tracks
This commit is contained in:
@@ -37,8 +37,6 @@
|
||||
#include "RimTextAnnotation.h"
|
||||
#include "RimTools.h"
|
||||
#include "RimViewController.h"
|
||||
#include "RimViewLinker.h"
|
||||
#include "RimViewLinkerCollection.h"
|
||||
#include "RimViewNameConfig.h"
|
||||
#include "RimWellMeasurementCollection.h"
|
||||
#include "RimWellMeasurementInViewCollection.h"
|
||||
@@ -110,35 +108,6 @@ RimGridView::RimGridView()
|
||||
m_surfaceVizModel->setName( "SurfaceModel" );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimGridView::~RimGridView( void )
|
||||
{
|
||||
RimProject* proj = RimProject::current();
|
||||
|
||||
if ( proj && this->isMasterView() )
|
||||
{
|
||||
RimViewLinker* viewLinker = this->assosiatedViewLinker();
|
||||
viewLinker->setMasterView( nullptr );
|
||||
|
||||
delete proj->viewLinkerCollection->viewLinker();
|
||||
proj->viewLinkerCollection->viewLinker = nullptr;
|
||||
|
||||
proj->uiCapability()->updateConnectedEditors();
|
||||
}
|
||||
|
||||
RimViewController* vController = this->viewController();
|
||||
if ( proj && vController )
|
||||
{
|
||||
vController->setManagedView( nullptr );
|
||||
vController->ownerViewLinker()->removeViewController( vController );
|
||||
delete vController;
|
||||
|
||||
proj->uiCapability()->updateConnectedEditors();
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -306,43 +275,6 @@ void RimGridView::replaceCellFilterCollectionWithOverride()
|
||||
this->uiCapability()->updateConnectedEditors();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimViewController* RimGridView::viewController() const
|
||||
{
|
||||
std::vector<RimViewController*> objects;
|
||||
this->objectsWithReferringPtrFieldsOfType( objects );
|
||||
|
||||
for ( auto v : objects )
|
||||
{
|
||||
if ( v )
|
||||
{
|
||||
return v;
|
||||
}
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimViewLinker* RimGridView::assosiatedViewLinker() const
|
||||
{
|
||||
RimViewLinker* viewLinker = this->viewLinkerIfMasterView();
|
||||
if ( !viewLinker )
|
||||
{
|
||||
RimViewController* viewController = this->viewController();
|
||||
if ( viewController )
|
||||
{
|
||||
viewLinker = viewController->ownerViewLinker();
|
||||
}
|
||||
}
|
||||
|
||||
return viewLinker;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -472,16 +404,6 @@ void RimGridView::fieldChangedByUi( const caf::PdmFieldHandle* changedField, con
|
||||
}
|
||||
|
||||
Rim3dView::fieldChangedByUi( changedField, oldValue, newValue );
|
||||
|
||||
if ( changedField == &m_scaleZ )
|
||||
{
|
||||
RimViewLinker* viewLinker = this->assosiatedViewLinker();
|
||||
if ( viewLinker )
|
||||
{
|
||||
viewLinker->updateScaleZ( this, scaleZ() );
|
||||
viewLinker->updateCamera( this );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -524,25 +446,6 @@ void RimGridView::selectOverlayInfoConfig()
|
||||
Riu3DMainWindowTools::selectAsCurrentItem( m_overlayInfoConfig );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimViewLinker* RimGridView::viewLinkerIfMasterView() const
|
||||
{
|
||||
std::vector<RimViewLinker*> objects;
|
||||
this->objectsWithReferringPtrFieldsOfType( objects );
|
||||
|
||||
for ( auto viewLinker : objects )
|
||||
{
|
||||
if ( viewLinker )
|
||||
{
|
||||
return viewLinker;
|
||||
}
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user