#3407 Default color palette for new well paths

This commit is contained in:
Jacob Støren 2018-09-24 16:38:38 +02:00
parent d5d18bde09
commit 5a9a5ba803
3 changed files with 30 additions and 2 deletions

View File

@ -497,6 +497,26 @@ const caf::ColorTable& RiaColorTables::timestepsPaletteColors()
return colorTable;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
const caf::ColorTable& RiaColorTables::editableWellPathsPaletteColors()
{
static std::vector<cvf::Color3ub> colors{
cvf::Color3ub( 204, 0, 204), // Dark magenta
cvf::Color3ub( 173, 23, 212), // Strong Purple
cvf::Color3ub( 143, 46, 219), //Purple
cvf::Color3ub( 102, 76, 230), // Gray Blue
cvf::Color3ub( 71, 99, 237), // Lighter Gray Blue
cvf::Color3ub( 31, 130, 247), // Strong Blue
cvf::Color3ub( 0, 153, 255), // Dark Turquise
};
static caf::ColorTable colorTable = caf::ColorTable(colors);
return colorTable;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------

View File

@ -53,6 +53,7 @@ public:
static const caf::ColorTable& wellLogPlotPaletteColors();
static const caf::ColorTable& selectionPaletteColors();
static const caf::ColorTable& timestepsPaletteColors();
static const caf::ColorTable& editableWellPathsPaletteColors();
static cvf::Color3f undefinedCellColor();
static cvf::Color3f perforationLengthColor();

View File

@ -29,6 +29,7 @@ CAF_CMD_SOURCE_INIT(RicNewEditableWellPathFeature, "RicNewEditableWellPathFeatur
#include "RimOilField.h"
#include "Riu3DMainWindowTools.h"
#include "RimWellPathGeometryDef.h"
#include "RiaColorTables.h"
//--------------------------------------------------------------------------------------------------
///
@ -71,9 +72,15 @@ void RicNewEditableWellPathFeature::onActionTriggered(bool isChecked)
{
std::vector<RimWellPath*> newWellPaths;
auto newModeledWellPath = new RimModeledWellPath();
newModeledWellPath->setUnitSystem(project->commonUnitSystemForAllCases());
newWellPaths.push_back(newModeledWellPath);
newWellPaths.back()->setName("UWell-" + QString::number(wellPathCollection->modelledWellPathCount()+1));
newModeledWellPath->setUnitSystem(project->commonUnitSystemForAllCases());
size_t modelledWellpathCount = wellPathCollection->modelledWellPathCount();
newWellPaths.back()->setName("UWell-" + QString::number(modelledWellpathCount+1));
newModeledWellPath->setWellPathColor(RiaColorTables::editableWellPathsPaletteColors().cycledColor3f(modelledWellpathCount));
wellPathCollection->addWellPaths(newWellPaths);
wellPathCollection->uiCapability()->updateConnectedEditors();