Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
GNEStop.cpp
Go to the documentation of this file.
1/****************************************************************************/
2// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo
3// Copyright (C) 2001-2025 German Aerospace Center (DLR) and others.
4// This program and the accompanying materials are made available under the
5// terms of the Eclipse Public License 2.0 which is available at
6// https://www.eclipse.org/legal/epl-2.0/
7// This Source Code may also be made available under the following Secondary
8// Licenses when the conditions for such availability set forth in the Eclipse
9// Public License 2.0 are satisfied: GNU General Public License, version 2
10// or later which is available at
11// https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html
12// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later
13/****************************************************************************/
18// Representation of Stops in netedit
19/****************************************************************************/
20
26#include <netedit/GNENet.h>
27#include <netedit/GNEUndoList.h>
30
31#include "GNEStop.h"
32
33// ===========================================================================
34// member method definitions
35// ===========================================================================
36#ifdef _MSC_VER
37#pragma warning(push)
38#pragma warning(disable: 4355) // mask warning about "this" in initializers
39#endif
41 GNEDemandElement(net, tag),
42 GNEDemandElementPlan(this, -1, -1),
43 myMoveElementLaneDouble(new GNEMoveElementLaneDouble(this, SUMO_ATTR_STARTPOS, startPos, SUMO_ATTR_ENDPOS, endPos, friendlyPos)),
44 myCreationIndex(myNet->getAttributeCarriers()->getStopIndex()) {
45 // enable parking for stops in parkin)gAreas
48 }
49 // set parking
52 }
53 // set waypoint speed
55 // set jump
56 (jump != -1) ? parametersSet |= STOP_JUMP_SET : parametersSet &= ~STOP_JUMP_SET;
57 // set locator sufix
59}
60
61
63 const SUMOVehicleParameter::Stop& stopParameter) :
64 GNEDemandElement(stopParent, tag),
65 SUMOVehicleParameter::Stop(stopParameter),
66 GNEDemandElementPlan(this, -1, -1),
67 myMoveElementLaneDouble(new GNEMoveElementLaneDouble(this, SUMO_ATTR_STARTPOS, startPos, SUMO_ATTR_ENDPOS, endPos, friendlyPos)),
68 myCreationIndex(myNet->getAttributeCarriers()->getStopIndex()) {
69 // set parents
70 setParent<GNEAdditional*>(stoppingPlace);
71 setParent<GNEDemandElement*>(stopParent);
72 // set triggered values
73 if (triggered) {
75 if (awaitedPersons.size() > 0) {
77 }
78 } else if (containerTriggered) {
81 if (awaitedPersons.size() > 0) {
83 }
84 } else if (joinTriggered) {
86 }
87 // set parking
90 }
91 // set tripID and line
92 (stopParameter.tripId.size() > 0) ? parametersSet |= STOP_TRIP_ID_SET : parametersSet &= ~STOP_TRIP_ID_SET;
93 (stopParameter.line.size() > 0) ? parametersSet |= STOP_LINE_SET : parametersSet &= ~STOP_LINE_SET;
94 stopParameter.onDemand ? parametersSet |= STOP_ONDEMAND_SET : parametersSet &= ~STOP_ONDEMAND_SET;
95 // set waypoint speed
97 // set jump
98 (jump != -1) ? parametersSet |= STOP_JUMP_SET : parametersSet &= ~STOP_JUMP_SET;
99 // set locator sufix
101}
102
103
105 const SUMOVehicleParameter::Stop& stopParameter) :
106 GNEDemandElement(stopParent, tag),
107 SUMOVehicleParameter::Stop(stopParameter),
108 GNEDemandElementPlan(this, -1, -1),
109 myMoveElementLaneDouble(new GNEMoveElementLaneDouble(this, SUMO_ATTR_STARTPOS, startPos, SUMO_ATTR_ENDPOS, endPos, friendlyPos)),
110 myCreationIndex(myNet->getAttributeCarriers()->getStopIndex()) {
111 // set parents
112 setParent<GNELane*>(lane);
113 setParent<GNEDemandElement*>(stopParent);
114 // set triggered values
115 if (triggered) {
117 if (awaitedPersons.size() > 0) {
119 }
120 } else if (containerTriggered) {
123 if (awaitedPersons.size() > 0) {
125 }
126 } else if (joinTriggered) {
128 }
129 // set parking
132 }
133 // set trigger
134 (stopParameter.tripId.size() > 0) ? parametersSet |= STOP_TRIP_ID_SET : parametersSet &= ~STOP_TRIP_ID_SET;
135 // set tripID and line
136 (stopParameter.tripId.size() > 0) ? parametersSet |= STOP_TRIP_ID_SET : parametersSet &= ~STOP_TRIP_ID_SET;
137 (stopParameter.line.size() > 0) ? parametersSet |= STOP_LINE_SET : parametersSet &= ~STOP_LINE_SET;
138 stopParameter.onDemand ? parametersSet |= STOP_ONDEMAND_SET : parametersSet &= ~STOP_ONDEMAND_SET;
139 // set waypoint speed
141 // set jump
142 (jump != -1) ? parametersSet |= STOP_JUMP_SET : parametersSet &= ~STOP_JUMP_SET;
143 // set locator sufix
145}
146#ifdef _MSC_VER
147#pragma warning(pop)
148#endif
149
151
152
157
158
161 return this;
162}
163
164
165const Parameterised*
167 return this;
168}
169
170
171void
173 device.openTag(SUMO_TAG_STOP);
174 if (getParentAdditionals().size() > 0) {
175 if (getParentAdditionals().front()->getTagProperty()->getTag() == SUMO_TAG_BUS_STOP) {
177 }
178 if (getParentAdditionals().front()->getTagProperty()->getTag() == SUMO_TAG_TRAIN_STOP) {
180 }
181 if (getParentAdditionals().front()->getTagProperty()->getTag() == SUMO_TAG_CONTAINER_STOP) {
183 }
184 if (getParentAdditionals().front()->getTagProperty()->getTag() == SUMO_TAG_CHARGING_STATION) {
186 }
187 if (getParentAdditionals().front()->getTagProperty()->getTag() == SUMO_TAG_PARKING_AREA) {
189 }
190 } else {
191 if (getParentLanes().size() > 0) {
192 device.writeAttr(SUMO_ATTR_LANE, getParentLanes().front()->getID());
193 }
194 if (startPos != INVALID_DOUBLE) {
196 }
197 if (endPos != INVALID_DOUBLE) {
199 }
200 }
201 // write rest of attributes
202 write(device, true, false);
203}
204
205
208 if (getPathStopIndex() == -1) {
210 } else if ((getParentLanes().size() > 0) && !myMoveElementLaneDouble->isMoveElementValid()) {
212 } else {
213 return Problem::OK;
214 }
215}
216
217
218std::string
220 if (getPathStopIndex() == -1) {
221 return ("Downstream stop");
222 } else if (getParentLanes().size() > 0) {
224 } else {
225 return "";
226 }
227}
228
229
230void
237
238
241 return getParentDemandElements().front()->getVClass();
242}
243
244
245const RGBColor&
247 // get inspected AC
248 const auto inspectedAC = myNet->getViewNet()->getInspectedElements().getFirstAC();
249 if (inspectedAC) {
250 // check if is a route or a vehicle
251 if ((inspectedAC->getTagProperty()->isRoute() || inspectedAC->getTagProperty()->isVehicle()) && (inspectedAC != getParentDemandElements().front())) {
252 return RGBColor::GREY;
253 }
254 } else if (myNet->getViewParent()->getStopFrame()->shown()) {
256 return RGBColor::GREY;
257 }
258 }
259 // return default color
262 } else {
264 }
265}
266
267
268void
270 // update geometry depending of parent
271 if (getParentLanes().size() > 0) {
272 // Cut shape using as delimitators fixed start position and fixed end position
274 } else if (getParentAdditionals().size() > 0) {
275 // use geometry of additional (busStop)
276 myDemandElementGeometry = getParentAdditionals().at(0)->getAdditionalGeometry();
277 }
278}
279
280
283 if (getParentLanes().size() > 0) {
284 return getParentLanes().front()->getLaneShape().positionAtOffset((startPos + endPos) / 2.0);
285 } else if (getParentAdditionals().size() > 0) {
286 return getParentAdditionals().front()->getPositionInView();
287 } else {
288 throw ProcessError(TL("Invalid Stop parent"));
289 }
290}
291
292
293std::string
295 if (getParentDemandElements().size() > 0) {
296 return getParentDemandElements().front()->getID();
297 } else if (getParentAdditionals().size() > 0) {
298 return getParentAdditionals().front()->getID();
299 } else if (getParentLanes().size() > 0) {
300 return getParentLanes().front()->getID();
301 } else {
302 throw ProcessError(TL("Invalid parent"));
303 }
304}
305
306
307double
309 return s.addSize.getExaggeration(s, this);
310}
311
312
315 Boundary b;
316 // Return Boundary depending if myMovingGeometryBoundary is initialised (important for move geometry)
317 if (getParentAdditionals().size() > 0) {
318 return getParentAdditionals().at(0)->getCenteringBoundary();
321 } else if (myDemandElementGeometry.getShape().size() > 0) {
323 } else {
325 }
326 b.grow(20);
327 return b;
328}
329
330
331void
332GNEStop::splitEdgeGeometry(const double /*splitPosition*/, const GNENetworkElement* /*originalElement*/, const GNENetworkElement* /*newElement*/, GNEUndoList* /*undoList*/) {
333 // geometry of this element cannot be splitted
334}
335
336
337void
339 // check if draw an stop for person/containers or for vehicles/routes
340 if (canDrawVehicleStop()) {
341 // get exaggeration
342 const auto exaggeration = getExaggeration(s);
343 // get lane
344 const auto& stopLane = getParentLanes().size() > 0 ? getParentLanes().front() : nullptr;
345 // get lane width
346 const double width = stopLane ? stopLane->getParentEdge()->getNBEdge()->getLaneWidth(stopLane->getIndex()) * 0.5 : exaggeration * 0.8;
347 // get detail level
348 const auto d = s.getDetailLevel(exaggeration);
349 // draw geometry only if we'rent in drawForObjectUnderCursor mode
351 // get color
353 // Add a layer matrix
355 // set Color
356 GLHelper::setColor(color);
357 // Start with the drawing of the area traslating matrix to origin
359 // draw depending if is over lane or over stoppingP
360 if (getParentLanes().size() > 0) {
361 drawStopOverLane(s, d, color, width, exaggeration);
362 } else {
363 drawStopOverStoppingPlace(d, color, width, exaggeration);
364 }
365 // pop layer matrix
367 if (s.showParkingInfo) {
368 // draw above demand elements
371 drawStopLabel(s);
373 }
374 // draw lock icon
376 // draw dotted contour
378 }
379 // calculate contour and draw dotted geometry
380 if (getParentAdditionals().size() > 0) {
381 myStopContour.calculateContourExtrudedShape(s, d, this, myDemandElementGeometry.getShape(), getType(), width, exaggeration, true, true,
382 0, nullptr, getParentAdditionals().front()->getParentLanes().front()->getParentEdge());
383 } else {
384 myStopContour.calculateContourExtrudedShape(s, d, this, myDemandElementGeometry.getShape(), getType(), width, exaggeration, true, true,
385 0, nullptr, getParentLanes().front()->getParentEdge());
386 }
387 }
388}
389
390
391void
393 const SUMOVehicleParameter::Stop& stop = *this;
394 std::string label;
395 if (stop.speed > 0) {
396 label += "waypoint";
397 } else if (stop.busstop != "") {
398 label += "busStop:" + stop.busstop;
399 } else if (stop.containerstop != "") {
400 label += "containerStop:" + stop.containerstop;
401 } else if (stop.parkingarea != "") {
402 label += "parkingArea:" + stop.parkingarea;
403 } else if (stop.chargingStation != "") {
404 label += "chargingStation:" + stop.chargingStation;
405 } else if (stop.overheadWireSegment != "") {
406 label += "overheadWireSegment:" + stop.overheadWireSegment;
407 } else {
408 label += "stop";
409 }
410 if (stop.triggered || stop.containerTriggered || stop.joinTriggered) {
411 label += " triggered:";
412 if (stop.triggered) {
413 label += "person";
414 if (!stop.awaitedPersons.empty()) {
415 label += "(" + toString(stop.awaitedPersons) + ")";
416 }
417 }
418 if (stop.containerTriggered) {
419 label += "container";
420 if (!stop.awaitedContainers.empty()) {
421 label += "(" + toString(stop.awaitedContainers) + ")";
422 }
423 }
424 if (stop.joinTriggered) {
425 label += "join";
426 if (stop.join != "") {
427 label += "(" + stop.join + ")";
428 }
429 }
430 }
431 if (stop.arrival >= 0) {
432 label += " arrival:" + time2string(stop.arrival);
433 }
434 if (stop.until >= 0) {
435 label += " until:" + time2string(stop.until);
436 }
437 if (stop.started >= 0) {
438 label += " started:" + time2string(stop.started);
439 }
440 if (stop.ended >= 0) {
441 label += " ended:" + time2string(stop.ended);
442 }
443 if (stop.duration >= 0 || stop.duration > 0) {
444 if (STEPS2TIME(stop.duration) > 3600 * 24) {
445 label += " duration:1day+";
446 } else {
447 label += " duration:" + time2string(stop.duration);
448 }
449 }
450 if (stop.actType != "") {
451 label += " actType:" + stop.actType;
452 }
454}
455
456
457void
459 // only update geometry
461}
462
463
464void
465GNEStop::drawLanePartialGL(const GUIVisualizationSettings& /*s*/, const GNESegment* /*segment*/, const double /*offsetFront*/) const {
466 // Stops don't use drawJunctionPartialGL
467}
468
469
470void
471GNEStop::drawJunctionPartialGL(const GUIVisualizationSettings& /*s*/, const GNESegment* /*segment*/, const double /*offsetFront*/) const {
472 // Stops don't use drawJunctionPartialGL
473}
474
475
476GNELane*
478 // check if stop is placed over a busStop
479 if (getParentAdditionals().size() > 0) {
480 return getParentAdditionals().front()->getParentLanes().front();
481 } else {
482 return getParentLanes().front();
483 }
484}
485
486
487GNELane*
489 // first and last path lane are the same
490 return getFirstPathLane();
491}
492
493
494std::string
496 switch (key) {
497 case SUMO_ATTR_ID:
498 return getMicrosimID();
500 if (isAttributeEnabled(key)) {
501 return time2string(duration);
502 } else {
503 return "";
504 }
505 case SUMO_ATTR_UNTIL:
506 if (isAttributeEnabled(key)) {
507 return time2string(until);
508 } else {
509 return "";
510 }
512 if (isAttributeEnabled(key)) {
513 return time2string(extension);
514 } else {
515 return "";
516 }
518 if (triggered) {
519 return "person";
520 } else if (containerTriggered) {
521 return "container";
522 } else if (joinTriggered) {
523 return "join";
524 } else {
525 return "false";
526 }
528 if (triggered) {
529 return toString(awaitedPersons);
530 } else if (containerTriggered) {
532 } else {
533 return "";
534 }
535 case SUMO_ATTR_JOIN:
536 if (joinTriggered) {
537 return join;
538 } else {
539 return "";
540 }
542 return toString(permitted);
545 return "true";
546 } else {
547 return "false";
548 }
550 return actType;
552 return tripId;
553 case SUMO_ATTR_LINE:
554 return line;
556 return toString(onDemand);
557 case SUMO_ATTR_JUMP:
559 return time2string(jump);
560 } else {
561 return "";
562 }
563 // only for waypoints
564 case SUMO_ATTR_SPEED:
565 return toString(speed);
566 // specific of Stops over stoppingPlaces
572 return getParentAdditionals().front()->getID();
573 // specific of stops over lanes
575 if (posLat == INVALID_DOUBLE) {
576 return "";
577 } else {
578 return toString(posLat);
579 }
580 case SUMO_ATTR_SPLIT:
581 return split;
582 //
583 case GNE_ATTR_PARENT:
584 return getParentDemandElements().front()->getID();
585 case GNE_ATTR_STOPINDEX: {
586 // extract all stops of demandElement parent
587 std::vector<GNEDemandElement*> stops;
588 for (const auto& parent : getParentDemandElements().front()->getChildDemandElements()) {
589 if (parent->getTagProperty()->isVehicleStop()) {
590 stops.push_back(parent);
591 }
592 }
593 // find index in stops
594 for (int i = 0; i < (int)stops.size(); i++) {
595 if (stops.at(i) == this) {
596 return toString(i);
597 }
598 }
599 return "invalid index";
600 }
602 return toString(getPathStopIndex());
603 default:
605 }
606}
607
608
609double
611 switch (key) {
612 case SUMO_ATTR_INDEX: // for writting sorted
613 return (double)myCreationIndex;
614 case GNE_ATTR_STOPINDEX: {
615 // extract all stops of demandElement parent
616 std::vector<GNEDemandElement*> stops, filteredStops;
617 for (const auto& parent : getParentDemandElements().front()->getChildDemandElements()) {
618 if (parent->getTagProperty()->isVehicleStop()) {
619 stops.push_back(parent);
620 }
621 }
622 // now filter stops with the same startPos
623 for (const auto& stop : stops) {
624 if (stop->getAttributeDouble(SUMO_ATTR_STARTPOS) == getAttributeDouble(SUMO_ATTR_STARTPOS)) {
625 filteredStops.push_back(stop);
626 }
627 }
628 // get index
629 for (int i = 0; i < (int)filteredStops.size(); i++) {
630 if (filteredStops.at(i) == this) {
631 return i;
632 }
633 }
634 return 0;
635 }
637 return (double)getPathStopIndex();
638 default:
640 }
641}
642
643
646 switch (key) {
648 if (getParentAdditionals().size() > 0) {
649 // return first position of busStop
650 return getParentAdditionals().front()->getAdditionalGeometry().getShape().front();
651 } else {
652 // get lane shape
653 const PositionVector& laneShape = getLastPathLane()->getLaneShape();
654 // continue depending of arrival position
655 if (endPos == 0) {
656 return laneShape.front();
657 } else if ((endPos == -1) || (endPos >= laneShape.length2D())) {
658 return laneShape.back();
659 } else {
660 return laneShape.positionAtOffset2D(endPos);
661 }
662 }
663 }
664 default:
665 return getCommonAttributePosition(key);
666 }
667}
668
669
670void
671GNEStop::setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList) {
672 if (value == getAttribute(key)) {
673 return; //avoid needless changes, later logic relies on the fact that attributes have changed
674 }
675 switch (key) {
677 case SUMO_ATTR_UNTIL:
681 case SUMO_ATTR_JOIN:
686 case SUMO_ATTR_LINE:
688 case SUMO_ATTR_JUMP:
689 // only for waypoints
690 case SUMO_ATTR_SPEED:
691 // specific of Stops over stoppingPlaces
697 // specific of stops over lanes
699 case SUMO_ATTR_SPLIT:
700 // other
701 case GNE_ATTR_PARENT:
702 GNEChange_Attribute::changeAttribute(this, key, value, undoList);
703 break;
704 default:
705 myMoveElementLaneDouble->setMovingAttribute(key, value, undoList);
706 break;
707 }
708}
709
710
711bool
712GNEStop::isValid(SumoXMLAttr key, const std::string& value) {
713 // declare string error
714 std::string error;
715 switch (key) {
717 case SUMO_ATTR_UNTIL:
719 if (canParse<SUMOTime>(value)) {
720 return parse<SUMOTime>(value) >= 0;
721 } else {
722 return false;
723 }
724 case SUMO_ATTR_TRIGGERED: {
725 const auto expectedValues = myTagProperty->getAttributeProperties(key)->getDiscreteValues();
726 const auto triggeredValues = parse<std::vector<std::string> >(value);
727 for (const auto& triggeredValue : triggeredValues) {
728 if (std::find(expectedValues.begin(), expectedValues.end(), triggeredValue) == expectedValues.end()) {
729 return false;
730 }
731 }
732 return true;
733 }
735 if (value.empty()) {
736 return false;
737 } else {
738 const std::vector<std::string> expectedValues = parse<std::vector<std::string> >(value);
739 for (const auto& expectedValue : expectedValues) {
740 if (!SUMOXMLDefinitions::isValidVehicleID(expectedValue)) {
741 return false;
742 }
743 }
744 return true;
745 }
746 case SUMO_ATTR_JOIN:
747 if (value.empty()) {
748 return false;
749 } else {
751 }
752 case SUMO_ATTR_PERMITTED: {
753 const std::vector<std::string> expectedValues = parse<std::vector<std::string> >(value);
754 for (const auto& expectedValue : expectedValues) {
755 if (!SUMOXMLDefinitions::isValidVehicleID(expectedValue)) {
756 return false;
757 }
758 }
759 return true;
760 }
761 case SUMO_ATTR_PARKING: {
762 if (value == "opportunistic") {
763 return false; // Currrently deactivated opportunistic in netedit waiting for the implementation in SUMO
764 }
765 const auto expectedValues = myTagProperty->getAttributeProperties(key)->getDiscreteValues();
766 const auto triggeredValues = parse<std::vector<std::string> >(value);
767 for (const auto& triggeredValue : triggeredValues) {
768 if (std::find(expectedValues.begin(), expectedValues.end(), triggeredValue) == expectedValues.end()) {
769 return false;
770 }
771 }
772 return true;
773 }
775 return true;
778 case SUMO_ATTR_LINE:
779 return true;
781 return canParse<bool>(value);
782 case SUMO_ATTR_JUMP:
783 if ((value == "-1") || (value.empty())) {
784 return true;
785 } else if (canParse<double>(value)) {
786 return parse<double>(value) >= 0;
787 } else {
788 return false;
789 }
790 // only for waypoints
791 case SUMO_ATTR_SPEED:
792 if (canParse<double>(value)) {
793 return (parse<double>(value) >= 0);
794 } else {
795 return false;
796 }
797 // specific of Stops over stoppingPlaces
799 return (myNet->getAttributeCarriers()->retrieveAdditional(SUMO_TAG_BUS_STOP, value, false) != nullptr);
801 return (myNet->getAttributeCarriers()->retrieveAdditional(SUMO_TAG_TRAIN_STOP, value, false) != nullptr);
803 return (myNet->getAttributeCarriers()->retrieveAdditional(SUMO_TAG_CONTAINER_STOP, value, false) != nullptr);
805 return (myNet->getAttributeCarriers()->retrieveAdditional(SUMO_TAG_CHARGING_STATION, value, false) != nullptr);
807 return (myNet->getAttributeCarriers()->retrieveAdditional(SUMO_TAG_PARKING_AREA, value, false) != nullptr);
808 // specific of stops over lanes
810 if (value.empty()) {
811 return true;
812 } else {
813 return canParse<double>(value);
814 }
815 case SUMO_ATTR_SPLIT:
816 if (value.empty()) {
817 return true;
818 } else {
820 }
821 //
822 case GNE_ATTR_PARENT:
823 return false;
824 default:
826 }
827}
828
829
830void
832 switch (key) {
834 case SUMO_ATTR_UNTIL:
836 undoList->add(new GNEChange_ToggleAttribute(this, key, true), true);
837 break;
838 default:
839 throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'");
840 }
841}
842
843
844void
846 switch (key) {
848 case SUMO_ATTR_UNTIL:
850 undoList->add(new GNEChange_ToggleAttribute(this, key, false), true);
851 break;
852 default:
853 throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'");
854 }
855}
856
857
858bool
860 switch (key) {
861 // Currently stops parents cannot be edited
867 return false;
869 return (parametersSet & STOP_DURATION_SET) != 0;
870 case SUMO_ATTR_UNTIL:
871 return (parametersSet & STOP_UNTIL_SET) != 0;
873 return (parametersSet & STOP_EXTENSION_SET) != 0;
876 case SUMO_ATTR_JOIN:
877 return joinTriggered;
879 // for stops/waypoints over parking areas, always enabled
881 return false;
882 } else {
883 return true;
884 }
885 default:
886 return true;
887 }
888}
889
890
891std::string
893 return getTagStr();
894}
895
896
897std::string
899 if (getParentAdditionals().size() > 0) {
900 if (getParentAdditionals().front()->getTagProperty()->getTag() == SUMO_TAG_BUS_STOP) {
901 return "BusStop: " + getParentAdditionals().front()->getID();
902 } else if (getParentAdditionals().front()->getTagProperty()->getTag() == SUMO_TAG_TRAIN_STOP) {
903 return "TrainStop: " + getParentAdditionals().front()->getID();
904 } else if (getParentAdditionals().front()->getTagProperty()->getTag() == SUMO_TAG_CONTAINER_STOP) {
905 return "containerStop: " + getParentAdditionals().front()->getID();
906 } else if (getParentAdditionals().front()->getTagProperty()->getTag() == SUMO_TAG_CHARGING_STATION) {
907 return "chargingStation: " + getParentAdditionals().front()->getID();
908 } else {
909 return "parkingArea: " + getParentAdditionals().front()->getID();
910 }
911 } else if (getParentLanes().size() > 0) {
912 return "lane: " + getParentLanes().front()->getID();
913 } else {
914 return "";
915 }
916}
917
918
919double
921 double fixedPos = startPos;
922 const double len = getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength();
923 if (fixedPos < 0) {
924 fixedPos += len;
925 }
926 return fixedPos * getParentLanes().front()->getLengthGeometryFactor();
927}
928
929
930double
932 double fixedPos = endPos;
933 const double len = getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength();
934 if (fixedPos < 0) {
935 fixedPos += len;
936 }
937 return fixedPos * getParentLanes().front()->getLengthGeometryFactor();
938}
939
940// ===========================================================================
941// protected
942// ===========================================================================
943
944bool
946 const auto& inspectedElements = myNet->getViewNet()->getInspectedElements();
948 return true;
949 } else if (inspectedElements.isACInspected(this)) {
950 return true;
951 } else if (inspectedElements.isACInspected(getParentDemandElements().front())) {
952 return true;
954 return true;
955 } else if ((getParentDemandElements().front()->getTagProperty()->getTag() == GNE_TAG_VEHICLE_WITHROUTE) ||
957 if (inspectedElements.isACInspected(getParentDemandElements().front()->getChildDemandElements().front())) {
958 return true;
959 } else {
960 return false;
961 }
962 } else {
963 return false;
964 }
965}
966
967
968bool
970 // get stop frame
971 const auto stopFrame = myNet->getViewParent()->getStopFrame();
972 // check conditions
974 return true;
975 } else if (stopFrame->shown() && (stopFrame->getStopParentSelector()->getCurrentDemandElement() == getParentDemandElements().front())) {
976 return true;
977 } else {
978 return false;
979 }
980}
981
982
983
984void
986 const double width, const double exaggeration) const {
987 // Draw top and bot lines using shape, shapeRotations, shapeLengths and value of exaggeration
991 exaggeration * 0.1, 0, width);
995 exaggeration * 0.1, 0, width * -1);
996 // Add a detail matrix
998 // move to geometry front
999 glTranslated(myDemandElementGeometry.getShape().back().x(), myDemandElementGeometry.getShape().back().y(), 0.1);
1000 // rotate
1001 if (myDemandElementGeometry.getShapeRotations().size() > 0) {
1002 glRotated(myDemandElementGeometry.getShapeRotations().back(), 0, 0, 1);
1003 }
1004 // move again
1005 glTranslated(0, exaggeration * 0.5, 0);
1006 // draw stop front
1007 GLHelper::drawBoxLine(Position(0, 0), 0, exaggeration * 0.5, width);
1008 // move to symbol position
1009 glTranslated(0, 1, 0.1);
1010 // draw text depending of detail
1012 // draw symbol
1013 GLHelper::drawText(myTagProperty->isVehicleWaypoint() ? "W" : "S", Position(), .1, 2.8, color, 180);
1014 // move to subtitle position
1015 glTranslated(0, 1.4, 0);
1016 // draw subtitle depending of tag
1017 GLHelper::drawText("lane", Position(), .1, 1, color, 180);
1018 // check if draw index
1019 if (drawIndex()) {
1020 // move to index position
1021 glTranslated(-2.1, -2.4, 0);
1022 glRotated(-90, 0, 0, 1);
1023 // draw index
1025 }
1026 } else {
1027 GLHelper::drawBoxLine(Position(0, 1), 0, 2, 1);
1028 }
1029 // pop detail matrix
1031 // draw geometry points
1032 drawGeometryPoints(s, d, color);
1033}
1034
1035
1036void
1038 const double width, const double exaggeration) const {
1039 // Draw the area using shape, shapeRotations, shapeLengths and value of exaggeration taked from stoppingPlace parent
1041 // only draw text if isn't being drawn for selecting
1043 // Add a detail matrix
1045 // move to geometry front
1046 glTranslated(myDemandElementGeometry.getShape().back().x(), myDemandElementGeometry.getShape().back().y(), 0.1);
1047 // rotate
1048 if (myDemandElementGeometry.getShapeRotations().size() > 0) {
1049 glRotated(myDemandElementGeometry.getShapeRotations().back(), 0, 0, 1);
1050 }
1051 // move to index position
1052 glTranslated(-1.4, exaggeration * 0.5, 0.1);
1053 glRotated(-90, 0, 0, 1);
1054 // draw index
1056 // pop detail matrix
1058 }
1059}
1060
1061// ===========================================================================
1062// private
1063// ===========================================================================
1064
1065void
1066GNEStop::setAttribute(SumoXMLAttr key, const std::string& value) {
1067 switch (key) {
1068 case SUMO_ATTR_DURATION:
1069 if (value.empty()) {
1070 toggleAttribute(key, false);
1071 } else {
1072 toggleAttribute(key, true);
1073 duration = string2time(value);
1074 }
1075 break;
1076 case SUMO_ATTR_UNTIL:
1077 if (value.empty()) {
1078 toggleAttribute(key, false);
1079 } else {
1080 toggleAttribute(key, true);
1081 until = string2time(value);
1082 }
1083 break;
1085 if (value.empty()) {
1086 toggleAttribute(key, false);
1087 } else {
1088 toggleAttribute(key, true);
1089 extension = string2time(value);
1090 }
1091 break;
1093 // reset all flags
1094 triggered = false;
1095 containerTriggered = false;
1096 joinTriggered = false;
1097 // disable all flags
1098 parametersSet &= ~STOP_JOIN_SET;
1099 parametersSet &= ~STOP_TRIGGER_SET;
1100 parametersSet &= ~STOP_EXPECTED_SET;
1101 parametersSet &= ~STOP_CONTAINER_TRIGGER_SET;
1102 parametersSet &= ~STOP_EXPECTED_CONTAINERS_SET;
1103 // check value
1104 if ((value == "person") || (value == "true")) {
1106 triggered = true;
1107 if (awaitedPersons.size() > 0) {
1109 }
1110 } else if (value == "container") {
1113 containerTriggered = true;
1114 if (awaitedPersons.size() > 0) {
1116 }
1117 } else if (value == "join") {
1119 joinTriggered = true;
1120 }
1121 break;
1122 case SUMO_ATTR_EXPECTED:
1123 if (triggered) {
1124 awaitedPersons = parse<std::set<std::string> >(value);
1125 if (awaitedPersons.size() > 0) {
1127 } else {
1128 parametersSet &= ~STOP_EXPECTED_SET;
1129 }
1130 } else if (containerTriggered) {
1131 awaitedContainers = parse<std::set<std::string> >(value);
1132 if (awaitedContainers.size() > 0) {
1134 } else {
1135 parametersSet &= ~STOP_EXPECTED_CONTAINERS_SET;
1136 }
1137 }
1138 break;
1139 case SUMO_ATTR_JOIN:
1140 if (joinTriggered) {
1141 join = value;
1142 if (join.size() > 0) {
1144 } else {
1145 parametersSet &= ~STOP_JOIN_SET;
1146 }
1147 }
1148 break;
1150 if (value.empty()) {
1151 parametersSet &= ~STOP_PERMITTED_SET;
1152 } else {
1154 permitted = parse<std::set<std::string> >(value);
1155 }
1156 break;
1157 case SUMO_ATTR_PARKING:
1160 parametersSet &= ~STOP_PARKING_SET;
1161 } else {
1163 }
1164 break;
1165 case SUMO_ATTR_ACTTYPE:
1166 actType = value;
1167 break;
1168 case SUMO_ATTR_TRIP_ID:
1169 tripId = value;
1170 toggleAttribute(key, (value.size() > 0));
1171 break;
1172 case SUMO_ATTR_LINE:
1173 line = value;
1174 toggleAttribute(key, (value.size() > 0));
1175 break;
1176 case SUMO_ATTR_ONDEMAND:
1177 if (parse<bool>(value)) {
1179 } else {
1180 parametersSet &= ~STOP_ONDEMAND_SET;
1181 }
1182 // set flag
1184 break;
1185 case SUMO_ATTR_JUMP:
1186 if ((value == "-1") || value.empty()) {
1187 parametersSet &= ~STOP_JUMP_SET;
1188 jump = -1;
1189 } else {
1191 jump = string2time(value);
1192 }
1193 break;
1194 // only for waypoints
1195 case SUMO_ATTR_SPEED:
1196 speed = parse<double>(value);
1197 break;
1198 // specific of Stops over stoppingPlaces
1199 case SUMO_ATTR_BUS_STOP:
1202 break;
1206 break;
1210 break;
1214 break;
1218 break;
1219 // specific of Stops over lanes
1220 case SUMO_ATTR_LANE:
1223 break;
1225 if (value.empty()) {
1227 parametersSet &= ~STOP_POSLAT_SET;
1228 } else {
1229 posLat = parse<double>(value);
1231 }
1232 break;
1233 case SUMO_ATTR_SPLIT:
1234 split = value;
1235 if (split.size() > 0) {
1237 } else {
1238 parametersSet &= ~STOP_SPLIT_SET;
1239 }
1240 break;
1241 //
1242 case GNE_ATTR_PARENT:
1244 break;
1245 default:
1247 break;
1248 }
1249}
1250
1251
1252void
1254 switch (key) {
1255 case SUMO_ATTR_DURATION:
1256 if (value) {
1258 } else {
1259 parametersSet &= ~STOP_DURATION_SET;
1260 }
1261 break;
1262 case SUMO_ATTR_UNTIL:
1263 if (value) {
1265 } else {
1266 parametersSet &= ~STOP_UNTIL_SET;
1267 }
1268 break;
1270 if (value) {
1272 } else {
1273 parametersSet &= ~STOP_EXTENSION_SET;
1274 }
1275 break;
1276 case SUMO_ATTR_TRIP_ID:
1277 if (value) {
1279 } else {
1280 parametersSet &= ~STOP_TRIP_ID_SET;
1281 }
1282 break;
1283 case SUMO_ATTR_LINE:
1284 if (value) {
1286 } else {
1287 parametersSet &= ~STOP_LINE_SET;
1288 }
1289 break;
1290 case SUMO_ATTR_ONDEMAND:
1291 if (value) {
1293 } else {
1294 parametersSet &= ~STOP_ONDEMAND_SET;
1295 }
1296 break;
1297 default:
1298 throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'");
1299 }
1300}
1301
1302
1303void
1305 // first check that we're in move mode and shift key is pressed
1307 // calculate new color
1308 const RGBColor color = baseColor.changedBrightness(-50);
1309 // push matrix
1311 // translated to front
1312 glTranslated(0, 0, 0.1);
1313 // set color
1314 GLHelper::setColor(color);
1315 // draw points
1316 if (startPos != INVALID_DOUBLE) {
1317 // push geometry point matrix
1319 glTranslated(myDemandElementGeometry.getShape().front().x(), myDemandElementGeometry.getShape().front().y(), 0.1);
1320 // draw geometry point
1322 // pop geometry point matrix
1324 }
1325 if (endPos != INVALID_DOUBLE) {
1326 // push geometry point matrix
1328 glTranslated(myDemandElementGeometry.getShape().back().x(), myDemandElementGeometry.getShape().back().y(), 0.1);
1329 // draw geometry point
1331 // pop geometry point matrix
1333 }
1334 // pop draw matrix
1336 }
1337}
1338
1339
1340int
1342 // get edge stop indexes
1343 const auto edgeStopIndex = getEdgeStopIndex();
1344 // finally find stopIndex in edgeStopIndexes
1345 for (const auto& edgeStop : edgeStopIndex) {
1346 for (const auto& stop : edgeStop.stops) {
1347 if (stop == this) {
1348 return edgeStop.stopIndex;
1349 }
1350 }
1351 }
1352 // not found, then return -1
1353 return -1;
1354}
1355
1356
1357void
1359 if (getParentAdditionals().size() > 0) {
1360 setDemandElementID(getMicrosimID() + " (" + getParentAdditionals().front()->getTagStr() + ")");
1361 } else if (getParentLanes().size() > 0) {
1362 setDemandElementID(getMicrosimID() + " (" + getParentLanes().front()->getTagStr() + ")");
1363 }
1364}
1365
1366/****************************************************************************/
@ GLO_VEHICLELABELS
stack and flow labels (used in netedit)
#define TL(string)
Definition MsgHandler.h:304
SUMOTime string2time(const std::string &r)
convert string to SUMOTime
Definition SUMOTime.cpp:46
std::string time2string(SUMOTime t, bool humanReadable)
convert SUMOTime to string (independently of global format setting)
Definition SUMOTime.cpp:91
#define STEPS2TIME(x)
Definition SUMOTime.h:55
SUMOVehicleClass
Definition of vehicle classes to differ between different lane usage and authority types.
const int STOP_DURATION_SET
const int STOP_POSLAT_SET
const int STOP_EXPECTED_SET
const int STOP_SPEED_SET
const int STOP_UNTIL_SET
const int STOP_LINE_SET
const int STOP_PARKING_SET
const int STOP_TRIP_ID_SET
const int STOP_PERMITTED_SET
const int STOP_SPLIT_SET
const int STOP_JOIN_SET
const int STOP_CONTAINER_TRIGGER_SET
const int STOP_EXTENSION_SET
const int STOP_TRIGGER_SET
const int STOP_JUMP_SET
const int STOP_ONDEMAND_SET
const int STOP_EXPECTED_CONTAINERS_SET
SumoXMLTag
Numbers representing SUMO-XML - element names.
@ GNE_TAG_WAYPOINT_PARKINGAREA
@ GNE_TAG_STOP_PARKINGAREA
stop placed over a parking area
@ SUMO_TAG_CHARGING_STATION
A Charging Station.
@ SUMO_TAG_CONTAINER_STOP
A container stop.
@ SUMO_TAG_BUS_STOP
A bus stop.
@ SUMO_TAG_STOP
stop for vehicles
@ GNE_TAG_FLOW_WITHROUTE
description of a vehicle with an embedded route
@ SUMO_TAG_PARKING_AREA
A parking area.
@ SUMO_TAG_TRAIN_STOP
A train stop (alias for bus stop)
@ GNE_TAG_VEHICLE_WITHROUTE
description of a vehicle with an embedded route
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
@ SUMO_ATTR_STARTPOS
@ SUMO_ATTR_PARKING
@ SUMO_ATTR_EXTENSION
@ SUMO_ATTR_LANE
@ SUMO_ATTR_SPEED
@ SUMO_ATTR_CONTAINER_STOP
@ SUMO_ATTR_PARKING_AREA
@ SUMO_ATTR_BUS_STOP
@ SUMO_ATTR_TRAIN_STOP
@ SUMO_ATTR_ENDPOS
@ GNE_ATTR_PARENT
parent of an additional element
@ SUMO_ATTR_SPLIT
@ SUMO_ATTR_ACTTYPE
@ SUMO_ATTR_POSITION_LAT
@ SUMO_ATTR_EXPECTED
@ SUMO_ATTR_LINE
@ SUMO_ATTR_CHARGING_STATION
@ SUMO_ATTR_ONDEMAND
@ SUMO_ATTR_INDEX
@ SUMO_ATTR_TRIP_ID
@ SUMO_ATTR_PERMITTED
@ GNE_ATTR_STOPINDEX
stop index (position in the parent's children
@ SUMO_ATTR_JOIN
@ SUMO_ATTR_JUMP
@ GNE_ATTR_PLAN_GEOMETRY_ENDPOS
person/container geometry end position
@ SUMO_ATTR_ID
@ SUMO_ATTR_UNTIL
@ SUMO_ATTR_TRIGGERED
@ SUMO_ATTR_DURATION
@ GNE_ATTR_PATHSTOPINDEX
stop index (position in the parent's path)
const double INVALID_DOUBLE
invalid double
Definition StdDefs.h:68
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
Definition ToString.h:46
A class that stores a 2D geometrical boundary.
Definition Boundary.h:39
void add(double x, double y, double z=0)
Makes the boundary include the given coordinate.
Definition Boundary.cpp:75
bool isInitialised() const
check if Boundary is Initialised
Definition Boundary.cpp:256
Boundary & grow(double by)
extends the boundary by the given amount
Definition Boundary.cpp:340
static void setColor(const RGBColor &c)
Sets the gl-color to this value.
Definition GLHelper.cpp:649
static void popMatrix()
pop matrix
Definition GLHelper.cpp:131
static void drawBoxLines(const PositionVector &geom, const std::vector< double > &rots, const std::vector< double > &lengths, double width, int cornerDetail=0, double offset=0)
Draws thick lines.
Definition GLHelper.cpp:348
static void drawBoxLine(const Position &beg, double rot, double visLength, double width, double offset=0)
Draws a thick line.
Definition GLHelper.cpp:296
static void drawFilledCircleDetailled(const GUIVisualizationSettings::Detail d, const double radius)
Draws a filled circle around (0,0) depending of level of detail.
Definition GLHelper.cpp:534
static void pushMatrix()
push matrix
Definition GLHelper.cpp:118
static void drawText(const std::string &text, const Position &pos, const double layer, const double size, const RGBColor &col=RGBColor::BLACK, const double angle=0, const int align=0, double width=-1)
Definition GLHelper.cpp:742
static void drawTextSettings(const GUIVisualizationTextSettings &settings, const std::string &text, const Position &pos, const double scale, const double angle=0, const double layer=2048, const int align=0)
Definition GLHelper.cpp:773
bool drawMovingGeometryPoints() const
check if draw moving geometry points
bool isAttributeCarrierSelected() const
check if attribute carrier is selected
const std::string getID() const override
get ID (all Attribute Carriers have one)
const std::string & getTagStr() const
get tag assigned to this object in string format
bool drawUsingSelectColor() const
check if attribute carrier must be drawn using selecting color.
void drawInLayer(const double typeOrLayer, const double extraOffset=0) const
draw element in the given layer, or in front if corresponding flag is enabled
Position getCommonAttributePosition(SumoXMLAttr key) const
friend class GNEChange_ToggleAttribute
const GNETagProperties * getTagProperty() const
get tagProperty associated with this Attribute Carrier
GNENet * myNet
pointer to net
const GNETagProperties * myTagProperty
reference to tagProperty associated with this attribute carrier
static void changeAttribute(GNEAttributeCarrier *AC, SumoXMLAttr key, const std::string &value, GNEUndoList *undoList, const bool force=false)
change attribute
void calculateContourExtrudedShape(const GUIVisualizationSettings &s, const GUIVisualizationSettings::Detail d, const GUIGlObject *glObject, const PositionVector &shape, const double layer, const double extrusionWidth, const double scale, const bool closeFirstExtrem, const bool closeLastExtrem, const double offset, const GNESegment *segment, const GUIGlObject *boundaryParent, const bool addToSelectedObjects=true) const
calculate contour extruded (used in elements formed by a central shape)
bool drawDottedContours(const GUIVisualizationSettings &s, const GUIVisualizationSettings::Detail d, const GNEAttributeCarrier *AC, const double lineWidth, const bool addOffset) const
draw dotted contours (basics, select, delete, inspect...)
GUIGeometry myDemandElementGeometry
demand element geometry (also called "stacked geometry")
void replaceFirstParentAdditional(SumoXMLTag tag, const std::string &value)
replace the first parent additional
void setDemandElementID(const std::string &newID)
set demand element id
std::vector< EdgeStopIndex > getEdgeStopIndex() const
get edgeStopIndex
Problem
enum class for demandElement problems
void replaceFirstParentLane(const std::string &value)
replace the first parent lane
GNEDemandElement * getCurrentDemandElement() const
get current demand element
const GNEHierarchicalContainerParents< GNEAdditional * > & getParentAdditionals() const
get parent additionals
const GNEHierarchicalContainerParents< GNEDemandElement * > & getParentDemandElements() const
get parent demand elements
const GNEHierarchicalContainerParents< GNELane * > & getParentLanes() const
get parent lanes
const GNEHierarchicalContainerChildren< GNEDemandElement * > & getChildDemandElements() const
return child demand elements
const PositionVector & getLaneShape() const
get elements shape
Definition GNELane.cpp:232
double myMovingLateralOffset
move element lateral offset
std::string getMovingAttribute(SumoXMLAttr key) const override
get moving attribute
void fixMovingProblem()
fix moving problem
double getMovingAttributeDouble(SumoXMLAttr key) const override
get moving attribute double
std::string getMovingProblem() const
return a string with the current moving problem
bool isMovingAttributeValid(SumoXMLAttr key, const std::string &value) const override
check if the given moving attribute is valid
bool isMoveElementValid() const
check if current moving element is valid to be written into XML
void setMovingAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList) override
set moving attribute (using undo-list)
GNEAdditional * retrieveAdditional(SumoXMLTag type, const std::string &id, bool hardFail=true) const
Returns the named additional.
GNENetHelper::AttributeCarriers * getAttributeCarriers() const
get all attribute carriers used in this net
Definition GNENet.cpp:174
GNEViewParent * getViewParent() const
get view parent (used for simplify code)
Definition GNENet.cpp:150
GNEViewNet * getViewNet() const
get view net (used for simplify code)
Definition GNENet.cpp:144
GNEDemandElementSelector * getStopParentSelector() const
get stop parent selector
int getPathStopIndex() const
get pathStopIndex
Definition GNEStop.cpp:1341
GNEMoveElement * getMoveElement() const override
methods to retrieve the elements linked to this stop
Definition GNEStop.cpp:154
~GNEStop()
destructor
Definition GNEStop.cpp:150
void setStopMicrosimID()
set stop microsim ID
Definition GNEStop.cpp:1358
SUMOVehicleClass getVClass() const override
obtain VClass related with this demand element
Definition GNEStop.cpp:240
void disableAttribute(SumoXMLAttr key, GNEUndoList *undoList) override
Definition GNEStop.cpp:845
GNEStop(SumoXMLTag tag, GNENet *net)
default constructor
Definition GNEStop.cpp:40
bool drawIndex() const
draw index
Definition GNEStop.cpp:969
GNEMoveElementLaneDouble * myMoveElementLaneDouble
move element lane double
Definition GNEStop.h:221
GNEContour myStopContour
variable used for draw contours
Definition GNEStop.h:224
Position getPositionInView() const override
Returns position of demand element in view.
Definition GNEStop.cpp:282
std::string getAttribute(SumoXMLAttr key) const override
inherited from GNEAttributeCarrier
Definition GNEStop.cpp:495
double getExaggeration(const GUIVisualizationSettings &s) const override
return exaggeration associated with this GLObject
Definition GNEStop.cpp:308
void writeDemandElement(OutputDevice &device) const override
write demand element element into a xml file
Definition GNEStop.cpp:172
GNELane * getFirstPathLane() const override
get first path lane
Definition GNEStop.cpp:477
Boundary myMovingGeometryBoundary
boundary used during moving of elements (to avoid insertion in RTREE)
Definition GNEStop.h:227
void drawStopOverStoppingPlace(const GUIVisualizationSettings::Detail d, const RGBColor &color, const double width, const double exaggeration) const
draw stop over stoppingPlace
Definition GNEStop.cpp:1037
Boundary getCenteringBoundary() const override
Returns the boundary to which the view shall be centered in order to show the object.
Definition GNEStop.cpp:314
void drawGL(const GUIVisualizationSettings &s) const override
Draws the object.
Definition GNEStop.cpp:338
void computePathElement() override
compute pathElement
Definition GNEStop.cpp:458
void drawStopOverLane(const GUIVisualizationSettings &s, const GUIVisualizationSettings::Detail d, const RGBColor &color, const double width, const double exaggeration) const
draw stop over lane
Definition GNEStop.cpp:985
void drawJunctionPartialGL(const GUIVisualizationSettings &s, const GNESegment *segment, const double offsetFront) const override
Draws partial object over junction.
Definition GNEStop.cpp:471
Problem isDemandElementValid() const override
check if current demand element is valid to be written into XML (by default true, can be reimplemente...
Definition GNEStop.cpp:207
double getAttributeDouble(SumoXMLAttr key) const override
Definition GNEStop.cpp:610
Parameterised * getParameters() override
get parameters associated with this stop
Definition GNEStop.cpp:160
void drawStopLabel(const GUIVisualizationSettings &s) const
Definition GNEStop.cpp:392
std::string getDemandElementProblem() const override
return a string with the current demand element problem (by default empty, can be reimplemented in ch...
Definition GNEStop.cpp:219
void toggleAttribute(SumoXMLAttr key, const bool value) override
method for enable or disable the attribute and nothing else (used in GNEChange_ToggleAttribute)
Definition GNEStop.cpp:1253
void enableAttribute(SumoXMLAttr key, GNEUndoList *undoList) override
Definition GNEStop.cpp:831
bool isValid(SumoXMLAttr key, const std::string &value) override
Definition GNEStop.cpp:712
void updateGeometry() override
update pre-computed geometry information
Definition GNEStop.cpp:269
std::string getHierarchyName() const override
get Hierarchy Name (Used in AC Hierarchy)
Definition GNEStop.cpp:898
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList) override
Definition GNEStop.cpp:671
void splitEdgeGeometry(const double splitPosition, const GNENetworkElement *originalElement, const GNENetworkElement *newElement, GNEUndoList *undoList) override
split geometry
Definition GNEStop.cpp:332
const int myCreationIndex
creation index (using for saving sorted)
Definition GNEStop.h:239
Position getAttributePosition(SumoXMLAttr key) const override
Definition GNEStop.cpp:645
double getStartGeometryPositionOverLane() const
get start position over lane that is applicable to the shape
Definition GNEStop.cpp:920
void drawGeometryPoints(const GUIVisualizationSettings &s, const GUIVisualizationSettings::Detail d, const RGBColor &baseColor) const
draw geometry points
Definition GNEStop.cpp:1304
bool canDrawVehicleStop() const
check if vehicle stop can be draw
Definition GNEStop.cpp:945
void fixDemandElementProblem() override
fix demand element problem (by default throw an exception, has to be reimplemented in children)
Definition GNEStop.cpp:231
GNELane * getLastPathLane() const override
get last path lane
Definition GNEStop.cpp:488
std::string getPopUpID() const override
get PopPup ID (Used in AC Hierarchy)
Definition GNEStop.cpp:892
double getEndGeometryPositionOverLane() const
get end position over lane that is applicable to the shape
Definition GNEStop.cpp:931
bool isAttributeEnabled(SumoXMLAttr key) const override
Definition GNEStop.cpp:859
std::string getParentName() const override
Returns the name of the parent object.
Definition GNEStop.cpp:294
void drawLanePartialGL(const GUIVisualizationSettings &s, const GNESegment *segment, const double offsetFront) const override
Draws partial object over lane.
Definition GNEStop.cpp:465
const RGBColor & getColor() const override
get color
Definition GNEStop.cpp:246
SumoXMLTag getTag() const
get Tag vinculated with this attribute Property
bool isVehicleWaypoint() const
return true if tag correspond to a vehicle waypoint element
const std::vector< const GNEAttributeProperties * > & getAttributeProperties() const
get all attribute properties
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...
bool isACInspected(GNEAttributeCarrier *AC) const
GNEAttributeCarrier * getFirstAC() const
GNEViewNetHelper::InspectedElements & getInspectedElements()
get inspected elements
const GNEViewNetHelper::DemandViewOptions & getDemandViewOptions() const
get demand view options
GNEStopFrame * getStopFrame() const
get frame for DEMAND_STOP
const std::vector< double > & getShapeRotations() const
The rotations of the single shape parts.
static void drawGeometry(const GUIVisualizationSettings::Detail d, const GUIGeometry &geometry, const double width, double offset=0)
draw geometry
const PositionVector & getShape() const
The shape of the additional element.
void updateGeometry(const PositionVector &shape)
update entire geometry
const std::vector< double > & getShapeLengths() const
The lengths of the single shape parts.
const std::string & getMicrosimID() const
Returns the id of the object as known to microsim.
GUIGlObjectType getType() const
Returns the type of the object as coded in GUIGlObjectType.
const GUIVisualizationSettings & getVisualisationSettings() const
get visualization settings (read only)
Stores the information about how to visualize structures.
GUIVisualizationSizeSettings addSize
bool checkDrawAdditional(Detail d, const bool selected) const
check if draw additionals
bool showParkingInfo
Set whether parking related information should be shown.
Detail getDetailLevel(const double exaggeration) const
return the detail level
GUIVisualizationColorSettings colorSettings
color settings
GUIVisualizationDottedContourSettings dottedContourSettings
dotted contour settings
double scale
information about a lane's width (temporary, used for a single view)
GUIVisualizationTextSettings vehicleText
GUIVisualizationNeteditSizeSettings neteditSizeSettings
netedit size settings
double angle
The current view rotation angle.
Static storage of an output device and its base (abstract) implementation.
OutputDevice & writeAttr(const SumoXMLAttr attr, const T &val)
writes a named attribute
OutputDevice & openTag(const std::string &xmlElement)
Opens an XML tag.
An upper class for objects with additional parameters.
A point in 2D or 3D with translation and scaling methods.
Definition Position.h:37
A list of positions.
double length2D() const
Returns the length.
Boundary getBoxBoundary() const
Returns a boundary enclosing this list of lines.
Position positionAtOffset2D(double pos, double lateralOffset=0, bool extrapolateBeyond=false) const
Returns the position at the given length.
static const RGBColor GREY
Definition RGBColor.h:197
RGBColor changedBrightness(int change, int toChange=3) const
Returns a new color with altered brightness.
Definition RGBColor.cpp:200
Definition of vehicle stop (position and duration)
SUMOTime started
the time at which this stop was reached
ParkingType parking
whether the vehicle is removed from the net while stopping
std::string lane
The lane to stop at.
SUMOTime extension
The maximum time extension for boarding / loading.
double speed
the speed at which this stop counts as reached (waypoint mode)
std::string parkingarea
(Optional) parking area if one is assigned to the stop
std::string split
the id of the vehicle (train portion) that splits of upon reaching this stop
double startPos
The stopping position start.
std::string line
the new line id of the trip within a cyclical public transport route
double posLat
the lateral offset when stopping
bool onDemand
whether the stop may be skipped
std::string chargingStation
(Optional) charging station if one is assigned to the stop
std::string overheadWireSegment
(Optional) overhead line segment if one is assigned to the stop
std::set< std::string > permitted
IDs of persons or containers that may board/load at this stop.
int parametersSet
Information for the output which parameter were set.
SUMOTime jump
transfer time if there shall be a jump from this stop to the next route edge
std::string join
the id of the vehicle (train portion) to which this vehicle shall be joined
SUMOTime until
The time at which the vehicle may continue its journey.
std::string actType
act Type (only used by Persons) (used by netedit)
bool triggered
whether an arriving person lets the vehicle continue
void write(OutputDevice &dev, const bool close=true, const bool writeTagAndParents=true) const
Writes the stop as XML.
SUMOTime ended
the time at which this stop was ended
double endPos
The stopping position end.
std::set< std::string > awaitedPersons
IDs of persons the vehicle has to wait for until departing.
std::set< std::string > awaitedContainers
IDs of containers the vehicle has to wait for until departing.
std::string busstop
(Optional) bus stop if one is assigned to the stop
bool joinTriggered
whether an joined vehicle lets this vehicle continue
std::string tripId
id of the trip within a cyclical public transport route
std::string containerstop
(Optional) container stop if one is assigned to the stop
bool containerTriggered
whether an arriving container lets the vehicle continue
SUMOTime arrival
The (expected) time at which the vehicle reaches the stop.
SUMOTime duration
The stopping duration.
Structure representing possible vehicle parameter.
static ParkingType parseParkingType(const std::string &value)
parses parking type value
static bool isValidVehicleID(const std::string &value)
whether the given string is a valid id for a vehicle or flow
Definition of vehicle stop (position and duration)
bool showAllTrips() const
check if trips has to be drawn
static void drawLockIcon(const GUIVisualizationSettings::Detail d, const GNEAttributeCarrier *AC, GUIGlObjectType type, const Position position, const double exaggeration, const double size=0.5, const double offsetx=0, const double offsety=0)
draw lock icon
RGBColor selectedRouteColor
route selection color (used for routes and vehicle stops)
RGBColor waypointColor
color for Waypoints
static const double segmentWidth
width of dotted contour segments
static const double additionalGeometryPointRadius
moving additional geometry point radius
double getExaggeration(const GUIVisualizationSettings &s, const GUIGlObject *o, double factor=20) const
return the drawing size including exaggeration and constantSize values