#3816 Annotations : Assert if resolve of PdmPtrField fails

This commit is contained in:
Magne Sjaastad 2018-12-04 14:33:14 +01:00
parent aa19715c40
commit af18e30ac6
3 changed files with 25 additions and 11 deletions

View File

@ -157,8 +157,13 @@ RimContourMapView* RicNewContourMapViewFeature::create2dContourMapFrom3dView(Rim
contourMap->setName(QString("Contour Map %1").arg(i + 1));
eclipseCase->contourMapCollection()->push_back(contourMap);
contourMap->syncronizeLocalAnnotationsFromGlobal();
// Resolve references after contour map has been inserted into Rim structures
contourMap->resolveReferencesRecursively();
std::vector<caf::PdmFieldHandle*> fieldsWithFailingResolve;
contourMap->resolveReferencesRecursively(&fieldsWithFailingResolve);
CVF_ASSERT(fieldsWithFailingResolve.empty());
contourMap->initAfterReadRecursively();
return contourMap;

View File

@ -847,16 +847,7 @@ void RimEclipseView::onLoadDataAndUpdate()
syncronizeWellsWithResults();
RimProject* proj = RiaApplication::instance()->project();
if (proj && proj->activeOilField())
{
RimAnnotationCollection* annotColl = proj->activeOilField()->annotationCollection();
if (annotColl && annotationCollection())
{
annotationCollection()->onGlobalCollectionChanged(annotColl);
}
}
syncronizeLocalAnnotationsFromGlobal();
{
// Update simulation well fractures after well cell results are imported
@ -1269,6 +1260,22 @@ void RimEclipseView::syncronizeWellsWithResults()
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimEclipseView::syncronizeLocalAnnotationsFromGlobal()
{
RimProject* proj = RiaApplication::instance()->project();
if (proj && proj->activeOilField())
{
RimAnnotationCollection* annotColl = proj->activeOilField()->annotationCollection();
if (annotColl && annotationCollection())
{
annotationCollection()->onGlobalCollectionChanged(annotColl);
}
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------

View File

@ -142,6 +142,8 @@ public:
virtual std::vector<RimLegendConfig*> legendConfigs() const override;
cvf::Color4f colorFromCellCategory(RivCellSetEnum geometryType) const;
void syncronizeLocalAnnotationsFromGlobal();
protected:
void initAfterRead() override;
virtual void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) override;