本文整理汇总了C++中Stopwatch::elapsed_user_time方法的典型用法代码示例。如果您正苦于以下问题:C++ Stopwatch::elapsed_user_time方法的具体用法?C++ Stopwatch::elapsed_user_time怎么用?C++ Stopwatch::elapsed_user_time使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Stopwatch
的用法示例。
在下文中一共展示了Stopwatch::elapsed_user_time方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: apply
// TODO: using CGAL::pca_estimate_normals()
void NormalEstimator::apply(Object* object, unsigned int K)
{
if (object == NULL) {
std::cout << title() << "no data exists" << std::endl;
return;
}
std::cout << title() << "estimating point cloud normal..." << std::endl;
Stopwatch clock;
PrimitiveFitting fit;
std::vector<Vertex*> &vertices = object->vertices();
unsigned int num = vertices.size() / 30; // for each part
unsigned int count = 0;
for (unsigned int i=0; i<vertices.size(); ++i) {
Vertex* v = vertices[i];
// TODO: process larger number once a time
std::vector<Vertex*> neighbors;
object->get_K_nearest_points(v->point(), K, neighbors);
neighbors.push_back(v); // do NOT forget itself
fit.set_points(neighbors);
Plane3d plane;
fit.fit_plane(plane);
Vector3d n = global::normalOf(plane);
v->set_normal(n);
}
std::cout << title() << "normal estimation done. Time: " << clock.elapsed_user_time() << " second" << std::endl;
object->set_normals_exist(true);
}