Fix bug in statistic. Choose best geometry for feature size calculating.

This commit is contained in:
vng 2011-08-26 19:48:48 +03:00 committed by Alex Zolotarev
parent 51e8dbb183
commit 0495475b7c
3 changed files with 6 additions and 4 deletions

View file

@ -80,6 +80,7 @@ namespace stats
m_info.m_inner[1].Add(innerStats.m_Strips);
m_info.m_inner[2].Add(innerStats.m_Size);
// get geometry size for the best geometry (-1)
FeatureType::geom_stat_t const geom = f.GetGeometrySize(-1);
FeatureType::geom_stat_t const trg = f.GetTrianglesSize(-1);

View file

@ -297,14 +297,14 @@ int LoaderCurrent::GetScaleIndex(int scale, offsets_t const & offsets) const
switch (scale)
{
case -2:
// Choose the worst existing geometry.
case -1:
// Choose the best existing geometry for the last visible scale.
ind = count-1;
while (ind >= 0 && offsets[ind] == kInvalidOffset) --ind;
break;
case -1:
// Choose the best geometry for the last visible scale.
case -2:
// Choose the worst existing geometry for the first visible scale.
ind = 0;
while (ind < count && offsets[ind] == kInvalidOffset) ++ind;
break;

View file

@ -45,6 +45,7 @@ namespace
m_timer.Reset();
// Call this function to load feature's inner data and geometry.
(void)ft.IsEmptyGeometry(m_scale);
m_reading += m_timer.ElapsedSeconds();