本文整理汇总了C++中NBEdge::allowVehicleClass方法的典型用法代码示例。如果您正苦于以下问题:C++ NBEdge::allowVehicleClass方法的具体用法?C++ NBEdge::allowVehicleClass怎么用?C++ NBEdge::allowVehicleClass使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NBEdge
的用法示例。
在下文中一共展示了NBEdge::allowVehicleClass方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
void
NINavTeqHelper::addVehicleClasses(NBEdge& e, const std::string& oclassS) {
std::string classS = "0000000000" + oclassS;
classS = classS.substr(classS.length() - 10);
// 0: allow all vehicle types
if (classS[0] == '1') {
return;
}
// we have some restrictions. disallow all and then add classes indiviually
e.setPermissions(0);
// Passenger cars -- becomes SVC_PASSENGER
if (classS[1] == '1') {
e.allowVehicleClass(-1, SVC_PASSENGER);
}
// High Occupancy Vehicle -- becomes SVC_PASSENGER|SVC_HOV
if (classS[2] == '1') {
e.allowVehicleClass(-1, SVC_HOV);
e.allowVehicleClass(-1, SVC_PASSENGER);
}
// Emergency Vehicle -- becomes SVC_PUBLIC_EMERGENCY
if (classS[3] == '1') {
e.allowVehicleClass(-1, SVC_PUBLIC_EMERGENCY);
}
// Taxi -- becomes SVC_TAXI
if (classS[4] == '1') {
e.allowVehicleClass(-1, SVC_TAXI);
}
// Public Bus -- becomes SVC_BUS|SVC_PUBLIC_TRANSPORT
if (classS[5] == '1') {
e.allowVehicleClass(-1, SVC_PUBLIC_TRANSPORT);
e.allowVehicleClass(-1, SVC_BUS);
}
// Delivery Truck -- becomes SVC_DELIVERY
if (classS[6] == '1') {
e.allowVehicleClass(-1, SVC_DELIVERY);
}
// Transport Truck -- becomes SVC_TRANSPORT
if (classS[7] == '1') {
e.allowVehicleClass(-1, SVC_TRANSPORT);
}
// Bicycle -- becomes SVC_BICYCLE
if (classS[8] == '1') {
e.allowVehicleClass(-1, SVC_BICYCLE);
}
// Pedestrian -- becomes SVC_PEDESTRIAN
if (classS[9] == '1') {
e.allowVehicleClass(-1, SVC_PEDESTRIAN);
}
}