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

This class is used to generate a spline curve from a given spline space that approximates a set of weighed data points. More...

#include <SmoothCurve.h>

List of all members.

Public Member Functions

 SmoothCurve (int dim=3)
 Constructor.
 ~SmoothCurve ()
 Destructor.
int attach (const boost::shared_ptr< SplineCurve > &incurve, int coef_known[], int numSideConstraints=0)
 Initializes data given by an intermediate curve.
void setOptim (const double weight1, const double weight2, const double weight3)
 Compute the smoothing part of the equation system.
void setLeastSquares (std::vector< double > &pnts, std::vector< double > &param_pnts, std::vector< double > &pnt_weights, double weight)
 Compute matrices for least squares approximation.
void setPeriodicity (int cont, double weight)
 Set periodicity constraints in one par.
void setSideConstraints (std::vector< sideConstraint > &constraints)
 Set linear side constraints (linear equation involving the free coefficients) to the minimization problem.
void equationSolve (boost::shared_ptr< SplineCurve > &curve)
 Solve equation system, and produce output curve.


Detailed Description

This class is used to generate a spline curve from a given spline space that approximates a set of weighed data points.

In addition, user can set other conditions on things like curve smoothness or periodicity. To use this object, you must first instanciate it, then run the 'attach()' function, the 'setOptim()' function, the 'setLeastSquares()' function and finally the 'equationSolve()' function. Optionally, the functions 'setPeriodicity()' and 'setSideConstraints()' can be run before 'equationSolve()', if the corresponding conditions should be speficied.

Definition at line 83 of file SmoothCurve.h.


Constructor & Destructor Documentation

Go::SmoothCurve::SmoothCurve ( int  dim = 3  ) 

Constructor.

Initialises the object with a given spatial dimension (default is 3).

Parameters:
dim dimension of the geometry space.


Member Function Documentation

int Go::SmoothCurve::attach ( const boost::shared_ptr< SplineCurve > &  incurve,
int  coef_known[],
int  numSideConstraints = 0 
)

Initializes data given by an intermediate curve.

Parameters:
incurve curve defining the initial spline curve.
coef_known array defining the free coefficients. Size equal to the number of coefficients in incurve. Value 0 = not known, value 1 = known.
numSideConstraints the number of linear side constrains for the approximation.
Returns:
status value: 0 = OK, negative not OK.

void Go::SmoothCurve::setOptim ( const double  weight1,
const double  weight2,
const double  weight3 
)

Compute the smoothing part of the equation system.

The sum of the weights should lie in the unit interval.

Parameters:
weight1 weight for smoothing with respect to the 1st derivative.
weight2 weight for smoothing with respect to the 2nd derivative.
weight3 weight for smoothing with respect to the 3rd derivative.

void Go::SmoothCurve::setLeastSquares ( std::vector< double > &  pnts,
std::vector< double > &  param_pnts,
std::vector< double > &  pnt_weights,
double  weight 
)

Compute matrices for least squares approximation.

Parameters:
pnts the input points (for 3D: (x0, y0, z0, x1, y1, z1, ...)) defining the approximation part of the smoothing problem.
param_pnts the parameters for the input pnts.
pnt_weights weight attached to each point to be approximated. Should lie in the unit interval. Typically they are all 1.0.
weight multiplier of all weights in the pnt_weights vector

void Go::SmoothCurve::setPeriodicity ( int  cont,
double  weight 
)

Set periodicity constraints in one par.

dir.

Parameters:
cont the wanted continuity across the seam.
weight weight given to approximative continuity conditions. Should lie inside the unit interval.

void Go::SmoothCurve::setSideConstraints ( std::vector< sideConstraint > &  constraints  ) 

Set linear side constraints (linear equation involving the free coefficients) to the minimization problem.

The problem is solved using the method of Lagrange multipliers.

Parameters:
constraints the linear side constraints.

void Go::SmoothCurve::equationSolve ( boost::shared_ptr< SplineCurve > &  curve  ) 

Solve equation system, and produce output curve.

Parameters:
curve the curve resulting from the smoothing process.


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