24 vector<SplinePair> &xy)
const 28 Points::const_iterator itrP;
29 for (itrP = points.begin(); itrP != points.end(); itrP++) {
30 const Point &point = *itrP;
44 vector<SplinePair> &xy)
const 50 Points::const_iterator itrP;
51 for (itrP = points.begin(); itrP != points.end(); itrP++) {
52 const Point &point = *itrP;
60 linearToLog.
linearize (posGraph.y(), isLogYRadius)));
65 const vector<SplinePair> &xy,
66 double pointsInterval)
const 70 const double NUM_SMALLER_INTERVALS = 1000;
83 double integratedSeparation = 0;
84 QPointF posLast (xy [0].x(),
90 double tMin = t.front();
91 double tMax = t.back();
94 int iTLastInterval = 0;
95 for (
int iT = 0; iT < NUM_SMALLER_INTERVALS; iT++) {
97 double tIter = tMin + ((tMax - tMin) * iT) / (NUM_SMALLER_INTERVALS - 1.0);
101 QPointF posNew = QPointF (pairNew.
x(),
104 QPointF posDelta = posNew - posLast;
105 double integratedSeparationDelta = qSqrt (posDelta.x() * posDelta.x() + posDelta.y() * posDelta.y());
106 integratedSeparation += integratedSeparationDelta;
108 while (integratedSeparation >= pointsInterval) {
116 sInterp = double (pointsInterval) / double (integratedSeparation);
118 double tInterp = (1.0 - sInterp) * tLast + sInterp * tIter;
120 integratedSeparation -= pointsInterval;
123 ordinals.push_back (tInterp);
131 if (iTLastInterval < NUM_SMALLER_INTERVALS - 1) {
134 ordinals.push_back (tMax);
Cubic interpolation given independent and dependent value vectors.
SplinePair interpolateCoeff(double t) const
Return interpolated y for specified x.
double y() const
Get method for y.
double linearize(double value, bool isLog) const
Convert log coordinates to linear. This is a noop if the input is already linear.
#define LOG4CPP_INFO_S(logger)
Class that represents one digitized point. The screen-to-graph coordinate transformation is always ex...
QPointF posScreen() const
Accessor for screen position.
ExportValuesOrdinal ordinalsAtIntervalsGraph(const std::vector< double > &t, const std::vector< SplinePair > &xy, double pointsInterval) const
Perform the interpolation on the arrays loaded by the other methods.
double ordinal(ApplyHasCheck applyHasCheck=KEEP_HAS_CHECK) const
Get method for ordinal. Skip check if copying one instance to another.
void loadSplinePairsWithTransformation(const Points &points, const Transformation &transformation, bool isLogXTheta, bool isLogYRadius, std::vector< double > &t, std::vector< SplinePair > &xy) const
Load t (=ordinal) and xy (=screen position) spline pairs, converting screen coordinates to graph coor...
log4cpp::Category * mainCat
double x() const
Get method for x.
Warps log coordinates to make them linear before passing them to code that accepts only linear coordi...
ExportOrdinalsSmooth()
Single constructor.
QList< double > ExportValuesOrdinal
Single X/Y pair for cubic spline interpolation initialization and calculations.
void loadSplinePairsWithoutTransformation(const Points &points, std::vector< double > &t, std::vector< SplinePair > &xy) const
Load t (=ordinal) and xy (=screen position) spline pairs, without any conversion to graph coordinates...