mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#5279 Formations : Add const and simplify access
This commit is contained in:
@@ -1001,15 +1001,11 @@ void RimGridCrossPlotDataSet::updateLegendRange()
|
||||
RimEclipseCase* eclipseCase = dynamic_cast<RimEclipseCase*>( m_case() );
|
||||
if ( eclipseCase )
|
||||
{
|
||||
RigFormationNames* formationNames = eclipseCase->eclipseCaseData()->activeFormationNames();
|
||||
if ( formationNames )
|
||||
const std::vector<QString> categoryNames = eclipseCase->eclipseCaseData()->formationNames();
|
||||
if ( !categoryNames.empty() )
|
||||
{
|
||||
const std::vector<QString>& categoryNames = formationNames->formationNames();
|
||||
if ( !categoryNames.empty() )
|
||||
{
|
||||
legendConfig()->setNamedCategoriesInverse( categoryNames );
|
||||
legendConfig()->setAutomaticRanges( 0, categoryNames.size() - 1, 0, categoryNames.size() - 1 );
|
||||
}
|
||||
legendConfig()->setNamedCategoriesInverse( categoryNames );
|
||||
legendConfig()->setAutomaticRanges( 0, categoryNames.size() - 1, 0, categoryNames.size() - 1 );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -403,15 +403,10 @@ void RimEclipsePropertyFilter::computeResultValueRange()
|
||||
if ( m_resultDefinition->resultType() == RiaDefines::FORMATION_NAMES )
|
||||
{
|
||||
CVF_ASSERT( parentContainer()->reservoirView()->eclipseCase()->eclipseCaseData() );
|
||||
CVF_ASSERT(
|
||||
parentContainer()->reservoirView()->eclipseCase()->eclipseCaseData()->activeFormationNames() );
|
||||
|
||||
const std::vector<QString>& fnVector = parentContainer()
|
||||
->reservoirView()
|
||||
->eclipseCase()
|
||||
->eclipseCaseData()
|
||||
->activeFormationNames()
|
||||
->formationNames();
|
||||
const std::vector<QString> fnVector =
|
||||
parentContainer()->reservoirView()->eclipseCase()->eclipseCaseData()->formationNames();
|
||||
|
||||
setCategoryNames( fnVector );
|
||||
}
|
||||
else if ( m_resultDefinition->resultVariable() == RiaDefines::completionTypeResultName() )
|
||||
|
||||
@@ -1882,15 +1882,15 @@ void RimEclipseResultDefinition::updateRangesForExplicitLegends( RimRegularLegen
|
||||
{
|
||||
if ( this->resultType() == RiaDefines::FORMATION_NAMES )
|
||||
{
|
||||
const std::vector<QString>& fnVector = eclipseCaseData->activeFormationNames()->formationNames();
|
||||
std::vector<QString> fnVector = eclipseCaseData->formationNames();
|
||||
legendConfigToUpdate->setNamedCategoriesInverse( fnVector );
|
||||
}
|
||||
else if ( this->resultType() == RiaDefines::ALLEN_DIAGRAMS )
|
||||
{
|
||||
if ( this->resultVariable() == RiaDefines::formationAllenResultName() )
|
||||
{
|
||||
const std::vector<QString>& fnVector = eclipseCaseData->activeFormationNames()->formationNames();
|
||||
std::vector<int> fnameIdxes;
|
||||
const std::vector<QString> fnVector = eclipseCaseData->formationNames();
|
||||
std::vector<int> fnameIdxes;
|
||||
for ( int i = static_cast<int>( fnVector.size() ); i > 0; --i )
|
||||
fnameIdxes.push_back( i - 1 );
|
||||
|
||||
|
||||
@@ -1252,7 +1252,7 @@ void RimEclipseView::onUpdateLegends()
|
||||
}
|
||||
else
|
||||
{
|
||||
const std::vector<QString>& fnVector = eclipseCase->activeFormationNames()->formationNames();
|
||||
const std::vector<QString> fnVector = eclipseCase->formationNames();
|
||||
cellEdgeResult()->legendConfig()->setNamedCategoriesInverse( fnVector );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2027,10 +2027,7 @@ std::vector<QString> RimWellLogTrack::formationNamesVector( RimCase* rimCase )
|
||||
|
||||
if ( eclipseCase )
|
||||
{
|
||||
if ( eclipseCase->eclipseCaseData()->activeFormationNames() )
|
||||
{
|
||||
return eclipseCase->eclipseCaseData()->activeFormationNames()->formationNames();
|
||||
}
|
||||
return eclipseCase->eclipseCaseData()->formationNames();
|
||||
}
|
||||
else if ( geoMechCase )
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user