Class xlifepp::BSpline#

class BSpline : public xlifepp::Spline#

Inheritence diagram for xlifepp::BSpline:

digraph { graph [bgcolor="#00000000"] node [shape=rectangle style=filled fillcolor="#FFFFFF" font=Helvetica padding=2] edge [color="#1414CE"] "1" [label="xlifepp::BSpline" tooltip="xlifepp::BSpline" fillcolor="#BFBFBF"] "2" [label="xlifepp::Spline" tooltip="xlifepp::Spline"] "1" -> "2" [dir=forward tooltip="public-inheritance"] }

Collaboration diagram for xlifepp::BSpline:

digraph { graph [bgcolor="#00000000"] node [shape=rectangle style=filled fillcolor="#FFFFFF" font=Helvetica padding=2] edge [color="#1414CE"] "25" [label="xlifepp::Collection< string_t >" tooltip="xlifepp::Collection< string_t >"] "19" [label="xlifepp::Matrix< real_t >" tooltip="xlifepp::Matrix< real_t >"] "22" [label="xlifepp::Vector< real_t >" tooltip="xlifepp::Vector< real_t >"] "33" [label="xlifepp::Vector< xlifepp::Vector< real_t > >" tooltip="xlifepp::Vector< xlifepp::Vector< real_t > >"] "42" [label="std::list< std::pair< number_t, real_t > >" tooltip="std::list< std::pair< number_t, real_t > >"] "15" [label="std::map< number_t, std::vector< number_t > >" tooltip="std::map< number_t, std::vector< number_t > >"] "13" [label="std::map< number_t, xlifepp::Geometry * >" tooltip="std::map< number_t, xlifepp::Geometry * >"] "44" [label="std::map< real_t, number_t >" tooltip="std::map< real_t, number_t >"] "41" [label="std::map< string_t, number_t >" tooltip="std::map< string_t, number_t >"] "5" [label="std::multimap< real_t, number_t >" tooltip="std::multimap< real_t, number_t >"] "43" [label="std::list< T >" tooltip="std::list< T >"] "14" [label="std::map< K, T >" tooltip="std::map< K, T >"] "6" [label="std::multimap< K, T >" tooltip="std::multimap< K, T >"] "4" [label="std::vector< T >" tooltip="std::vector< T >"] "28" [label="std::vector< T >" tooltip="std::vector< T >"] "21" [label="std::vector< K >" tooltip="std::vector< K >"] "11" [label="std::vector< RealPair >" tooltip="std::vector< RealPair >"] "24" [label="std::vector< const xlifepp::Transformation * >" tooltip="std::vector< const xlifepp::Transformation * >"] "29" [label="std::vector< number_t >" tooltip="std::vector< number_t >"] "7" [label="std::vector< real_t >" tooltip="std::vector< real_t >"] "38" [label="std::vector< std::vector< GeoNumPair > >" tooltip="std::vector< std::vector< GeoNumPair > >"] "16" [label="std::vector< std::vector< int_t > >" tooltip="std::vector< std::vector< int_t > >"] "26" [label="std::vector< string_t >" tooltip="std::vector< string_t >"] "37" [label="std::vector< xlifepp::GeomDomain * >" tooltip="std::vector< xlifepp::GeomDomain * >"] "36" [label="std::vector< xlifepp::GeomElement * >" tooltip="std::vector< xlifepp::GeomElement * >"] "40" [label="std::vector< xlifepp::Parameter * >" tooltip="std::vector< xlifepp::Parameter * >"] "3" [label="std::vector< xlifepp::Point >" tooltip="std::vector< xlifepp::Point >"] "30" [label="std::vector< xlifepp::Transformation * >" tooltip="std::vector< xlifepp::Transformation * >"] "34" [label="std::vector< xlifepp::Vector< real_t > >" tooltip="std::vector< xlifepp::Vector< real_t > >"] "1" [label="xlifepp::BSpline" tooltip="xlifepp::BSpline" fillcolor="#BFBFBF"] "10" [label="xlifepp::BoundingBox" tooltip="xlifepp::BoundingBox"] "27" [label="xlifepp::Collection< T >" tooltip="xlifepp::Collection< T >"] "17" [label="xlifepp::ExtrusionData" tooltip="xlifepp::ExtrusionData"] "32" [label="xlifepp::GeoNode" tooltip="xlifepp::GeoNode"] "9" [label="xlifepp::Geometry" tooltip="xlifepp::Geometry"] "20" [label="xlifepp::Matrix< K >" tooltip="xlifepp::Matrix< K >"] "35" [label="xlifepp::Mesh" tooltip="xlifepp::Mesh"] "12" [label="xlifepp::MinimalBox" tooltip="xlifepp::MinimalBox"] "39" [label="xlifepp::Parameters" tooltip="xlifepp::Parameters"] "8" [label="xlifepp::Parametrization" tooltip="xlifepp::Parametrization"] "31" [label="xlifepp::Point" tooltip="xlifepp::Point"] "2" [label="xlifepp::Spline" tooltip="xlifepp::Spline"] "18" [label="xlifepp::Transformation" tooltip="xlifepp::Transformation"] "23" [label="xlifepp::Vector< K >" tooltip="xlifepp::Vector< K >"] "25" -> "26" [dir=forward tooltip="public-inheritance"] "25" -> "27" [dir=forward tooltip="template-instance"] "19" -> "7" [dir=forward tooltip="public-inheritance"] "19" -> "20" [dir=forward tooltip="template-instance"] "22" -> "7" [dir=forward tooltip="public-inheritance"] "22" -> "23" [dir=forward tooltip="template-instance"] "33" -> "34" [dir=forward tooltip="public-inheritance"] "33" -> "23" [dir=forward tooltip="template-instance"] "42" -> "43" [dir=forward tooltip="template-instance"] "15" -> "14" [dir=forward tooltip="template-instance"] "13" -> "14" [dir=forward tooltip="template-instance"] "44" -> "14" [dir=forward tooltip="template-instance"] "41" -> "14" [dir=forward tooltip="template-instance"] "5" -> "6" [dir=forward tooltip="template-instance"] "21" -> "4" [dir=forward tooltip="template-instance"] "11" -> "4" [dir=forward tooltip="template-instance"] "24" -> "4" [dir=forward tooltip="template-instance"] "29" -> "4" [dir=forward tooltip="template-instance"] "7" -> "4" [dir=forward tooltip="template-instance"] "38" -> "4" [dir=forward tooltip="template-instance"] "16" -> "4" [dir=forward tooltip="template-instance"] "26" -> "4" [dir=forward tooltip="template-instance"] "37" -> "4" [dir=forward tooltip="template-instance"] "36" -> "4" [dir=forward tooltip="template-instance"] "40" -> "4" [dir=forward tooltip="template-instance"] "3" -> "4" [dir=forward tooltip="template-instance"] "30" -> "4" [dir=forward tooltip="template-instance"] "34" -> "4" [dir=forward tooltip="template-instance"] "1" -> "2" [dir=forward tooltip="public-inheritance"] "1" -> "3" [dir=forward tooltip="usage"] "1" -> "7" [dir=forward tooltip="usage"] "1" -> "44" [dir=forward tooltip="usage"] "10" -> "11" [dir=forward tooltip="usage"] "27" -> "28" [dir=forward tooltip="public-inheritance"] "17" -> "18" [dir=forward tooltip="usage"] "17" -> "25" [dir=forward tooltip="usage"] "17" -> "29" [dir=forward tooltip="usage"] "17" -> "7" [dir=forward tooltip="usage"] "17" -> "22" [dir=forward tooltip="usage"] "17" -> "30" [dir=forward tooltip="usage"] "17" -> "31" [dir=forward tooltip="usage"] "32" -> "32" [dir=forward tooltip="usage"] "32" -> "9" [dir=forward tooltip="usage"] "9" -> "10" [dir=forward tooltip="usage"] "9" -> "12" [dir=forward tooltip="usage"] "9" -> "13" [dir=forward tooltip="usage"] "9" -> "15" [dir=forward tooltip="usage"] "9" -> "16" [dir=forward tooltip="usage"] "9" -> "17" [dir=forward tooltip="usage"] "9" -> "8" [dir=forward tooltip="usage"] "9" -> "9" [dir=forward tooltip="usage"] "9" -> "32" [dir=forward tooltip="usage"] "20" -> "21" [dir=forward tooltip="public-inheritance"] "35" -> "9" [dir=forward tooltip="usage"] "35" -> "3" [dir=forward tooltip="usage"] "35" -> "36" [dir=forward tooltip="usage"] "35" -> "37" [dir=forward tooltip="usage"] "35" -> "29" [dir=forward tooltip="usage"] "35" -> "38" [dir=forward tooltip="usage"] "35" -> "35" [dir=forward tooltip="usage"] "12" -> "3" [dir=forward tooltip="usage"] "39" -> "40" [dir=forward tooltip="usage"] "39" -> "41" [dir=forward tooltip="usage"] "8" -> "9" [dir=forward tooltip="usage"] "8" -> "22" [dir=forward tooltip="usage"] "8" -> "33" [dir=forward tooltip="usage"] "8" -> "35" [dir=forward tooltip="usage"] "8" -> "39" [dir=forward tooltip="usage"] "8" -> "42" [dir=forward tooltip="usage"] "31" -> "7" [dir=forward tooltip="public-inheritance"] "2" -> "3" [dir=forward tooltip="usage"] "2" -> "5" [dir=forward tooltip="usage"] "2" -> "7" [dir=forward tooltip="usage"] "2" -> "8" [dir=forward tooltip="usage"] "18" -> "19" [dir=forward tooltip="usage"] "18" -> "22" [dir=forward tooltip="usage"] "18" -> "24" [dir=forward tooltip="usage"] "23" -> "21" [dir=forward tooltip="public-inheritance"] }

BSpline class (rational B-Spline)

Public Functions

BSpline(const BSpline&)#

copy constructor

BSpline(const std::vector<Point> &cpts, number_t degree = 3, SplineBC bcs = _undefBC, SplineBC bce = _undefBC, const std::vector<real_t> &weights = std::vector<real_t>())#

create B-Spline approximation

approximation or interpolation B-spline

BSpline(SplineSubtype sbt, const std::vector<Point> &cpts, number_t degree = 3, SplineParametrization spar = _uniformParametrization, SplineBC bcs = _undefBC, SplineBC bce = _undefBC, const std::vector<real_t> &yp0 = std::vector<real_t>(), const std::vector<real_t> &yp1 = std::vector<real_t>(), const std::vector<real_t> &weights = std::vector<real_t>())#

create Bspline approximation or interpolation

virtual std::vector<Point> boundNodes() const#

return bound nodes

inline virtual BSpline *clone() const#

virtual copy like constructor

void computeB(real_t t, DiffOpType dif, number_t &j, Vector<real_t> &B, Vector<real_t> &dB, Vector<real_t> &d2B) const#

compute tool called by evaluate

void copy(const BSpline&)#

copy BSpline data in a cleaned BSpline (re-allocate parametrization_ pointer)

virtual Point evaluate(real_t t, DiffOpType d = _id) const#

evaluate spline or its derivative at t

evaluate B-Spline using Bernstein polynomials Q(s)= sum_{i=0,n} wi Bi,k(t) Pi /sum_{i=0,n} wi Bi,k(t) with t=t0_+s*(tf_-t0_) with Bi,k the B-spline function NEW VERSION: separate the computation of B from the construction of Q computeB may be reused, probably a little less efficient BSpline parameter t in [0,1] derivative order up to 2

virtual Point evaluate2(real_t t, DiffOpType d = _id) const#

evaluate spline or its derivative at t

evaluate B-Spline using Bernstein polynomials Q(s)= sum_{i=0,n} wi Bi,k(t) Pi(t) /sum_{i=0,n} wi Bi,k(t) with Bi,k the B-spline function OLD version

Vector<real_t> funParametrization(const Point &pt, Parameters &pars, DiffOpType d = _id) const#

parametrization

< parametrization s(t)

void initInterp()#

initialization when interpolation is selected cpts (in) : list of interpolated points Q_i cpts (out) : list of control points P_j leading to B-spline interpolating Q_i this function solve the linear system sum_j=0,m w_j*B_jk(s_i)P_j = sum_j=0,m w_j*B_jk(s_i) Q_i 0 <= i,j <=m <=> M*P=D*Q with M_ij = w_j*B_jk(s_i) D_ii = sum_j=0,m w_j*B_jk(s_i) =sum_j=0,m M_ij when B-spline is clamped at ends, first (resp.

last) two rows of system have to be modified P0 = Q0 k*w_m/w_m-1(t_m+1-t_m)*(Pm-Pm-1) = ype k*w_1/w_0(t_k+1-t_k)*(P1-P0) = yps Pm=Qm s_i is given by t(r_i)=t0+r_i*(tf-t0) where r_i are chosen using one of the rules uniform: r_i=i/m chordal: r_i=r_i-1 + |Q_i-Q_i-1|/ sum_j=1,m |Q_j-Q_i-j| , r_0=0 centripetal: r_i=r_i-1 + sqrt(|Q_i-Q_i-1|)/ sum_j=1,m sqrt(|Q_j-Q_i-j|) , r_0=0 ONLY UNIFORM IS AVAILABLE

Vector<real_t> invParametrization(const Point &pt, Parameters &pars, DiffOpType d = _id) const#

inverse of parametrization

< inverse of parametrization

BSpline &operator=(const BSpline&)#

assign BSpline to current one

inline virtual RealPair parameterBounds() const#

< real parameter bounds

virtual void print(std::ostream&, bool nocpt = false) const#

print utility

inline real_t toKnotsParameter(real_t t) const#

map t in [0,1] to knots parameter