#include <HermiteGrid1DMulti.h>
Public Member Functions | |
HermiteGrid1DMulti (EvalCurveSet &surf, double start, double end, std::vector< int > dims) | |
Construct a HermiteGrid1DMulti from a set of related curves (represented by a EvalCurveSet) and a given interval. | |
HermiteGrid1DMulti (EvalCurveSet &surf, double param[], int n, std::vector< int > dims) | |
Construct a HermiteGrid1DMulti from a set of related curves (represented by a EvalCurveSet) and a set of parameter values. | |
~HermiteGrid1DMulti () | |
Default destructor. | |
int | addKnot (EvalCurveSet &surf, double knot) |
Add another sample (parameter, positions, tangents) to the grid. | |
void | getSegment (int left, int right, double &spar, double &epar, std::vector< std::vector< Point > > &bezcoef) |
Calculate Bezier coefficients of the cubic curves interpolating the points and tangents at the grid nodes with indices 'left' and 'right'. | |
std::vector< double > | getKnots () |
Return the grid parameters. | |
std::vector< std::vector< Point > > | getData () |
Return the sample values (positions and first derivatives). | |
int | dims (int ki) |
Return the spatial dimension of each of the curves. | |
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 HermiteGrid1DMulti.h.
Go::HermiteGrid1DMulti::HermiteGrid1DMulti | ( | EvalCurveSet & | surf, | |
double | start, | |||
double | end, | |||
std::vector< int > | dims | |||
) |
Construct a HermiteGrid1DMulti from a set of related curves (represented by a EvalCurveSet) and a given interval.
surf | the curve collection to sample from | |
start | start of parameter interval | |
end | end of parameter interval | |
dims | vector that specifies the dimensions of the curves contained in the EvalCurveSet. The size of the vector should be equal to the total number of curves in 'surf', ie. the return value of its EvalCurveSet::nmbCvs() function. |
Go::HermiteGrid1DMulti::HermiteGrid1DMulti | ( | EvalCurveSet & | surf, | |
double | param[], | |||
int | n, | |||
std::vector< int > | dims | |||
) |
Construct a HermiteGrid1DMulti from a set of related curves (represented by a EvalCurveSet) and a set of parameter values.
surf | the curve collection to sample from | |
param | array of strictly increasing parameters contained in the parameter domain of 'surf'. | |
n | number of elements in 'param[]' | |
dims | vector that specifies the dimensions of the curves contained in the EvalCurveSet. The size of the vector should be equal to the total number of curves in 'surf', ie. the return value of its EvalCurveSet::nmbCvs() function. |
int Go::HermiteGrid1DMulti::addKnot | ( | EvalCurveSet & | surf, | |
double | knot | |||
) |
Add another sample (parameter, positions, tangents) to the grid.
Returns the index of the new knot (parameter value) in the sorted knot vector after insertion.
surf | the curve collection to sample from | |
knot | the new sample value (parameter value, knot) |
void Go::HermiteGrid1DMulti::getSegment | ( | int | left, | |
int | right, | |||
double & | spar, | |||
double & | epar, | |||
std::vector< std::vector< Point > > & | bezcoef | |||
) |
Calculate Bezier coefficients of the cubic curves interpolating the points and tangents at the 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 | a vector containing arrays of cubic Bezier coefficients. There are as many vector entries as there are curves, and each entry contains the Bezier coefficients for that curve. |