2015-08-14 09:45:57 +02:00
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
//
|
|
|
|
|
// Copyright (C) 2015- Statoil ASA
|
|
|
|
|
// Copyright (C) 2015- Ceetron Solutions AS
|
2019-09-06 10:40:57 +02:00
|
|
|
//
|
2015-08-14 09:45:57 +02:00
|
|
|
// ResInsight is free software: you can redistribute it and/or modify
|
|
|
|
|
// it under the terms of the GNU General Public License as published by
|
|
|
|
|
// the Free Software Foundation, either version 3 of the License, or
|
|
|
|
|
// (at your option) any later version.
|
2019-09-06 10:40:57 +02:00
|
|
|
//
|
2015-08-14 09:45:57 +02:00
|
|
|
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
|
|
|
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
|
|
|
// FITNESS FOR A PARTICULAR PURPOSE.
|
2019-09-06 10:40:57 +02:00
|
|
|
//
|
|
|
|
|
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
2015-08-14 09:45:57 +02:00
|
|
|
// for more details.
|
|
|
|
|
//
|
|
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
2015-08-11 20:59:05 +02:00
|
|
|
|
|
|
|
|
#include "RicDeleteItemExec.h"
|
|
|
|
|
#include "RicDeleteItemExecData.h"
|
|
|
|
|
|
2019-05-06 10:36:05 +02:00
|
|
|
#include "RiaGuiApplication.h"
|
2017-12-15 10:37:51 +01:00
|
|
|
|
2020-01-06 11:30:06 +01:00
|
|
|
#include "Rim2dIntersectionViewCollection.h"
|
2018-01-18 11:42:29 +01:00
|
|
|
#include "Rim3dView.h"
|
2018-11-27 15:43:44 +01:00
|
|
|
#include "RimAnnotationCollection.h"
|
|
|
|
|
#include "RimAnnotationInViewCollection.h"
|
2017-02-22 14:40:13 +01:00
|
|
|
#include "RimCase.h"
|
2015-08-14 15:20:50 +02:00
|
|
|
#include "RimCellRangeFilterCollection.h"
|
|
|
|
|
#include "RimEclipsePropertyFilterCollection.h"
|
2018-01-18 11:42:29 +01:00
|
|
|
#include "RimEclipseView.h"
|
2018-05-31 10:23:51 +02:00
|
|
|
#include "RimEnsembleCurveFilterCollection.h"
|
|
|
|
|
#include "RimEnsembleCurveSet.h"
|
2018-04-20 14:58:39 +02:00
|
|
|
#include "RimEnsembleCurveSetCollection.h"
|
2017-02-22 14:40:13 +01:00
|
|
|
#include "RimFormationNamesCollection.h"
|
2020-01-06 11:30:06 +01:00
|
|
|
#include "RimFractureTemplateCollection.h"
|
2015-08-14 15:20:50 +02:00
|
|
|
#include "RimGeoMechPropertyFilterCollection.h"
|
2016-09-23 13:11:35 +02:00
|
|
|
#include "RimIntersectionCollection.h"
|
2019-11-25 15:34:36 +01:00
|
|
|
#include "RimIntersectionResultsDefinitionCollection.h"
|
2015-09-15 13:14:13 +02:00
|
|
|
#include "RimProject.h"
|
2017-10-13 09:29:42 +02:00
|
|
|
#include "RimSimWellInView.h"
|
2017-12-15 12:16:47 +01:00
|
|
|
#include "RimSummaryCrossPlotCollection.h"
|
2018-04-20 14:58:39 +02:00
|
|
|
#include "RimSummaryPlot.h"
|
2018-01-18 11:42:29 +01:00
|
|
|
#include "RimSummaryPlotCollection.h"
|
2020-01-06 11:30:06 +01:00
|
|
|
#include "RimSurfaceCollection.h"
|
2015-09-15 13:14:13 +02:00
|
|
|
#include "RimViewLinkerCollection.h"
|
2015-09-01 14:50:26 +02:00
|
|
|
#include "RimWellLogPlot.h"
|
2015-09-07 14:30:52 +02:00
|
|
|
#include "RimWellLogPlotCollection.h"
|
2015-11-04 16:14:42 +01:00
|
|
|
#include "RimWellLogTrack.h"
|
2017-02-22 14:40:13 +01:00
|
|
|
#include "RimWellPath.h"
|
2015-09-15 13:14:13 +02:00
|
|
|
#include "RimWellPathCollection.h"
|
|
|
|
|
|
2018-04-27 06:28:08 +02:00
|
|
|
#include "RiuPlotMainWindow.h"
|
2017-12-15 10:37:51 +01:00
|
|
|
|
2015-09-15 13:14:13 +02:00
|
|
|
#include "cafNotificationCenter.h"
|
|
|
|
|
#include "cafPdmChildArrayField.h"
|
|
|
|
|
#include "cafPdmDocument.h"
|
|
|
|
|
#include "cafPdmReferenceHelper.h"
|
|
|
|
|
#include "cafPdmUiFieldHandle.h"
|
|
|
|
|
#include "cafSelectionManager.h"
|
2015-08-11 20:59:05 +02:00
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 10:40:57 +02:00
|
|
|
///
|
2015-08-11 20:59:05 +02:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
|
QString RicDeleteItemExec::name()
|
|
|
|
|
{
|
|
|
|
|
return m_commandData->classKeyword();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 10:40:57 +02:00
|
|
|
///
|
2015-08-11 20:59:05 +02:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
|
void RicDeleteItemExec::redo()
|
|
|
|
|
{
|
2020-02-12 11:43:15 +01:00
|
|
|
caf::PdmFieldHandle* field =
|
|
|
|
|
caf::PdmReferenceHelper::fieldFromReference( m_commandData->m_rootObject, m_commandData->m_pathToField );
|
2015-08-11 20:59:05 +02:00
|
|
|
|
2019-09-06 10:40:57 +02:00
|
|
|
caf::PdmChildArrayFieldHandle* listField = dynamic_cast<caf::PdmChildArrayFieldHandle*>( field );
|
|
|
|
|
if ( listField )
|
2015-08-11 20:59:05 +02:00
|
|
|
{
|
2017-05-19 13:40:38 +02:00
|
|
|
std::vector<caf::PdmObjectHandle*> children;
|
2019-09-06 10:40:57 +02:00
|
|
|
listField->childObjects( &children );
|
2015-08-11 20:59:05 +02:00
|
|
|
|
2017-05-19 13:40:38 +02:00
|
|
|
caf::PdmObjectHandle* obj = children[m_commandData->m_indexToObject];
|
2019-09-06 10:40:57 +02:00
|
|
|
caf::SelectionManager::instance()->removeObjectFromAllSelections( obj );
|
2015-08-11 20:59:05 +02:00
|
|
|
|
2016-11-04 08:48:38 +01:00
|
|
|
std::vector<caf::PdmObjectHandle*> referringObjects;
|
2019-09-06 10:40:57 +02:00
|
|
|
obj->objectsWithReferringPtrFields( referringObjects );
|
2016-11-04 08:48:38 +01:00
|
|
|
|
2019-09-06 10:40:57 +02:00
|
|
|
if ( m_commandData->m_deletedObjectAsXml().isEmpty() )
|
2015-08-11 20:59:05 +02:00
|
|
|
{
|
2019-09-06 10:40:57 +02:00
|
|
|
m_commandData->m_deletedObjectAsXml = xmlObj( obj )->writeObjectToXmlString();
|
2015-08-11 20:59:05 +02:00
|
|
|
}
|
|
|
|
|
|
2015-08-13 11:47:43 +02:00
|
|
|
delete obj;
|
2015-08-11 20:59:05 +02:00
|
|
|
|
2019-09-06 10:40:57 +02:00
|
|
|
listField->erase( m_commandData->m_indexToObject );
|
2015-09-25 14:46:45 +02:00
|
|
|
|
2015-08-14 15:20:50 +02:00
|
|
|
caf::PdmObjectHandle* parentObj = listField->ownerObject();
|
2015-08-20 15:24:49 +02:00
|
|
|
parentObj->uiCapability()->updateConnectedEditors();
|
2019-09-06 10:40:57 +02:00
|
|
|
|
2018-02-18 18:56:43 +01:00
|
|
|
Rim3dView* view = nullptr;
|
2019-09-06 10:40:57 +02:00
|
|
|
parentObj->firstAncestorOrThisOfType( view );
|
2019-11-25 15:34:36 +01:00
|
|
|
RimGridView* gridView = dynamic_cast<RimGridView*>( view );
|
2015-08-14 15:20:50 +02:00
|
|
|
|
2016-11-04 08:48:38 +01:00
|
|
|
// Range Filters
|
|
|
|
|
|
2015-08-14 15:20:50 +02:00
|
|
|
RimCellRangeFilterCollection* rangeFilterColl;
|
2019-09-06 10:40:57 +02:00
|
|
|
parentObj->firstAncestorOrThisOfType( rangeFilterColl );
|
2015-08-14 15:20:50 +02:00
|
|
|
|
2019-09-06 10:40:57 +02:00
|
|
|
if ( rangeFilterColl )
|
2015-08-14 15:20:50 +02:00
|
|
|
{
|
2019-09-06 10:40:57 +02:00
|
|
|
rangeFilterColl->updateDisplayModeNotifyManagedViews( nullptr );
|
2015-08-14 15:20:50 +02:00
|
|
|
}
|
2015-08-11 20:59:05 +02:00
|
|
|
|
2016-11-04 08:48:38 +01:00
|
|
|
// Prop Filter
|
|
|
|
|
|
2015-08-14 15:20:50 +02:00
|
|
|
RimEclipsePropertyFilterCollection* eclipsePropColl;
|
2019-09-06 10:40:57 +02:00
|
|
|
parentObj->firstAncestorOrThisOfType( eclipsePropColl );
|
|
|
|
|
|
2015-08-14 15:20:50 +02:00
|
|
|
RimGeoMechPropertyFilterCollection* geoMechPropColl;
|
2019-09-06 10:40:57 +02:00
|
|
|
parentObj->firstAncestorOrThisOfType( geoMechPropColl );
|
2015-08-14 15:20:50 +02:00
|
|
|
|
2019-09-06 10:40:57 +02:00
|
|
|
if ( view && ( eclipsePropColl || geoMechPropColl ) )
|
2015-08-14 15:20:50 +02:00
|
|
|
{
|
2019-09-06 10:40:57 +02:00
|
|
|
view->scheduleGeometryRegen( PROPERTY_FILTERED );
|
2015-08-14 15:20:50 +02:00
|
|
|
view->scheduleCreateDisplayModelAndRedraw();
|
|
|
|
|
}
|
|
|
|
|
|
2016-11-04 08:48:38 +01:00
|
|
|
// Intersections
|
|
|
|
|
|
2019-11-26 12:30:44 +01:00
|
|
|
RimIntersectionCollection* intersectionColl;
|
|
|
|
|
parentObj->firstAncestorOrThisOfType( intersectionColl );
|
|
|
|
|
if ( view && intersectionColl )
|
2015-11-19 13:40:45 +01:00
|
|
|
{
|
2019-11-26 12:30:44 +01:00
|
|
|
intersectionColl->syncronize2dIntersectionViews();
|
2015-11-19 13:40:45 +01:00
|
|
|
view->scheduleCreateDisplayModelAndRedraw();
|
|
|
|
|
}
|
2018-01-29 12:41:55 +01:00
|
|
|
else
|
|
|
|
|
{
|
2019-09-06 10:40:57 +02:00
|
|
|
RimCase* parentCase = dynamic_cast<RimCase*>( parentObj );
|
2018-01-29 12:41:55 +01:00
|
|
|
if ( parentCase ) // A view was deleted. Need to update the list of intersection views
|
|
|
|
|
{
|
2019-09-06 10:40:57 +02:00
|
|
|
parentCase->intersectionViewCollection()->syncFromExistingIntersections( true );
|
2018-01-29 12:41:55 +01:00
|
|
|
}
|
|
|
|
|
}
|
2015-11-19 13:40:45 +01:00
|
|
|
|
2019-11-25 15:34:36 +01:00
|
|
|
// Intersection Result Definitions
|
|
|
|
|
|
|
|
|
|
RimIntersectionResultsDefinitionCollection* separateIntersectResDefColl;
|
|
|
|
|
parentObj->firstAncestorOrThisOfType( separateIntersectResDefColl );
|
|
|
|
|
if ( gridView && separateIntersectResDefColl )
|
|
|
|
|
{
|
|
|
|
|
gridView->scheduleCreateDisplayModelAndRedraw();
|
2019-11-26 12:30:44 +01:00
|
|
|
gridView->intersectionCollection()->scheduleCreateDisplayModelAndRedraw2dIntersectionViews();
|
2019-11-25 15:34:36 +01:00
|
|
|
}
|
|
|
|
|
|
2017-01-05 14:52:59 +01:00
|
|
|
// SimWell Fractures
|
2017-10-13 10:16:01 +02:00
|
|
|
RimSimWellInView* simWell;
|
2019-09-06 10:40:57 +02:00
|
|
|
parentObj->firstAncestorOrThisOfType( simWell );
|
|
|
|
|
if ( view && simWell )
|
2017-01-05 14:52:59 +01:00
|
|
|
{
|
|
|
|
|
view->scheduleCreateDisplayModelAndRedraw();
|
|
|
|
|
}
|
|
|
|
|
|
2017-02-23 08:21:45 +01:00
|
|
|
RimFractureTemplateCollection* fracTemplateColl;
|
2019-09-06 10:40:57 +02:00
|
|
|
parentObj->firstAncestorOrThisOfType( fracTemplateColl );
|
|
|
|
|
if ( fracTemplateColl )
|
2017-02-23 08:21:45 +01:00
|
|
|
{
|
|
|
|
|
RimProject* proj = nullptr;
|
2019-09-06 10:40:57 +02:00
|
|
|
parentObj->firstAncestorOrThisOfType( proj );
|
|
|
|
|
if ( proj )
|
2017-02-23 08:21:45 +01:00
|
|
|
{
|
2018-09-11 12:41:45 +02:00
|
|
|
proj->scheduleCreateDisplayModelAndRedrawAllViews();
|
2017-02-23 08:21:45 +01:00
|
|
|
}
|
2018-01-18 11:42:29 +01:00
|
|
|
|
|
|
|
|
std::vector<Rim3dView*> views;
|
2019-09-06 10:40:57 +02:00
|
|
|
proj->allVisibleViews( views );
|
|
|
|
|
for ( Rim3dView* visibleView : views )
|
2018-01-18 11:42:29 +01:00
|
|
|
{
|
2019-09-06 10:40:57 +02:00
|
|
|
if ( dynamic_cast<RimEclipseView*>( visibleView ) )
|
2018-01-18 11:42:29 +01:00
|
|
|
{
|
2018-09-27 20:40:05 +02:00
|
|
|
visibleView->updateConnectedEditors();
|
2018-01-18 11:42:29 +01:00
|
|
|
}
|
|
|
|
|
}
|
2017-02-23 08:21:45 +01:00
|
|
|
}
|
2017-01-05 14:52:59 +01:00
|
|
|
|
2016-11-04 08:48:38 +01:00
|
|
|
// Well paths
|
2016-09-23 13:11:35 +02:00
|
|
|
|
2017-02-22 14:40:13 +01:00
|
|
|
RimWellPath* wellPath;
|
2019-09-06 10:40:57 +02:00
|
|
|
parentObj->firstAncestorOrThisOfType( wellPath );
|
2017-02-22 14:40:13 +01:00
|
|
|
|
2019-09-06 10:40:57 +02:00
|
|
|
if ( wellPath )
|
2017-02-22 14:40:13 +01:00
|
|
|
{
|
|
|
|
|
wellPath->updateConnectedEditors();
|
|
|
|
|
}
|
|
|
|
|
|
2015-08-14 15:20:50 +02:00
|
|
|
RimWellPathCollection* wellPathColl;
|
2019-09-06 10:40:57 +02:00
|
|
|
parentObj->firstAncestorOrThisOfType( wellPathColl );
|
2015-08-14 15:20:50 +02:00
|
|
|
|
2019-09-06 10:40:57 +02:00
|
|
|
if ( wellPathColl )
|
2015-08-14 15:20:50 +02:00
|
|
|
{
|
2017-06-21 17:13:19 +02:00
|
|
|
wellPathColl->scheduleRedrawAffectedViews();
|
2017-05-11 11:12:49 +02:00
|
|
|
wellPathColl->uiCapability()->updateConnectedEditors();
|
2015-08-14 15:20:50 +02:00
|
|
|
}
|
2015-09-01 14:50:26 +02:00
|
|
|
|
2015-10-29 10:29:48 +01:00
|
|
|
// Update due to deletion of curves (not tracks, handled separatly)
|
|
|
|
|
|
2015-09-01 14:50:26 +02:00
|
|
|
RimWellLogPlot* wellLogPlot;
|
2019-09-06 10:40:57 +02:00
|
|
|
parentObj->firstAncestorOrThisOfType( wellLogPlot );
|
|
|
|
|
if ( wellLogPlot )
|
2015-09-01 14:50:26 +02:00
|
|
|
{
|
2015-10-27 14:44:53 +01:00
|
|
|
wellLogPlot->calculateAvailableDepthRange();
|
2019-10-11 15:54:19 +02:00
|
|
|
wellLogPlot->updateZoom();
|
2019-05-06 10:36:05 +02:00
|
|
|
RiuPlotMainWindow* mainPlotWindow = RiaGuiApplication::instance()->mainPlotWindow();
|
2018-09-10 09:55:07 +02:00
|
|
|
mainPlotWindow->updateWellLogPlotToolBar();
|
2015-09-01 14:50:26 +02:00
|
|
|
}
|
2015-09-07 14:30:52 +02:00
|
|
|
|
2015-11-04 15:57:06 +01:00
|
|
|
RimWellLogTrack* wellLogPlotTrack;
|
2019-09-06 10:40:57 +02:00
|
|
|
parentObj->firstAncestorOrThisOfType( wellLogPlotTrack );
|
|
|
|
|
if ( wellLogPlotTrack )
|
2015-09-07 15:36:50 +02:00
|
|
|
{
|
2019-10-11 15:54:19 +02:00
|
|
|
wellLogPlotTrack->setAutoScaleXEnabled( true );
|
|
|
|
|
wellLogPlotTrack->updateZoomInQwt();
|
2019-05-06 10:36:05 +02:00
|
|
|
RiuPlotMainWindow* mainPlotWindow = RiaGuiApplication::instance()->mainPlotWindow();
|
2018-09-10 09:55:07 +02:00
|
|
|
mainPlotWindow->updateWellLogPlotToolBar();
|
2015-09-07 15:36:50 +02:00
|
|
|
}
|
2019-09-06 10:40:57 +02:00
|
|
|
|
2015-10-29 10:29:48 +01:00
|
|
|
// Update due to delete plots
|
|
|
|
|
// Make sure the plot collection disappears with the last plot
|
2015-09-07 15:36:50 +02:00
|
|
|
|
2019-09-06 10:40:57 +02:00
|
|
|
RimWellLogPlotCollection* wellLogPlotCollection = dynamic_cast<RimWellLogPlotCollection*>( parentObj );
|
|
|
|
|
if ( wellLogPlotCollection )
|
2015-09-07 14:30:52 +02:00
|
|
|
{
|
2019-09-06 10:40:57 +02:00
|
|
|
if ( wellLogPlotCollection->wellLogPlots.empty() )
|
2015-09-07 14:30:52 +02:00
|
|
|
{
|
2018-02-18 18:56:43 +01:00
|
|
|
RimProject* project = nullptr;
|
2019-09-06 10:40:57 +02:00
|
|
|
parentObj->firstAncestorOrThisOfType( project );
|
|
|
|
|
if ( project )
|
2015-10-29 10:29:48 +01:00
|
|
|
{
|
|
|
|
|
project->updateConnectedEditors();
|
|
|
|
|
}
|
2015-09-07 14:30:52 +02:00
|
|
|
}
|
2019-05-06 10:36:05 +02:00
|
|
|
RiuPlotMainWindow* mainPlotWindow = RiaGuiApplication::instance()->mainPlotWindow();
|
2018-09-10 09:55:07 +02:00
|
|
|
mainPlotWindow->updateWellLogPlotToolBar();
|
2015-09-07 14:30:52 +02:00
|
|
|
}
|
2019-09-06 10:40:57 +02:00
|
|
|
|
2016-11-04 08:48:38 +01:00
|
|
|
// Linked views
|
|
|
|
|
|
2018-02-18 18:56:43 +01:00
|
|
|
RimViewLinkerCollection* viewLinkerCollection = nullptr;
|
2019-09-06 10:40:57 +02:00
|
|
|
parentObj->firstAncestorOrThisOfType( viewLinkerCollection );
|
|
|
|
|
if ( viewLinkerCollection )
|
2015-09-15 13:14:13 +02:00
|
|
|
{
|
|
|
|
|
viewLinkerCollection->uiCapability()->updateConnectedEditors();
|
|
|
|
|
|
2018-02-18 18:56:43 +01:00
|
|
|
RimProject* project = nullptr;
|
2019-09-06 10:40:57 +02:00
|
|
|
parentObj->firstAncestorOrThisOfType( project );
|
|
|
|
|
if ( project )
|
2015-09-15 13:14:13 +02:00
|
|
|
{
|
|
|
|
|
// Update visibility of top level Linked Views item in the project tree
|
|
|
|
|
// Not visible if no views are linked
|
|
|
|
|
project->uiCapability()->updateConnectedEditors();
|
|
|
|
|
}
|
|
|
|
|
}
|
2016-11-04 08:48:38 +01:00
|
|
|
|
|
|
|
|
// Formation names
|
|
|
|
|
|
|
|
|
|
RimFormationNamesCollection* formationNamesCollection;
|
2019-09-06 10:40:57 +02:00
|
|
|
parentObj->firstAncestorOrThisOfType( formationNamesCollection );
|
|
|
|
|
if ( formationNamesCollection )
|
2016-11-04 08:48:38 +01:00
|
|
|
{
|
2019-09-06 10:40:57 +02:00
|
|
|
for ( caf::PdmObjectHandle* reffingObj : referringObjects )
|
2016-11-04 08:48:38 +01:00
|
|
|
{
|
2019-09-06 10:40:57 +02:00
|
|
|
RimCase* aCase = dynamic_cast<RimCase*>( reffingObj );
|
|
|
|
|
if ( aCase ) aCase->updateFormationNamesData();
|
2016-11-04 08:48:38 +01:00
|
|
|
}
|
|
|
|
|
}
|
2017-12-15 10:37:51 +01:00
|
|
|
|
|
|
|
|
RimSummaryPlotCollection* summaryPlotCollection = nullptr;
|
2019-09-06 10:40:57 +02:00
|
|
|
parentObj->firstAncestorOrThisOfType( summaryPlotCollection );
|
|
|
|
|
if ( summaryPlotCollection )
|
2017-12-15 10:37:51 +01:00
|
|
|
{
|
2018-05-15 08:43:36 +02:00
|
|
|
summaryPlotCollection->updateSummaryNameHasChanged();
|
2019-05-06 10:36:05 +02:00
|
|
|
RiuPlotMainWindow* mainPlotWindow = RiaGuiApplication::instance()->mainPlotWindow();
|
2017-12-15 10:37:51 +01:00
|
|
|
mainPlotWindow->updateSummaryPlotToolBar();
|
|
|
|
|
}
|
2017-12-15 12:16:47 +01:00
|
|
|
|
|
|
|
|
RimSummaryCrossPlotCollection* summaryCrossPlotCollection = nullptr;
|
2019-09-06 10:40:57 +02:00
|
|
|
parentObj->firstAncestorOrThisOfType( summaryCrossPlotCollection );
|
|
|
|
|
if ( summaryCrossPlotCollection )
|
2017-12-15 12:16:47 +01:00
|
|
|
{
|
2019-05-06 10:36:05 +02:00
|
|
|
RiuPlotMainWindow* mainPlotWindow = RiaGuiApplication::instance()->mainPlotWindow();
|
2017-12-15 12:16:47 +01:00
|
|
|
mainPlotWindow->updateSummaryPlotToolBar();
|
|
|
|
|
}
|
2018-04-20 14:58:39 +02:00
|
|
|
|
|
|
|
|
RimEnsembleCurveSetCollection* ensembleCurveSetColl = nullptr;
|
2019-09-06 10:40:57 +02:00
|
|
|
parentObj->firstAncestorOrThisOfType( ensembleCurveSetColl );
|
|
|
|
|
if ( ensembleCurveSetColl )
|
2018-04-20 14:58:39 +02:00
|
|
|
{
|
|
|
|
|
RimSummaryPlot* plot = nullptr;
|
2019-09-06 10:40:57 +02:00
|
|
|
ensembleCurveSetColl->firstAncestorOrThisOfType( plot );
|
|
|
|
|
if ( plot ) plot->updateConnectedEditors();
|
2018-04-20 14:58:39 +02:00
|
|
|
}
|
2018-05-31 10:23:51 +02:00
|
|
|
|
|
|
|
|
RimEnsembleCurveFilterCollection* ensembleCurveFilterColl = nullptr;
|
2019-09-06 10:40:57 +02:00
|
|
|
parentObj->firstAncestorOrThisOfType( ensembleCurveFilterColl );
|
|
|
|
|
if ( ensembleCurveFilterColl )
|
2018-05-31 10:23:51 +02:00
|
|
|
{
|
|
|
|
|
RimSummaryPlot* plot = nullptr;
|
2019-09-06 10:40:57 +02:00
|
|
|
ensembleCurveFilterColl->firstAncestorOrThisOfType( plot );
|
|
|
|
|
if ( plot ) plot->loadDataAndUpdate();
|
2018-05-31 10:23:51 +02:00
|
|
|
}
|
2018-11-27 15:43:44 +01:00
|
|
|
|
|
|
|
|
{
|
|
|
|
|
RimAnnotationCollection* annotationColl = nullptr;
|
2019-09-06 10:40:57 +02:00
|
|
|
parentObj->firstAncestorOrThisOfType( annotationColl );
|
|
|
|
|
if ( annotationColl )
|
2018-11-27 15:43:44 +01:00
|
|
|
{
|
|
|
|
|
annotationColl->onAnnotationDeleted();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
RimAnnotationInViewCollection* annotationColl = nullptr;
|
2019-09-06 10:40:57 +02:00
|
|
|
parentObj->firstAncestorOrThisOfType( annotationColl );
|
|
|
|
|
if ( annotationColl )
|
2018-11-27 15:43:44 +01:00
|
|
|
{
|
|
|
|
|
annotationColl->onAnnotationDeleted();
|
|
|
|
|
}
|
|
|
|
|
}
|
2020-01-06 11:30:06 +01:00
|
|
|
|
|
|
|
|
{
|
|
|
|
|
RimSurfaceCollection* surfCollection;
|
|
|
|
|
parentObj->firstAncestorOrThisOfType( surfCollection );
|
|
|
|
|
if ( surfCollection )
|
|
|
|
|
{
|
|
|
|
|
surfCollection->updateViews();
|
|
|
|
|
}
|
|
|
|
|
}
|
2015-08-11 20:59:05 +02:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 10:40:57 +02:00
|
|
|
///
|
2015-08-11 20:59:05 +02:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
|
void RicDeleteItemExec::undo()
|
|
|
|
|
{
|
2020-02-12 11:43:15 +01:00
|
|
|
caf::PdmFieldHandle* field =
|
|
|
|
|
caf::PdmReferenceHelper::fieldFromReference( m_commandData->m_rootObject, m_commandData->m_pathToField );
|
2015-08-11 20:59:05 +02:00
|
|
|
|
2019-09-06 10:40:57 +02:00
|
|
|
caf::PdmChildArrayFieldHandle* listField = dynamic_cast<caf::PdmChildArrayFieldHandle*>( field );
|
|
|
|
|
if ( listField )
|
2015-08-11 20:59:05 +02:00
|
|
|
{
|
2019-09-06 10:40:57 +02:00
|
|
|
caf::PdmObjectHandle* obj =
|
|
|
|
|
caf::PdmXmlObjectHandle::readUnknownObjectFromXmlString( m_commandData->m_deletedObjectAsXml(),
|
2019-11-14 20:48:11 +01:00
|
|
|
caf::PdmDefaultObjectFactory::instance(),
|
|
|
|
|
false );
|
2015-08-11 20:59:05 +02:00
|
|
|
|
2019-09-06 10:40:57 +02:00
|
|
|
listField->insertAt( m_commandData->m_indexToObject, obj );
|
2015-08-11 20:59:05 +02:00
|
|
|
|
2015-08-27 11:56:52 +02:00
|
|
|
obj->xmlCapability()->initAfterReadRecursively();
|
2015-08-12 11:10:10 +02:00
|
|
|
|
|
|
|
|
listField->uiCapability()->updateConnectedEditors();
|
2015-08-20 15:24:49 +02:00
|
|
|
listField->ownerObject()->uiCapability()->updateConnectedEditors();
|
2015-08-12 11:10:10 +02:00
|
|
|
|
2019-09-06 10:40:57 +02:00
|
|
|
if ( m_notificationCenter ) m_notificationCenter->notifyObservers();
|
2015-08-11 20:59:05 +02:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 10:40:57 +02:00
|
|
|
///
|
2015-08-11 20:59:05 +02:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 10:40:57 +02:00
|
|
|
RicDeleteItemExec::RicDeleteItemExec( caf::NotificationCenter* notificationCenter )
|
|
|
|
|
: CmdExecuteCommand( notificationCenter )
|
2015-08-11 20:59:05 +02:00
|
|
|
{
|
|
|
|
|
m_commandData = new RicDeleteItemExecData;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 10:40:57 +02:00
|
|
|
///
|
2015-08-11 20:59:05 +02:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
|
RicDeleteItemExecData* RicDeleteItemExec::commandData()
|
|
|
|
|
{
|
|
|
|
|
return m_commandData;
|
|
|
|
|
}
|