本文整理汇总了C++中NBNode::reinit方法的典型用法代码示例。如果您正苦于以下问题:C++ NBNode::reinit方法的具体用法?C++ NBNode::reinit怎么用?C++ NBNode::reinit使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NBNode
的用法示例。
在下文中一共展示了NBNode::reinit方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: st
bool
NIImporter_DlrNavteq::TrafficlightsHandler::report(const std::string& result) {
// #ID POICOL-TYPE DESCRIPTION LONGITUDE LATITUDE NAVTEQ_LINK_ID NODEID
if (result[0] == '#') {
return true;
}
StringTokenizer st(result, StringTokenizer::WHITECHARS);
const std::string edgeID = st.get(5);
NBEdge* edge = myEdgeCont.retrieve(edgeID);
if (edge == nullptr) {
WRITE_WARNING("The traffic light edge '" + edgeID + "' could not be found");
} else {
NBNode* node = edge->getToNode();
if (node->getType() != NODETYPE_TRAFFIC_LIGHT) {
node->reinit(node->getPosition(), NODETYPE_TRAFFIC_LIGHT);
// @note. There may be additional information somewhere in the GDF files about traffic light type ...
TrafficLightType type = SUMOXMLDefinitions::TrafficLightTypes.get(OptionsCont::getOptions().getString("tls.default-type"));
// @note actually we could use the navteq node ID here
NBTrafficLightDefinition* tlDef = new NBOwnTLDef(node->getID(), node, 0, type);
if (!myTLLogicCont.insert(tlDef)) {
// actually, nothing should fail here
delete tlDef;
throw ProcessError("Could not allocate tls for '" + node->getID() + "'.");
}
}
}
return true;
}
示例2:
void
NBNodeCont::discardTrafficLights(NBTrafficLightLogicCont& tlc, bool geometryLike) {
for (NodeCont::const_iterator i = myNodes.begin(); i != myNodes.end(); ++i) {
NBNode* node = i->second;
if (!geometryLike || node->geometryLike()) {
// make a copy of tldefs
const std::set<NBTrafficLightDefinition*> tldefs = node->getControllingTLS();
for (std::set<NBTrafficLightDefinition*>::const_iterator it = tldefs.begin(); it != tldefs.end(); ++it) {
NBTrafficLightDefinition* tlDef = *it;
node->removeTrafficLight(tlDef);
tlc.extract(tlDef);
}
node->reinit(node->getPosition(), NODETYPE_UNKNOWN);
}
}
}