本文整理汇总了C++中ref_ptr::GetType方法的典型用法代码示例。如果您正苦于以下问题:C++ ref_ptr::GetType方法的具体用法?C++ ref_ptr::GetType怎么用?C++ ref_ptr::GetType使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ref_ptr
的用法示例。
在下文中一共展示了ref_ptr::GetType方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: AnimationStarted
void MyPositionController::AnimationStarted(ref_ptr<Animation> anim)
{
if (m_isPendingAnimation && m_animCreator != nullptr && anim != nullptr &&
(anim->GetType() == Animation::MapFollow ||
anim->GetType() == Animation::MapLinear))
{
m_isPendingAnimation = false;
double const kDoNotChangeDuration = -1.0;
m_animCreator(anim->GetType() == Animation::MapFollow ? anim->GetDuration() : kDoNotChangeDuration);
}
}
示例2: AcceptMessage
void BackendRenderer::AcceptMessage(ref_ptr<Message> message)
{
switch (message->GetType())
{
case Message::UpdateReadManager:
{
TTilesCollection tiles = m_requestedTiles->GetTiles();
if (!tiles.empty())
{
ScreenBase const screen = m_requestedTiles->GetScreen();
bool const have3dBuildings = m_requestedTiles->Have3dBuildings();
m_readManager->UpdateCoverage(screen, have3dBuildings, tiles, m_texMng);
m_updateCurrentCountryFn(screen.ClipRect().Center(), (*tiles.begin()).m_zoomLevel);
}
break;
}
case Message::InvalidateReadManagerRect:
{
ref_ptr<InvalidateReadManagerRectMessage> msg = message;
if (msg->NeedInvalidateAll())
m_readManager->InvalidateAll();
else
m_readManager->Invalidate(msg->GetTilesForInvalidate());
break;
}
case Message::ShowChoosePositionMark:
{
RecacheChoosePositionMark();
break;
}
case Message::GuiRecache:
{
ref_ptr<GuiRecacheMessage> msg = message;
RecacheGui(msg->GetInitInfo(), msg->NeedResetOldGui());
#ifdef RENRER_DEBUG_INFO_LABELS
RecacheDebugLabels();
#endif
break;
}
case Message::GuiLayerLayout:
{
ref_ptr<GuiLayerLayoutMessage> msg = message;
m_commutator->PostMessage(ThreadsCommutator::RenderThread,
make_unique_dp<GuiLayerLayoutMessage>(msg->AcceptLayoutInfo()),
MessagePriority::Normal);
break;
}
case Message::TileReadStarted:
{
ref_ptr<TileReadStartMessage> msg = message;
m_batchersPool->ReserveBatcher(msg->GetKey());
break;
}
case Message::TileReadEnded:
{
ref_ptr<TileReadEndMessage> msg = message;
m_batchersPool->ReleaseBatcher(msg->GetKey());
break;
}
case Message::FinishTileRead:
{
ref_ptr<FinishTileReadMessage> msg = message;
m_commutator->PostMessage(ThreadsCommutator::RenderThread,
make_unique_dp<FinishTileReadMessage>(msg->MoveTiles()),
MessagePriority::Normal);
break;
}
case Message::FinishReading:
{
TOverlaysRenderData overlays;
overlays.swap(m_overlays);
if (!overlays.empty())
{
m_commutator->PostMessage(ThreadsCommutator::RenderThread,
make_unique_dp<FlushOverlaysMessage>(move(overlays)),
MessagePriority::Normal);
}
break;
}
case Message::MapShapesRecache:
{
RecacheMapShapes();
break;
}
case Message::MapShapeReaded:
{
ref_ptr<MapShapeReadedMessage> msg = message;
auto const & tileKey = msg->GetKey();
if (m_requestedTiles->CheckTileKey(tileKey) && m_readManager->CheckTileKey(tileKey))
//.........这里部分代码省略.........
示例3: AcceptMessage
void BackendRenderer::AcceptMessage(ref_ptr<Message> message)
{
switch (message->GetType())
{
case Message::UpdateReadManager:
{
TTilesCollection tiles = m_requestedTiles->GetTiles();
if (!tiles.empty())
{
ScreenBase const screen = m_requestedTiles->GetScreen();
m_readManager->UpdateCoverage(screen, tiles, m_texMng);
gui::CountryStatusHelper & helper = gui::DrapeGui::Instance().GetCountryStatusHelper();
if ((*tiles.begin()).m_zoomLevel > scales::GetUpperWorldScale())
m_model.UpdateCountryIndex(helper.GetCountryIndex(), screen.ClipRect().Center());
else
helper.Clear();
}
break;
}
case Message::InvalidateReadManagerRect:
{
ref_ptr<InvalidateReadManagerRectMessage> msg = message;
m_readManager->Invalidate(msg->GetTilesForInvalidate());
break;
}
case Message::CountryStatusRecache:
{
RecacheCountryStatus();
break;
}
case Message::GuiRecache:
{
ref_ptr<GuiRecacheMessage> msg = message;
RecacheGui(msg->GetInitInfo(), msg->GetSizeInfoMap());
break;
}
case Message::GuiLayerLayout:
{
ref_ptr<GuiLayerLayoutMessage> msg = message;
m_commutator->PostMessage(ThreadsCommutator::RenderThread,
make_unique_dp<GuiLayerLayoutMessage>(msg->AcceptLayoutInfo()),
MessagePriority::Normal);
RecacheCountryStatus();
break;
}
case Message::TileReadStarted:
{
m_batchersPool->ReserveBatcher(static_cast<ref_ptr<BaseTileMessage>>(message)->GetKey());
break;
}
case Message::TileReadEnded:
{
ref_ptr<TileReadEndMessage> msg = message;
m_batchersPool->ReleaseBatcher(msg->GetKey());
break;
}
case Message::FinishReading:
{
ref_ptr<FinishReadingMessage> msg = message;
m_commutator->PostMessage(ThreadsCommutator::RenderThread,
make_unique_dp<FinishReadingMessage>(move(msg->MoveTiles())),
MessagePriority::Normal);
break;
}
case Message::MapShapeReaded:
{
ref_ptr<MapShapeReadedMessage> msg = message;
auto const & tileKey = msg->GetKey();
if (m_requestedTiles->CheckTileKey(tileKey) && m_readManager->CheckTileKey(tileKey))
{
ref_ptr<dp::Batcher> batcher = m_batchersPool->GetTileBatcher(tileKey);
for (drape_ptr<MapShape> const & shape : msg->GetShapes())
shape->Draw(batcher, m_texMng);
}
break;
}
case Message::UpdateUserMarkLayer:
{
ref_ptr<UpdateUserMarkLayerMessage> msg = message;
TileKey const & key = msg->GetKey();
UserMarksProvider const * marksProvider = msg->StartProcess();
if (marksProvider->IsDirty())
{
m_commutator->PostMessage(ThreadsCommutator::RenderThread,
make_unique_dp<ClearUserMarkLayerMessage>(key),
MessagePriority::Normal);
m_batchersPool->ReserveBatcher(key);
CacheUserMarks(marksProvider, m_batchersPool->GetTileBatcher(key), m_texMng);
m_batchersPool->ReleaseBatcher(key);
}
msg->EndProcess();
break;
}
case Message::CountryInfoUpdate:
{
ref_ptr<CountryInfoUpdateMessage> msg = message;
gui::CountryStatusHelper & helper = gui::DrapeGui::Instance().GetCountryStatusHelper();
//.........这里部分代码省略.........
示例4: AcceptMessage
void FrontendRenderer::AcceptMessage(ref_ptr<Message> message)
{
switch (message->GetType())
{
case Message::FlushTile:
{
ref_ptr<FlushRenderBucketMessage> msg = message;
dp::GLState const & state = msg->GetState();
TileKey const & key = msg->GetKey();
drape_ptr<dp::RenderBucket> bucket = msg->AcceptBuffer();
ref_ptr<dp::GpuProgram> program = m_gpuProgramManager->GetProgram(state.GetProgramIndex());
ref_ptr<dp::GpuProgram> program3d = m_gpuProgramManager->GetProgram(state.GetProgram3dIndex());
bool const isPerspective = m_userEventStream.GetCurrentScreen().isPerspective();
if (isPerspective)
program3d->Bind();
else
program->Bind();
bucket->GetBuffer()->Build(isPerspective ? program3d : program);
if (!IsUserMarkLayer(key))
{
if (CheckTileGenerations(key))
m_tileTree->ProcessTile(key, GetCurrentZoomLevelForData(), state, move(bucket));
}
else
{
m_userMarkRenderGroups.emplace_back(make_unique_dp<UserMarkRenderGroup>(state, key, move(bucket)));
m_userMarkRenderGroups.back()->SetRenderParams(program, program3d, make_ref(&m_generalUniforms));
}
break;
}
case Message::FinishReading:
{
ref_ptr<FinishReadingMessage> msg = message;
for (auto const & tileKey : msg->GetTiles())
CheckTileGenerations(tileKey);
m_tileTree->FinishTiles(msg->GetTiles(), GetCurrentZoomLevelForData());
break;
}
case Message::InvalidateRect:
{
ref_ptr<InvalidateRectMessage> m = message;
TTilesCollection tiles;
ScreenBase screen = m_userEventStream.GetCurrentScreen();
m2::RectD rect = m->GetRect();
if (rect.Intersect(screen.ClipRect()))
{
m_tileTree->Invalidate();
ResolveTileKeys(rect, tiles);
auto eraseFunction = [&tiles](vector<drape_ptr<RenderGroup>> & groups)
{
vector<drape_ptr<RenderGroup> > newGroups;
for (drape_ptr<RenderGroup> & group : groups)
{
if (tiles.find(group->GetTileKey()) == tiles.end())
newGroups.push_back(move(group));
}
swap(groups, newGroups);
};
eraseFunction(m_renderGroups);
eraseFunction(m_deferredRenderGroups);
BaseBlockingMessage::Blocker blocker;
m_commutator->PostMessage(ThreadsCommutator::ResourceUploadThread,
make_unique_dp<InvalidateReadManagerRectMessage>(blocker, tiles),
MessagePriority::High);
blocker.Wait();
m_requestedTiles->Set(screen, m_isIsometry || screen.isPerspective(), move(tiles));
m_commutator->PostMessage(ThreadsCommutator::ResourceUploadThread,
make_unique_dp<UpdateReadManagerMessage>(),
MessagePriority::UberHighSingleton);
}
break;
}
case Message::ClearUserMarkLayer:
{
TileKey const & tileKey = ref_ptr<ClearUserMarkLayerMessage>(message)->GetKey();
auto const functor = [&tileKey](drape_ptr<UserMarkRenderGroup> const & g)
{
return g->GetTileKey() == tileKey;
};
auto const iter = remove_if(m_userMarkRenderGroups.begin(),
m_userMarkRenderGroups.end(),
functor);
m_userMarkRenderGroups.erase(iter, m_userMarkRenderGroups.end());
break;
}
case Message::ChangeUserMarkLayerVisibility:
{
ref_ptr<ChangeUserMarkLayerVisibilityMessage> m = message;
TileKey const & key = m->GetKey();
//.........这里部分代码省略.........