70 if (additionalParent) {
122 if (
TAZ !=
nullptr) {
123 if (
TAZ->getTAZElementShape().size() == 0) {
125 if (
TAZ->getChildAdditionals().size() > 0) {
126 for (
const auto& i :
TAZ->getChildAdditionals()) {
127 b.
add(i->getCenteringBoundary());
157 if (edge ==
nullptr || laneIndex < 0 || edge->getNumLanes() <= laneIndex) {
158 WRITE_ERROR(
"Lane '" + laneID +
"' to place poi '" + poiID +
"' on is not known.");
164 if (lanePos < 0 || lanePos > edge->
getLength()) {
167 return edge->
getLanes()[laneIndex].shape.positionAtOffset(lanePos, -lanePosLat);
245 const double startPos,
const double endPos,
const int parametersSet,
246 const std::string& name,
const std::vector<std::string>& lines,
int personCapacity,
double parkingLength,
247 bool friendlyPosition,
bool blockMovement) {
249 GNEAdditional* busStop =
new GNEBusStop(
id, lane, net, startPos, endPos, parametersSet, name, lines, personCapacity, parkingLength, friendlyPosition, blockMovement);
257 busStop->
incRef(
"buildBusStop");
269 if (lane ==
nullptr) {
271 }
else if (busStop ==
nullptr) {
285 access->
incRef(
"buildAccess");
294 const std::string& name,
const std::vector<std::string>& lines,
bool friendlyPosition,
bool blockMovement) {
296 GNEAdditional* containerStop =
new GNEContainerStop(
id, lane, net, startPos, endPos, parametersSet, name, lines, friendlyPosition, blockMovement);
304 containerStop->
incRef(
"buildContainerStop");
306 return containerStop;
315 const std::string& name,
double chargingPower,
double efficiency,
bool chargeInTransit,
SUMOTime chargeDelay,
bool friendlyPosition,
bool blockMovement) {
317 GNEAdditional* chargingStation =
new GNEChargingStation(
id, lane, net, startPos, endPos, parametersSet, name, chargingPower, efficiency, chargeInTransit, chargeDelay, friendlyPosition, blockMovement);
325 chargingStation->
incRef(
"buildChargingStation");
327 return chargingStation;
336 const std::string& name,
bool friendlyPosition,
int roadSideCapacity,
bool onRoad,
double width,
const std::string& length,
double angle,
bool blockMovement) {
338 GNEAdditional* parkingArea =
new GNEParkingArea(
id, lane, net, startPos, endPos, parametersSet, name, friendlyPosition, roadSideCapacity, onRoad, width, length, angle, blockMovement);
346 parkingArea->
incRef(
"buildParkingArea");
365 parkingSpace->
incRef(
"buildParkingSpace");
374 GNEAdditionalHandler::buildDetectorE1(
GNENet* net,
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) {
376 GNEAdditional* detectorE1 =
new GNEDetectorE1(
id, lane, net, pos, freq, filename, vehicleTypes, name, friendlyPos, blockMovement);
384 detectorE1->
incRef(
"buildDetectorE1");
395 const std::string& filename,
const std::string& vehicleTypes,
const std::string& name,
SUMOTime timeThreshold,
double speedThreshold,
double jamThreshold,
bool friendlyPos,
bool blockMovement) {
397 GNEAdditional* detectorE2 =
new GNEDetectorE2(
id, lane, net, pos, length, freq, trafficLight, filename, vehicleTypes, name, timeThreshold, speedThreshold, jamThreshold, friendlyPos, blockMovement);
405 detectorE2->
incRef(
"buildDetectorE2");
416 const std::string& filename,
const std::string& vehicleTypes,
const std::string& name,
SUMOTime timeThreshold,
double speedThreshold,
double jamThreshold,
bool friendlyPos,
bool blockMovement) {
418 GNEDetectorE2* detectorE2 =
new GNEDetectorE2(
id, lanes, net, pos, endPos, freq, trafficLight, filename, vehicleTypes, name, timeThreshold, speedThreshold, jamThreshold, friendlyPos, blockMovement);
427 for (
const auto& lane : lanes) {
430 detectorE2->
incRef(
"buildDetectorE2Multilane");
441 const std::string& name,
SUMOTime timeThreshold,
double speedThreshold,
bool blockMovement) {
443 GNEAdditional* detectorE3 =
new GNEDetectorE3(
id, net, pos, freq, filename, vehicleTypes, name, timeThreshold, speedThreshold, blockMovement);
450 detectorE3->
incRef(
"buildDetectorE3");
462 if (lane ==
nullptr) {
464 }
else if (E3Parent ==
nullptr) {
476 entry->
incRef(
"buildDetectorEntry");
486 if (lane ==
nullptr) {
488 }
else if (E3Parent ==
nullptr) {
500 exit->
incRef(
"buildDetectorExit");
518 detectorE1Instant->
incRef(
"buildDetectorE1Instant");
520 return detectorE1Instant;
536 if (centerAfterCreation) {
542 calibrator->
incRef(
"buildCalibrator");
560 if (centerAfterCreation) {
566 calibrator->
incRef(
"buildCalibrator");
577 const std::string& vehsPerHour,
const std::string& speed,
const RGBColor& color,
const std::string& departLane,
const std::string& departPos,
578 const std::string& departSpeed,
const std::string& arrivalLane,
const std::string& arrivalPos,
const std::string& arrivalSpeed,
const std::string& line,
579 int personNumber,
int containerNumber,
bool reroute,
const std::string& departPosLat,
const std::string& arrivalPosLat,
SUMOTime begin,
SUMOTime end) {
583 arrivalLane, arrivalPos, arrivalSpeed, line, personNumber, containerNumber, reroute,
584 departPosLat, arrivalPosLat, begin, end);
591 flow->
incRef(
"buildCalibratorFlow");
598 GNEAdditionalHandler::buildRerouter(
GNENet* net,
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) {
601 GNEAdditional* rerouter =
new GNERerouter(
id, net, pos, name, file, prob, off, timeThreshold, vTypes, blockMovement);
603 std::vector<GNEAdditional*> rerouterSymbols;
604 for (
const auto& edge : edges) {
610 for (
const auto& rerouterSymbol : rerouterSymbols) {
617 for (
int i = 0; i < (int)edges.size(); i++) {
618 edges.at(i)->addChildElement(rerouterSymbols.at(i));
619 rerouterSymbols.at(i)->incRef(
"buildRerouterSymbol");
621 rerouter->
incRef(
"buildRerouter");
657 rerouterInterval->
incRef(
"buildRerouterInterval");
659 return rerouterInterval;
677 closingLaneReroute->
incRef(
"buildClosingLaneReroute");
679 return closingLaneReroute;
694 closingReroute->
incRef(
"buildClosingReroute");
696 return closingReroute;
711 destProbReroute->
incRef(
"builDestProbReroute");
713 return destProbReroute;
728 parkingAreaReroute->
incRef(
"builParkingAreaReroute");
730 return parkingAreaReroute;
745 routeProbReroute->
incRef(
"buildRouteProbReroute");
747 return routeProbReroute;
760 if (centerAfterCreation) {
766 routeProbe->
incRef(
"buildRouteProbe");
781 std::vector<GNEAdditional*> VSSSymbols;
782 for (
const auto& lane : lanes) {
788 for (
const auto& VSSSymbol : VSSSymbols) {
795 for (
int i = 0; i < (int)lanes.size(); i++) {
796 lanes.at(i)->addChildElement(VSSSymbols.at(i));
797 VSSSymbols.at(i)->incRef(
"buildVariableSpeedSignSymbol");
799 variableSpeedSign->
incRef(
"buildVariableSpeedSign");
801 return variableSpeedSign;
819 variableSpeedSignStep->
incRef(
"buildVariableSpeedSignStep");
821 return variableSpeedSignStep;
833 if (centerAfterCreation) {
839 vaporizer->
incRef(
"buildVaporizer");
854 for (
const auto& edge : edges) {
865 TAZ->incRef(
"buildTAZ");
866 for (
const auto& edge : edges) {
869 TAZSource->
incRef(
"buildTAZ");
870 TAZ->addChildElement(TAZSource);
873 TAZSink->
incRef(
"buildTAZ");
874 TAZ->addChildElement(TAZSink);
880 TAZ->updateGeometry();
881 TAZ->updateParentAdditional();
890 for (
const auto& TAZElement :
TAZ->getChildTAZElements()) {
892 TAZSink = TAZElement;
896 if (TAZSink ==
nullptr) {
905 TAZSink->
incRef(
"buildTAZSource");
911 for (
const auto& TAZElement :
TAZ->getChildTAZElements()) {
913 TAZSource = TAZElement;
917 if (TAZSource ==
nullptr) {
926 TAZSource->
incRef(
"buildTAZSource");
936 TAZSource->
incRef(
"buildTAZSource");
947 for (
const auto& TAZElement :
TAZ->getChildTAZElements()) {
949 TAZSource = TAZElement;
953 if (TAZSource ==
nullptr) {
962 TAZSource->
incRef(
"buildTAZSink");
967 for (
const auto& TAZElement :
TAZ->getChildTAZElements()) {
969 TAZSink = TAZElement;
973 if (TAZSink ==
nullptr) {
982 TAZSink->
incRef(
"buildTAZSink");
992 TAZSink->
incRef(
"buildTAZSink");
1008 WRITE_WARNING(
"The position of additional '" + additionalID +
"' lies beyond the lane's '" + lane.
getID() +
"' length.");
1016 if (fabs(pos) > laneLength) {
1019 }
else if (pos < 0) {
1021 }
else if (pos > laneLength) {
1022 pos = laneLength - 0.01;
1030 if ((pos < 0) || ((pos + length) > laneLength)) {
1033 }
else if (pos < 0) {
1035 }
else if (pos > laneLength) {
1036 pos = laneLength - 0.01;
1038 }
else if ((pos + length) > laneLength) {
1039 length = laneLength - pos - 0.01;
1067 std::vector<std::pair<SUMOTime, SUMOTime>> sortedIntervals;
1070 if (!rerouterChild->getTagProperty().isSymbol()) {
1078 sortedIntervals.push_back(std::make_pair(newBegin, newEnd));
1080 std::sort(sortedIntervals.begin(), sortedIntervals.end());
1082 for (
int i = 0; i < (int)sortedIntervals.size() - 1; i++) {
1083 if (sortedIntervals.at(i).second > sortedIntervals.at(i + 1).first) {
1108 if (edge ==
nullptr) {
1112 }
else if (begin > end) {
1118 if (insertedAdditionals) {
1132 const std::string
id = GNEAttributeCarrier::parseAttributeFromXML<std::string>(attrs,
"",
SUMO_TAG_TAZ,
SUMO_ATTR_ID, abort);
1136 bool blockMovement =
false;
1141 std::vector<std::string> edgeIDs;
1143 std::string parsedAttribute = attrs.
get<std::string>(
SUMO_ATTR_EDGES,
id.c_str(), abort,
false);
1144 edgeIDs = GNEAttributeCarrier::parse<std::vector<std::string> >(parsedAttribute);
1147 std::vector<GNEEdge*> edges;
1148 for (
auto i : edgeIDs) {
1150 if (edge ==
nullptr) {
1154 edges.push_back(edge);
1164 GNETAZElement* TAZElementCreated =
buildTAZ(net, allowUndoRedo,
id, shape, color, edges, blockMovement);
1166 if (insertedAdditionals) {
1188 if (insertedAdditionals) {
1195 if (edge ==
nullptr) {
1197 }
else if (
TAZ ==
nullptr) {
1203 if (insertedAdditionals) {
1225 if (insertedAdditionals) {
1232 if (edge ==
nullptr) {
1234 }
else if (
TAZ ==
nullptr) {
1240 if (insertedAdditionals) {
1269 }
else if (edge ==
nullptr) {
1274 if (GNEAttributeCarrier::canParse<double>(freq)) {
1275 if (GNEAttributeCarrier::parse<double>(freq) < 0) {
1288 if (insertedAdditionals) {
1328 if (insertedAdditionals) {
1335 if (route ==
nullptr) {
1338 }
else if (vtype ==
nullptr) {
1341 }
else if ((vehsPerHour.empty()) && (speed.empty())) {
1344 }
else if (calibrator !=
nullptr) {
1346 GNEAdditional* additionalCreated =
buildCalibratorFlow(net, allowUndoRedo, calibrator, route, vtype, vehsPerHour, speed, color, departLane, departPos, departSpeed, arrivalLane, arrivalPos, arrivalSpeed,
1347 line, personNumber, containerNumber, reroute, departPosLat, arrivalPosLat, begin, end);
1349 if (insertedAdditionals) {
1363 std::string
id = GNEAttributeCarrier::parseAttributeFromXML<std::string>(attrs,
"",
SUMO_TAG_VSS,
SUMO_ATTR_ID, abort);
1369 bool blockMovement =
false;
1376 std::vector<GNELane*> lanes;
1378 lanes = GNEAttributeCarrier::parse<std::vector<GNELane*> >(net, lanesIDs);
1383 }
else if (lanes.size() == 0) {
1384 WRITE_WARNING(
"A Variable Speed Sign needs at least one lane.");
1389 if (insertedAdditionals) {
1410 if (insertedAdditionals) {
1417 if (variableSpeedSign !=
nullptr) {
1421 if (insertedAdditionals) {
1445 bool blockMovement =
false;
1452 std::vector<GNEEdge*> edges;
1454 edges = GNEAttributeCarrier::parse<std::vector<GNEEdge*> >(net, edgesIDs);
1459 }
else if (edges.size() == 0) {
1464 file, off, timeThreshold, vTypes, blockMovement);
1466 if (insertedAdditionals) {
1487 if (insertedAdditionals) {
1494 if (rerouter ==
nullptr) {
1497 if (insertedAdditionals) {
1503 if (lastInsertedRerouterInterval) {
1510 }
else if (rerouter !=
nullptr) {
1514 if (insertedAdditionals) {
1537 if (insertedAdditionals) {
1544 if (lane ==
nullptr) {
1546 }
else if (rerouterInterval !=
nullptr) {
1550 if (insertedAdditionals) {
1573 if (insertedAdditionals) {
1580 if (edge ==
nullptr) {
1582 }
else if (rerouterInterval !=
nullptr) {
1586 if (insertedAdditionals) {
1608 if (insertedAdditionals) {
1615 if (edge ==
nullptr) {
1617 }
else if (rerouterInterval !=
nullptr) {
1621 if (insertedAdditionals) {
1644 if (insertedAdditionals) {
1651 if (parkingArea ==
nullptr) {
1653 }
else if (rerouterInterval !=
nullptr) {
1657 if (insertedAdditionals) {
1678 if (insertedAdditionals) {
1685 if (rerouterInterval !=
nullptr) {
1689 if (insertedAdditionals) {
1708 std::vector<std::string> lines = GNEAttributeCarrier::parseAttributeFromXML<std::vector<std::string> >(attrs, id,
SUMO_TAG_BUS_STOP,
SUMO_ATTR_LINES, abort);
1713 bool blockMovement =
false;
1724 }
else if (lane ==
nullptr) {
1729 double startPosDouble = 0;
1731 const double stoppingPlaceLength = (endPosDouble - startPosDouble);
1732 int parametersSet = 0;
1734 if (GNEAttributeCarrier::canParse<double>(startPos)) {
1735 startPosDouble = GNEAttributeCarrier::parse<double>(startPos);
1738 if (GNEAttributeCarrier::canParse<double>(endPos)) {
1739 endPosDouble = GNEAttributeCarrier::parse<double>(endPos);
1745 if (checkStopPosResult == SUMORouteHandler::StopPos::STOPPOS_INVALID_STARTPOS) {
1747 endPosDouble = stoppingPlaceLength;
1748 }
else if (checkStopPosResult == SUMORouteHandler::StopPos::STOPPOS_INVALID_ENDPOS) {
1751 }
else if (checkStopPosResult == SUMORouteHandler::StopPos::STOPPOS_INVALID_LANELENGTH) {
1757 GNEAdditional* additionalCreated =
buildBusStop(net, allowUndoRedo,
id, lane, startPosDouble, endPosDouble, parametersSet,
1758 name, lines, personCapacity, parkingLength, friendlyPosition, blockMovement);
1760 if (insertedAdditionals) {
1782 bool blockMovement =
false;
1793 }
else if (lane ==
nullptr) {
1798 double startPosDouble = 0;
1800 const double stoppingPlaceLength = (endPosDouble - startPosDouble);
1801 int parametersSet = 0;
1803 if (GNEAttributeCarrier::canParse<double>(startPos)) {
1804 startPosDouble = GNEAttributeCarrier::parse<double>(startPos);
1807 if (GNEAttributeCarrier::canParse<double>(endPos)) {
1808 endPosDouble = GNEAttributeCarrier::parse<double>(endPos);
1814 if (checkStopPosResult == SUMORouteHandler::StopPos::STOPPOS_INVALID_STARTPOS) {
1816 endPosDouble = stoppingPlaceLength;
1817 }
else if (checkStopPosResult == SUMORouteHandler::StopPos::STOPPOS_INVALID_ENDPOS) {
1820 }
else if (checkStopPosResult == SUMORouteHandler::StopPos::STOPPOS_INVALID_LANELENGTH) {
1827 name, lines, friendlyPosition, blockMovement);
1829 if (insertedAdditionals) {
1848 bool blockMovement =
false;
1854 double posDouble = GNEAttributeCarrier::parse<double>(position);
1859 if (insertedAdditionals) {
1866 if (lane ==
nullptr) {
1868 }
else if (busStop ==
nullptr) {
1876 GNEAdditional* additionalCreated =
buildAccess(net, allowUndoRedo, busStop, lane, posDouble, length, friendlyPos, blockMovement);
1878 if (insertedAdditionals) {
1903 bool blockMovement =
false;
1914 }
else if (lane ==
nullptr) {
1919 double startPosDouble = 0;
1921 const double stoppingPlaceLength = (endPosDouble - startPosDouble);
1922 int parametersSet = 0;
1924 if (GNEAttributeCarrier::canParse<double>(startPos)) {
1925 startPosDouble = GNEAttributeCarrier::parse<double>(startPos);
1928 if (GNEAttributeCarrier::canParse<double>(endPos)) {
1929 endPosDouble = GNEAttributeCarrier::parse<double>(endPos);
1935 if (checkStopPosResult == SUMORouteHandler::StopPos::STOPPOS_INVALID_STARTPOS) {
1937 endPosDouble = stoppingPlaceLength;
1938 }
else if (checkStopPosResult == SUMORouteHandler::StopPos::STOPPOS_INVALID_ENDPOS) {
1941 }
else if (checkStopPosResult == SUMORouteHandler::StopPos::STOPPOS_INVALID_LANELENGTH) {
1948 name, chargingPower, efficiency, chargeInTransit, chargeDelay, friendlyPosition, blockMovement);
1950 if (insertedAdditionals) {
1976 bool blockMovement =
false;
1987 }
else if (lane ==
nullptr) {
1992 double startPosDouble = 0;
1994 const double stoppingPlaceLength = (endPosDouble - startPosDouble);
1995 int parametersSet = 0;
1997 if (GNEAttributeCarrier::canParse<double>(startPos)) {
1998 startPosDouble = GNEAttributeCarrier::parse<double>(startPos);
2001 if (GNEAttributeCarrier::canParse<double>(endPos)) {
2002 endPosDouble = GNEAttributeCarrier::parse<double>(endPos);
2008 if (checkStopPosResult == SUMORouteHandler::StopPos::STOPPOS_INVALID_STARTPOS) {
2010 endPosDouble = stoppingPlaceLength;
2011 }
else if (checkStopPosResult == SUMORouteHandler::StopPos::STOPPOS_INVALID_ENDPOS) {
2014 }
else if (checkStopPosResult == SUMORouteHandler::StopPos::STOPPOS_INVALID_LANELENGTH) {
2021 name, friendlyPosition, roadSideCapacity, onRoad, width, length, angle, blockMovement);
2023 if (insertedAdditionals) {
2042 bool blockMovement =
false;
2051 if (insertedAdditionals) {
2058 if (parkingAreaParent !=
nullptr) {
2062 if (insertedAdditionals) {
2076 std::string edgeID, laneId, id;
2095 }
else if (edge ==
nullptr) {
2099 GNEAdditional* additionalCreated =
buildCalibrator(net, allowUndoRedo,
id, edge, position, name, outfile, freq, routeProbe, centerAfterCreation);
2101 if (insertedAdditionals) {
2124 }
else if (lane ==
nullptr) {
2128 GNEAdditional* additionalCreated =
buildCalibrator(net, allowUndoRedo,
id, lane, position, name, outfile, freq, routeProbe, centerAfterCreation);
2130 if (insertedAdditionals) {
2156 bool blockMovement =
false;
2167 }
else if (lane ==
nullptr) {
2174 GNEAdditional* additionalCreated =
buildDetectorE1(net, allowUndoRedo,
id, lane, position, frequency, file, vehicleTypes, name, friendlyPos, blockMovement);
2176 if (insertedAdditionals) {
2192 std::string
id = GNEAttributeCarrier::parseAttributeFromXML<std::string>(attrs,
"", E2Tag,
SUMO_ATTR_ID, abort);
2200 double position = GNEAttributeCarrier::parseAttributeFromXML<double>(attrs,
id, E2Tag,
SUMO_ATTR_POSITION, abort);
2201 std::string frequency = GNEAttributeCarrier::parseAttributeFromXML<std::string>(attrs,
id, E2Tag,
SUMO_ATTR_FREQUENCY, abort);
2202 const std::string trafficLight = GNEAttributeCarrier::parseAttributeFromXML<std::string>(attrs,
id, E2Tag,
SUMO_ATTR_TLID, abort);
2203 std::string file = GNEAttributeCarrier::parseAttributeFromXML<std::string>(attrs,
id, E2Tag,
SUMO_ATTR_FILE, abort);
2204 std::string vehicleTypes = GNEAttributeCarrier::parseAttributeFromXML<std::string>(attrs,
id, E2Tag,
SUMO_ATTR_VTYPES, abort);
2205 std::string name = GNEAttributeCarrier::parseAttributeFromXML<std::string>(attrs,
id, E2Tag,
SUMO_ATTR_NAME, abort);
2209 bool friendlyPos = GNEAttributeCarrier::parseAttributeFromXML<bool>(attrs,
id, E2Tag,
SUMO_ATTR_FRIENDLY_POS, abort);
2211 bool blockMovement =
false;
2213 blockMovement = GNEAttributeCarrier::parseAttributeFromXML<bool>(attrs,
id, E2Tag,
GNE_ATTR_BLOCK_MOVEMENT, abort);
2216 GNEAttributeCarrier::parseAttributeFromXML<std::string>(attrs,
id, E2Tag,
SUMO_ATTR_CONT, abort);
2220 if (laneId.empty() && laneIds.empty()) {
2222 }
else if (!frequency.empty() && !trafficLight.empty()) {
2223 WRITE_WARNING(
"Frecuency and TL cannot be defined at the same time.");
2226 if (frequency.empty() && trafficLight.empty()) {
2227 frequency =
"900.00";
2232 std::vector<GNELane*> lanes;
2233 bool laneConsecutives =
true;
2235 lanes = GNEAttributeCarrier::parse<std::vector<GNELane*> >(net, laneIds);
2245 WRITE_WARNING(
"The lane '" + laneId +
"' to use within the " +
toString(E2Tag) +
" '" +
id +
"' is not known.");
2251 WRITE_WARNING(
"The list of lanes '" + laneIds +
"' to use within the " +
toString(E2Tag) +
" '" +
id +
"' isn't valid.");
2252 }
else if (!lanes.empty() && !laneConsecutives) {
2253 WRITE_WARNING(
"The lanes '" + laneIds +
"' to use within the " +
toString(E2Tag) +
" '" +
id +
"' aren't consecutives.");
2256 }
else if (!lanes.empty() && !
fixE2DetectorPosition(position, length, lanes.front()->getParentEdge()->getNBEdge()->getFinalLength(), friendlyPos)) {
2258 }
else if (!lanes.empty() && !
fixE2DetectorPosition(endPos, length, lanes.back()->getParentEdge()->getNBEdge()->getFinalLength(), friendlyPos)) {
2262 GNEAdditional* additionalCreated =
buildSingleLaneDetectorE2(net, allowUndoRedo,
id, lane, position, length, frequency, trafficLight, file, vehicleTypes,
2263 name, haltingTimeThreshold, haltingSpeedThreshold, jamDistThreshold, friendlyPos, blockMovement);
2265 if (insertedAdditionals) {
2271 GNEAdditional* additionalCreated =
buildMultiLaneDetectorE2(net, allowUndoRedo,
id, lanes, position, endPos, frequency, trafficLight, file, vehicleTypes,
2272 name, haltingTimeThreshold, haltingSpeedThreshold, jamDistThreshold, friendlyPos, blockMovement);
2274 if (insertedAdditionals) {
2298 bool blockMovement =
false;
2309 GNEAdditional* additionalCreated =
buildDetectorE3(net, allowUndoRedo,
id, pos, frequency, file, vehicleTypes, name, haltingTimeThreshold, haltingSpeedThreshold, blockMovement);
2311 if (insertedAdditionals) {
2329 bool blockMovement =
false;
2339 if (insertedAdditionals) {
2346 if (lane ==
nullptr) {
2350 }
else if (E3Parent) {
2354 if (insertedAdditionals) {
2372 bool blockMovement =
false;
2382 if (insertedAdditionals) {
2389 if (lane ==
nullptr) {
2393 }
else if (E3Parent) {
2397 if (insertedAdditionals) {
2419 bool blockMovement =
false;
2430 }
else if (lane ==
nullptr) {
2439 if (insertedAdditionals) {
2456 std::string polygonID = GNEAttributeCarrier::parseAttributeFromXML<std::string>(attrs,
"",
SUMO_TAG_POLY,
SUMO_ATTR_ID, abort);
2461 std::string type = GNEAttributeCarrier::parseAttributeFromXML<std::string>(attrs, polygonID,
SUMO_TAG_POLY,
SUMO_ATTR_TYPE, abort);
2478 bool success =
true;
2479 for (
int i = 0; i < (int)shape.size(); i++) {
2483 WRITE_WARNING(
"Unable to project coordinates for polygon '" + polygonID +
"'.");
2492 if (!
myNet->
getAttributeCarriers()->
addPolygon(polygonID, type, color, layer, angle, imgFile, relativePath, shape, geo, fill, lineWidth,
false)) {
2493 WRITE_WARNING(
"Polygon with ID '" + polygonID +
"' already exists.");
2506 std::string POIID = GNEAttributeCarrier::parseAttributeFromXML<std::string>(attrs,
"",
SUMO_TAG_POI,
SUMO_ATTR_ID, abort);
2518 std::string type = GNEAttributeCarrier::parseAttributeFromXML<std::string>(attrs, POIID,
SUMO_TAG_POI,
SUMO_ATTR_TYPE, abort);
2538 WRITE_WARNING(
"The lane '" + laneID +
"' to use within the PoI '" + POIID +
"' is not known.");
2542 bool useGeo =
false;
2548 pos =
getLanePos(POIID, laneID, lanePos, lanePosLat);
2552 WRITE_WARNING(
"Either (x, y), (lon, lat) or (lane, pos) must be specified for PoI '" + POIID +
"'.");
2555 WRITE_WARNING(
"(lon, lat) is specified for PoI '" + POIID +
"' but no geo-conversion is specified for the network.");
2562 WRITE_WARNING(
"Unable to project coordinates for PoI '" + POIID +
"'.");
2568 if (!
myNet->
getAttributeCarriers()->
addPOI(POIID, type, color, pos, useGeo, laneID, lanePos, lanePosLat, layer, angle, imgFile, relativePath, width, height,
false)) {
2569 WRITE_WARNING(
"POI with ID '" + POIID +
"' already exists.");
2588 WRITE_WARNING(
"Error parsing key from shape parameter. Key cannot be empty");
2592 WRITE_WARNING(
"Error parsing key from shape parameter. Key contains invalid characters");
2596 WRITE_WARNING(
"Error parsing key from shape parameter. Key doesn't exist");
2603 WRITE_DEBUG(
"Inserting parameter '" + key +
"|" + val +
"' into shape.");
2615 WRITE_WARNING(
"Error parsing key from additional parameter. Key cannot be empty");
2619 WRITE_WARNING(
"Error parsing key from additional parameter. Key contains invalid characters");
2623 WRITE_WARNING(
"Error parsing key from additional parameter. Key doesn't exist");
2630 WRITE_WARNING(
"Error parsing value from additional float parameter. Value cannot be parsed to float");
2650 WRITE_WARNING(
"Error parsing key from shape parameter. Key cannot be empty");
2654 WRITE_WARNING(
"Error parsing key from shape parameter. Key contains invalid characters");
2658 WRITE_WARNING(
"Error parsing key from shape parameter. Key doesn't exist");
2665 WRITE_WARNING(
"Error parsing value from shape float parameter. Value cannot be parsed to float");
2685 WRITE_WARNING(
"Error parsing key from TAZ parameter. Key cannot be empty");
2689 WRITE_WARNING(
"Error parsing key from TAZ parameter. Key contains invalid characters");
2693 WRITE_WARNING(
"Error parsing key from TAZ parameter. Key doesn't exist");
2700 WRITE_WARNING(
"Error parsing value from TAZ float parameter. Value cannot be parsed to float");
2712 WRITE_WARNING(
"Parameters has to be declared within the definition of an additional, shape or TAZ element");
2728 myInsertedElements.back().additional = additional;
2734 myInsertedElements.back().shape = shapeCreated;
2740 myInsertedElements.back().TAZElement = TAZElementCreated;
2746 if (!myInsertedElements.empty()) {
2747 myInsertedElements.pop_back();
2754 if (myInsertedElements.size() < 2) {
2756 WRITE_WARNING(
"A " +
toString(myInsertedElements.back().tag) +
" must be declared within the definition of a " +
toString(expectedTag) +
".");
2759 if (myInsertedElements.size() < 2) {
2762 }
else if ((myInsertedElements.end() - 2)->additional ==
nullptr) {
2770 retrievedAdditional = myInsertedElements.at(1).additional;
2772 retrievedAdditional = net->
retrieveAdditional((myInsertedElements.end() - 2)->tag, (myInsertedElements.end() - 2)->additional->getID(),
false);
2774 if (retrievedAdditional ==
nullptr) {
2776 WRITE_WARNING(
"A " +
toString((myInsertedElements.end() - 1)->tag) +
" must be declared within the definition of a " +
toString(expectedTag) +
".");
2780 WRITE_WARNING(
"A " +
toString((myInsertedElements.end() - 1)->tag) +
" cannot be declared within the definition of a " + retrievedAdditional->
getTagStr() +
".");
2783 return retrievedAdditional;
2791 if (myInsertedElements.size() < 2) {
2793 WRITE_WARNING(
"A " +
toString(myInsertedElements.back().tag) +
" must be declared within the definition of a " +
toString(expectedTag) +
".");
2796 if (myInsertedElements.size() < 2) {
2799 }
else if ((myInsertedElements.end() - 2)->shape ==
nullptr) {
2804 GNEShape* retrievedShape = net->
retrieveShape((myInsertedElements.end() - 2)->tag, (myInsertedElements.end() - 2)->shape->getID(),
false);
2805 if (retrievedShape ==
nullptr) {
2807 WRITE_WARNING(
"A " +
toString((myInsertedElements.end() - 1)->tag) +
" must be declared within the definition of a " +
toString(expectedTag) +
".");
2811 WRITE_WARNING(
"A " +
toString((myInsertedElements.end() - 1)->tag) +
" cannot be declared within the definition of a " + retrievedShape->
getTagStr() +
".");
2814 return retrievedShape;
2822 if (myInsertedElements.size() < 2) {
2824 WRITE_WARNING(
"A " +
toString(myInsertedElements.back().tag) +
" must be declared within the definition of a " +
toString(expectedTag) +
".");
2827 if (myInsertedElements.size() < 2) {
2830 }
else if ((myInsertedElements.end() - 2)->TAZElement ==
nullptr) {
2835 GNETAZElement* retrievedTAZElement = net->
retrieveTAZElement((myInsertedElements.end() - 2)->tag, (myInsertedElements.end() - 2)->TAZElement->getID(),
false);
2836 if (retrievedTAZElement ==
nullptr) {
2838 WRITE_WARNING(
"A " +
toString((myInsertedElements.end() - 1)->tag) +
" must be declared within the definition of a " +
toString(expectedTag) +
".");
2842 WRITE_WARNING(
"A " +
toString((myInsertedElements.end() - 1)->tag) +
" cannot be declared within the definition of a " + retrievedTAZElement->
getTagStr() +
".");
2845 return retrievedTAZElement;
2854 for (std::vector<StackElement>::const_reverse_iterator i = myInsertedElements.rbegin(); i != myInsertedElements.rend(); i++) {
2857 return i->additional;
2867 for (std::vector<StackElement>::const_reverse_iterator i = myInsertedElements.rbegin(); i != myInsertedElements.rend(); i++) {
2880 for (std::vector<StackElement>::const_reverse_iterator i = myInsertedElements.rbegin(); i != myInsertedElements.rend(); i++) {
2883 return i->TAZElement;
2892 additional(nullptr),
2894 TAZElement(nullptr) {
const int STOPPINGPLACE_STARTPOS_SET
const int STOPPINGPLACE_ENDPOS_SET
#define WRITE_MESSAGE(msg)
#define WRITE_WARNING(msg)
SVCPermissions parseVehicleClasses(const std::string &allowedS)
Parses the given definition of allowed vehicle classes into the given containers Deprecated classes g...
int SVCPermissions
bitset where each bit declares whether a certain SVC may use this edge/lane
SumoXMLTag
Numbers representing SUMO-XML - element names.
@ SUMO_TAG_INTERVAL
an aggreagated-output interval
@ SUMO_TAG_CLOSING_REROUTE
reroute of type closing
@ SUMO_TAG_REROUTER
A rerouter.
@ SUMO_TAG_ROUTEPROBE
a routeprobe detector
@ SUMO_TAG_TAZ
a traffic assignment zone
@ SUMO_TAG_E2DETECTOR
an e2 detector
@ SUMO_TAG_CHARGING_STATION
A Charging Station.
@ SUMO_TAG_VTYPE
description of a vehicle type
@ SUMO_TAG_ACCESS
An access point for a train stop.
@ SUMO_TAG_E2DETECTOR_MULTILANE
an e2 detector over multiple lanes (used by Netedit)
@ SUMO_TAG_NOTHING
invalid tag
@ SUMO_TAG_CONTAINER_STOP
A container stop.
@ SUMO_TAG_TAZSINK
a sink within a district (connection road)
@ SUMO_TAG_BUS_STOP
A bus stop.
@ SUMO_TAG_POI
begin/end of the description of a Point of interest
@ SUMO_TAG_LANECALIBRATOR
A calibrator placed over lane (used in netedit)
@ SUMO_TAG_STEP
trigger: a step description
@ SUMO_TAG_PARKING_AREA
A parking area.
@ SUMO_TAG_PARKING_ZONE_REROUTE
entry for an alternative parking zone
@ SUMO_TAG_ROUTE_PROB_REROUTE
probability of route of a reroute
@ SUMO_TAG_DET_ENTRY
an e3 entry point
@ SUMO_TAG_PARKING_SPACE
A parking space for a single vehicle within a parking area.
@ SUMO_TAG_ROUTE
begin/end of the description of a route
@ SUMO_TAG_POLY
begin/end of the description of a polygon
@ SUMO_TAG_TRAIN_STOP
A train stop (alias for bus stop)
@ SUMO_TAG_LANE
begin/end of the description of a single lane
@ SUMO_TAG_INSTANT_INDUCTION_LOOP
An instantenous induction loop.
@ SUMO_TAG_POILANE
begin/end of the description of a Point of interest over Lane (used by Netedit)
@ SUMO_TAG_DEST_PROB_REROUTE
probability of destiny of a reroute
@ SUMO_TAG_PARAM
parameter associated to a certain key
@ SUMO_TAG_E1DETECTOR
an e1 detector
@ SUMO_TAG_DET_EXIT
an e3 exit point
@ SUMO_TAG_VAPORIZER
vaporizer of vehicles
@ SUMO_TAG_LANE_AREA_DETECTOR
alternative tag for e2 detector
@ SUMO_TAG_TAZSOURCE
a source within a district (connection road)
@ SUMO_TAG_CLOSING_LANE_REROUTE
lane of a reroute of type closing
@ SUMO_TAG_INDUCTION_LOOP
alternative tag for e1 detector
@ SUMO_TAG_CALIBRATOR
A calibrator placed over edge.
@ SUMO_TAG_ENTRY_EXIT_DETECTOR
alternative tag for e3 detector
@ SUMO_TAG_E3DETECTOR
an e3 detector
@ SUMO_TAG_VSS
A variable speed sign.
@ SUMO_TAG_FLOW_CALIBRATOR
a flow definition within in Calibrator (used in NETEDIT)
@ SUMO_TAG_EDGE
begin/end of the description of an edge
@ GNE_ATTR_CENTER_AFTER_CREATION
flag to center camera after element creation
@ SUMO_ATTR_JAM_DIST_THRESHOLD
@ SUMO_ATTR_DEPARTPOS_LAT
@ SUMO_ATTR_PARKING_LENGTH
@ GNE_ATTR_BLOCK_MOVEMENT
block movement of a graphic element
@ GNE_ATTR_PARENT
parent of an additional element
@ SUMO_ATTR_BEGIN
weights: time range begin
@ SUMO_ATTR_EDGES
the edges of a route
@ SUMO_ATTR_CONTAINER_NUMBER
@ SUMO_ATTR_HALTING_TIME_THRESHOLD
@ SUMO_ATTR_SHAPE
edge: the shape in xml-definition
@ SUMO_ATTR_CHARGEINTRANSIT
Allow/disallow charge in transit in Charging Stations.
@ SUMO_ATTR_FILL
Fill the polygon.
@ SUMO_ATTR_LAYER
A layer number.
@ SUMO_ATTR_HALTING_SPEED_THRESHOLD
@ SUMO_ATTR_END
weights: time range end
@ SUMO_ATTR_ROADSIDE_CAPACITY
@ SUMO_ATTR_TLID
link,node: the traffic light id responsible for this link
@ SUMO_ATTR_CHARGINGPOWER
@ SUMO_ATTR_PERSON_NUMBER
@ SUMO_ATTR_COLOR
A color information.
@ SUMO_ATTR_EFFICIENCY
Eficiency of the charge in Charging Stations.
@ SUMO_ATTR_ARRIVALPOS_LAT
@ SUMO_ATTR_PERSON_CAPACITY
@ SUMO_ATTR_CHARGEDELAY
Delay in the charge of charging stations.
@ SUMO_ATTR_TIME
trigger: the time of the step
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
A class that stores a 2D geometrical boundary.
void add(double x, double y, double z=0)
Makes the boundary include the given coordinate.
double ymin() const
Returns minimum y-coordinate.
double xmin() const
Returns minimum x-coordinate.
double ymax() const
Returns maximum y-coordinate.
double xmax() const
Returns maximum x-coordinate.
static bool isAbsolute(const std::string &path)
Returns the information whether the given path is absolute.
static std::string getConfigurationRelative(const std::string &configPath, const std::string &path)
Returns the second path as a relative path to the first file.
static std::string getFilePath(const std::string &path)
Removes the file information from the given path.
Stack used to save the last inserted element.
std::vector< StackElement > myInsertedElements
vector used as stack
GNEShape * getLastInsertedShape() const
return last inserted shape
GNETAZElement * getTAZElementParent(GNENet *net, SumoXMLTag expectedTag) const
retrieve parent TAZElement correspond to current status of myInsertedElements
void commitTAZElementInsertion(GNETAZElement *TAZElementCreated)
commit TAZElement element insertion (used to save last correct created element)
GNETAZElement * getLastInsertedTAZElement() const
return last inserted TAZElement
GNEAdditional * getLastInsertedAdditional() const
return last inserted additional
void commitAdditionalInsertion(GNEAdditional *additionalCreated)
commit additional element insertion (used to save last correct created element)
void commitShapeInsertion(GNEShape *shapeCreated)
commit shape element insertion (used to save last correct created element)
void popElement()
pop last inserted element (used only in function myEndElement)
GNEShape * getShapeParent(GNENet *net, SumoXMLTag expectedTag) const
retrieve parent shape correspond to current status of myInsertedElements
void insertElement(SumoXMLTag tag)
insert new element (called only in function myStartElement)
GNEAdditional * getAdditionalParent(GNENet *net, SumoXMLTag expectedTag) const
retrieve parent additional correspond to current status of myInsertedElements
Builds additional objects for GNENet (busStops, chargingStations, detectors, etc.....
static bool checkOverlappingRerouterIntervals(GNEAdditional *rerouter, SUMOTime newBegin, SUMOTime newEnd)
check if an overlapping is produced in rerouter if a interval with certain begin and end is inserted
static bool checkAndFixDetectorPosition(double &pos, const double laneLength, const bool friendlyPos)
check if the position of a detector over a lane is valid
static bool parseAndBuildTAZSource(GNENet *net, bool allowUndoRedo, const SUMOSAXAttributes &attrs, LastInsertedElement *insertedAdditionals)
Builds a TAZ Source.
static bool parseAndBuildRerouterClosingLaneReroute(GNENet *net, bool allowUndoRedo, const SUMOSAXAttributes &attrs, LastInsertedElement *insertedAdditionals)
Parses his values and builds a Closing Lane reroute.
static bool parseAndBuildTAZSink(GNENet *net, bool allowUndoRedo, const SUMOSAXAttributes &attrs, LastInsertedElement *insertedAdditionals)
Builds a TAZ Sink.
static GNEAdditional * buildMultiLaneDetectorE2(GNENet *net, bool allowUndoRedo, const std::string &id, const std::vector< GNELane * > &lanes, double pos, double endPos, const std::string &freq, const std::string &trafficLight, const std::string &filename, const std::string &vehicleTypes, const std::string &name, SUMOTime timeThreshold, double speedThreshold, double jamThreshold, bool friendlyPos, bool blockMovement)
Builds a multi-lane Area Detector (E2)
~GNEAdditionalHandler()
Destructor.
static GNEAdditional * buildChargingStation(GNENet *net, bool allowUndoRedo, const std::string &id, GNELane *lane, const double startPos, const double endPos, const int parametersSet, const std::string &name, double chargingPower, double efficiency, bool chargeInTransit, SUMOTime chargeDelay, bool friendlyPosition, bool blockMovement)
Builds a charging Station.
void parseAndBuildPoly(const SUMOSAXAttributes &attrs)
Parses his values and builds a Poly.
static GNEAdditional * buildVaporizer(GNENet *net, bool allowUndoRedo, GNEEdge *edge, SUMOTime start, SUMOTime endTime, const std::string &name, bool centerAfterCreation)
Builds a vaporizer (lane speed additional)
static bool parseAndBuildBusStop(GNENet *net, bool allowUndoRedo, const SUMOSAXAttributes &attrs, LastInsertedElement *insertedAdditionals)
Parses his values and builds a bus stop.
static bool parseAndBuildDetectorExit(GNENet *net, bool allowUndoRedo, const SUMOSAXAttributes &attrs, LastInsertedElement *insertedAdditionals)
Parses his values and builds a Exit detector.
static GNEAdditional * buildBusStop(GNENet *net, bool allowUndoRedo, const std::string &id, GNELane *lane, const double startPos, const double endPos, const int parametersSet, const std::string &name, const std::vector< std::string > &lines, int personCapacity, double parkingLength, bool friendlyPosition, bool blockMovement)
Builds a bus stop.
static GNEAdditional * buildClosingLaneReroute(GNENet *net, bool allowUndoRedo, GNEAdditional *rerouterIntervalParent, GNELane *closedLane, SVCPermissions permissions)
static bool parseAndBuildParkingSpace(GNENet *net, bool allowUndoRedo, const SUMOSAXAttributes &attrs, LastInsertedElement *insertedAdditionals)
Parses his values and builds a parking space.
static GNEAdditional * buildVariableSpeedSign(GNENet *net, bool allowUndoRedo, const std::string &id, Position pos, const std::vector< GNELane * > &destLanes, const std::string &name, bool blockMovement)
Builds a VariableSpeedSign (lane speed additional)
static bool buildAdditional(GNENet *net, bool allowUndoRedo, SumoXMLTag tag, const SUMOSAXAttributes &attrs, LastInsertedElement *insertedAdditionals)
Build additionals.
static bool parseAndBuildRerouter(GNENet *net, bool allowUndoRedo, const SUMOSAXAttributes &attrs, LastInsertedElement *insertedAdditionals)
Parses his values and builds a rerouter.
static GNEAdditional * builParkingAreaReroute(GNENet *net, bool allowUndoRedo, GNEAdditional *rerouterIntervalParent, GNEAdditional *newParkignArea, double probability, bool visible)
static bool accessCanBeCreated(GNEAdditional *busStopParent, GNEEdge *edge)
check if a GNEAccess can be created in a certain Edge
static bool parseAndBuildCalibratorFlow(GNENet *net, bool allowUndoRedo, const SUMOSAXAttributes &attrs, LastInsertedElement *insertedAdditionals)
Parses flow values of Calibrators.
static bool parseAndBuildRerouterClosingReroute(GNENet *net, bool allowUndoRedo, const SUMOSAXAttributes &attrs, LastInsertedElement *insertedAdditionals)
Parses his values and builds a Closing Reroute.
static GNEAdditional * buildDetectorE1(GNENet *net, 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)
Builds a induction loop detector (E1)
static bool parseAndBuildChargingStation(GNENet *net, bool allowUndoRedo, const SUMOSAXAttributes &attrs, LastInsertedElement *insertedAdditionals)
Parses his values and builds a charging station.
static GNEAdditional * builDestProbReroute(GNENet *net, bool allowUndoRedo, GNEAdditional *rerouterIntervalParent, GNEEdge *newEdgeDestination, double probability)
static GNEAdditional * buildClosingReroute(GNENet *net, bool allowUndoRedo, GNEAdditional *rerouterIntervalParent, GNEEdge *closedEdge, SVCPermissions permissions)
static GNETAZElement * buildTAZSink(GNENet *net, bool allowUndoRedo, GNETAZElement *TAZ, GNEEdge *edge, double arrivalWeight)
Builds a TAZSink (Traffic Assignment Zone)
static GNEAdditional * buildDetectorE3(GNENet *net, bool allowUndoRedo, const std::string &id, Position pos, SUMOTime freq, const std::string &filename, const std::string &vehicleTypes, const std::string &name, SUMOTime timeThreshold, double speedThreshold, bool blockMovement)
Builds a multi entry exit detector (E3)
static bool parseAndBuildVaporizer(GNENet *net, bool allowUndoRedo, const SUMOSAXAttributes &attrs, LastInsertedElement *insertedAdditionals)
Builds a Vaporizer.
static bool fixE2DetectorPosition(double &pos, double &length, const double laneLength, const bool friendlyPos)
check if the position of a detector over a lane is valid
double getPosition(double pos, GNELane &lane, bool friendlyPos, const std::string &additionalID)
extracts the position, checks whether it shall be mirrored and checks whether it is within the lane.
static bool parseAndBuildRerouterParkingAreaReroute(GNENet *net, bool allowUndoRedo, const SUMOSAXAttributes &attrs, LastInsertedElement *insertedAdditionals)
Parses his values and builds a parkingAreaReroute.
static bool parseAndBuildCalibrator(GNENet *net, bool allowUndoRedo, const SUMOSAXAttributes &attrs, LastInsertedElement *insertedAdditionals)
Parses his values and builds a mesoscopic or microscopic calibrator.
static bool parseAndBuildTAZ(GNENet *net, bool allowUndoRedo, const SUMOSAXAttributes &attrs, LastInsertedElement *insertedAdditionals)
Builds a TAZ.
LastInsertedElement * myLastInsertedElement
LastInsertedElement used for insert children.
static GNETAZElement * buildTAZSource(GNENet *net, bool allowUndoRedo, GNETAZElement *TAZ, GNEEdge *edge, double departWeight)
Builds a TAZSource (Traffic Assignment Zone)
static bool parseAndBuildRouteProbe(GNENet *net, bool allowUndoRedo, const SUMOSAXAttributes &attrs, LastInsertedElement *insertedAdditionals)
Parses his values and builds routeProbe.
static bool parseAndBuildDetectorE1(GNENet *net, bool allowUndoRedo, const SUMOSAXAttributes &attrs, LastInsertedElement *insertedAdditionals)
Parses his values and builds a induction loop detector (GNENet *net, bool allowUndoRedo,...
static GNEAdditional * buildSingleLaneDetectorE2(GNENet *net, bool allowUndoRedo, const std::string &id, GNELane *lane, double pos, double length, const std::string &freq, const std::string &trafficLight, const std::string &filename, const std::string &vehicleTypes, const std::string &name, SUMOTime timeThreshold, double speedThreshold, double jamThreshold, bool friendlyPos, bool blockMovement)
Builds a single-lane Area Detector (E2)
static GNEAdditional * buildParkingArea(GNENet *net, bool allowUndoRedo, const std::string &id, GNELane *lane, const double startPos, const double endPos, const int parametersSet, const std::string &name, bool friendlyPosition, int roadSideCapacity, bool onRoad, double width, const std::string &length, double angle, bool blockMovement)
Builds a Parking Area.
void myStartElement(int element, const SUMOSAXAttributes &attrs)
Called on the opening of a tag;.
static bool parseAndBuildRerouterInterval(GNENet *net, bool allowUndoRedo, const SUMOSAXAttributes &attrs, LastInsertedElement *insertedAdditionals)
Parses his values and builds a Rerouter Interval.
static GNEAdditional * buildRouteProbe(GNENet *net, bool allowUndoRedo, const std::string &id, GNEEdge *edge, const std::string &freq, const std::string &name, const std::string &file, SUMOTime begin, bool centerAfterCreation)
builds a Route probe
static GNEAdditional * buildDetectorEntry(GNENet *net, bool allowUndoRedo, GNEAdditional *E3Parent, GNELane *lane, double pos, bool friendlyPos, bool blockMovement)
Builds a entry detector (E3)
GNEAdditionalHandler(const std::string &file, GNENet *net, GNEAdditional *additionalParent=nullptr)
Constructor.
static bool parseAndBuildDetectorE1Instant(GNENet *net, bool allowUndoRedo, const SUMOSAXAttributes &attrs, LastInsertedElement *insertedAdditionals)
Parses his values and builds a Instant induction loop detector (GNENet *net, bool allowUndoRedo,...
static bool parseAndBuildParkingArea(GNENet *net, bool allowUndoRedo, const SUMOSAXAttributes &attrs, LastInsertedElement *insertedAdditionals)
Parses his values and builds a parking area.
static GNEAdditional * buildVariableSpeedSignStep(GNENet *net, bool allowUndoRedo, GNEAdditional *VSSParent, double time, double speed)
Builds a VariableSpeedSign Step.
static GNEAdditional * buildCalibrator(GNENet *net, bool allowUndoRedo, const std::string &id, GNELane *lane, double pos, const std::string &name, const std::string &outfile, SUMOTime freq, const std::string &routeprobe, bool centerAfterCreation)
builds a microscopic calibrator over a lane
void myEndElement(int element)
Called when a closing tag occurs.
static GNETAZElement * buildTAZ(GNENet *net, bool allowUndoRedo, const std::string &id, const PositionVector &shape, const RGBColor &color, const std::vector< GNEEdge * > &edges, bool blockMovement)
Builds a TAZ (Traffic Assignment Zone)
static bool parseAndBuildDetectorE3(GNENet *net, bool allowUndoRedo, const SUMOSAXAttributes &attrs, LastInsertedElement *insertedAdditionals)
Parses his values and builds a multi entry exit detector (GNENet *net, bool allowUndoRedo,...
static GNEAdditional * buildRerouter(GNENet *net, 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)
builds a rerouter
static bool parseAndBuildVariableSpeedSign(GNENet *net, bool allowUndoRedo, const SUMOSAXAttributes &attrs, LastInsertedElement *insertedAdditionals)
Parses his values and builds a Variable Speed Signal (GNENet *net, bool allowUndoRedo,...
static GNEAdditional * buildDetectorExit(GNENet *net, bool allowUndoRedo, GNEAdditional *E3Parent, GNELane *lane, double pos, bool friendlyPos, bool blockMovement)
Builds a exit detector (E3)
GNENet * myNet
pointer to net
static bool parseAndBuildDetectorE2(GNENet *net, bool allowUndoRedo, const SUMOSAXAttributes &attrs, LastInsertedElement *insertedAdditionals)
Parses his values and builds a lane area detector (GNENet *net, bool allowUndoRedo,...
void parseAndBuildPOI(const SUMOSAXAttributes &attrs)
Parses his values and builds a POI.
static GNEAdditional * buildParkingSpace(GNENet *net, bool allowUndoRedo, GNEAdditional *parkingAreaParent, Position pos, double width, double length, double angle, bool blockMovement)
Builds a Parking Space.
static bool parseAndBuildContainerStop(GNENet *net, bool allowUndoRedo, const SUMOSAXAttributes &attrs, LastInsertedElement *insertedAdditionals)
Parses his values and builds a container stop.
static GNEAdditional * buildRouteProbReroute(GNENet *net, bool allowUndoRedo, GNEAdditional *rerouterIntervalParent, const std::string &newRouteId, double probability)
static GNEAdditional * buildContainerStop(GNENet *net, bool allowUndoRedo, const std::string &id, GNELane *lane, const double startPos, const double endPos, const int parametersSet, const std::string &name, const std::vector< std::string > &lines, bool friendlyPosition, bool blockMovement)
Builds a container stop.
void parseParameter(const SUMOSAXAttributes &attrs)
Parse parameter and insert it in the last created additional.
static GNEAdditional * buildRerouterInterval(GNENet *net, bool allowUndoRedo, GNEAdditional *rerouterParent, SUMOTime begin, SUMOTime end)
builds a rerouter interval
static GNEAdditional * buildDetectorE1Instant(GNENet *net, bool allowUndoRedo, const std::string &id, GNELane *lane, double pos, const std::string &filename, const std::string &vehicleTypes, const std::string &name, bool friendlyPos, bool blockMovement)
Builds a Instant Induction Loop Detector (E1Instant)
static GNEAdditional * buildAccess(GNENet *net, bool allowUndoRedo, GNEAdditional *busStop, GNELane *lane, double pos, const std::string &length, bool friendlyPos, bool blockMovement)
Builds an Access.
static bool parseAndBuildVariableSpeedSignStep(GNENet *net, bool allowUndoRedo, const SUMOSAXAttributes &attrs, LastInsertedElement *insertedAdditionals)
Parses his values and builds a Variable Speed Signal Step.
static GNEAdditional * buildCalibratorFlow(GNENet *net, bool allowUndoRedo, GNEAdditional *calibratorParent, GNEDemandElement *route, GNEDemandElement *vType, const std::string &vehsPerHour, const std::string &speed, const RGBColor &color, const std::string &departLane, const std::string &departPos, const std::string &departSpeed, const std::string &arrivalLane, const std::string &arrivalPos, const std::string &arrivalSpeed, const std::string &line, int personNumber, int containerNumber, bool reroute, const std::string &departPosLat, const std::string &arrivalPosLat, SUMOTime begin, SUMOTime end)
builds a calibrator flow
static bool parseAndBuildRerouterRouteProbReroute(GNENet *net, bool allowUndoRedo, const SUMOSAXAttributes &attrs, LastInsertedElement *insertedAdditionals)
Parses his values and builds a Route Prob Reroute.
static bool parseAndBuildRerouterDestProbReroute(GNENet *net, bool allowUndoRedo, const SUMOSAXAttributes &attrs, LastInsertedElement *insertedAdditionals)
Parses his values and builds a Destiny Prob Reroute.
static bool parseAndBuildAccess(GNENet *net, bool allowUndoRedo, const SUMOSAXAttributes &attrs, LastInsertedElement *insertedAdditionals)
Parses values and adds access to the current bus stop.
Position getLanePos(const std::string &poiID, const std::string &laneID, double lanePos, double lanePosLat)
get lane position
static bool parseAndBuildDetectorEntry(GNENet *net, bool allowUndoRedo, const SUMOSAXAttributes &attrs, LastInsertedElement *insertedAdditionals)
Parses his values and builds a Entry detector.
An Element which don't belongs to GNENet but has influency in the simulation.
const std::string & getID() const
get ID
virtual void updateGeometry()=0
update pre-computed geometry information
Position getPositionInView() const
Returns position of additional in view.
const std::string & getTagStr() const
get tag assigned to this object in string format
const GNETagProperties & getTagProperty() const
get Tag Property assigned to this object
static bool canParse(const std::string &string)
true if a value of type T can be parsed from string
static bool lanesConsecutives(const std::vector< GNELane * > &lanes)
check if lanes are consecutives
static const double INVALID_POSITION
invalid double position
A lane area vehicles can halt at (netedit-version)
A lane area vehicles can halt at (netedit-version)
An Element which don't belongs to GNENet but has influency in the simulation.
A road/street connecting two junctions (netedit-version)
NBEdge * getNBEdge() const
returns the internal NBEdge
const std::vector< GNELane * > & getLanes() const
returns a reference to the lane vector
void addChildElement(T *element)
add child element
const std::vector< GNEAdditional * > & getParentAdditionals() const
get parent additionals
const std::vector< GNEAdditional * > & getChildAdditionals() const
return child additionals
This lane is powered by an underlying GNEEdge and basically knows how to draw itself.
double getLaneShapeLength() const
returns the length of the lane's shape
GNEEdge * getParentEdge() const
get arent edge
bool addPOI(const std::string &id, const std::string &type, const RGBColor &color, const Position &pos, bool geo, const std::string &lane, double posOverLane, double posLat, double layer, double angle, const std::string &imgFile, bool relativePath, double width, double height, bool ignorePruning=false)
Builds a POI using the given values and adds it to the container.
bool addPolygon(const std::string &id, const std::string &type, const RGBColor &color, double layer, double angle, const std::string &imgFile, bool relativePath, const PositionVector &shape, bool geo, bool fill, double lineWidth, bool ignorePruning=false)
Builds a polygon using the given values and adds it to the container.
void insertTAZElement(GNETAZElement *TAZElement)
Insert a TAZElement element int GNENet container.
void insertAdditional(GNEAdditional *additional)
Insert a additional element int GNENet container.
const std::map< SumoXMLTag, std::map< std::string, GNEShape * > > & getShapes() const
A NBNetBuilder extended by visualisation and editing capabilities.
void disableUpdateGeometry()
disable update geometry of elements after inserting or removing an element in net
GNELane * retrieveLane(const std::string &id, bool failHard=true, bool checkVolatileChange=false)
get lane by id
GNEEdge * retrieveEdge(const std::string &id, bool failHard=true) const
get edge by id
GNETAZElement * retrieveTAZElement(SumoXMLTag type, const std::string &id, bool hardFail=true) const
Returns the named TAZElement.
GNENetHelper::AttributeCarriers * getAttributeCarriers() const
retrieve all attribute carriers of Net
GNEAdditional * retrieveAdditional(SumoXMLTag type, const std::string &id, bool hardFail=true) const
Returns the named additional.
GNEShape * retrieveShape(SumoXMLTag type, const std::string &id, bool hardFail=true) const
Returns the named shape.
GNEDemandElement * retrieveDemandElement(SumoXMLTag type, const std::string &id, bool hardFail=true) const
Returns the named demand element.
GNEViewNet * getViewNet() const
get view net
void enableUpdateGeometry()
const std::string & getID() const
get ID
A lane area vehicles can park at (netedit-version)
vehicle space used by GNEParkingAreas
void incRef(const std::string &debugMsg="")
Increarse reference.
Representation of a RouteProbe in netedit.
virtual void setParameter(const std::string &key, const std::string &value)=0
Sets a parameter.
An Element which don't belongs to GNENet but has influency in the simulation.
virtual void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)=0
method for setting the attribute and letting the object perform TAZElement changes
bool hasDoubleParameters() const
return true if Tag correspond to an element that supports double parameters "key1=double1|key2=double...
bool hasParameters() const
return true if Tag correspond to an element that supports parameters "key1=value1|key2=value2|....
SumoXMLTag getTag() const
get Tag vinculated with this attribute Property
void p_begin(const std::string &description)
Begin undo command sub-group. This begins a new group of commands that are treated as a single comman...
void p_end()
End undo command sub-group. If the sub-group is still empty, it will be deleted; otherwise,...
Representation of a vaporizer in netedit.
GNEUndoList * getUndoList() const
get the undoList object
virtual void centerTo(GUIGlID id, bool applyZoom, double zoomDist=20)
centers to the chosen artifact
const std::string & getFileName() const
returns the current file name
static methods for processing the coordinates conversion for the current net
static const GeoConvHelper & getFinal()
the coordinate transformation for writing the location element and for tracking the original coordina...
bool x2cartesian_const(Position &from) const
Converts the given coordinate into a cartesian using the previous initialisation.
The representation of a single edge during network building.
double getLength() const
Returns the computed length of the edge.
const std::vector< NBEdge::Lane > & getLanes() const
Returns the lane definitions.
double getFinalLength() const
get length that will be assigned to the lanes in the final network
static void interpretLaneID(const std::string &lane_id, std::string &edge_id, int &index)
parses edge-id and index from lane-id
static OptionsCont & getOptions()
Retrieves the options.
virtual void setParameter(const std::string &key, const std::string &value)
Sets a parameter.
A point in 2D or 3D with translation and scaling methods.
void set(double x, double y)
set positions x and y
static const Position INVALID
used to indicate that a position is valid
static const RGBColor RED
named colors
static StopPos checkStopPos(double &startPos, double &endPos, const double laneLength, const double minLength, const bool friendlyPos)
check start and end position of a stop
Encapsulated SAX-Attributes.
T getOpt(int attr, const char *objectid, bool &ok, T defaultValue, bool report=true) const
Tries to read given attribute assuming it is an int.
SUMOTime getOptSUMOTimeReporting(int attr, const char *objectid, bool &ok, SUMOTime defaultValue, bool report=true) const
Tries to read given attribute assuming it is a SUMOTime.
T get(int attr, const char *objectid, bool &ok, bool report=true) const
Tries to read given attribute assuming it is an int.
virtual bool hasAttribute(int id) const =0
Returns the information whether the named (by its enum-value) attribute is within the current list.
virtual std::string getString(int id) const =0
Returns the string-value of the named (by its enum-value) attribute.
static bool isValidTypeID(const std::string &value)
whether the given string is a valid id for an edge or vehicle type
static bool isValidParameterKey(const std::string &value)
whether the given string is a valid key for a parameter
The XML-Handler for network loading.
virtual void myEndElement(int element)
Called when a closing tag occurs.
void setDefaults(const std::string &prefix, const RGBColor &color, const double layer, const bool fill=false)
set default values
Parameterised * getLastParameterised() const
get last parameterised object
const GeoConvHelper * myGeoConvHelper
geo-conversion to use during loading
static const double DEFAULT_LAYER_POI
static void setValidation(const std::string &validationScheme, const std::string &netValidationScheme, const std::string &routeValidationScheme)
Enables or disables validation.
static bool runParser(GenericSAXHandler &handler, const std::string &file, const bool isNet=false, const bool isRoute=false)
Runs the given handler on the given file; returns if everything's ok.
StackElement(SumoXMLTag _tag)
constructor