72 myAllowUndoRedo(allowUndoRedo) {
82 const std::string& laneID,
const double startPos,
const double endPos,
const std::string& name,
83 const std::vector<std::string>& lines,
const int personCapacity,
const double parkingLength,
84 const RGBColor& color,
const bool friendlyPosition,
const std::map<std::string, std::string>& parameters) {
94 if (lane ==
nullptr) {
98 }
else if (personCapacity < 0) {
100 }
else if (parkingLength < 0) {
105 parkingLength, color, friendlyPosition, parameters);
114 busStop->
incRef(
"buildBusStop");
125 const std::string& laneID,
const double startPos,
const double endPos,
const std::string& name,
126 const std::vector<std::string>& lines,
const int personCapacity,
const double parkingLength,
127 const RGBColor& color,
const bool friendlyPosition,
const std::map<std::string, std::string>& parameters) {
137 if (lane ==
nullptr) {
141 }
else if (personCapacity < 0) {
143 }
else if (parkingLength < 0) {
148 parkingLength, color, friendlyPosition, parameters);
157 trainStop->
incRef(
"buildTrainStop");
168 const double pos,
const double length,
const bool friendlyPos,
const std::map<std::string, std::string>& parameters) {
175 if (busStop ==
nullptr) {
179 if (lane ==
nullptr) {
181 }
else if (busStop ==
nullptr) {
185 }
else if ((length != -1) && (length < 0)) {
203 access->
incRef(
"buildAccess");
211 const double startPos,
const double endPos,
const std::string& name,
const std::vector<std::string>& lines,
const int containerCapacity,
212 const double parkingLength,
const RGBColor& color,
const bool friendlyPosition,
const std::map<std::string, std::string>& parameters) {
222 if (lane ==
nullptr) {
226 }
else if (containerCapacity < 0) {
228 }
else if (parkingLength < 0) {
233 color, friendlyPosition, parameters);
242 containerStop->
incRef(
"buildContainerStop");
253 const std::string& laneID,
const double startPos,
const double endPos,
const std::string& name,
const double chargingPower,
254 const double efficiency,
const bool chargeInTransit,
const SUMOTime chargeDelay,
const bool friendlyPosition,
255 const std::map<std::string, std::string>& parameters) {
265 if (lane ==
nullptr) {
269 }
else if (chargingPower < 0) {
271 }
else if (chargeDelay < 0) {
276 chargeDelay, friendlyPosition, parameters);
285 chargingStation->
incRef(
"buildChargingStation");
297 const double startPos,
const double endPos,
const std::string& departPos,
const std::string& name,
const bool friendlyPosition,
298 const int roadSideCapacity,
const bool onRoad,
const double width,
const double length,
const double angle,
const std::map<std::string, std::string>& parameters) {
308 const double departPosDouble = GNEAttributeCarrier::canParse<double>(departPos) ? GNEAttributeCarrier::parse<double>(departPos) : 0;
310 if (lane ==
nullptr) {
314 }
else if (roadSideCapacity < 0) {
316 }
else if (width < 0) {
318 }
else if (length < 0) {
334 parkingArea->
incRef(
"buildParkingArea");
345 const std::string& name,
const std::string& width,
const std::string& length,
const std::string& angle,
const double slope,
346 const std::map<std::string, std::string>& parameters) {
348 if (!width.empty() && !GNEAttributeCarrier::canParse<double>(width)) {
350 }
else if (!length.empty() && !GNEAttributeCarrier::canParse<double>(length)) {
352 }
else if (!angle.empty() && !GNEAttributeCarrier::canParse<double>(angle)) {
360 const double widthDouble = width.empty() ? 0 : GNEAttributeCarrier::parse<double>(width);
361 const double lengthDouble = length.empty() ? 0 : GNEAttributeCarrier::parse<double>(length);
363 if (parkingArea ==
nullptr) {
365 }
else if (widthDouble < 0) {
367 }
else if (lengthDouble < 0) {
371 GNEAdditional* parkingSpace =
new GNEParkingSpace(
myNet, parkingArea,
Position(x, y, z), width, length, angle, slope, name, parameters);
380 parkingSpace->
incRef(
"buildParkingSpace");
391 const double position,
const SUMOTime frequency,
const std::string& file,
const std::vector<std::string>& vehicleTypes,
const std::string& name,
392 const bool friendlyPos,
const std::map<std::string, std::string>& parameters) {
402 if (lane ==
nullptr) {
406 }
else if (frequency < 0) {
423 detectorE1->
incRef(
"buildDetectorE1");
434 const double pos,
const double length,
const SUMOTime freq,
const std::string& trafficLight,
const std::string& filename,
const std::vector<std::string>& vehicleTypes,
435 const std::string& name,
const SUMOTime timeThreshold,
const double speedThreshold,
const double jamThreshold,
const bool friendlyPos,
436 const std::map<std::string, std::string>& parameters) {
447 if (lane ==
nullptr) {
451 }
else if (length < 0) {
453 }
else if ((freq != -1) && (freq < 0)) {
455 }
else if (timeThreshold < 0) {
457 }
else if (speedThreshold < 0) {
459 }
else if (jamThreshold < 0) {
461 }
else if (freq < 0) {
463 }
else if (timeThreshold < 0) {
465 }
else if (speedThreshold < 0) {
467 }
else if (jamThreshold < 0) {
476 id, lane,
myNet, pos, length, freq, trafficLight, filename,
477 vehicleTypes, name, timeThreshold, speedThreshold, jamThreshold,
478 friendlyPos, parameters);
487 detectorE2->
incRef(
"buildDetectorE2");
498 const double pos,
const double endPos,
const SUMOTime freq,
const std::string& trafficLight,
const std::string& filename,
const std::vector<std::string>& vehicleTypes,
499 const std::string& name,
const SUMOTime timeThreshold,
const double speedThreshold,
const double jamThreshold,
const bool friendlyPos,
500 const std::map<std::string, std::string>& parameters) {
511 if (lanes.size() > 0) {
513 pos, lanes.front()->getParentEdge()->getNBEdge()->getFinalLength(),
514 endPos, lanes.back()->getParentEdge()->getNBEdge()->getFinalLength(), friendlyPos)) {
516 }
else if (freq < 0) {
518 }
else if (timeThreshold < 0) {
520 }
else if (speedThreshold < 0) {
522 }
else if (jamThreshold < 0) {
531 id, lanes,
myNet, pos, endPos, freq, trafficLight, filename,
532 vehicleTypes, name, timeThreshold, speedThreshold, jamThreshold,
533 friendlyPos, parameters);
541 for (
const auto& lane : lanes) {
542 lane->addChildElement(detectorE2);
544 detectorE2->
incRef(
"buildDetectorE2Multilane");
556 const std::string& filename,
const std::vector<std::string>& vehicleTypes,
const std::string& name,
const SUMOTime timeThreshold,
const double speedThreshold,
557 const std::map<std::string, std::string>& parameters) {
561 }
else if (freq < 0) {
563 }
else if (timeThreshold < 0) {
565 }
else if (speedThreshold < 0) {
583 E3->incRef(
"buildDetectorE3");
593 const bool friendlyPos,
const std::map<std::string, std::string>& parameters) {
599 if (lane ==
nullptr) {
601 }
else if (
E3 ==
nullptr) {
618 E3->addChildElement(entry);
619 entry->
incRef(
"buildDetectorEntry");
627 const bool friendlyPos,
const std::map<std::string, std::string>& parameters) {
633 if (lane ==
nullptr) {
635 }
else if (
E3 ==
nullptr) {
652 E3->addChildElement(exit);
653 exit->
incRef(
"buildDetectorExit");
661 const std::string& filename,
const std::vector<std::string>& vehicleTypes,
const std::string& name,
const bool friendlyPos,
const std::map<std::string, std::string>& parameters) {
671 if (lane ==
nullptr) {
688 detectorE1Instant->
incRef(
"buildDetectorE1Instant");
699 const std::string& name,
const std::string& outfile,
const SUMOTime freq,
const std::string& routeprobeID,
const double jamThreshold,
const std::vector<std::string>& vTypes,
700 const std::map<std::string, std::string>& parameters) {
711 }
else if ((routeprobeID.size() > 0) && (routeProbe ==
nullptr)) {
713 }
else if (lane ==
nullptr) {
721 }
else if (freq < 0) {
723 }
else if (jamThreshold < 0) {
728 new GNECalibrator(
id,
myNet, lane, pos, freq, name, outfile, jamThreshold, vTypes, parameters) :
729 new GNECalibrator(
id,
myNet, lane, pos, freq, name, outfile, routeProbe, jamThreshold, vTypes, parameters);
745 calibrator->
incRef(
"buildCalibrator");
754 const std::string& name,
const std::string& outfile,
const SUMOTime freq,
const std::string& routeprobeID,
const double jamThreshold,
const std::vector<std::string>& vTypes,
755 const std::map<std::string, std::string>& parameters) {
766 }
else if ((routeprobeID.size() > 0) && (routeProbe ==
nullptr)) {
768 }
else if (edge ==
nullptr) {
775 }
else if (freq < 0) {
777 }
else if (jamThreshold < 0) {
782 new GNECalibrator(
id,
myNet, edge, pos, freq, name, outfile, jamThreshold, vTypes, parameters) :
783 new GNECalibrator(
id,
myNet, edge, pos, freq, name, outfile, routeProbe, jamThreshold, vTypes, parameters);
799 calibrator->
incRef(
"buildCalibrator");
815 if (vType ==
nullptr) {
817 }
else if (route ==
nullptr) {
819 }
else if (calibrator ==
nullptr) {
833 flow->
incRef(
"buildCalibratorFlow");
841 const std::vector<std::string>& edgeIDs,
const double prob,
const std::string& name,
const std::string& file,
const bool off,
const SUMOTime timeThreshold,
842 const std::vector<std::string>& vTypes,
const std::map<std::string, std::string>& parameters) {
846 }
else if (prob < 0) {
848 }
else if (timeThreshold < 0) {
860 if (edges.size() > 0) {
864 if (edges.size() > 0) {
865 PositionVector laneShape = edges.front()->getLanes().front()->getLaneShape();
871 rerouter =
new GNERerouter(
id,
myNet,
Position(0, 0), name, file, prob, off, timeThreshold, vTypes, parameters);
874 rerouter =
new GNERerouter(
id,
myNet, pos, name, file, prob, off, timeThreshold, vTypes, parameters);
877 std::vector<GNEAdditional*> rerouterSymbols;
878 for (
const auto& edge : edges) {
886 for (
const auto& rerouterSymbol : rerouterSymbols) {
893 for (
int i = 0; i < (int)edges.size(); i++) {
894 edges.at(i)->addChildElement(rerouterSymbols.at(i));
895 rerouterSymbols.at(i)->incRef(
"buildRerouterSymbol");
897 rerouter->
incRef(
"buildRerouter");
928 if (rerouter ==
nullptr) {
930 }
else if (begin < 0) {
932 }
else if (end < 0) {
934 }
else if (end < begin) {
948 rerouterInterval->
incRef(
"buildRerouterInterval");
964 if (lane ==
nullptr) {
966 }
else if (rerouterInterval ==
nullptr) {
978 closingLaneReroute->
incRef(
"buildClosingLaneReroute");
991 if (edge ==
nullptr) {
993 }
else if (rerouterInterval ==
nullptr) {
1005 closingLaneReroute->
incRef(
"buildClosingLaneReroute");
1017 if (edge ==
nullptr) {
1019 }
else if (rerouterInterval ==
nullptr) {
1031 destProbReroute->
incRef(
"builDestProbReroute");
1044 if (rerouterInterval ==
nullptr) {
1046 }
else if (parkingArea ==
nullptr) {
1058 parkingAreaReroute->
incRef(
"builParkingAreaReroute");
1071 if (rerouterInterval ==
nullptr) {
1073 }
else if (route ==
nullptr) {
1085 routeProbReroute->
incRef(
"buildRouteProbReroute");
1093 const std::string& name,
const std::string& file,
const SUMOTime begin,
const std::map<std::string, std::string>& parameters) {
1103 if (edge ==
nullptr) {
1105 }
else if (freq < 0) {
1107 }
else if (begin < 0) {
1126 routeProbe->
incRef(
"buildRouteProbe");
1137 const std::vector<std::string>& laneIDs,
const std::string& name,
const std::vector<std::string>& vTypes,
const std::map<std::string, std::string>& parameters) {
1147 if (lanes.size() > 0) {
1155 std::vector<GNEAdditional*> VSSSymbols;
1156 for (
const auto& lane : lanes) {
1163 for (
const auto& VSSSymbol : VSSSymbols) {
1170 for (
int i = 0; i < (int)lanes.size(); i++) {
1171 lanes.at(i)->addChildElement(VSSSymbols.at(i));
1172 VSSSymbols.at(i)->incRef(
"buildVariableSpeedSignSymbol");
1174 variableSpeedSign->
incRef(
"buildVariableSpeedSign");
1189 if (VSS ==
nullptr) {
1191 }
else if (time < 0) {
1207 variableSpeedSignStep->
incRef(
"buildVariableSpeedSignStep");
1215 const SUMOTime endTime,
const std::string& name,
const std::map<std::string, std::string>& parameters) {
1225 if (edge ==
nullptr) {
1227 }
else if (beginTime < 0) {
1229 }
else if (endTime < 0) {
1231 }
else if (endTime < beginTime) {
1248 vaporizer->
incRef(
"buildVaporizer");
1259 const Position& center,
const bool fill,
const RGBColor& color,
const std::vector<std::string>& edgeIDs,
1260 const std::string& name,
const std::map<std::string, std::string>& parameters) {
1265 if (TAZShape.size() == 0) {
1268 for (
const auto& edge : edges) {
1269 TAZBoundary.
add(edge->getCenteringBoundary());
1274 if (sourceSinkEdge) {
1279 TAZShape = TAZBoundary.
getShape(
true);
1288 }
else if (TAZShape.size() == 0) {
1302 for (
const auto& edge : edges) {
1313 TAZ->incRef(
"buildTAZ");
1314 for (
const auto& edge : edges) {
1317 TAZSource->
incRef(
"buildTAZ");
1318 TAZ->addChildElement(TAZSource);
1321 TAZSink->
incRef(
"buildTAZ");
1322 TAZ->addChildElement(TAZSink);
1328 TAZ->updateGeometry();
1342 if (
TAZ ==
nullptr) {
1344 }
else if (edge ==
nullptr) {
1348 for (
const auto& TAZElement :
TAZ->getChildTAZElements()) {
1350 TAZSink = TAZElement;
1354 if (TAZSink ==
nullptr) {
1364 TAZSink->
incRef(
"buildTAZSource");
1370 for (
const auto& TAZElement :
TAZ->getChildTAZElements()) {
1372 TAZSource = TAZElement;
1376 if (TAZSource ==
nullptr) {
1386 TAZSource->
incRef(
"buildTAZSource");
1396 TAZSource->
incRef(
"buildTAZSource");
1410 if (
TAZ ==
nullptr) {
1412 }
else if (edge ==
nullptr) {
1418 for (
const auto& TAZElement :
TAZ->getChildTAZElements()) {
1420 TAZSource = TAZElement;
1424 if (TAZSource ==
nullptr) {
1434 TAZSource->
incRef(
"buildTAZSink");
1439 for (
const auto& TAZElement :
TAZ->getChildTAZElements()) {
1441 TAZSink = TAZElement;
1445 if (TAZSink ==
nullptr) {
1455 TAZSink->
incRef(
"buildTAZSink");
1465 TAZSink->
incRef(
"buildTAZSink");
1474 const RGBColor& color,
double layer,
double angle,
const std::string& imgFile,
bool relativePath,
const PositionVector& shape,
bool geo,
bool fill,
1475 double lineWidth,
const std::string& name,
const std::map<std::string, std::string>& parameters) {
1483 }
else if (lineWidth < 0) {
1489 GNEPoly* poly =
new GNEPoly(
myNet,
id, type, shape, geo, fill, lineWidth, color, layer, angle, imgFile, relativePath, name, parameters);
1498 poly->
incRef(
"addPolygon");
1506 const RGBColor& color,
const double x,
const double y,
double layer,
double angle,
const std::string& imgFile,
bool relativePath,
1507 double width,
double height,
const std::string& name,
const std::map<std::string, std::string>& parameters) {
1511 }
else if (width < 0) {
1513 }
else if (height < 0) {
1521 GNEPOI*
POI =
new GNEPOI(
myNet,
id, type, color, x, y,
false, layer, angle, imgFile, relativePath, width, height, name, parameters);
1530 POI->incRef(
"addPOI");
1540 const RGBColor& color,
const std::string& laneID,
double posOverLane,
const bool friendlyPos,
double posLat,
double layer,
double angle,
1541 const std::string& imgFile,
bool relativePath,
double width,
double height,
const std::string& name,
const std::map<std::string, std::string>& parameters) {
1545 }
else if (width < 0) {
1547 }
else if (height < 0) {
1557 if (lane ==
nullptr) {
1563 GNEShape* POILane =
new GNEPOI(
myNet,
id, type, color, lane, posOverLane, friendlyPos, posLat, layer, angle, imgFile, relativePath, width, height, name, parameters);
1573 POILane->
incRef(
"buildPOILane");
1584 const RGBColor& color,
const double lon,
const double lat,
double layer,
double angle,
const std::string& imgFile,
bool relativePath,
1585 double width,
double height,
const std::string& name,
const std::map<std::string, std::string>& parameters) {
1589 }
else if (width < 0) {
1591 }
else if (height < 0) {
1601 GNEPOI*
POIGEO =
new GNEPOI(
myNet,
id, type, color, lon, lat,
true, layer, angle, imgFile, relativePath, width, height, name, parameters);
1610 POIGEO->incRef(
"buildPOIGeo");
1622 for (
const auto& lane : edge->
getLanes()) {
1635 std::vector<std::pair<SUMOTime, SUMOTime>> sortedIntervals;
1638 if (!rerouterChild->getTagProperty().isSymbol()) {
1646 sortedIntervals.push_back(std::make_pair(newBegin, newEnd));
1648 std::sort(sortedIntervals.begin(), sortedIntervals.end());
1650 for (
int i = 0; i < (int)sortedIntervals.size() - 1; i++) {
1651 if (sortedIntervals.at(i).second > sortedIntervals.at(i + 1).first) {
1668 if ((pos < 0) || (pos > laneLength)) {
1684 }
else if (pos > laneLength) {
1708 if ((to - from) < POSITION_EPS) {
1711 if ((from < 0) || (from > laneLength)) {
1714 if ((to < 0) || (to > laneLength)) {
1735 }
else if (from > laneLength) {
1744 }
else if (to > laneLength) {
1748 if ((to - from) < POSITION_EPS) {
1749 if (to >= POSITION_EPS) {
1750 from = to - POSITION_EPS;
1768 if ((pos < 0) || (pos > laneLength)) {
1771 if ((pos + length) > laneLength) {
1789 length = POSITION_EPS;
1791 if (pos > (laneLength - POSITION_EPS)) {
1792 pos = (laneLength - POSITION_EPS);
1793 length = POSITION_EPS;
1794 }
else if ((pos + length) > laneLength) {
1795 length = (laneLength - pos);
1819 WRITE_ERROR(
"Could not build " +
toString(tag) +
" with ID '" +
id +
"' in netedit; ID contains invalid characters.");
1825 WRITE_ERROR(
"Could not build " +
toString(tag) +
" with ID '" +
id +
"' in netedit; Invalid position over lane.");
1831 WRITE_ERROR(
"Could not build " +
toString(tag) +
" with ID '" +
id +
"' in netedit; declared twice.");
1843 WRITE_ERROR(
"Could not build " +
toString(tag) +
" with ID '" +
id +
"' in netedit; attribute " +
toString(attribute) +
" cannot be negative.");
1849 WRITE_ERROR(
"Could not build " +
toString(tag) +
" with ID '" +
id +
"' in netedit; list of VTypes isn't valid.");
1855 WRITE_ERROR(
"Could not build " +
toString(tag) +
" with ID '" +
id +
"' in netedit; filename is invalid.");
1861 for (
const auto& vTypeID : vTypeIDs) {
1915 std::vector<GNEEdge*>
1917 std::vector<GNEEdge*> edges;
1918 for (
const auto& edgeID : edgeIDs) {
1921 if (edge ==
nullptr) {
1926 edges.push_back(edge);
1933 std::vector<GNELane*>
1935 std::vector<GNELane*> lanes;
1936 for (
const auto& laneID : laneIDs) {
1939 if (lane ==
nullptr) {
1944 lanes.push_back(lane);
1953 myAllowUndoRedo(false) {
1971 centerAfterCreation(false) {
#define WRITE_WARNING(msg)
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/person/container type
@ SUMO_TAG_ACCESS
An access point for a train stop.
@ SUMO_TAG_CONTAINER_STOP
A container stop.
@ SUMO_TAG_PARKING_AREA_REROUTE
entry for an alternative parking zone
@ 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_FLOW
a flow definitio nusing a from-to edges instead of a route (used by router)
@ SUMO_TAG_PARKING_AREA
A parking area.
@ SUMO_TAG_ROUTE_PROB_REROUTE
probability of route of a reroute
@ SUMO_TAG_DET_ENTRY
an e3 entry point
@ GNE_TAG_E2DETECTOR_MULTILANE
an e2 detector over multiple lanes (placed here due create Additional Frame)
@ 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_SINK
Sink(s) specification.
@ SUMO_TAG_TRAIN_STOP
A train stop (alias for bus stop)
@ SUMO_TAG_SOURCE
a source
@ SUMO_TAG_LANE
begin/end of the description of a single lane
@ SUMO_TAG_INSTANT_INDUCTION_LOOP
An instantenous induction loop.
@ SUMO_TAG_DEST_PROB_REROUTE
probability of destiny of a reroute
@ SUMO_TAG_E1DETECTOR
an e1 detector
@ SUMO_TAG_DET_EXIT
an e3 exit point
@ SUMO_TAG_VAPORIZER
vaporizer of vehicles
@ 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_E3DETECTOR
an e3 detector
@ SUMO_TAG_VSS
A variable speed sign.
@ SUMO_TAG_EDGE
begin/end of the description of an edge
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
@ GNE_ATTR_CENTER_AFTER_CREATION
flag to center camera after element creation
@ SUMO_ATTR_JAM_DIST_THRESHOLD
@ SUMO_ATTR_PARKING_LENGTH
@ GNE_ATTR_SELECTED
element is selected
@ SUMO_ATTR_BEGIN
weights: time range begin
@ SUMO_ATTR_HALTING_TIME_THRESHOLD
@ SUMO_ATTR_HALTING_SPEED_THRESHOLD
@ SUMO_ATTR_END
weights: time range end
@ SUMO_ATTR_ROADSIDE_CAPACITY
@ SUMO_ATTR_CHARGINGPOWER
@ SUMO_ATTR_PERSON_CAPACITY
@ SUMO_ATTR_CHARGEDELAY
Delay in the charge of charging stations.
const double INVALID_DOUBLE
const double SUMO_const_laneWidth
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.
PositionVector getShape(const bool closeShape) const
get position vector (shape) based on this boundary
SUMOTime getTimeAttribute(const SumoXMLAttr attr) const
get time attribute
bool hasStringAttribute(const SumoXMLAttr attr) const
has function
SumoBaseObject * getParentSumoBaseObject() const
get pointer to mySumoBaseObjectParent SumoBaseObject (if is null, then is the root)
bool hasTimeAttribute(const SumoXMLAttr attr) const
check if current SumoBaseObject has the given time attribute
SumoXMLTag getTag() const
const std::string & getStringAttribute(const SumoXMLAttr attr) const
get string attribute
const std::vector< SumoBaseObject * > & getSumoBaseObjectChildren() const
get SumoBaseObject children
void buildPolygon(const CommonXMLStructure::SumoBaseObject *sumoBaseObject, const std::string &id, const std::string &type, const RGBColor &color, const double layer, const double angle, const std::string &imgFile, const bool relativePath, const PositionVector &shape, const bool geo, const bool fill, const double lineWidth, const std::string &name, const std::map< std::string, std::string > ¶meters)
Builds a polygon using the given values.
void buildVariableSpeedSign(const CommonXMLStructure::SumoBaseObject *sumoBaseObject, const std::string &id, const Position &pos, const std::vector< std::string > &laneIDs, const std::string &name, const std::vector< std::string > &vTypes, const std::map< std::string, std::string > ¶meters)
Builds a VariableSpeedSign (lane speed additional)
~GNEAdditionalHandler()
Destructor.
void writeErrorInvalidVTypes(const SumoXMLTag tag, const std::string &id) const
write error "invalid list of vehicle types"
std::vector< GNELane * > parseLanes(const SumoXMLTag tag, const std::vector< std::string > &laneIDs) const
parse lanes
GNEAdditional * getRerouterIntervalParent(const CommonXMLStructure::SumoBaseObject *sumoBaseObject) const
get rerouter interval parent
void buildEdgeCalibrator(const CommonXMLStructure::SumoBaseObject *sumoBaseObject, const std::string &id, const std::string &edgeID, const double pos, const std::string &name, const std::string &outfile, const SUMOTime freq, const std::string &routeprobe, const double jamThreshold, const std::vector< std::string > &vTypes, const std::map< std::string, std::string > ¶meters)
builds a microscopic calibrator over an edge
void buildPOI(const CommonXMLStructure::SumoBaseObject *sumoBaseObject, const std::string &id, const std::string &type, const RGBColor &color, const double x, const double y, const double layer, const double angle, const std::string &imgFile, bool relativePath, const double width, const double height, const std::string &name, const std::map< std::string, std::string > ¶meters)
Builds a POI using the given values.
void buildAccess(const CommonXMLStructure::SumoBaseObject *sumoBaseObject, const std::string &laneID, const double pos, const double length, const bool friendlyPos, const std::map< std::string, std::string > ¶meters)
Builds an Access.
static bool accessCanBeCreated(GNEAdditional *busStopParent, GNEEdge *edge)
check if a GNEAccess can be created in a certain Edge
void buildTAZSink(const CommonXMLStructure::SumoBaseObject *sumoBaseObject, const std::string &edgeID, const double arrivalWeight)
Builds a TAZSink (Traffic Assignment Zone)
void buildVariableSpeedSignStep(const CommonXMLStructure::SumoBaseObject *sumoBaseObject, const SUMOTime time, const std::string &speed)
Builds a VariableSpeedSign Step.
void buildMultiLaneDetectorE2(const CommonXMLStructure::SumoBaseObject *sumoBaseObject, const std::string &id, const std::vector< std::string > &lanes, const double pos, const double endPos, const SUMOTime freq, const std::string &trafficLight, const std::string &filename, const std::vector< std::string > &vehicleTypes, const std::string &name, const SUMOTime timeThreshold, const double speedThreshold, const double jamThreshold, const bool friendlyPos, const std::map< std::string, std::string > ¶meters)
Builds a multi-lane Area Detector (E2)
GNEAdditional * getAdditionalParent(const CommonXMLStructure::SumoBaseObject *sumoBaseObject, SumoXMLTag tag) const
get additional parent
void buildVaporizer(const CommonXMLStructure::SumoBaseObject *sumoBaseObject, const std::string &edgeID, const SUMOTime from, const SUMOTime endTime, const std::string &name, const std::map< std::string, std::string > ¶meters)
Builds a vaporizer (lane speed additional)
static void fixE2MultiLanePosition(double &pos, const double fromLaneLength, double &to, const double TolaneLength)
fix the given positions over lane
void writeErrorInvalidNegativeValue(const SumoXMLTag tag, const std::string &id, const SumoXMLAttr attribute) const
write error "invalid negative element"
void buildRerouterInterval(const CommonXMLStructure::SumoBaseObject *sumoBaseObject, const SUMOTime begin, const SUMOTime end)
builds a rerouter interval
void buildTrainStop(const CommonXMLStructure::SumoBaseObject *sumoBaseObject, const std::string &id, const std::string &laneID, const double startPos, const double endPos, const std::string &name, const std::vector< std::string > &lines, const int personCapacity, const double parkingLength, const RGBColor &color, const bool friendlyPosition, const std::map< std::string, std::string > ¶meters)
Builds a train stop.
void buildCalibratorFlow(const CommonXMLStructure::SumoBaseObject *sumoBaseObject, const SUMOVehicleParameter &vehicleParameter)
builds a calibrator flow
void buildE1Detector(const CommonXMLStructure::SumoBaseObject *sumoBaseObject, const std::string &id, const std::string &laneID, const double position, const SUMOTime frequency, const std::string &file, const std::vector< std::string > &vehicleTypes, const std::string &name, const bool friendlyPos, const std::map< std::string, std::string > ¶meters)
Builds a induction loop detector (E1)
void buildPOILane(const CommonXMLStructure::SumoBaseObject *sumoBaseObject, const std::string &id, const std::string &type, const RGBColor &color, const std::string &laneID, const double posOverLane, const bool friendlyPos, const double posLat, const double layer, const double angle, const std::string &imgFile, const bool relativePath, const double width, const double height, const std::string &name, const std::map< std::string, std::string > ¶meters)
Builds a POI over lane using the given values.
void buildDetectorE3(const CommonXMLStructure::SumoBaseObject *sumoBaseObject, const std::string &id, const Position &pos, const SUMOTime freq, const std::string &filename, const std::vector< std::string > &vehicleTypes, const std::string &name, const SUMOTime timeThreshold, const double speedThreshold, const std::map< std::string, std::string > ¶meters)
Builds a multi entry exit detector (E3)
static void fixDoublePositionOverLane(double &from, double &to, const double laneLengt)
fix the given positions over lane
void writeErrorDuplicated(const SumoXMLTag tag, const std::string &id) const
write error "duplicated additional"
void buildBusStop(const CommonXMLStructure::SumoBaseObject *sumoBaseObject, const std::string &id, const std::string &laneID, const double startPos, const double endPos, const std::string &name, const std::vector< std::string > &lines, const int personCapacity, const double parkingLength, const RGBColor &color, const bool friendlyPosition, const std::map< std::string, std::string > ¶meters)
Builds a bus stop.
void writeErrorInvalidPosition(const SumoXMLTag tag, const std::string &id) const
write error "invalid position"
static void fixE2SingleLanePosition(double &pos, double &length, const double laneLength)
fix the given positions over lane
void writeErrorInvalidFilename(const SumoXMLTag tag, const std::string &id) const
write error "invalid filename"
static bool checkSinglePositionOverLane(double pos, const double laneLength, const bool friendlyPos)
check if the given position over a lane is valid
void buildContainerStop(const CommonXMLStructure::SumoBaseObject *sumoBaseObject, const std::string &id, const std::string &laneID, const double startPos, const double endPos, const std::string &name, const std::vector< std::string > &lines, const int containerCapacity, const double parkingLength, const RGBColor &color, const bool friendlyPosition, const std::map< std::string, std::string > ¶meters)
Builds a container stop.
void buildClosingLaneReroute(const CommonXMLStructure::SumoBaseObject *sumoBaseObject, const std::string &closedLane, SVCPermissions permissions)
builds a closing lane reroute
void buildLaneCalibrator(const CommonXMLStructure::SumoBaseObject *sumoBaseObject, const std::string &id, const std::string &laneID, const double pos, const std::string &name, const std::string &outfile, const SUMOTime freq, const std::string &routeprobe, const double jamThreshold, const std::vector< std::string > &vTypes, const std::map< std::string, std::string > ¶meters)
builds a microscopic calibrator over a lane
void buildClosingReroute(const CommonXMLStructure::SumoBaseObject *sumoBaseObject, const std::string &closedEdgeID, SVCPermissions permissions)
builds a closing edge reroute
void buildDetectorEntry(const CommonXMLStructure::SumoBaseObject *sumoBaseObject, const std::string &laneID, const double pos, const bool friendlyPos, const std::map< std::string, std::string > ¶meters)
Builds a entry detector (E3)
void buildChargingStation(const CommonXMLStructure::SumoBaseObject *sumoBaseObject, const std::string &id, const std::string &laneID, const double startPos, const double endPos, const std::string &name, const double chargingPower, const double efficiency, const bool chargeInTransit, const SUMOTime chargeDelay, const bool friendlyPosition, const std::map< std::string, std::string > ¶meters)
Builds a charging Station.
static bool checkDoublePositionOverLane(double from, const double to, const double laneLength, const bool friendlyPos)
check if the given positions over a lane is valid
void buildDestProbReroute(const CommonXMLStructure::SumoBaseObject *sumoBaseObject, const std::string &newEdgeDestinationID, const double probability)
builds a dest prob reroute
void buildParkingSpace(const CommonXMLStructure::SumoBaseObject *sumoBaseObject, const double x, const double y, const double z, const std::string &name, const std::string &width, const std::string &length, const std::string &angle, const double slope, const std::map< std::string, std::string > ¶meters)
Builds a Parking Space.
bool checkListOfVehicleTypes(const std::vector< std::string > &vTypeIDs) const
check list of IDs
const bool myAllowUndoRedo
allow undo/redo
void buildParkingAreaReroute(const CommonXMLStructure::SumoBaseObject *sumoBaseObject, const std::string &newParkignAreaID, const double probability, const bool visible)
builds a parking area reroute
void buildParkingArea(const CommonXMLStructure::SumoBaseObject *sumoBaseObject, const std::string &id, const std::string &laneID, const double startPos, const double endPos, const std::string &departPos, const std::string &name, const bool friendlyPosition, const int roadSideCapacity, const bool onRoad, const double width, const double length, const double angle, const std::map< std::string, std::string > ¶meters)
Builds a Parking Area.
GNEAdditionalHandler()
invalidate default constructo
void writeErrorInvalidParent(const SumoXMLTag tag, const SumoXMLTag parent) const
write error "invalid parent element"
static bool checkE2MultiLanePosition(double pos, const double fromLaneLength, const double to, const double TolaneLength, const bool friendlyPos)
check if the given positions over a lane is valid
void buildDetectorE1Instant(const CommonXMLStructure::SumoBaseObject *sumoBaseObject, const std::string &id, const std::string &laneID, const double pos, const std::string &filename, const std::vector< std::string > &vehicleTypes, const std::string &name, const bool friendlyPos, const std::map< std::string, std::string > ¶meters)
Builds a Instant Induction Loop Detector (E1Instant)
GNETAZElement * getTAZParent(const CommonXMLStructure::SumoBaseObject *sumoBaseObject) const
get TAZ parent
static bool checkOverlappingRerouterIntervals(GNEAdditional *rerouter, const SUMOTime newBegin, const SUMOTime newEnd)
check if an overlapping is produced in rerouter if a interval with certain begin and end is inserted
GNENet * myNet
pointer to GNENet
static void fixSinglePositionOverLane(double &pos, const double laneLength)
fix given position over lane
void buildRerouter(const CommonXMLStructure::SumoBaseObject *sumoBaseObject, const std::string &id, const Position &pos, const std::vector< std::string > &edgeIDs, const double prob, const std::string &name, const std::string &file, const bool off, const SUMOTime timeThreshold, const std::vector< std::string > &vTypes, const std::map< std::string, std::string > ¶meters)
builds a rerouter
void buildRouteProbe(const CommonXMLStructure::SumoBaseObject *sumoBaseObject, const std::string &id, const std::string &edgeID, const SUMOTime freq, const std::string &name, const std::string &file, const SUMOTime begin, const std::map< std::string, std::string > ¶meters)
builds a Route probe
std::vector< GNEEdge * > parseEdges(const SumoXMLTag tag, const std::vector< std::string > &edgeIDs) const
parse edges
void buildRouteProbReroute(const CommonXMLStructure::SumoBaseObject *sumoBaseObject, const std::string &newRouteID, const double probability)
builds a route prob reroute
void writeInvalidID(const SumoXMLTag tag, const std::string &id) const
write invalid id
void buildTAZSource(const CommonXMLStructure::SumoBaseObject *sumoBaseObject, const std::string &edgeID, const double departWeight)
Builds a TAZSource (Traffic Assignment Zone)
void buildSingleLaneDetectorE2(const CommonXMLStructure::SumoBaseObject *sumoBaseObject, const std::string &id, const std::string &laneID, const double pos, const double length, const SUMOTime freq, const std::string &trafficLight, const std::string &filename, const std::vector< std::string > &vehicleTypes, const std::string &name, const SUMOTime timeThreshold, const double speedThreshold, const double jamThreshold, const bool friendlyPos, const std::map< std::string, std::string > ¶meters)
Builds a single-lane Area Detector (E2)
void buildDetectorExit(const CommonXMLStructure::SumoBaseObject *sumoBaseObject, const std::string &laneID, const double pos, const bool friendlyPos, const std::map< std::string, std::string > ¶meters)
Builds a exit detector (E3)
void buildPOIGeo(const CommonXMLStructure::SumoBaseObject *sumoBaseObject, const std::string &id, const std::string &type, const RGBColor &color, const double lon, const double lat, const double layer, const double angle, const std::string &imgFile, bool relativePath, const double width, const double height, const std::string &name, const std::map< std::string, std::string > ¶meters)
Builds a POI in GEO coordinaten using the given values.
static bool checkE2SingleLanePosition(double pos, const double length, const double laneLength, const bool friendlyPos)
check if the given positions over a lane is valid
void buildTAZ(const CommonXMLStructure::SumoBaseObject *sumoBaseObject, const std::string &id, const PositionVector &shape, const Position ¢er, const bool fill, const RGBColor &color, const std::vector< std::string > &edgeIDs, const std::string &name, const std::map< std::string, std::string > ¶meters)
Builds a TAZ (Traffic Assignment Zone)
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
virtual Position getPositionInView() const =0
Returns position of additional in view.
const std::string & getTagStr() const
get tag assigned to this object in string format
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 * > & getChildAdditionals() const
return child additionals
This lane is powered by an underlying GNEEdge and basically knows how to draw itself.
bool allowPedestrians() const
check if current lane allow pedestrians
GNEEdge * getParentEdge() const
get arent edge
GNETAZElement * retrieveTAZElement(SumoXMLTag type, const std::string &id, bool hardFail=true) const
Returns the named TAZElement.
GNELane * retrieveLane(const std::string &id, bool hardFail=true, bool checkVolatileChange=false) const
get lane by id
GNEShape * retrieveShape(SumoXMLTag, const std::string &id, bool hardFail=true) const
Returns the named shape.
GNEAdditional * retrieveAdditional(SumoXMLTag type, const std::string &id, bool hardFail=true) const
Returns the named additional.
void insertShape(GNEShape *shape)
Insert a shape element int GNENet container.
GNEAdditional * retrieveRerouterInterval(const std::string &rerouterID, const SUMOTime begin, const SUMOTime end) const
Returns the rerouter interval defined by given begin and end.
void insertTAZElement(GNETAZElement *TAZElement)
Insert a TAZElement element int GNENet container.
void insertAdditional(GNEAdditional *additional)
Insert a additional element int GNENet container.
GNEEdge * retrieveEdge(const std::string &id, bool hardFail=true) const
get edge by id
GNEDemandElement * retrieveDemandElement(SumoXMLTag type, const std::string &id, bool hardFail=true) const
Returns the named demand element.
A NBNetBuilder extended by visualisation and editing capabilities.
void disableUpdateGeometry()
disable update geometry of elements after inserting or removing an element in net
GNENetHelper::AttributeCarriers * getAttributeCarriers() const
get all attribute carriers used in this net
GNEViewNet * getViewNet() const
get view net
void enableUpdateGeometry()
Boundary getCenteringBoundary() const
Returns the boundary to which the view shall be centered in order to show the object.
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.
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
void end()
End undo command sub-group. If the sub-group is still empty, it will be deleted; otherwise,...
void begin(GUIIcon icon, const std::string &description)
Begin undo command sub-group with current supermode. This begins a new group of commands that are tre...
void add(GNEChange *command, bool doit=false, bool merge=true)
Add new command, executing it if desired. The new command will be merged with the previous command if...
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
static const GeoConvHelper & getFinal()
the coordinate transformation for writing the location element and for tracking the original coordina...
double getFinalLength() const
get length that will be assigned to the lanes in the final network
C++ TraCI client API implementation.
A point in 2D or 3D with translation and scaling methods.
static const Position INVALID
used to indicate that a position is valid
double length2D() const
Returns the length.
void move2side(double amount, double maxExtension=100)
move position vector to side using certain ammount
Position positionAtOffset2D(double pos, double lateralOffset=0) const
Returns the position at the given length.
Structure representing possible vehicle parameter.
std::string vtypeid
The vehicle's type id.
std::string routeid
The vehicle's route id.
static bool isValidTypeID(const std::string &value)
whether the given string is a valid id for an edge or vehicle type
static bool isValidFilename(const std::string &value)
whether the given string is a valid attribute for a filename (for example, a name)
static bool isValidAdditionalID(const std::string &value)
whether the given string is a valid id for an additional object
static bool isValidDetectorID(const std::string &value)
whether the given string is a valid id for an detector
static bool isValidListOfTypeID(const std::string &value)
whether the given string is a valid list of ids for an edge or vehicle type (empty aren't allowed)
struct for Netedit parameters
const bool centerAfterCreation
center view after creation
~NeteditParameters()
destructor
NeteditParameters()
default constructor