本文整理汇总了C++中BezierCurve::length方法的典型用法代码示例。如果您正苦于以下问题:C++ BezierCurve::length方法的具体用法?C++ BezierCurve::length怎么用?C++ BezierCurve::length使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BezierCurve
的用法示例。
在下文中一共展示了BezierCurve::length方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: groupCurveLength
float BccWorld::groupCurveLength(GeometryArray * geos)
{
float sum = 0.f;
const unsigned n = geos->numGeometries();
unsigned i = 0;
for(;i<n;i++) {
BezierCurve * c = static_cast<BezierCurve *>(geos->geometry(i));
sum += c->length();
}
return sum;
}
示例2: createCurveGeometryFromFile
bool BccWorld::createCurveGeometryFromFile()
{
if(!readCurveDataFromFile()) return false;
m_allGeo = new GeometryArray;
m_allGeo->create(m_curves->numCurves());
const unsigned n = m_curves->numCurves();
m_allGeo = new GeometryArray;
m_allGeo->create(n);
unsigned * cc = m_curves->counts();
Vector3F * cvs = m_curves->points();
m_totalCurveLength = 0.f;
CurveBuilder cb;
unsigned ncv;
unsigned cvDrift = 0;
unsigned i, j;
for(i=0; i< n; i++) {
ncv = cc[i];
for(j=0; j < ncv; j++)
cb.addVertex(cvs[j + cvDrift]);
BezierCurve * c = new BezierCurve;
cb.finishBuild(c);
m_totalCurveLength += c->length();
m_allGeo->setGeometry(c, i);
cvDrift += ncv;
}
std::cout<<" n curves "<<n
<<" total curve length: "<<m_totalCurveLength<<"\n";
m_numCurves = n;
return true;
}