本文整理汇总了C++中GNEEdge::moveGeometry方法的典型用法代码示例。如果您正苦于以下问题:C++ GNEEdge::moveGeometry方法的具体用法?C++ GNEEdge::moveGeometry怎么用?C++ GNEEdge::moveGeometry使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GNEEdge
的用法示例。
在下文中一共展示了GNEEdge::moveGeometry方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: retrieveJunctions
void
GNENet::moveSelection(const Position& moveSrc, const Position& moveDest) {
Position delta = moveDest - moveSrc;
// move junctions
std::set<GNEJunction*> junctionSet;
std::vector<GNEJunction*> junctions = retrieveJunctions(true);
for (std::vector<GNEJunction*>::iterator it = junctions.begin(); it != junctions.end(); it++) {
Position newPos = (*it)->getNBNode()->getPosition() + delta;
(*it)->move(newPos);
junctionSet.insert(*it);
}
// move edge geometry (endpoints are already moved)
std::vector<GNEEdge*> edges = retrieveEdges(true);
for (std::vector<GNEEdge*>::iterator it = edges.begin(); it != edges.end(); it++) {
GNEEdge* edge = *it;
if (edge) {
if (junctionSet.count(edge->getSource()) > 0 &&
junctionSet.count(edge->getDest()) > 0) {
// edge and its endpoints are selected, move all the inner points as well
edge->moveGeometry(delta);
} else {
// move only geometry near mouse
edge->moveGeometry(moveSrc, delta, true);
}
}
}
}