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

Method Get

libs/search/geometry_cache.cpp:36–52  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

34{}
35
36CBV PivotRectsCache::Get(MwmContext const & context, m2::RectD const & rect, int scale)
37{
38 auto p = FindOrCreateEntry(context.GetId(), [&rect, &scale](Entry const & entry)
39 {
40 return scale == entry.m_scale &&
41 (entry.m_rect.IsRectInside(rect) || IsEqualMercator(rect, entry.m_rect, kMwmPointAccuracy));
42 });
43 auto & entry = p.first;
44 if (p.second)
45 {
46 m2::RectD normRect = mercator::RectByCenterXYAndSizeInMeters(rect.Center(), m_maxRadiusMeters);
47 if (!normRect.IsRectInside(rect))
48 normRect = rect;
49 InitEntry(context, normRect, scale, entry);
50 }
51 return entry.m_cbv;
52}
53
54// LocalityRectsCache ------------------------------------------------------------------------------
55LocalityRectsCache::LocalityRectsCache(size_t maxNumEntries, base::Cancellable const & cancellable)

Callers 15

GetMatchingStreetImplMethod · 0.45
IsEmptyMethod · 0.45
GetWeightImplFunction · 0.45
GetIdfMethod · 0.45
SimilarityMethod · 0.45
SearchPostcodeMethod · 0.45
CategoriesInfoMethod · 0.45
GetBestHouseWithNumberFunction · 0.45
QuerySliceClass · 0.45
GetCenterMethod · 0.45
GetNameScoresFunction · 0.45

Calls 5

IsEqualMercatorFunction · 0.85
GetIdMethod · 0.45
IsRectInsideMethod · 0.45
CenterMethod · 0.45

Tested by 4

UNIT_CLASS_TESTFunction · 0.36
UNIT_CLASS_TESTFunction · 0.36
UNIT_TESTFunction · 0.36
UNIT_TESTFunction · 0.36