mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#3098 Show depth axis only for left-most plot. They all share the same depth axis anyway.
This commit is contained in:
@@ -628,6 +628,16 @@ void RimWellLogTrack::setXAxisTitle(const QString& text)
|
|||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
QString RimWellLogTrack::depthPlotTitle() const
|
||||||
|
{
|
||||||
|
RimWellLogPlot* parent;
|
||||||
|
this->firstAncestorOrThisOfTypeAsserted(parent);
|
||||||
|
|
||||||
|
return parent->depthPlotTitle();
|
||||||
|
}
|
||||||
|
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RimWellLogTrack::setFormationWellPath(RimWellPath* wellPath)
|
void RimWellLogTrack::setFormationWellPath(RimWellPath* wellPath)
|
||||||
|
|||||||
@@ -81,6 +81,7 @@ public:
|
|||||||
size_t curveIndex(RimWellLogCurve* curve);
|
size_t curveIndex(RimWellLogCurve* curve);
|
||||||
size_t curveCount() { return curves.size(); }
|
size_t curveCount() { return curves.size(); }
|
||||||
void setXAxisTitle(const QString& text);
|
void setXAxisTitle(const QString& text);
|
||||||
|
QString depthPlotTitle() const;
|
||||||
|
|
||||||
void setFormationWellPath(RimWellPath* wellPath);
|
void setFormationWellPath(RimWellPath* wellPath);
|
||||||
void setFormationSimWellName(const QString& simWellName);
|
void setFormationSimWellName(const QString& simWellName);
|
||||||
|
|||||||
@@ -319,6 +319,8 @@ void RiuWellLogPlot::placeChildWidgets(int height, int width)
|
|||||||
int trackCount = m_trackPlots.size();
|
int trackCount = m_trackPlots.size();
|
||||||
CVF_ASSERT(m_legends.size() == trackCount);
|
CVF_ASSERT(m_legends.size() == trackCount);
|
||||||
|
|
||||||
|
const int trackPadding = 4;
|
||||||
|
|
||||||
int visibleTrackCount = 0;
|
int visibleTrackCount = 0;
|
||||||
for (int tIdx = 0; tIdx < trackCount; ++tIdx)
|
for (int tIdx = 0; tIdx < trackCount; ++tIdx)
|
||||||
{
|
{
|
||||||
@@ -366,9 +368,8 @@ void RiuWellLogPlot::placeChildWidgets(int height, int width)
|
|||||||
realTrackWidth += 1;
|
realTrackWidth += 1;
|
||||||
--trackWidthExtra;
|
--trackWidthExtra;
|
||||||
}
|
}
|
||||||
int realLegendWidth = std::max(realTrackWidth, m_legends[tIdx]->sizeHint().width());
|
m_legends[tIdx]->setGeometry(trackX + trackPadding, titleHeight, realTrackWidth - 2 * trackPadding, maxLegendHeight);
|
||||||
m_legends[tIdx]->setGeometry(trackX, titleHeight, realLegendWidth, maxLegendHeight);
|
m_trackPlots[tIdx]->setGeometry(trackX + trackPadding, titleHeight + maxLegendHeight, realTrackWidth - 2 * trackPadding, trackHeight);
|
||||||
m_trackPlots[tIdx]->setGeometry(trackX, titleHeight + maxLegendHeight, realTrackWidth, trackHeight);
|
|
||||||
|
|
||||||
trackX += realTrackWidth;
|
trackX += realTrackWidth;
|
||||||
}
|
}
|
||||||
@@ -398,16 +399,19 @@ void RiuWellLogPlot::updateChildrenLayout()
|
|||||||
|
|
||||||
|
|
||||||
int trackCount = m_trackPlots.size();
|
int trackCount = m_trackPlots.size();
|
||||||
|
int numTracksAlreadyShown = 0;
|
||||||
for (int tIdx = 0; tIdx < trackCount; ++tIdx)
|
for (int tIdx = 0; tIdx < trackCount; ++tIdx)
|
||||||
{
|
{
|
||||||
if (m_trackPlots[tIdx]->isVisible())
|
if (m_trackPlots[tIdx]->isVisible())
|
||||||
{
|
{
|
||||||
m_legends[tIdx]->show();
|
m_legends[tIdx]->show();
|
||||||
|
m_trackPlots[tIdx]->enableVerticalAxisLabelsAndTitle(numTracksAlreadyShown == 0);
|
||||||
|
numTracksAlreadyShown++;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
m_legends[tIdx]->hide();
|
m_legends[tIdx]->hide();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
placeChildWidgets(this->height(), this->width());
|
placeChildWidgets(this->height(), this->width());
|
||||||
|
|||||||
@@ -261,3 +261,17 @@ bool RiuWellLogTrack::isRimTrackVisible()
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
void RiuWellLogTrack::enableVerticalAxisLabelsAndTitle(bool enable)
|
||||||
|
{
|
||||||
|
QString depthAxisTitle("");
|
||||||
|
if (enable && m_plotTrackDefinition)
|
||||||
|
{
|
||||||
|
depthAxisTitle = m_plotTrackDefinition->depthPlotTitle();
|
||||||
|
}
|
||||||
|
this->setAxisTitle(QwtPlot::yLeft, depthAxisTitle);
|
||||||
|
this->axisScaleDraw(QwtPlot::yLeft)->enableComponent(
|
||||||
|
QwtAbstractScaleDraw::Labels, enable);
|
||||||
|
}
|
||||||
|
|||||||
@@ -52,6 +52,7 @@ public:
|
|||||||
void setXRange(double min, double max);
|
void setXRange(double min, double max);
|
||||||
|
|
||||||
bool isRimTrackVisible();
|
bool isRimTrackVisible();
|
||||||
|
void enableVerticalAxisLabelsAndTitle(bool enable);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual bool eventFilter(QObject* watched, QEvent* event);
|
virtual bool eventFilter(QObject* watched, QEvent* event);
|
||||||
|
|||||||
Reference in New Issue
Block a user