Skip to content

Commit

Permalink
now recording original node ids. refs #4902
Browse files Browse the repository at this point in the history
  • Loading branch information
namdre committed Jan 4, 2019
1 parent 1f6fe1e commit 6752f52
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/netbuild/NBNodeCont.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1056,6 +1056,7 @@ NBNodeCont::shortestEdge(const NodeSet& cluster, const NodeSet& startNodes, cons
void
NBNodeCont::joinNodeClusters(NodeClusters clusters,
NBDistrictCont& dc, NBEdgeCont& ec, NBTrafficLightLogicCont& tlc) {
const bool origNames = OptionsCont::getOptions().getBool("output.original-names");
for (NodeClusters::iterator i = clusters.begin(); i != clusters.end(); ++i) {
NodeSet cluster = *i;
assert(cluster.size() > 1);
Expand Down Expand Up @@ -1112,6 +1113,13 @@ NBNodeCont::joinNodeClusters(NodeClusters clusters,
const bool outgoing = cluster.count(e->getFromNode()) > 0;
NBNode* from = outgoing ? newNode : e->getFromNode();
NBNode* to = outgoing ? e->getToNode() : newNode;
if (origNames) {
if (outgoing) {
e->setParameter("origFrom", e->getFromNode()->getID());
} else {
e->setParameter("origTo", e->getToNode()->getID());
}
}
e->reinitNodes(from, to);
// re-add connections which previously existed and may still valid.
// connections to removed edges will be ignored
Expand Down

0 comments on commit 6752f52

Please sign in to comment.