26 #define BSPLINE_TINY 1e-20 36 template <
class Po
intND>
45 void setCtrlPoints(
const std::vector<PointND>& ctrlPointVec );
52 void eval(
double dPos, PointND& point);
68 double evalBasis(
double t,
unsigned int i,
int n);
79 template <
class Po
intND>
87 template <
class Po
intND>
93 template <
class Po
intND>
116 int iNumInternalKnots = iNumCtrlPoint -
m_iGrad;
117 for(i=0; i<iNumInternalKnots; i++)
119 double Distance1 = 0.0;
124 d=
m_KnotVec[i+m_iGrad-1] + sqrt(Distance1);
128 double Distance2 = 0.0;
129 for(
unsigned int k = 0; k <
m_CtrlPointVec[iNumInternalKnots+1].size(); k++)
133 d =
m_KnotVec[iNumCtrlPoint-1] + sqrt(Distance2);
149 template <
class Po
intND>
154 for(
unsigned int i = 0; i<point.size(); i++)
159 for(
unsigned int j = 0; j<point.size(); j++)
166 template <
class Po
intND>
183 iNumOfPoints =
m_KnotVec.back() / dIpoDist + 2;
184 ipoVec.resize(iNumOfPoints);
188 for(
int i=0; i < iNumOfPoints -1 ; i++)
273 template <
class Po
intND>
285 dInc =
m_KnotVec.back() / (double)(iNumOfPoints-1);
286 ipoVec.resize(iNumOfPoints);
290 for(
int i=0; i < iNumOfPoints -1 ; i++)
303 template <
class Po
intND>
327 dNum1 = m_KnotVec[i+n-1] - m_KnotVec[i];
329 dDen2 = m_KnotVec[i+n] - u;
330 dNum2 = m_KnotVec[i+n] - m_KnotVec[i+1];
334 N = dDen1 / dNum1 *
evalBasis(u, i , n-1);
335 N += dDen2 / dNum2 *
evalBasis(u, i+1 , n-1);
339 N = dDen2 / dNum2 *
evalBasis(u, i+1 , n-1);
343 N = dDen1 / dNum1 *
evalBasis(u, i , n-1);
void setCtrlPoints(const std::vector< PointND > &ctrlPointVec)
double evalBasis(double t, unsigned int i, int n)
void eval(double dPos, PointND &point)
bool ipoWithConstSampleDist(double dIpoDist, std::vector< PointND > &ipoVec)
std::vector< double > m_KnotVec
std::vector< PointND > m_CtrlPointVec
bool ipoWithNumSamples(int iNumPts, std::vector< PointND > &ipoVec)
double getMaxdPos() const