21#ifndef JKQTPGEOMETRYTOOLS_H_INCLUDED
22#define JKQTPGEOMETRYTOOLS_H_INCLUDED
23#include "jkqtcommon/jkqtcommon_imexport.h"
30#include <QPainterPath>
33#include <forward_list>
38#include "jkqtcommon/jkqtpmathtools.h"
39#include "jkqtcommon/jkqtpcodestructuring.h"
64 JKQTPAdaptiveFunctionGraphEvaluator(
const std::function<
double(
double)>& fx_,
const std::function<
double(
double)>& fy_,
unsigned int minSamples_=10,
unsigned int maxRefinementDegree_=5,
double slopeTolerance_=0.005,
double minPixelPerSample_=32);
77 JKQTPAdaptiveFunctionGraphEvaluator(
const std::function<QPointF(
double)>& fxy_,
unsigned int minSamples_=10,
unsigned int maxRefinementDegree_=5,
double slopeTolerance_=0.005,
double minPixelPerSample_=32);
84 QVector<QPointF>
evaluate(
double tmin=0.0,
double tmax=1.0)
const;
86 typedef std::forward_list<std::pair<double, QPointF>>
InternalList;
88 void refine(
InternalList& data, InternalList::iterator a, InternalList::iterator b,
unsigned int degree)
const;
91 std::function<double(
double)>
fx;
93 std::function<double(
double)>
fy;
95 std::function<QPointF(
double)>
fxy;
110 mutable std::random_device
rd;
114 mutable std::uniform_real_distribution<double>
dist;
158JKQTCOMMON_LIB_EXPORT QVector<QPointF>
JKQTPSplitEllipseIntoPoints(std::function<QPointF(QPointF)> fTransform,
double x,
double y,
double a,
double b,
double angle_start=0,
double angle_end=360,
double alpha=0, QPointF* x_start=
nullptr, QPointF* x_end=
nullptr, QPointF* x_start_notrafo=
nullptr, QPointF* x_end_notrafo=
nullptr);
adaptive drawing of a function graph, specified by two function and evaluated over a parameter rang...
Definition jkqtpgeometrytools.h:49
std::function< double(double)> fy
function
Definition jkqtpgeometrytools.h:93
std::uniform_real_distribution< double > dist
random number generation: distribution
Definition jkqtpgeometrytools.h:114
std::random_device rd
random number generation: device
Definition jkqtpgeometrytools.h:110
JKQTPAdaptiveFunctionGraphEvaluator(const std::function< QPointF(double)> &fxy_, unsigned int minSamples_=10, unsigned int maxRefinementDegree_=5, double slopeTolerance_=0.005, double minPixelPerSample_=32)
class constructor
std::forward_list< std::pair< double, QPointF > > InternalList
Definition jkqtpgeometrytools.h:86
std::function< double(double)> fx
function
Definition jkqtpgeometrytools.h:91
double minPixelPerSample
create one sample at least every minPixelPerSample pixels
Definition jkqtpgeometrytools.h:108
unsigned int minSamples
the minimum number of points to evaluate the function at
Definition jkqtpgeometrytools.h:97
JKQTPAdaptiveFunctionGraphEvaluator(const std::function< double(double)> &fx_, const std::function< double(double)> &fy_, unsigned int minSamples_=10, unsigned int maxRefinementDegree_=5, double slopeTolerance_=0.005, double minPixelPerSample_=32)
class constructor
double slopeTolerance
the tolerance for the difference of two subsequent slopes
Definition jkqtpgeometrytools.h:106
void refine(InternalList &data, InternalList::iterator a, InternalList::iterator b, unsigned int degree) const
refine (if necessary) the function graph between the two points a and b, working on the given list of...
QVector< QPointF > evaluate(double tmin=0.0, double tmax=1.0) const
evaluate the function specified in the constructor over the given parameter range tmin ....
unsigned int maxRefinementDegree
the maximum number of recursive refinement steps
Definition jkqtpgeometrytools.h:104
std::function< QPointF(double)> fxy
function
Definition jkqtpgeometrytools.h:95
std::mt19937 gen
random number generation: egenrator
Definition jkqtpgeometrytools.h:112