Abstracts away over differences in IntersectionView and Intersection.

Usage:

    struct MyIntersection : EnableIntersectionOps<MyIntersection> {

    };

Done.

We require MyIntersection having at least the member attributes from
IntersectionViewData but don't enforce a inheritance hierarchy.
This commit is contained in:
Daniel J. Hofmann
2016-12-02 12:02:42 +01:00
committed by Moritz Kobitzsch
parent 928a6f0c7d
commit 9d8b92f418
5 changed files with 47 additions and 62 deletions
@@ -57,16 +57,17 @@ class IntersectionNormalizer
const IntersectionGenerator &intersection_generator;
// check if two indices in an intersection can be seen as a single road in the perceived
// intersection representation. See below for an example. Utility function for
// MergeSegregatedRoads. It also checks for neighboring merges.
// This is due possible segments where multiple roads could end up being merged into one.
// We only support merging two roads, not three or more, though.
// c c
// / /
// a - b -> a - b - (c,d) but not a - b d -> a,b,(cde)
// \ \
// d e
/* check if two indices in an intersection can be seen as a single road in the perceived
* intersection representation. See below for an example. Utility function for
* MergeSegregatedRoads. It also checks for neighboring merges.
* This is due possible segments where multiple roads could end up being merged into one.
* We only support merging two roads, not three or more, though.
* c c
* / /
* a - b -> a - b - (c,d) but not a - b d -> a,b,(cde)
* \ \
* d e
*/
bool CanMerge(const NodeID intersection_node,
const IntersectionShape &intersection,
std::size_t first_index,