mirror of
https://github.com/OPM/ResInsight.git
synced 2026-10-12 08:25:03 -05:00
#3907 Summary : Consider combined curve count when assigning color
This commit is contained in:
1 parent
755e1405db
commit
284e07b967
4 files changed
+24
-9
No files matched your search
@@ -19,6 +19,7 @@
|
||||
#include "RicNewSummaryCurveFeature.h"
|
||||
|
||||
#include "RiaApplication.h"
|
||||
#include "RiaColorTables.h"
|
||||
|
||||
#include "RimMainPlotCollection.h"
|
||||
#include "RimOilField.h"
|
||||
@@ -31,8 +32,6 @@
|
||||
|
||||
#include "RiuPlotMainWindow.h"
|
||||
|
||||
#include "WellLogCommands/RicWellLogPlotCurveFeatureImpl.h"
|
||||
|
||||
#include "cafSelectionManager.h"
|
||||
|
||||
#include "cvfAssert.h"
|
||||
@@ -62,7 +61,9 @@ void RicNewSummaryCurveFeature::onActionTriggered(bool isChecked)
|
||||
if (plot)
|
||||
{
|
||||
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);
|
||||
|
||||
plot->addCurveAndUpdate(newCurve);
|
||||
|
||||
+2
-6
@@ -67,12 +67,8 @@ void RicNewSummaryEnsembleCurveSetFeature::onActionTriggered(bool isChecked)
|
||||
{
|
||||
RimEnsembleCurveSet* curveSet = new RimEnsembleCurveSet();
|
||||
|
||||
// Set single curve set color
|
||||
auto allCurveSets = plot->ensembleCurveSetCollection()->curveSets();
|
||||
size_t colorIndex = std::count_if(allCurveSets.begin(), allCurveSets.end(), [](RimEnsembleCurveSet* curveSet)
|
||||
{
|
||||
return curveSet->colorMode() == RimEnsembleCurveSet::SINGLE_COLOR;
|
||||
});
|
||||
// Use same counting as RicNewSummaryCurveFeature::onActionTriggered
|
||||
auto colorIndex = plot->singleColorCurveCount();
|
||||
curveSet->setColor(RiaColorTables::summaryCurveDefaultPaletteColors().cycledColor3f(colorIndex));
|
||||
curveSet->legendConfig()->setColorRange(RimEnsembleCurveSetColorManager::cycledEnsembleColorRange(static_cast<int>(colorIndex)));
|
||||
|
||||
|
||||
Reference in new issue
Block a user