#include <ApproxCurve.h>
Public Member Functions | |
ApproxCurve (const std::vector< double > &points, const std::vector< double > &parvals, int dim, double aepsge) | |
Constructor where the user specifies a set of parameterized points and a tolerance to be used. | |
ApproxCurve (const std::vector< double > &points, const std::vector< double > &parvals, int dim, double aepsge, int in, int ik) | |
Constructor where the user specifies a set of parameterized points and a tolerance to be used, as well as the spline order and number of control points. | |
ApproxCurve (const std::vector< double > &points, const std::vector< double > &parvals, int dim, double aepsge, int in, int ik, std::vector< double > &knots) | |
Constructor where the user specifies a set of parameterized points, a tolerance and the spline space to use for constructing the curve. | |
~ApproxCurve () | |
Destructor. | |
void | setSmooth (double w) |
Set smoothing weight 0 < w < 1. | |
void | unsetSmooth () |
Unset smoothing weight (set it to zero). | |
void | setEndPoints (const std::vector< Point > &start_point, const std::vector< Point > &end_point) |
The user may specifically decide the start and end points and tangents of the approximation curve (if these are not set, this information will result from the smoothing equation). | |
boost::shared_ptr< SplineCurve > | getApproxCurve (double &maxdist, double &avdist, int max_iter=5) |
When everything else is set, this function can be used to fetch the approximating curve. | |
Protected Member Functions | |
ApproxCurve () | |
Default constructor. |
Definition at line 63 of file ApproxCurve.h.
Go::ApproxCurve::ApproxCurve | ( | const std::vector< double > & | points, | |
const std::vector< double > & | parvals, | |||
int | dim, | |||
double | aepsge | |||
) |
Constructor where the user specifies a set of parameterized points and a tolerance to be used.
The generated curve will have a spline basis of order 4 (cubic), and a number of control points equal to one-sixth of the number of input points. The knotvector of the curve's basis will be set to uniform.
points | vector containing the points to approximate. These are stored consecutively in "xyzxyzxyz-fashion". | |
parvals | the parameter values associated with the points to approximate | |
dim | the spatial dimension of the points (usually 3) | |
aepsge | the geometric tolerance to work with |
Go::ApproxCurve::ApproxCurve | ( | const std::vector< double > & | points, | |
const std::vector< double > & | parvals, | |||
int | dim, | |||
double | aepsge, | |||
int | in, | |||
int | ik | |||
) |
Constructor where the user specifies a set of parameterized points and a tolerance to be used, as well as the spline order and number of control points.
The knotvector of the curve's basis will be set to uniform.
points | vector containing the points to approximate. These are stored consecutively in "xyzxyzxyz-fashion". | |
parvals | the parameter values associated with the points to approximate | |
dim | the spatial dimension of the points (usually 3) | |
aepsge | the geometric tolerance to work with | |
in | the number of control points of the resulting spline curve | |
ik | the order of the resulting spline curve (pol. degree + 1) |
Go::ApproxCurve::ApproxCurve | ( | const std::vector< double > & | points, | |
const std::vector< double > & | parvals, | |||
int | dim, | |||
double | aepsge, | |||
int | in, | |||
int | ik, | |||
std::vector< double > & | knots | |||
) |
Constructor where the user specifies a set of parameterized points, a tolerance and the spline space to use for constructing the curve.
points | vector containing the points to approximate. These are stored consecutively in "xyzxyzxyz-fashion". | |
parvals | the parameter values associated with the points to approximate | |
dim | the spatial dimension of the points (usually 3) | |
aepsge | the geometric tolerance to work with | |
in | the number of control points of the resulting spline curve | |
ik | the order of the resulting spline curve (pol. degree + 1) | |
knots | specifies the knotvector of the resulting spline curve. |
void Go::ApproxCurve::setSmooth | ( | double | w | ) |
Set smoothing weight 0 < w < 1.
w | the smoothing weight |
void Go::ApproxCurve::setEndPoints | ( | const std::vector< Point > & | start_point, | |
const std::vector< Point > & | end_point | |||
) |
The user may specifically decide the start and end points and tangents of the approximation curve (if these are not set, this information will result from the smoothing equation).
This function lets the user specify the start and end points and tangents.
start_point | this vector should contain one or two elements: the start point and optionally the start tangent of the curve. | |
end_point | this vector should contain one or two elements: the end point and optionally the end tangent of the curve. |
boost::shared_ptr<SplineCurve> Go::ApproxCurve::getApproxCurve | ( | double & | maxdist, | |
double & | avdist, | |||
int | max_iter = 5 | |||
) |
When everything else is set, this function can be used to fetch the approximating curve.
maxdist | report the maximum distance between the generated curve and the data points | |
avdist | report the average distance between the generated curve and the datapoints |
max_iter | specify the maximum number of iterations to use |