diff options
author | Darafei Praliaskouski <komzpa@gmail.com> | 2013-01-18 15:51:19 +0400 |
---|---|---|
committer | Alex Zolotarev <alex@maps.me> | 2015-09-23 01:48:58 +0300 |
commit | dcbb82e287ed4067fc9d4240dcb99e7a3b3c6a95 (patch) | |
tree | 6b99c873b492ffdffc1e66240081f2f4a5b6f154 /indexer/classificator.cpp | |
parent | f8166a04273b95b19078f04eba0b753be135633d (diff) |
suitable_getter refactor
Diffstat (limited to 'indexer/classificator.cpp')
-rw-r--r-- | indexer/classificator.cpp | 26 |
1 files changed, 9 insertions, 17 deletions
diff --git a/indexer/classificator.cpp b/indexer/classificator.cpp index 9c8c1a8562..2a2070bdeb 100644 --- a/indexer/classificator.cpp +++ b/indexer/classificator.cpp @@ -308,7 +308,7 @@ namespace static const int visible[3][drule::count_of_rules] = { {0, 0, 1, 1, 1, 0, 0}, // fpoint {1, 0, 0, 0, 0, 1, 0}, // fline - {1, 1, 1, 1, 0, 1, 0} // farea + {1, 1, 1, 1, 0, 0, 0} // farea }; if (visible[ft][i->m_type] == 1) @@ -318,17 +318,6 @@ namespace } } - void look_forward(int ft) - { - if (m_scales[0] < 0) return; - iter_t i = m_iters[0]; - do - { - add_rule(ft, i); - ++i; - } while (i != m_rules.end() && i->m_scale == m_scales[0]); - } - public: suitable_getter(vec_t const & rules, vec_t & keys) : m_rules(rules), m_keys(keys) @@ -344,11 +333,15 @@ namespace else m_scales[0] = -1000; - // if drawing rules exist for 'scale', than process and exit + // if drawing rules exist for 'scale', then process and exit if (scale == m_scales[0]) { - look_forward(ft); - return; + if (m_scales[0] < 0) return; + iter_t i = m_iters[0]; + do + { + add_rule(ft, i++); + } while (i != m_rules.end() && i->m_scale == m_scales[0]); } } }; @@ -362,8 +355,7 @@ void ClassifObject::GetSuitable(int scale, FeatureGeoType ft, vector<drule::Key> if (!m_visibility[scale]) return; - // special for AlexZ - // find rules for 'scale' or if no - for nearest to 'scale' scale + // find rules for 'scale' suitable_getter rulesGetter(m_drawRule, keys); rulesGetter.find(ft, scale); } |