本文整理汇总了C++中Point3dVector::begin方法的典型用法代码示例。如果您正苦于以下问题:C++ Point3dVector::begin方法的具体用法?C++ Point3dVector::begin怎么用?C++ Point3dVector::begin使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Point3dVector
的用法示例。
在下文中一共展示了Point3dVector::begin方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: reorderULC
/// reorder points to upper-left-corner convention
Point3dVector reorderULC(const Point3dVector& points)
{
unsigned N = points.size();
if (N < 3){
return Point3dVector();
}
// transformation to align face
Transformation t = Transformation::alignFace(points);
Point3dVector facePoints = t.inverse()*points;
// find ulc index in face coordinates
double maxY = std::numeric_limits<double>::min();
double minX = std::numeric_limits<double>::max();
unsigned ulcIndex = 0;
for(unsigned i = 0; i < N; ++i){
OS_ASSERT(std::abs(facePoints[i].z()) < 0.001);
if ((maxY < facePoints[i].y()) || ((maxY < facePoints[i].y() + 0.00001) && (minX > facePoints[i].x()))){
ulcIndex = i;
maxY = facePoints[i].y();
minX = facePoints[i].x();
}
}
// no-op
if (ulcIndex == 0){
return points;
}
// create result
Point3dVector result;
std::copy (points.begin() + ulcIndex, points.end(), std::back_inserter(result));
std::copy (points.begin(), points.begin() + ulcIndex, std::back_inserter(result));
OS_ASSERT(result.size() == N);
return result;
}