Simplify access to RimMainPlotCollection

* Add current() to RimMainPlotCollection to avoid include of RimProject
* Remove "segment" prefix
* Reload data when RftCase changes
This commit is contained in:
Magne Sjaastad
2022-08-19 05:30:25 -07:00
committed by GitHub
parent 506bfbd638
commit 4cd38d7daf
51 changed files with 240 additions and 418 deletions

View File

@@ -60,9 +60,7 @@ RimWellMeasurementCollection::~RimWellMeasurementCollection()
//--------------------------------------------------------------------------------------------------
void RimWellMeasurementCollection::updateAllCurves()
{
RimProject* proj;
this->firstAncestorOrThisOfTypeAsserted( proj );
RimMainPlotCollection* plotCollection = proj->mainPlotCollection();
RimMainPlotCollection* plotCollection = RimMainPlotCollection::current();
std::vector<RimWellMeasurementCurve*> measurementCurves;
plotCollection->descendantsIncludingThisOfType( measurementCurves );
@@ -80,9 +78,7 @@ void RimWellMeasurementCollection::updateAllCurves()
//--------------------------------------------------------------------------------------------------
void RimWellMeasurementCollection::deleteAllEmptyCurves()
{
RimProject* proj;
this->firstAncestorOrThisOfTypeAsserted( proj );
RimMainPlotCollection* plotCollection = proj->mainPlotCollection();
RimMainPlotCollection* plotCollection = RimMainPlotCollection::current();
std::vector<RimWellMeasurementCurve*> measurementCurves;
plotCollection->descendantsIncludingThisOfType( measurementCurves );
@@ -269,8 +265,6 @@ void RimWellMeasurementCollection::removeMeasurementsForFilePath( RimWellMeasure
delete measurementsToRemove[i];
}
RimProject* proj;
this->firstAncestorOrThisOfTypeAsserted( proj );
proj->scheduleCreateDisplayModelAndRedrawAllViews();
RimProject::current()->scheduleCreateDisplayModelAndRedrawAllViews();
this->updateAllCurves();
}