21#ifndef jkqtpevaluatedfunctionbase_H
22#define jkqtpevaluatedfunctionbase_H
28#include "jkqtplotter/graphs/jkqtpscatter.h"
29#include "jkqtplotter/jkqtpgraphsbasestylingmixins.h"
30#include "jkqtplotter/jkqtplotter_imexport.h"
31#include "jkqtcommon/jkqtpgeometrytools.h"
88 virtual bool getXMinMax(
double& minx,
double& maxx,
double& smallestGreaterZero)
override;
90 virtual bool getYMinMax(
double& miny,
double& maxy,
double& smallestGreaterZero)
override;
93 virtual void setParams(
const QVector<double>& params);
143 void setParamsV(
double p1,
double p2,
double p3,
double p4,
double p5);
158 std::function<QPointF(
double)>
func;
base class for 2D plotter classes (used by the plotter widget JKQTPlotter)
Definition jkqtpbaseplotter.h:394
this class extends the QPainter
Definition jkqtpenhancedpainter.h:33
Base class for graph classes that evaluate a mathematical function (e.g. defined as a C-function),...
Definition jkqtpevaluatedfunctionbase.h:74
void setMinSamples(const unsigned int &__value)
the minimum number of points to evaluate the function at
const QVector< double > & getInternalParams() const
returns the currently set internal parameter vector
bool getDisplaySamplePoints() const
if true [default: off] display the points where the function has been sampled
JKQTPEvaluatedFunctionGraphBase(JKQTBasePlotter *parent=nullptr)
class constructor
void setMaxRefinementDegree(const unsigned int &__value)
the maximum number of recursive refinement steps
unsigned int maxRefinementDegree
the maximum number of recursive refinement steps
Definition jkqtpevaluatedfunctionbase.h:210
void setDataCleanupMaxAllowedAngleDegree(double __value)
in the clean-up step of plot-data creation, a point is removed from the data, if it caused its neighb...
void setParamsV(double p1, double p2, double p3)
set an internal parameter vector as function parameters, initialized with {p1,p2,p3}
void setParameterColumn(int __value)
if set, the values from this datatsore column are used for the parameters p1 , p2 ,...
virtual bool usesColumn(int c) const override
returns true if the given column is used by the graph
double slopeTolerance
the tolerance for the difference of two subsequent slopes
Definition jkqtpevaluatedfunctionbase.h:212
double getMinPixelPerSample() const
create one sample at least every minPixelPerSample pixels
unsigned int getMaxRefinementDegree() const
the maximum number of recursive refinement steps
bool displaySamplePoints
if true [default: off] display the points where the function has been sampled
Definition jkqtpevaluatedfunctionbase.h:219
virtual PlotFunctorSpec buildPlotFunctorSpec()=0
this function returns a functor that is used to generate the plot data in coordinate space,...
int getParameterColumn() const
if set, the values from this datatsore column are used for the parameters p1 , p2 ,...
unsigned int getMinSamples() const
the minimum number of points to evaluate the function at
QVector< QPointF > data
plot data calculated by createPlotData(), i.e. the datapoints to be plotted
Definition jkqtpevaluatedfunctionbase.h:200
virtual void createPlotData(bool collectParams=true)
fill the data array with data from the function plotFunction
void setParamsV(double p1, double p2, double p3, double p4)
set an internal parameter vector as function parameters, initialized with {p1,p2,p3,...
virtual bool getYMinMax(double &miny, double &maxy, double &smallestGreaterZero) override
get the maximum and minimum y-value of the graph
void setParamsV(double p1, double p2)
set an internal parameter vector as function parameters, initialized with {p1,p2}
double minPixelPerSample
create one sample at least every minPixelPerSample pixels
Definition jkqtpevaluatedfunctionbase.h:214
void setSlopeTolerance(double __value)
the tolerance for the difference of two subsequent slopes
void setDisplaySamplePoints(bool __value)
if true [default: off] display the points where the function has been sampled
virtual ~JKQTPEvaluatedFunctionGraphBase()
class destructor
virtual void collectParameters()
ensure that current function parameters for a plot function (which may stem from different sources,...
void setParameterColumn(size_t __value)
if set, the values from this datatsore column are used for the parameters p1 , p2 ,...
virtual void setParams(const QVector< double > ¶ms)
sets the params as a pointer to an internal COPY of the given vector (not the data of the vector,...
double getDataCleanupMaxAllowedAngleDegree() const
in the clean-up step of plot-data creation, a point is removed from the data, if it caused its neighb...
double getSlopeTolerance() const
the tolerance for the difference of two subsequent slopes
double dataCleanupMaxAllowedAngleDegree
in the clean-up step of plot-data creation, a point is removed from the data, if it caused its neighb...
Definition jkqtpevaluatedfunctionbase.h:217
void setParamsV(double p1)
set an internal parameter vector as function parameters, initialized with {p1}
JKQTPEvaluatedFunctionGraphBase(JKQTPlotter *parent)
class constructor
QVector< double > iparams
internal storage for the current function parameters for plotFunction (which may stem from different ...
Definition jkqtpevaluatedfunctionbase.h:197
void setCopiedParams(const double *params, int N)
sets the params from a copy of the given array of length N
QVector< double > & getInternalParams()
returns the currently set internal parameter vector
void setParamsV(double p1, double p2, double p3, double p4, double p5)
set an internal parameter vector as function parameters, initialized with {p1,p2,p3,...
int parameterColumn
if set, the values from this datatsore column are used for the parameters p1 , p2 ,...
Definition jkqtpevaluatedfunctionbase.h:194
void setMinPixelPerSample(double __value)
create one sample at least every minPixelPerSample pixels
virtual bool getXMinMax(double &minx, double &maxx, double &smallestGreaterZero) override
get the maximum and minimum x-value of the graph
void drawSamplePoints(JKQTPEnhancedPainter &painter, QColor graphColor)
draw all the sample points in data as small symbols
unsigned int minSamples
the minimum number of points to evaluate the function at
Definition jkqtpevaluatedfunctionbase.h:203
extends JKQTPEvaluatedFunctionGraphBase with some basic properties (e.g. function parameters) for a s...
Definition jkqtpevaluatedfunctionbase.h:232
void setErrorParameterColumn(int __value)
if set, the values from this datatsore column are used for the parameters p1 , p2 ,...
void setErrorParamsV(double p1, double p2, double p3, double p4, double p5)
set the internal error function parameters to {p1,p2,p3,p4,p5}
void setErrorParamsV(double p1, double p2)
set the internal error function parameters to {p1,p2}
virtual ~JKQTPEvaluatedFunctionWithErrorsGraphBase()
class destructor
void setErrorParamsV(double p1)
set the internal error function parameters to {p1}
void setErrorParamsV(double p1, double p2, double p3)
set the internal error function parameters to {p1,p2,p3}
virtual std::function< QPointF(double)> buildErrorFunctorSpec()=0
same as JKQTPEvaluatedFunctionGraphBase::buildPlotFunctorSpec(), but for error functions.
void setErrorParameterColumn(size_t __value)
if set, the values from this datatsore column are used for the parameters p1 , p2 ,...
JKQTPEvaluatedFunctionWithErrorsGraphBase(JKQTBasePlotter *parent=nullptr)
class constructor
int getErrorParameterColumn() const
if set, the values from this datatsore column are used for the parameters p1 , p2 ,...
virtual bool usesColumn(int c) const override
returns true if the given column is used by the graph
int errorParameterColumn
if set, the values from this datatsore column are used for the parameters p1 , p2 ,...
Definition jkqtpevaluatedfunctionbase.h:286
void setErrorParams(const QVector< double > &errorParams)
sets the error params as a pointer to an internal COPY of the given vector (not the data of the vecto...
QVector< double > & getInternalErrorParams()
returns the currently set internal parameter vector
void setErrorParamsV(double p1, double p2, double p3, double p4)
set the internal error function parameters to {p1,p2,p3,p4}
virtual void collectParameters() override
ensure that current function parameters for plotFunction (which may stem from different sources,...
const QVector< double > & getInternalErrorParams() const
returns the currently set internal parameter vector
JKQTPEvaluatedFunctionWithErrorsGraphBase(JKQTPlotter *parent)
class constructor
QVector< double > ierrorparams
internal storage for the current error function parameters for errorPlotFunction (which may stem from...
Definition jkqtpevaluatedfunctionbase.h:288
this virtual base class of the (data-column based) graphs, which are part of a JKQTPlotter plot and w...
Definition jkqtpgraphsbase.h:429
plotter widget for scientific plots (uses JKQTBasePlotter to do the actual drawing)
Definition jkqtplotter.h:364
#define JKQTPLOTTER_LIB_EXPORT
Definition jkqtplotter_imexport.h:89
specifies an internal plot functor
Definition jkqtpevaluatedfunctionbase.h:152
double range_start
lower bound for the dependent parameter variable of func
Definition jkqtpevaluatedfunctionbase.h:160
std::function< QPointF(double)> func
calculates the points on the function graph, in dependence on a dependent parameter variable,...
Definition jkqtpevaluatedfunctionbase.h:158
double range_end
upper bound for the dependent parameter variable of func
Definition jkqtpevaluatedfunctionbase.h:162