From a208d78fbbaa4963853e8466e16b706790239636 Mon Sep 17 00:00:00 2001 From: ExMix Date: Sun, 29 Mar 2015 19:16:44 +0300 Subject: [PATCH] [drape] remove old code --- map/framework.cpp | 1 - map/information_display.cpp | 233 +----------------------------------- map/information_display.hpp | 43 +------ 3 files changed, 2 insertions(+), 275 deletions(-) diff --git a/map/framework.cpp b/map/framework.cpp index ead2a491cc..6e697e800e 100644 --- a/map/framework.cpp +++ b/map/framework.cpp @@ -167,7 +167,6 @@ Framework::Framework() m_width(0), m_height(0), m_animController(new anim::Controller), - m_informationDisplay(this), m_bmManager(*this), m_balloonManager(*this), m_fixedSearchResults(0), diff --git a/map/information_display.cpp b/map/information_display.cpp index 50360f37a7..f91ed26197 100644 --- a/map/information_display.cpp +++ b/map/information_display.cpp @@ -10,81 +10,7 @@ #include "geometry/transformations.hpp" -namespace -{ - static int const RULLER_X_OFFSET = 6; - static int const RULLER_Y_OFFSET = 42; - static int const FONT_SIZE = 14; - static int const COMPASS_X_OFFSET = 8; - static int const COMPASS_Y_OFFSET = 65; -#ifdef OMIM_OS_ANDROID - static double const RULLER_X_OFFSET_L = 70.4; - static double const RULLER_Y_OFFSET_L = 10.5; - static int const COMPASS_X_OFFSET_L = 18; - static double const COMPASS_Y_OFFSET_L = 11.4; -#endif -} - -InformationDisplay::InformationDisplay(Framework * fw) - : m_framework(fw) -{ - ///@TODO UVR - //m_fontDesc.m_color = Color(0x4D, 0x4D, 0x4D, 0xCC); - - InitRuler(fw); - InitCompassArrow(fw); - InitLocationState(fw); - InitDebugLabel(); - InitCopyright(fw); - -#ifndef DEBUG - enableDebugInfo(false); -#endif - - setVisualScale(1); -} - -void InformationDisplay::InitRuler(Framework * fw) -{ - ///@TODO UVR -// Ruler::Params p; - -// p.m_depth = rulerDepth; -// p.m_position = EPosAboveLeft; -// p.m_framework = fw; - -// m_ruler.reset(new Ruler(p)); -// m_ruler->setIsVisible(false); -} - -void InformationDisplay::InitCopyright(Framework * fw) -{ - ///@TODO UVR -// gui::CachedTextView::Params p; - -// p.m_depth = rulerDepth; -// p.m_position = EPosAboveLeft; -// p.m_pivot = m2::PointD(0, 0); -// p.m_text = "Map data © OpenStreetMap"; - -// m_copyrightLabel.reset(new gui::CachedTextView(p)); -} - -void InformationDisplay::InitCompassArrow(Framework * fw) -{ - ///@TODO UVR -// CompassArrow::Params p; - -// p.m_position = EPosCenter; -// p.m_depth = compassDepth; -// p.m_pivot = m2::PointD(0, 0); -// p.m_framework = fw; - -// m_compassArrow.reset(new CompassArrow(p)); -// m_compassArrow->setIsVisible(false); -} - -void InformationDisplay::InitLocationState(Framework * fw) +void InformationDisplay::InitLocationState() { ///@TODO UVR // location::State::Params p; @@ -98,163 +24,6 @@ void InformationDisplay::InitLocationState(Framework * fw) // m_locationState.reset(new location::State(p)); } -void InformationDisplay::InitDebugLabel() -{ - ///@TODO UVR -// gui::CachedTextView::Params p; - -// p.m_depth = debugDepth; -// p.m_position = EPosAboveRight; -// p.m_pivot = m2::PointD(0, 0); - -// m_debugLabel.reset(new gui::CachedTextView(p)); -} - - ///@TODO UVR -//void InformationDisplay::setController(gui::Controller * controller) -//{ -// m_controller = controller; -// m_controller->AddElement(m_countryStatusDisplay); -// m_controller->AddElement(m_compassArrow); -// m_controller->AddElement(m_locationState); -// m_controller->AddElement(m_ruler); -// m_controller->AddElement(m_debugLabel); - -// m_controller->AddElement(m_copyrightLabel); -// shared_ptr task(new AlfaAnimationTask(1.0, 0.0, 0.15, 3.0, m_framework)); -// task->AddCallback(anim::Task::EEnded, [this] () -// { -// m_controller->RemoveElement(m_copyrightLabel); -// m_copyrightLabel.reset(); -// }); - -// m_copyrightLabel->setAnimated([task] () -// { -// AlfaAnimationTask * t = static_cast(task.get()); -// return t->GetCurrentAlfa(); -// }); - -// m_framework->GetAnimController()->AddTask(task); -//} - -void InformationDisplay::SetWidgetPivotsByDefault(int screenWidth, int screenHeight) -{ - - ///@TODO UVR -// double rulerOffsX = RULLER_X_OFFSET; -// double rulerOffsY = RULLER_Y_OFFSET; -// double compassOffsX = COMPASS_X_OFFSET; -// double compassOffsY = COMPASS_Y_OFFSET; -//#ifdef OMIM_OS_ANDROID -// if (GetPlatform().IsTablet()) -// { -// rulerOffsX = RULLER_X_OFFSET_L; -// rulerOffsY = RULLER_Y_OFFSET_L; -// compassOffsX = COMPASS_X_OFFSET_L; -// compassOffsY = COMPASS_Y_OFFSET_L; -// } -//#endif - -// double const vs = m_framework->GetVisualScale(); -// m_countryStatusDisplay->setPivot(m2::PointD(rect.Center())); - -// m2::PointD const size = m_compassArrow->GetPixelSize(); -// m_compassArrow->setPivot(m2::PointD(compassOffsX * vs + size.x / 2.0, -// rect.maxY() - compassOffsY * vs - size.y / 2.0)); - -// m_ruler->setPivot(m2::PointD(rect.maxX() - rulerOffsX * vs, -// rect.maxY() - rulerOffsY * vs)); - -// if (m_copyrightLabel) -// { -// m_copyrightLabel->setPivot(m2::PointD(rect.maxX() - rulerOffsX * vs, -// rect.maxY() - rulerOffsY * vs)); -// } - -// m_debugLabel->setPivot(m2::PointD(rect.minX() + 10, -// rect.minY() + 50 + 5 * vs)); -} - -bool InformationDisplay::isCopyrightActive() const -{ - ///@TODO UVR - return false;//m_copyrightLabel != nullptr; -} - -void InformationDisplay::enableCopyright(bool doEnable) -{ - if (m_copyrightLabel != nullptr) - m_copyrightLabel->setIsVisible(doEnable); -} - -void InformationDisplay::enableRuler(bool doEnable) -{ - ///@TODO UVR -// if (doEnable) -// m_ruler->AnimateShow(); -// else -// m_ruler->AnimateHide(); -} - -bool InformationDisplay::isRulerEnabled() const -{ - ///@TODO UVR - return false;//m_ruler->isVisible(); -} - -void InformationDisplay::setVisualScale(double visualScale) -{ - ///@TODO UVR -// m_fontDesc.m_size = static_cast(FONT_SIZE * visualScale); - -// m_ruler->setFont(gui::Element::EActive, m_fontDesc); -// m_debugLabel->setFont(gui::Element::EActive, m_fontDesc); -// if (m_copyrightLabel) -// m_copyrightLabel->setFont(gui::Element::EActive, m_fontDesc); -} - -void InformationDisplay::enableDebugInfo(bool doEnable) -{ - ///@TODO UVR - //m_debugLabel->setIsVisible(doEnable); -} - -void InformationDisplay::setDebugInfo(double frameDuration, int currentScale) -{ - ostringstream out; - out << "Scale : " << currentScale; - - ///@TODO UVR - //m_debugLabel->setText(out.str()); -} - -void InformationDisplay::enableCompassArrow(bool doEnable) -{ - ///@TODO UVR -// if (doEnable) -// m_compassArrow->AnimateShow(); -// else -// m_compassArrow->AnimateHide(); -} - -bool InformationDisplay::isCompassArrowEnabled() const -{ - ///@TODO UVR - return false;//m_compassArrow->isVisible(); -} - -void InformationDisplay::setCompassArrowAngle(double angle) -{ - ///@TODO UVR - //m_compassArrow->SetAngle(angle); -} - -void InformationDisplay::setEmptyCountryIndex(storage::TIndex const & idx) -{ - ///@TODO UVR - //m_countryStatusDisplay->SetCountryIndex(idx); -} - shared_ptr const & InformationDisplay::locationState() const { ///@TODO UVR diff --git a/map/information_display.hpp b/map/information_display.hpp index 2471da01b4..4d62eaffe9 100644 --- a/map/information_display.hpp +++ b/map/information_display.hpp @@ -15,35 +15,13 @@ namespace location class State; } -class Framework; -class CompassArrow; -class Ruler; - /// Class, which displays additional information on the primary layer like: /// rules, coordinates, GPS position and heading, compass, Download button, etc. class InformationDisplay { - Framework * m_framework; - ///@TODO UVR - //graphics::FontDesc m_fontDesc; - - shared_ptr m_ruler; - ///@TODO UVR - //gui::Controller * m_controller; - - shared_ptr m_compassArrow; shared_ptr m_locationState; - ///@TODO UVR - //shared_ptr m_debugLabel; - //shared_ptr m_copyrightLabel; - - void InitRuler(Framework * fw); - void InitDebugLabel(); - void InitLocationState(Framework * fw); - void InitCompassArrow(Framework * fw); - - void InitCopyright(Framework * fw); + void InitLocationState(); public: enum class WidgetType { Ruler = 0, @@ -53,31 +31,12 @@ public: DebugLabel }; - InformationDisplay(Framework * framework); - //void setController(gui::Controller * controller); - void setDisplayRect(m2::RectI const & rect); - void setVisualScale(double visualScale); - - bool isCopyrightActive() const; - void enableCopyright(bool doEnable); - - void enableRuler(bool doEnable); - bool isRulerEnabled() const; - - void enableDebugInfo(bool doEnable); - void setDebugInfo(double frameDuration, int currentScale); void measurementSystemChanged(); - void enableCompassArrow(bool doEnable); - bool isCompassArrowEnabled() const; - void setCompassArrowAngle(double angle); - shared_ptr const & locationState() const; - void setEmptyCountryIndex(storage::TIndex const & idx); - void ResetRouteMatchingInfo(); void SetWidgetPivot(WidgetType widget, m2::PointD const & pivot);