remove id from stored edges

This commit is contained in:
Andrey Chulkov 2020-05-07 18:42:52 +03:00
parent e579a9830c
commit ce082b3389
2 changed files with 10 additions and 3 deletions

View File

@ -525,12 +525,12 @@ void BucketsSinglePolygonIndex::indexBuild(const Polygon & polygon)
{
if (l & 1)
{
this->edges_index_tree[l++].push_back(all_edges[i]);
this->edges_index_tree[l++].eplace_back(all_edges[i]);
++total_index_edges;
}
if (r & 1)
{
this->edges_index_tree[--r].push_back(all_edges[i]);
this->edges_index_tree[--r].emplace_back(all_edges[i]);
++total_index_edges;
}
}

View File

@ -199,6 +199,13 @@ private:
static bool compare2(const Edge & a, const Edge & b);
};
struct EdgeNoId
{
explicit EdgeNoId(const Edge & e): l(e.l), r(e.r) {}
Point l;
Point r;
};
/** Sorted distinct coordinates of all vertexes. */
std::vector<Float64> sorted_x;
std::vector<Edge> all_edges;
@ -218,7 +225,7 @@ private:
* Every polygon's edge covers a segment of x coordinates, and can be added to this tree by
* placing it into O(log n) vertexes of this tree.
*/
std::vector<std::vector<Edge>> edges_index_tree;
std::vector<std::vector<EdgeNoId>> edges_index_tree;
};
}