#3156 Make formation labels optional even if formation lines are shown

This commit is contained in:
Gaute Lindkvist
2018-07-06 09:16:03 +02:00
parent 8b258d6edd
commit f8a7ba541f
5 changed files with 45 additions and 12 deletions

View File

@@ -158,7 +158,13 @@ void RicNewWellBoreStabilityPlotFeature::createFormationTrack(RimWellLogPlot* pl
//--------------------------------------------------------------------------------------------------
void RicNewWellBoreStabilityPlotFeature::createCasingShoeTrack(RimWellLogPlot* plot, RimWellPath* wellPath, RimGeoMechCase* geoMechCase)
{
RimWellLogTrack* casingShoeTrack = RicNewWellLogPlotFeatureImpl::createWellLogPlotTrack(false, "Casing Shoe", plot);
casingShoeTrack->setWidthScaleFactor(RimWellLogTrack::NARROW_TRACK);
casingShoeTrack->setFormationWellPath(wellPath);
casingShoeTrack->setFormationCase(geoMechCase);
casingShoeTrack->setShowFormations(true);
casingShoeTrack->setShowFormationLabels(false);
casingShoeTrack->setVisibleXRange(0.0, 0.0);
std::vector<RimWellLogFile*> wellLogFiles = wellPath->wellLogFiles();
for (RimWellLogFile* logFile : wellLogFiles)
{
@@ -167,9 +173,6 @@ void RicNewWellBoreStabilityPlotFeature::createCasingShoeTrack(RimWellLogPlot* p
{
if (channel->name() == "CASING_SIZE")
{
RimWellLogTrack* casingShoeTrack = RicNewWellLogPlotFeatureImpl::createWellLogPlotTrack(false, "Casing Shoe Depth", plot);
casingShoeTrack->setWidthScaleFactor(RimWellLogTrack::NARROW_TRACK);
casingShoeTrack->setAutoScaleXEnabled(true);
RimWellLogFileCurve* fileCurve = RicWellLogTools::addFileCurve(casingShoeTrack, false);
fileCurve->setWellLogFile(logFile);
fileCurve->setWellPath(wellPath);
@@ -177,6 +180,7 @@ void RicNewWellBoreStabilityPlotFeature::createCasingShoeTrack(RimWellLogPlot* p
fileCurve->setCustomName(QString("Casing size [in]"));
fileCurve->setLineThickness(2);
fileCurve->loadDataAndUpdate(false);
casingShoeTrack->setAutoScaleXEnabled(true);
casingShoeTrack->calculateXZoomRangeAndUpdateQwt();
break;
}
@@ -194,6 +198,11 @@ void RicNewWellBoreStabilityPlotFeature::createStabilityCurvesTrack(RimWellLogPl
stabilityCurvesTrack->setAutoScaleXEnabled(true);
stabilityCurvesTrack->setTickIntervals(0.5, 0.05);
stabilityCurvesTrack->enableGridLines(RimWellLogTrack::GRID_X_MAJOR_AND_MINOR);
stabilityCurvesTrack->setFormationWellPath(wellPath);
stabilityCurvesTrack->setFormationCase(geoMechView->geoMechCase());
stabilityCurvesTrack->setShowFormations(true);
stabilityCurvesTrack->setShowFormationLabels(false);
std::vector<QString> resultNames = RiaDefines::wellPathStabilityResultNames();
std::vector<cvf::Color3f> colors = { cvf::Color3f::RED, cvf::Color3f::PURPLE, cvf::Color3f::GREEN, cvf::Color3f::BLUE, cvf::Color3f::ORANGE };
@@ -262,5 +271,8 @@ void RicNewWellBoreStabilityPlotFeature::createAnglesTrack(RimWellLogPlot* plot,
wellPathAnglesTrack->setVisibleXRange(minValue, maxValue);
wellPathAnglesTrack->setTickIntervals(90.0, 30.0);
wellPathAnglesTrack->enableGridLines(RimWellLogTrack::GRID_X_MAJOR_AND_MINOR);
wellPathAnglesTrack->setFormationWellPath(wellPath);
wellPathAnglesTrack->setFormationCase(geoMechView->geoMechCase());
wellPathAnglesTrack->setShowFormations(true);
wellPathAnglesTrack->setShowFormationLabels(false);
}

View File

@@ -158,7 +158,8 @@ RimWellLogTrack::RimWellLogTrack()
m_majorTickInterval.uiCapability()->setUiHidden(true);
m_minorTickInterval.uiCapability()->setUiHidden(true);
CAF_PDM_InitField(&m_showFormations, "ShowFormations", false, "Show", "", "", "");
CAF_PDM_InitField(&m_showFormations, "ShowFormations", false, "Show Lines", "", "", "");
CAF_PDM_InitField(&m_showFormationLabels, "ShowFormationLabels", true, "Show Labels", "", "", "");
CAF_PDM_InitFieldNoDefault(&m_formationSource, "FormationSource", "Source", "", "", "");
@@ -356,6 +357,10 @@ void RimWellLogTrack::fieldChangedByUi(const caf::PdmFieldHandle* changedField,
}
}
}
else if (changedField == &m_showFormationLabels)
{
loadDataAndUpdate();
}
else if (changedField == &m_formationCase)
{
QList<caf::PdmOptionItemInfo> options;
@@ -1037,6 +1042,14 @@ void RimWellLogTrack::setShowFormations(bool on)
m_showFormations = on;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimWellLogTrack::setShowFormationLabels(bool on)
{
m_showFormationLabels = on;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@@ -1062,6 +1075,7 @@ void RimWellLogTrack::defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering&
caf::PdmUiGroup* formationGroup = uiOrdering.addNewGroup("Zonation/Formation Names");
formationGroup->add(&m_showFormations);
formationGroup->add(&m_showFormationLabels);
if (!m_formationsForCaseWithSimWellOnly)
{
@@ -1439,6 +1453,7 @@ std::vector<QString> RimWellLogTrack::formationNamesVector(RimCase* rimCase)
//--------------------------------------------------------------------------------------------------
void RimWellLogTrack::setFormationFieldsUiReadOnly(bool readOnly /*= true*/)
{
m_showFormationLabels.uiCapability()->setUiReadOnly(readOnly);
m_formationSource.uiCapability()->setUiReadOnly(readOnly);
m_formationTrajectoryType.uiCapability()->setUiReadOnly(readOnly);
m_formationSimWellName.uiCapability()->setUiReadOnly(readOnly);
@@ -1530,7 +1545,7 @@ void RimWellLogTrack::updateFormationNamesOnPlot()
&formationNamesToPlot,
&yValues);
m_annotationTool->attachFormationNames(this->viewer(), formationNamesToPlot, yValues);
m_annotationTool->attachFormationNames(this->viewer(), formationNamesToPlot, yValues, m_showFormationLabels());
}
else if (m_formationSource() == WELL_PICK_FILTER)
{

View File

@@ -115,6 +115,7 @@ public:
void setTickIntervals(double majorTickInterval, double minorTickInterval);
void enableGridLines(GridLines gridLines);
void setShowFormations(bool on);
void setShowFormationLabels(bool on);
RiuWellLogTrack* viewer();
@@ -183,6 +184,7 @@ private:
caf::PdmField<double> m_minorTickInterval;
caf::PdmField<bool> m_showFormations;
caf::PdmField<bool> m_showFormationLabels;
caf::PdmField<caf::AppEnum<FormationSource>> m_formationSource;
caf::PdmPtrField<RimCase*> m_formationCase;
caf::PdmField<caf::AppEnum<TrajectoryType>> m_formationTrajectoryType;

View File

@@ -34,7 +34,7 @@ RiuPlotAnnotationTool::~RiuPlotAnnotationTool()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RiuPlotAnnotationTool::attachFormationNames(QwtPlot* plot, const std::vector<QString>& names, const std::vector<std::pair<double, double>> yPositions)
void RiuPlotAnnotationTool::attachFormationNames(QwtPlot* plot, const std::vector<QString>& names, const std::vector<std::pair<double, double>> yPositions, bool showNames)
{
detachAllAnnotations();
@@ -47,10 +47,14 @@ void RiuPlotAnnotationTool::attachFormationNames(QwtPlot* plot, const std::vecto
{
QwtPlotMarker* line(new QwtPlotMarker());
QString name = names[i];
if (names[i].toLower().indexOf("top") == -1)
QString name;
if (showNames)
{
name += " Top";
name = names[i];
if (names[i].toLower().indexOf("top") == -1)
{
name += " Top";
}
}
RiuPlotAnnotationTool::horizontalDashedLine(line, name, yPositions[i].first);

View File

@@ -34,7 +34,7 @@ public:
RiuPlotAnnotationTool() {};
~RiuPlotAnnotationTool();
void attachFormationNames(QwtPlot* plot, const std::vector<QString>& names, const std::vector<std::pair<double, double>> yPositions);
void attachFormationNames(QwtPlot* plot, const std::vector<QString>& names, const std::vector<std::pair<double, double>> yPositions, bool showNames = true);
void attachWellPicks(QwtPlot* plot, const std::vector<QString>& names, const std::vector<double> yPositions);
void detachAllAnnotations();