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,10 +54,13 @@ 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);
auto offset = std::distance(start_, r.begin()); if (b.valid())
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))); auto offset = std::distance(start_, r.begin());
//boxes_.emplace_back(std::make_tuple(bbox,offset, size)); 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_tuple(bbox,offset, size));
}
} }
Iterator start_; Iterator start_;
Boxes & boxes_; Boxes & boxes_;