[map] unlocked styling for z19

This commit is contained in:
Darafei Praliaskouski 2013-04-26 16:51:27 +03:00 committed by Alex Zolotarev
parent 753b0bf203
commit 040d6c1253
8 changed files with 21 additions and 10 deletions

View file

@ -1,5 +1,6 @@
#include "classificator.hpp"
#include "tree_structure.hpp"
#include "scales.hpp"
#include "../coding/file_reader.hpp"
@ -81,10 +82,13 @@ void ClassifObject::LoadPolicy::Serialize(string const & s)
drule::Key key;
key.fromString(s);
//p->m_drawRule.push_back(key);
// mark as visible in rule's scale
p->m_visibility[key.m_scale] = true;
// mark objects visible on higher zooms as visible on upperScale, to get them into .mwm file
int const upperScale = scales::GetUpperScale();
if (key.m_scale > upperScale)
p->m_visibility[upperScale] = true;
}
void ClassifObject::LoadPolicy::Start(size_t i)

View file

@ -1,6 +1,7 @@
#pragma once
#include "drawing_rule_def.hpp"
#include "types_mapping.hpp"
#include "scales.hpp"
#include "../base/base.hpp"
@ -113,7 +114,7 @@ public:
}
}
typedef bitset<18> visible_mask_t;
typedef bitset<UPPER_STYLE_SCALE+1> visible_mask_t;
visible_mask_t GetVisibilityMask() const { return m_visibility; }
void SetVisibilityMask(visible_mask_t mask) { m_visibility = mask; }
void SetVisibilityOnScale(const bool isVisible, const int scale) { m_visibility[scale] = isVisible; }

View file

@ -126,7 +126,7 @@ void RulesHolder::Clean()
size_t RulesHolder::AddRule(int scale, rule_type_t type, BaseRule * p)
{
ASSERT ( 0 <= scale && scale <= scales::GetUpperScale(), (scale) );
ASSERT ( 0 <= scale && scale <= scales::GetUpperStyleScale(), (scale) );
ASSERT ( 0 <= type && type < count_of_rules, () );
m_container[type].push_back(p);

View file

@ -118,7 +118,7 @@ namespace
bool operator() (ClassifObject const * p, bool & res)
{
res = true;
p->GetSuitable(m_scale, m_ft, m_keys);
p->GetSuitable(min(m_scale, scales::GetUpperStyleScale()), m_ft, m_keys);
return false;
}
};

View file

@ -3,9 +3,12 @@
#include "../geometry/rect2d.hpp"
#include "../geometry/point2d.hpp"
int const UPPER_STYLE_SCALE = 19;
namespace scales
{
inline int GetUpperScale() { return 17; }
inline int GetUpperStyleScale() { return UPPER_STYLE_SCALE; }
inline int GetUpperWorldScale() { return 9; }
double GetM2PFactor(int level);

View file

@ -762,9 +762,10 @@ void Framework::DrawModel(shared_ptr<PaintEvent> const & e,
try
{
int const scale = (m_queryMaxScaleMode ? scales::GetUpperScale() : scaleLevel);
// limit scaleLevel to be not more than upperScale
int const upperScale = scales::GetUpperScale();
int const scale = min((m_queryMaxScaleMode ? upperScale : scaleLevel), upperScale);
//threads::MutexGuard lock(m_modelSyn);
if (isTiling)
m_model.ForEachFeature_TileDrawing(selectRect, doDraw, scale);
else

View file

@ -392,7 +392,7 @@ void ScreenCoverage::Draw(graphics::Screen * s, ScreenBase const & screen)
int ScreenCoverage::GetDrawScale() const
{
return min(m_tiler.tileScale(), scales::GetUpperScale());
return m_tiler.tileScale();
}
bool ScreenCoverage::IsEmptyDrawingCoverage() const

View file

@ -252,13 +252,15 @@ void TileRenderer::DrawTile(core::CommandsQueue::Environment const & env,
frameScreen.PtoG(m2::Inflate(m2::RectD(renderRect), inflationSize, inflationSize), clipRect);
frameScreen.PtoG(m2::RectD(renderRect), selectRect);
// adjusting tileScale to look the same across devices with different tileWidth and visualScale values
int styleTileScale = max((rectInfo.m_tileScale + log(tileWidth / 256.0 / drawer->VisualScale()) / log(2.0)), 1.0);
m_renderFn(
paintEvent,
frameScreen,
selectRect,
clipRect,
min(scales::GetUpperScale(), rectInfo.m_tileScale),
rectInfo.m_tileScale <= scales::GetUpperScale()
styleTileScale,
styleTileScale <= scales::GetUpperScale()
);
drawer->endFrame();