mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#3492 Tidy up color code for well path components/completions and select colors that work better.
This commit is contained in:
@@ -18,6 +18,7 @@
|
||||
|
||||
#include "RimFishbonesMultipleSubs.h"
|
||||
|
||||
#include "RiaColorTables.h"
|
||||
#include "RigFishbonesGeometry.h"
|
||||
#include "RigWellPath.h"
|
||||
#include "RimProject.h"
|
||||
@@ -71,7 +72,8 @@ RimFishbonesMultipleSubs::RimFishbonesMultipleSubs()
|
||||
m_name.uiCapability()->setUiReadOnly(true);
|
||||
m_name.xmlCapability()->setIOWritable(false);
|
||||
|
||||
CAF_PDM_InitField(&fishbonesColor, "Color", cvf::Color3f(0.999f, 0.333f, 0.999f), "Fishbones Color", "", "", "");
|
||||
cvf::Color3f defaultColor = RiaColorTables::wellPathComponentColors()[RiaDefines::FISHBONES];
|
||||
CAF_PDM_InitField(&fishbonesColor, "Color", defaultColor, "Fishbones Color", "", "", "");
|
||||
|
||||
CAF_PDM_InitField(&m_lateralCountPerSub, "LateralCountPerSub", 3, "Laterals Per Sub", "", "", "");
|
||||
CAF_PDM_InitField(&m_lateralLength, "LateralLength", QString("11.0"), "Length(s) [m]", "", "Specify multiple length values if the sub lengths differ", "");
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
#include "RimFracture.h"
|
||||
|
||||
#include "RiaApplication.h"
|
||||
#include "RiaColorTables.h"
|
||||
#include "RiaCompletionTypeCalculationScheduler.h"
|
||||
#include "RiaEclipseUnitTools.h"
|
||||
#include "RiaLogging.h"
|
||||
@@ -314,7 +315,7 @@ QString RimFracture::componentTypeLabel() const
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
cvf::Color3f RimFracture::defaultComponentColor() const
|
||||
{
|
||||
return cvf::Color3f(cvf::Color3::ORANGE_RED);
|
||||
return RiaColorTables::wellPathComponentColors()[componentType()];
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
|
||||
#include "RimPerforationInterval.h"
|
||||
|
||||
#include "RiaColorTables.h"
|
||||
#include "RigWellPath.h"
|
||||
#include "RigCaseCellResultsData.h"
|
||||
|
||||
@@ -259,7 +260,7 @@ QString RimPerforationInterval::componentTypeLabel() const
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
cvf::Color3f RimPerforationInterval::defaultComponentColor() const
|
||||
{
|
||||
return cvf::Color3f(cvf::Color3::GREEN);
|
||||
return RiaColorTables::wellPathComponentColors()[componentType()];
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
#include "RimWellPathValve.h"
|
||||
|
||||
#include "RiaDefines.h"
|
||||
#include "RiaColorTables.h"
|
||||
#include "RiaEclipseUnitTools.h"
|
||||
|
||||
#include "RigWellPath.h"
|
||||
@@ -89,19 +90,7 @@ QString RimWellPathValve::componentTypeLabel() const
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
cvf::Color3f RimWellPathValve::defaultComponentColor() const
|
||||
{
|
||||
switch (m_type())
|
||||
{
|
||||
case RiaDefines::ICD:
|
||||
return cvf::Color3f(cvf::Color3::DARK_BLUE);
|
||||
case RiaDefines::AICD:
|
||||
return cvf::Color3f(cvf::Color3::BROWN);
|
||||
case RiaDefines::ICV:
|
||||
return cvf::Color3f(cvf::Color3::DARK_VIOLET);
|
||||
default:
|
||||
break;
|
||||
}
|
||||
CVF_ASSERT(false);
|
||||
return cvf::Color3f(cvf::Color3::BLACK);
|
||||
return RiaColorTables::wellPathComponentColors()[componentType()];
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
#include "RiaPreferences.h"
|
||||
#include "RiaViewRedrawScheduler.h"
|
||||
|
||||
#include "Rim3dWellLogCurve.h"
|
||||
#include "RimCase.h"
|
||||
#include "RimGridView.h"
|
||||
#include "RimMainPlotCollection.h"
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
|
||||
#include "RimEclipseCellColors.h"
|
||||
|
||||
#include "RiaColorTables.h"
|
||||
#include "RigCaseCellResultsData.h"
|
||||
#include "RigEclipseCaseData.h"
|
||||
#include "RigFlowDiagResults.h"
|
||||
@@ -392,34 +393,22 @@ void RimEclipseCellColors::updateLegendData(size_t currentTimeStep,
|
||||
legendConfig->setNamedCategoriesInverse(fnVector);
|
||||
}
|
||||
else if ( this->resultType() == RiaDefines::DYNAMIC_NATIVE && this->resultVariable() == RiaDefines::completionTypeResultName() )
|
||||
{
|
||||
std::vector< std::tuple<QString, int, cvf::Color3ub> > categories;
|
||||
|
||||
caf::AppEnum<RiaDefines::WellPathComponentType> wellPath(RiaDefines::WELL_PATH);
|
||||
caf::AppEnum<RiaDefines::WellPathComponentType> fishbone(RiaDefines::FISHBONES);
|
||||
caf::AppEnum<RiaDefines::WellPathComponentType> perforationInterval(RiaDefines::PERFORATION_INTERVAL);
|
||||
caf::AppEnum<RiaDefines::WellPathComponentType> fracture(RiaDefines::FRACTURE);
|
||||
|
||||
{
|
||||
const std::vector<int>& visibleCategories = cellResultsData->uniqueCellScalarValues(this->scalarResultIndex());
|
||||
|
||||
if (std::find(visibleCategories.begin(), visibleCategories.end(), wellPath.index()) != visibleCategories.end())
|
||||
std::vector<RiaDefines::WellPathComponentType> supportedCompletionTypes =
|
||||
{ RiaDefines::WELL_PATH, RiaDefines::FISHBONES, RiaDefines::PERFORATION_INTERVAL, RiaDefines::FRACTURE };
|
||||
|
||||
RiaColorTables::WellPathComponentColors colors = RiaColorTables::wellPathComponentColors();
|
||||
|
||||
std::vector< std::tuple<QString, int, cvf::Color3ub> > categories;
|
||||
for (auto completionType : supportedCompletionTypes)
|
||||
{
|
||||
categories.push_back(std::make_tuple(wellPath.uiText(), static_cast<int>(wellPath.index()), cvf::Color3::RED));
|
||||
}
|
||||
|
||||
if (std::find(visibleCategories.begin(), visibleCategories.end(), fishbone.index()) != visibleCategories.end())
|
||||
{
|
||||
categories.push_back(std::make_tuple(fishbone.uiText(), static_cast<int>(fishbone.index()), cvf::Color3::DARK_GREEN));
|
||||
}
|
||||
|
||||
if (std::find(visibleCategories.begin(), visibleCategories.end(), perforationInterval.index()) != visibleCategories.end())
|
||||
{
|
||||
categories.push_back(std::make_tuple(perforationInterval.uiText(), static_cast<int>(perforationInterval.index()), cvf::Color3::GREEN));
|
||||
}
|
||||
|
||||
if (std::find(visibleCategories.begin(), visibleCategories.end(), fracture.index()) != visibleCategories.end())
|
||||
{
|
||||
categories.push_back(std::make_tuple(fracture.uiText(), static_cast<int>(fracture.index()), cvf::Color3::YELLOW_GREEN));
|
||||
if (std::find(visibleCategories.begin(), visibleCategories.end(), completionType) != visibleCategories.end())
|
||||
{
|
||||
QString categoryText = caf::AppEnum<RiaDefines::WellPathComponentType>::uiText(completionType);
|
||||
categories.push_back(std::make_tuple(categoryText, completionType, colors[completionType]));
|
||||
}
|
||||
}
|
||||
|
||||
legendConfig->setCategoryItems(categories);
|
||||
|
||||
@@ -391,13 +391,17 @@ void RimEclipsePropertyFilter::computeResultValueRange()
|
||||
}
|
||||
else if (resultDefinition->resultVariable() == RiaDefines::completionTypeResultName())
|
||||
{
|
||||
std::vector<QString> ctNames;
|
||||
ctNames.push_back(caf::AppEnum<RiaDefines::WellPathComponentType>::uiText(RiaDefines::WELL_PATH));
|
||||
for (RiaDefines::WellPathComponentType type : RiaDefines::wellPathCompletionTypes())
|
||||
std::vector<RiaDefines::WellPathComponentType> componentTypes =
|
||||
{
|
||||
RiaDefines::WELL_PATH, RiaDefines::PERFORATION_INTERVAL,
|
||||
RiaDefines::FISHBONES, RiaDefines::FRACTURE
|
||||
};
|
||||
std::vector<std::pair<QString, int>> ctNamesAndValues;
|
||||
for (RiaDefines::WellPathComponentType type : componentTypes)
|
||||
{
|
||||
ctNames.push_back(caf::AppEnum<RiaDefines::WellPathComponentType>::uiText(type));
|
||||
ctNamesAndValues.push_back(std::make_pair(caf::AppEnum<RiaDefines::WellPathComponentType>::uiText(type), type));
|
||||
}
|
||||
setCategoryNames(ctNames);
|
||||
setCategoryNamesAndValues(ctNamesAndValues);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
#include "RimWellPath.h"
|
||||
|
||||
#include "RiaApplication.h"
|
||||
#include "RiaColorTables.h"
|
||||
#include "RiaSimWellBranchTools.h"
|
||||
#include "RiaWellNameComparer.h"
|
||||
|
||||
@@ -190,6 +191,62 @@ double RimWellPath::wellPathRadiusScaleFactor() const
|
||||
return m_wellPathRadiusScaleFactor();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RiaDefines::WellPathComponentType RimWellPath::componentType() const
|
||||
{
|
||||
return RiaDefines::WELL_PATH;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RimWellPath::componentLabel() const
|
||||
{
|
||||
return name();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RimWellPath::componentTypeLabel() const
|
||||
{
|
||||
return "Well Path";
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
cvf::Color3f RimWellPath::defaultComponentColor() const
|
||||
{
|
||||
return RiaColorTables::wellPathComponentColors()[componentType()];
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
double RimWellPath::startMD() const
|
||||
{
|
||||
if (wellPathGeometry())
|
||||
{
|
||||
return wellPathGeometry()->measureDepths().front();
|
||||
}
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
double RimWellPath::endMD() const
|
||||
{
|
||||
if (wellPathGeometry())
|
||||
{
|
||||
return wellPathGeometry()->measureDepths().back();
|
||||
}
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
|
||||
#include "RiaEclipseUnitTools.h"
|
||||
|
||||
#include "Rim3dWellLogCurve.h"
|
||||
#include "RimWellPathComponentInterface.h"
|
||||
|
||||
#include "cafPdmField.h"
|
||||
#include "cafPdmObject.h"
|
||||
@@ -53,13 +53,14 @@ class RimWellPathCompletions;
|
||||
class RigWellPathFormations;
|
||||
|
||||
class RimWellPathFractureCollection;
|
||||
class Rim3dWellLogCurve;
|
||||
class Rim3dWellLogCurveCollection;
|
||||
|
||||
//==================================================================================================
|
||||
///
|
||||
///
|
||||
//==================================================================================================
|
||||
class RimWellPath : public caf::PdmObject
|
||||
class RimWellPath : public caf::PdmObject, public RimWellPathComponentInterface
|
||||
{
|
||||
CAF_PDM_HEADER_INIT;
|
||||
|
||||
@@ -120,6 +121,15 @@ public:
|
||||
double combinedScaleFactor() const;
|
||||
double wellPathRadius(double characteristicCellSize) const;
|
||||
double wellPathRadiusScaleFactor() const;
|
||||
|
||||
|
||||
// RimWellPathComponentInterface overrides
|
||||
RiaDefines::WellPathComponentType componentType() const override;
|
||||
QString componentLabel() const override;
|
||||
QString componentTypeLabel() const override;
|
||||
cvf::Color3f defaultComponentColor() const override;
|
||||
double startMD() const override;
|
||||
double endMD() const override;
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
#include "RimWellPathAttribute.h"
|
||||
|
||||
#include "RiaColorTables.h"
|
||||
#include "RigWellPath.h"
|
||||
|
||||
#include "RimProject.h"
|
||||
@@ -124,19 +125,7 @@ QString RimWellPathAttribute::componentTypeLabel() const
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
cvf::Color3f RimWellPathAttribute::defaultComponentColor() const
|
||||
{
|
||||
switch (m_type())
|
||||
{
|
||||
case RiaDefines::CASING:
|
||||
return cvf::Color3::FOREST_GREEN;
|
||||
case RiaDefines::LINER:
|
||||
return cvf::Color3::OLIVE;
|
||||
case RiaDefines::PACKER:
|
||||
return cvf::Color3::GRAY;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
CVF_ASSERT(false);
|
||||
return cvf::Color3f(cvf::Color3::BLACK);
|
||||
return RiaColorTables::wellPathComponentColors()[componentType()];
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user