| 379 | //////////////////////////////////////////////////////////////////////////////// |
| 380 | |
| 381 | void |
| 382 | pcl::ihs::Integration::age(const MeshPtr& mesh, const bool cleanup) const |
| 383 | { |
| 384 | for (std::size_t i = 0; i < mesh->sizeVertices(); ++i) { |
| 385 | PointIHS& pt = mesh->getVertexDataCloud()[i]; |
| 386 | if (pt.age < max_age_) { |
| 387 | // Point survives |
| 388 | ++(pt.age); |
| 389 | } |
| 390 | else if (pt.age == max_age_) // Judgement Day |
| 391 | { |
| 392 | if (pcl::ihs::countDirections(pt.directions) < min_directions_) { |
| 393 | // Point dies (no need to transform it) |
| 394 | mesh->deleteVertex(VertexIndex(i)); |
| 395 | } |
| 396 | else { |
| 397 | // Point becomes immortal |
| 398 | pt.age = std::numeric_limits<unsigned int>::max(); |
| 399 | } |
| 400 | } |
| 401 | } |
| 402 | |
| 403 | if (cleanup) { |
| 404 | mesh->cleanUp(); |
| 405 | } |
| 406 | } |
| 407 | |
| 408 | //////////////////////////////////////////////////////////////////////////////// |
| 409 |
no test coverage detected