| 381 | } |
| 382 | |
| 383 | void 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 | |
| 431 | void DrawWidget::keyPressEvent(QKeyEvent * e) |
| 432 | { |
nothing calls this directly
no test coverage detected