mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Curve Style : Add support for curve fitting for non-solid line styles
This commit is contained in:
@@ -35,6 +35,7 @@
|
||||
#include "qwt_point_mapper.h"
|
||||
#include "qwt_scale_map.h"
|
||||
#include "qwt_symbol.h"
|
||||
#include "qwt_weeding_curve_fitter.h"
|
||||
|
||||
#include <cmath>
|
||||
#include <limits>
|
||||
@@ -520,3 +521,27 @@ RiuPlotCurveSymbol* RiuQwtPlotCurve::createSymbol( RiuPlotCurveSymbol::PointSymb
|
||||
{
|
||||
return new RiuQwtSymbol( symbol );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuQwtPlotCurve::setCurveFittingTolerance( double tolerance )
|
||||
{
|
||||
bool enableCurveFitting = ( tolerance > 0.0 );
|
||||
if ( !enableCurveFitting )
|
||||
{
|
||||
setCurveAttribute( QwtPlotCurve::Fitted, false );
|
||||
}
|
||||
else
|
||||
{
|
||||
auto cf = dynamic_cast<QwtWeedingCurveFitter*>( curveFitter() );
|
||||
if ( !cf )
|
||||
{
|
||||
cf = new QwtWeedingCurveFitter;
|
||||
setCurveFitter( cf );
|
||||
}
|
||||
setCurveAttribute( QwtPlotCurve::Fitted, true );
|
||||
|
||||
cf->setTolerance( tolerance );
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user