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

Method ProcessSelection

libs/drape_frontend/frontend_renderer.cpp:1302–1349  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1300}
1301
1302void FrontendRenderer::ProcessSelection(ref_ptr<SelectObjectMessage> msg)
1303{
1304 if (msg->IsDismiss())
1305 {
1306 m_selectionShape->Hide();
1307 if (msg->ShouldRestoreViewport() && !m_myPositionController->IsModeChangeViewport() && m_selectionTrackInfo)
1308 {
1309 AddUserEvent(make_unique_dp<SetAnyRectEvent>(m_selectionTrackInfo->m_startRect, true /* isAnim */,
1310 false /* fitInViewport */, false /* useVisibleViewport */));
1311 }
1312 m_selectionTrackInfo.reset();
1313 }
1314 else
1315 {
1316 double offsetZ = 0.0;
1317 ScreenBase modelView;
1318 m_userEventStream.GetTargetScreen(modelView);
1319
1320 if (modelView.isPerspective() && msg->GetSelectedObject() != SelectionShape::ESelectedObject::OBJECT_TRACK)
1321 {
1322 dp::TOverlayContainer selectResult;
1323 if (m_overlayTree->IsNeedUpdate())
1324 BuildOverlayTree(modelView);
1325 m_overlayTree->Select(msg->GetPosition(), selectResult);
1326 for (ref_ptr<dp::OverlayHandle> const & handle : selectResult)
1327 offsetZ = std::max(offsetZ, handle->GetPivotZ());
1328 }
1329
1330 if (msg->IsSelectionShapeVisible())
1331 m_selectionShape->Show(msg->GetSelectedObject(), msg->GetPosition(), offsetZ, msg->IsAnim());
1332 else
1333 m_selectionShape->Hide();
1334
1335 if (!m_myPositionController->IsModeChangeViewport())
1336 {
1337 if (auto const startPosition = m_selectionShape->GetPixelPosition(modelView, GetCurrentZoom()))
1338 m_selectionTrackInfo = SelectionTrackInfo(modelView.GlobalRect(), *startPosition);
1339 }
1340
1341 if (msg->IsGeometrySelectionAllowed())
1342 {
1343 m_commutator->PostMessage(
1344 ThreadsCommutator::ResourceUploadThread,
1345 make_unique_dp<CheckSelectionGeometryMessage>(msg->GetFeatureID(), m_selectionShape->GetRecacheId()),
1346 MessagePriority::Normal);
1347 }
1348 }
1349}
1350
1351void FrontendRenderer::BeginUpdateOverlayTree(ScreenBase const & modelView)
1352{

Callers

nothing calls this directly

Calls 15

SelectionTrackInfoClass · 0.85
IsDismissMethod · 0.80
ShouldRestoreViewportMethod · 0.80
IsModeChangeViewportMethod · 0.80
isPerspectiveMethod · 0.80
IsNeedUpdateMethod · 0.80
GetPivotZMethod · 0.80
GetPixelPositionMethod · 0.80
HideMethod · 0.45
resetMethod · 0.45

Tested by

no test coverage detected