Go::ApproxCurve Class Reference
['geometry' - a spline library]

This class can generate a B-spline curve that approximates a set of points for a given accuracy. More...

#include <ApproxCurve.h>

List of all members.

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< SplineCurvegetApproxCurve (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.


Detailed Description

This class can generate a B-spline curve that approximates a set of points for a given accuracy.

Definition at line 63 of file ApproxCurve.h.


Constructor & Destructor Documentation

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.

Parameters:
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.

Parameters:
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.

Parameters:
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.


Member Function Documentation

void Go::ApproxCurve::setSmooth ( double  w  ) 

Set smoothing weight 0 < w < 1.

Parameters:
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.

Parameters:
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.

Return values:
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
Parameters:
max_iter specify the maximum number of iterations to use
Returns:
a shared pointer to the generated SplineCurve, approximating the points as specified.


The documentation for this class was generated from the following file:
Generated on Mon Jun 11 14:48:18 2007 for GoTools Core Library by  doxygen 1.5.1