From eb31b223a5921ea1e2eabf53d549e5a10dd37ea3 Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Sat, 14 Sep 2024 15:59:40 +0200 Subject: [PATCH] Cleanup code --- .../RiuRelativePermeabilityPlotPanel.cpp | 25 +++++++++---------- .../RiuRelativePermeabilityPlotPanel.h | 1 - 2 files changed, 12 insertions(+), 14 deletions(-) diff --git a/ApplicationLibCode/UserInterface/RiuRelativePermeabilityPlotPanel.cpp b/ApplicationLibCode/UserInterface/RiuRelativePermeabilityPlotPanel.cpp index 1a167a52012..7de71869fb9 100644 --- a/ApplicationLibCode/UserInterface/RiuRelativePermeabilityPlotPanel.cpp +++ b/ApplicationLibCode/UserInterface/RiuRelativePermeabilityPlotPanel.cpp @@ -27,14 +27,12 @@ #include "RiuDockedQwtPlot.h" #include "RiuGuiTheme.h" #include "RiuPlotCurveSymbol.h" -#include "RiuQwtPlotCurve.h" #include "RiuQwtPlotTools.h" #include "RiuQwtSymbol.h" #include "RiuRelativePermeabilityPlotUpdater.h" #include "RiuTextDialog.h" #include "cvfAssert.h" -#include "cvfTrace.h" #include "qwt_legend.h" #include "qwt_plot.h" @@ -89,6 +87,14 @@ RiuRelativePermeabilityPlotPanel::RiuRelativePermeabilityPlotPanel( QWidget* par , m_swat( HUGE_VAL ) , m_sgas( HUGE_VAL ) , m_plotUpdater( new RiuRelativePermeabilityPlotUpdater( this ) ) + , m_qwtPlot( nullptr ) + , m_selectedCurvesButtonGroup( nullptr ) + , m_groupBox( nullptr ) + , m_logarithmicScaleKrAxisCheckBox( nullptr ) + , m_showUnscaledCheckBox( nullptr ) + , m_fixedXAxisCheckBox( nullptr ) + , m_fixedLeftYAxisCheckBox( nullptr ) + { m_qwtPlot = new RelPermQwtPlot( this ); m_qwtPlot->setProperty( "qss-class", "RelPermPlot" ); @@ -155,13 +161,6 @@ RiuRelativePermeabilityPlotPanel::RiuRelativePermeabilityPlotPanel( QWidget* par plotUiSelectedCurves(); } -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -RiuRelativePermeabilityPlotPanel::~RiuRelativePermeabilityPlotPanel() -{ -} - //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- @@ -352,11 +351,11 @@ void RiuRelativePermeabilityPlotPanel::plotCurvesInQwt( RiaDefines::EclipseUnitS plotOnWhichYAxis = RIGHT_YAXIS; } - RiuQwtPlotCurve* qwtCurve = new RiuQwtPlotCurve( nullptr, curve.name.c_str() ); + QwtPlotCurve* qwtCurve = new QwtPlotCurve( curve.name.c_str() ); CVF_ASSERT( curve.saturationVals.size() == curve.yVals.size() ); const bool includePositiveValuesOnly = ( logScaleLeftAxis && plotOnWhichYAxis == LEFT_YAXIS ); - qwtCurve->setSamplesFromXValuesAndYValues( curve.saturationVals, curve.yVals, includePositiveValuesOnly ); + qwtCurve->setSamples( curve.saturationVals.data(), curve.yVals.data(), static_cast( curve.saturationVals.size() ) ); qwtCurve->setTitle( curve.name.c_str() ); @@ -390,7 +389,7 @@ void RiuRelativePermeabilityPlotPanel::plotCurvesInQwt( RiaDefines::EclipseUnitS const QPen curvePen( QBrush(), 1, penStyle ); qwtCurve->setPen( curvePen ); - RiuQwtSymbol* curveSymbol = new RiuQwtSymbol( RiuPlotCurveSymbol::SYMBOL_ELLIPSE ); + auto* curveSymbol = new RiuQwtSymbol( RiuPlotCurveSymbol::SYMBOL_ELLIPSE ); curveSymbol->setSize( 6, 6 ); curveSymbol->setBrush( Qt::NoBrush ); qwtCurve->setSymbol( curveSymbol ); @@ -405,7 +404,7 @@ void RiuRelativePermeabilityPlotPanel::plotCurvesInQwt( RiaDefines::EclipseUnitS { QwtAxisId relatedYAxis( QwtAxis::YRight, 0 ); - qwtCurve->QwtPlotCurve::setYAxis( relatedYAxis ); + qwtCurve->setYAxis( relatedYAxis ); shouldEnableRightYAxis = true; } diff --git a/ApplicationLibCode/UserInterface/RiuRelativePermeabilityPlotPanel.h b/ApplicationLibCode/UserInterface/RiuRelativePermeabilityPlotPanel.h index c45a90ca9b5..00587094275 100644 --- a/ApplicationLibCode/UserInterface/RiuRelativePermeabilityPlotPanel.h +++ b/ApplicationLibCode/UserInterface/RiuRelativePermeabilityPlotPanel.h @@ -46,7 +46,6 @@ class RiuRelativePermeabilityPlotPanel : public QWidget public: RiuRelativePermeabilityPlotPanel( QWidget* parent ); - ~RiuRelativePermeabilityPlotPanel() override; void setPlotData( RiaDefines::EclipseUnitSystem unitSystem, const std::vector& relPermCurves,