mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Logarithmic curve support and renaming (#8546)
* Add test for both positive and negative numbers * Remove redundant sample count from parameter list * Propagate useLogarithmicScale * Renaming
This commit is contained in:
@@ -49,7 +49,7 @@ RiuPlotCurve::~RiuPlotCurve()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuPlotCurve::setSamplesValues( const std::vector<double>& xValues, const std::vector<double>& yValues )
|
||||
{
|
||||
setSamplesInPlot( xValues, yValues, static_cast<int>( xValues.size() ) );
|
||||
setSamplesInPlot( xValues, yValues );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -57,9 +57,9 @@ void RiuPlotCurve::setSamplesValues( const std::vector<double>& xValues, const s
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuPlotCurve::setSamplesFromXValuesAndYValues( const std::vector<double>& xValues,
|
||||
const std::vector<double>& yValues,
|
||||
bool isLogCurve )
|
||||
bool useLogarithmicScale )
|
||||
{
|
||||
computeValidIntervalsAndSetCurveData( xValues, yValues, isLogCurve );
|
||||
computeValidIntervalsAndSetCurveData( xValues, yValues, useLogarithmicScale );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -67,11 +67,11 @@ void RiuPlotCurve::setSamplesFromXValuesAndYValues( const std::vector<double>& x
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuPlotCurve::setSamplesFromDatesAndYValues( const std::vector<QDateTime>& dateTimes,
|
||||
const std::vector<double>& yValues,
|
||||
bool isLogCurve )
|
||||
bool useLogarithmicScale )
|
||||
{
|
||||
auto xValues = RiuPlotCurve::fromQDateTime( dateTimes );
|
||||
|
||||
computeValidIntervalsAndSetCurveData( xValues, yValues, isLogCurve );
|
||||
computeValidIntervalsAndSetCurveData( xValues, yValues, useLogarithmicScale );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -79,11 +79,11 @@ void RiuPlotCurve::setSamplesFromDatesAndYValues( const std::vector<QDateTime>&
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuPlotCurve::setSamplesFromTimeTAndYValues( const std::vector<time_t>& dateTimes,
|
||||
const std::vector<double>& yValues,
|
||||
bool isLogCurve )
|
||||
bool useLogarithmicScale )
|
||||
{
|
||||
auto xValues = RiuPlotCurve::fromTime_t( dateTimes );
|
||||
|
||||
computeValidIntervalsAndSetCurveData( xValues, yValues, isLogCurve );
|
||||
computeValidIntervalsAndSetCurveData( xValues, yValues, useLogarithmicScale );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -123,9 +123,9 @@ void RiuPlotCurve::setBlackAndWhiteLegendIcon( bool blackAndWhite )
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuPlotCurve::computeValidIntervalsAndSetCurveData( const std::vector<double>& xValues,
|
||||
const std::vector<double>& yValues,
|
||||
bool isLogCurve )
|
||||
bool useLogarithmicScale )
|
||||
{
|
||||
auto intervalsOfValidValues = RiaCurveDataTools::calculateIntervalsOfValidValues( yValues, isLogCurve );
|
||||
auto intervalsOfValidValues = RiaCurveDataTools::calculateIntervalsOfValidValues( yValues, useLogarithmicScale );
|
||||
|
||||
std::vector<double> validYValues;
|
||||
std::vector<double> validXValues;
|
||||
@@ -133,7 +133,7 @@ void RiuPlotCurve::computeValidIntervalsAndSetCurveData( const std::vector<doubl
|
||||
RiaCurveDataTools::getValuesByIntervals( yValues, intervalsOfValidValues, &validYValues );
|
||||
RiaCurveDataTools::getValuesByIntervals( xValues, intervalsOfValidValues, &validXValues );
|
||||
|
||||
setSamplesInPlot( validXValues, validYValues, static_cast<int>( validXValues.size() ) );
|
||||
setSamplesInPlot( validXValues, validYValues );
|
||||
|
||||
setLineSegmentStartStopIndices( RiaCurveDataTools::computePolyLineStartStopIndices( intervalsOfValidValues ) );
|
||||
}
|
||||
@@ -184,7 +184,7 @@ std::vector<double> RiuPlotCurve::fromTime_t( const std::vector<time_t>& timeSte
|
||||
void RiuPlotCurve::setSamplesFromXYErrorValues( const std::vector<double>& xValues,
|
||||
const std::vector<double>& yValues,
|
||||
const std::vector<double>& errorValues,
|
||||
bool isLogCurve,
|
||||
bool useLogarithmicScale,
|
||||
RiaCurveDataTools::ErrorAxis errorAxis )
|
||||
{
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user