本文整理汇总了C++中NBEdge::append方法的典型用法代码示例。如果您正苦于以下问题:C++ NBEdge::append方法的具体用法?C++ NBEdge::append怎么用?C++ NBEdge::append使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NBEdge
的用法示例。
在下文中一共展示了NBEdge::append方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: erase
unsigned int
NBNodeCont::removeUnwishedNodes(NBDistrictCont& dc, NBEdgeCont& ec,
NBJoinedEdgesMap& je, NBTrafficLightLogicCont& tlc,
bool removeGeometryNodes) {
unsigned int no = 0;
std::vector<NBNode*> toRemove;
for (NodeCont::iterator i = myNodes.begin(); i != myNodes.end(); i++) {
NBNode* current = (*i).second;
bool remove = false;
std::vector<std::pair<NBEdge*, NBEdge*> > toJoin;
// check for completely empty nodes
if (current->getOutgoingEdges().size() == 0 && current->getIncomingEdges().size() == 0) {
// remove if empty
remove = true;
}
// check for nodes which are only geometry nodes
if (removeGeometryNodes) {
if ((current->getOutgoingEdges().size() == 1 && current->getIncomingEdges().size() == 1)
||
(current->getOutgoingEdges().size() == 2 && current->getIncomingEdges().size() == 2)) {
// ok, one in, one out or two in, two out
// -> ask the node whether to join
remove = current->checkIsRemovable();
if (remove) {
toJoin = current->getEdgesToJoin();
}
}
}
// remove the node and join the geometries when wished
if (!remove) {
continue;
}
for (std::vector<std::pair<NBEdge*, NBEdge*> >::iterator j = toJoin.begin(); j != toJoin.end(); j++) {
NBEdge* begin = (*j).first;
NBEdge* continuation = (*j).second;
begin->append(continuation);
continuation->getToNode()->replaceIncoming(continuation, begin, 0);
tlc.replaceRemoved(continuation, -1, begin, -1);
je.appended(begin->getID(), continuation->getID());
ec.erase(dc, continuation);
}
toRemove.push_back(current);
no++;
}
// erase all
for (std::vector<NBNode*>::iterator j = toRemove.begin(); j != toRemove.end(); ++j) {
erase(*j);
}
return no;
}