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 authored and GitHub committed 2022-08-19 14:30:25 +02:00
1 parent 506bfbd638
commit 4cd38d7daf
51 files changed
+240 -418

No files matched your search

@@ -46,8 +46,6 @@
#include "RimGeoMechResultDefinition.h"
#include "RimGeoMechView.h"
#include "RimMainPlotCollection.h"
#include "RimOilField.h"
#include "RimProject.h"
#include "RimTools.h"
#include "RimWellBoreStabilityPlot.h"
#include "RimWellLogCurve.h"
@@ -438,10 +436,7 @@ void RimWellLogExtractionCurve::extractData( bool* isUsingPseudoLength,
clampBranchIndex();
RimMainPlotCollection* mainPlotCollection;
this->firstAncestorOrThisOfTypeAsserted( mainPlotCollection );
RimWellLogPlotCollection* wellLogCollection = mainPlotCollection->wellLogPlotCollection();
RimWellLogPlotCollection* wellLogCollection = RimMainPlotCollection::current()->wellLogPlotCollection();
cvf::ref<RigEclipseWellLogExtractor> eclExtractor;
cvf::ref<RigGeoMechWellLogExtractor> geomExtractor;
@@ -696,15 +691,7 @@ std::set<QString> RimWellLogExtractionCurve::sortedSimWellNames()
//--------------------------------------------------------------------------------------------------
void RimWellLogExtractionCurve::clearGeneratedSimWellPaths()
{
RimWellLogPlotCollection* wellLogCollection = nullptr;
// Need to use this approach, and not firstAnchestor because the curve might not be inside the hierarchy when
// deleted.
RimProject* proj = RimProject::current();
if ( proj && proj->mainPlotCollection() ) wellLogCollection = proj->mainPlotCollection()->wellLogPlotCollection();
if ( !wellLogCollection ) return;
RimWellLogPlotCollection* wellLogCollection = RimMainPlotCollection::current()->wellLogPlotCollection();
for ( auto wellPath : m_wellPathsWithExtractors )
{
@@ -173,8 +173,8 @@ RimWellLogRftCurve::RimWellLogRftCurve()
CAF_PDM_InitFieldNoDefault( &m_wellLogChannelName, "WellLogChannelName", "Well Property" );
CAF_PDM_InitFieldNoDefault( &m_rftDataType, "RftDataType", "Data Type" );
CAF_PDM_InitField( &m_segmentResultName, "SegmentResultName", RiaResultNames::undefinedResultName(), "Segment Result Name" );
CAF_PDM_InitField( &m_segmentBranchIndex, "SegmentBranchIndex", -1, "Segment Branch" );
CAF_PDM_InitField( &m_segmentResultName, "SegmentResultName", RiaResultNames::undefinedResultName(), "Result Name" );
CAF_PDM_InitField( &m_segmentBranchIndex, "SegmentBranchIndex", -1, "Branch" );
CAF_PDM_InitFieldNoDefault( &m_segmentBranchType, "SegmentBranchType", "Branch Type" );
}