本文整理汇总了C++中GNEEdge::getLaneGlIDs方法的典型用法代码示例。如果您正苦于以下问题:C++ GNEEdge::getLaneGlIDs方法的具体用法?C++ GNEEdge::getLaneGlIDs怎么用?C++ GNEEdge::getLaneGlIDs使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GNEEdge
的用法示例。
在下文中一共展示了GNEEdge::getLaneGlIDs方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
long
GNEConnectorFrame::onCmdSelectDeadStarts(FXObject*, FXSelector, void*) {
GNENet* net = myViewNet->getNet();
std::set<GUIGlID> selectIDs;
// every edge knows only its outgoing connections so we look at whole junctions
const std::vector<GNEJunction*> junctions = net->retrieveJunctions();
for (std::vector<GNEJunction*>::const_iterator junction_it = junctions.begin(); junction_it != junctions.end(); junction_it++) {
// first collect all outgoing lanes
const EdgeVector& outgoing = (*junction_it)->getNBNode()->getOutgoingEdges();
for (EdgeVector::const_iterator it = outgoing.begin(); it != outgoing.end(); it++) {
GNEEdge* edge = net->retrieveEdge((*it)->getID());
const std::set<GUIGlID> laneIDs = edge->getLaneGlIDs();
for (std::set<GUIGlID>::const_iterator lid_it = laneIDs.begin(); lid_it != laneIDs.end(); lid_it++) {
selectIDs.insert(*lid_it);
}
}
// then remove all approached lanes
const EdgeVector& incoming = (*junction_it)->getNBNode()->getIncomingEdges();
for (EdgeVector::const_iterator it = incoming.begin(); it != incoming.end(); it++) {
GNEEdge* edge = net->retrieveEdge((*it)->getID());
NBEdge* nbe = edge->getNBEdge();
const std::vector<NBEdge::Connection>& connections = nbe->getConnections();
for (std::vector<NBEdge::Connection>::const_iterator con_it = connections.begin(); con_it != connections.end(); con_it++) {
GNEEdge* approachedEdge = net->retrieveEdge(con_it->toEdge->getID());
GNELane* approachedLane = approachedEdge->getLanes()[con_it->toLane];
selectIDs.erase(approachedLane->getGlID());
}
}
}
myViewNet->getViewParent()->getSelectorFrame()->handleIDs(
std::vector<GUIGlID>(selectIDs.begin(), selectIDs.end()),
false, GNESelectorFrame::SET_REPLACE);
return 1;
}