mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#4168 Treat some properties as categories.
This commit is contained in:
@@ -35,6 +35,7 @@
|
||||
#include "RimCase.h"
|
||||
#include "RimEclipseCase.h"
|
||||
#include "RimEclipseView.h"
|
||||
#include "RimEclipseCellColors.h"
|
||||
#include "RimEclipseResultDefinition.h"
|
||||
#include "RimGridCrossPlot.h"
|
||||
#include "RimGridCrossPlotCurve.h"
|
||||
@@ -93,9 +94,8 @@ RimGridCrossPlotCurveSet::RimGridCrossPlotCurveSet()
|
||||
m_yAxisProperty.uiCapability()->setUiTreeChildrenHidden(true);
|
||||
|
||||
CAF_PDM_InitFieldNoDefault(&m_categoryProperty, "CategoryProperty", "Data Grouping Property", "", "", "");
|
||||
m_categoryProperty = new RimEclipseResultDefinition;
|
||||
m_categoryProperty = new RimEclipseCellColors;
|
||||
m_categoryProperty.uiCapability()->setUiHidden(true);
|
||||
m_categoryProperty.uiCapability()->setUiTreeChildrenHidden(true);
|
||||
|
||||
CAF_PDM_InitFieldNoDefault(&m_nameConfig, "NameConfig", "Name", "", "", "");
|
||||
m_nameConfig = new RimGridCrossPlotCurveSetNameConfig(this);
|
||||
@@ -105,12 +105,6 @@ RimGridCrossPlotCurveSet::RimGridCrossPlotCurveSet()
|
||||
CAF_PDM_InitFieldNoDefault(&m_crossPlotCurves, "CrossPlotCurves", "Curves", "", "", "");
|
||||
m_crossPlotCurves.uiCapability()->setUiTreeHidden(true);
|
||||
|
||||
CAF_PDM_InitFieldNoDefault(&m_legendConfig, "LegendConfig", "", "", "", "");
|
||||
m_legendConfig = new RimRegularLegendConfig();
|
||||
m_legendConfig->setColorRange(RimRegularLegendConfig::CATEGORY);
|
||||
m_legendConfig->setMappingMode(RimRegularLegendConfig::CATEGORY_INTEGER);
|
||||
m_legendConfig->setTickNumberFormat(RimRegularLegendConfig::AUTO);
|
||||
|
||||
setDefaults();
|
||||
}
|
||||
|
||||
@@ -212,20 +206,17 @@ QString RimGridCrossPlotCurveSet::createAutoName() const
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RimGridCrossPlotCurveSet::categoryTitle() const
|
||||
{
|
||||
if (hasCategoryResult())
|
||||
if (m_categorization() == TIME_CATEGORIZATION)
|
||||
{
|
||||
if (m_categorization() == TIME_CATEGORIZATION)
|
||||
{
|
||||
return QString("Time Steps");
|
||||
}
|
||||
else if (m_categorization() == FORMATION_CATEGORIZATION)
|
||||
{
|
||||
return QString("Formations");
|
||||
}
|
||||
else if (m_categorization() == RESULT_CATEGORIZATION && m_categoryProperty->hasResult())
|
||||
{
|
||||
return QString("%1").arg(m_categoryProperty->resultVariableUiShortName());
|
||||
}
|
||||
return QString("Time Steps");
|
||||
}
|
||||
else if (m_categorization() == FORMATION_CATEGORIZATION)
|
||||
{
|
||||
return QString("Formations");
|
||||
}
|
||||
else if (m_categorization() == RESULT_CATEGORIZATION && m_categoryProperty->hasResult())
|
||||
{
|
||||
return QString("%1").arg(m_categoryProperty->resultVariableUiShortName());
|
||||
}
|
||||
return "";
|
||||
}
|
||||
@@ -255,9 +246,9 @@ void RimGridCrossPlotCurveSet::cellFilterViewUpdated()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimRegularLegendConfig* RimGridCrossPlotCurveSet::legendConfig()
|
||||
RimRegularLegendConfig* RimGridCrossPlotCurveSet::legendConfig() const
|
||||
{
|
||||
return m_legendConfig;
|
||||
return m_categoryProperty->legendConfig();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -316,7 +307,7 @@ std::vector<QString> RimGridCrossPlotCurveSet::categoryStrings() const
|
||||
std::vector<QString> catStrings;
|
||||
for (auto curve : m_crossPlotCurves())
|
||||
{
|
||||
catStrings.push_back(m_legendConfig->categoryNameFromCategoryValue(curve->categoryIndex()));
|
||||
catStrings.push_back(legendConfig()->categoryNameFromCategoryValue(curve->categoryIndex()));
|
||||
}
|
||||
return catStrings;
|
||||
}
|
||||
@@ -407,17 +398,22 @@ void RimGridCrossPlotCurveSet::createCurves(const RigEclipseCrossPlotResult& res
|
||||
|
||||
std::vector<double> tickValues;
|
||||
|
||||
if (m_categorization == TIME_CATEGORIZATION || m_categorization == FORMATION_CATEGORIZATION)
|
||||
if (hasCategoryResult())
|
||||
{
|
||||
for (size_t i = 0; i < result.xValues.size(); ++i)
|
||||
{
|
||||
categorizedResults[result.catValuesDiscrete[i]].first.push_back(result.xValues[i]);
|
||||
categorizedResults[result.catValuesDiscrete[i]].second.push_back(result.yValues[i]);
|
||||
int categoryNum =
|
||||
m_categorization == RESULT_CATEGORIZATION
|
||||
? static_cast<int>(result.catValuesContinuous[i])
|
||||
: result.catValuesDiscrete[i];
|
||||
|
||||
categorizedResults[categoryNum].first.push_back(result.xValues[i]);
|
||||
categorizedResults[categoryNum].second.push_back(result.yValues[i]);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
m_legendConfig->scalarMapper()->majorTickValues(&tickValues);
|
||||
legendConfig()->scalarMapper()->majorTickValues(&tickValues);
|
||||
|
||||
for (size_t i = 0; i < result.xValues.size(); ++i)
|
||||
{
|
||||
@@ -433,13 +429,13 @@ void RimGridCrossPlotCurveSet::createCurves(const RigEclipseCrossPlotResult& res
|
||||
{
|
||||
RimGridCrossPlotCurve* curve = new RimGridCrossPlotCurve();
|
||||
curve->setCategoryInformation(indexInPlot(), it->first);
|
||||
if (m_categorization == RESULT_CATEGORIZATION)
|
||||
if (hasCategoryResult())
|
||||
{
|
||||
curve->setColor(cvf::Color3f(m_legendConfig->scalarMapper()->mapToColor(tickValues[it->first])));
|
||||
curve->setColor(cvf::Color3f(legendConfig()->scalarMapper()->mapToColor(it->first)));
|
||||
}
|
||||
else
|
||||
{
|
||||
curve->setColor(cvf::Color3f(m_legendConfig->scalarMapper()->mapToColor(it->first)));
|
||||
curve->setColor(cvf::Color3f(legendConfig()->scalarMapper()->mapToColor(tickValues[it->first])));
|
||||
}
|
||||
curve->setSamples(it->second.first, it->second.second);
|
||||
curve->showLegend(m_crossPlotCurves.empty());
|
||||
@@ -551,18 +547,18 @@ void RimGridCrossPlotCurveSet::fieldChangedByUi(const caf::PdmFieldHandle* chang
|
||||
{
|
||||
if (m_categorization == TIME_CATEGORIZATION)
|
||||
{
|
||||
m_legendConfig->setColorRange(RimRegularLegendConfig::NORMAL);
|
||||
m_legendConfig->setMappingMode(RimRegularLegendConfig::CATEGORY_INTEGER);
|
||||
legendConfig()->setColorRange(RimRegularLegendConfig::NORMAL);
|
||||
legendConfig()->setMappingMode(RimRegularLegendConfig::CATEGORY_INTEGER);
|
||||
}
|
||||
else if (m_categorization == FORMATION_CATEGORIZATION)
|
||||
else if (hasCategoryResult())
|
||||
{
|
||||
m_legendConfig->setColorRange(RimRegularLegendConfig::CATEGORY);
|
||||
m_legendConfig->setMappingMode(RimRegularLegendConfig::CATEGORY_INTEGER);
|
||||
legendConfig()->setColorRange(RimRegularLegendConfig::CATEGORY);
|
||||
legendConfig()->setMappingMode(RimRegularLegendConfig::CATEGORY_INTEGER);
|
||||
}
|
||||
else
|
||||
{
|
||||
m_legendConfig->setColorRange(RimRegularLegendConfig::NORMAL);
|
||||
m_legendConfig->setMappingMode(RimRegularLegendConfig::LINEAR_DISCRETE);
|
||||
legendConfig()->setColorRange(RimRegularLegendConfig::NORMAL);
|
||||
legendConfig()->setMappingMode(RimRegularLegendConfig::LINEAR_DISCRETE);
|
||||
|
||||
}
|
||||
|
||||
@@ -642,7 +638,7 @@ QList<caf::PdmOptionItemInfo> RimGridCrossPlotCurveSet::calculateValueOptions(co
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimGridCrossPlotCurveSet::updateLegend()
|
||||
{
|
||||
m_legendConfig->setTitle(categoryTitle());
|
||||
legendConfig()->setTitle(categoryTitle());
|
||||
|
||||
RimGridCrossPlot* parent;
|
||||
this->firstAncestorOrThisOfTypeAsserted(parent);
|
||||
@@ -656,8 +652,8 @@ void RimGridCrossPlotCurveSet::updateLegend()
|
||||
RigFormationNames* formationNames = eclipseCase->eclipseCaseData()->activeFormationNames();
|
||||
|
||||
const std::vector<QString>& categoryNames = formationNames->formationNames();
|
||||
m_legendConfig->setNamedCategories(categoryNames);
|
||||
m_legendConfig->setAutomaticRanges(0, categoryNames.size() - 1, 0, categoryNames.size() - 1);
|
||||
legendConfig()->setNamedCategories(categoryNames);
|
||||
legendConfig()->setAutomaticRanges(0, categoryNames.size() - 1, 0, categoryNames.size() - 1);
|
||||
}
|
||||
else if (m_categorization() == TIME_CATEGORIZATION)
|
||||
{
|
||||
@@ -667,48 +663,16 @@ void RimGridCrossPlotCurveSet::updateLegend()
|
||||
{
|
||||
categoryNames.push_back(name);
|
||||
}
|
||||
m_legendConfig->setNamedCategories(categoryNames);
|
||||
m_legendConfig->setAutomaticRanges(0, categoryNames.size() - 1, 0, categoryNames.size() - 1);
|
||||
legendConfig()->setNamedCategories(categoryNames);
|
||||
legendConfig()->setAutomaticRanges(0, categoryNames.size() - 1, 0, categoryNames.size() - 1);
|
||||
}
|
||||
else if (m_categoryProperty->eclipseResultAddress().isValid())
|
||||
{
|
||||
RimEclipseCase* eclipseCase = dynamic_cast<RimEclipseCase*>(m_case());
|
||||
RigEclipseCaseData* caseData = eclipseCase->eclipseCaseData();
|
||||
CVF_ASSERT(caseData);
|
||||
if (!caseData) return;
|
||||
|
||||
RigCaseCellResultsData* cellResultsData = caseData->results(RiaDefines::MATRIX_MODEL);
|
||||
CVF_ASSERT(cellResultsData);
|
||||
|
||||
double globalMin, globalMax;
|
||||
double globalPosClosestToZero, globalNegClosestToZero;
|
||||
|
||||
cellResultsData->minMaxCellScalarValues(m_categoryProperty->eclipseResultAddress(), globalMin, globalMax);
|
||||
cellResultsData->posNegClosestToZero(
|
||||
m_categoryProperty->eclipseResultAddress(), globalPosClosestToZero, globalNegClosestToZero);
|
||||
|
||||
double localMin, localMax;
|
||||
double localPosClosestToZero, localNegClosestToZero;
|
||||
if (m_categoryProperty->hasDynamicResult() && m_timeStep != -1)
|
||||
if (eclipseCase)
|
||||
{
|
||||
cellResultsData->minMaxCellScalarValues(m_categoryProperty->eclipseResultAddress(), m_timeStep, localMin, localMax);
|
||||
cellResultsData->posNegClosestToZero(
|
||||
m_categoryProperty->eclipseResultAddress(), m_timeStep, localPosClosestToZero, localNegClosestToZero);
|
||||
m_categoryProperty->updateLegendData(eclipseCase, m_timeStep());
|
||||
}
|
||||
else
|
||||
{
|
||||
localMin = globalMin;
|
||||
localMax = globalMax;
|
||||
|
||||
localPosClosestToZero = globalPosClosestToZero;
|
||||
localNegClosestToZero = globalNegClosestToZero;
|
||||
}
|
||||
|
||||
CVF_ASSERT(m_legendConfig);
|
||||
|
||||
m_legendConfig->setClosestToZeroValues(
|
||||
globalPosClosestToZero, globalNegClosestToZero, localPosClosestToZero, localNegClosestToZero);
|
||||
m_legendConfig->setAutomaticRanges(globalMin, globalMax, localMin, localMax);
|
||||
}
|
||||
parent->qwtPlot()->addOrUpdateCurveSetLegend(this);
|
||||
}
|
||||
@@ -724,7 +688,15 @@ void RimGridCrossPlotCurveSet::updateLegend()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RimGridCrossPlotCurveSet::hasCategoryResult() const
|
||||
{
|
||||
return m_categorization == FORMATION_CATEGORIZATION || m_categorization == TIME_CATEGORIZATION || m_categorization == RESULT_CATEGORIZATION;
|
||||
if (m_categorization == FORMATION_CATEGORIZATION || m_categorization == TIME_CATEGORIZATION)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else if (m_categorization == RESULT_CATEGORIZATION)
|
||||
{
|
||||
return m_categoryProperty->hasCategoryResult();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -768,20 +740,20 @@ void RimGridCrossPlotCurveSet::updateCurveNames(bool applyCaseName,
|
||||
|
||||
if (applyCategory && m_categorization != NO_CATEGORIZATION)
|
||||
{
|
||||
if (m_categorization == RESULT_CATEGORIZATION)
|
||||
if (hasCategoryResult())
|
||||
{
|
||||
nameTags += legendConfig()->categoryNameFromCategoryValue(curve->categoryIndex());
|
||||
}
|
||||
else
|
||||
{
|
||||
std::vector<double> tickValues;
|
||||
m_legendConfig->scalarMapper()->majorTickValues(&tickValues);
|
||||
legendConfig()->scalarMapper()->majorTickValues(&tickValues);
|
||||
size_t catIndex = (size_t) curve->categoryIndex();
|
||||
double lowerLimit = tickValues[catIndex];
|
||||
double upperLimit = catIndex + 1u < tickValues.size()
|
||||
? tickValues[catIndex + 1u] : std::numeric_limits<double>::infinity();
|
||||
nameTags += QString("%1 [%2, %3]").arg(categoryTitle()).arg(lowerLimit).arg(upperLimit);
|
||||
}
|
||||
else
|
||||
{
|
||||
nameTags += m_legendConfig->categoryNameFromCategoryValue(curve->categoryIndex());
|
||||
}
|
||||
}
|
||||
|
||||
curve->setCustomName(nameTags.join(", "));
|
||||
@@ -852,7 +824,7 @@ void RimGridCrossPlotCurveSet::defineUiTreeOrdering(caf::PdmUiTreeOrdering& uiTr
|
||||
{
|
||||
if (m_categorization() != NO_CATEGORIZATION)
|
||||
{
|
||||
uiTreeOrdering.add(m_legendConfig());
|
||||
m_categoryProperty->uiTreeOrdering(uiTreeOrdering, uiConfigName);
|
||||
}
|
||||
|
||||
for (auto curve : m_crossPlotCurves())
|
||||
|
||||
@@ -39,6 +39,7 @@ class RimCase;
|
||||
class RimGridCrossPlotCurve;
|
||||
class RimGridView;
|
||||
class RimEclipseCase;
|
||||
class RimEclipseCellColors;
|
||||
class RimEclipseResultDefinition;
|
||||
class RimRegularLegendConfig;
|
||||
class QwtPlot;
|
||||
@@ -89,7 +90,7 @@ public:
|
||||
void detachAllCurves();
|
||||
void cellFilterViewUpdated();
|
||||
|
||||
RimRegularLegendConfig* legendConfig();
|
||||
RimRegularLegendConfig* legendConfig() const;
|
||||
|
||||
std::vector< RimGridCrossPlotCurve*> curves() const;
|
||||
|
||||
@@ -129,10 +130,9 @@ private:
|
||||
caf::PdmField<CurveCategorizationEnum> m_categorization;
|
||||
caf::PdmChildField<RimEclipseResultDefinition*> m_xAxisProperty;
|
||||
caf::PdmChildField<RimEclipseResultDefinition*> m_yAxisProperty;
|
||||
caf::PdmChildField<RimEclipseResultDefinition*> m_categoryProperty;
|
||||
caf::PdmChildField<RimEclipseCellColors*> m_categoryProperty;
|
||||
|
||||
caf::PdmChildField<RimGridCrossPlotCurveSetNameConfig*> m_nameConfig;
|
||||
|
||||
caf::PdmChildArrayField<RimGridCrossPlotCurve*> m_crossPlotCurves;
|
||||
caf::PdmChildField<RimRegularLegendConfig*> m_legendConfig;
|
||||
};
|
||||
|
||||
@@ -660,7 +660,7 @@ void Rim2dIntersectionView::updateLegends()
|
||||
{
|
||||
m_legendConfig()->setUiValuesFromLegendConfig(eclView->cellResult()->legendConfig());
|
||||
m_ternaryLegendConfig()->setUiValuesFromLegendConfig(eclView->cellResult()->ternaryLegendConfig());
|
||||
eclView->cellResult()->updateLegendData(m_currentTimeStep(), m_legendConfig(), m_ternaryLegendConfig());
|
||||
eclView->cellResult()->updateLegendData(eclView->eclipseCase(), m_currentTimeStep(), m_legendConfig(), m_ternaryLegendConfig());
|
||||
|
||||
if ( eclView->cellResult()->isTernarySaturationSelected() )
|
||||
{
|
||||
|
||||
@@ -226,6 +226,14 @@ void RimEclipseCellColors::updateLegendCategorySettings()
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimEclipseCellColors::uiTreeOrdering(caf::PdmUiTreeOrdering& uiTreeOrdering, QString uiConfigName /*= ""*/)
|
||||
{
|
||||
defineUiTreeOrdering(uiTreeOrdering, uiConfigName);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -274,7 +282,8 @@ public :
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimEclipseCellColors::updateLegendData(size_t currentTimeStep,
|
||||
void RimEclipseCellColors::updateLegendData(RimEclipseCase* rimEclipseCase,
|
||||
int currentTimeStep,
|
||||
RimRegularLegendConfig* legendConfig,
|
||||
RimTernaryLegendConfig* ternaryLegendConfig)
|
||||
{
|
||||
@@ -285,22 +294,22 @@ void RimEclipseCellColors::updateLegendData(size_t currentTimeStep,
|
||||
{
|
||||
if ( this->isFlowDiagOrInjectionFlooding() )
|
||||
{
|
||||
CVF_ASSERT(currentTimeStep >= 0);
|
||||
|
||||
double globalMin, globalMax;
|
||||
double globalPosClosestToZero, globalNegClosestToZero;
|
||||
RigFlowDiagResults* flowResultsData = this->flowDiagSolution()->flowDiagResults();
|
||||
RigFlowDiagResultAddress resAddr = this->flowDiagResAddress();
|
||||
|
||||
int integerTimeStep = static_cast<int>(currentTimeStep);
|
||||
|
||||
flowResultsData->minMaxScalarValues(resAddr, integerTimeStep, &globalMin, &globalMax);
|
||||
flowResultsData->posNegClosestToZero(resAddr, integerTimeStep, &globalPosClosestToZero, &globalNegClosestToZero);
|
||||
flowResultsData->minMaxScalarValues(resAddr, currentTimeStep, &globalMin, &globalMax);
|
||||
flowResultsData->posNegClosestToZero(resAddr, currentTimeStep, &globalPosClosestToZero, &globalNegClosestToZero);
|
||||
|
||||
double localMin, localMax;
|
||||
double localPosClosestToZero, localNegClosestToZero;
|
||||
if ( this->hasDynamicResult() )
|
||||
{
|
||||
flowResultsData->minMaxScalarValues(resAddr, integerTimeStep, &localMin, &localMax);
|
||||
flowResultsData->posNegClosestToZero(resAddr, integerTimeStep, &localPosClosestToZero, &localNegClosestToZero);
|
||||
flowResultsData->minMaxScalarValues(resAddr, currentTimeStep, &localMin, &localMax);
|
||||
flowResultsData->posNegClosestToZero(resAddr, currentTimeStep, &localPosClosestToZero, &localNegClosestToZero);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -318,7 +327,7 @@ void RimEclipseCellColors::updateLegendData(size_t currentTimeStep,
|
||||
localPosClosestToZero, localNegClosestToZero);
|
||||
legendConfig->setAutomaticRanges(globalMin, globalMax, localMin, localMax);
|
||||
|
||||
if ( this->hasCategoryResult() )
|
||||
if ( this->hasCategoryResult() && m_reservoirView)
|
||||
{
|
||||
std::set<std::tuple<QString, int, cvf::Color3ub>, TupleCompare > categories;
|
||||
//std::set<std::tuple<QString, int, cvf::Color3ub> > categories;
|
||||
@@ -346,8 +355,6 @@ void RimEclipseCellColors::updateLegendData(size_t currentTimeStep,
|
||||
}
|
||||
else
|
||||
{
|
||||
RimEclipseCase* rimEclipseCase = nullptr;
|
||||
this->firstAncestorOrThisOfType(rimEclipseCase);
|
||||
CVF_ASSERT(rimEclipseCase);
|
||||
if ( !rimEclipseCase ) return;
|
||||
|
||||
@@ -366,7 +373,7 @@ void RimEclipseCellColors::updateLegendData(size_t currentTimeStep,
|
||||
|
||||
double localMin, localMax;
|
||||
double localPosClosestToZero, localNegClosestToZero;
|
||||
if ( this->hasDynamicResult() )
|
||||
if ( this->hasDynamicResult() && currentTimeStep >= 0)
|
||||
{
|
||||
cellResultsData->minMaxCellScalarValues(this->eclipseResultAddress(), currentTimeStep, localMin, localMax);
|
||||
cellResultsData->posNegClosestToZero(this->eclipseResultAddress(), currentTimeStep, localPosClosestToZero, localNegClosestToZero);
|
||||
@@ -424,8 +431,6 @@ void RimEclipseCellColors::updateLegendData(size_t currentTimeStep,
|
||||
|
||||
// Ternary legend update
|
||||
{
|
||||
RimEclipseCase* rimEclipseCase = nullptr;
|
||||
this->firstAncestorOrThisOfType(rimEclipseCase);
|
||||
CVF_ASSERT(rimEclipseCase);
|
||||
if ( !rimEclipseCase ) return;
|
||||
|
||||
@@ -525,16 +530,18 @@ RimTernaryLegendConfig* RimEclipseCellColors::ternaryLegendConfig()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimEclipseCellColors::updateIconState()
|
||||
{
|
||||
RimViewController* viewController = m_reservoirView->viewController();
|
||||
if (viewController && viewController->isResultColorControlled())
|
||||
if (m_reservoirView)
|
||||
{
|
||||
updateUiIconFromState(false);
|
||||
RimViewController* viewController = m_reservoirView->viewController();
|
||||
if (viewController && viewController->isResultColorControlled())
|
||||
{
|
||||
updateUiIconFromState(false);
|
||||
}
|
||||
else
|
||||
{
|
||||
updateUiIconFromState(true);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
updateUiIconFromState(true);
|
||||
}
|
||||
|
||||
uiCapability()->updateConnectedEditors();
|
||||
}
|
||||
|
||||
|
||||
@@ -26,6 +26,7 @@
|
||||
#include "cafPdmChildField.h"
|
||||
#include "cafPdmPtrField.h"
|
||||
|
||||
class RimEclipseCase;
|
||||
class RimTernaryLegendConfig;
|
||||
class RimRegularLegendConfig;
|
||||
|
||||
@@ -43,10 +44,10 @@ public:
|
||||
void setReservoirView(RimEclipseView* ownerReservoirView);
|
||||
RimEclipseView* reservoirView();
|
||||
|
||||
void updateLegendData(size_t timestep,
|
||||
void updateLegendData(RimEclipseCase* rimEclipseCase,
|
||||
int timestep,
|
||||
RimRegularLegendConfig* legendConfig = nullptr,
|
||||
RimTernaryLegendConfig* ternaryLegendConfig = nullptr);
|
||||
|
||||
RimRegularLegendConfig* legendConfig();
|
||||
RimTernaryLegendConfig* ternaryLegendConfig();
|
||||
|
||||
@@ -55,7 +56,7 @@ public:
|
||||
void updateIconState();
|
||||
|
||||
void updateLegendCategorySettings() override;
|
||||
|
||||
void uiTreeOrdering(caf::PdmUiTreeOrdering& uiTreeOrdering, QString uiConfigName = "");
|
||||
protected:
|
||||
// Overridden methods
|
||||
void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue) override;
|
||||
|
||||
@@ -1159,7 +1159,7 @@ void RimEclipseView::updateLegends()
|
||||
{
|
||||
if (this->cellEdgeResult()->isUsingSingleVariable())
|
||||
{
|
||||
this->cellEdgeResult()->singleVarEdgeResultColors()->updateLegendData(m_currentTimeStep);
|
||||
this->cellEdgeResult()->singleVarEdgeResultColors()->updateLegendData(m_eclipseCase, m_currentTimeStep);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1226,7 +1226,7 @@ void RimEclipseView::updateMinMaxValuesAndAddLegendToView(QString
|
||||
RimEclipseCellColors* resultColors,
|
||||
RigCaseCellResultsData* cellResultsData)
|
||||
{
|
||||
resultColors->updateLegendData(m_currentTimeStep);
|
||||
resultColors->updateLegendData(m_eclipseCase, m_currentTimeStep);
|
||||
|
||||
if (resultColors->hasResult() && resultColors->legendConfig()->showLegend())
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user