only add valid bounding boxes (make backward compatible)

This commit is contained in:
artemp 2016-12-06 12:20:16 +01:00
parent 218fba4479
commit df10fab439

View file

@ -54,11 +54,14 @@ struct extract_positions
{ {
auto const& r = std::get<0>(val); auto const& r = std::get<0>(val);
auto const& b = std::get<1>(val); auto const& b = std::get<1>(val);
if (b.valid())
{
auto offset = std::distance(start_, r.begin()); auto offset = std::distance(start_, r.begin());
auto size = std::distance(r.begin(), r.end()); auto size = std::distance(r.begin(), r.end());
boxes_.emplace_back(std::make_pair(box_type(b.minx(), b.miny(), b.maxx(), b.maxy()), std::make_pair(offset, size))); boxes_.emplace_back(std::make_pair(box_type(b.minx(), b.miny(), b.maxx(), b.maxy()), std::make_pair(offset, size)));
//boxes_.emplace_back(std::make_tuple(bbox,offset, size)); //boxes_.emplace_back(std::make_tuple(bbox,offset, size));
} }
}
Iterator start_; Iterator start_;
Boxes & boxes_; Boxes & boxes_;
}; };