| 227 | } |
| 228 | |
| 229 | bool ProcessCell(TCell const & cell) |
| 230 | { |
| 231 | // get rect cell |
| 232 | double minX, minY, maxX, maxY; |
| 233 | CellIdConverter<mercator::Bounds, TCell>::GetCellBounds(cell, minX, minY, maxX, maxY); |
| 234 | |
| 235 | using namespace coastlines_generator; |
| 236 | // create rect region |
| 237 | PointT arr[] = {D2I(m2::PointD(minX, minY)), D2I(m2::PointD(minX, maxY)), D2I(m2::PointD(maxX, maxY)), |
| 238 | D2I(m2::PointD(maxX, minY))}; |
| 239 | RegionT rectR(arr, arr + ARRAY_SIZE(arr)); |
| 240 | |
| 241 | // Do 'and' with all regions and accumulate the result, including bound region. |
| 242 | // In 'odd' parts we will have an ocean. |
| 243 | DoDifference doDiff(rectR); |
| 244 | m_index.ForEachInRect(GetLimitRect(rectR), std::bind<void>(std::ref(doDiff), std::placeholders::_1)); |
| 245 | |
| 246 | // Check if too many points for feature. |
| 247 | if (cell.Level() < kHighLevel && doDiff.GetPointsCount() >= kMaxPoints) |
| 248 | return false; |
| 249 | |
| 250 | m_ctx.processResultFunc(cell, doDiff); |
| 251 | return true; |
| 252 | } |
| 253 | |
| 254 | void operator()() |
| 255 | { |
nothing calls this directly
no test coverage detected