2012-05-18 09:45:23 +02:00
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
//
|
2014-09-23 15:04:57 +02:00
|
|
|
// Copyright (C) 2011- Statoil ASA
|
|
|
|
|
// Copyright (C) 2013- Ceetron Solutions AS
|
|
|
|
|
// Copyright (C) 2011-2012 Ceetron AS
|
2019-09-06 10:40:57 +02:00
|
|
|
//
|
2012-05-18 09:45:23 +02:00
|
|
|
// ResInsight is free software: you can redistribute it and/or modify
|
|
|
|
|
// it under the terms of the GNU General Public License as published by
|
|
|
|
|
// the Free Software Foundation, either version 3 of the License, or
|
|
|
|
|
// (at your option) any later version.
|
2019-09-06 10:40:57 +02:00
|
|
|
//
|
2012-05-18 09:45:23 +02:00
|
|
|
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
|
|
|
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
|
|
|
// FITNESS FOR A PARTICULAR PURPOSE.
|
2019-09-06 10:40:57 +02:00
|
|
|
//
|
|
|
|
|
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
2012-05-18 09:45:23 +02:00
|
|
|
// for more details.
|
|
|
|
|
//
|
|
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
2015-06-25 13:32:00 +02:00
|
|
|
#include "RimEclipseCellColors.h"
|
2012-05-18 09:45:23 +02:00
|
|
|
|
2021-09-20 12:12:51 +02:00
|
|
|
#include "RiaResultNames.h"
|
|
|
|
|
|
2020-02-28 14:38:24 +01:00
|
|
|
#include "RicfCommandObject.h"
|
2017-01-11 15:03:39 +01:00
|
|
|
#include "RigCaseCellResultsData.h"
|
|
|
|
|
#include "RigEclipseCaseData.h"
|
|
|
|
|
#include "RigFlowDiagResults.h"
|
|
|
|
|
#include "RigFormationNames.h"
|
|
|
|
|
|
2016-08-03 16:01:44 +02:00
|
|
|
#include "RimCellEdgeColors.h"
|
2017-01-11 15:03:39 +01:00
|
|
|
#include "RimEclipseCase.h"
|
2015-09-23 13:48:25 +02:00
|
|
|
#include "RimEclipseFaultColors.h"
|
2015-05-21 10:34:38 +02:00
|
|
|
#include "RimEclipseView.h"
|
2018-04-18 10:10:39 +02:00
|
|
|
#include "RimRegularLegendConfig.h"
|
2017-10-13 09:29:42 +02:00
|
|
|
#include "RimSimWellInView.h"
|
2017-10-13 14:20:47 +02:00
|
|
|
#include "RimSimWellInViewCollection.h"
|
2014-05-06 22:39:53 +02:00
|
|
|
#include "RimTernaryLegendConfig.h"
|
2015-10-13 10:24:11 +02:00
|
|
|
#include "RimViewController.h"
|
2015-09-23 13:48:25 +02:00
|
|
|
#include "RimViewLinker.h"
|
|
|
|
|
|
2014-05-06 22:51:17 +02:00
|
|
|
#include "RiuMainWindow.h"
|
2016-08-05 15:06:50 +02:00
|
|
|
|
2016-06-16 15:59:20 +02:00
|
|
|
#include "cafPdmUiTreeOrdering.h"
|
2013-05-06 10:55:00 +02:00
|
|
|
|
2019-09-06 10:40:57 +02:00
|
|
|
CAF_PDM_SOURCE_INIT( RimEclipseCellColors, "ResultSlot" );
|
2012-05-18 09:45:23 +02:00
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 10:40:57 +02:00
|
|
|
///
|
2012-05-18 09:45:23 +02:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2015-06-25 12:04:46 +02:00
|
|
|
RimEclipseCellColors::RimEclipseCellColors()
|
2020-12-04 13:21:19 +01:00
|
|
|
: legendConfigChanged( this )
|
2012-05-18 09:45:23 +02:00
|
|
|
{
|
2023-02-26 10:48:40 +01:00
|
|
|
CAF_PDM_InitScriptableObjectWithNameAndComment( "Cell Result", ":/CellResult.png", "", "", "CellColors", "Eclipse Cell Colors class" );
|
2012-05-18 09:45:23 +02:00
|
|
|
|
2021-11-14 14:15:12 +01:00
|
|
|
CAF_PDM_InitFieldNoDefault( &obsoleteField_legendConfig, "LegendDefinition", "Color Legend" );
|
2023-08-04 09:04:14 +02:00
|
|
|
obsoleteField_legendConfig.xmlCapability()->setIOWritable( false );
|
2014-06-13 08:12:45 +02:00
|
|
|
|
2021-11-14 14:15:12 +01:00
|
|
|
CAF_PDM_InitFieldNoDefault( &m_legendConfigData, "ResultVarLegendDefinitionList", "" );
|
2012-05-18 09:45:23 +02:00
|
|
|
|
2021-11-14 14:15:12 +01:00
|
|
|
CAF_PDM_InitFieldNoDefault( &m_ternaryLegendConfig, "TernaryLegendDefinition", "Ternary Color Legend" );
|
2023-08-04 09:04:14 +02:00
|
|
|
m_ternaryLegendConfig = new RimTernaryLegendConfig();
|
2015-08-06 08:08:00 +02:00
|
|
|
|
2021-11-14 14:15:12 +01:00
|
|
|
CAF_PDM_InitFieldNoDefault( &m_legendConfigPtrField, "LegendDefinitionPtrField", "Color Legend PtrField" );
|
2015-09-01 13:53:04 +02:00
|
|
|
|
|
|
|
|
// Make sure we have a created legend for the default/undefined result variable
|
2023-08-04 09:04:14 +02:00
|
|
|
changeLegendConfig( resultVariable() );
|
2021-05-04 06:53:43 +02:00
|
|
|
|
|
|
|
|
m_useDiscreteLogLevels = false;
|
2012-05-18 09:45:23 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 10:40:57 +02:00
|
|
|
///
|
2012-05-18 09:45:23 +02:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2015-06-25 12:04:46 +02:00
|
|
|
RimEclipseCellColors::~RimEclipseCellColors()
|
2012-05-18 09:45:23 +02:00
|
|
|
{
|
2019-09-06 10:40:57 +02:00
|
|
|
CVF_ASSERT( obsoleteField_legendConfig() == nullptr );
|
2015-08-07 11:09:05 +02:00
|
|
|
|
2022-05-31 13:08:07 +02:00
|
|
|
m_legendConfigData.deleteChildren();
|
2015-08-07 11:09:05 +02:00
|
|
|
|
2018-09-24 22:26:14 +02:00
|
|
|
delete m_ternaryLegendConfig();
|
2012-05-18 09:45:23 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 10:40:57 +02:00
|
|
|
///
|
2012-05-18 09:45:23 +02:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2023-02-26 10:48:40 +01:00
|
|
|
void RimEclipseCellColors::fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue )
|
2012-05-18 09:45:23 +02:00
|
|
|
{
|
2019-09-06 10:40:57 +02:00
|
|
|
RimEclipseResultDefinition::fieldChangedByUi( changedField, oldValue, newValue );
|
2013-08-02 13:04:25 +02:00
|
|
|
|
2020-02-12 11:43:15 +01:00
|
|
|
// Update of legend config must happen after RimEclipseResultDefinition::fieldChangedByUi(), as this function
|
2023-08-04 09:04:14 +02:00
|
|
|
// modifies resultVariable()
|
2019-09-06 10:40:57 +02:00
|
|
|
if ( changedField == &m_resultVariableUiField )
|
2012-05-18 09:45:23 +02:00
|
|
|
{
|
2019-09-06 10:40:57 +02:00
|
|
|
if ( oldValue != newValue )
|
2012-05-18 09:45:23 +02:00
|
|
|
{
|
2023-08-04 09:04:14 +02:00
|
|
|
changeLegendConfig( resultVariableUiName() );
|
2012-05-18 09:45:23 +02:00
|
|
|
}
|
|
|
|
|
|
2023-08-04 09:04:14 +02:00
|
|
|
RimEclipseFaultColors* faultColors = dynamic_cast<RimEclipseFaultColors*>( parentField()->ownerObject() );
|
2019-09-06 10:40:57 +02:00
|
|
|
if ( faultColors )
|
2015-08-10 14:14:22 +02:00
|
|
|
{
|
2015-08-11 11:12:43 +02:00
|
|
|
faultColors->updateConnectedEditors();
|
2015-08-10 14:14:22 +02:00
|
|
|
}
|
2016-08-03 16:01:44 +02:00
|
|
|
|
2023-08-04 09:04:14 +02:00
|
|
|
RimCellEdgeColors* cellEdgeColors = dynamic_cast<RimCellEdgeColors*>( parentField()->ownerObject() );
|
2019-09-06 10:40:57 +02:00
|
|
|
if ( cellEdgeColors )
|
2016-08-03 16:01:44 +02:00
|
|
|
{
|
|
|
|
|
cellEdgeColors->updateConnectedEditors();
|
|
|
|
|
}
|
2012-05-18 09:45:23 +02:00
|
|
|
}
|
|
|
|
|
|
2019-10-15 14:28:15 +02:00
|
|
|
if ( m_reservoirView ) m_reservoirView->scheduleCreateDisplayModelAndRedraw();
|
2012-05-18 09:45:23 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 10:40:57 +02:00
|
|
|
///
|
2012-05-18 09:45:23 +02:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 10:40:57 +02:00
|
|
|
void RimEclipseCellColors::changeLegendConfig( QString resultVarNameOfNewLegend )
|
2012-05-18 09:45:23 +02:00
|
|
|
{
|
2021-01-21 12:58:46 +01:00
|
|
|
if ( resultVarNameOfNewLegend != RiaResultNames::ternarySaturationResultName() )
|
2014-05-06 22:39:53 +02:00
|
|
|
{
|
2015-08-06 08:08:00 +02:00
|
|
|
QString legendResultVariable;
|
|
|
|
|
|
2023-08-04 09:04:14 +02:00
|
|
|
if ( m_legendConfigPtrField() )
|
2015-08-06 08:08:00 +02:00
|
|
|
{
|
2023-08-04 09:04:14 +02:00
|
|
|
legendResultVariable = m_legendConfigPtrField()->resultVariableName();
|
2015-08-06 08:08:00 +02:00
|
|
|
}
|
|
|
|
|
|
2023-08-04 09:04:14 +02:00
|
|
|
if ( !m_legendConfigPtrField() || legendResultVariable != resultVarNameOfNewLegend )
|
2012-05-18 09:45:23 +02:00
|
|
|
{
|
2017-03-06 11:18:57 +01:00
|
|
|
bool found = false;
|
2019-09-06 10:40:57 +02:00
|
|
|
for ( size_t i = 0; i < m_legendConfigData.size(); i++ )
|
2014-05-06 22:39:53 +02:00
|
|
|
{
|
2019-09-06 10:40:57 +02:00
|
|
|
if ( m_legendConfigData[i]->resultVariableName() == resultVarNameOfNewLegend )
|
2014-05-06 22:39:53 +02:00
|
|
|
{
|
2023-08-04 09:04:14 +02:00
|
|
|
m_legendConfigPtrField = m_legendConfigData[i];
|
|
|
|
|
found = true;
|
2014-05-06 22:39:53 +02:00
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2019-09-06 10:40:57 +02:00
|
|
|
if ( !found )
|
2014-05-06 22:39:53 +02:00
|
|
|
{
|
2023-05-09 11:41:56 +02:00
|
|
|
int caseId = 0;
|
|
|
|
|
if ( eclipseCase() ) caseId = eclipseCase()->caseId();
|
|
|
|
|
|
2023-12-07 14:10:03 +01:00
|
|
|
bool useCategoryLegend = hasCategoryResult();
|
|
|
|
|
if ( m_resultType() == RiaDefines::ResultCatType::FORMATION_NAMES ) useCategoryLegend = true;
|
|
|
|
|
|
|
|
|
|
auto newLegend = createLegendForResult( caseId, resultVarNameOfNewLegend, m_useDiscreteLogLevels, useCategoryLegend );
|
2020-01-28 15:34:01 +01:00
|
|
|
|
2022-02-25 15:22:36 +01:00
|
|
|
newLegend->changed.connect( this, &RimEclipseCellColors::onLegendConfigChanged );
|
|
|
|
|
|
2019-09-06 10:40:57 +02:00
|
|
|
m_legendConfigData.push_back( newLegend );
|
2015-08-06 08:08:00 +02:00
|
|
|
|
2023-08-04 09:04:14 +02:00
|
|
|
m_legendConfigPtrField = newLegend;
|
2014-05-06 22:39:53 +02:00
|
|
|
}
|
2012-05-18 09:45:23 +02:00
|
|
|
}
|
2015-08-06 08:08:00 +02:00
|
|
|
}
|
2020-12-04 13:21:19 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
|
///
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2020-12-07 09:30:09 +01:00
|
|
|
void RimEclipseCellColors::onLegendConfigChanged( const caf::SignalEmitter* emitter, RimLegendConfigChangeType changeType )
|
2020-12-04 13:21:19 +01:00
|
|
|
{
|
2020-12-07 09:30:09 +01:00
|
|
|
legendConfigChanged.send( changeType );
|
2012-05-18 09:45:23 +02:00
|
|
|
}
|
|
|
|
|
|
2021-02-01 08:09:30 +01:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
|
///
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2023-05-09 11:41:56 +02:00
|
|
|
RimRegularLegendConfig*
|
|
|
|
|
RimEclipseCellColors::createLegendForResult( int caseId, const QString& resultName, bool useDiscreteLogLevels, bool isCategoryResult )
|
2021-02-01 08:09:30 +01:00
|
|
|
{
|
2022-01-05 21:44:56 +01:00
|
|
|
auto* newLegend = new RimRegularLegendConfig;
|
|
|
|
|
newLegend->resultVariableName = resultName;
|
2021-02-01 08:09:30 +01:00
|
|
|
|
2023-05-09 11:41:56 +02:00
|
|
|
newLegend->setDefaultConfigForResultName( caseId, resultName, useDiscreteLogLevels, isCategoryResult );
|
2021-02-01 08:09:30 +01:00
|
|
|
|
|
|
|
|
return newLegend;
|
|
|
|
|
}
|
|
|
|
|
|
2012-05-18 09:45:23 +02:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 10:40:57 +02:00
|
|
|
///
|
2012-05-18 09:45:23 +02:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2015-06-25 12:04:46 +02:00
|
|
|
void RimEclipseCellColors::initAfterRead()
|
2012-05-18 09:45:23 +02:00
|
|
|
{
|
2015-06-25 09:38:53 +02:00
|
|
|
RimEclipseResultDefinition::initAfterRead();
|
2012-05-18 09:45:23 +02:00
|
|
|
|
2023-08-04 09:04:14 +02:00
|
|
|
if ( m_legendConfigPtrField() && m_legendConfigPtrField()->resultVariableName() == "" )
|
2012-05-18 09:45:23 +02:00
|
|
|
{
|
2023-08-04 09:04:14 +02:00
|
|
|
m_legendConfigPtrField()->resultVariableName = resultVariable();
|
2015-08-06 08:08:00 +02:00
|
|
|
}
|
|
|
|
|
|
2019-09-06 10:40:57 +02:00
|
|
|
if ( obsoleteField_legendConfig )
|
2015-08-06 08:08:00 +02:00
|
|
|
{
|
|
|
|
|
// The current legend config is NOT stored in <ResultVarLegendDefinitionList> in ResInsight up to v 1.3.7-dev
|
2018-04-18 10:10:39 +02:00
|
|
|
RimRegularLegendConfig* obsoleteLegend = obsoleteField_legendConfig();
|
2015-08-07 12:40:47 +02:00
|
|
|
|
2018-10-10 10:17:07 +02:00
|
|
|
// set to nullptr before pushing into container
|
2018-02-18 18:56:43 +01:00
|
|
|
obsoleteField_legendConfig = nullptr;
|
2015-08-07 12:40:47 +02:00
|
|
|
|
2022-02-25 15:22:36 +01:00
|
|
|
obsoleteLegend->changed.connect( this, &RimEclipseCellColors::onLegendConfigChanged );
|
2019-09-06 10:40:57 +02:00
|
|
|
m_legendConfigData.push_back( obsoleteLegend );
|
2022-02-25 15:22:36 +01:00
|
|
|
|
2015-08-07 12:40:47 +02:00
|
|
|
m_legendConfigPtrField = obsoleteLegend;
|
2012-05-18 09:45:23 +02:00
|
|
|
}
|
2014-05-06 22:39:53 +02:00
|
|
|
|
2023-08-04 09:04:14 +02:00
|
|
|
changeLegendConfig( resultVariable() );
|
2015-09-23 13:48:25 +02:00
|
|
|
|
|
|
|
|
updateIconState();
|
2012-05-18 09:45:23 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-04-15 11:06:27 +02:00
|
|
|
///
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 10:40:57 +02:00
|
|
|
void RimEclipseCellColors::defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering )
|
2019-04-15 11:06:27 +02:00
|
|
|
{
|
2019-09-06 10:40:57 +02:00
|
|
|
RimEclipseResultDefinition::defineUiOrdering( uiConfigName, uiOrdering );
|
2019-04-15 11:06:27 +02:00
|
|
|
|
2019-09-06 10:40:57 +02:00
|
|
|
if ( uiConfigName == "AddLegendLevels" )
|
2019-04-15 11:06:27 +02:00
|
|
|
{
|
2019-09-06 10:40:57 +02:00
|
|
|
legendConfig()->uiOrdering( "NumIntervalsOnly", uiOrdering );
|
2019-04-15 11:06:27 +02:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 10:40:57 +02:00
|
|
|
///
|
2016-06-16 15:59:20 +02:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 10:40:57 +02:00
|
|
|
void RimEclipseCellColors::defineUiTreeOrdering( caf::PdmUiTreeOrdering& uiTreeOrdering, QString uiConfigName /*= ""*/ )
|
2016-06-16 15:59:20 +02:00
|
|
|
{
|
2023-08-04 09:04:14 +02:00
|
|
|
if ( resultVariable() == RiaResultNames::ternarySaturationResultName() )
|
2016-08-05 15:06:50 +02:00
|
|
|
{
|
2019-09-06 10:40:57 +02:00
|
|
|
uiTreeOrdering.add( m_ternaryLegendConfig() );
|
2016-08-05 15:06:50 +02:00
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2019-09-06 10:40:57 +02:00
|
|
|
uiTreeOrdering.add( m_legendConfigPtrField() );
|
2016-08-05 15:06:50 +02:00
|
|
|
}
|
|
|
|
|
|
2022-11-10 07:21:41 +01:00
|
|
|
for ( const auto& obj : m_additionalUiTreeObjects )
|
|
|
|
|
{
|
|
|
|
|
uiTreeOrdering.add( obj );
|
|
|
|
|
}
|
|
|
|
|
|
2019-09-06 10:40:57 +02:00
|
|
|
uiTreeOrdering.skipRemainingChildren( true );
|
2016-06-16 15:59:20 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 10:40:57 +02:00
|
|
|
///
|
2016-09-07 11:41:02 +02:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
|
void RimEclipseCellColors::updateLegendCategorySettings()
|
|
|
|
|
{
|
2023-08-04 09:04:14 +02:00
|
|
|
changeLegendConfig( resultVariableUiName() );
|
2016-09-07 11:41:02 +02:00
|
|
|
}
|
|
|
|
|
|
2019-03-05 12:37:58 +01:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
|
///
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 10:40:57 +02:00
|
|
|
void RimEclipseCellColors::uiTreeOrdering( caf::PdmUiTreeOrdering& uiTreeOrdering, QString uiConfigName /*= ""*/ )
|
2019-03-05 12:37:58 +01:00
|
|
|
{
|
2019-09-06 10:40:57 +02:00
|
|
|
defineUiTreeOrdering( uiTreeOrdering, uiConfigName );
|
2019-03-05 12:37:58 +01:00
|
|
|
}
|
|
|
|
|
|
2021-05-04 06:53:43 +02:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
|
///
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
|
void RimEclipseCellColors::useDiscreteLogLevels( bool enable )
|
|
|
|
|
{
|
|
|
|
|
m_useDiscreteLogLevels = true;
|
|
|
|
|
}
|
|
|
|
|
|
2022-11-10 07:21:41 +01:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
|
///
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
|
void RimEclipseCellColors::setAdditionalUiTreeObjects( const std::vector<caf::PdmObject*>& objects )
|
|
|
|
|
{
|
|
|
|
|
m_additionalUiTreeObjects = objects;
|
|
|
|
|
}
|
|
|
|
|
|
2016-09-07 11:41:02 +02:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2012-05-18 09:45:23 +02:00
|
|
|
///
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 10:40:57 +02:00
|
|
|
void RimEclipseCellColors::setReservoirView( RimEclipseView* ownerReservoirView )
|
2012-05-18 09:45:23 +02:00
|
|
|
{
|
2019-03-13 10:16:46 +01:00
|
|
|
m_reservoirView = ownerReservoirView;
|
2019-09-06 10:40:57 +02:00
|
|
|
if ( ownerReservoirView )
|
2019-03-12 14:31:11 +01:00
|
|
|
{
|
2023-08-04 09:04:14 +02:00
|
|
|
setEclipseCase( ownerReservoirView->eclipseCase() );
|
2019-03-12 14:31:11 +01:00
|
|
|
}
|
2014-06-13 08:12:45 +02:00
|
|
|
}
|
2016-08-05 15:06:50 +02:00
|
|
|
|
2015-09-01 13:56:35 +02:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 10:40:57 +02:00
|
|
|
///
|
2015-09-01 13:56:35 +02:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
|
RimEclipseView* RimEclipseCellColors::reservoirView()
|
|
|
|
|
{
|
|
|
|
|
return m_reservoirView;
|
|
|
|
|
}
|
|
|
|
|
|
2017-03-21 15:58:02 +01:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 10:40:57 +02:00
|
|
|
///
|
2017-03-21 15:58:02 +01:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-11-22 12:36:39 +01:00
|
|
|
void RimEclipseCellColors::updateRangesForEmbeddedLegends( int currentTimeStep )
|
2017-03-21 15:58:02 +01:00
|
|
|
{
|
2023-08-04 09:04:14 +02:00
|
|
|
updateRangesForExplicitLegends( legendConfig(), m_ternaryLegendConfig(), currentTimeStep );
|
2017-01-11 15:03:39 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 10:40:57 +02:00
|
|
|
///
|
2017-01-11 15:03:39 +01:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 10:40:57 +02:00
|
|
|
void RimEclipseCellColors::setResultVariable( const QString& val )
|
2014-06-13 08:12:45 +02:00
|
|
|
{
|
2019-09-06 10:40:57 +02:00
|
|
|
RimEclipseResultDefinition::setResultVariable( val );
|
2014-06-13 08:12:45 +02:00
|
|
|
|
2023-08-04 09:04:14 +02:00
|
|
|
changeLegendConfig( val );
|
2012-05-18 09:45:23 +02:00
|
|
|
}
|
2014-05-06 22:39:53 +02:00
|
|
|
|
2015-08-06 08:08:00 +02:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 10:40:57 +02:00
|
|
|
///
|
2015-08-06 08:08:00 +02:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2018-04-18 10:10:39 +02:00
|
|
|
RimRegularLegendConfig* RimEclipseCellColors::legendConfig()
|
2015-08-06 08:08:00 +02:00
|
|
|
{
|
|
|
|
|
return m_legendConfigPtrField;
|
|
|
|
|
}
|
|
|
|
|
|
2018-09-24 22:26:14 +02:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 10:40:57 +02:00
|
|
|
///
|
2018-09-24 22:26:14 +02:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
|
RimTernaryLegendConfig* RimEclipseCellColors::ternaryLegendConfig()
|
|
|
|
|
{
|
|
|
|
|
return m_ternaryLegendConfig;
|
|
|
|
|
}
|
|
|
|
|
|
2015-09-23 13:48:25 +02:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 10:40:57 +02:00
|
|
|
///
|
2015-09-23 13:48:25 +02:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
|
void RimEclipseCellColors::updateIconState()
|
|
|
|
|
{
|
2019-09-06 10:40:57 +02:00
|
|
|
if ( m_reservoirView )
|
2015-09-23 13:48:25 +02:00
|
|
|
{
|
2019-03-05 12:37:58 +01:00
|
|
|
RimViewController* viewController = m_reservoirView->viewController();
|
2019-09-06 10:40:57 +02:00
|
|
|
if ( viewController && viewController->isResultColorControlled() )
|
2019-03-05 12:37:58 +01:00
|
|
|
{
|
2019-09-06 10:40:57 +02:00
|
|
|
updateUiIconFromState( false );
|
2019-03-05 12:37:58 +01:00
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2019-09-06 10:40:57 +02:00
|
|
|
updateUiIconFromState( true );
|
2019-03-05 12:37:58 +01:00
|
|
|
}
|
2015-09-23 13:48:25 +02:00
|
|
|
}
|
|
|
|
|
uiCapability()->updateConnectedEditors();
|
|
|
|
|
}
|