本文整理汇总了C++中ref_ptr::AllowPerspective方法的典型用法代码示例。如果您正苦于以下问题:C++ ref_ptr::AllowPerspective方法的具体用法?C++ ref_ptr::AllowPerspective怎么用?C++ ref_ptr::AllowPerspective使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ref_ptr
的用法示例。
在下文中一共展示了ref_ptr::AllowPerspective方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: AcceptMessage
//.........这里部分代码省略.........
blocker.Wait();
}
// Invalidate textures and wait for completion.
{
BaseBlockingMessage::Blocker blocker;
m_commutator->PostMessage(ThreadsCommutator::ResourceUploadThread,
make_unique_dp<InvalidateTexturesMessage>(blocker),
MessagePriority::High);
blocker.Wait();
}
// Invalidate route.
if (m_routeRenderer->GetStartPoint())
{
m2::PointD const & position = m_routeRenderer->GetStartPoint()->m_position;
m_commutator->PostMessage(ThreadsCommutator::ResourceUploadThread,
make_unique_dp<CacheRouteSignMessage>(position, true /* isStart */,
true /* isValid */),
MessagePriority::High);
}
if (m_routeRenderer->GetFinishPoint())
{
m2::PointD const & position = m_routeRenderer->GetFinishPoint()->m_position;
m_commutator->PostMessage(ThreadsCommutator::ResourceUploadThread,
make_unique_dp<CacheRouteSignMessage>(position, false /* isStart */,
true /* isValid */),
MessagePriority::High);
}
auto const & routeData = m_routeRenderer->GetRouteData();
if (routeData != nullptr)
{
auto recacheRouteMsg = make_unique_dp<AddRouteMessage>(routeData->m_sourcePolyline,
routeData->m_sourceTurns,
routeData->m_color);
m_routeRenderer->Clear(true /* keepDistanceFromBegin */);
m_commutator->PostMessage(ThreadsCommutator::ResourceUploadThread, move(recacheRouteMsg),
MessagePriority::Normal);
}
// Request new tiles.
m_requestedTiles->Set(screen, m_isIsometry || screen.isPerspective(), move(tiles));
m_commutator->PostMessage(ThreadsCommutator::ResourceUploadThread,
make_unique_dp<UpdateReadManagerMessage>(),
MessagePriority::UberHighSingleton);
break;
}
case Message::EnablePerspective:
{
ref_ptr<EnablePerspectiveMessage> const msg = message;
AddUserEvent(EnablePerspectiveEvent(msg->GetRotationAngle(), msg->GetAngleFOV(),
false /* animated */, true /* immediately start */));
break;
}
case Message::Allow3dMode:
{
ref_ptr<Allow3dModeMessage> const msg = message;
bool const isPerspective = m_userEventStream.GetCurrentScreen().isPerspective();
#ifdef OMIM_OS_DESKTOP
if (m_enablePerspectiveInNavigation == msg->AllowPerspective() &&
m_enablePerspectiveInNavigation != isPerspective)
{
if (m_enablePerspectiveInNavigation)
AddUserEvent(EnablePerspectiveEvent(msg->GetRotationAngle(), msg->GetAngleFOV(),
false /* animated */, true /* immediately start */));
else
AddUserEvent(DisablePerspectiveEvent());
}
#endif
m_enablePerspectiveInNavigation = msg->AllowPerspective();
m_enable3dBuildings = msg->Allow3dBuildings();
if (m_myPositionController->IsInRouting())
{
if (m_enablePerspectiveInNavigation && !isPerspective && !m_perspectiveDiscarded)
{
AddUserEvent(EnablePerspectiveEvent(msg->GetRotationAngle(), msg->GetAngleFOV(),
true /* animated */, true /* immediately start */));
}
else if (!m_enablePerspectiveInNavigation && (isPerspective || m_perspectiveDiscarded))
{
DisablePerspective();
}
}
break;
}
case Message::Invalidate:
{
// Do nothing here, new frame will be rendered because of this message processing.
break;
}
default:
ASSERT(false, ());
}
}