Well paths: Update display model after delete

This commit is contained in:
Magne Sjaastad 2013-10-23 08:07:11 +02:00
parent 9abc3387aa
commit 76ffd7e937
3 changed files with 21 additions and 3 deletions

View File

@ -1586,7 +1586,16 @@ void RimUiTreeView::slotDeleteAllWellPaths()
if (myModel)
{
myModel->deleteAllWellPaths(currentIndex());
caf::PdmUiTreeItem* uiItem = myModel->getTreeItemFromIndex(currentIndex());
if (uiItem && uiItem->dataObject())
{
RimWellPathCollection* wellPathCollection = dynamic_cast<RimWellPathCollection*>(uiItem->dataObject().p());
if (wellPathCollection)
{
wellPathCollection->scheduleGeometryRegenAndRedrawViews();
}
}
}
}

View File

@ -108,8 +108,7 @@ RimWellPathCollection::~RimWellPathCollection()
//--------------------------------------------------------------------------------------------------
void RimWellPathCollection::fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue)
{
m_wellPathCollectionPartManager->scheduleGeometryRegen();
if (m_project) m_project->createDisplayModelAndRedrawAllViews();
scheduleGeometryRegenAndRedrawViews();
}
@ -227,6 +226,15 @@ caf::PdmFieldHandle* RimWellPathCollection::objectToggleField()
return &isActive;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimWellPathCollection::scheduleGeometryRegenAndRedrawViews()
{
m_wellPathCollectionPartManager->scheduleGeometryRegen();
if (m_project) m_project->createDisplayModelAndRedrawAllViews();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------

View File

@ -73,6 +73,7 @@ public:
virtual void fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue );
void scheduleGeometryRegenAndRedrawViews();
private:
virtual void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering );