3.4.0
tigl::CTiglBSplineApproxInterp Class Reference

#include <CTiglBSplineApproxInterp.h>

Public Member Functions

TIGL_EXPORT CTiglBSplineApproxInterp (const TColgp_Array1OfPnt &points, int nControlPoints, int degree=3, bool continuous_if_closed=false)
 
TIGL_EXPORT CTiglApproxResult FitCurve (const std::vector< double > &initialParms=std::vector< double >()) const
 Returns the resulting curve and the fit error. More...
 
TIGL_EXPORT CTiglApproxResult FitCurveOptimal (const std::vector< double > &initialParms=std::vector< double >(), int maxIter=10) const
 Fits the curve by optimizing the parameters. Important: Parameters of points that are interpolated are not optimized. More...
 
TIGL_EXPORT void InterpolatePoint (size_t pointIndex, bool withKink=false)
 The specified point will be interpolated instead of approximated. More...
 

Private Member Functions

void computeKnots (int ncp, const std::vector< double > &params, std::vector< double > &knots, std::vector< int > &mults) const
 
std::vector< double > computeParameters (double alpha) const
 
bool firstAndLastInterpolated () const
 
math_Matrix getContinuityMatrix (int nCtrPnts, int contin_cons, const std::vector< double > &params, const TColStd_Array1OfReal &flatKnots) const
 
bool isClosed () const
 
double maxDistanceOfBoundingBox (const TColgp_Array1OfPnt &points) const
 computes the maximum distance of the given points More...
 
void optimizeParameters (const Handle(Geom_Curve)&curve, std::vector< double > &parms) const
 
ProjectResult projectOnCurve (const gp_Pnt &pnt, const Handle(Geom_Curve)&curve, double initial_Parm) const
 
CTiglApproxResult solve (const std::vector< double > &params, const TColStd_Array1OfReal &knots, const TColStd_Array1OfInteger &mults) const
 

Private Attributes

bool m_C2Continuous
 determines the continuous closing of curve More...
 
int m_degree
 degree of the B-spline More...
 
std::vector< size_t > m_indexOfApproximated
 
std::vector< size_t > m_indexOfInterpolated
 
std::vector< size_t > m_indexOfKinks
 
int m_ncp
 Number of control points of the B-spline. More...
 
TColgp_Array1OfPnt m_pnts
 curve coordinates to be fitted by the B-spline More...
 

Constructor & Destructor Documentation

◆ CTiglBSplineApproxInterp()

TIGL_EXPORT tigl::CTiglBSplineApproxInterp::CTiglBSplineApproxInterp ( const TColgp_Array1OfPnt &  points,
int  nControlPoints,
int  degree = 3,
bool  continuous_if_closed = false 
)

Member Function Documentation

◆ computeKnots()

void tigl::CTiglBSplineApproxInterp::computeKnots ( int  ncp,
const std::vector< double > &  params,
std::vector< double > &  knots,
std::vector< int > &  mults 
) const
private

◆ computeParameters()

std::vector<double> tigl::CTiglBSplineApproxInterp::computeParameters ( double  alpha) const
private

◆ firstAndLastInterpolated()

bool tigl::CTiglBSplineApproxInterp::firstAndLastInterpolated ( ) const
private

◆ FitCurve()

TIGL_EXPORT CTiglApproxResult tigl::CTiglBSplineApproxInterp::FitCurve ( const std::vector< double > &  initialParms = std::vector< double >()) const

Returns the resulting curve and the fit error.

◆ FitCurveOptimal()

TIGL_EXPORT CTiglApproxResult tigl::CTiglBSplineApproxInterp::FitCurveOptimal ( const std::vector< double > &  initialParms = std::vector< double >(),
int  maxIter = 10 
) const

Fits the curve by optimizing the parameters. Important: Parameters of points that are interpolated are not optimized.

◆ getContinuityMatrix()

math_Matrix tigl::CTiglBSplineApproxInterp::getContinuityMatrix ( int  nCtrPnts,
int  contin_cons,
const std::vector< double > &  params,
const TColStd_Array1OfReal &  flatKnots 
) const
private

◆ InterpolatePoint()

TIGL_EXPORT void tigl::CTiglBSplineApproxInterp::InterpolatePoint ( size_t  pointIndex,
bool  withKink = false 
)

The specified point will be interpolated instead of approximated.

◆ isClosed()

bool tigl::CTiglBSplineApproxInterp::isClosed ( ) const
private

◆ maxDistanceOfBoundingBox()

double tigl::CTiglBSplineApproxInterp::maxDistanceOfBoundingBox ( const TColgp_Array1OfPnt &  points) const
private

computes the maximum distance of the given points

◆ optimizeParameters()

void tigl::CTiglBSplineApproxInterp::optimizeParameters ( const Handle(Geom_Curve)&  curve,
std::vector< double > &  parms 
) const
private

◆ projectOnCurve()

ProjectResult tigl::CTiglBSplineApproxInterp::projectOnCurve ( const gp_Pnt &  pnt,
const Handle(Geom_Curve)&  curve,
double  initial_Parm 
) const
private

◆ solve()

CTiglApproxResult tigl::CTiglBSplineApproxInterp::solve ( const std::vector< double > &  params,
const TColStd_Array1OfReal &  knots,
const TColStd_Array1OfInteger &  mults 
) const
private

Field Documentation

◆ m_C2Continuous

bool tigl::CTiglBSplineApproxInterp::m_C2Continuous
private

determines the continuous closing of curve

◆ m_degree

int tigl::CTiglBSplineApproxInterp::m_degree
private

degree of the B-spline

◆ m_indexOfApproximated

std::vector<size_t> tigl::CTiglBSplineApproxInterp::m_indexOfApproximated
private

◆ m_indexOfInterpolated

std::vector<size_t> tigl::CTiglBSplineApproxInterp::m_indexOfInterpolated
private

◆ m_indexOfKinks

std::vector<size_t> tigl::CTiglBSplineApproxInterp::m_indexOfKinks
private

◆ m_ncp

int tigl::CTiglBSplineApproxInterp::m_ncp
private

Number of control points of the B-spline.

◆ m_pnts

TColgp_Array1OfPnt tigl::CTiglBSplineApproxInterp::m_pnts
private

curve coordinates to be fitted by the B-spline


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