Skip to content

Commit

Permalink
Cleanup code
Browse files Browse the repository at this point in the history
  • Loading branch information
magnesj committed Sep 14, 2024
1 parent 16900d5 commit eb31b22
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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" );
Expand Down Expand Up @@ -155,13 +161,6 @@ RiuRelativePermeabilityPlotPanel::RiuRelativePermeabilityPlotPanel( QWidget* par
plotUiSelectedCurves();
}

//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RiuRelativePermeabilityPlotPanel::~RiuRelativePermeabilityPlotPanel()
{
}

//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
Expand Down Expand Up @@ -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<int>( curve.saturationVals.size() ) );

qwtCurve->setTitle( curve.name.c_str() );

Expand Down Expand Up @@ -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 );
Expand All @@ -405,7 +404,7 @@ void RiuRelativePermeabilityPlotPanel::plotCurvesInQwt( RiaDefines::EclipseUnitS
{
QwtAxisId relatedYAxis( QwtAxis::YRight, 0 );

qwtCurve->QwtPlotCurve::setYAxis( relatedYAxis );
qwtCurve->setYAxis( relatedYAxis );
shouldEnableRightYAxis = true;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ class RiuRelativePermeabilityPlotPanel : public QWidget

public:
RiuRelativePermeabilityPlotPanel( QWidget* parent );
~RiuRelativePermeabilityPlotPanel() override;

void setPlotData( RiaDefines::EclipseUnitSystem unitSystem,
const std::vector<RigFlowDiagSolverInterface::RelPermCurve>& relPermCurves,
Expand Down

0 comments on commit eb31b22

Please sign in to comment.