68 if (additionalParent) {
83 SumoXMLTag tag = static_cast<SumoXMLTag>(element);
114 SumoXMLTag tag = static_cast<SumoXMLTag>(element);
118 if (TAZ !=
nullptr) {
123 b.
add(i->getCenteringBoundary());
153 if (edge ==
nullptr || laneIndex < 0 || edge->getNumLanes() <= laneIndex) {
154 WRITE_ERROR(
"Lane '" + laneID +
"' to place poi '" + poiID +
"' on is not known.");
160 if (lanePos < 0 || lanePos > edge->
getLength()) {
163 return edge->
getLanes()[laneIndex].shape.positionAtOffset(lanePos, -lanePosLat);
201 return parseAndBuildTAZ(viewNet, allowUndoRedo, attrs, insertedAdditionals);
241 const std::string& name,
const std::vector<std::string>& lines,
int personCapacity,
bool friendlyPosition,
bool blockMovement) {
243 GNEBusStop* busStop =
new GNEBusStop(
id, lane, viewNet, startPos, endPos, parametersSet, name, lines, personCapacity, friendlyPosition, blockMovement);
251 busStop->
incRef(
"buildBusStop");
263 if (lane ==
nullptr) {
265 }
else if (busStop ==
nullptr) {
270 GNEAccess* access =
new GNEAccess(busStop, lane, viewNet, pos, length, friendlyPos, blockMovement);
279 access->
incRef(
"buildAccess");
288 const std::string& name,
const std::vector<std::string>& lines,
bool friendlyPosition,
bool blockMovement) {
298 containerStop->
incRef(
"buildContainerStop");
300 return containerStop;
309 const std::string& name,
double chargingPower,
double efficiency,
bool chargeInTransit,
SUMOTime chargeDelay,
bool friendlyPosition,
bool blockMovement) {
311 GNEChargingStation* chargingStation =
new GNEChargingStation(
id, lane, viewNet, startPos, endPos, parametersSet, name, chargingPower, efficiency, chargeInTransit, chargeDelay, friendlyPosition, blockMovement);
319 chargingStation->
incRef(
"buildChargingStation");
321 return chargingStation;
330 const std::string& name,
bool friendlyPosition,
int roadSideCapacity,
bool onRoad,
double width,
const std::string& length,
double angle,
bool blockMovement) {
332 GNEParkingArea* parkingArea =
new GNEParkingArea(
id, lane, viewNet, startPos, endPos, parametersSet, name, friendlyPosition, roadSideCapacity, onRoad, width, length, angle, blockMovement);
340 parkingArea->
incRef(
"buildParkingArea");
359 parkingSpace->
incRef(
"buildParkingSpace");
366 GNEAdditionalHandler::buildDetectorE1(
GNEViewNet* viewNet,
bool allowUndoRedo,
const std::string&
id,
GNELane* lane,
double pos,
SUMOTime freq,
const std::string& filename,
const std::string& vehicleTypes,
const std::string& name,
bool friendlyPos,
bool blockMovement) {
368 GNEDetectorE1* detectorE1 =
new GNEDetectorE1(
id, lane, viewNet, pos, freq, filename, vehicleTypes, name, friendlyPos, blockMovement);
376 detectorE1->
incRef(
"buildDetectorE1");
387 const std::string& vehicleTypes,
const std::string& name,
SUMOTime timeThreshold,
double speedThreshold,
double jamThreshold,
bool friendlyPos,
bool blockMovement) {
389 GNEDetectorE2* detectorE2 =
new GNEDetectorE2(
id, lane, viewNet, pos, length, freq, filename, vehicleTypes, name, timeThreshold, speedThreshold, jamThreshold, friendlyPos, blockMovement);
397 detectorE2->
incRef(
"buildDetectorE2");
408 const std::string& vehicleTypes,
const std::string& name,
SUMOTime timeThreshold,
double speedThreshold,
double jamThreshold,
bool friendlyPos,
bool blockMovement) {
410 GNEDetectorE2* detectorE2 =
new GNEDetectorE2(
id, lanes, viewNet, pos, endPos, freq, filename, vehicleTypes, name, timeThreshold, speedThreshold, jamThreshold, friendlyPos, blockMovement);
417 for (
auto i : lanes) {
418 i->addChildAdditional(detectorE2);
420 detectorE2->
incRef(
"buildDetectorE2Multilane");
433 const std::string& name,
SUMOTime timeThreshold,
double speedThreshold,
bool blockMovement) {
435 GNEDetectorE3* detectorE3 =
new GNEDetectorE3(
id, viewNet, pos, freq, filename, vehicleTypes, name, timeThreshold, speedThreshold, blockMovement);
442 detectorE3->
incRef(
"buildDetectorE3");
454 if (lane ==
nullptr) {
456 }
else if (E3Parent ==
nullptr) {
468 entry->
incRef(
"buildDetectorEntry");
478 if (lane ==
nullptr) {
480 }
else if (E3Parent ==
nullptr) {
492 exit->
incRef(
"buildDetectorExit");
510 detectorE1Instant->
incRef(
"buildDetectorE1Instant");
512 return detectorE1Instant;
528 if (centerAfterCreation) {
534 calibrator->
incRef(
"buildCalibrator");
552 if (centerAfterCreation) {
558 calibrator->
incRef(
"buildCalibrator");
569 const std::string& vehsPerHour,
const std::string& speed,
const RGBColor& color,
const std::string& departLane,
const std::string& departPos,
570 const std::string& departSpeed,
const std::string& arrivalLane,
const std::string& arrivalPos,
const std::string& arrivalSpeed,
const std::string& line,
571 int personNumber,
int containerNumber,
bool reroute,
const std::string& departPosLat,
const std::string& arrivalPosLat,
SUMOTime begin,
SUMOTime end) {
575 arrivalLane, arrivalPos, arrivalSpeed, line, personNumber, containerNumber, reroute,
576 departPosLat, arrivalPosLat, begin, end);
583 flow->
incRef(
"buildCalibratorFlow");
590 GNEAdditionalHandler::buildRerouter(
GNEViewNet* viewNet,
bool allowUndoRedo,
const std::string&
id,
Position pos,
const std::vector<GNEEdge*>& edges,
double prob,
const std::string& name,
const std::string& file,
bool off,
SUMOTime timeThreshold,
const std::string& vTypes,
bool blockMovement) {
592 GNERerouter* rerouter =
new GNERerouter(
id, viewNet, pos, edges, name, file, prob, off, timeThreshold, vTypes, blockMovement);
600 for (
auto i : edges) {
601 i->addParentAdditional(rerouter);
603 rerouter->
incRef(
"buildRerouter");
610 GNEAdditionalHandler rerouterValuesHandler(currentAdditionalFilename + file, viewNet, rerouter);
639 rerouterInterval->
incRef(
"buildRerouterInterval");
641 return rerouterInterval;
659 closingLaneReroute->
incRef(
"buildClosingLaneReroute");
661 return closingLaneReroute;
676 closingReroute->
incRef(
"buildClosingReroute");
678 return closingReroute;
693 destProbReroute->
incRef(
"builDestProbReroute");
695 return destProbReroute;
710 parkingAreaReroute->
incRef(
"builParkingAreaReroute");
712 return parkingAreaReroute;
727 routeProbReroute->
incRef(
"buildRouteProbReroute");
729 return routeProbReroute;
742 if (centerAfterCreation) {
748 routeProbe->
incRef(
"buildRouteProbe");
768 for (
auto i : lanes) {
769 i->addParentAdditional(variableSpeedSign);
771 variableSpeedSign->
incRef(
"buildVariableSpeedSign");
773 return variableSpeedSign;
791 variableSpeedSignStep->
incRef(
"buildVariableSpeedSignStep");
793 return variableSpeedSignStep;
805 if (centerAfterCreation) {
811 vaporizer->
incRef(
"buildVaporizer");
819 GNETAZ* TAZ =
new GNETAZ(
id, viewNet, shape, color, blockMovement);
826 for (
auto i : edges) {
838 for (
auto i : edges) {
841 TAZSource->
incRef(
"buildTAZ");
845 TAZSink->
incRef(
"buildTAZ");
868 if (TAZSink ==
nullptr) {
877 TAZSink->
incRef(
"buildTAZSource");
889 if (TAZSource ==
nullptr) {
898 TAZSource->
incRef(
"buildTAZSource");
908 TAZSource->
incRef(
"buildTAZSource");
925 if (TAZSource ==
nullptr) {
934 TAZSource->
incRef(
"buildTAZSink");
945 if (TAZSink ==
nullptr) {
954 TAZSink->
incRef(
"buildTAZSink");
964 TAZSink->
incRef(
"buildTAZSink");
980 WRITE_WARNING(
"The position of additional '" + additionalID +
"' lies beyond the lane's '" + lane.
getID() +
"' length.");
988 if (fabs(pos) > laneLength) {
991 }
else if (pos < 0) {
993 }
else if (pos > laneLength) {
994 pos = laneLength - 0.01;
1002 if ((pos < 0) || ((pos + length) > laneLength)) {
1005 }
else if (pos < 0) {
1007 }
else if (pos > laneLength) {
1008 pos = laneLength - 0.01;
1010 }
else if ((pos + length) > laneLength) {
1011 length = laneLength - pos - 0.01;
1039 std::vector<std::pair<SUMOTime, SUMOTime>> sortedIntervals;
1048 sortedIntervals.push_back(std::make_pair(newBegin, newEnd));
1050 std::sort(sortedIntervals.begin(), sortedIntervals.end());
1052 for (
int i = 0; i < (int)sortedIntervals.size() - 1; i++) {
1053 if (sortedIntervals.at(i).second > sortedIntervals.at(i + 1).first) {
1078 if (edge ==
nullptr) {
1082 }
else if (begin > end) {
1088 if (insertedAdditionals) {
1102 const std::string
id = GNEAttributeCarrier::parseAttributeFromXML<std::string>(attrs,
"",
SUMO_TAG_TAZ,
SUMO_ATTR_ID, abort);
1106 bool blockMovement =
false;
1111 std::vector<std::string> edgeIDs;
1113 std::string parsedAttribute = attrs.
get<std::string>(
SUMO_ATTR_EDGES,
id.c_str(), abort,
false);
1114 edgeIDs = GNEAttributeCarrier::parse<std::vector<std::string> >(parsedAttribute);
1117 std::vector<GNEEdge*> edges;
1118 for (
auto i : edgeIDs) {
1120 if (edge ==
nullptr) {
1124 edges.push_back(edge);
1134 GNEAdditional* additionalCreated =
buildTAZ(viewNet, allowUndoRedo,
id, shape, color, edges, blockMovement);
1136 if (insertedAdditionals) {
1158 if (insertedAdditionals) {
1165 if (edge ==
nullptr) {
1167 }
else if (TAZ ==
nullptr) {
1173 if (insertedAdditionals) {
1195 if (insertedAdditionals) {
1202 if (edge ==
nullptr) {
1204 }
else if (TAZ ==
nullptr) {
1210 if (insertedAdditionals) {
1239 }
else if (edge ==
nullptr) {
1244 if (GNEAttributeCarrier::canParse<double>(freq)) {
1245 if (GNEAttributeCarrier::parse<double>(freq) < 0) {
1258 if (insertedAdditionals) {
1298 if (insertedAdditionals) {
1305 if (route ==
nullptr) {
1308 }
else if (vtype ==
nullptr) {
1311 }
else if ((vehsPerHour.empty()) && (speed.empty())) {
1314 }
else if (calibrator !=
nullptr) {
1316 GNEAdditional* additionalCreated =
buildCalibratorFlow(viewNet, allowUndoRedo, calibrator, route, vtype, vehsPerHour, speed, color, departLane, departPos, departSpeed, arrivalLane, arrivalPos, arrivalSpeed,
1317 line, personNumber, containerNumber, reroute, departPosLat, arrivalPosLat, begin, end);
1319 if (insertedAdditionals) {
1333 std::string polygonID = GNEAttributeCarrier::parseAttributeFromXML<std::string>(attrs,
"",
SUMO_TAG_POLY,
SUMO_ATTR_ID, abort);
1338 std::string type = GNEAttributeCarrier::parseAttributeFromXML<std::string>(attrs, polygonID,
SUMO_TAG_POLY,
SUMO_ATTR_TYPE, abort);
1355 bool success =
true;
1356 for (
int i = 0; i < (int)shape.size(); i++) {
1360 WRITE_WARNING(
"Unable to project coordinates for polygon '" + polygonID +
"'.");
1369 if (!
myShapeContainer.
addPolygon(polygonID, type, color, layer, angle, imgFile, relativePath, shape, geo, fill, lineWidth,
false)) {
1370 WRITE_WARNING(
"Polygon with ID '" + polygonID +
"' already exists.");
1383 std::string
id = GNEAttributeCarrier::parseAttributeFromXML<std::string>(attrs,
"",
SUMO_TAG_VSS,
SUMO_ATTR_ID, abort);
1389 bool blockMovement =
false;
1396 std::vector<GNELane*> lanes;
1398 lanes = GNEAttributeCarrier::parse<std::vector<GNELane*> >(viewNet->
getNet(), lanesIDs);
1403 }
else if (lanes.size() == 0) {
1404 WRITE_WARNING(
"A Variable Speed Sign needs at least one lane.");
1409 if (insertedAdditionals) {
1430 if (insertedAdditionals) {
1437 if (variableSpeedSign !=
nullptr) {
1441 if (insertedAdditionals) {
1465 bool blockMovement =
false;
1472 std::vector<GNEEdge*> edges;
1474 edges = GNEAttributeCarrier::parse<std::vector<GNEEdge*> >(viewNet->
getNet(), edgesIDs);
1479 }
else if (edges.size() == 0) {
1484 file, off, timeThreshold, vTypes, blockMovement);
1486 if (insertedAdditionals) {
1507 if (insertedAdditionals) {
1514 if (rerouter ==
nullptr) {
1517 if (insertedAdditionals) {
1523 if (lastInsertedRerouterInterval) {
1530 }
else if (rerouter !=
nullptr) {
1534 if (insertedAdditionals) {
1557 if (insertedAdditionals) {
1564 if (lane ==
nullptr) {
1566 }
else if (rerouterInterval !=
nullptr) {
1570 if (insertedAdditionals) {
1593 if (insertedAdditionals) {
1600 if (edge ==
nullptr) {
1602 }
else if (rerouterInterval !=
nullptr) {
1606 if (insertedAdditionals) {
1628 if (insertedAdditionals) {
1635 if (edge ==
nullptr) {
1637 }
else if (rerouterInterval !=
nullptr) {
1641 if (insertedAdditionals) {
1664 if (insertedAdditionals) {
1671 if (parkingArea ==
nullptr) {
1673 }
else if (rerouterInterval !=
nullptr) {
1677 if (insertedAdditionals) {
1698 if (insertedAdditionals) {
1705 if (rerouterInterval !=
nullptr) {
1709 if (insertedAdditionals) {
1728 std::vector<std::string> lines = GNEAttributeCarrier::parseAttributeFromXML<std::vector<std::string> >(attrs, id,
SUMO_TAG_BUS_STOP,
SUMO_ATTR_LINES, abort);
1732 bool blockMovement =
false;
1743 }
else if (lane ==
nullptr) {
1748 double startPosDouble = 0;
1750 const double stoppingPlaceLength = (endPosDouble - startPosDouble);
1751 int parametersSet = 0;
1753 if (GNEAttributeCarrier::canParse<double>(startPos)) {
1754 startPosDouble = GNEAttributeCarrier::parse<double>(startPos);
1757 if (GNEAttributeCarrier::canParse<double>(endPos)) {
1758 endPosDouble = GNEAttributeCarrier::parse<double>(endPos);
1764 if (checkStopPosResult == SUMORouteHandler::StopPos::STOPPOS_INVALID_STARTPOS) {
1766 endPosDouble = stoppingPlaceLength;
1767 }
else if (checkStopPosResult == SUMORouteHandler::StopPos::STOPPOS_INVALID_ENDPOS) {
1770 }
else if (checkStopPosResult == SUMORouteHandler::StopPos::STOPPOS_INVALID_LANELENGTH) {
1776 GNEAdditional* additionalCreated =
buildBusStop(viewNet, allowUndoRedo,
id, lane, startPosDouble, endPosDouble, parametersSet,
1777 name, lines, personCapacity, friendlyPosition, blockMovement);
1779 if (insertedAdditionals) {
1801 bool blockMovement =
false;
1812 }
else if (lane ==
nullptr) {
1817 double startPosDouble = 0;
1819 const double stoppingPlaceLength = (endPosDouble - startPosDouble);
1820 int parametersSet = 0;
1822 if (GNEAttributeCarrier::canParse<double>(startPos)) {
1823 startPosDouble = GNEAttributeCarrier::parse<double>(startPos);
1826 if (GNEAttributeCarrier::canParse<double>(endPos)) {
1827 endPosDouble = GNEAttributeCarrier::parse<double>(endPos);
1833 if (checkStopPosResult == SUMORouteHandler::StopPos::STOPPOS_INVALID_STARTPOS) {
1835 endPosDouble = stoppingPlaceLength;
1836 }
else if (checkStopPosResult == SUMORouteHandler::StopPos::STOPPOS_INVALID_ENDPOS) {
1839 }
else if (checkStopPosResult == SUMORouteHandler::StopPos::STOPPOS_INVALID_LANELENGTH) {
1846 name, lines, friendlyPosition, blockMovement);
1848 if (insertedAdditionals) {
1867 bool blockMovement =
false;
1873 double posDouble = GNEAttributeCarrier::parse<double>(position);
1878 if (insertedAdditionals) {
1885 if (lane ==
nullptr) {
1887 }
else if (busStop ==
nullptr) {
1895 GNEAdditional* additionalCreated =
buildAccess(viewNet, allowUndoRedo, busStop, lane, posDouble, length, friendlyPos, blockMovement);
1897 if (insertedAdditionals) {
1922 bool blockMovement =
false;
1933 }
else if (lane ==
nullptr) {
1938 double startPosDouble = 0;
1940 const double stoppingPlaceLength = (endPosDouble - startPosDouble);
1941 int parametersSet = 0;
1943 if (GNEAttributeCarrier::canParse<double>(startPos)) {
1944 startPosDouble = GNEAttributeCarrier::parse<double>(startPos);
1947 if (GNEAttributeCarrier::canParse<double>(endPos)) {
1948 endPosDouble = GNEAttributeCarrier::parse<double>(endPos);
1954 if (checkStopPosResult == SUMORouteHandler::StopPos::STOPPOS_INVALID_STARTPOS) {
1956 endPosDouble = stoppingPlaceLength;
1957 }
else if (checkStopPosResult == SUMORouteHandler::StopPos::STOPPOS_INVALID_ENDPOS) {
1960 }
else if (checkStopPosResult == SUMORouteHandler::StopPos::STOPPOS_INVALID_LANELENGTH) {
1967 name, chargingPower, efficiency, chargeInTransit, chargeDelay, friendlyPosition, blockMovement);
1969 if (insertedAdditionals) {
1995 bool blockMovement =
false;
2006 }
else if (lane ==
nullptr) {
2011 double startPosDouble = 0;
2013 const double stoppingPlaceLength = (endPosDouble - startPosDouble);
2014 int parametersSet = 0;
2016 if (GNEAttributeCarrier::canParse<double>(startPos)) {
2017 startPosDouble = GNEAttributeCarrier::parse<double>(startPos);
2020 if (GNEAttributeCarrier::canParse<double>(endPos)) {
2021 endPosDouble = GNEAttributeCarrier::parse<double>(endPos);
2027 if (checkStopPosResult == SUMORouteHandler::StopPos::STOPPOS_INVALID_STARTPOS) {
2029 endPosDouble = stoppingPlaceLength;
2030 }
else if (checkStopPosResult == SUMORouteHandler::StopPos::STOPPOS_INVALID_ENDPOS) {
2033 }
else if (checkStopPosResult == SUMORouteHandler::StopPos::STOPPOS_INVALID_LANELENGTH) {
2040 name, friendlyPosition, roadSideCapacity, onRoad, width, length, angle, blockMovement);
2042 if (insertedAdditionals) {
2061 bool blockMovement =
false;
2070 if (insertedAdditionals) {
2077 if (parkingAreaParent !=
nullptr) {
2081 if (insertedAdditionals) {
2095 std::string edgeID, laneId, id;
2114 }
else if (edge ==
nullptr) {
2118 GNEAdditional* additionalCreated =
buildCalibrator(viewNet, allowUndoRedo,
id, edge, position, name, outfile, freq, routeProbe, centerAfterCreation);
2120 if (insertedAdditionals) {
2143 }
else if (lane ==
nullptr) {
2147 GNEAdditional* additionalCreated =
buildCalibrator(viewNet, allowUndoRedo,
id, lane, position, name, outfile, freq, routeProbe, centerAfterCreation);
2149 if (insertedAdditionals) {
2175 bool blockMovement =
false;
2186 }
else if (lane ==
nullptr) {
2193 GNEAdditional* additionalCreated =
buildDetectorE1(viewNet, allowUndoRedo,
id, lane, position, frequency, file, vehicleTypes, name, friendlyPos, blockMovement);
2195 if (insertedAdditionals) {
2211 std::string
id = GNEAttributeCarrier::parseAttributeFromXML<std::string>(attrs,
"", E2Tag,
SUMO_ATTR_ID, abort);
2219 double position = GNEAttributeCarrier::parseAttributeFromXML<double>(attrs,
id, E2Tag,
SUMO_ATTR_POSITION, abort);
2221 std::string file = GNEAttributeCarrier::parseAttributeFromXML<std::string>(attrs,
id, E2Tag,
SUMO_ATTR_FILE, abort);
2222 std::string vehicleTypes = GNEAttributeCarrier::parseAttributeFromXML<std::string>(attrs,
id, E2Tag,
SUMO_ATTR_VTYPES, abort);
2223 std::string name = GNEAttributeCarrier::parseAttributeFromXML<std::string>(attrs,
id, E2Tag,
SUMO_ATTR_NAME, abort);
2227 bool friendlyPos = GNEAttributeCarrier::parseAttributeFromXML<bool>(attrs,
id, E2Tag,
SUMO_ATTR_FRIENDLY_POS, abort);
2229 bool blockMovement =
false;
2231 blockMovement = GNEAttributeCarrier::parseAttributeFromXML<bool>(attrs,
id, E2Tag,
GNE_ATTR_BLOCK_MOVEMENT, abort);
2234 GNEAttributeCarrier::parseAttributeFromXML<std::string>(attrs,
id, E2Tag,
SUMO_ATTR_CONT, abort);
2238 if (laneId.empty() && laneIds.empty()) {
2244 std::vector<GNELane*> lanes;
2245 bool laneConsecutives =
true;
2247 lanes = GNEAttributeCarrier::parse<std::vector<GNELane*> >(viewNet->
getNet(), laneIds);
2257 WRITE_WARNING(
"The lane '" + laneId +
"' to use within the " +
toString(E2Tag) +
" '" +
id +
"' is not known.");
2263 WRITE_WARNING(
"The list of lanes '" + laneIds +
"' to use within the " +
toString(E2Tag) +
" '" +
id +
"' isn't valid.");
2264 }
else if (!lanes.empty() && !laneConsecutives) {
2265 WRITE_WARNING(
"The lanes '" + laneIds +
"' to use within the " +
toString(E2Tag) +
" '" +
id +
"' aren't consecutives.");
2268 }
else if (!lanes.empty() && !
fixE2DetectorPosition(position, length, lanes.front()->getParentEdge()->getNBEdge()->getFinalLength(), friendlyPos)) {
2270 }
else if (!lanes.empty() && !
fixE2DetectorPosition(endPos, length, lanes.back()->getParentEdge()->getNBEdge()->getFinalLength(), friendlyPos)) {
2275 name, haltingTimeThreshold, haltingSpeedThreshold, jamDistThreshold, friendlyPos, blockMovement);
2277 if (insertedAdditionals) {
2284 name, haltingTimeThreshold, haltingSpeedThreshold, jamDistThreshold, friendlyPos, blockMovement);
2286 if (insertedAdditionals) {
2310 bool blockMovement =
false;
2321 GNEAdditional* additionalCreated =
buildDetectorE3(viewNet, allowUndoRedo,
id, pos, frequency, file, vehicleTypes, name, haltingTimeThreshold, haltingSpeedThreshold, blockMovement);
2323 if (insertedAdditionals) {
2341 bool blockMovement =
false;
2351 if (insertedAdditionals) {
2358 if (lane ==
nullptr) {
2362 }
else if (E3Parent) {
2366 if (insertedAdditionals) {
2384 bool blockMovement =
false;
2394 if (insertedAdditionals) {
2401 if (lane ==
nullptr) {
2405 }
else if (E3Parent) {
2409 if (insertedAdditionals) {
2431 bool blockMovement =
false;
2442 }
else if (lane ==
nullptr) {
2451 if (insertedAdditionals) {
2468 std::string POIID = GNEAttributeCarrier::parseAttributeFromXML<std::string>(attrs,
"",
SUMO_TAG_POI,
SUMO_ATTR_ID, abort);
2480 std::string type = GNEAttributeCarrier::parseAttributeFromXML<std::string>(attrs, POIID,
SUMO_TAG_POI,
SUMO_ATTR_TYPE, abort);
2500 WRITE_WARNING(
"The lane '" + laneID +
"' to use within the PoI '" + POIID +
"' is not known.");
2504 bool useGeo =
false;
2510 pos =
getLanePos(POIID, laneID, lanePos, lanePosLat);
2514 WRITE_WARNING(
"Either (x, y), (lon, lat) or (lane, pos) must be specified for PoI '" + POIID +
"'.");
2517 WRITE_WARNING(
"(lon, lat) is specified for PoI '" + POIID +
"' but no geo-conversion is specified for the network.");
2524 WRITE_WARNING(
"Unable to project coordinates for PoI '" + POIID +
"'.");
2530 if (!
myShapeContainer.
addPOI(POIID, type, color, pos, useGeo, laneID, lanePos, lanePosLat, layer, angle, imgFile, relativePath, width, height,
false)) {
2531 WRITE_WARNING(
"POI with ID '" + POIID +
"' already exists.");
2550 WRITE_WARNING(
"Error parsing key from shape parameter. Key cannot be empty");
2554 WRITE_WARNING(
"Error parsing key from shape parameter. Key contains invalid characters");
2558 WRITE_WARNING(
"Error parsing key from shape parameter. Key doesn't exist");
2564 WRITE_WARNING(
"Error parsing value from shape parameter. Value contains invalid characters");
2569 WRITE_DEBUG(
"Inserting parameter '" + key +
"|" + val +
"' into shape.");
2581 WRITE_WARNING(
"Error parsing key from additional parameter. Key cannot be empty");
2585 WRITE_WARNING(
"Error parsing key from additional parameter. Key contains invalid characters");
2589 WRITE_WARNING(
"Error parsing key from additional parameter. Key doesn't exist");
2595 WRITE_WARNING(
"Error parsing value from additional parameter. Value contains invalid characters");
2607 WRITE_WARNING(
"Parameters has to be declared within the definition of an additional or a shape element");
2623 myInsertedElements.back().second = additional;
2629 if (!myInsertedElements.empty()) {
2630 myInsertedElements.pop_back();
2637 if (myInsertedElements.size() < 2) {
2639 WRITE_WARNING(
"A " +
toString(myInsertedElements.back().first) +
" must be declared within the definition of a " +
toString(expectedTag) +
".");
2642 if (myInsertedElements.size() < 2) {
2645 }
else if ((myInsertedElements.end() - 2)->second ==
nullptr) {
2651 if (retrievedAdditional ==
nullptr) {
2653 WRITE_WARNING(
"A " +
toString((myInsertedElements.end() - 1)->first) +
" must be declared within the definition of a " +
toString(expectedTag) +
".");
2657 WRITE_WARNING(
"A " +
toString((myInsertedElements.end() - 1)->first) +
" cannot be declared within the definition of a " + retrievedAdditional->
getTagStr() +
".");
2660 return retrievedAdditional;
2669 for (std::vector<std::pair<SumoXMLTag, GNEAdditional*> >::const_reverse_iterator i = myInsertedElements.rbegin(); i != myInsertedElements.rend(); i++) {