Refactor and rename QIconProvider -> IconProvider (#5893)

* Refactor and rename QIconProvider -> IconProvider
* Generate icons on demand as unique_ptrs
This commit is contained in:
Gaute Lindkvist
2020-05-09 11:25:11 +02:00
committed by GitHub
parent b84e868564
commit 2e79cf614f
42 changed files with 383 additions and 379 deletions

View File

@@ -294,7 +294,7 @@ void RimWellLogTrack::simWellOptionItems( QList<caf::PdmOptionItemInfo>* options
sortedWellNames = eclipseCase->eclipseCaseData()->findSortedWellNames();
}
caf::QIconProvider simWellIcon( ":/Well.png" );
caf::IconProvider simWellIcon( ":/Well.png" );
for ( const QString& wname : sortedWellNames )
{
options->push_back( caf::PdmOptionItemInfo( wname, wname, false, simWellIcon ) );
@@ -1930,21 +1930,21 @@ std::vector<std::pair<double, double>> RimWellLogTrack::waterAndRockRegions( Ria
}
double waterEndMD = extractor->cellIntersectionMDs().front();
double rockEndMD = extractor->cellIntersectionMDs().back();
return {{waterStartMD, waterEndMD}, {waterEndMD, rockEndMD}};
return { { waterStartMD, waterEndMD }, { waterEndMD, rockEndMD } };
}
else if ( depthType == RiaDefines::DepthTypeEnum::TRUE_VERTICAL_DEPTH )
{
double waterStartTVD = 0.0;
double waterEndTVD = extractor->cellIntersectionTVDs().front();
double rockEndTVD = extractor->cellIntersectionTVDs().back();
return {{waterStartTVD, waterEndTVD}, {waterEndTVD, rockEndTVD}};
return { { waterStartTVD, waterEndTVD }, { waterEndTVD, rockEndTVD } };
}
else if ( depthType == RiaDefines::DepthTypeEnum::TRUE_VERTICAL_DEPTH_RKB )
{
double waterStartTVDRKB = extractor->wellPathData()->rkbDiff();
double waterEndTVDRKB = extractor->cellIntersectionTVDs().front() + extractor->wellPathData()->rkbDiff();
double rockEndTVDRKB = extractor->cellIntersectionTVDs().back() + extractor->wellPathData()->rkbDiff();
return {{waterStartTVDRKB, waterEndTVDRKB}, {waterEndTVDRKB, rockEndTVDRKB}};
return { { waterStartTVDRKB, waterEndTVDRKB }, { waterEndTVDRKB, rockEndTVDRKB } };
}
return {};
}
@@ -2386,7 +2386,7 @@ void RimWellLogTrack::updateFormationNamesOnPlot()
const std::vector<std::pair<double, double>> waterAndRockIntervals =
waterAndRockRegions( plot->depthType(), extractor );
m_annotationTool->attachNamedRegions( m_plotWidget,
{"Sea Level", ""},
{ "Sea Level", "" },
xRange,
waterAndRockIntervals,
m_regionAnnotationDisplay(),
@@ -2394,7 +2394,7 @@ void RimWellLogTrack::updateFormationNamesOnPlot()
( ( 100 - m_colorShadingTransparency ) * 255 ) / 100,
m_showRegionLabels(),
RiuPlotAnnotationTool::LEFT_COLUMN,
{Qt::SolidPattern, Qt::Dense6Pattern} );
{ Qt::SolidPattern, Qt::Dense6Pattern } );
}
if ( m_formationSource == CASE )
@@ -2593,16 +2593,16 @@ void RimWellLogTrack::updateWellPathAttributesOnPlot()
}
const std::map<RiaDefines::WellPathComponentType, int> sortIndices =
{{RiaDefines::WellPathComponentType::WELL_PATH, 0},
{RiaDefines::WellPathComponentType::CASING, 1},
{RiaDefines::WellPathComponentType::LINER, 2},
{RiaDefines::WellPathComponentType::PERFORATION_INTERVAL, 3},
{RiaDefines::WellPathComponentType::FISHBONES, 4},
{RiaDefines::WellPathComponentType::FRACTURE, 5},
{RiaDefines::WellPathComponentType::PACKER, 6},
{RiaDefines::WellPathComponentType::ICD, 7},
{RiaDefines::WellPathComponentType::AICD, 8},
{RiaDefines::WellPathComponentType::ICV, 9}};
{ { RiaDefines::WellPathComponentType::WELL_PATH, 0 },
{ RiaDefines::WellPathComponentType::CASING, 1 },
{ RiaDefines::WellPathComponentType::LINER, 2 },
{ RiaDefines::WellPathComponentType::PERFORATION_INTERVAL, 3 },
{ RiaDefines::WellPathComponentType::FISHBONES, 4 },
{ RiaDefines::WellPathComponentType::FRACTURE, 5 },
{ RiaDefines::WellPathComponentType::PACKER, 6 },
{ RiaDefines::WellPathComponentType::ICD, 7 },
{ RiaDefines::WellPathComponentType::AICD, 8 },
{ RiaDefines::WellPathComponentType::ICV, 9 } };
std::stable_sort( allWellPathComponents.begin(),
allWellPathComponents.end(),