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

Function VisualizeFeatureInRect

libs/map/framework_visualize.cpp:61–81  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

59}
60
61void VisualizeFeatureInRect(m2::RectD const & rect, FeatureType & ft, df::DrapeApi & drapeApi)
62{
63 bool allPointsOutside = true;
64 std::vector<m2::PointD> points;
65 ft.ForEachPoint([&](m2::PointD const & pt)
66 {
67 if (rect.IsPointInside(pt))
68 allPointsOutside = false;
69 points.push_back(pt);
70 }, scales::GetUpperScale());
71
72 if (!allPointsOutside)
73 {
74 static uint64_t counter = 0;
75 auto const color = colorList[counter++ % std::size(colorList)];
76
77 // Note. The first param at DrapeApi::AddLine() should be unique, so pass unique ft.GetID().
78 // Other way last added line replaces the previous added line with the same name.
79 drapeApi.AddLine(DebugPrint(ft.GetID()), df::DrapeApiLineData(points, color).Width(3.0f).ShowPoints(true).ShowId());
80 }
81}
82} // namespace
83
84void Framework::VisualizeRoadsInRect(m2::RectD const & rect)

Callers 2

VisualizeRoadsInRectMethod · 0.85

Calls 9

GetUpperScaleFunction · 0.85
sizeFunction · 0.85
DrapeApiLineDataClass · 0.85
DebugPrintFunction · 0.70
ForEachPointMethod · 0.45
IsPointInsideMethod · 0.45
push_backMethod · 0.45
AddLineMethod · 0.45
GetIDMethod · 0.45

Tested by

no test coverage detected