mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#3907 Summary : Consider combined curve count when assigning color
This commit is contained in:
@@ -19,6 +19,7 @@
|
|||||||
#include "RicNewSummaryCurveFeature.h"
|
#include "RicNewSummaryCurveFeature.h"
|
||||||
|
|
||||||
#include "RiaApplication.h"
|
#include "RiaApplication.h"
|
||||||
|
#include "RiaColorTables.h"
|
||||||
|
|
||||||
#include "RimMainPlotCollection.h"
|
#include "RimMainPlotCollection.h"
|
||||||
#include "RimOilField.h"
|
#include "RimOilField.h"
|
||||||
@@ -31,8 +32,6 @@
|
|||||||
|
|
||||||
#include "RiuPlotMainWindow.h"
|
#include "RiuPlotMainWindow.h"
|
||||||
|
|
||||||
#include "WellLogCommands/RicWellLogPlotCurveFeatureImpl.h"
|
|
||||||
|
|
||||||
#include "cafSelectionManager.h"
|
#include "cafSelectionManager.h"
|
||||||
|
|
||||||
#include "cvfAssert.h"
|
#include "cvfAssert.h"
|
||||||
@@ -62,7 +61,9 @@ void RicNewSummaryCurveFeature::onActionTriggered(bool isChecked)
|
|||||||
if (plot)
|
if (plot)
|
||||||
{
|
{
|
||||||
RimSummaryCurve* newCurve = new RimSummaryCurve();
|
RimSummaryCurve* newCurve = new RimSummaryCurve();
|
||||||
cvf::Color3f curveColor = RicWellLogPlotCurveFeatureImpl::curveColorFromTable(plot->curveCount());
|
|
||||||
|
// Use same counting as RicNewSummaryEnsembleCurveSetFeature::onActionTriggered
|
||||||
|
cvf::Color3f curveColor = RiaColorTables::summaryCurveDefaultPaletteColors().cycledColor3f(plot->singleColorCurveCount());
|
||||||
newCurve->setColor(curveColor);
|
newCurve->setColor(curveColor);
|
||||||
|
|
||||||
plot->addCurveAndUpdate(newCurve);
|
plot->addCurveAndUpdate(newCurve);
|
||||||
|
|||||||
@@ -67,12 +67,8 @@ void RicNewSummaryEnsembleCurveSetFeature::onActionTriggered(bool isChecked)
|
|||||||
{
|
{
|
||||||
RimEnsembleCurveSet* curveSet = new RimEnsembleCurveSet();
|
RimEnsembleCurveSet* curveSet = new RimEnsembleCurveSet();
|
||||||
|
|
||||||
// Set single curve set color
|
// Use same counting as RicNewSummaryCurveFeature::onActionTriggered
|
||||||
auto allCurveSets = plot->ensembleCurveSetCollection()->curveSets();
|
auto colorIndex = plot->singleColorCurveCount();
|
||||||
size_t colorIndex = std::count_if(allCurveSets.begin(), allCurveSets.end(), [](RimEnsembleCurveSet* curveSet)
|
|
||||||
{
|
|
||||||
return curveSet->colorMode() == RimEnsembleCurveSet::SINGLE_COLOR;
|
|
||||||
});
|
|
||||||
curveSet->setColor(RiaColorTables::summaryCurveDefaultPaletteColors().cycledColor3f(colorIndex));
|
curveSet->setColor(RiaColorTables::summaryCurveDefaultPaletteColors().cycledColor3f(colorIndex));
|
||||||
curveSet->legendConfig()->setColorRange(RimEnsembleCurveSetColorManager::cycledEnsembleColorRange(static_cast<int>(colorIndex)));
|
curveSet->legendConfig()->setColorRange(RimEnsembleCurveSetColorManager::cycledEnsembleColorRange(static_cast<int>(colorIndex)));
|
||||||
|
|
||||||
|
|||||||
@@ -549,6 +549,22 @@ bool RimSummaryPlot::containsResamplableCurves() const
|
|||||||
return !m_gridTimeHistoryCurves.empty() || resamplableSummaryCurveCount > 0;
|
return !m_gridTimeHistoryCurves.empty() || resamplableSummaryCurveCount > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
size_t RimSummaryPlot::singleColorCurveCount() const
|
||||||
|
{
|
||||||
|
auto allCurveSets = ensembleCurveSetCollection()->curveSets();
|
||||||
|
size_t colorIndex = std::count_if(allCurveSets.begin(), allCurveSets.end(), [](RimEnsembleCurveSet* curveSet)
|
||||||
|
{
|
||||||
|
return curveSet->colorMode() == RimEnsembleCurveSet::SINGLE_COLOR;
|
||||||
|
});
|
||||||
|
|
||||||
|
colorIndex += curveCount();
|
||||||
|
|
||||||
|
return colorIndex;
|
||||||
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
|||||||
@@ -132,6 +132,8 @@ public:
|
|||||||
void updatePlotInfoLabel();
|
void updatePlotInfoLabel();
|
||||||
|
|
||||||
bool containsResamplableCurves() const;
|
bool containsResamplableCurves() const;
|
||||||
|
|
||||||
|
size_t singleColorCurveCount() const;
|
||||||
// RimViewWindow overrides
|
// RimViewWindow overrides
|
||||||
public:
|
public:
|
||||||
QWidget* createViewWidget(QWidget* mainWindowParent) override;
|
QWidget* createViewWidget(QWidget* mainWindowParent) override;
|
||||||
|
|||||||
Reference in New Issue
Block a user