36 for(
int i = 0; i < ( n + k ); i++ )
43 else if( ( i >= k ) && ( i < n ) )
56 WBSpline::WBSpline(
int order, std::vector< WVector3d > deBoorPoints, std::vector<double> knots )
70 unsigned int r = 0, i;
84 for( i = 0; i <
m_knots.size(); i++ )
96 for( i = (
m_knots.size() - 1 ); i > 0; i-- )
143 double deltaT = resolution;
148 for(
int step = 0; step < steps; step++ )
150 currentT =
m_knots[0] + step * deltaT;
152 points->push_back( samplePoint );
void setOrder(int order)
Sets a new order for the spline.
double m_t
The parameter value of the last spline evaluation i.e. the last call to f().
std::vector< WVector3d > getDeBoorPoints()
Returns the stored de Boor points.
void setKnots(std::vector< double > knots)
Sets new knots for the spline.
void samplePoints(std::vector< WVector3d > *p, double resolution)
Compute sample points on the spline for a given resolution.
WVector3d controlPoint_i_j(int _i, int _j)
Compute a control point of the de Boor algorithm for the given parameters.
int getOrder()
Returns the order of the spline.
WVector3d f(double t)
Compute a single sample point on the spline for the given parameter.
WBSpline(int order, std::vector< WVector3d > deBoorPoints)
Constructor for the spline that takes the order and de Boor points while constructing a normalized kn...
void setDeBoorPoints(std::vector< WVector3d > deBoorPoints)
Sets new de Boor points for the spline.
int m_order
The order of the spline.
std::vector< double > getKnots()
Returns the stored knots.
std::vector< double > m_knots
The knots of the spline.
~WBSpline()
Empty destructor.
double getAlpha_i_j(int _i, int _j)
Compute the alpha of the de Boor algorithm for the given parameters.
std::vector< WVector3d > m_deBoorPoints
The de Boor points of the spline.