68 if (additionalParent) {
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);
240 GNEAdditionalHandler::buildBusStop(
GNEViewNet* viewNet,
bool allowUndoRedo,
const std::string&
id,
GNELane* lane,
const std::string& startPos,
const std::string& endPos,
const std::string& name,
const std::vector<std::string>& lines,
int personCapacity,
bool friendlyPosition,
bool blockMovement) {
242 GNEBusStop* busStop =
new GNEBusStop(
id, lane, viewNet, startPos, endPos, name, lines, personCapacity, friendlyPosition, blockMovement);
250 busStop->
incRef(
"buildBusStop");
262 if (lane ==
nullptr) {
264 }
else if (busStop ==
nullptr) {
269 GNEAccess* access =
new GNEAccess(busStop, lane, viewNet, pos, length, friendlyPos, blockMovement);
278 access->
incRef(
"buildAccess");
296 containerStop->
incRef(
"buildContainerStop");
298 return containerStop;
307 double chargingPower,
double efficiency,
bool chargeInTransit,
SUMOTime chargeDelay,
bool friendlyPosition,
bool blockMovement) {
309 GNEChargingStation* chargingStation =
new GNEChargingStation(
id, lane, viewNet, startPos, endPos, name, chargingPower, efficiency, chargeInTransit, chargeDelay, friendlyPosition, blockMovement);
317 chargingStation->
incRef(
"buildChargingStation");
319 return chargingStation;
328 bool friendlyPosition,
int roadSideCapacity,
bool onRoad,
double width,
const std::string& length,
double angle,
bool blockMovement) {
330 GNEParkingArea* parkingArea =
new GNEParkingArea(
id, lane, viewNet, startPos, endPos, name, friendlyPosition, roadSideCapacity, onRoad, width, length, angle, blockMovement);
338 parkingArea->
incRef(
"buildParkingArea");
357 parkingSpace->
incRef(
"buildParkingSpace");
364 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) {
366 GNEDetectorE1* detectorE1 =
new GNEDetectorE1(
id, lane, viewNet, pos, freq, filename, vehicleTypes, name, friendlyPos, blockMovement);
374 detectorE1->
incRef(
"buildDetectorE1");
385 const std::string& vehicleTypes,
const std::string& name,
SUMOTime timeThreshold,
double speedThreshold,
double jamThreshold,
bool friendlyPos,
bool blockMovement) {
387 GNEDetectorE2* detectorE2 =
new GNEDetectorE2(
id, lane, viewNet, pos, length, freq, filename, vehicleTypes, name, timeThreshold, speedThreshold, jamThreshold, friendlyPos, blockMovement);
395 detectorE2->
incRef(
"buildDetectorE2");
406 const std::string& vehicleTypes,
const std::string& name,
SUMOTime timeThreshold,
double speedThreshold,
double jamThreshold,
bool friendlyPos,
bool blockMovement) {
408 GNEDetectorE2* detectorE2 =
new GNEDetectorE2(
id, lanes, viewNet, pos, endPos, freq, filename, vehicleTypes, name, timeThreshold, speedThreshold, jamThreshold, friendlyPos, blockMovement);
415 for (
auto i : lanes) {
416 i->addAdditionalChild(detectorE2);
418 detectorE2->
incRef(
"buildDetectorE2Multilane");
431 const std::string& name,
SUMOTime timeThreshold,
double speedThreshold,
bool blockMovement) {
433 GNEDetectorE3* detectorE3 =
new GNEDetectorE3(
id, viewNet, pos, freq, filename, vehicleTypes, name, timeThreshold, speedThreshold, blockMovement);
440 detectorE3->
incRef(
"buildDetectorE3");
452 if (lane ==
nullptr) {
454 }
else if (E3Parent ==
nullptr) {
466 entry->
incRef(
"buildDetectorEntry");
476 if (lane ==
nullptr) {
478 }
else if (E3Parent ==
nullptr) {
490 exit->
incRef(
"buildDetectorExit");
508 detectorE1Instant->
incRef(
"buildDetectorE1Instant");
510 return detectorE1Instant;
530 calibrator->
incRef(
"buildCalibrator");
552 calibrator->
incRef(
"buildCalibrator");
563 const std::string& vehsPerHour,
const std::string& speed,
const RGBColor& color,
const std::string& departLane,
const std::string& departPos,
564 const std::string& departSpeed,
const std::string& arrivalLane,
const std::string& arrivalPos,
const std::string& arrivalSpeed,
const std::string& line,
565 int personNumber,
int containerNumber,
bool reroute,
const std::string& departPosLat,
const std::string& arrivalPosLat,
SUMOTime begin,
SUMOTime end) {
569 arrivalLane, arrivalPos, arrivalSpeed, line, personNumber, containerNumber, reroute,
570 departPosLat, arrivalPosLat, begin, end);
577 flow->
incRef(
"buildCalibratorFlow");
584 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) {
586 GNERerouter* rerouter =
new GNERerouter(
id, viewNet, pos, edges, name, file, prob, off, timeThreshold, vTypes, blockMovement);
594 for (
auto i : edges) {
595 i->addAdditionalParent(rerouter);
597 rerouter->
incRef(
"buildRerouter");
604 GNEAdditionalHandler rerouterValuesHandler(currentAdditionalFilename + file, viewNet, rerouter);
633 rerouterInterval->
incRef(
"buildRerouterInterval");
635 return rerouterInterval;
653 closingLaneReroute->
incRef(
"buildClosingLaneReroute");
655 return closingLaneReroute;
670 closingReroute->
incRef(
"buildClosingReroute");
672 return closingReroute;
687 destProbReroute->
incRef(
"builDestProbReroute");
689 return destProbReroute;
704 parkingAreaReroute->
incRef(
"builParkingAreaReroute");
706 return parkingAreaReroute;
721 routeProbReroute->
incRef(
"buildRouteProbReroute");
723 return routeProbReroute;
740 routeProbe->
incRef(
"buildRouteProbe");
760 for (
auto i : lanes) {
761 i->addAdditionalParent(variableSpeedSign);
763 variableSpeedSign->
incRef(
"buildVariableSpeedSign");
765 return variableSpeedSign;
783 variableSpeedSignStep->
incRef(
"buildVariableSpeedSignStep");
785 return variableSpeedSignStep;
801 vaporizer->
incRef(
"buildVaporizer");
809 GNETAZ* TAZ =
new GNETAZ(
id, viewNet, shape, color, blockMovement);
816 for (
auto i : edges) {
828 for (
auto i : edges) {
831 TAZSource->
incRef(
"buildTAZ");
835 TAZSink->
incRef(
"buildTAZ");
858 if (TAZSink ==
nullptr) {
867 TAZSink->
incRef(
"buildTAZSource");
879 if (TAZSource ==
nullptr) {
888 TAZSource->
incRef(
"buildTAZSource");
898 TAZSource->
incRef(
"buildTAZSource");
915 if (TAZSource ==
nullptr) {
924 TAZSource->
incRef(
"buildTAZSink");
935 if (TAZSink ==
nullptr) {
944 TAZSink->
incRef(
"buildTAZSink");
954 TAZSink->
incRef(
"buildTAZSink");
970 WRITE_WARNING(
"The position of additional '" + additionalID +
"' lies beyond the lane's '" + lane.
getID() +
"' length.");
978 if (fabs(pos) > laneLength) {
981 }
else if (pos < 0) {
983 }
else if (pos > laneLength) {
984 pos = laneLength - 0.01;
992 if ((pos < 0) || ((pos + length) > laneLength)) {
995 }
else if (pos < 0) {
997 }
else if (pos > laneLength) {
998 pos = laneLength - 0.01;
1000 }
else if ((pos + length) > laneLength) {
1001 length = laneLength - pos - 0.01;
1029 std::vector<std::pair<SUMOTime, SUMOTime>> sortedIntervals;
1034 sortedIntervals.back().first = GNEAttributeCarrier::parse<SUMOTime>(i->getAttribute(
SUMO_ATTR_BEGIN));
1035 sortedIntervals.back().second = GNEAttributeCarrier::parse<SUMOTime>(i->getAttribute(
SUMO_ATTR_END));
1038 sortedIntervals.push_back(std::make_pair(newBegin, newEnd));
1040 std::sort(sortedIntervals.begin(), sortedIntervals.end());
1042 for (
int i = 0; i < (int)sortedIntervals.size() - 1; i++) {
1043 if (sortedIntervals.at(i).second > sortedIntervals.at(i + 1).first) {
1066 if (edge ==
nullptr) {
1067 WRITE_WARNING(
"The edge '" + edgeID +
"' to use within the " +
toString(SUMO_TAG_VAPORIZER) +
" is not known.");
1069 WRITE_WARNING(
"There is already a " +
toString(SUMO_TAG_VAPORIZER) +
" in the edge '" + edgeID +
"'.");
1070 }
else if (begin > end) {
1071 WRITE_WARNING(
"Time interval of " +
toString(SUMO_TAG_VAPORIZER) +
" isn't valid. Attribute '" +
toString(SUMO_ATTR_BEGIN) +
"' is greater than attribute '" +
toString(SUMO_ATTR_END) +
"'.");
1076 if (insertedAdditionals) {
1090 const std::string
id = GNEAttributeCarrier::parseAttributeFromXML<std::string>(attrs,
"",
SUMO_TAG_TAZ,
SUMO_ATTR_ID, abort);
1094 bool blockMovement =
false;
1099 std::vector<std::string> edgeIDs;
1101 std::string parsedAttribute = attrs.get<std::string>(
SUMO_ATTR_EDGES,
id.c_str(), abort,
false);
1102 edgeIDs = GNEAttributeCarrier::parse<std::vector<std::string> >(parsedAttribute);
1105 std::vector<GNEEdge*> edges;
1106 for (
auto i : edgeIDs) {
1108 if (edge ==
nullptr) {
1112 edges.push_back(edge);
1122 GNEAdditional* additionalCreated =
buildTAZ(viewNet, allowUndoRedo,
id, shape, color, edges, blockMovement);
1124 if (insertedAdditionals) {
1146 if (insertedAdditionals) {
1153 if (edge ==
nullptr) {
1154 WRITE_WARNING(
"The edge '" + edgeID +
"' to use within the " +
toString(SUMO_TAG_TAZSOURCE) +
" is not known.");
1155 }
else if (TAZ ==
nullptr) {
1161 if (insertedAdditionals) {
1183 if (insertedAdditionals) {
1190 if (edge ==
nullptr) {
1191 WRITE_WARNING(
"The edge '" + edgeID +
"' to use within the " +
toString(SUMO_TAG_TAZSINK) +
" is not known.");
1192 }
else if (TAZ ==
nullptr) {
1198 if (insertedAdditionals) {
1224 WRITE_WARNING(
"There is another " +
toString(SUMO_TAG_ROUTEPROBE) +
" with the same ID='" +
id +
"'.");
1225 }
else if (edge ==
nullptr) {
1227 WRITE_WARNING(
"The edge '" + edgeId +
"' to use within the " +
toString(SUMO_TAG_ROUTEPROBE) +
" '" +
id +
"' is not known.");
1230 if (GNEAttributeCarrier::canParse<double>(freq)) {
1231 if (GNEAttributeCarrier::parse<double>(freq) < 0) {
1244 if (insertedAdditionals) {
1284 if (insertedAdditionals) {
1291 if (route ==
nullptr) {
1294 }
else if (vtype ==
nullptr) {
1297 }
else if ((vehsPerHour.empty()) && (speed.empty())) {
1298 WRITE_WARNING(
toString(SUMO_TAG_FLOW_CALIBRATOR) +
" cannot be created; At least parameters " +
toString(SUMO_ATTR_VEHSPERHOUR) +
" or " +
toString(SUMO_ATTR_SPEED) +
" has to be defined");
1300 }
else if (calibrator !=
nullptr) {
1302 GNEAdditional* additionalCreated =
buildCalibratorFlow(viewNet, allowUndoRedo, calibrator, route, vtype, vehsPerHour, speed, color, departLane, departPos, departSpeed, arrivalLane, arrivalPos, arrivalSpeed,
1303 line, personNumber, containerNumber, reroute, departPosLat, arrivalPosLat, begin, end);
1305 if (insertedAdditionals) {
1319 std::string polygonID = GNEAttributeCarrier::parseAttributeFromXML<std::string>(attrs,
"",
SUMO_TAG_POLY,
SUMO_ATTR_ID, abort);
1324 std::string type = GNEAttributeCarrier::parseAttributeFromXML<std::string>(attrs, polygonID,
SUMO_TAG_POLY,
SUMO_ATTR_TYPE, abort);
1334 if (attrs.getOpt<
bool>(
SUMO_ATTR_GEO, polygonID.c_str(), abort,
false)) {
1336 bool success =
true;
1337 for (
int i = 0; i < (int)shape.size(); i++) {
1341 WRITE_WARNING(
"Unable to project coordinates for polygon '" + polygonID +
"'.");
1350 if (!
myShapeContainer.
addPolygon(polygonID, type, color, layer, angle, imgFile, relativePath, shape, geo, fill, lineWidth,
false)) {
1351 WRITE_WARNING(
"Polygon with ID '" + polygonID +
"' already exists.");
1364 std::string
id = GNEAttributeCarrier::parseAttributeFromXML<std::string>(attrs,
"",
SUMO_TAG_VSS,
SUMO_ATTR_ID, abort);
1370 bool blockMovement =
false;
1377 std::vector<GNELane*> lanes;
1379 lanes = GNEAttributeCarrier::parse<std::vector<GNELane*> >(viewNet->
getNet(), lanesIDs);
1384 }
else if (lanes.size() == 0) {
1385 WRITE_WARNING(
"A Variable Speed Sign needs at least one lane.");
1390 if (insertedAdditionals) {
1411 if (insertedAdditionals) {
1418 if (variableSpeedSign !=
nullptr) {
1422 if (insertedAdditionals) {
1443 const std::string vTypes = attrs.getOpt<std::string>(
SUMO_ATTR_VTYPES,
id.c_str(), abort,
"");
1446 bool blockMovement =
false;
1453 std::vector<GNEEdge*> edges;
1455 edges = GNEAttributeCarrier::parse<std::vector<GNEEdge*> >(viewNet->
getNet(), edgesIDs);
1459 WRITE_WARNING(
"There is another " +
toString(SUMO_TAG_REROUTER) +
" with the same ID='" +
id +
"'.");
1460 }
else if (edges.size() == 0) {
1465 file, off, timeThreshold, vTypes, blockMovement);
1467 if (insertedAdditionals) {
1488 if (insertedAdditionals) {
1495 if (rerouter ==
nullptr) {
1498 if (insertedAdditionals) {
1504 if (lastInsertedRerouterInterval) {
1511 }
else if (rerouter !=
nullptr) {
1515 if (insertedAdditionals) {
1538 if (insertedAdditionals) {
1545 if (lane ==
nullptr) {
1546 WRITE_WARNING(
"The lane '" + laneID +
"' to use within the " +
toString(SUMO_TAG_CLOSING_LANE_REROUTE) +
" is not known.");
1547 }
else if (rerouterInterval !=
nullptr) {
1551 if (insertedAdditionals) {
1574 if (insertedAdditionals) {
1581 if (edge ==
nullptr) {
1582 WRITE_WARNING(
"The edge '" + edgeID +
"' to use within the " +
toString(SUMO_TAG_CLOSING_REROUTE) +
" is not known.");
1583 }
else if (rerouterInterval !=
nullptr) {
1587 if (insertedAdditionals) {
1609 if (insertedAdditionals) {
1616 if (edge ==
nullptr) {
1617 WRITE_WARNING(
"The edge '" + edgeID +
"' to use within the " +
toString(SUMO_TAG_DEST_PROB_REROUTE) +
" is not known.");
1618 }
else if (rerouterInterval !=
nullptr) {
1622 if (insertedAdditionals) {
1645 if (insertedAdditionals) {
1652 if (parkingArea ==
nullptr) {
1653 WRITE_WARNING(
"The parkingArea '" + parkingAreaID +
"' to use within the " +
toString(SUMO_TAG_PARKING_ZONE_REROUTE) +
" is not known.");
1654 }
else if (rerouterInterval !=
nullptr) {
1658 if (insertedAdditionals) {
1679 if (insertedAdditionals) {
1686 if (rerouterInterval !=
nullptr) {
1690 if (insertedAdditionals) {
1709 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;
1723 WRITE_WARNING(
"There is another " +
toString(SUMO_TAG_BUS_STOP) +
" with the same ID='" +
id +
"'.");
1724 }
else if (lane ==
nullptr) {
1726 WRITE_WARNING(
"The lane '" + laneId +
"' to use within the " +
toString(SUMO_TAG_BUS_STOP) +
" '" +
id +
"' is not known.");
1732 GNEAdditional* additionalCreated =
buildBusStop(viewNet, allowUndoRedo,
id, lane, startPos, endPos, name, lines, personCapacity, friendlyPosition, blockMovement);
1734 if (insertedAdditionals) {
1756 bool blockMovement =
false;
1766 WRITE_WARNING(
"There is another " +
toString(SUMO_TAG_CONTAINER_STOP) +
" with the same ID='" +
id +
"'.");
1767 }
else if (lane ==
nullptr) {
1769 WRITE_WARNING(
"The lane '" + laneId +
"' to use within the " +
toString(SUMO_TAG_CONTAINER_STOP) +
" '" +
id +
"' is not known.");
1772 WRITE_WARNING(
"Invalid position for " +
toString(SUMO_TAG_CONTAINER_STOP) +
" with ID = '" +
id +
"'.");
1775 GNEAdditional* additionalCreated =
buildContainerStop(viewNet, allowUndoRedo,
id, lane, startPos, endPos, name, lines, friendlyPosition, blockMovement);
1777 if (insertedAdditionals) {
1796 bool blockMovement =
false;
1802 double posDouble = GNEAttributeCarrier::parse<double>(position);
1807 if (insertedAdditionals) {
1814 if (lane ==
nullptr) {
1815 WRITE_WARNING(
"The lane '" + laneId +
"' to use within the " +
toString(SUMO_TAG_ACCESS) +
" is not known.");
1816 }
else if (busStop ==
nullptr) {
1821 WRITE_WARNING(
"Edge '" + lane->getParentEdge().getID() +
"' already has an Access for busStop '" + busStop->
getID() +
"'");
1826 if (insertedAdditionals) {
1851 bool blockMovement =
false;
1861 WRITE_WARNING(
"There is another " +
toString(SUMO_TAG_CHARGING_STATION) +
" with the same ID='" +
id +
"'.");
1862 }
else if (lane ==
nullptr) {
1864 WRITE_WARNING(
"The lane '" + laneId +
"' to use within the " +
toString(SUMO_TAG_CHARGING_STATION) +
" '" +
id +
"' is not known.");
1867 WRITE_WARNING(
"Invalid position for " +
toString(SUMO_TAG_CHARGING_STATION) +
" with ID = '" +
id +
"'.");
1871 efficiency, chargeInTransit, chargeDelay, friendlyPosition, blockMovement);
1873 if (insertedAdditionals) {
1899 bool blockMovement =
false;
1909 WRITE_WARNING(
"There is another " +
toString(SUMO_TAG_PARKING_AREA) +
" with the same ID='" +
id +
"'.");
1910 }
else if (lane ==
nullptr) {
1912 WRITE_WARNING(
"The lane '" + laneId +
"' to use within the " +
toString(SUMO_TAG_PARKING_AREA) +
" '" +
id +
"' is not known.");
1915 WRITE_WARNING(
"Invalid position for " +
toString(SUMO_TAG_PARKING_AREA) +
" with ID = '" +
id +
"'.");
1919 roadSideCapacity, onRoad, width, length, angle, blockMovement);
1921 if (insertedAdditionals) {
1940 bool blockMovement =
false;
1949 if (insertedAdditionals) {
1956 if (parkingAreaParent !=
nullptr) {
1960 if (insertedAdditionals) {
1974 std::string edgeID, laneId, id;
1990 WRITE_WARNING(
"There is another " +
toString(SUMO_TAG_CALIBRATOR) +
" with the same ID='" +
id +
"'.");
1991 }
else if (edge ==
nullptr) {
1992 WRITE_WARNING(
"The edge '" + edgeID +
"' to use within the " +
toString(SUMO_TAG_CALIBRATOR) +
" '" +
id +
"' is not known.");
1997 if (insertedAdditionals) {
2018 }
else if (lane ==
nullptr) {
2024 if (insertedAdditionals) {
2050 bool blockMovement =
false;
2060 WRITE_WARNING(
"There is another " +
toString(SUMO_TAG_E1DETECTOR) +
" with the same ID='" +
id +
"'.");
2061 }
else if (lane ==
nullptr) {
2063 WRITE_WARNING(
"The lane '" + laneId +
"' to use within the " +
toString(SUMO_TAG_E1DETECTOR) +
" '" +
id +
"' is not known.");
2065 WRITE_WARNING(
"Invalid position for " +
toString(SUMO_TAG_E1DETECTOR) +
" with ID = '" +
id +
"'.");
2068 GNEAdditional* additionalCreated =
buildDetectorE1(viewNet, allowUndoRedo,
id, lane, position, frequency, file, vehicleTypes, name, friendlyPos, blockMovement);
2070 if (insertedAdditionals) {
2086 std::string
id = GNEAttributeCarrier::parseAttributeFromXML<std::string>(attrs,
"", E2Tag,
SUMO_ATTR_ID, abort);
2094 double position = GNEAttributeCarrier::parseAttributeFromXML<double>(attrs, id, E2Tag,
SUMO_ATTR_POSITION, abort);
2096 std::string file = GNEAttributeCarrier::parseAttributeFromXML<std::string>(attrs, id, E2Tag,
SUMO_ATTR_FILE, abort);
2097 std::string vehicleTypes = GNEAttributeCarrier::parseAttributeFromXML<std::string>(attrs, id, E2Tag,
SUMO_ATTR_VTYPES, abort);
2098 std::string name = GNEAttributeCarrier::parseAttributeFromXML<std::string>(attrs, id, E2Tag,
SUMO_ATTR_NAME, abort);
2102 bool friendlyPos = GNEAttributeCarrier::parseAttributeFromXML<bool>(attrs, id, E2Tag,
SUMO_ATTR_FRIENDLY_POS, abort);
2104 bool blockMovement =
false;
2106 blockMovement = GNEAttributeCarrier::parseAttributeFromXML<bool>(attrs, id, E2Tag,
GNE_ATTR_BLOCK_MOVEMENT, abort);
2109 GNEAttributeCarrier::parseAttributeFromXML<std::string>(attrs, id, E2Tag,
SUMO_ATTR_CONT, abort);
2113 if (laneId.empty() && laneIds.empty()) {
2119 std::vector<GNELane*> lanes;
2120 bool laneConsecutives =
true;
2122 lanes = GNEAttributeCarrier::parse<std::vector<GNELane*> >(viewNet->
getNet(), laneIds);
2130 }
else if (attrs.hasAttribute(
SUMO_ATTR_LANE) && (lane ==
nullptr)) {
2132 WRITE_WARNING(
"The lane '" + laneId +
"' to use within the " +
toString(E2Tag) +
" '" +
id +
"' is not known.");
2138 WRITE_WARNING(
"The list of lanes '" + laneIds +
"' to use within the " +
toString(E2Tag) +
" '" +
id +
"' isn't valid.");
2139 }
else if (!lanes.empty() && !laneConsecutives) {
2140 WRITE_WARNING(
"The lanes '" + laneIds +
"' to use within the " +
toString(E2Tag) +
" '" +
id +
"' aren't consecutives.");
2143 }
else if (!lanes.empty() && !
fixE2DetectorPosition(position, length, lanes.front()->getParentEdge().getNBEdge()->getFinalLength(), friendlyPos)) {
2145 }
else if (!lanes.empty() && !
fixE2DetectorPosition(endPos, length, lanes.back()->getParentEdge().getNBEdge()->getFinalLength(), friendlyPos)) {
2150 name, haltingTimeThreshold, haltingSpeedThreshold, jamDistThreshold, friendlyPos, blockMovement);
2152 if (insertedAdditionals) {
2159 name, haltingTimeThreshold, haltingSpeedThreshold, jamDistThreshold, friendlyPos, blockMovement);
2161 if (insertedAdditionals) {
2185 bool blockMovement =
false;
2193 WRITE_WARNING(
"There is another " +
toString(SUMO_TAG_E3DETECTOR) +
" with the same ID='" +
id +
"'.");
2196 GNEAdditional* additionalCreated =
buildDetectorE3(viewNet, allowUndoRedo,
id, pos, frequency, file, vehicleTypes, name, haltingTimeThreshold, haltingSpeedThreshold, blockMovement);
2198 if (insertedAdditionals) {
2216 bool blockMovement =
false;
2226 if (insertedAdditionals) {
2233 if (lane ==
nullptr) {
2234 WRITE_WARNING(
"The lane '" + laneId +
"' to use within the " +
toString(SUMO_TAG_DET_ENTRY) +
" is not known.");
2237 }
else if (E3Parent) {
2241 if (insertedAdditionals) {
2259 bool blockMovement =
false;
2269 if (insertedAdditionals) {
2276 if (lane ==
nullptr) {
2277 WRITE_WARNING(
"The lane '" + laneId +
"' to use within the " +
toString(SUMO_TAG_DET_EXIT) +
" is not known.");
2280 }
else if (E3Parent) {
2284 if (insertedAdditionals) {
2306 bool blockMovement =
false;
2316 WRITE_WARNING(
"There is another " +
toString(SUMO_TAG_INSTANT_INDUCTION_LOOP) +
" with the same ID='" +
id +
"'.");
2317 }
else if (lane ==
nullptr) {
2319 WRITE_WARNING(
"The lane '" + laneId +
"' to use within the " +
toString(SUMO_TAG_INSTANT_INDUCTION_LOOP) +
" '" +
id +
"' is not known.");
2321 WRITE_WARNING(
"Invalid position for " +
toString(SUMO_TAG_INSTANT_INDUCTION_LOOP) +
" with ID = '" +
id +
"'.");
2326 if (insertedAdditionals) {
2343 std::string POIID = GNEAttributeCarrier::parseAttributeFromXML<std::string>(attrs,
"",
SUMO_TAG_POI,
SUMO_ATTR_ID, abort);
2355 std::string type = GNEAttributeCarrier::parseAttributeFromXML<std::string>(attrs, POIID,
SUMO_TAG_POI,
SUMO_ATTR_TYPE, abort);
2370 WRITE_WARNING(
"The lane '" + laneID +
"' to use within the PoI '" + POIID +
"' is not known.");
2374 bool useGeo =
false;
2380 pos =
getLanePos(POIID, laneID, lanePos, lanePosLat);
2384 WRITE_WARNING(
"Either (x, y), (lon, lat) or (lane, pos) must be specified for PoI '" + POIID +
"'.");
2387 WRITE_WARNING(
"(lon, lat) is specified for PoI '" + POIID +
"' but no geo-conversion is specified for the network.");
2394 WRITE_WARNING(
"Unable to project coordinates for PoI '" + POIID +
"'.");
2400 if (!
myShapeContainer.
addPOI(POIID, type, color, pos, useGeo, laneID, lanePos, lanePosLat, layer, angle, imgFile, relativePath, width, height,
false)) {
2401 WRITE_WARNING(
"POI with ID '" + POIID +
"' already exists.");
2420 WRITE_WARNING(
"Error parsing key from shape generic parameter. Key cannot be empty");
2424 WRITE_WARNING(
"Error parsing key from shape generic parameter. Key contains invalid characters");
2428 WRITE_WARNING(
"Error parsing key from shape generic parameter. Key doesn't exist");
2434 WRITE_WARNING(
"Error parsing value from shape generic parameter. Value contains invalid characters");
2439 WRITE_DEBUG(
"Inserting generic parameter '" + key +
"|" + val +
"' into shape.");
2451 WRITE_WARNING(
"Error parsing key from additional generic parameter. Key cannot be empty");
2455 WRITE_WARNING(
"Error parsing key from additional generic parameter. Key contains invalid characters");
2459 WRITE_WARNING(
"Error parsing key from additional generic parameter. Key doesn't exist");
2465 WRITE_WARNING(
"Error parsing value from additional generic parameter. Value contains invalid characters");
2477 WRITE_WARNING(
"Generic Parameters has to be declared within the definition of an additional or a shape element");
2487 myInsertedElements.push_back(std::make_pair(tag,
nullptr));
2493 myInsertedElements.back().second = additional;
2499 if (!myInsertedElements.empty()) {
2500 myInsertedElements.pop_back();
2507 if (myInsertedElements.size() < 2) {
2509 WRITE_WARNING(
"A " +
toString(myInsertedElements.back().first) +
" must be declared within the definition of a " +
toString(expectedTag) +
".");
2512 if (myInsertedElements.size() < 2) {
2515 }
else if ((myInsertedElements.end() - 2)->second ==
nullptr) {
2521 if (retrievedAdditional ==
nullptr) {
2523 WRITE_WARNING(
"A " +
toString((myInsertedElements.end() - 1)->first) +
" must be declared within the definition of a " +
toString(expectedTag) +
".");
2527 WRITE_WARNING(
"A " +
toString((myInsertedElements.end() - 1)->first) +
" cannot be declared within the definition of a " + retrievedAdditional->
getTagStr() +
".");
2530 return retrievedAdditional;
2539 for (std::vector<std::pair<SumoXMLTag, GNEAdditional*> >::const_reverse_iterator i = myInsertedElements.rbegin(); i != myInsertedElements.rend(); i++) {
static GNEAdditional * buildParkingArea(GNEViewNet *viewNet, bool allowUndoRedo, const std::string &id, GNELane *lane, const std::string &startPos, const std::string &endPos, 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 insertAdditional(GNEAdditional *additional)
Insert a additional element int GNENet container.
GNEAdditionalHandler(const std::string &file, GNEViewNet *viewNet, GNEAdditional *additionalParent=nullptr)
Constructor.
double getLength() const
Returns the computed length of the edge.
double ymin() const
Returns minimum y-coordinate.
GNEAdditional * getLastInsertedAdditional() const
return last additional inserted
SumoXMLTag
Numbers representing SUMO-XML - element names.
static bool parseAndBuildTAZSource(GNEViewNet *viewNet, bool allowUndoRedo, const SUMOSAXAttributes &attrs, HierarchyInsertedAdditionals *insertedAdditionals)
Builds a TAZ Source.
vehicle space used by GNEParkingAreas
double xmax() const
Returns maximum x-coordinate.
GNEEdge * retrieveEdge(const std::string &id, bool failHard=true)
get edge by id
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
method for setting the attribute and letting the object perform additional changes ...
static bool parseAndBuildVaporizer(GNEViewNet *viewNet, bool allowUndoRedo, const SUMOSAXAttributes &attrs, HierarchyInsertedAdditionals *insertedAdditionals)
Builds a Vaporizer.
alternative tag for e1 detector
static std::string getConfigurationRelative(const std::string &configPath, const std::string &path)
Returns the second path as a relative path to the first file.
description of a vehicle type
a source within a district (connection road)
static bool parseAndBuildDetectorE2(GNEViewNet *viewNet, bool allowUndoRedo, const SUMOSAXAttributes &attrs, HierarchyInsertedAdditionals *insertedAdditionals)
Parses his values and builds a lane area detector (GNEViewNet* viewNet, bool allowUndoRedo, E2)
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 isValidAttribute(const std::string &value)
whether the given string is a valid attribute for a certain key (for example, a name) ...
static bool parseAndBuildRerouterClosingLaneReroute(GNEViewNet *viewNet, bool allowUndoRedo, const SUMOSAXAttributes &attrs, HierarchyInsertedAdditionals *insertedAdditionals)
Parses his values and builds a Closing Lane reroute.
void myStartElement(int element, const SUMOSAXAttributes &attrs)
Called on the opening of a tag;.
begin/end of the description of a single lane
void setDefaults(const std::string &prefix, const RGBColor &color, const double layer, const bool fill=false)
set default values
virtual void myEndElement(int element)
Called when a closing tag occurs.
static GNEAdditional * buildChargingStation(GNEViewNet *viewNet, bool allowUndoRedo, const std::string &id, GNELane *lane, const std::string &startPos, const std::string &endPos, const std::string &name, double chargingPower, double efficiency, bool chargeInTransit, SUMOTime chargeDelay, bool friendlyPosition, bool blockMovement)
Builds a charging Station.
const GeoConvHelper * myGeoConvHelper
geo-conversion to use during loading
static bool parseAndBuildRerouter(GNEViewNet *viewNet, bool allowUndoRedo, const SUMOSAXAttributes &attrs, HierarchyInsertedAdditionals *insertedAdditionals)
Parses his values and builds a rerouter.
static GNEAdditional * buildVariableSpeedSign(GNEViewNet *viewNet, 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)
A calibrator placed over edge.
an e2 detector over multiple lanes (used by Netedit)
const Polygons & getPolygons() const
Returns all polygons.
void popElement()
pop last inserted element (used only in function myEndElement)
a traffic assignment zone
static void setValidation(const std::string &validationScheme, const std::string &netValidationScheme)
Enables or disables validation.
static bool parseAndBuildVariableSpeedSign(GNEViewNet *viewNet, bool allowUndoRedo, const SUMOSAXAttributes &attrs, HierarchyInsertedAdditionals *insertedAdditionals)
Parses his values and builds a Variable Speed Signal (GNEViewNet* viewNet, bool allowUndoRedo, lane speed additional)
static const double DEFAULT_LAYER_POI
lane of a reroute of type closing
Allow/disallow charge in transit in Charging Stations.
static bool parseAndBuildDetectorExit(GNEViewNet *viewNet, bool allowUndoRedo, const SUMOSAXAttributes &attrs, HierarchyInsertedAdditionals *insertedAdditionals)
Parses his values and builds a Exit detector.
static bool parseAndBuildRerouterParkingAreaReroute(GNEViewNet *viewNet, bool allowUndoRedo, const SUMOSAXAttributes &attrs, HierarchyInsertedAdditionals *insertedAdditionals)
Parses his values and builds a parkingAreaReroute.
const std::string & getFileName() const
returns the current file name
int SVCPermissions
bitset where each bit declares whether a certain SVC may use this edge/lane
T get(const std::string &id) const
Retrieves an item.
The representation of a single edge during network building.
static bool checkStoppinPlacePosition(const std::string &startPosStr, const std::string &endPosStr, const double laneLength, const bool friendlyPos)
check if the position of an stoppingPlace over a lane is valid (without modifications) ...
PositionVector getShape() const
Returns additional element's shape.
Position getPositionInView() const
Returns position of additional in view.
static GNEAdditional * buildCalibratorFlow(GNEViewNet *viewNet, 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
virtual void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)=0
method for setting the attribute and letting the object perform additional changes ...
Representation of a RouteProbe in netedit.
weights: time range begin
static bool parseAndBuildDetectorEntry(GNEViewNet *viewNet, bool allowUndoRedo, const SUMOSAXAttributes &attrs, HierarchyInsertedAdditionals *insertedAdditionals)
Parses his values and builds a Entry detector.
void updateGeometry()
update pre-computed geometry information
static bool parseAndBuildCalibrator(GNEViewNet *viewNet, bool allowUndoRedo, const SUMOSAXAttributes &attrs, HierarchyInsertedAdditionals *insertedAdditionals)
Parses his values and builds a mesoscopic or microscopic calibrator.
static bool parseAndBuildParkingSpace(GNEViewNet *viewNet, bool allowUndoRedo, const SUMOSAXAttributes &attrs, HierarchyInsertedAdditionals *insertedAdditionals)
Parses his values and builds a parking space.
static GNEAdditional * buildCalibrator(GNEViewNet *viewNet, bool allowUndoRedo, const std::string &id, GNELane *lane, double pos, const std::string &name, const std::string &outfile, SUMOTime freq, const std::string &routeprobe)
builds a microscopic calibrator over a lane
static GNEAdditional * buildSingleLaneDetectorE2(GNEViewNet *viewNet, bool allowUndoRedo, const std::string &id, GNELane *lane, double pos, double length, SUMOTime freq, 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)
This lane is powered by an underlying GNEEdge and basically knows how to draw itself.
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...
const std::vector< NBEdge::Lane > & getLanes() const
Returns the lane definitions.
void parseAndBuildPoly(const SUMOSAXAttributes &attrs)
Parses his values and builds a Poly.
static bool parseAndBuildRouteProbe(GNEViewNet *viewNet, bool allowUndoRedo, const SUMOSAXAttributes &attrs, HierarchyInsertedAdditionals *insertedAdditionals)
Parses his values and builds routeProbe.
begin/end of the description of a Point of interest
Parameterised * myLastParameterised
element to receive parameters
virtual 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.
A parking space for a single vehicle within a parking area.
static bool runParser(GenericSAXHandler &handler, const std::string &file, const bool isNet=false)
Runs the given handler on the given file; returns if everything's ok.
static bool buildAdditional(GNEViewNet *viewNet, bool allowUndoRedo, SumoXMLTag tag, const SUMOSAXAttributes &attrs, HierarchyInsertedAdditionals *insertedAdditionals)
Build additionals.
static bool parseAndBuildChargingStation(GNEViewNet *viewNet, bool allowUndoRedo, const SUMOSAXAttributes &attrs, HierarchyInsertedAdditionals *insertedAdditionals)
Parses his values and builds a charging station.
const std::vector< GNEAdditional * > & getAdditionalChildren() const
return vector of additionals that have as Parent this edge (For example, Calibrators) ...
virtual bool hasAttribute(int id) const =0
Returns the information whether the named (by its enum-value) attribute is within the current list...
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 parseAndBuildDetectorE3(GNEViewNet *viewNet, bool allowUndoRedo, const SUMOSAXAttributes &attrs, HierarchyInsertedAdditionals *insertedAdditionals)
Parses his values and builds a multi entry exit detector (GNEViewNet* viewNet, bool allowUndoRedo...
static GNEAdditional * buildContainerStop(GNEViewNet *viewNet, bool allowUndoRedo, const std::string &id, GNELane *lane, const std::string &startPos, const std::string &endPos, const std::string &name, const std::vector< std::string > &lines, bool friendlyPosition, bool blockMovement)
Builds a container stop.
static GNEAdditional * buildClosingReroute(GNEViewNet *viewNet, bool allowUndoRedo, GNEAdditional *rerouterIntervalParent, GNEEdge *closedEdge, SVCPermissions permissions)
A class that stores a 2D geometrical boundary.
static bool parseAndBuildRerouterInterval(GNEViewNet *viewNet, bool allowUndoRedo, const SUMOSAXAttributes &attrs, HierarchyInsertedAdditionals *insertedAdditionals)
Parses his values and builds a Rerouter Interval.
Builds additional objects for GNENet (busStops, chargingStations, detectors, etc..)
begin/end of the description of a route
#define WRITE_WARNING(msg)
static OptionsCont & getOptions()
Retrieves the options.
static GNEAdditional * builDestProbReroute(GNEViewNet *viewNet, bool allowUndoRedo, GNEAdditional *rerouterIntervalParent, GNEEdge *newEdgeDestination, double probability)
virtual std::string getString(int id) const =0
Returns the string-value of the named (by its enum-value) attribute.
void commitElementInsertion(GNEAdditional *additionalCreated)
commit element insertion (used to save last correct created element)
The XML-Handler for network loading.
GNEAdditional * retrieveAdditionalParent(GNEViewNet *viewNet, SumoXMLTag expectedTag) const
retrieve additional parent correspond to current status of myInsertedElements
static GNEAdditional * buildDetectorE1Instant(GNEViewNet *viewNet, 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 * buildDetectorEntry(GNEViewNet *viewNet, bool allowUndoRedo, GNEAdditional *E3Parent, GNELane *lane, double pos, bool friendlyPos, bool blockMovement)
Builds a entry detector (E3)
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 ...
GNEAdditional * retrieveAdditional(SumoXMLTag type, const std::string &id, bool hardFail=true) const
Returns the named additional.
static GNEAdditional * buildRouteProbReroute(GNEViewNet *viewNet, bool allowUndoRedo, GNEAdditional *rerouterIntervalParent, const std::string &newRouteId, double probability)
NBEdge * getNBEdge() const
returns the internal NBEdge
void insertElement(SumoXMLTag tag)
insert new element (called only in function myStartElement)
GNEUndoList * getUndoList() const
get the undoList object
~GNEAdditionalHandler()
Destructor.
HierarchyInsertedAdditionals myHierarchyInsertedAdditionals
HierarchyInsertedAdditionals used for insert children.
static methods for processing the coordinates conversion for the current net
static bool parseAndBuildContainerStop(GNEViewNet *viewNet, bool allowUndoRedo, const SUMOSAXAttributes &attrs, HierarchyInsertedAdditionals *insertedAdditionals)
Parses his values and builds a container stop.
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
SumoXMLTag getTag() const
get Tag vinculated with this attribute Property
A lane area vehicles can park at (netedit-version)
GNEEdge & getParentEdge()
Returns underlying parent edge.
void enableUpdateGeometry()
Encapsulated SAX-Attributes.
An instantenous induction loop.
GNEDemandElement * retrieveDemandElement(SumoXMLTag type, const std::string &id, bool hardFail=true) const
Returns the named demand element.
T get(int attr, const char *objectid, bool &ok, bool report=true) const
Tries to read given attribute assuming it is an int.
Stack used to save the last inserted element.
static bool isAbsolute(const std::string &path)
Returns the information whether the given path is absolute.
static bool parseAndBuildRerouterRouteProbReroute(GNEViewNet *viewNet, bool allowUndoRedo, const SUMOSAXAttributes &attrs, HierarchyInsertedAdditionals *insertedAdditionals)
Parses his values and builds a Route Prob Reroute.
static const double INVALID_POSITION
invalid double position
void p_end()
End undo command sub-group. If the sub-group is still empty, it will be deleted; otherwise, the sub-group will be added as a new command into parent group. A matching begin() must have been called previously.
A point in 2D or 3D with translation and scaling methods.
parameter associated to a certain key
static bool lanesConsecutives(const std::vector< GNELane *> &lanes)
check if lanes are consecutives
static GNEAdditional * buildAccess(GNEViewNet *viewNet, bool allowUndoRedo, GNEAdditional *busStop, GNELane *lane, const std::string &pos, const std::string &length, bool friendlyPos, bool blockMovement)
Builds an Access.
bool hasGenericParameters() const
return true if Tag correspond to an element that supports generic parameters
void checkE2MultilaneIntegrity()
check if E2 is valid (all of their lanes are connected, it must called after every operation which in...
static GNEAdditional * buildRouteProbe(GNEViewNet *viewNet, bool allowUndoRedo, const std::string &id, GNEEdge *edge, const std::string &freq, const std::string &name, const std::string &file, SUMOTime begin)
builds a Route probe
virtual void centerTo(GUIGlID id, bool applyZoom, double zoomDist=20)
centers to the chosen artifact
A calibrator placed over lane (used in netedit)
Representation of a vaporizer in netedit.
block movement of a graphic element
const std::vector< GNELane * > & getLanes() const
returns a reference to the lane vector
static GNEAdditional * buildRerouterInterval(GNEViewNet *viewNet, bool allowUndoRedo, GNEAdditional *rerouterParent, SUMOTime begin, SUMOTime end)
builds a rerouter interval
virtual 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.
static GNEAdditional * 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)
Builds a induction loop detector (E1)
static bool parseAndBuildCalibratorFlow(GNEViewNet *viewNet, bool allowUndoRedo, const SUMOSAXAttributes &attrs, HierarchyInsertedAdditionals *insertedAdditionals)
Parses flow values of Calibrators.
const std::vector< GNEAdditional * > & getAdditionalParents() const
return vector of additionals that have as Parent this edge (For example, Calibrators) ...
double xmin() const
Returns minimum x-coordinate.
A lane area vehicles can halt at (netedit-version)
void addAdditionalChild(GNEAdditional *additional)
void setParameter(const std::string &key, const std::string &value)
Sets a parameter.
static bool parseAndBuildDetectorE1Instant(GNEViewNet *viewNet, bool allowUndoRedo, const SUMOSAXAttributes &attrs, HierarchyInsertedAdditionals *insertedAdditionals)
Parses his values and builds a Instant induction loop detector (GNEViewNet* viewNet, bool allowUndoRedo, E1Instant)
edge: the shape in xml-definition
probability of route of a reroute
SVCPermissions parseVehicleClasses(const std::string &allowedS)
Parses the given definition of allowed vehicle classes into the given containers Deprecated classes g...
probability of destiny of a reroute
const std::string getID() const
function to support debugging
static GNEAdditional * buildDetectorE3(GNEViewNet *viewNet, 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)
GNEViewNet * myViewNet
pointer to View's Net
void incRef(const std::string &debugMsg="")
Increarse reference.
static GNEAdditional * buildBusStop(GNEViewNet *viewNet, bool allowUndoRedo, const std::string &id, GNELane *lane, const std::string &startPos, const std::string &endPos, const std::string &name, const std::vector< std::string > &lines, int personCapacity, bool friendlyPosition, bool blockMovement)
Builds a bus stop.
static GNEAdditional * buildVaporizer(GNEViewNet *viewNet, bool allowUndoRedo, GNEEdge *edge, SUMOTime start, SUMOTime endTime, const std::string &name)
Builds a vaporizer (lane speed additional)
static GNEAdditional * buildMultiLaneDetectorE2(GNEViewNet *viewNet, bool allowUndoRedo, const std::string &id, const std::vector< GNELane *> &lanes, double pos, double endPos, SUMOTime freq, 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)
static bool parseAndBuildTAZSink(GNEViewNet *viewNet, bool allowUndoRedo, const SUMOSAXAttributes &attrs, HierarchyInsertedAdditionals *insertedAdditionals)
Builds a TAZ Sink.
double getLaneShapeLength() const
returns the length of the lane's shape
static GNEAdditional * buildTAZSource(GNEViewNet *viewNet, bool allowUndoRedo, GNEAdditional *TAZ, GNEEdge *edge, double departWeight)
Builds a TAZSource (Traffic Assignment Zone)
double getFinalLength() const
get length that will be assigned to the lanes in the final network
static bool parseAndBuildDetectorE1(GNEViewNet *viewNet, bool allowUndoRedo, const SUMOSAXAttributes &attrs, HierarchyInsertedAdditionals *insertedAdditionals)
Parses his values and builds a induction loop detector (GNEViewNet* viewNet, bool allowUndoRedo...
void updateAdditionalParent()
update TAZ after add or remove a Source/sink, or change their weight
static bool accessCanBeCreated(GNEAdditional *busStopParent, GNEEdge &edge)
check if a GNEAccess can be created in a certain Edge
static bool parseAndBuildRerouterClosingReroute(GNEViewNet *viewNet, bool allowUndoRedo, const SUMOSAXAttributes &attrs, HierarchyInsertedAdditionals *insertedAdditionals)
Parses his values and builds a Closing Reroute.
begin/end of the description of an edge
static GNEAdditional * buildParkingSpace(GNEViewNet *viewNet, bool allowUndoRedo, GNEAdditional *parkingAreaParent, Position pos, double width, double length, double angle, bool blockMovement)
Builds a Parking Space.
A road/street connecting two junctions (netedit-version)
entry for an alternative parking zone
static bool canParse(const std::string &string)
true if a value of type T can be parsed from string
void parseGenericParameter(const SUMOSAXAttributes &attrs)
Parse generic parameter and insert it in the last created additional.
static GNEAdditional * 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)
builds a rerouter
trigger: the time of the step
static const RGBColor RED
named colors
Position getPositionInView() const
Returns position of additional in view.
A train stop (alias for bus stop)
static bool parseAndBuildTAZ(GNEViewNet *viewNet, bool allowUndoRedo, const SUMOSAXAttributes &attrs, HierarchyInsertedAdditionals *insertedAdditionals)
Builds a TAZ.
a sink within a district (connection road)
static GNEAdditional * builParkingAreaReroute(GNEViewNet *viewNet, bool allowUndoRedo, GNEAdditional *rerouterIntervalParent, GNEAdditional *newParkignArea, double probability, bool visible)
An Element which don't belongs to GNENet but has influency in the simulation.
static void interpretLaneID(const std::string &lane_id, std::string &edge_id, int &index)
parses edge-id and index from lane-id
const std::string & getTagStr() const
get tag assigned to this object in string format
static bool parseAndBuildVariableSpeedSignStep(GNEViewNet *viewNet, bool allowUndoRedo, const SUMOSAXAttributes &attrs, HierarchyInsertedAdditionals *insertedAdditionals)
Parses his values and builds a Variable Speed Signal Step.
Position getLanePos(const std::string &poiID, const std::string &laneID, double lanePos, double lanePosLat)
get lane position
ShapeContainer & myShapeContainer
reference to shape container in which all Shares are being added
static bool parseAndBuildBusStop(GNEViewNet *viewNet, bool allowUndoRedo, const SUMOSAXAttributes &attrs, HierarchyInsertedAdditionals *insertedAdditionals)
Parses his values and builds a bus stop.
static const GeoConvHelper & getFinal()
the coordinate transformation for writing the location element and for tracking the original coordina...
static GNEAdditional * buildTAZSink(GNEViewNet *viewNet, bool allowUndoRedo, GNEAdditional *TAZ, GNEEdge *edge, double arrivalWeight)
Builds a TAZSink (Traffic Assignment Zone)
GNENet * getNet() const
get the net object
static bool parseAndBuildAccess(GNEViewNet *viewNet, bool allowUndoRedo, const SUMOSAXAttributes &attrs, HierarchyInsertedAdditionals *insertedAdditionals)
Parses values and adds access to the current bus stop.
an aggreagated-output interval
Eficiency of the charge in Charging Stations.
bool x2cartesian_const(Position &from) const
Converts the given coordinate into a cartesian using the previous initialisation. ...
const TagProperties & getTagProperty() const
get Tag Property assigned to this object
void parseAndBuildPOI(const SUMOSAXAttributes &attrs)
Parses his values and builds a POI.
static std::string getFilePath(const std::string &path)
Removes the file information from the given path.
parent of an additional element
void myEndElement(int element)
Called when a closing tag occurs.
static GNEAdditional * buildVariableSpeedSignStep(GNEViewNet *viewNet, bool allowUndoRedo, GNEAdditional *VSSParent, double time, double speed)
Builds a VariableSpeedSign Step.
void disableUpdateGeometry()
disable update geometry of elements after inserting or removing an element in net ...
static bool isValidTypeID(const std::string &value)
whether the given string is a valid id for an edge or vehicle type
static bool parseAndBuildRerouterDestProbReroute(GNEViewNet *viewNet, bool allowUndoRedo, const SUMOSAXAttributes &attrs, HierarchyInsertedAdditionals *insertedAdditionals)
Parses his values and builds a Destiny Prob Reroute.
Delay in the charge of charging stations.
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
Parameterised * getLastParameterised() const
get last parameterised object
static bool parseAndBuildParkingArea(GNEViewNet *viewNet, bool allowUndoRedo, const SUMOSAXAttributes &attrs, HierarchyInsertedAdditionals *insertedAdditionals)
Parses his values and builds a parking area.
void add(double x, double y, double z=0)
Makes the boundary include the given coordinate.
A lane area vehicles can halt at (netedit-version)
double ymax() const
Returns maximum y-coordinate.
begin/end of the description of a Point of interest over Lane (used by Netedit)
a flow definition within in Calibrator (used in NETEDIT)
#define WRITE_MESSAGE(msg)
An access point for a train stop.
static GNEAdditional * buildClosingLaneReroute(GNEViewNet *viewNet, bool allowUndoRedo, GNEAdditional *rerouterIntervalParent, GNELane *closedLane, SVCPermissions permissions)
GNELane * retrieveLane(const std::string &id, bool failHard=true, bool checkVolatileChange=false)
get lane by id
static GNEAdditional * buildDetectorExit(GNEViewNet *viewNet, bool allowUndoRedo, GNEAdditional *E3Parent, GNELane *lane, double pos, bool friendlyPos, bool blockMovement)
Builds a exit detector (E3)
Position getPositionInView() const
Returns position of additional in view.
alternative tag for e3 detector
static GNEAdditional * buildTAZ(GNEViewNet *viewNet, 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)
alternative tag for e2 detector
An Element which don't belongs to GNENet but has influency in the simulation.
static const Position INVALID
used to indicate that a position is valid
begin/end of the description of a polygon
trigger: a step description
const POIs & getPOIs() const
Returns all pois.