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

Method ForEachInIntervals

libs/indexer/data_source.cpp:211–240  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

209}
210
211void DataSource::ForEachInIntervals(ReaderCallback const & fn, covering::CoveringMode mode, m2::RectD const & rect,
212 int scale) const
213{
214 std::vector<std::shared_ptr<MwmInfo>> mwms;
215 GetMwmsInfo(mwms);
216
217 covering::CoveringGetter cov(rect, mode);
218
219 MwmId worldID[2];
220
221 for (auto const & info : mwms)
222 {
223 if (info->m_minScale <= scale && scale <= info->m_maxScale && rect.IsIntersect(info->m_bordersRect))
224 {
225 MwmId const mwmId(info);
226 switch (info->GetType())
227 {
228 case MwmInfo::COUNTRY: fn(GetMwmHandleById(mwmId), cov, scale); break;
229 case MwmInfo::COASTS: worldID[0] = mwmId; break;
230 case MwmInfo::WORLD: worldID[1] = mwmId; break;
231 }
232 }
233 }
234
235 if (worldID[0].IsAlive())
236 fn(GetMwmHandleById(worldID[0]), cov, scale);
237
238 if (worldID[1].IsAlive())
239 fn(GetMwmHandleById(worldID[1]), cov, scale);
240}
241
242void DataSource::ForEachFeatureIDInRect(FeatureIdCallback const & f, m2::RectD const & rect, int scale,
243 covering::CoveringMode mode /* = covering::ViewportWithLowLevels */) const

Callers

nothing calls this directly

Calls 4

GetMwmsInfoFunction · 0.85
IsIntersectMethod · 0.45
GetTypeMethod · 0.45
IsAliveMethod · 0.45

Tested by

no test coverage detected