#include <HermiteGrid1D.h>
Public Member Functions | |
HermiteGrid1D (const EvalCurve &crv, double start, double end) | |
Construct a HermiteGrid1D from a curve and a given interval. | |
HermiteGrid1D (const EvalCurve &crv, double param[], int n) | |
Construct a HermiteGrid1D from a curve and a set of parameter values. | |
~HermiteGrid1D () | |
Default destructor. | |
int | addKnot (const EvalCurve &crv, double knot) |
Add another sample (parameter, position, tangent) to the grid. | |
void | getSegment (int left, int right, double &spar, double &epar, Point bezcoef[4]) |
Calculate Bezier coefficients of the cubic curve interpolating the point and tangent values at grid nodes with indices "left" and "right". | |
std::vector< double > | getKnots () |
Return the grid parameters. | |
std::vector< Point > | getData () |
Return the sample values (positions and first derivatives). | |
int | dim () |
Return the spatial dimension. | |
int | size () |
Return the number of samples in the grid. |
It can be used to generate bezier curve segments obtained by Hermite interpolation of intervals between the sampled parameter values.
Definition at line 52 of file HermiteGrid1D.h.
Go::HermiteGrid1D::HermiteGrid1D | ( | const EvalCurve & | crv, | |
double | start, | |||
double | end | |||
) |
Construct a HermiteGrid1D from a curve and a given interval.
The grid will only contain the sampled values (position, derivative) for the first and last value of the interval.
crv | curve to sample | |
start | start of interval | |
end | end of interval |
Go::HermiteGrid1D::HermiteGrid1D | ( | const EvalCurve & | crv, | |
double | param[], | |||
int | n | |||
) |
Construct a HermiteGrid1D from a curve and a set of parameter values.
crv | curve to sample | |
param | array of strictly increasing parameters contained in the parameter domain of 'crv'. | |
n | number of elements in 'param[]'. |
int Go::HermiteGrid1D::addKnot | ( | const EvalCurve & | crv, | |
double | knot | |||
) |
Add another sample (parameter, position, tangent) to the grid.
Returns the index of the new knot (parameter value) in the sorted knot vector after insertion.
crv | curve to evaluate | |
knot | the new sample value (parameter value, knot) |
void Go::HermiteGrid1D::getSegment | ( | int | left, | |
int | right, | |||
double & | spar, | |||
double & | epar, | |||
Point | bezcoef[4] | |||
) |
Calculate Bezier coefficients of the cubic curve interpolating the point and tangent values at grid nodes with indices "left" and "right".
left | indicating grid node for start of curve segment | |
right | indicating grid node for end of curve segment | |
spar | start parameter of segment | |
epar | end parameter of segment | |
bezcoef | array of cubic Bezier coefficients |