mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-09 23:16:00 -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:
parent
fc146bb554
commit
a8a1b61646
@ -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();
|
||||
}
|
||||
|
@ -33,37 +33,6 @@
|
||||
|
||||
#include "cafPdmUiEditorHandle.h"
|
||||
|
||||
class ResViewRangeFiltersEditorHandle : public caf::PdmUiEditorHandle
|
||||
{
|
||||
public:
|
||||
ResViewRangeFiltersEditorHandle(caf::PdmFieldHandle* a)
|
||||
{
|
||||
this->bindToPdmItem(a->uiCapability());
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
virtual void configureAndUpdateUi(const QString& uiConfigName)
|
||||
{
|
||||
caf::PdmUiFieldHandle* uiFieldHandle = dynamic_cast<caf::PdmUiFieldHandle*>(this->pdmItem());
|
||||
caf::PdmObjectHandle* objHandle = uiFieldHandle->fieldHandle()->ownerObject();
|
||||
|
||||
RimView* view = NULL;
|
||||
objHandle->firstAnchestorOrThisOfType(view);
|
||||
CVF_ASSERT(view);
|
||||
|
||||
view->scheduleGeometryRegen(RANGE_FILTERED);
|
||||
view->scheduleGeometryRegen(RANGE_FILTERED_INACTIVE);
|
||||
|
||||
view->scheduleCreateDisplayModelAndRedraw();
|
||||
|
||||
// This will update UI editors related to tree view (and others), as there is no tree view entity for editor for
|
||||
// the property filters childarrayfield (this field is hidden)
|
||||
uiObj(objHandle)->updateConnectedEditors();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
CAF_PDM_SOURCE_INIT(RimCellRangeFilterCollection, "CellRangeFilterCollection");
|
||||
|
||||
@ -80,7 +49,6 @@ RimCellRangeFilterCollection::RimCellRangeFilterCollection()
|
||||
CAF_PDM_InitField(&isActive, "Active", true, "Active", "", "", "");
|
||||
isActive.uiCapability()->setUiHidden(true);
|
||||
|
||||
rangeFilters.uiCapability()->addFieldEditor(new ResViewRangeFiltersEditorHandle(&rangeFilters));
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -27,35 +27,6 @@
|
||||
#include "cafPdmUiEditorHandle.h"
|
||||
|
||||
|
||||
class ResViewPropertyFilterEditorHandle : public caf::PdmUiEditorHandle
|
||||
{
|
||||
public:
|
||||
ResViewPropertyFilterEditorHandle(caf::PdmFieldHandle* a)
|
||||
{
|
||||
this->bindToPdmItem(a->uiCapability());
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
virtual void configureAndUpdateUi(const QString& uiConfigName)
|
||||
{
|
||||
caf::PdmUiFieldHandle* uiFieldHandle = dynamic_cast<caf::PdmUiFieldHandle*>(this->pdmItem());
|
||||
caf::PdmObjectHandle* objHandle = uiFieldHandle->fieldHandle()->ownerObject();
|
||||
|
||||
RimEclipseView* view = NULL;
|
||||
objHandle->firstAnchestorOrThisOfType(view);
|
||||
CVF_ASSERT(view);
|
||||
|
||||
view->scheduleGeometryRegen(PROPERTY_FILTERED);
|
||||
view->scheduleCreateDisplayModelAndRedraw();
|
||||
|
||||
// This will update UI editors related to tree view (and others), as there is no tree view entity for editor for
|
||||
// the property filters childarrayfield (this field is hidden)
|
||||
uiObj(objHandle)->updateConnectedEditors();
|
||||
}
|
||||
};
|
||||
|
||||
CAF_PDM_SOURCE_INIT(RimEclipsePropertyFilterCollection, "CellPropertyFilters");
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -71,7 +42,6 @@ RimEclipsePropertyFilterCollection::RimEclipsePropertyFilterCollection()
|
||||
CAF_PDM_InitField(&active, "Active", true, "Active", "", "", "");
|
||||
active.uiCapability()->setUiHidden(true);
|
||||
|
||||
propertyFilters.uiCapability()->addFieldEditor(new ResViewPropertyFilterEditorHandle(&propertyFilters));
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -46,30 +46,6 @@ namespace caf
|
||||
}
|
||||
}
|
||||
|
||||
class RimWellPathCollectionEditorHandle : public caf::PdmUiEditorHandle
|
||||
{
|
||||
public:
|
||||
RimWellPathCollectionEditorHandle(caf::PdmFieldHandle* a)
|
||||
{
|
||||
this->bindToPdmItem(a->uiCapability());
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
virtual void configureAndUpdateUi(const QString& uiConfigName)
|
||||
{
|
||||
caf::PdmUiFieldHandle* uiFieldHandle = dynamic_cast<caf::PdmUiFieldHandle*>(this->pdmItem());
|
||||
RimWellPathCollection* wellPathColl = dynamic_cast<RimWellPathCollection*>(uiFieldHandle->fieldHandle()->ownerObject());
|
||||
|
||||
wellPathColl->scheduleGeometryRegenAndRedrawViews();
|
||||
|
||||
// This will update UI editors related to tree view (and others), as there is no tree view entity for editor for
|
||||
// the property filters childarrayfield (this field is hidden)
|
||||
uiObj(wellPathColl)->updateConnectedEditors();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
CAF_PDM_SOURCE_INIT(RimWellPathCollection, "WellPaths");
|
||||
|
||||
@ -106,7 +82,6 @@ RimWellPathCollection::RimWellPathCollection()
|
||||
|
||||
m_asciiFileReader = new RimWellPathAsciiFileReader;
|
||||
|
||||
wellPaths.uiCapability()->addFieldEditor(new RimWellPathCollectionEditorHandle(&wellPaths));
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user