本文整理汇总了C++中SplineSurface::coefs_end方法的典型用法代码示例。如果您正苦于以下问题:C++ SplineSurface::coefs_end方法的具体用法?C++ SplineSurface::coefs_end怎么用?C++ SplineSurface::coefs_end使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SplineSurface
的用法示例。
在下文中一共展示了SplineSurface::coefs_end方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ASSERT
//===========================================================================
vector<shared_ptr<SplineSurface> >
SurfaceCreators::separateRationalParts(const SplineSurface& sf)
//===========================================================================
{
bool rat = sf.rational();
ASSERT(rat);
int dim= sf.dimension();
int rdim = dim + 1;
vector<shared_ptr<SplineSurface> > sep_sfs;
vector<double> coefs(sf.coefs_begin(), sf.coefs_end());
int nmb1 = sf.numCoefs_u();
int nmb2 = sf.numCoefs_v();
vector<double> rcoefs;
int num_coefs = nmb1*nmb2;
vector<double>::const_iterator rcoef_iter = sf.rcoefs_begin();
for (int ki = 0; ki < num_coefs; ++ki) {
rcoefs.push_back(rcoef_iter[ki*rdim+1]);
for (int kj = 0; kj < dim; ++kj) {
coefs[ki*dim+kj] /= (rcoefs.back());
}
}
sep_sfs.push_back(shared_ptr<SplineSurface>
(new SplineSurface(nmb1, nmb2, sf.order_u(), sf.order_v(),
sf.basis_u().begin(), sf.basis_v().begin(),
coefs.begin(), dim)));
sep_sfs.push_back(shared_ptr<SplineSurface>
(new SplineSurface(nmb1, nmb2, sf.order_u(), sf.order_v(),
sf.basis_u().begin(), sf.basis_v().begin(),
rcoefs.begin(), 1)));
return sep_sfs;
}