#3104 Well Log Plots: Implement variable width for tracks

This commit is contained in:
Gaute Lindkvist
2018-06-26 11:18:24 +02:00
parent ad17ee1050
commit e4288972de
6 changed files with 136 additions and 42 deletions

View File

@@ -155,6 +155,8 @@ RimWellLogTrack::RimWellLogTrack()
CAF_PDM_InitField(&m_showformationFluids, "ShowFormationFluids", false, "Show Fluids", "", "", "");
CAF_PDM_InitField(&m_widthScaleFactor, "WidthScaleFactor", 1, "Width", "", "Set width of track. ", "");
m_formationsForCaseWithSimWellOnly = false;
}
@@ -221,19 +223,17 @@ void RimWellLogTrack::fieldChangedByUi(const caf::PdmFieldHandle* changedField,
m_wellLogTrackPlotWidget->setVisible(m_show());
}
RimWellLogPlot* wellLogPlot;
this->firstAncestorOrThisOfType(wellLogPlot);
if (wellLogPlot)
updateParentPlotLayout();
}
else if (changedField == &m_widthScaleFactor)
{
if (m_widthScaleFactor < 1 && m_widthScaleFactor > 10)
{
wellLogPlot->calculateAvailableDepthRange();
wellLogPlot->updateDepthZoom();
RiuWellLogPlot* wellLogPlotViewer = dynamic_cast<RiuWellLogPlot*>(wellLogPlot->viewWidget());
if (wellLogPlotViewer)
{
wellLogPlotViewer->updateChildrenLayout();
}
m_widthScaleFactor = cvf::Math::clamp(m_widthScaleFactor(), 1, 10);
updateEditors();
}
updateParentPlotLayout();
}
else if (changedField == &m_visibleXRangeMin || changedField == &m_visibleXRangeMax)
{
@@ -241,6 +241,7 @@ void RimWellLogTrack::fieldChangedByUi(const caf::PdmFieldHandle* changedField,
m_wellLogTrackPlotWidget->replot();
m_isAutoScaleXEnabled = false;
updateEditors();
updateParentPlotLayout();
}
else if (changedField == &m_isAutoScaleXEnabled)
{
@@ -357,6 +358,23 @@ void RimWellLogTrack::fieldChangedByUi(const caf::PdmFieldHandle* changedField,
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimWellLogTrack::updateParentPlotLayout()
{
RimWellLogPlot* wellLogPlot;
this->firstAncestorOrThisOfType(wellLogPlot);
if (wellLogPlot)
{
RiuWellLogPlot* wellLogPlotViewer = dynamic_cast<RiuWellLogPlot*>(wellLogPlot->viewWidget());
if (wellLogPlotViewer)
{
wellLogPlotViewer->updateChildrenLayout();
}
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@@ -638,6 +656,23 @@ QString RimWellLogTrack::depthPlotTitle() const
return parent->depthPlotTitle();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
int RimWellLogTrack::widthScaleFactor() const
{
return m_widthScaleFactor();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimWellLogTrack::setWidthScaleFactor(int scaleFactor)
{
m_widthScaleFactor = scaleFactor;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimWellLogTrack::setFormationWellPath(RimWellPath* wellPath)
@@ -863,7 +898,10 @@ RimWellLogCurve* RimWellLogTrack::curveDefinitionFromCurve(const QwtPlotCurve* c
void RimWellLogTrack::defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering)
{
uiOrdering.add(&m_userName);
// Hidden option that may still be useful for testing: enables you to control the width of tracks.
#ifdef ENABLE_WIDTHWEIGHT_GUI
uiOrdering.add(&m_widthScaleFactor);
#endif
caf::PdmUiGroup* formationGroup = uiOrdering.addNewGroup("Zonation/Formation Names");
formationGroup->add(&m_showFormations);

View File

@@ -78,10 +78,12 @@ public:
void takeOutCurve(RimWellLogCurve* curve);
void deleteAllCurves();
size_t curveIndex(RimWellLogCurve* curve);
size_t curveCount() { return curves.size(); }
void setXAxisTitle(const QString& text);
size_t curveIndex(RimWellLogCurve* curve);
size_t curveCount() { return curves.size(); }
void setXAxisTitle(const QString& text);
QString depthPlotTitle() const;
int widthScaleFactor() const;
void setWidthScaleFactor(int scaleFactor);
void setFormationWellPath(RimWellPath* wellPath);
void setFormationSimWellName(const QString& simWellName);
@@ -128,6 +130,7 @@ public:
private:
virtual void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue) override;
void updateParentPlotLayout();
virtual QList<caf::PdmOptionItemInfo> calculateValueOptions(const caf::PdmFieldHandle* fieldNeedingOptions, bool * useOptionsOnly) override;
virtual caf::PdmFieldHandle* objectToggleField() override;
@@ -180,7 +183,7 @@ private:
caf::PdmField<int> m_formationBranchIndex;
caf::PdmField<caf::AppEnum<RigWellPathFormations::FormationLevel>> m_formationLevel;
caf::PdmField<bool> m_showformationFluids;
caf::PdmField<int> m_widthScaleFactor;
caf::PdmField<bool> m_formationBranchDetection;
bool m_formationsForCaseWithSimWellOnly;