mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#5473 Improve WBS plot layout by removing gaps and tweaking column spans
This commit is contained in:
@@ -214,7 +214,7 @@ void RicNewWellBoreStabilityPlotFeature::createFormationTrack( RimWellBoreStabil
|
|||||||
formationTrack->setFormationCase( geoMechCase );
|
formationTrack->setFormationCase( geoMechCase );
|
||||||
formationTrack->setAnnotationType( RiuPlotAnnotationTool::FORMATION_ANNOTATIONS );
|
formationTrack->setAnnotationType( RiuPlotAnnotationTool::FORMATION_ANNOTATIONS );
|
||||||
formationTrack->setVisibleXRange( 0.0, 0.0 );
|
formationTrack->setVisibleXRange( 0.0, 0.0 );
|
||||||
formationTrack->setColSpan( RimPlot::ONE );
|
formationTrack->setColSpan( RimPlot::TWO );
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@@ -229,9 +229,11 @@ void RicNewWellBoreStabilityPlotFeature::createCasingShoeTrack( RimWellBoreStabi
|
|||||||
casingShoeTrack->setFormationWellPath( wellPath );
|
casingShoeTrack->setFormationWellPath( wellPath );
|
||||||
casingShoeTrack->setFormationCase( geoMechCase );
|
casingShoeTrack->setFormationCase( geoMechCase );
|
||||||
casingShoeTrack->setAnnotationType( RiuPlotAnnotationTool::FORMATION_ANNOTATIONS );
|
casingShoeTrack->setAnnotationType( RiuPlotAnnotationTool::FORMATION_ANNOTATIONS );
|
||||||
casingShoeTrack->setAnnotationDisplay( RiuPlotAnnotationTool::DARK_LINES );
|
casingShoeTrack->setAnnotationDisplay( RiuPlotAnnotationTool::COLOR_SHADING_AND_LINES );
|
||||||
casingShoeTrack->setShowRegionLabels( false );
|
casingShoeTrack->setShowRegionLabels( false );
|
||||||
casingShoeTrack->setShowWellPathAttributes( true );
|
casingShoeTrack->setShowWellPathAttributes( true );
|
||||||
|
casingShoeTrack->setShowBothSidesOfWell( false );
|
||||||
|
casingShoeTrack->setAnnotationTransparency( 90 );
|
||||||
casingShoeTrack->setWellPathAttributesSource( wellPath );
|
casingShoeTrack->setWellPathAttributesSource( wellPath );
|
||||||
casingShoeTrack->setVisibleXRange( 0.0, 0.0 );
|
casingShoeTrack->setVisibleXRange( 0.0, 0.0 );
|
||||||
casingShoeTrack->setAutoScaleXEnabled( true );
|
casingShoeTrack->setAutoScaleXEnabled( true );
|
||||||
@@ -303,7 +305,7 @@ void RicNewWellBoreStabilityPlotFeature::createStabilityCurvesTrack( RimWellBore
|
|||||||
|
|
||||||
plot );
|
plot );
|
||||||
stabilityCurvesTrack->setVisibleXRange( 0.0, 2.5 );
|
stabilityCurvesTrack->setVisibleXRange( 0.0, 2.5 );
|
||||||
stabilityCurvesTrack->setColSpan( RimPlot::FIVE );
|
stabilityCurvesTrack->setColSpan( RimPlot::SIX );
|
||||||
stabilityCurvesTrack->setAutoScaleXEnabled( true );
|
stabilityCurvesTrack->setAutoScaleXEnabled( true );
|
||||||
stabilityCurvesTrack->setTickIntervals( 0.5, 0.1 );
|
stabilityCurvesTrack->setTickIntervals( 0.5, 0.1 );
|
||||||
stabilityCurvesTrack->setXAxisGridVisibility( RimWellLogPlot::AXIS_GRID_MAJOR_AND_MINOR );
|
stabilityCurvesTrack->setXAxisGridVisibility( RimWellLogPlot::AXIS_GRID_MAJOR_AND_MINOR );
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ void RimPlot::RowOrColSpanEnum::setUp()
|
|||||||
addItem( RimPlot::THREE, "THREE", "3" );
|
addItem( RimPlot::THREE, "THREE", "3" );
|
||||||
addItem( RimPlot::FOUR, "FOUR", "4" );
|
addItem( RimPlot::FOUR, "FOUR", "4" );
|
||||||
addItem( RimPlot::FIVE, "FIVE", "5" );
|
addItem( RimPlot::FIVE, "FIVE", "5" );
|
||||||
|
addItem( RimPlot::SIX, "SIX", "6" );
|
||||||
setDefault( RimPlot::ONE );
|
setDefault( RimPlot::ONE );
|
||||||
}
|
}
|
||||||
} // namespace caf
|
} // namespace caf
|
||||||
|
|||||||
@@ -53,7 +53,8 @@ public:
|
|||||||
TWO = 2,
|
TWO = 2,
|
||||||
THREE = 3,
|
THREE = 3,
|
||||||
FOUR = 4,
|
FOUR = 4,
|
||||||
FIVE = 5
|
FIVE = 5,
|
||||||
|
SIX = 6
|
||||||
};
|
};
|
||||||
using RowOrColSpanEnum = caf::AppEnum<RowOrColSpan>;
|
using RowOrColSpanEnum = caf::AppEnum<RowOrColSpan>;
|
||||||
|
|
||||||
|
|||||||
@@ -182,6 +182,7 @@ void RiuQwtPlotWidget::setAxisFontsAndAlignment( QwtPlot::Axis axis,
|
|||||||
axisTitle.setRenderFlags( alignment | Qt::TextWordWrap );
|
axisTitle.setRenderFlags( alignment | Qt::TextWordWrap );
|
||||||
|
|
||||||
setAxisTitle( axis, axisTitle );
|
setAxisTitle( axis, axisTitle );
|
||||||
|
applyAxisTitleToQwt( axis );
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@@ -275,6 +276,7 @@ void RiuQwtPlotWidget::setAxisLabelsAndTicksEnabled( QwtPlot::Axis axis, bool en
|
|||||||
{
|
{
|
||||||
this->axisScaleDraw( axis )->enableComponent( QwtAbstractScaleDraw::Ticks, enable );
|
this->axisScaleDraw( axis )->enableComponent( QwtAbstractScaleDraw::Ticks, enable );
|
||||||
this->axisScaleDraw( axis )->enableComponent( QwtAbstractScaleDraw::Labels, enable );
|
this->axisScaleDraw( axis )->enableComponent( QwtAbstractScaleDraw::Labels, enable );
|
||||||
|
recalculateAxisExtents( axis );
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@@ -367,10 +369,14 @@ double RiuQwtPlotWidget::minorTickInterval( QwtPlot::Axis axis ) const
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
int RiuQwtPlotWidget::axisExtent( QwtPlot::Axis axis ) const
|
int RiuQwtPlotWidget::axisExtent( QwtPlot::Axis axis ) const
|
||||||
{
|
{
|
||||||
int lineExtent = 5;
|
int lineExtent = 0;
|
||||||
|
|
||||||
|
if ( this->axisScaleDraw( axis )->hasComponent( QwtAbstractScaleDraw::Ticks ) )
|
||||||
|
{
|
||||||
lineExtent += this->axisScaleDraw( axis )->maxTickLength();
|
lineExtent += this->axisScaleDraw( axis )->maxTickLength();
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( this->axisScaleDraw( axis )->hasComponent( QwtAbstractScaleDraw::Labels ) )
|
||||||
{
|
{
|
||||||
QFont tickLabelFont = axisFont( axis );
|
QFont tickLabelFont = axisFont( axis );
|
||||||
// Make space for a fairly long value label
|
// Make space for a fairly long value label
|
||||||
@@ -641,12 +647,8 @@ void RiuQwtPlotWidget::applyAxisTitleToQwt( QwtPlot::Axis axis )
|
|||||||
axisTitle.setText( titleToApply );
|
axisTitle.setText( titleToApply );
|
||||||
|
|
||||||
setAxisTitle( axis, axisTitle );
|
setAxisTitle( axis, axisTitle );
|
||||||
if ( axis == QwtPlot::yLeft || axis == QwtPlot::yRight )
|
|
||||||
{
|
|
||||||
axisScaleDraw( axis )->setMinimumExtent( axisExtent( axis ) );
|
|
||||||
setMinimumWidth( defaultMinimumWidth() + axisExtent( axis ) );
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
recalculateAxisExtents( axis );
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@@ -780,6 +782,19 @@ void RiuQwtPlotWidget::onAxisSelected( QwtScaleWidget* scale, bool toggleItemInS
|
|||||||
emit axisSelected( axisId, toggleItemInSelection );
|
emit axisSelected( axisId, toggleItemInSelection );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
void RiuQwtPlotWidget::recalculateAxisExtents( QwtPlot::Axis axis )
|
||||||
|
{
|
||||||
|
if ( axis == QwtPlot::yLeft || axis == QwtPlot::yRight )
|
||||||
|
{
|
||||||
|
int extent = axisExtent( axis );
|
||||||
|
axisScaleDraw( axis )->setMinimumExtent( extent );
|
||||||
|
setMinimumWidth( defaultMinimumWidth() + extent );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
|||||||
@@ -154,6 +154,7 @@ private:
|
|||||||
void highlightCurve( const QwtPlotCurve* closestCurve );
|
void highlightCurve( const QwtPlotCurve* closestCurve );
|
||||||
void resetCurveHighlighting();
|
void resetCurveHighlighting();
|
||||||
void onAxisSelected( QwtScaleWidget* scale, bool toggleItemInSelection );
|
void onAxisSelected( QwtScaleWidget* scale, bool toggleItemInSelection );
|
||||||
|
void recalculateAxisExtents( QwtPlot::Axis axis );
|
||||||
|
|
||||||
caf::UiStyleSheet createPlotStyleSheet() const;
|
caf::UiStyleSheet createPlotStyleSheet() const;
|
||||||
caf::UiStyleSheet createCanvasStyleSheet() const;
|
caf::UiStyleSheet createCanvasStyleSheet() const;
|
||||||
|
|||||||
Reference in New Issue
Block a user