mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Refactor connection between cases and views.
Eclipse grid views and contour maps are not longer a child of the case. The views are not separate collections (one for grid and one for contour maps) on root level.
This commit is contained in:
@@ -20,6 +20,7 @@
|
||||
|
||||
#include "RicPasteFeatureImpl.h"
|
||||
|
||||
#include "Rim3dView.h"
|
||||
#include "RimCase.h"
|
||||
#include "RimCellFilter.h"
|
||||
#include "RimCellFilterCollection.h"
|
||||
@@ -42,17 +43,9 @@ bool RicPasteCellFiltersFeature::isCommandEnabled() const
|
||||
|
||||
std::vector<caf::PdmPointer<RimCellFilter>> typedObjects;
|
||||
objectGroup.objectsByType( &typedObjects );
|
||||
if ( typedObjects.empty() )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if ( typedObjects.empty() ) return false;
|
||||
|
||||
if ( dynamic_cast<RimCellFilterCollection*>( caf::SelectionManager::instance()->selectedItem() ) )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
return dynamic_cast<RimCellFilterCollection*>( caf::SelectionManager::instance()->selectedItem() ) != nullptr;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -63,7 +56,11 @@ void RicPasteCellFiltersFeature::onActionTriggered( bool isChecked )
|
||||
auto cellFilterCollection = dynamic_cast<RimCellFilterCollection*>( caf::SelectionManager::instance()->selectedItem() );
|
||||
if ( !cellFilterCollection ) return;
|
||||
|
||||
auto eclipseCase = cellFilterCollection->firstAncestorOfType<RimCase>();
|
||||
auto view = cellFilterCollection->firstAncestorOfType<Rim3dView>();
|
||||
if ( !view ) return;
|
||||
|
||||
auto eclipseCase = view->ownerCase();
|
||||
if ( !eclipseCase ) return;
|
||||
|
||||
caf::PdmObjectGroup objectGroup;
|
||||
RicPasteFeatureImpl::findObjectsFromClipboardRefs( &objectGroup );
|
||||
|
||||
@@ -186,9 +186,8 @@ void RicPasteEclipseCasesFeature::addCasesToGridCaseGroup( caf::PdmObjectGroup&
|
||||
|
||||
gridCaseGroup->updateConnectedEditors();
|
||||
|
||||
for ( size_t rvIdx = 0; rvIdx < rimResultReservoir->reservoirViews.size(); rvIdx++ )
|
||||
for ( RimEclipseView* riv : rimResultReservoir->reservoirViews() )
|
||||
{
|
||||
RimEclipseView* riv = rimResultReservoir->reservoirViews()[rvIdx];
|
||||
riv->loadDataAndUpdate();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user