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

Method ProcessSelectionMode

qt/draw_widget.cpp:383–429  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

381}
382
383void DrawWidget::ProcessSelectionMode()
384{
385 QPoint const lt = m_rubberBand->geometry().topLeft();
386 QPoint const rb = m_rubberBand->geometry().bottomRight();
387 m2::RectD rect;
388 rect.Add(m_framework.PtoG(m2::PointD(L2D(lt.x()), L2D(lt.y()))));
389 rect.Add(m_framework.PtoG(m2::PointD(L2D(rb.x()), L2D(rb.y()))));
390
391 switch (*m_selectionMode)
392 {
393 case SelectionMode::Features: m_framework.VisualizeRoadsInRect(rect); break;
394
395 case SelectionMode::CityBoundaries: m_framework.VisualizeCityBoundariesInRect(rect); break;
396
397 case SelectionMode::CityRoads: m_framework.VisualizeCityRoadsInRect(rect); break;
398
399 case SelectionMode::CrossMwmSegments: m_framework.VisualizeCrossMwmTransitionsInRect(rect); break;
400
401 case SelectionMode::MwmsBordersByPolyFiles:
402 VisualizeMwmsBordersInRect(rect, false /* withVertices */, false /* fromPackedPolygon */, false /* boundingBox */);
403 break;
404
405 case SelectionMode::MwmsBordersWithVerticesByPolyFiles:
406 VisualizeMwmsBordersInRect(rect, true /* withVertices */, false /* fromPackedPolygon */, false /* boundingBox */);
407 break;
408
409 case SelectionMode::MwmsBordersByPackedPolygon:
410 VisualizeMwmsBordersInRect(rect, false /* withVertices */, true /* fromPackedPolygon */, false /* boundingBox */);
411 break;
412
413 case SelectionMode::MwmsBordersWithVerticesByPackedPolygon:
414 VisualizeMwmsBordersInRect(rect, true /* withVertices */, true /* fromPackedPolygon */, false /* boundingBox */);
415 break;
416
417 case SelectionMode::BoundingBoxByPolyFiles:
418 VisualizeMwmsBordersInRect(rect, true /* withVertices */, false /* fromPackedPolygon */, true /* boundingBox */);
419 break;
420
421 case SelectionMode::BoundingBoxByPackedPolygon:
422 VisualizeMwmsBordersInRect(rect, true /* withVertices */, true /* fromPackedPolygon */, true /* boundingBox */);
423 break;
424
425 default: UNREACHABLE();
426 }
427
428 m_rubberBand->hide();
429}
430
431void DrawWidget::keyPressEvent(QKeyEvent * e)
432{

Callers

nothing calls this directly

Calls 10

VisualizeRoadsInRectMethod · 0.80
geometryMethod · 0.45
AddMethod · 0.45
PtoGMethod · 0.45
xMethod · 0.45
yMethod · 0.45
hideMethod · 0.45

Tested by

no test coverage detected