本文整理汇总了C++中NBNode::computeInternalLaneShape方法的典型用法代码示例。如果您正苦于以下问题:C++ NBNode::computeInternalLaneShape方法的具体用法?C++ NBNode::computeInternalLaneShape怎么用?C++ NBNode::computeInternalLaneShape使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NBNode
的用法示例。
在下文中一共展示了NBNode::computeInternalLaneShape方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: assert
void
GNETLSEditorFrame::buildIinternalLanes(NBTrafficLightDefinition* tlDef) {
// clean up previous objects
SUMORTree& rtree = myViewNet->getNet()->getVisualisationSpeedUp();
for (TLIndexMap::iterator it = myInternalLanes.begin(); it != myInternalLanes.end(); it++) {
std::vector<GNEInternalLane*> lanes = it->second;
for (std::vector<GNEInternalLane*>::iterator it_lane = lanes.begin(); it_lane != lanes.end(); it_lane++) {
rtree.removeAdditionalGLObject(*it_lane);
delete *it_lane;
}
}
myInternalLanes.clear();
if (tlDef != 0) {
const int NUM_POINTS = 10;
assert(myCurrentJunction);
SUMORTree& rtree = myViewNet->getNet()->getVisualisationSpeedUp();
NBNode* nbn = myCurrentJunction->getNBNode();
std::string innerID = ":" + nbn->getID(); // see NWWriter_SUMO::writeInternalEdges
const NBConnectionVector& links = tlDef->getControlledLinks();
for (NBConnectionVector::const_iterator it = links.begin(); it != links.end(); it++) {
int tlIndex = it->getTLIndex();
PositionVector shape = nbn->computeInternalLaneShape(it->getFrom(), NBEdge::Connection(it->getFromLane(),
it->getTo(), it->getToLane()), NUM_POINTS);
GNEInternalLane* ilane = new GNEInternalLane(this, innerID + '_' + toString(tlIndex), shape, tlIndex);
rtree.addAdditionalGLObject(ilane);
myInternalLanes[tlIndex].push_back(ilane);
}
const std::vector<NBNode::Crossing>& crossings = nbn->getCrossings();
for (std::vector<NBNode::Crossing>::const_iterator it = crossings.begin(); it != crossings.end(); it++) {
const NBNode::Crossing& c = *it;
GNEInternalLane* ilane = new GNEInternalLane(this, c.id, c.shape, c.tlLinkNo);
rtree.addAdditionalGLObject(ilane);
myInternalLanes[c.tlLinkNo].push_back(ilane);
}
}
}