diff options
author | Yury Melnichek <melnichek@gmail.com> | 2011-09-11 12:55:32 +0400 |
---|---|---|
committer | Alex Zolotarev <alex@maps.me> | 2015-09-23 01:23:40 +0300 |
commit | b12e8e71f78368eddd04049006cdca51292ab740 (patch) | |
tree | 6cc70a8ba7c182938c3c5577a4453babc6ba2288 /geometry/covering.hpp | |
parent | d78bbb9321f088a1243ed98667aaaa3d787b8aba (diff) |
Remove minId сondition from covering::Covering.
Diffstat (limited to 'geometry/covering.hpp')
-rw-r--r-- | geometry/covering.hpp | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/geometry/covering.hpp b/geometry/covering.hpp index 44ef105bf2..1a78b94ad3 100644 --- a/geometry/covering.hpp +++ b/geometry/covering.hpp @@ -32,14 +32,14 @@ public: m_Covering[cell.Level()].push_back(cell); } - explicit Covering(vector<CellId> const & v, int64_t minId = 0) + explicit Covering(vector<CellId> const & v) { for (size_t i = 0; i < v.size(); ++i) m_Covering[v[i].Level()].push_back(v[i]); Sort(); Unique(); RemoveDuplicateChildren(); - RemoveFullSquares(minId); + RemoveFullSquares(); m_Size = CalculateSize(); } @@ -88,7 +88,7 @@ public: result.push_back(m_Covering[level][i].ToInt64()); } - void Simplify(int64_t minId = 0) + void Simplify() { int cellsSimplified = 0; int const initialSize = m_Size; @@ -97,25 +97,24 @@ public: if (m_Covering[level].size() >= 2) { int const initialLevelSize = static_cast<int>(m_Covering[level].size()); - SimplifyLevel(level, minId); + SimplifyLevel(level); cellsSimplified += initialLevelSize - static_cast<int>(m_Covering[level].size()); if (cellsSimplified > initialSize / 2) break; } } RemoveDuplicateChildren(); - RemoveFullSquares(minId); + RemoveFullSquares(); m_Size = CalculateSize(); } private: - void SimplifyLevel(int level, int64_t minId) + void SimplifyLevel(int level) { map<CellId, uint32_t, LessQueueOrder> parentCellCounts; typedef typename vector<CellId>::const_iterator ConstIteartor; for (ConstIteartor it = m_Covering[level].begin(); it != m_Covering[level].end(); ++it) - if (it->Parent().ToInt64() >= minId) ++parentCellCounts[it->Parent()]; vector<CellId> parentCells, childCells; @@ -214,7 +213,7 @@ private: } } - void RemoveFullSquares(int64_t minId = 0) + void RemoveFullSquares() { vector<CellId> cellsToAppend; for (int level = m_Covering.size() - 1; level >= 0; --level) @@ -231,8 +230,7 @@ private: CellId const parent = a[i].Parent(); if (parent == a[i+1].Parent() && parent == a[i+2].Parent() && - parent == a[i+3].Parent() && - parent.ToInt64() >= minId) + parent == a[i+3].Parent()) { parents.push_back(parent); i += 3; |