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

Method GetCategoryRect

libs/map/bookmark_manager.cpp:1673–1699  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1671}
1672
1673m2::RectD BookmarkManager::GetCategoryRect(kml::MarkGroupId categoryId, bool addIconsSize) const
1674{
1675 CHECK_THREAD_CHECKER(m_threadChecker, ());
1676 auto const * category = GetBmCategory(categoryId);
1677
1678 m2::RectD categoryRect;
1679 if (category->IsEmpty())
1680 return categoryRect;
1681
1682 for (auto markId : category->GetUserMarks())
1683 {
1684 auto const bookmark = GetBookmark(markId);
1685 categoryRect.Add(bookmark->GetPivot());
1686 }
1687 if (addIconsSize && !category->GetUserMarks().empty())
1688 {
1689 double const coeff = m_maxBookmarkSymbolSize.y / (m_viewport.PixelRect().SizeY() - m_maxBookmarkSymbolSize.y);
1690 categoryRect.Add(categoryRect.LeftTop() + m2::PointD(0.0, categoryRect.SizeY() * coeff));
1691 }
1692 for (auto trackId : category->GetUserLines())
1693 {
1694 auto const track = GetTrack(trackId);
1695 categoryRect.Add(track->GetLimitRect());
1696 }
1697
1698 return categoryRect;
1699}
1700
1701kml::CategoryData const & BookmarkManager::GetCategoryData(kml::MarkGroupId categoryId) const
1702{

Callers 1

ShowBookmarkCategoryMethod · 0.80

Calls 8

GetBookmarkFunction · 0.85
SizeYMethod · 0.80
LeftTopMethod · 0.80
IsEmptyMethod · 0.45
AddMethod · 0.45
GetPivotMethod · 0.45
emptyMethod · 0.45
GetLimitRectMethod · 0.45

Tested by

no test coverage detected