mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
(#373) Fixed update after delete.
Removed the editors used to update after delete, and did all the updating from the command directly. Less code easier to follow, not as generic.
This commit is contained in:
@@ -28,6 +28,11 @@
|
||||
#include "cafNotificationCenter.h"
|
||||
#include "cafSelectionManager.h"
|
||||
#include "cafPdmDocument.h"
|
||||
#include "RimCellRangeFilterCollection.h"
|
||||
#include "RimEclipsePropertyFilterCollection.h"
|
||||
#include "RimGeoMechPropertyFilterCollection.h"
|
||||
#include "RimWellPathCollection.h"
|
||||
#include "RimView.h"
|
||||
|
||||
|
||||
namespace caf
|
||||
@@ -63,10 +68,45 @@ void RicDeleteItemExec::redo()
|
||||
}
|
||||
|
||||
listField->erase(m_commandData->m_indexToObject);
|
||||
|
||||
delete obj;
|
||||
|
||||
listField->uiCapability()->updateConnectedEditors();
|
||||
caf::PdmObjectHandle* parentObj = listField->ownerObject();
|
||||
parentObj->capability<caf::PdmUiObjectHandle>()->updateConnectedEditors();
|
||||
|
||||
RimView* view = NULL;
|
||||
parentObj->firstAnchestorOrThisOfType(view);
|
||||
|
||||
RimCellRangeFilterCollection* rangeFilterColl;
|
||||
parentObj->firstAnchestorOrThisOfType(rangeFilterColl);
|
||||
|
||||
if (view && rangeFilterColl)
|
||||
{
|
||||
view->scheduleGeometryRegen(RANGE_FILTERED);
|
||||
view->scheduleGeometryRegen(RANGE_FILTERED_INACTIVE);
|
||||
|
||||
view->scheduleCreateDisplayModelAndRedraw();
|
||||
}
|
||||
|
||||
RimEclipsePropertyFilterCollection* eclipsePropColl;
|
||||
parentObj->firstAnchestorOrThisOfType(eclipsePropColl);
|
||||
|
||||
RimGeoMechPropertyFilterCollection* geoMechPropColl;
|
||||
parentObj->firstAnchestorOrThisOfType(geoMechPropColl);
|
||||
|
||||
if (view && (eclipsePropColl || geoMechPropColl))
|
||||
{
|
||||
view->scheduleGeometryRegen(PROPERTY_FILTERED);
|
||||
view->scheduleCreateDisplayModelAndRedraw();
|
||||
}
|
||||
|
||||
RimWellPathCollection* wellPathColl;
|
||||
parentObj->firstAnchestorOrThisOfType(wellPathColl);
|
||||
|
||||
if (wellPathColl)
|
||||
{
|
||||
wellPathColl->scheduleGeometryRegenAndRedrawViews();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -87,6 +127,7 @@ void RicDeleteItemExec::undo()
|
||||
PdmDocument::initAfterReadTraversal(obj);
|
||||
|
||||
listField->uiCapability()->updateConnectedEditors();
|
||||
listField->ownerObject()->capability<caf::PdmUiObjectHandle>()->updateConnectedEditors();
|
||||
|
||||
if (m_notificationCenter) m_notificationCenter->notifyObservers();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user