MCPcopy Create free account
hub / github.com/comaps/comaps / ProcessCell

Method ProcessCell

generator/coastlines_generator.cpp:229–252  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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 {

Callers

nothing calls this directly

Calls 5

LevelMethod · 0.80
D2IFunction · 0.70
GetLimitRectFunction · 0.70
ForEachInRectMethod · 0.45
GetPointsCountMethod · 0.45

Tested by

no test coverage detected