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

Function DrawMwmBorder

qt/draw_widget.cpp:58–79  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

56 dp::Color(0, 0, 100, 255), dp::Color(100, 100, 0, 255), dp::Color(0, 100, 100, 255), dp::Color(100, 0, 100, 255)};
57
58void DrawMwmBorder(df::DrapeApi & drapeApi, std::string const & mwmName, std::vector<m2::RegionD> const & regions,
59 bool withVertices)
60{
61 for (size_t i = 0; i < regions.size(); ++i)
62 {
63 auto const & region = regions[i];
64 auto const & points = region.Data();
65 if (points.empty())
66 return;
67
68 static uint32_t kColorCounter = 0;
69
70 auto lineData = df::DrapeApiLineData(points, colorList[kColorCounter]).Width(4.0f).ShowId();
71 if (withVertices)
72 lineData.ShowPoints(true /* markPoints */);
73
74 auto const & name = i == 0 ? mwmName : mwmName + "_" + std::to_string(i);
75 drapeApi.AddLine(name, lineData);
76
77 kColorCounter = (kColorCounter + 1) % colorList.size();
78 }
79}
80
81#if defined(OMIM_OS_LINUX)
82df::TouchEvent::ETouchType qtTouchEventTypeToDfTouchEventType(QEvent::Type qEventType)

Callers 1

Calls 6

DrapeApiLineDataClass · 0.85
to_stringFunction · 0.85
sizeMethod · 0.45
DataMethod · 0.45
emptyMethod · 0.45
AddLineMethod · 0.45

Tested by

no test coverage detected