#9092 WLP: show only axis for first and last track.

This commit is contained in:
Kristian Bendiksen
2022-08-10 08:39:03 +02:00
parent 80961161d2
commit b4bca2276f
4 changed files with 53 additions and 4 deletions

View File

@@ -767,6 +767,39 @@ void RimDepthTrackPlot::onPlotsReordered( const SignalEmitter* emitter )
recreatePlotWidgets();
loadDataAndUpdate();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RimDepthTrackPlot::isFirstVisibleTrack( RimWellLogTrack* track )
{
// Find first visible track
auto findFirstVisibleTrack = [this]() {
auto plots = visiblePlots();
if ( !plots.empty() ) return plots.front();
return static_cast<RimWellLogTrack*>( nullptr );
};
auto firstVisibleTrack = findFirstVisibleTrack();
return firstVisibleTrack && firstVisibleTrack == track;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RimDepthTrackPlot::isLastVisibleTrack( RimWellLogTrack* track )
{
// Find last visible track
auto findLastVisibleTrack = [this]() {
auto plots = visiblePlots();
if ( !plots.empty() ) return plots.back();
return static_cast<RimWellLogTrack*>( nullptr );
};
auto lastVisibleTrack = findLastVisibleTrack();
return lastVisibleTrack && lastVisibleTrack == track;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------

View File

@@ -146,6 +146,9 @@ public:
RiaDefines::DepthUnitType caseDepthUnit() const;
bool isFirstVisibleTrack( RimWellLogTrack* track );
bool isLastVisibleTrack( RimWellLogTrack* track );
protected:
QImage snapshotWindowContent() override;

View File

@@ -1290,13 +1290,21 @@ void RimWellLogTrack::onLoadDataAndUpdate()
if ( wellLogPlot->depthOrientation() == RimDepthTrackPlot::DepthOrientation::VERTICAL )
{
// Show depth axis only for the first track (on the left side)
bool isFirstTrack = wellLogPlot->isFirstVisibleTrack( this );
m_plotWidget->setAxisEnabled( QwtAxis::XTop, true );
m_plotWidget->setAxisEnabled( QwtAxis::XBottom, false );
m_plotWidget->setAxisEnabled( QwtAxis::YLeft, isFirstTrack );
m_plotWidget->setAxisEnabled( QwtAxis::YRight, false );
}
else
{
// Show depth axis only for the last track (on the bottom side)
bool isLastTrack = wellLogPlot->isLastVisibleTrack( this );
m_plotWidget->setAxisEnabled( QwtAxis::XTop, false );
m_plotWidget->setAxisEnabled( QwtAxis::XBottom, true );
m_plotWidget->setAxisEnabled( QwtAxis::XBottom, isLastTrack );
m_plotWidget->setAxisEnabled( QwtAxis::YLeft, true );
m_plotWidget->setAxisEnabled( QwtAxis::YRight, false );
}
}