mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#9347 Well Log Plot : Add possibility to show depth axis in all tracks
This commit is contained in:
parent
1a5da47418
commit
3f9f337e64
@ -35,6 +35,15 @@ void caf::AppEnum<RiaDefines::PlotAxis>::setUp()
|
||||
|
||||
setDefault( RiaDefines::PlotAxis::PLOT_AXIS_LEFT );
|
||||
}
|
||||
|
||||
template <>
|
||||
void caf::AppEnum<RiaDefines::MultiPlotAxisVisibility>::setUp()
|
||||
{
|
||||
addItem( RiaDefines::MultiPlotAxisVisibility::ONE_VISIBLE, "ONE_VISIBLE", "One Axis Per Plot" );
|
||||
addItem( RiaDefines::MultiPlotAxisVisibility::ALL_VISIBLE, "ALL_VISIBLE", "All Axis Visible" );
|
||||
|
||||
setDefault( RiaDefines::MultiPlotAxisVisibility::ONE_VISIBLE );
|
||||
}
|
||||
}; // namespace caf
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -59,6 +59,12 @@ enum class Orientation
|
||||
VERTICAL
|
||||
};
|
||||
|
||||
enum class MultiPlotAxisVisibility
|
||||
{
|
||||
ONE_VISIBLE,
|
||||
ALL_VISIBLE
|
||||
};
|
||||
|
||||
double minimumDefaultValuePlot();
|
||||
double minimumDefaultLogValuePlot();
|
||||
double maximumDefaultValuePlot();
|
||||
|
@ -123,6 +123,9 @@ RimDepthTrackPlot::RimDepthTrackPlot()
|
||||
CAF_PDM_InitScriptableField( &m_isAutoScaleDepthEnabled, "AutoScaleDepthEnabled", true, "Auto Scale" );
|
||||
m_isAutoScaleDepthEnabled.uiCapability()->setUiHidden( true );
|
||||
|
||||
caf::AppEnum<RiaDefines::MultiPlotAxisVisibility> depthAxisVisibility = RiaDefines::MultiPlotAxisVisibility::ONE_VISIBLE;
|
||||
CAF_PDM_InitField( &m_depthAxisVisibility, "DepthAxisVisibility", depthAxisVisibility, "Axis Visibility" );
|
||||
|
||||
CAF_PDM_InitScriptableFieldNoDefault( &m_subTitleFontSize, "SubTitleFontSize", "Track Title Font Size" );
|
||||
CAF_PDM_InitScriptableFieldNoDefault( &m_axisTitleFontSize, "AxisTitleFontSize", "Axis Title Font Size" );
|
||||
CAF_PDM_InitScriptableFieldNoDefault( &m_axisValueFontSize, "AxisValueFontSize", "Axis Value Font Size" );
|
||||
@ -200,6 +203,7 @@ RimDepthTrackPlot& RimDepthTrackPlot::operator=( RimDepthTrackPlot&& rhs )
|
||||
m_maxVisibleDepth = rhs.m_maxVisibleDepth();
|
||||
m_depthAxisGridVisibility = rhs.m_depthAxisGridVisibility();
|
||||
m_isAutoScaleDepthEnabled = rhs.m_isAutoScaleDepthEnabled();
|
||||
m_depthAxisVisibility = rhs.m_depthAxisVisibility();
|
||||
|
||||
m_subTitleFontSize = rhs.m_subTitleFontSize();
|
||||
m_axisTitleFontSize = rhs.m_axisTitleFontSize();
|
||||
@ -473,6 +477,7 @@ void RimDepthTrackPlot::uiOrderingForDepthAxis( QString uiConfigName, caf::PdmUi
|
||||
uiOrdering.add( &m_minVisibleDepth );
|
||||
uiOrdering.add( &m_maxVisibleDepth );
|
||||
uiOrdering.add( &m_depthAxisGridVisibility );
|
||||
uiOrdering.add( &m_depthAxisVisibility );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -878,7 +883,7 @@ void RimDepthTrackPlot::fieldChangedByUi( const caf::PdmFieldHandle* changedFiel
|
||||
m_isAutoScaleDepthEnabled = true;
|
||||
onLoadDataAndUpdate();
|
||||
}
|
||||
else if ( changedField == &m_depthOrientation )
|
||||
else if ( changedField == &m_depthOrientation || changedField == &m_depthAxisVisibility )
|
||||
{
|
||||
onLoadDataAndUpdate();
|
||||
}
|
||||
@ -1214,6 +1219,22 @@ void RimDepthTrackPlot::setDepthOrientation( DepthOrientation depthOrientation )
|
||||
m_depthOrientation = depthOrientation;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RiaDefines::MultiPlotAxisVisibility RimDepthTrackPlot::depthAxisVisibility() const
|
||||
{
|
||||
return m_depthAxisVisibility();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimDepthTrackPlot::setDepthAxisVisibility( RiaDefines::MultiPlotAxisVisibility axisVisibility )
|
||||
{
|
||||
m_depthAxisVisibility = axisVisibility;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -20,6 +20,8 @@
|
||||
#pragma once
|
||||
|
||||
#include "RiaDefines.h"
|
||||
#include "RiaPlotDefines.h"
|
||||
|
||||
#include "RimAbstractPlotCollection.h"
|
||||
#include "RimEnsembleWellLogStatistics.h"
|
||||
#include "RimPlot.h"
|
||||
@ -107,6 +109,9 @@ public:
|
||||
RimDepthTrackPlot::DepthOrientation depthOrientation() const;
|
||||
void setDepthOrientation( RimDepthTrackPlot::DepthOrientation depthOrientation );
|
||||
|
||||
RiaDefines::MultiPlotAxisVisibility depthAxisVisibility() const;
|
||||
void setDepthAxisVisibility( RiaDefines::MultiPlotAxisVisibility axisVisibility );
|
||||
|
||||
RiuPlotAxis depthAxis() const;
|
||||
RiuPlotAxis valueAxis() const;
|
||||
RiuPlotAxis annotationAxis() const;
|
||||
@ -189,12 +194,16 @@ protected:
|
||||
bool m_commonDataSourceEnabled;
|
||||
|
||||
caf::PdmField<QString> m_plotWindowTitle;
|
||||
|
||||
// Depth axis
|
||||
caf::PdmField<caf::AppEnum<DepthTypeEnum>> m_depthType;
|
||||
caf::PdmField<caf::AppEnum<RiaDefines::DepthUnitType>> m_depthUnit;
|
||||
caf::PdmField<double> m_minVisibleDepth;
|
||||
caf::PdmField<double> m_maxVisibleDepth;
|
||||
caf::PdmField<AxisGridEnum> m_depthAxisGridVisibility;
|
||||
caf::PdmField<bool> m_isAutoScaleDepthEnabled;
|
||||
caf::PdmField<caf::AppEnum<RiaDefines::MultiPlotAxisVisibility>> m_depthAxisVisibility;
|
||||
|
||||
caf::PdmField<caf::FontTools::RelativeSizeEnum> m_subTitleFontSize;
|
||||
caf::PdmField<caf::FontTools::RelativeSizeEnum> m_axisTitleFontSize;
|
||||
caf::PdmField<caf::FontTools::RelativeSizeEnum> m_axisValueFontSize;
|
||||
|
@ -1287,19 +1287,30 @@ void RimWellLogTrack::updateAxesVisibility( RimDepthTrackPlot::DepthOrientation
|
||||
|
||||
bool needUpdate = false;
|
||||
|
||||
RimDepthTrackPlot* wellLogPlot;
|
||||
this->firstAncestorOrThisOfTypeAsserted( wellLogPlot );
|
||||
|
||||
bool showFirstTrack =
|
||||
wellLogPlot->depthAxisVisibility() == RiaDefines::MultiPlotAxisVisibility::ALL_VISIBLE ||
|
||||
( isFirstTrack && wellLogPlot->depthAxisVisibility() == RiaDefines::MultiPlotAxisVisibility::ONE_VISIBLE );
|
||||
|
||||
bool showLastTrack =
|
||||
wellLogPlot->depthAxisVisibility() == RiaDefines::MultiPlotAxisVisibility::ALL_VISIBLE ||
|
||||
( isLastTrack && wellLogPlot->depthAxisVisibility() == RiaDefines::MultiPlotAxisVisibility::ONE_VISIBLE );
|
||||
|
||||
if ( orientation == RimDepthTrackPlot::DepthOrientation::VERTICAL )
|
||||
{
|
||||
// Show depth axis only for the first track (on the left side)
|
||||
needUpdate |= setAxisVisible( QwtAxis::XBottom, false );
|
||||
needUpdate |= setAxisVisible( QwtAxis::XTop, true );
|
||||
needUpdate |= setAxisVisible( QwtAxis::YLeft, isFirstTrack );
|
||||
needUpdate |= setAxisVisible( QwtAxis::YLeft, showFirstTrack );
|
||||
needUpdate |= setAxisVisible( QwtAxis::YRight, false );
|
||||
}
|
||||
else
|
||||
{
|
||||
// Show depth axis only for the last track (on the bottom side)
|
||||
needUpdate |= setAxisVisible( QwtAxis::XTop, false );
|
||||
needUpdate |= setAxisVisible( QwtAxis::XBottom, isLastTrack );
|
||||
needUpdate |= setAxisVisible( QwtAxis::XBottom, showLastTrack );
|
||||
needUpdate |= setAxisVisible( QwtAxis::YLeft, true );
|
||||
needUpdate |= setAxisVisible( QwtAxis::YRight, false );
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user