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

Method CreateAnim

libs/drape_frontend/my_position_controller.cpp:861–891  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

859}
860
861void MyPositionController::CreateAnim(m2::PointD const & oldPos, double oldAzimut, ScreenBase const & screen)
862{
863 double const moveDuration = PositionInterpolator::GetMoveDuration(oldPos, m_position, screen);
864 double const rotateDuration = AngleInterpolator::GetRotateDuration(oldAzimut, m_drawDirection);
865 if (df::IsAnimationAllowed(std::max(moveDuration, rotateDuration), screen))
866 {
867 if (IsModeChangeViewport())
868 {
869 m_animCreator = [this, moveDuration](ref_ptr<Animation> syncAnim) -> drape_ptr<Animation>
870 {
871 drape_ptr<Animation> anim = make_unique_dp<ArrowAnimation>(
872 GetDrawablePosition(), m_position, syncAnim == nullptr ? moveDuration : syncAnim->GetDuration(),
873 GetDrawableAzimut(), m_drawDirection);
874 if (syncAnim != nullptr)
875 {
876 anim->SetMaxDuration(syncAnim->GetMaxDuration());
877 anim->SetMinDuration(syncAnim->GetMinDuration());
878 }
879 return anim;
880 };
881 m_oldPosition = oldPos;
882 m_oldDrawDirection = oldAzimut;
883 m_isPendingAnimation = true;
884 }
885 else
886 {
887 AnimationSystem::Instance().CombineAnimation(
888 make_unique_dp<ArrowAnimation>(oldPos, m_position, moveDuration, oldAzimut, m_drawDirection));
889 }
890 }
891}
892
893void MyPositionController::EnablePerspectiveInRouting(bool enablePerspective)
894{

Callers

nothing calls this directly

Calls 8

IsAnimationAllowedFunction · 0.85
IsModeChangeViewportFunction · 0.85
CombineAnimationMethod · 0.80
GetDurationMethod · 0.45
SetMaxDurationMethod · 0.45
GetMaxDurationMethod · 0.45
SetMinDurationMethod · 0.45
GetMinDurationMethod · 0.45

Tested by

no test coverage detected