mirror of
https://github.com/OPM/ResInsight.git
synced 2026-11-05 21:56:46 -06:00
#12179 Avoid showing unused values in category legend
This commit is contained in:
1 parent
fe417cf40a
commit
d05de77748
9 files changed
+61
-40
No files matched your search
@@ -1208,7 +1208,11 @@ void RimGridCrossPlotDataSet::updateLegendRange()
|
||||
RimEclipseCase* eclipseCase = dynamic_cast<RimEclipseCase*>( m_case() );
|
||||
if ( eclipseCase )
|
||||
{
|
||||
m_groupingProperty->updateRangesForEmbeddedLegends( m_timeStep() );
|
||||
auto eclipseView = dynamic_cast<RimEclipseView*>( m_cellFilterView() );
|
||||
m_groupingProperty->updateRangesForExplicitLegends( m_groupingProperty->legendConfig(),
|
||||
m_groupingProperty->ternaryLegendConfig(),
|
||||
m_timeStep(),
|
||||
eclipseView );
|
||||
}
|
||||
}
|
||||
if ( !m_legendOverlayFrame )
|
||||
|
||||
@@ -300,14 +300,6 @@ RimEclipseView* RimEclipseCellColors::reservoirView()
|
||||
return m_reservoirView;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimEclipseCellColors::updateRangesForEmbeddedLegends( int currentTimeStep )
|
||||
{
|
||||
updateRangesForExplicitLegends( legendConfig(), m_ternaryLegendConfig(), currentTimeStep );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -49,7 +49,6 @@ public:
|
||||
void setReservoirView( RimEclipseView* ownerReservoirView );
|
||||
RimEclipseView* reservoirView();
|
||||
|
||||
void updateRangesForEmbeddedLegends( int timestep );
|
||||
RimRegularLegendConfig* legendConfig();
|
||||
RimTernaryLegendConfig* ternaryLegendConfig();
|
||||
|
||||
|
||||
@@ -1682,7 +1682,8 @@ void RimEclipseResultDefinition::setTernaryEnabled( bool enabled )
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimEclipseResultDefinition::updateRangesForExplicitLegends( RimRegularLegendConfig* legendConfigToUpdate,
|
||||
RimTernaryLegendConfig* ternaryLegendConfigToUpdate,
|
||||
int currentTimeStep )
|
||||
int currentTimeStep,
|
||||
RimEclipseView* cellVisibilityView )
|
||||
|
||||
{
|
||||
if ( hasResult() )
|
||||
@@ -1696,7 +1697,7 @@ void RimEclipseResultDefinition::updateRangesForExplicitLegends( RimRegularLegen
|
||||
}
|
||||
else
|
||||
{
|
||||
RimEclipseResultDefinitionTools::updateCellResultLegend( this, legendConfigToUpdate, currentTimeStep );
|
||||
RimEclipseResultDefinitionTools::updateCellResultLegend( this, legendConfigToUpdate, currentTimeStep, cellVisibilityView );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1706,6 +1707,17 @@ void RimEclipseResultDefinition::updateRangesForExplicitLegends( RimRegularLegen
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimEclipseResultDefinition::updateRangesForExplicitLegends( RimRegularLegendConfig* legendConfig,
|
||||
RimTernaryLegendConfig* ternaryLegendConfig,
|
||||
int currentTimeStep )
|
||||
{
|
||||
RimEclipseView* cellVisibilityView = nullptr;
|
||||
updateRangesForExplicitLegends( legendConfig, ternaryLegendConfig, currentTimeStep, cellVisibilityView );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -137,6 +137,11 @@ public:
|
||||
void setTernaryEnabled( bool enabled );
|
||||
|
||||
void updateRangesForExplicitLegends( RimRegularLegendConfig* legendConfig, RimTernaryLegendConfig* ternaryLegendConfig, int currentTimeStep );
|
||||
void updateRangesForExplicitLegends( RimRegularLegendConfig* legendConfig,
|
||||
RimTernaryLegendConfig* ternaryLegendConfig,
|
||||
int currentTimeStep,
|
||||
RimEclipseView* viewUsedForCategoryValues );
|
||||
|
||||
void updateLegendTitle( RimRegularLegendConfig* legendConfig, const QString& legendHeading );
|
||||
|
||||
bool showOnlyVisibleCategoriesInLegend() const;
|
||||
|
||||
@@ -42,10 +42,12 @@
|
||||
#include "RimSimWellInViewCollection.h"
|
||||
#include "RimTernaryLegendConfig.h"
|
||||
|
||||
#include "cafCategoryMapper.h"
|
||||
|
||||
#include "cvfColor3.h"
|
||||
|
||||
#include <QString>
|
||||
|
||||
#include "cafCategoryMapper.h"
|
||||
#include "cvfColor3.h"
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -491,7 +493,8 @@ void RimEclipseResultDefinitionTools::updateLegendForFlowDiagnostics( const RimE
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimEclipseResultDefinitionTools::updateCellResultLegend( const RimEclipseResultDefinition* resultDefinition,
|
||||
RimRegularLegendConfig* legendConfigToUpdate,
|
||||
int timeStep )
|
||||
int timeStep,
|
||||
RimEclipseView* sourceCellVisibilityView )
|
||||
{
|
||||
if ( !resultDefinition || !legendConfigToUpdate ) return;
|
||||
|
||||
@@ -638,19 +641,17 @@ void RimEclipseResultDefinitionTools::updateCellResultLegend( const RimEclipseRe
|
||||
|
||||
if ( resultDefinition->showOnlyVisibleCategoriesInLegend() )
|
||||
{
|
||||
auto eclView = resultDefinition->firstAncestorOrThisOfType<RimEclipseView>();
|
||||
if ( eclView && eclView->showWindow() )
|
||||
// If a predefined view is nullptr, search for an ancestor view
|
||||
auto cellVisibilityView = sourceCellVisibilityView ? sourceCellVisibilityView
|
||||
: resultDefinition->firstAncestorOrThisOfType<RimEclipseView>();
|
||||
if ( cellVisibilityView && cellVisibilityView->showWindow() )
|
||||
{
|
||||
// Check if current result is cell result, and update the visible set of values
|
||||
// TODO: Can be extended to the separate geometry results (separate fault result, separate
|
||||
// intersection results), but this requires some refactoring
|
||||
if ( eclView->cellResult() == resultDefinition )
|
||||
{
|
||||
std::set<int> visibleCategorySet = RigVisibleCategoriesCalculator::visibleCategories( eclView );
|
||||
std::set<int> visibleCategorySet =
|
||||
RigVisibleCategoriesCalculator::visibleCategories( cellVisibilityView, resultDefinition );
|
||||
|
||||
visibleCategoryValues.clear();
|
||||
visibleCategoryValues.insert( visibleCategoryValues.begin(), visibleCategorySet.begin(), visibleCategorySet.end() );
|
||||
}
|
||||
// If we have a view, use the unique values defined by visible cells in this view
|
||||
visibleCategoryValues.clear();
|
||||
visibleCategoryValues.insert( visibleCategoryValues.begin(), visibleCategorySet.begin(), visibleCategorySet.end() );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -52,7 +52,10 @@ void updateLegendForFlowDiagnostics( const RimEclipseResultDefinition* resultDef
|
||||
RimRegularLegendConfig* legendConfigToUpdate,
|
||||
int timeStep );
|
||||
|
||||
void updateCellResultLegend( const RimEclipseResultDefinition* resultDefinition, RimRegularLegendConfig* legendConfigToUpdate, int timeStep );
|
||||
void updateCellResultLegend( const RimEclipseResultDefinition* resultDefinition,
|
||||
RimRegularLegendConfig* legendConfigToUpdate,
|
||||
int timeStep,
|
||||
RimEclipseView* sourceCellVisibilityView );
|
||||
|
||||
QList<caf::PdmOptionItemInfo> calcOptionsForVariableUiFieldStandard( RiaDefines::ResultCatType resultCatType,
|
||||
const RigCaseCellResultsData* results,
|
||||
|
||||
Reference in new issue
Block a user