C3D Toolkit  Kernel - 117982, Vision - 2.9.2.2
MbApproxNurbsParameters< Point, Vector, Nurbs > Class Template Reference

Parameters for the approximation polyline by a NURBS curve. More...

#include <mb_smooth_nurbs_fit_curve.h>

Public Member Functions

 MbApproxNurbsParameters (VERSION version=Math::DefaultMathVersion())
 Default constructor.
 
 MbApproxNurbsParameters (const MbApproxNurbsParameters &other)
 The copy constructor.
 
 ~MbApproxNurbsParameters ()
 Destructor.
 
void Init (const MbApproxNurbsParameters &other)
 Initialize by another parameters.
 
void InitUniform (const std::vector< Point > &aPt, size_t order, size_t nSpan, double smooth, MbeSmoothingMethod typeSmoothing, double tolerance, bool bClosed, double extendBeg=0., double extendEnd=0.)
 Initialize by points. Create uniform knot vector. More...
 
void InitUniformByPointsAndParams (const std::vector< Point > &aPt, const std::vector< double > &aPrm, size_t order, size_t nSpan, double smooth, MbeSmoothingMethod typeSmoothing, double tolerance, bool bClosed, double extendBeg=0., double extendEnd=0.)
 Initialize by points and parameters. Create uniform knot vector. More...
 
void InitPoints (const std::vector< Point > &aPt, size_t order, double smooth, MbeSmoothingMethod typeSmoothing, double tolerance)
 Initialize by points. More...
 
void InitSimpleConstraints (const std::vector< Point > &aPt, size_t order, double tolerance, c3d::BoolPair bFixBeginEnd, bool bClosed, Vector *pDerBeg=nullptr, Vector *pDerEnd=nullptr)
 Initialize by points with end constraints. More...
 
void InitConstraints (const std::vector< Point > &aPt, size_t order, double tolerance, bool bClosed, const std::vector< std::pair< size_t, const Vector * >> &constraints)
 Initialize by points with points and derivatives constraints. More...
 
bool IsClosed () const
 Whether curve closed.
 
size_t GetOrder () const
 Get NURBS order.
 
MbeSmoothingMethod GetMethodOrderSmoothing () const
 Get smoothing method.
 
double GetSmoothCoefficient () const
 Get smoothing coefficient.
 
double GetTolerance () const
 Get approximation tolerance.
 
const c3d::DoubleVectorGetKnots () const
 Get knots.
 
const std::vector< Point > & GetPoints () const
 Get points.
 
const c3d::DoubleVectorGetPointsParameters () const
 Get point's parameters.
 
const std::vector< MbApproxWeightConstraint< Vector > > & GetPointsWeights () const
 Get point's weights. More...
 
bool IsSmoothDefined () const
 Whether smoothing coefficient defined.
 
void SetPointWeight (size_t idx, double weight)
 Set weight for point with specified index.
 
void SetWeightDerivative (size_t idx, double weight, const Vector &der)
 Set derivative weight and derivative itself for point with specified index. More...
 
void SetSmoothCoefficient (double smooth)
 Set smoothing coefficient. More...
 

Detailed Description

template<class Point, class Vector, class Nurbs>
class MbApproxNurbsParameters< Point, Vector, Nurbs >

Parameters for the approximation polyline by a NURBS curve.

Parameters for the approximation polyline by a NURBS curve.

Member Function Documentation

◆ InitUniform()

template<class Point , class Vector , class Nurbs >
void MbApproxNurbsParameters< Point, Vector, Nurbs >::InitUniform ( const std::vector< Point > &  aPt,
size_t  order,
size_t  nSpan,
double  smooth,
MbeSmoothingMethod  typeSmoothing,
double  tolerance,
bool  bClosed,
double  extendBeg = 0.,
double  extendEnd = 0. 
)
inline

Initialize by points. Create uniform knot vector.

Initialize by points. Create uniform knot vector with user defined number of spans. Points parameters will be calculated by chord length method. First and last knots will be equal to first and last paramemters values or will be extended by specified value. All point weights are unit. There are no constraints for points and derivatives. The curve will be unclosed.

Parameters
[in]aPt- Points for approximation.
[in]order- Curve order.
[in]nSpan- Number of spans.
[in]smooth- Smoothing coefficient.
[in]orderSmoothing- Derivative order for smoothing.
[in]tolerance- Approximation tolerance.
[in]bClosed- Closure flag.
[in]extendBeg- Parametric length extention value for the curve beginning as percent w.r.t. difference between last and first point parameter (optional).
[in]extendEnd- Parametric length extention value for the curve end as percent w.r.t. difference between last and first point parameter (optional).

◆ InitUniformByPointsAndParams()

template<class Point , class Vector , class Nurbs >
void MbApproxNurbsParameters< Point, Vector, Nurbs >::InitUniformByPointsAndParams ( const std::vector< Point > &  aPt,
const std::vector< double > &  aPrm,
size_t  order,
size_t  nSpan,
double  smooth,
MbeSmoothingMethod  typeSmoothing,
double  tolerance,
bool  bClosed,
double  extendBeg = 0.,
double  extendEnd = 0. 
)
inline

Initialize by points and parameters. Create uniform knot vector.

Initialize by points and parameters. Create uniform knot vector with user defined number of spans. First and last knots will be equal to first and last paramemters values or will be extended by specified value. All point weights are unit. There are no constraints for points and derivatives. The curve will be unclosed.

Parameters
[in]aPt- Points for approximation.
[in]aPrm- Point parameters.
[in]order- Curve order.
[in]nSpan- Number of spans.
[in]smooth- Smoothing coefficient.
[in]orderSmoothing- Derivative order for smoothing.
[in]tolerance- Approximation tolerance.
[in]bClosed- Closure flag.
[in]extendBeg- Parametric length extention value for the curve beginning as percent w.r.t. difference between last and first point parameter (optional).
[in]extendEnd- Parametric length extention value for the curve end as percent w.r.t. difference between last and first point parameter (optional).

◆ InitPoints()

template<class Point , class Vector , class Nurbs >
void MbApproxNurbsParameters< Point, Vector, Nurbs >::InitPoints ( const std::vector< Point > &  aPt,
size_t  order,
double  smooth,
MbeSmoothingMethod  typeSmoothing,
double  tolerance 
)
inline

Initialize by points.

Initialize by points. Knot vector will be empty and should be defined in the approximation algorithm. Points parameters will be calculated by chord length method. All point weights are unit. There are no constraints for points and derivatives. The curve will be unclosed.

Parameters
[in]aPt- Points for approximation.
[in]order- Curve order.
[in]smooth- Smoothing coefficient.
[in]orderSmoothing- Derivative order for smoothing.
[in]tolerance- Approximation tolerance.

◆ InitSimpleConstraints()

template<class Point , class Vector , class Nurbs >
void MbApproxNurbsParameters< Point, Vector, Nurbs >::InitSimpleConstraints ( const std::vector< Point > &  aPt,
size_t  order,
double  tolerance,
c3d::BoolPair  bFixBeginEnd,
bool  bClosed,
Vector *  pDerBeg = nullptr,
Vector *  pDerEnd = nullptr 
)
inline

Initialize by points with end constraints.

Initialize by points. Knot vector and smoothing coefficient should be defined in the approximation algorithm. There are no constraints for inner points and derivatives. The curve will be unclosed.

Deprecated:
The method is deprecated.
Parameters
[in]aPt- Points for approximation.
[in]order- Curve order.
[in]tolerance- Approximation tolerance.
[in]bFixBeginEnd- Whether curve should coincide with first and last point.
[in]bClosed- Closure flag.
[in]pDerBeg- Curve beginnig derivative constraint (optional).
[in]pDerEnd- Curve end derivative constraint (optional).

◆ InitConstraints()

template<class Point , class Vector , class Nurbs >
void MbApproxNurbsParameters< Point, Vector, Nurbs >::InitConstraints ( const std::vector< Point > &  aPt,
size_t  order,
double  tolerance,
bool  bClosed,
const std::vector< std::pair< size_t, const Vector * >> &  constraints 
)
inline

Initialize by points with points and derivatives constraints.

Initialize by points with points and derivatives constraints. Knot vector and smoothing coefficient should be defined in the approximation algorithm.

Parameters
[in]aPt- Points for approximation.
[in]order- Curve order.
[in]tolerance- Approximation tolerance.
[in]bClosed- Closure flag.
[in]constraints- Array of constraints for points and derivatives. First - index of fixed point. Second - derivative vector constraint, if nullptr - derivative is unconstrained for this point.

◆ GetPointsWeights()

template<class Point , class Vector , class Nurbs >
const std::vector<MbApproxWeightConstraint<Vector> >& MbApproxNurbsParameters< Point, Vector, Nurbs >::GetPointsWeights ( ) const
inline

Get point's weights.

Get curve for result comparing.

◆ SetWeightDerivative()

template<class Point , class Vector , class Nurbs >
void MbApproxNurbsParameters< Point, Vector, Nurbs >::SetWeightDerivative ( size_t  idx,
double  weight,
const Vector &  der 
)
inline

Set derivative weight and derivative itself for point with specified index.

Set curve for result comparing.

◆ SetSmoothCoefficient()

template<class Point , class Vector , class Nurbs >
void MbApproxNurbsParameters< Point, Vector, Nurbs >::SetSmoothCoefficient ( double  smooth)
inline

Set smoothing coefficient.

Get math version.


The documentation for this class was generated from the following file: