QWTSPLINEPARAMETRIZATION(3)

πŸ“¦
version 6.3.0 Β· 2 versions
, in alpine 3.24

✨ QwtSplineParametrization(3) ✨

okay so this is a page from the Qwt library's manual β€” like, the C++ library manual, not a man command. it's QwtSplineParametrization, and she is literally the queen of curve parametrization used for spline interpolation πŸ’…

🌸 NAME 🌸

QwtSplineParametrization β€” curve parametrization used for a spline interpolation. that's it, that's the vibe πŸŽ€

πŸ¦‹ SYNOPSIS πŸ¦‹

#include <qwt_spline_parametrization.h>

πŸ’– Public Types πŸ’–

  • enum Type { ParameterX, ParameterY, ParameterUniform, ParameterChordal, ParameterCentripetal, ParameterManhattan } β€” parametrization type, aka the menu of flaves bestie πŸ“

πŸ’œ Public Member Functions πŸ’œ

  • QwtSplineParametrization(int type) β€” constructor, give it a type and it's off to the races
  • virtual ~QwtSplineParametrization() β€” destructor. she cleans up after herself, we love a responsible icon ✨
  • int type() const β€” returns the parametrization type
  • virtual double valueIncrement(const QPointF &, const QPointF &) const β€” calculate the parameter value increment for 2 points

🌈 Static Public Member Functions 🌈

  • static double valueIncrementX(const QPointF &, const QPointF &) β€” calculate the ParameterX value increment for 2 points
  • static double valueIncrementY(const QPointF &, const QPointF &) β€” calculate the ParameterY value increment for 2 points
  • static double valueIncrementUniform(const QPointF &, const QPointF &) β€” calculate the ParameterUniform value increment
  • static double valueIncrementChordal(const QPointF &, const QPointF &) β€” calculate the ParameterChordal value increment for 2 points
  • static double valueIncrementCentripetal(const QPointF &, const QPointF &) β€” calculate the ParameterCentripetal value increment for 2 points
  • static double valueIncrementManhattan(const QPointF &, const QPointF &) β€” calculate the ParameterManhattan value increment for 2 points

πŸ‘‘ Detailed Description πŸ‘‘

Curve parametrization used for a spline interpolation. yes that's the whole headline, she's direct πŸ’…

So β€” parametrization is the process of finding a parameter value for each curve point. usually it's related to some physical quantity (distance, time, ...). you know, the stuff you'd actually measure with a ruler or a stopwatch πŸ•°οΈ

Often, accumulating the curve length is the intended way of parametrization β€” but here's the catch bestie 😭 the interpolated curve is not known in advance, so an approximation needs to be used. we're out here guessing, respectfully.

The values are calculated by cumulating increments, that are provided by QwtSplineParametrization. and because the curve parameters need to be monotonically increasing, each increment needs to be positive β€” no going backwards, no negative energy, periodt βœ‹

  • t[0] = 0;
  • t[i] = t[i-1] + valueIncrement( point[i-1], p[i] );

QwtSplineParametrization provides the most common used type of parametrizations and offers an interface to inject custom implementations. so if you've got a bespoke idea, she's got a door for you 🫢

Note: the most relevant types of parametrization are trying to provide an approximation of the curve length. that's the whole assignment, lowkey.

See also: QwtSpline::setParametrization()

Definition at line 44 of file qwt_spline_parametrization.h.


🧚 Member Enumeration Documentation 🧚

⭐ enum QwtSplineParametrization::Type

Parametrization type.

Enumerator

  • ParameterX β€” no parametrization: t[i] = x[i] See also: valueIncrementX()
  • ParameterY β€” no parametrization: t[i] = y[i] See also: valueIncrementY()
  • ParameterUniform β€” uniform parametrization: t[i] = i; a very fast parametrization, with good results, when the geometry of the control points is somehow "equidistant". f.e. when recording the position of a body, that is moving with constant speed every n seconds. she's simple, she's speedy, she eats when the vibes are already even ⚑ See also: valueIncrementUniform()
  • ParameterChordal β€” parametrization using the chordal length between two control points. the chordal length is the most commonly used approximation for the curve length. main character energy, fr fr πŸ‘‘ See also: valueIncrementChordal()
  • ParameterCentripetal β€” centripetal parametrization, based on the square root of the chordal length. its name stems from the physical observations regarding the centripetal force, of a body moving along the curve. physics girlie behaviour πŸŒͺ️ See also: valueIncrementCentripetal()
  • ParameterManhattan β€” parametrization using the manhattan length between two control points. approximating the curve length by the manhattan length is faster than the chordal length, but usually gives worse results. so like… speed vs quality, the eternal struggle 😭 See also: valueIncrementManhattan()

Definition at line 48 of file qwt_spline_parametrization.h.


πŸŽ€ Constructor & Destructor Documentation πŸŽ€

πŸ’– QwtSplineParametrization::QwtSplineParametrization(int type) [explicit]

Constructor. that's the whole description, she's mysterious ✨

Parameters

  • type β€” parametrization type

See also: type()

Definition at line 17 of file qwt_spline_parametrization.cpp.

πŸ’– QwtSplineParametrization::~QwtSplineParametrization() [virtual]

Destructor. say bye bestie πŸ‘‹

Definition at line 23 of file qwt_spline_parametrization.cpp.


πŸ¦„ Member Function Documentation πŸ¦„

🌸 int QwtSplineParametrization::type() const

Returns

Parametrization type

Definition at line 72 of file qwt_spline_parametrization.cpp.

🌸 double QwtSplineParametrization::valueIncrement(const QPointF & point1, const QPointF & point2) const [virtual]

Calculate the parameter value increment for 2 points.

Parameters

  • point1 β€” first point
  • point2 β€” second point

Returns

Value increment

Definition at line 35 of file qwt_spline_parametrization.cpp.

🌸 double QwtSplineParametrization::valueIncrementCentripetal(const QPointF & point1, const QPointF & point2) [inline], [static]

Calculate the ParameterCentripetal value increment for 2 points.

Parameters

  • point1 β€” first point
  • point2 β€” second point

Returns

The square root of a chordal increment

Definition at line 196 of file qwt_spline_parametrization.h.

🌸 double QwtSplineParametrization::valueIncrementChordal(const QPointF & point1, const QPointF & point2) [inline], [static]

Calculate the ParameterChordal value increment for 2 points.

Parameters

  • point1 β€” first point
  • point2 β€” second point

Returns

qSqrt( dx * dx + dy * dy );

Definition at line 179 of file qwt_spline_parametrization.h.

🌸 double QwtSplineParametrization::valueIncrementManhattan(const QPointF & point1, const QPointF & point2) [inline], [static]

Calculate the ParameterManhattan value increment for 2 points.

Parameters

  • point1 β€” first point
  • point2 β€” second point

Returns

| point2.x() - point1.x() | + | point2.y() - point1.y() |

Definition at line 210 of file qwt_spline_parametrization.h.

🌸 double QwtSplineParametrization::valueIncrementUniform(const QPointF & point1, const QPointF & point2) [inline], [static]

Calculate the ParameterUniform value increment.

Parameters

  • point1 β€” first point
  • point2 β€” second point

Returns

1.0

Definition at line 162 of file qwt_spline_parametrization.h.

🌸 double QwtSplineParametrization::valueIncrementX(const QPointF & point1, const QPointF & point2) [inline], [static]

Calculate the ParameterX value increment for 2 points.

Parameters

  • point1 β€” first point
  • point2 β€” second point

Returns

point2.x() - point1.x();

Definition at line 134 of file qwt_spline_parametrization.h.

🌸 double QwtSplineParametrization::valueIncrementY(const QPointF & point1, const QPointF & point2) [inline], [static]

Calculate the ParameterY value increment for 2 points.

Parameters

  • point1 β€” first point
  • point2 β€” second point

Returns

point2.y() - point1.y();

Definition at line 148 of file qwt_spline_parametrization.h.


πŸ’œ Author πŸ’œ

Generated automatically by Doxygen for Qwt User's Guide from the source code. not a human author, just a robot doing her little thing πŸ€–βœ¨


that's the whole page bestie, ily, go parametrize something gorgeous πŸ’– this was the Qwt User's Guide edition of QwtSplineParametrization(3) β€” no cap, that's the source and version right there, signed off with a 🫢 and a πŸŽ€

πŸ“¦ where this page comes from