#950 Fixed updating when formation names selection in case are changed, or the fomation name object is deleted.

This commit is contained in:
Jacob Støren 2016-11-04 08:48:38 +01:00
parent 2c6e6f4a80
commit 7501dc7a5f
2 changed files with 34 additions and 1 deletions

View File

@ -39,6 +39,8 @@
#include "cafPdmReferenceHelper.h"
#include "cafPdmUiFieldHandle.h"
#include "cafSelectionManager.h"
#include "RimFormationNamesCollection.h"
#include "RimCase.h"
namespace caf
@ -68,6 +70,9 @@ void RicDeleteItemExec::redo()
PdmObjectHandle* obj = children[m_commandData->m_indexToObject];
caf::SelectionManager::instance()->removeObjectFromAllSelections(obj);
std::vector<caf::PdmObjectHandle*> referringObjects;
obj->objectsWithReferringPtrFields(referringObjects);
if (m_commandData->m_deletedObjectAsXml().isEmpty())
{
m_commandData->m_deletedObjectAsXml = xmlObj(obj)->writeObjectToXmlString();
@ -83,6 +88,8 @@ void RicDeleteItemExec::redo()
RimView* view = NULL;
parentObj->firstAncestorOrThisOfType(view);
// Range Filters
RimCellRangeFilterCollection* rangeFilterColl;
parentObj->firstAncestorOrThisOfType(rangeFilterColl);
@ -91,6 +98,8 @@ void RicDeleteItemExec::redo()
rangeFilterColl->updateDisplayModeNotifyManagedViews(NULL);
}
// Prop Filter
RimEclipsePropertyFilterCollection* eclipsePropColl;
parentObj->firstAncestorOrThisOfType(eclipsePropColl);
@ -103,6 +112,8 @@ void RicDeleteItemExec::redo()
view->scheduleCreateDisplayModelAndRedraw();
}
// Intersections
RimIntersectionCollection* crossSectionColl;
parentObj->firstAncestorOrThisOfType(crossSectionColl);
if (view && crossSectionColl)
@ -110,6 +121,7 @@ void RicDeleteItemExec::redo()
view->scheduleCreateDisplayModelAndRedraw();
}
// Well paths
RimWellPathCollection* wellPathColl;
parentObj->firstAncestorOrThisOfType(wellPathColl);
@ -153,6 +165,8 @@ void RicDeleteItemExec::redo()
}
}
// Linked views
RimViewLinkerCollection* viewLinkerCollection = NULL;
parentObj->firstAncestorOrThisOfType(viewLinkerCollection);
if (viewLinkerCollection)
@ -168,6 +182,19 @@ void RicDeleteItemExec::redo()
project->uiCapability()->updateConnectedEditors();
}
}
// Formation names
RimFormationNamesCollection* formationNamesCollection;
parentObj->firstAncestorOrThisOfType(formationNamesCollection);
if (formationNamesCollection)
{
for(caf::PdmObjectHandle* reffingObj :referringObjects)
{
RimCase* aCase = dynamic_cast<RimCase*>(reffingObj);
if (aCase) aCase->updateFormationNamesData();
}
}
}
}

View File

@ -319,6 +319,7 @@ void RimEclipseCase::updateFormationNamesData()
if (eclView->cellResult()->resultType() == RimDefines::FORMATION_NAMES)
{
eclView->cellResult()->setResultVariable(RimDefines::undefinedResultName());
eclView->cellResult()->updateConnectedEditors();
}
RimEclipsePropertyFilterCollection* eclFilColl = eclView->eclipsePropertyFilterCollection();
@ -334,9 +335,14 @@ void RimEclipseCase::updateFormationNamesData()
RimEclipsePropertyFilterCollection* eclFilColl = eclView->eclipsePropertyFilterCollection();
for ( RimEclipsePropertyFilter* propFilter : eclFilColl->propertyFilters )
{
if ( propFilter->resultDefinition->resultType() == RimDefines::FORMATION_NAMES ) propFilter->setToDefaultValues();
if ( propFilter->resultDefinition->resultType() == RimDefines::FORMATION_NAMES )
{
propFilter->setToDefaultValues();
propFilter->updateConnectedEditors();
}
}
view->scheduleGeometryRegen(PROPERTY_FILTERED);
view->scheduleCreateDisplayModelAndRedraw();
}
}