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

Function DrawLine

libs/map/framework_visualize.cpp:41–59  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

39
40template <class Box>
41void DrawLine(Box const & box, dp::Color const & color, df::DrapeApi & drapeApi, std::string const & id)
42{
43 auto points = box.Points();
44 CHECK(!points.empty(), ());
45 points.push_back(points.front());
46
47 points.erase(unique(points.begin(), points.end(),
48 [](m2::PointD const & p1, m2::PointD const & p2)
49 {
50 m2::PointD const delta = p2 - p1;
51 return delta.IsAlmostZero();
52 }),
53 points.end());
54
55 if (points.size() <= 1)
56 return;
57
58 drapeApi.AddLine(id, df::DrapeApiLineData(points, color).Width(3.0f).ShowPoints(true).ShowId());
59}
60
61void VisualizeFeatureInRect(m2::RectD const & rect, FeatureType & ft, df::DrapeApi & drapeApi)
62{

Callers 1

Calls 12

uniqueFunction · 0.85
DrapeApiLineDataClass · 0.85
PointsMethod · 0.80
frontMethod · 0.80
IsAlmostZeroMethod · 0.80
emptyMethod · 0.45
push_backMethod · 0.45
eraseMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
sizeMethod · 0.45
AddLineMethod · 0.45

Tested by

no test coverage detected