Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
GNEDemandElementPlan.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-2024 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// An auxiliar, asbtract class for plan elements
19/****************************************************************************/
20
23#include <netedit/GNENet.h>
24#include <netedit/GNESegment.h>
25#include <netedit/GNEUndoList.h>
26#include <netedit/GNEViewNet.h>
29
31#include "GNERoute.h"
32
33// ===========================================================================
34// static definitions
35// ===========================================================================
36
38
39// ===========================================================================
40// GNEDemandElement method definitions
41// ===========================================================================
42
43std::pair<SumoXMLTag, GUIIcon>
45 if (planParameters.isSingleEdgePlan()) {
46 return std::make_pair(GNE_TAG_WALK_EDGE_EDGE, GUIIcon::WALK_EDGE);
47 } else if (planParameters.consecutiveEdges.size() > 0) {
48 return std::make_pair(GNE_TAG_WALK_EDGES, GUIIcon::WALK_EDGES);
49 } else if (!planParameters.toRoute.empty()) {
50 return std::make_pair(GNE_TAG_WALK_ROUTE, GUIIcon::WALK_ROUTE);
51 } else if (!planParameters.fromEdge.empty()) {
52 if (!planParameters.toEdge.empty()) {
53 return std::make_pair(GNE_TAG_WALK_EDGE_EDGE, GUIIcon::WALK_EDGE);
54 } else if (!planParameters.toTAZ.empty()) {
55 return std::make_pair(GNE_TAG_WALK_EDGE_TAZ, GUIIcon::WALK_TAZ);
56 } else if (!planParameters.toJunction.empty()) {
58 } else if (!planParameters.toBusStop.empty()) {
60 } else if (!planParameters.toTrainStop.empty()) {
62 } else if (!planParameters.toContainerStop.empty()) {
64 } else if (!planParameters.toChargingStation.empty()) {
66 } else if (!planParameters.toParkingArea.empty()) {
68 } else {
69 return std::make_pair(SUMO_TAG_NOTHING, GUIIcon::EMPTY);
70 }
71 } else if (!planParameters.fromTAZ.empty()) {
72 if (!planParameters.toEdge.empty()) {
73 return std::make_pair(GNE_TAG_WALK_TAZ_EDGE, GUIIcon::WALK_EDGE);
74 } else if (!planParameters.toTAZ.empty()) {
75 return std::make_pair(GNE_TAG_WALK_TAZ_TAZ, GUIIcon::WALK_TAZ);
76 } else if (!planParameters.toJunction.empty()) {
78 } else if (!planParameters.toBusStop.empty()) {
79 return std::make_pair(GNE_TAG_WALK_TAZ_BUSSTOP, GUIIcon::WALK_BUSSTOP);
80 } else if (!planParameters.toTrainStop.empty()) {
82 } else if (!planParameters.toContainerStop.empty()) {
84 } else if (!planParameters.toChargingStation.empty()) {
86 } else if (!planParameters.toParkingArea.empty()) {
88 } else {
89 return std::make_pair(SUMO_TAG_NOTHING, GUIIcon::EMPTY);
90 }
91 } else if (!planParameters.fromJunction.empty()) {
92 if (!planParameters.toEdge.empty()) {
93 return std::make_pair(GNE_TAG_WALK_JUNCTION_EDGE, GUIIcon::WALK_EDGE);
94 } else if (!planParameters.toTAZ.empty()) {
95 return std::make_pair(GNE_TAG_WALK_JUNCTION_TAZ, GUIIcon::WALK_TAZ);
96 } else if (!planParameters.toJunction.empty()) {
98 } else if (!planParameters.toBusStop.empty()) {
100 } else if (!planParameters.toTrainStop.empty()) {
102 } else if (!planParameters.toContainerStop.empty()) {
104 } else if (!planParameters.toChargingStation.empty()) {
106 } else if (!planParameters.toParkingArea.empty()) {
108 } else {
109 return std::make_pair(SUMO_TAG_NOTHING, GUIIcon::EMPTY);
110 }
111 } else if (!planParameters.fromBusStop.empty()) {
112 if (!planParameters.toEdge.empty()) {
113 return std::make_pair(GNE_TAG_WALK_BUSSTOP_EDGE, GUIIcon::WALK_EDGE);
114 } else if (!planParameters.toTAZ.empty()) {
115 return std::make_pair(GNE_TAG_WALK_BUSSTOP_TAZ, GUIIcon::WALK_TAZ);
116 } else if (!planParameters.toJunction.empty()) {
118 } else if (!planParameters.toBusStop.empty()) {
120 } else if (!planParameters.toTrainStop.empty()) {
122 } else if (!planParameters.toContainerStop.empty()) {
124 } else if (!planParameters.toChargingStation.empty()) {
126 } else if (!planParameters.toParkingArea.empty()) {
128 } else {
129 return std::make_pair(SUMO_TAG_NOTHING, GUIIcon::EMPTY);
130 }
131 } else if (!planParameters.fromTrainStop.empty()) {
132 if (!planParameters.toEdge.empty()) {
133 return std::make_pair(GNE_TAG_WALK_TRAINSTOP_EDGE, GUIIcon::WALK_EDGE);
134 } else if (!planParameters.toTAZ.empty()) {
135 return std::make_pair(GNE_TAG_WALK_TRAINSTOP_TAZ, GUIIcon::WALK_TAZ);
136 } else if (!planParameters.toJunction.empty()) {
138 } else if (!planParameters.toBusStop.empty()) {
140 } else if (!planParameters.toTrainStop.empty()) {
142 } else if (!planParameters.toContainerStop.empty()) {
144 } else if (!planParameters.toChargingStation.empty()) {
146 } else if (!planParameters.toParkingArea.empty()) {
148 } else {
149 return std::make_pair(SUMO_TAG_NOTHING, GUIIcon::EMPTY);
150 }
151 } else if (!planParameters.fromContainerStop.empty()) {
152 if (!planParameters.toEdge.empty()) {
154 } else if (!planParameters.toTAZ.empty()) {
156 } else if (!planParameters.toJunction.empty()) {
158 } else if (!planParameters.toBusStop.empty()) {
160 } else if (!planParameters.toTrainStop.empty()) {
162 } else if (!planParameters.toContainerStop.empty()) {
164 } else if (!planParameters.toChargingStation.empty()) {
166 } else if (!planParameters.toParkingArea.empty()) {
168 } else {
169 return std::make_pair(SUMO_TAG_NOTHING, GUIIcon::EMPTY);
170 }
171 } else if (!planParameters.fromChargingStation.empty()) {
172 if (!planParameters.toEdge.empty()) {
174 } else if (!planParameters.toTAZ.empty()) {
176 } else if (!planParameters.toJunction.empty()) {
178 } else if (!planParameters.toBusStop.empty()) {
180 } else if (!planParameters.toTrainStop.empty()) {
182 } else if (!planParameters.toContainerStop.empty()) {
184 } else if (!planParameters.toChargingStation.empty()) {
186 } else if (!planParameters.toParkingArea.empty()) {
188 } else {
189 return std::make_pair(SUMO_TAG_NOTHING, GUIIcon::EMPTY);
190 }
191 } else if (!planParameters.fromParkingArea.empty()) {
192 if (!planParameters.toEdge.empty()) {
194 } else if (!planParameters.toTAZ.empty()) {
195 return std::make_pair(GNE_TAG_WALK_PARKINGAREA_TAZ, GUIIcon::WALK_TAZ);
196 } else if (!planParameters.toJunction.empty()) {
198 } else if (!planParameters.toBusStop.empty()) {
200 } else if (!planParameters.toTrainStop.empty()) {
202 } else if (!planParameters.toContainerStop.empty()) {
204 } else if (!planParameters.toChargingStation.empty()) {
206 } else if (!planParameters.toParkingArea.empty()) {
208 } else {
209 return std::make_pair(SUMO_TAG_NOTHING, GUIIcon::EMPTY);
210 }
211 } else {
212 return std::make_pair(SUMO_TAG_NOTHING, GUIIcon::EMPTY);
213 }
214}
215
216
217std::pair<SumoXMLTag, GUIIcon>
219 if (planParameters.isSingleEdgePlan()) {
221 } else if (!planParameters.fromEdge.empty()) {
222 if (!planParameters.toEdge.empty()) {
224 } else if (!planParameters.toTAZ.empty()) {
226 } else if (!planParameters.toJunction.empty()) {
228 } else if (!planParameters.toBusStop.empty()) {
230 } else if (!planParameters.toTrainStop.empty()) {
232 } else if (!planParameters.toContainerStop.empty()) {
234 } else if (!planParameters.toChargingStation.empty()) {
236 } else if (!planParameters.toParkingArea.empty()) {
238 } else {
239 return std::make_pair(SUMO_TAG_NOTHING, GUIIcon::EMPTY);
240 }
241 } else if (!planParameters.fromTAZ.empty()) {
242 if (!planParameters.toEdge.empty()) {
244 } else if (!planParameters.toTAZ.empty()) {
246 } else if (!planParameters.toJunction.empty()) {
248 } else if (!planParameters.toBusStop.empty()) {
250 } else if (!planParameters.toTrainStop.empty()) {
252 } else if (!planParameters.toContainerStop.empty()) {
254 } else if (!planParameters.toChargingStation.empty()) {
256 } else if (!planParameters.toParkingArea.empty()) {
258 } else {
259 return std::make_pair(SUMO_TAG_NOTHING, GUIIcon::EMPTY);
260 }
261 } else if (!planParameters.fromJunction.empty()) {
262 if (!planParameters.toEdge.empty()) {
264 } else if (!planParameters.toTAZ.empty()) {
266 } else if (!planParameters.toJunction.empty()) {
268 } else if (!planParameters.toBusStop.empty()) {
270 } else if (!planParameters.toTrainStop.empty()) {
272 } else if (!planParameters.toContainerStop.empty()) {
274 } else if (!planParameters.toChargingStation.empty()) {
276 } else if (!planParameters.toParkingArea.empty()) {
278 } else {
279 return std::make_pair(SUMO_TAG_NOTHING, GUIIcon::EMPTY);
280 }
281 } else if (!planParameters.fromBusStop.empty()) {
282 if (!planParameters.toEdge.empty()) {
284 } else if (!planParameters.toTAZ.empty()) {
286 } else if (!planParameters.toJunction.empty()) {
288 } else if (!planParameters.toBusStop.empty()) {
290 } else if (!planParameters.toTrainStop.empty()) {
292 } else if (!planParameters.toContainerStop.empty()) {
294 } else if (!planParameters.toChargingStation.empty()) {
296 } else if (!planParameters.toParkingArea.empty()) {
298 } else {
299 return std::make_pair(SUMO_TAG_NOTHING, GUIIcon::EMPTY);
300 }
301 } else if (!planParameters.fromTrainStop.empty()) {
302 if (!planParameters.toEdge.empty()) {
304 } else if (!planParameters.toTAZ.empty()) {
306 } else if (!planParameters.toJunction.empty()) {
308 } else if (!planParameters.toBusStop.empty()) {
310 } else if (!planParameters.toTrainStop.empty()) {
312 } else if (!planParameters.toContainerStop.empty()) {
314 } else if (!planParameters.toChargingStation.empty()) {
316 } else if (!planParameters.toParkingArea.empty()) {
318 } else {
319 return std::make_pair(SUMO_TAG_NOTHING, GUIIcon::EMPTY);
320 }
321 } else if (!planParameters.fromContainerStop.empty()) {
322 if (!planParameters.toEdge.empty()) {
324 } else if (!planParameters.toTAZ.empty()) {
326 } else if (!planParameters.toJunction.empty()) {
328 } else if (!planParameters.toBusStop.empty()) {
330 } else if (!planParameters.toTrainStop.empty()) {
332 } else if (!planParameters.toContainerStop.empty()) {
334 } else if (!planParameters.toChargingStation.empty()) {
336 } else if (!planParameters.toParkingArea.empty()) {
338 } else {
339 return std::make_pair(SUMO_TAG_NOTHING, GUIIcon::EMPTY);
340 }
341 } else if (!planParameters.fromChargingStation.empty()) {
342 if (!planParameters.toEdge.empty()) {
344 } else if (!planParameters.toTAZ.empty()) {
346 } else if (!planParameters.toJunction.empty()) {
348 } else if (!planParameters.toBusStop.empty()) {
350 } else if (!planParameters.toTrainStop.empty()) {
352 } else if (!planParameters.toContainerStop.empty()) {
354 } else if (!planParameters.toChargingStation.empty()) {
356 } else if (!planParameters.toParkingArea.empty()) {
358 } else {
359 return std::make_pair(SUMO_TAG_NOTHING, GUIIcon::EMPTY);
360 }
361 } else if (!planParameters.fromParkingArea.empty()) {
362 if (!planParameters.toEdge.empty()) {
364 } else if (!planParameters.toTAZ.empty()) {
366 } else if (!planParameters.toJunction.empty()) {
368 } else if (!planParameters.toBusStop.empty()) {
370 } else if (!planParameters.toTrainStop.empty()) {
372 } else if (!planParameters.toContainerStop.empty()) {
374 } else if (!planParameters.toChargingStation.empty()) {
376 } else if (!planParameters.toParkingArea.empty()) {
378 } else {
379 return std::make_pair(SUMO_TAG_NOTHING, GUIIcon::EMPTY);
380 }
381 } else {
382 return std::make_pair(SUMO_TAG_NOTHING, GUIIcon::EMPTY);
383 }
384}
385
386
387std::pair<SumoXMLTag, GUIIcon>
389 if (planParameters.isSingleEdgePlan()) {
390 return std::make_pair(GNE_TAG_RIDE_EDGE_EDGE, GUIIcon::RIDE_EDGE);
391 } else if (!planParameters.fromEdge.empty()) {
392 if (!planParameters.toEdge.empty()) {
393 return std::make_pair(GNE_TAG_RIDE_EDGE_EDGE, GUIIcon::RIDE_EDGE);
394 } else if (!planParameters.toTAZ.empty()) {
395 return std::make_pair(GNE_TAG_RIDE_EDGE_TAZ, GUIIcon::RIDE_TAZ);
396 } else if (!planParameters.toJunction.empty()) {
398 } else if (!planParameters.toBusStop.empty()) {
399 return std::make_pair(GNE_TAG_RIDE_EDGE_BUSSTOP, GUIIcon::RIDE_BUSSTOP);
400 } else if (!planParameters.toTrainStop.empty()) {
402 } else if (!planParameters.toContainerStop.empty()) {
404 } else if (!planParameters.toChargingStation.empty()) {
406 } else if (!planParameters.toParkingArea.empty()) {
408 } else {
409 return std::make_pair(SUMO_TAG_NOTHING, GUIIcon::EMPTY);
410 }
411 } else if (!planParameters.fromTAZ.empty()) {
412 if (!planParameters.toEdge.empty()) {
413 return std::make_pair(GNE_TAG_RIDE_TAZ_EDGE, GUIIcon::RIDE_EDGE);
414 } else if (!planParameters.toTAZ.empty()) {
415 return std::make_pair(GNE_TAG_RIDE_TAZ_TAZ, GUIIcon::RIDE_TAZ);
416 } else if (!planParameters.toJunction.empty()) {
418 } else if (!planParameters.toBusStop.empty()) {
419 return std::make_pair(GNE_TAG_RIDE_TAZ_BUSSTOP, GUIIcon::RIDE_BUSSTOP);
420 } else if (!planParameters.toTrainStop.empty()) {
422 } else if (!planParameters.toContainerStop.empty()) {
424 } else if (!planParameters.toChargingStation.empty()) {
426 } else if (!planParameters.toParkingArea.empty()) {
428 } else {
429 return std::make_pair(SUMO_TAG_NOTHING, GUIIcon::EMPTY);
430 }
431 } else if (!planParameters.fromJunction.empty()) {
432 if (!planParameters.toEdge.empty()) {
433 return std::make_pair(GNE_TAG_RIDE_JUNCTION_EDGE, GUIIcon::RIDE_EDGE);
434 } else if (!planParameters.toTAZ.empty()) {
435 return std::make_pair(GNE_TAG_RIDE_JUNCTION_TAZ, GUIIcon::RIDE_TAZ);
436 } else if (!planParameters.toJunction.empty()) {
438 } else if (!planParameters.toBusStop.empty()) {
440 } else if (!planParameters.toTrainStop.empty()) {
442 } else if (!planParameters.toContainerStop.empty()) {
444 } else if (!planParameters.toChargingStation.empty()) {
446 } else if (!planParameters.toParkingArea.empty()) {
448 } else {
449 return std::make_pair(SUMO_TAG_NOTHING, GUIIcon::EMPTY);
450 }
451 } else if (!planParameters.fromBusStop.empty()) {
452 if (!planParameters.toEdge.empty()) {
453 return std::make_pair(GNE_TAG_RIDE_BUSSTOP_EDGE, GUIIcon::RIDE_EDGE);
454 } else if (!planParameters.toTAZ.empty()) {
455 return std::make_pair(GNE_TAG_RIDE_BUSSTOP_TAZ, GUIIcon::RIDE_TAZ);
456 } else if (!planParameters.toJunction.empty()) {
458 } else if (!planParameters.toBusStop.empty()) {
460 } else if (!planParameters.toTrainStop.empty()) {
462 } else if (!planParameters.toContainerStop.empty()) {
464 } else if (!planParameters.toChargingStation.empty()) {
466 } else if (!planParameters.toParkingArea.empty()) {
468 } else {
469 return std::make_pair(SUMO_TAG_NOTHING, GUIIcon::EMPTY);
470 }
471 } else if (!planParameters.fromTrainStop.empty()) {
472 if (!planParameters.toEdge.empty()) {
473 return std::make_pair(GNE_TAG_RIDE_TRAINSTOP_EDGE, GUIIcon::RIDE_EDGE);
474 } else if (!planParameters.toTAZ.empty()) {
475 return std::make_pair(GNE_TAG_RIDE_TRAINSTOP_TAZ, GUIIcon::RIDE_TAZ);
476 } else if (!planParameters.toJunction.empty()) {
478 } else if (!planParameters.toBusStop.empty()) {
480 } else if (!planParameters.toTrainStop.empty()) {
482 } else if (!planParameters.toContainerStop.empty()) {
484 } else if (!planParameters.toChargingStation.empty()) {
486 } else if (!planParameters.toParkingArea.empty()) {
488 } else {
489 return std::make_pair(SUMO_TAG_NOTHING, GUIIcon::EMPTY);
490 }
491 } else if (!planParameters.fromContainerStop.empty()) {
492 if (!planParameters.toEdge.empty()) {
494 } else if (!planParameters.toTAZ.empty()) {
496 } else if (!planParameters.toJunction.empty()) {
498 } else if (!planParameters.toBusStop.empty()) {
500 } else if (!planParameters.toTrainStop.empty()) {
502 } else if (!planParameters.toContainerStop.empty()) {
504 } else if (!planParameters.toChargingStation.empty()) {
506 } else if (!planParameters.toParkingArea.empty()) {
508 } else {
509 return std::make_pair(SUMO_TAG_NOTHING, GUIIcon::EMPTY);
510 }
511 } else if (!planParameters.fromChargingStation.empty()) {
512 if (!planParameters.toEdge.empty()) {
514 } else if (!planParameters.toTAZ.empty()) {
516 } else if (!planParameters.toJunction.empty()) {
518 } else if (!planParameters.toBusStop.empty()) {
520 } else if (!planParameters.toTrainStop.empty()) {
522 } else if (!planParameters.toContainerStop.empty()) {
524 } else if (!planParameters.toChargingStation.empty()) {
526 } else if (!planParameters.toParkingArea.empty()) {
528 } else {
529 return std::make_pair(SUMO_TAG_NOTHING, GUIIcon::EMPTY);
530 }
531 } else if (!planParameters.fromParkingArea.empty()) {
532 if (!planParameters.toEdge.empty()) {
534 } else if (!planParameters.toTAZ.empty()) {
535 return std::make_pair(GNE_TAG_RIDE_PARKINGAREA_TAZ, GUIIcon::RIDE_TAZ);
536 } else if (!planParameters.toJunction.empty()) {
538 } else if (!planParameters.toBusStop.empty()) {
540 } else if (!planParameters.toTrainStop.empty()) {
542 } else if (!planParameters.toContainerStop.empty()) {
544 } else if (!planParameters.toChargingStation.empty()) {
546 } else if (!planParameters.toParkingArea.empty()) {
548 } else {
549 return std::make_pair(SUMO_TAG_NOTHING, GUIIcon::EMPTY);
550 }
551 } else {
552 return std::make_pair(SUMO_TAG_NOTHING, GUIIcon::EMPTY);
553 }
554}
555
556
557std::pair<SumoXMLTag, GUIIcon>
559 if (planParameters.isSingleEdgePlan()) {
561 } else if (!planParameters.fromEdge.empty()) {
562 if (!planParameters.toEdge.empty()) {
564 } else if (!planParameters.toTAZ.empty()) {
566 } else if (!planParameters.toJunction.empty()) {
568 } else if (!planParameters.toBusStop.empty()) {
570 } else if (!planParameters.toTrainStop.empty()) {
572 } else if (!planParameters.toContainerStop.empty()) {
574 } else if (!planParameters.toChargingStation.empty()) {
576 } else if (!planParameters.toParkingArea.empty()) {
578 } else {
579 return std::make_pair(SUMO_TAG_NOTHING, GUIIcon::EMPTY);
580 }
581 } else if (!planParameters.fromTAZ.empty()) {
582 if (!planParameters.toEdge.empty()) {
584 } else if (!planParameters.toTAZ.empty()) {
586 } else if (!planParameters.toJunction.empty()) {
588 } else if (!planParameters.toBusStop.empty()) {
590 } else if (!planParameters.toTrainStop.empty()) {
592 } else if (!planParameters.toContainerStop.empty()) {
594 } else if (!planParameters.toChargingStation.empty()) {
596 } else if (!planParameters.toParkingArea.empty()) {
598 } else {
599 return std::make_pair(SUMO_TAG_NOTHING, GUIIcon::EMPTY);
600 }
601 } else if (!planParameters.fromJunction.empty()) {
602 if (!planParameters.toEdge.empty()) {
604 } else if (!planParameters.toTAZ.empty()) {
606 } else if (!planParameters.toJunction.empty()) {
608 } else if (!planParameters.toBusStop.empty()) {
610 } else if (!planParameters.toTrainStop.empty()) {
612 } else if (!planParameters.toContainerStop.empty()) {
614 } else if (!planParameters.toChargingStation.empty()) {
616 } else if (!planParameters.toParkingArea.empty()) {
618 } else {
619 return std::make_pair(SUMO_TAG_NOTHING, GUIIcon::EMPTY);
620 }
621 } else if (!planParameters.fromBusStop.empty()) {
622 if (!planParameters.toEdge.empty()) {
624 } else if (!planParameters.toTAZ.empty()) {
626 } else if (!planParameters.toJunction.empty()) {
628 } else if (!planParameters.toBusStop.empty()) {
630 } else if (!planParameters.toTrainStop.empty()) {
632 } else if (!planParameters.toContainerStop.empty()) {
634 } else if (!planParameters.toChargingStation.empty()) {
636 } else if (!planParameters.toParkingArea.empty()) {
638 } else {
639 return std::make_pair(SUMO_TAG_NOTHING, GUIIcon::EMPTY);
640 }
641 } else if (!planParameters.fromTrainStop.empty()) {
642 if (!planParameters.toEdge.empty()) {
644 } else if (!planParameters.toTAZ.empty()) {
646 } else if (!planParameters.toJunction.empty()) {
648 } else if (!planParameters.toBusStop.empty()) {
650 } else if (!planParameters.toTrainStop.empty()) {
652 } else if (!planParameters.toContainerStop.empty()) {
654 } else if (!planParameters.toChargingStation.empty()) {
656 } else if (!planParameters.toParkingArea.empty()) {
658 } else {
659 return std::make_pair(SUMO_TAG_NOTHING, GUIIcon::EMPTY);
660 }
661 } else if (!planParameters.fromContainerStop.empty()) {
662 if (!planParameters.toEdge.empty()) {
664 } else if (!planParameters.toTAZ.empty()) {
666 } else if (!planParameters.toJunction.empty()) {
668 } else if (!planParameters.toBusStop.empty()) {
670 } else if (!planParameters.toTrainStop.empty()) {
672 } else if (!planParameters.toContainerStop.empty()) {
674 } else if (!planParameters.toChargingStation.empty()) {
676 } else if (!planParameters.toParkingArea.empty()) {
678 } else {
679 return std::make_pair(SUMO_TAG_NOTHING, GUIIcon::EMPTY);
680 }
681 } else if (!planParameters.fromChargingStation.empty()) {
682 if (!planParameters.toEdge.empty()) {
684 } else if (!planParameters.toTAZ.empty()) {
686 } else if (!planParameters.toJunction.empty()) {
688 } else if (!planParameters.toBusStop.empty()) {
690 } else if (!planParameters.toTrainStop.empty()) {
692 } else if (!planParameters.toContainerStop.empty()) {
694 } else if (!planParameters.toChargingStation.empty()) {
696 } else if (!planParameters.toParkingArea.empty()) {
698 } else {
699 return std::make_pair(SUMO_TAG_NOTHING, GUIIcon::EMPTY);
700 }
701 } else if (!planParameters.fromParkingArea.empty()) {
702 if (!planParameters.toEdge.empty()) {
704 } else if (!planParameters.toTAZ.empty()) {
706 } else if (!planParameters.toJunction.empty()) {
708 } else if (!planParameters.toBusStop.empty()) {
710 } else if (!planParameters.toTrainStop.empty()) {
712 } else if (!planParameters.toContainerStop.empty()) {
714 } else if (!planParameters.toChargingStation.empty()) {
716 } else if (!planParameters.toParkingArea.empty()) {
718 } else {
719 return std::make_pair(SUMO_TAG_NOTHING, GUIIcon::EMPTY);
720 }
721 } else {
722 return std::make_pair(SUMO_TAG_NOTHING, GUIIcon::EMPTY);
723 }
724}
725
726
727std::pair<SumoXMLTag, GUIIcon>
729 if (planParameters.isSingleEdgePlan()) {
731 } else if (planParameters.consecutiveEdges.size() > 0) {
732 return std::make_pair(GNE_TAG_TRANSHIP_EDGES, GUIIcon::TRANSHIP_EDGES);
733 } else if (!planParameters.fromEdge.empty()) {
734 if (!planParameters.toEdge.empty()) {
736 } else if (!planParameters.toTAZ.empty()) {
737 return std::make_pair(GNE_TAG_TRANSHIP_EDGE_TAZ, GUIIcon::TRANSHIP_TAZ);
738 } else if (!planParameters.toJunction.empty()) {
740 } else if (!planParameters.toBusStop.empty()) {
742 } else if (!planParameters.toTrainStop.empty()) {
744 } else if (!planParameters.toContainerStop.empty()) {
746 } else if (!planParameters.toChargingStation.empty()) {
748 } else if (!planParameters.toParkingArea.empty()) {
750 } else {
751 return std::make_pair(SUMO_TAG_NOTHING, GUIIcon::EMPTY);
752 }
753 } else if (!planParameters.fromTAZ.empty()) {
754 if (!planParameters.toEdge.empty()) {
756 } else if (!planParameters.toTAZ.empty()) {
757 return std::make_pair(GNE_TAG_TRANSHIP_TAZ_TAZ, GUIIcon::TRANSHIP_TAZ);
758 } else if (!planParameters.toJunction.empty()) {
760 } else if (!planParameters.toBusStop.empty()) {
762 } else if (!planParameters.toTrainStop.empty()) {
764 } else if (!planParameters.toContainerStop.empty()) {
766 } else if (!planParameters.toChargingStation.empty()) {
768 } else if (!planParameters.toParkingArea.empty()) {
770 } else {
771 return std::make_pair(SUMO_TAG_NOTHING, GUIIcon::EMPTY);
772 }
773 } else if (!planParameters.fromJunction.empty()) {
774 if (!planParameters.toEdge.empty()) {
776 } else if (!planParameters.toTAZ.empty()) {
778 } else if (!planParameters.toJunction.empty()) {
780 } else if (!planParameters.toBusStop.empty()) {
782 } else if (!planParameters.toTrainStop.empty()) {
784 } else if (!planParameters.toContainerStop.empty()) {
786 } else if (!planParameters.toChargingStation.empty()) {
788 } else if (!planParameters.toParkingArea.empty()) {
790 } else {
791 return std::make_pair(SUMO_TAG_NOTHING, GUIIcon::EMPTY);
792 }
793 } else if (!planParameters.fromBusStop.empty()) {
794 if (!planParameters.toEdge.empty()) {
796 } else if (!planParameters.toTAZ.empty()) {
798 } else if (!planParameters.toJunction.empty()) {
800 } else if (!planParameters.toBusStop.empty()) {
802 } else if (!planParameters.toTrainStop.empty()) {
804 } else if (!planParameters.toContainerStop.empty()) {
806 } else if (!planParameters.toChargingStation.empty()) {
808 } else if (!planParameters.toParkingArea.empty()) {
810 } else {
811 return std::make_pair(SUMO_TAG_NOTHING, GUIIcon::EMPTY);
812 }
813 } else if (!planParameters.fromTrainStop.empty()) {
814 if (!planParameters.toEdge.empty()) {
816 } else if (!planParameters.toTAZ.empty()) {
818 } else if (!planParameters.toJunction.empty()) {
820 } else if (!planParameters.toBusStop.empty()) {
822 } else if (!planParameters.toTrainStop.empty()) {
824 } else if (!planParameters.toContainerStop.empty()) {
826 } else if (!planParameters.toChargingStation.empty()) {
828 } else if (!planParameters.toParkingArea.empty()) {
830 } else {
831 return std::make_pair(SUMO_TAG_NOTHING, GUIIcon::EMPTY);
832 }
833 } else if (!planParameters.fromContainerStop.empty()) {
834 if (!planParameters.toEdge.empty()) {
836 } else if (!planParameters.toTAZ.empty()) {
838 } else if (!planParameters.toJunction.empty()) {
840 } else if (!planParameters.toBusStop.empty()) {
842 } else if (!planParameters.toTrainStop.empty()) {
844 } else if (!planParameters.toContainerStop.empty()) {
846 } else if (!planParameters.toChargingStation.empty()) {
848 } else if (!planParameters.toParkingArea.empty()) {
850 } else {
851 return std::make_pair(SUMO_TAG_NOTHING, GUIIcon::EMPTY);
852 }
853 } else if (!planParameters.fromChargingStation.empty()) {
854 if (!planParameters.toEdge.empty()) {
856 } else if (!planParameters.toTAZ.empty()) {
858 } else if (!planParameters.toJunction.empty()) {
860 } else if (!planParameters.toBusStop.empty()) {
862 } else if (!planParameters.toTrainStop.empty()) {
864 } else if (!planParameters.toContainerStop.empty()) {
866 } else if (!planParameters.toChargingStation.empty()) {
868 } else if (!planParameters.toParkingArea.empty()) {
870 } else {
871 return std::make_pair(SUMO_TAG_NOTHING, GUIIcon::EMPTY);
872 }
873 } else if (!planParameters.fromParkingArea.empty()) {
874 if (!planParameters.toEdge.empty()) {
876 } else if (!planParameters.toTAZ.empty()) {
878 } else if (!planParameters.toJunction.empty()) {
880 } else if (!planParameters.toBusStop.empty()) {
882 } else if (!planParameters.toTrainStop.empty()) {
884 } else if (!planParameters.toContainerStop.empty()) {
886 } else if (!planParameters.toChargingStation.empty()) {
888 } else if (!planParameters.toParkingArea.empty()) {
890 } else {
891 return std::make_pair(SUMO_TAG_NOTHING, GUIIcon::EMPTY);
892 }
893 } else {
894 return std::make_pair(SUMO_TAG_NOTHING, GUIIcon::EMPTY);
895 }
896}
897
898
899std::pair<SumoXMLTag, GUIIcon>
901 if (!planParameters.toEdge.empty()) {
902 return std::make_pair(GNE_TAG_STOPPERSON_EDGE, GUIIcon::STOPELEMENT);
903 } else if (!planParameters.toBusStop.empty()) {
904 return std::make_pair(GNE_TAG_STOPPERSON_BUSSTOP, GUIIcon::STOPELEMENT);
905 } else if (!planParameters.toTrainStop.empty()) {
907 } else if (!planParameters.toContainerStop.empty()) {
909 } else if (!planParameters.toChargingStation.empty()) {
911 } else if (!planParameters.toParkingArea.empty()) {
913 } else {
914 return std::make_pair(SUMO_TAG_NOTHING, GUIIcon::EMPTY);
915 }
916}
917
918
919std::pair<SumoXMLTag, GUIIcon>
921 if (!planParameters.toEdge.empty()) {
922 return std::make_pair(GNE_TAG_STOPCONTAINER_EDGE, GUIIcon::STOPELEMENT);
923 } else if (!planParameters.toBusStop.empty()) {
925 } else if (!planParameters.toTrainStop.empty()) {
927 } else if (!planParameters.toContainerStop.empty()) {
929 } else if (!planParameters.toChargingStation.empty()) {
931 } else if (!planParameters.toParkingArea.empty()) {
933 } else {
934 return std::make_pair(SUMO_TAG_NOTHING, GUIIcon::EMPTY);
935 }
936}
937
938
939GNEDemandElementPlan::GNEDemandElementPlan(GNEDemandElement* planElement, const double departPosition, const double arrivalPosition) :
940 myDepartPosition(departPosition),
941 myArrivalPosition(arrivalPosition),
942 myPlanElement(planElement) {
943 // update centering boundary without updating grid
945}
946
947
950 // get tag property
951 const auto& tagProperty = myPlanElement->getTagProperty();
952 // only move personTrips defined over edges
953 if (tagProperty.planToEdge() || tagProperty.planConsecutiveEdges() || tagProperty.planEdge()) {
954 // get geometry end pos
956 // calculate circle width squared
957 const double circleWidthSquared = myArrivalPositionDiameter * myArrivalPositionDiameter;
958 // check if we clicked over a geometry end pos
959 if (myPlanElement->myNet->getViewNet()->getPositionInformation().distanceSquaredTo2D(geometryEndPos) <= ((circleWidthSquared + 2))) {
960 // continue depending of parent edges
961 if (myPlanElement->getParentEdges().size() > 0) {
962 return new GNEMoveOperation(myPlanElement, myPlanElement->getParentEdges().back()->getLaneByAllowedVClass(myPlanElement->getVClass()), myArrivalPosition, false);
963 } else {
964 return new GNEMoveOperation(myPlanElement, myPlanElement->getParentDemandElements().at(1)->getParentEdges().back()->getLaneByAllowedVClass(myPlanElement->getVClass()), myArrivalPosition, false);
965 }
966 }
967 }
968 return nullptr;
969}
970
971
972void
974 const auto& tagProperty = myPlanElement->getTagProperty();
975 // write attributes depending of parent elements
976 if (tagProperty.planConsecutiveEdges()) {
978 } else if (tagProperty.planRoute()) {
980 } else if (tagProperty.planEdge()) {
981 device.writeAttr(SUMO_ATTR_EDGE, myPlanElement->getParentEdges().front()->getID());
982 } else if (tagProperty.planBusStop()) {
984 } else if (tagProperty.planTrainStop()) {
986 } else if (tagProperty.planContainerStop()) {
988 } else if (tagProperty.planChargingStation()) {
990 } else if (tagProperty.planParkingArea()) {
992 } else {
993 // write from attribute (if this is the first element)
994 if (myPlanElement->getParentDemandElements().at(0)->getPreviousChildDemandElement(myPlanElement) == nullptr) {
995 // check if write edge or junction
996 if (tagProperty.planFromEdge()) {
997 device.writeAttr(SUMO_ATTR_FROM, myPlanElement->getParentEdges().front()->getID());
998 } else if (tagProperty.planFromTAZ()) {
999 device.writeAttr(SUMO_ATTR_FROM_TAZ, myPlanElement->getParentTAZs().front()->getID());
1000 } else if (tagProperty.planFromJunction()) {
1002 }
1003 // origin stopping places are transformed into an intial stop stage (see writeOriginStop)
1004 }
1005 // continue writting to attribute
1006 if (tagProperty.planToEdge()) {
1007 device.writeAttr(SUMO_ATTR_TO, myPlanElement->getParentEdges().back()->getID());
1008 } else if (tagProperty.planToJunction()) {
1010 } else if (tagProperty.planToTAZ()) {
1011 device.writeAttr(SUMO_ATTR_TO_TAZ, myPlanElement->getParentTAZs().back()->getID());
1012 } else if (tagProperty.planToBusStop()) {
1014 } else if (tagProperty.planToTrainStop()) {
1016 } else if (tagProperty.planToContainerStop()) {
1018 } else if (tagProperty.planToChargingStation()) {
1020 } else if (tagProperty.planToParkingArea()) {
1022 }
1023 }
1024 // check if write depart position
1025 if (tagProperty.hasAttribute(SUMO_ATTR_DEPARTPOS) && (myDepartPosition > 0)) {
1027 }
1028 // check if write arrival position
1029 if (tagProperty.hasAttribute(SUMO_ATTR_ARRIVALPOS) && (myArrivalPosition > 0)) {
1031 }
1032 // check if write end position
1033 if (tagProperty.hasAttribute(SUMO_ATTR_ENDPOS)) {
1035 }
1036}
1037
1038
1039void
1041 const auto& tagProperty = myPlanElement->getTagProperty();
1042 // write an extra stop element with duration 0 over a stopping place (if this is the first element)
1043 if (tagProperty.planFromStoppingPlace()
1044 && myPlanElement->getParentDemandElements().at(0)->getPreviousChildDemandElement(myPlanElement) == nullptr) {
1045 device.openTag(SUMO_TAG_STOP);
1046 const std::string stopID = myPlanElement->getParentStoppingPlaces().front()->getID();
1047 if (tagProperty.planFromBusStop()) {
1048 device.writeAttr(SUMO_ATTR_BUS_STOP, stopID);
1049 } else if (tagProperty.planFromTrainStop()) {
1050 device.writeAttr(SUMO_ATTR_TRAIN_STOP, stopID);
1051 } else if (tagProperty.planFromContainerStop()) {
1052 device.writeAttr(SUMO_ATTR_CONTAINER_STOP, stopID);
1053 } else if (tagProperty.planFromChargingStation()) {
1054 device.writeAttr(SUMO_ATTR_CHARGING_STATION, stopID);
1055 } else if (tagProperty.planFromParkingArea()) {
1056 device.writeAttr(SUMO_ATTR_PARKING_AREA, stopID);
1057 }
1058 device.writeAttr(SUMO_ATTR_DURATION, 0);
1059 device.closeTag();
1060 }
1061}
1062
1063
1067 // build header
1069 // build menu command for center button and copy cursor position to clipboard
1072 // build menu commands for names
1073 GUIDesigns::buildFXMenuCommand(ret, "Copy " + myPlanElement->getTagStr() + " name to clipboard", nullptr, ret, MID_COPY_NAME);
1074 GUIDesigns::buildFXMenuCommand(ret, "Copy " + myPlanElement->getTagStr() + " typed name to clipboard", nullptr, ret, MID_COPY_TYPED_NAME);
1075 new FXMenuSeparator(ret);
1076 // build selection and show parameters menu
1079 GUIDesigns::buildFXMenuCommand(ret, ("Cursor position in view: " + toString(getPlanPositionInView().x()) + "," + toString(getPlanPositionInView().y())).c_str(), nullptr, nullptr, 0);
1080 return ret;
1081}
1082
1083
1084GNELane*
1086 // get tag property
1087 const auto& tagProperty = myPlanElement->getTagProperty();
1088 // get vclass
1089 auto vClass = myPlanElement->getVClass();
1090 // continue depending of parents
1091 if (tagProperty.planRoute()) {
1092 // route
1093 return myPlanElement->getParentDemandElements().at(1)->getParentEdges().front()->getLaneByAllowedVClass(vClass);
1094 } else if (tagProperty.planConsecutiveEdges() || tagProperty.planFromEdge() || tagProperty.planEdge()) {
1095 // edges
1096 return myPlanElement->getParentEdges().front()->getLaneByAllowedVClass(vClass);
1097 } else if (tagProperty.planStoppingPlace() || tagProperty.planFromStoppingPlace() || tagProperty.planToStoppingPlace()) {
1098 // additional
1099 return myPlanElement->getParentStoppingPlaces().front()->getParentLanes().front();
1100 } else {
1101 // in other cases (TAZ, junctions, etc.) return null
1102 return nullptr;
1103 }
1104}
1105
1106
1107GNELane*
1109 // get tag property
1110 const auto& tagProperty = myPlanElement->getTagProperty();
1111 // get vclass
1112 auto vClass = myPlanElement->getVClass();
1113 // check parents
1114 if (tagProperty.planRoute()) {
1115 // route
1116 return myPlanElement->getParentDemandElements().at(1)->getParentEdges().back()->getLaneByAllowedVClass(vClass);
1117 } else if (tagProperty.planConsecutiveEdges() || tagProperty.planToEdge() || tagProperty.planEdge()) {
1118 // edges
1119 return myPlanElement->getParentEdges().back()->getLaneByAllowedVClass(vClass);
1120 } else if (tagProperty.planStoppingPlace() || tagProperty.planFromStoppingPlace() || tagProperty.planToStoppingPlace()) {
1121 // additional
1122 return myPlanElement->getParentStoppingPlaces().back()->getParentLanes().front()->getParentEdge()->getLaneByAllowedVClass(vClass);
1123 } else {
1124 // in other cases (TAZ, junctions, etc.) return null
1125 return nullptr;
1126 }
1127}
1128
1129
1130void
1132 // get tag property
1133 const auto& tagProperty = myPlanElement->getTagProperty();
1134 // get vClass
1135 auto vClass = myPlanElement->getVClass();
1136 // get path manager
1137 auto pathManager = myPlanElement->getNet()->getDemandPathManager();
1138 // continue depending of parents
1139 if (tagProperty.planRoute()) {
1140 // calculate consecutive path using route edges
1141 pathManager->calculateConsecutivePathEdges(myPlanElement, vClass, myPlanElement->getParentDemandElements().at(1)->getParentEdges());
1142 } else if (tagProperty.planConsecutiveEdges()) {
1143 // calculate consecutive path using edges
1144 pathManager->calculateConsecutivePathEdges(myPlanElement, vClass, myPlanElement->getParentEdges());
1146 // calculate path using junctions
1147 pathManager->calculatePath(myPlanElement, vClass, myPlanElement->getParentJunctions().front(), myPlanElement->getParentJunctions().back());
1149 // declare last lane
1150 GNELane* lastLane = nullptr;
1152 lastLane = myPlanElement->getParentStoppingPlaces().back()->getParentLanes().back();
1154 lastLane = myPlanElement->getParentStoppingPlaces().back()->getParentLanes().front();
1155 } else if (myPlanElement->myTagProperty.planToEdge()) {
1156 lastLane = myPlanElement->getParentEdges().back()->getLaneByAllowedVClass(vClass);
1157 }
1158 // calculate path
1159 if (lastLane) {
1160 pathManager->calculatePath(myPlanElement, vClass, myPlanElement->getParentJunctions().front(), lastLane);
1161 }
1163 // declare first lane
1164 GNELane* firstLane = nullptr;
1166 firstLane = myPlanElement->getParentStoppingPlaces().front()->getParentLanes().back();
1168 firstLane = myPlanElement->getParentStoppingPlaces().front()->getParentLanes().front();
1170 firstLane = myPlanElement->getParentEdges().front()->getLaneByAllowedVClass(vClass);
1171 }
1172 // calculate path
1173 if (firstLane) {
1174 pathManager->calculatePath(myPlanElement, vClass, firstLane, myPlanElement->getParentJunctions().back());
1175 }
1176 } else {
1177 // declare first edge
1178 GNELane* firstLane = nullptr;
1180 firstLane = myPlanElement->getParentEdges().front()->getLaneByAllowedVClass(vClass);
1182 firstLane = myPlanElement->getParentStoppingPlaces().front()->getParentLanes().back();
1184 firstLane = myPlanElement->getParentStoppingPlaces().front()->getParentLanes().front();
1185 }
1186 // declare last lane
1187 GNELane* lastLane = nullptr;
1189 lastLane = myPlanElement->getParentEdges().back()->getLaneByAllowedVClass(vClass);
1191 lastLane = myPlanElement->getParentStoppingPlaces().back()->getParentLanes().back();
1193 lastLane = myPlanElement->getParentStoppingPlaces().back()->getParentLanes().front();
1194 }
1195 if (firstLane && lastLane) {
1196 pathManager->calculatePath(myPlanElement, vClass, firstLane, lastLane);
1197 } else if (firstLane) {
1198 pathManager->calculateConsecutivePathLanes(myPlanElement, {firstLane});
1199 } else if (lastLane) {
1200 pathManager->calculateConsecutivePathLanes(myPlanElement, {lastLane});
1201 }
1202 }
1203 // update geometry
1205}
1206
1207
1208void
1210 // get tag property
1211 const auto& tagProperty = myPlanElement->getTagProperty();
1212 // check if plan start or end in a TAZ (becase in this case has to be inserted in RTREE
1213 if (tagProperty.planFromTAZ() || tagProperty.planToTAZ()) {
1214 // declare first and last positions
1215 Position firstPos = Position::INVALID;
1216 Position lastPos = Position::INVALID;
1217 // set first position
1218 if (tagProperty.planFromEdge()) {
1219 // from junction
1220 firstPos = myPlanElement->getFirstPathLane()->getLaneShape().back();
1221 } else if (tagProperty.planFromJunction()) {
1222 // from junction
1223 firstPos = myPlanElement->getParentJunctions().front()->getPositionInView();
1224 } else if (tagProperty.planFromStoppingPlace()) {
1225 // end of stoppingPlace lane shape
1226 firstPos = myPlanElement->getParentStoppingPlaces().front()->getParentLanes().front()->getLaneShape().back();
1227 } else if (tagProperty.planFromTAZ()) {
1228 // from TAZ
1229 if (myPlanElement->getParentTAZs().front()->getAttribute(SUMO_ATTR_CENTER).empty()) {
1230 firstPos = myPlanElement->getParentTAZs().front()->getAttributePosition(GNE_ATTR_TAZ_CENTROID);
1231 } else {
1232 firstPos = myPlanElement->getParentTAZs().front()->getAttributePosition(SUMO_ATTR_CENTER);
1233 }
1234 }
1235 // set last position
1236 if (tagProperty.planToEdge()) {
1237 // from junction
1238 lastPos = myPlanElement->getLastPathLane()->getLaneShape().back();
1239 } else if (tagProperty.planToJunction()) {
1240 // from junction
1241 lastPos = myPlanElement->getParentJunctions().back()->getPositionInView();
1242 } else if (tagProperty.planToStoppingPlace()) {
1243 // end of stoppingPlace lane shape
1244 lastPos = myPlanElement->getParentStoppingPlaces().back()->getParentLanes().front()->getLaneShape().front();
1245 } else if (tagProperty.planToTAZ()) {
1246 // from TAZ
1247 if (myPlanElement->getParentTAZs().back()->getAttribute(SUMO_ATTR_CENTER).empty()) {
1248 lastPos = myPlanElement->getParentTAZs().back()->getAttributePosition(GNE_ATTR_TAZ_CENTROID);
1249 } else {
1250 lastPos = myPlanElement->getParentTAZs().back()->getAttributePosition(SUMO_ATTR_CENTER);
1251 }
1252 }
1253 // use both position to calculate a line
1254 if ((firstPos != Position::INVALID) && (lastPos != Position::INVALID)) {
1256 } else {
1258 }
1259 }
1260 // update centering boundary
1262 // update child demand elements
1263 for (const auto& demandElement : myPlanElement->getChildDemandElements()) {
1264 demandElement->updateGeometry();
1265 }
1266}
1267
1268
1273
1274
1275void
1277 // remove additional from grid
1278 if (myPlanBoundary.isInitialised() && updateGrid) {
1280 }
1282 // if this element is over route, add their boundary
1283 if (myPlanElement->getParentDemandElements().size() > 1) {
1284 myPlanBoundary.add(myPlanElement->getParentDemandElements().at(1)->getCenteringBoundary());
1285 }
1286 // add the combination of all parent edges's boundaries
1287 for (const auto& edge : myPlanElement->getParentEdges()) {
1288 myPlanBoundary.add(edge->getCenteringBoundary());
1289 }
1290 // add the combination of all parent edges's boundaries
1291 for (const auto& junction : myPlanElement->getParentJunctions()) {
1292 myPlanBoundary.add(junction->getCenteringBoundary());
1293 }
1294 // add the combination of all parent additional's boundaries (stoppingPlaces and TAZs)
1295 for (const auto& additional : myPlanElement->getParentAdditionals()) {
1296 if (additional->getTagProperty().getTag() == SUMO_TAG_TAZ) {
1297 if (additional->getAttribute(SUMO_ATTR_CENTER).empty()) {
1298 myPlanBoundary.add(additional->getAttributePosition(GNE_ATTR_TAZ_CENTROID));
1299 } else {
1300 myPlanBoundary.add(additional->getAttributePosition(SUMO_ATTR_CENTER));
1301 }
1302 } else {
1303 myPlanBoundary.add(additional->getCenteringBoundary());
1304 }
1305 }
1306 // check if is valid
1309 }
1310 // add additional into RTREE again
1311 if (myPlanBoundary.isInitialised() && updateGrid) {
1313 }
1314}
1315
1316
1319 // get tag property
1320 const auto& tagProperty = myPlanElement->getTagProperty();
1321 // continue depending of parents
1322 if (tagProperty.planRoute()) {
1323 // route
1324 return myPlanElement->getParentDemandElements().at(1)->getPositionInView();
1325 } else if (tagProperty.isPlanStop()) {
1327 } else if (tagProperty.planFromEdge() || tagProperty.planConsecutiveEdges() || tagProperty.planEdge()) {
1328 // first edge
1329 return myPlanElement->getParentEdges().front()->getPositionInView();
1330 } else if (tagProperty.planFromJunction()) {
1331 // first junction
1332 return myPlanElement->getParentJunctions().front()->getPositionInView();
1333 } else if (tagProperty.planStoppingPlace() || tagProperty.planFromStoppingPlace()) {
1334 // first additional
1335 return myPlanElement->getParentStoppingPlaces().front()->getPositionInView();
1336 } else if (tagProperty.planFromTAZ()) {
1337 if (myPlanElement->getParentTAZs().front()->getAttribute(SUMO_ATTR_CENTER).empty()) {
1338 return myPlanElement->getParentTAZs().front()->getAttributePosition(GNE_ATTR_TAZ_CENTROID);
1339 } else {
1340 return myPlanElement->getParentTAZs().front()->getAttributePosition(SUMO_ATTR_CENTER);
1341 }
1342 } else {
1343 // return parent position
1344 return Position(0, 0);
1345 }
1346}
1347
1348
1349std::string
1351 // continue depending of key
1352 switch (key) {
1353 // Common plan attributes
1354 case SUMO_ATTR_ID:
1355 case GNE_ATTR_PARENT:
1356 return myPlanElement->getParentDemandElements().at(0)->getID();
1357 case GNE_ATTR_SELECTED:
1360 if (myDepartPosition < 0) {
1361 return "";
1362 } else {
1363 return toString(myDepartPosition);
1364 }
1365 case SUMO_ATTR_ENDPOS:
1367 if (myArrivalPosition < 0) {
1368 return "";
1369 } else {
1371 }
1372 // route
1373 case SUMO_ATTR_ROUTE:
1374 return myPlanElement->getParentDemandElements().at(1)->getID();
1375 // edges
1376 case SUMO_ATTR_EDGE:
1377 case SUMO_ATTR_EDGES:
1379 // stoppingPlaces (single and back)
1380 case SUMO_ATTR_BUS_STOP:
1385 return myPlanElement->getParentStoppingPlaces().back()->getID();
1386 // from elements
1387 case SUMO_ATTR_FROM:
1388 return myPlanElement->getParentEdges().front()->getID();
1390 return myPlanElement->getParentJunctions().front()->getID();
1391 case SUMO_ATTR_FROM_TAZ:
1392 return myPlanElement->getParentTAZs().front()->getID();
1398 return myPlanElement->getParentStoppingPlaces().front()->getID();
1399 // to elements
1400 case SUMO_ATTR_TO:
1401 return myPlanElement->getParentEdges().back()->getID();
1403 return myPlanElement->getParentJunctions().back()->getID();
1404 case SUMO_ATTR_TO_TAZ:
1405 return myPlanElement->getParentTAZs().back()->getID();
1406 default:
1407 throw InvalidArgument(myPlanElement->getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'");
1408 }
1409}
1410
1411
1412double
1414 // get tag property
1415 const auto& tagProperty = myPlanElement->getTagProperty();
1416 // declare plan parent
1417 const auto planParent = myPlanElement->getParentDemandElements().at(0);
1418 // continue depending of key
1419 switch (key) {
1421 if (tagProperty.planStoppingPlace()) {
1422 // use startpos of stoppingPlace parent (stops)
1423 return myPlanElement->getParentStoppingPlaces().front()->getAttributeDouble(SUMO_ATTR_STARTPOS);
1424 } else if (tagProperty.planFromStoppingPlace()) {
1425 // use end position of stoppingPlace parent (for plans that starts in stoppingPlaces)
1426 return myPlanElement->getParentStoppingPlaces().front()->getAttributeDouble(SUMO_ATTR_ENDPOS);
1427 } else if (tagProperty.planFromTAZ()) {
1428 return 0;
1429 } else if (tagProperty.planFromJunction()) {
1430 return -1;
1431 } else {
1432 // get previous plan element
1433 const auto previousPlan = planParent->getPreviousChildDemandElement(myPlanElement);
1434 // continue depending of previous plan
1435 if (previousPlan) {
1436 // use previous plan end position (normally the arrival position)
1437 const auto posOverLane = previousPlan->getAttributeDouble(GNE_ATTR_PLAN_GEOMETRY_ENDPOS);
1438 // if posOverLane is -1, means that previousPlan ends in the end of lane.
1439 if (posOverLane == -1) {
1440 // INVALID_DOUBLE will put the startPositio at the end of line
1441 return INVALID_DOUBLE;
1442 } else {
1443 return previousPlan->getAttributeDouble(GNE_ATTR_PLAN_GEOMETRY_ENDPOS);
1444 }
1445 } else {
1446 // use depart position defined in parent (person or container)
1447 return planParent->getAttributeDouble(SUMO_ATTR_DEPARTPOS);
1448 }
1449 }
1450 }
1452 // continue depending of parents
1453 if (tagProperty.planStoppingPlace()) {
1454 // use end position of the stoppingPlace (stops)
1455 return myPlanElement->getParentStoppingPlaces().back()->getAttributeDouble(SUMO_ATTR_ENDPOS);
1456 } else if (tagProperty.planToStoppingPlace()) {
1457 // use start position of the stoppingPlace (for elements that ends in stoppingPlaces)
1458 return myPlanElement->getParentStoppingPlaces().back()->getAttributeDouble(SUMO_ATTR_STARTPOS);
1459 } else if (tagProperty.planToJunction() || tagProperty.planToTAZ()) {
1460 // junctions and TAZs return always -1
1461 return -1;
1462 } else if ((tagProperty.isPlanStopPerson() || tagProperty.isPlanStopContainer()) && tagProperty.planEdge()) {
1463 // elements that ends in stop always uses the end (arrival) position of the stops over edges
1464 return myArrivalPosition;
1465 } else {
1466 // check if next plan is a stop over edge
1467 const auto nextPlan = planParent->getNextChildDemandElement(myPlanElement);
1468 if (nextPlan && (nextPlan->getTagProperty().isPlanStopPerson() ||
1469 nextPlan->getTagProperty().isPlanStopContainer()) &&
1470 nextPlan->getTagProperty().planEdge()) {
1471 // if next plan is an stop over stoppingPlaces, use ends of stoppingPlace
1472 return nextPlan->getAttributeDouble(GNE_ATTR_PLAN_GEOMETRY_ENDPOS);
1473 } else {
1474 // use arrival position
1475 return myArrivalPosition;
1476 }
1477 }
1479 return myDepartPosition;
1480 case SUMO_ATTR_ENDPOS:
1482 return myArrivalPosition;
1483 default:
1484 throw InvalidArgument(myPlanElement->getTagStr() + " doesn't have a doubleattribute of type '" + toString(key) + "'");
1485 }
1486}
1487
1488
1491 // get tag property
1492 const auto& tagProperty = myPlanElement->getTagProperty();
1493 // declare plan parent
1494 const auto planParent = myPlanElement->getParentDemandElements().at(0);
1495 // continue depending of key
1496 switch (key) {
1498 // get previous plan
1499 const auto previousPlan = planParent->getPreviousChildDemandElement(myPlanElement);
1500 if (previousPlan && previousPlan->getTagProperty().isPlanStop() && previousPlan->getTagProperty().planStoppingPlace()) {
1501 return previousPlan->getParentStoppingPlaces().front()->getAdditionalGeometry().getShape().back();
1502 }
1503 // continue depending of from element
1504 if (tagProperty.planStoppingPlace()) {
1505 return myPlanElement->getParentStoppingPlaces().front()->getAdditionalGeometry().getShape().front();
1506 } else if (tagProperty.planFromStoppingPlace()) {
1507 return myPlanElement->getParentStoppingPlaces().front()->getAdditionalGeometry().getShape().back();
1508 } else if (tagProperty.planFromJunction()) {
1509 // junction view position
1510 return myPlanElement->getParentJunctions().front()->getPositionInView();
1511 } else if (tagProperty.planFromTAZ()) {
1512 if (myPlanElement->getParentTAZs().front()->getAttribute(SUMO_ATTR_CENTER).empty()) {
1513 return myPlanElement->getParentTAZs().front()->getAttributePosition(GNE_ATTR_TAZ_CENTROID);
1514 } else {
1515 return myPlanElement->getParentTAZs().front()->getAttributePosition(SUMO_ATTR_CENTER);
1516 }
1517 } else if (tagProperty.planConsecutiveEdges() || tagProperty.planRoute() || tagProperty.planFromEdge()) {
1518 // get first path lane
1519 const auto firstLane = myPlanElement->getFirstPathLane();
1520 // check if first lane exists
1521 if (firstLane == nullptr) {
1522 return Position::INVALID;
1523 }
1524 // declare lane position
1525 double lanePosition = 0;
1526 // continue depending of conditions
1527 if (previousPlan) {
1528 // use previous geometry end position
1529 lanePosition = previousPlan->getAttributeDouble(GNE_ATTR_PLAN_GEOMETRY_ENDPOS);
1530 } else {
1531 // use departPos defined in planParent
1532 lanePosition = planParent->getAttributeDouble(SUMO_ATTR_DEPARTPOS);
1533 }
1534 // get lane shape
1535 const auto& laneShape = firstLane->getLaneShape();
1536 // continue depending of lane position
1537 if (lanePosition <= 0) {
1538 return laneShape.front();
1539 } else if (lanePosition >= laneShape.length2D()) {
1540 return laneShape.back();
1541 } else {
1542 return laneShape.positionAtOffset2D(lanePosition);
1543 }
1544 } else {
1545 return Position::INVALID;
1546 }
1547 }
1549 // check parents
1550 if (tagProperty.planToJunction()) {
1551 // junctions
1552 return myPlanElement->getParentJunctions().back()->getPositionInView();
1553 } else if (tagProperty.planStoppingPlace()) {
1554 // get additional back shape (stops)
1555 return myPlanElement->getParentStoppingPlaces().back()->getAdditionalGeometry().getShape().back();
1556 } else if (tagProperty.planToStoppingPlace()) {
1557 // get additional front shape
1558 return myPlanElement->getParentStoppingPlaces().back()->getAdditionalGeometry().getShape().front();
1559 } else if (tagProperty.planToTAZ()) {
1560 // taz
1561 if (myPlanElement->getParentTAZs().back()->getAttribute(SUMO_ATTR_CENTER).empty()) {
1562 return myPlanElement->getParentTAZs().back()->getAttributePosition(GNE_ATTR_TAZ_CENTROID);
1563 } else {
1564 return myPlanElement->getParentTAZs().back()->getAttributePosition(SUMO_ATTR_CENTER);
1565 }
1566 } else if (tagProperty.planConsecutiveEdges() || tagProperty.planRoute() || tagProperty.planFromEdge()) {
1567 // get next plan
1568 const auto nextPlan = planParent->getNextChildDemandElement(myPlanElement);
1569 // if next plan exist, then use their first lane (needed to maintain connectivity with rides)
1570 const auto lastLane = nextPlan ? nextPlan->getFirstPathLane() : myPlanElement->getLastPathLane();
1571 // check if last lane exists
1572 if (lastLane == nullptr) {
1573 return Position::INVALID;
1574 }
1575 // get lane shape
1576 const auto& laneShape = lastLane->getLaneShape();
1577 // continue depending of arrival position
1578 if (nextPlan && nextPlan->getTagProperty().isPlanStop()) {
1579 return nextPlan->getAttributePosition(GNE_ATTR_PLAN_GEOMETRY_ENDPOS);
1580 } else if (myArrivalPosition == 0) {
1581 return laneShape.front();
1582 } else if ((myArrivalPosition == -1) || (myArrivalPosition >= laneShape.length2D())) {
1583 return laneShape.back();
1584 } else {
1585 return laneShape.positionAtOffset2D(myArrivalPosition);
1586 }
1587 } else {
1588 return Position::INVALID;
1589 }
1590 }
1591 default:
1592 throw InvalidArgument(myPlanElement->getTagStr() + " doesn't have a position attribute of type '" + toString(key) + "'");
1593 }
1594}
1595
1596
1597void
1598GNEDemandElementPlan::setPlanAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList) {
1599 // continue depending of key
1600 switch (key) {
1601 // common attributes
1604 case SUMO_ATTR_ENDPOS:
1605 case GNE_ATTR_PARENT:
1606 case GNE_ATTR_SELECTED:
1608 break;
1609 default:
1610 throw InvalidArgument(myPlanElement->getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'");
1611 }
1612}
1613
1614
1615bool
1616GNEDemandElementPlan::isPlanValid(SumoXMLAttr key, const std::string& value) {
1617 // continue depending of key
1618 switch (key) {
1619 // common attributes
1620 case GNE_ATTR_PARENT:
1621 return false;
1624 if (value.empty()) {
1625 return true;
1626 } else if (GNEAttributeCarrier::canParse<double>(value)) {
1627 return GNEAttributeCarrier::parse<double>(value) >= 0;
1628 } else {
1629 return false;
1630 }
1631 case SUMO_ATTR_ENDPOS:
1632 return GNEAttributeCarrier::canParse<double>(value);
1633 case GNE_ATTR_SELECTED:
1634 return GNEAttributeCarrier::canParse<bool>(value);
1635 default:
1636 throw InvalidArgument(myPlanElement->getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'");
1637 }
1638}
1639
1640
1641bool
1643 switch (key) {
1644 // edges
1645 case SUMO_ATTR_EDGES:
1646 // edge
1647 case SUMO_ATTR_EDGE:
1648 // route
1649 case SUMO_ATTR_ROUTE:
1650 // from
1651 case SUMO_ATTR_FROM:
1653 case SUMO_ATTR_FROM_TAZ:
1659 // to
1660 case SUMO_ATTR_TO:
1662 case SUMO_ATTR_TO_TAZ:
1663 case SUMO_ATTR_BUS_STOP:
1668 // depart pos (temporal, probably will be removed)
1670 return false;
1671 default:
1672 return true;
1673 }
1674}
1675
1676
1677void
1679 switch (key) {
1680 // from-to attributes (needed if we're replacing junction by geometry points and similar operations)
1681 case SUMO_ATTR_FROM:
1683 break;
1684 case SUMO_ATTR_TO:
1686 break;
1687 // Common plan attributes
1688 case GNE_ATTR_PARENT:
1689 replacePlanParent(value);
1690 break;
1692 if (value.empty()) {
1693 myDepartPosition = -1;
1694 } else {
1695 myDepartPosition = GNEAttributeCarrier::parse<double>(value);
1696 }
1697 break;
1698 case SUMO_ATTR_ENDPOS:
1700 if (value.empty()) {
1701 myArrivalPosition = -1;
1702 } else {
1703 myArrivalPosition = GNEAttributeCarrier::parse<double>(value);
1704 }
1705 break;
1706 case GNE_ATTR_SELECTED:
1707 if (GNEAttributeCarrier::parse<bool>(value)) {
1709 } else {
1711 }
1712 // check if compute geometry and path
1713 if (!myPlanElement->isTemplate()) {
1716 }
1717 break;
1718 default:
1719 throw InvalidArgument(myPlanElement->getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'");
1720 }
1721}
1722
1723
1724std::string
1726 // get tag property
1727 const auto& tagProperty = myPlanElement->getTagProperty();
1728 // declare result
1729 std::string result;
1730 // clear result
1731 int index = 0;
1732 while (tagProperty.getTagStr().at(index) != ':') {
1733 result.push_back(tagProperty.getTagStr().at(index));
1734 index++;
1735 }
1736 result += ": ";
1737 // continue depending of attributes
1738 if (tagProperty.planConsecutiveEdges()) {
1739 // edges
1740 return result + myPlanElement->getParentEdges().front()->getID() + " ... " + myPlanElement->getParentEdges().back()->getID();
1741 } else if (tagProperty.planRoute()) {
1742 // route
1743 return result + myPlanElement->getParentDemandElements().at(1)->getID();
1744 } else if (tagProperty.planEdge()) {
1745 // edge
1746 return result + myPlanElement->getParentEdges().front()->getID();
1747 } else if (tagProperty.planStoppingPlace()) {
1748 // stoppingPlace
1749 return myPlanElement->getParentStoppingPlaces().front()->getID();
1750 } else {
1751 // stoppingPlace
1752 if (tagProperty.planFromStoppingPlace()) {
1753 result += myPlanElement->getParentStoppingPlaces().front()->getID();
1754 }
1755 // TAZ
1756 if (tagProperty.planFromTAZ()) {
1757 result += myPlanElement->getParentTAZs().front()->getID();
1758 }
1759 // junction
1760 if (tagProperty.planFromJunction()) {
1761 result += myPlanElement->getParentJunctions().front()->getID();
1762 }
1763 // edge
1764 if (tagProperty.planFromEdge()) {
1765 result += myPlanElement->getParentEdges().front()->getID();
1766 }
1767 // arrow
1768 result += " -> ";
1769 // stoppingPlace
1770 if (tagProperty.planToStoppingPlace()) {
1771 result += myPlanElement->getParentStoppingPlaces().back()->getID();
1772 }
1773 // TAZ
1774 if (tagProperty.planToTAZ()) {
1775 result += myPlanElement->getParentTAZs().back()->getID();
1776 }
1777 // junction
1778 if (tagProperty.planToJunction()) {
1779 result += myPlanElement->getParentJunctions().back()->getID();
1780 }
1781 // edge
1782 if (tagProperty.planToEdge()) {
1783 result += myPlanElement->getParentEdges().back()->getID();
1784 }
1785 return result;
1786 }
1787}
1788
1789
1790bool
1792 const auto viewNet = myPlanElement->getNet()->getViewNet();
1793 const auto& inspectedElements = viewNet->getInspectedElements();
1794 // check conditions
1795 if (viewNet->getEditModes().isCurrentSupermodeNetwork() &&
1796 viewNet->getNetworkViewOptions().showDemandElements() &&
1797 viewNet->getDemandViewOptions().showAllPersonPlans()) {
1798 // show all person plans in network mode
1799 return true;
1800 } else if (viewNet->getEditModes().isCurrentSupermodeDemand() &&
1801 viewNet->getDemandViewOptions().showAllPersonPlans()) {
1802 // show all person plans
1803 return true;
1804 } else if (viewNet->getEditModes().isCurrentSupermodeDemand() && myPlanElement->isAttributeCarrierSelected()) {
1805 // show selected
1806 return true;
1807 } else if (inspectedElements.isACInspected(myPlanElement->getParentDemandElements().front())) {
1808 // person parent is inspected
1809 return true;
1810 } else if (viewNet->getDemandViewOptions().getLockedPerson() == myPlanElement->getParentDemandElements().front()) {
1811 // person parent is locked
1812 return true;
1813 } else {
1814 // check if parent
1815 if (inspectedElements.getFirstAC() && inspectedElements.getFirstAC()->getTagProperty().isPlanPerson() &&
1816 (inspectedElements.getFirstAC()->getAttribute(GNE_ATTR_PARENT) == myPlanElement->getAttribute(GNE_ATTR_PARENT))) {
1817 // common person parent
1818 return true;
1819 } else {
1820 // all conditions are false
1821 return false;
1822 }
1823 }
1824}
1825
1826
1827bool
1829 const auto viewNet = myPlanElement->getNet()->getViewNet();
1830 const auto& inspectedElements = viewNet->getInspectedElements();
1831 // check conditions
1832 if (viewNet->getEditModes().isCurrentSupermodeNetwork() &&
1833 viewNet->getNetworkViewOptions().showDemandElements() &&
1834 viewNet->getDemandViewOptions().showAllContainerPlans()) {
1835 // show all container plans in network mode
1836 return true;
1837 } else if (viewNet->getEditModes().isCurrentSupermodeDemand() &&
1838 viewNet->getDemandViewOptions().showAllContainerPlans()) {
1839 // show all container plans
1840 return true;
1841 } else if (viewNet->getEditModes().isCurrentSupermodeDemand() && myPlanElement->isAttributeCarrierSelected()) {
1842 // show selected
1843 return true;
1844 } else if (inspectedElements.isACInspected(myPlanElement->getParentDemandElements().front())) {
1845 // container parent is inspected
1846 return true;
1847 } else if (viewNet->getDemandViewOptions().getLockedContainer() == myPlanElement->getParentDemandElements().front()) {
1848 // container parent is locked
1849 return true;
1850 } else {
1851 // check if parent is inspected
1852 if (inspectedElements.getFirstAC() && inspectedElements.getFirstAC()->getTagProperty().isPlanContainer() &&
1853 (inspectedElements.getFirstAC()->getAttribute(GNE_ATTR_PARENT) == myPlanElement->getAttribute(GNE_ATTR_PARENT))) {
1854 // common container parent
1855 return true;
1856 } else {
1857 // all conditions are false
1858 return false;
1859 }
1860 }
1861}
1862
1863
1864void
1865GNEDemandElementPlan::drawPlanGL(const bool drawPlan, const GUIVisualizationSettings& s, const RGBColor& planColor, const RGBColor& planSelectedColor) const {
1866 const auto viewNet = myPlanElement->getNet()->getViewNet();
1867 const auto& inspectedElements = viewNet->getInspectedElements();
1868 // get plan parent
1869 const GNEDemandElement* planParent = myPlanElement->getParentDemandElements().front();
1870 // get tag property
1871 const auto& tagProperty = myPlanElement->getTagProperty();
1872 // get plan geometry
1873 auto& planGeometry = myPlanElement->myDemandElementGeometry;
1874 // draw relations between TAZs
1875 if (drawPlan && (planGeometry.getShape().size() > 0)) {
1876 // draw boundary
1877 if (s.drawBoundaries) {
1879 }
1880 // get detail level
1881 const auto d = s.getDetailLevel(1);
1882 // check if draw with double width
1883 const bool drawHalfWidth = ((inspectedElements.getFirstAC() != myPlanElement) && (inspectedElements.getFirstAC() != planParent) && !gViewObjectsHandler.isObjectSelected(myPlanElement));
1884 // calculate path width
1885 double pathWidth = s.widthSettings.walkWidth;
1886 if (tagProperty.isPlanRide()) {
1887 pathWidth = s.widthSettings.rideWidth;
1888 } else if (tagProperty.isPlanPersonTrip()) {
1889 pathWidth = s.widthSettings.personTripWidth;
1890 }
1891 // draw geometry only if we'rent in drawForObjectUnderCursor mode
1892 if ((tagProperty.isPlanPerson() && s.checkDrawPerson(d, myPlanElement->isAttributeCarrierSelected())) ||
1893 (tagProperty.isPlanContainer() && s.checkDrawContainer(d, myPlanElement->isAttributeCarrierSelected()))) {
1894 // push matrix
1896 // translate to front
1897 viewNet->drawTranslateFrontAttributeCarrier(myPlanElement, GLO_TAZ + 1);
1898 // set color
1899 GLHelper::setColor(myPlanElement->drawUsingSelectColor() ? planSelectedColor : planColor);
1900 // draw line
1901 GUIGeometry::drawGeometry(d, planGeometry, pathWidth * (drawHalfWidth ? 1 : 2));
1902 if (drawHalfWidth) {
1903 GLHelper::drawTriangleAtEnd(planGeometry.getShape().front(), planGeometry.getShape().back(), 0.5, 0.5, 0.5);
1904 } else {
1905 GLHelper::drawTriangleAtEnd(planGeometry.getShape().front(), planGeometry.getShape().back(), 1, 1, 1);
1906 }
1907 // pop matrix
1909 // draw dotted contour
1911 }
1912 // calculate contour and draw dotted geometry
1913 myPlanContour.calculateContourExtrudedShape(s, d, myPlanElement, planGeometry.getShape(), myPlanElement->getType(), pathWidth * 2, 1, true, true, 0, nullptr);
1914 // calculate contour for end
1915 myPlanContourEnd.calculateContourCircleShape(s, d, myPlanElement, planGeometry.getShape().back(), 1, myPlanElement->getType(), 1);
1916 }
1917 // check if draw plan parent
1918 if (planParent->getPreviousChildDemandElement(myPlanElement) == nullptr) {
1919 planParent->drawGL(s);
1920 }
1921}
1922
1923
1924void
1926 const double offsetFront, const double planWidth, const RGBColor& planColor, const RGBColor& planSelectedColor) const {
1927 const auto viewNet = myPlanElement->getNet()->getViewNet();
1928 const auto& inspectedElements = viewNet->getInspectedElements();
1929 // get tag property
1930 const auto& tagProperty = myPlanElement->getTagProperty();
1931 // get plan parent
1932 const GNEDemandElement* planParent = myPlanElement->getParentDemandElements().front();
1933 // check if draw plan element can be drawn
1934 if (drawPlan && segment->getLane() && myPlanElement->getNet()->getDemandPathManager()->getPathDraw()->checkDrawPathGeometry(s, segment->getLane(), tagProperty.getTag())) {
1935 // draw boundary
1936 if (tagProperty.isPlacedInRTree() && s.drawBoundaries) {
1938 }
1939 // get detail level
1940 const auto d = s.getDetailLevel(1);
1941 // declare path geometry
1942 GUIGeometry planGeometry;
1943 // update pathGeometry depending of first and last segment
1944 if (segment->isFirstSegment() && segment->isLastSegment()) {
1945 if (tagProperty.planFromTAZ()) {
1946 planGeometry.updateGeometry(segment->getLane()->getLaneGeometry().getShape(),
1951 } else if (tagProperty.planToTAZ()) {
1952 planGeometry.updateGeometry(segment->getLane()->getLaneGeometry().getShape(),
1957 } else {
1958 planGeometry.updateGeometry(segment->getLane()->getLaneGeometry().getShape(),
1963 }
1964 } else if (segment->isFirstSegment()) {
1965 planGeometry.updateGeometry(segment->getLane()->getLaneGeometry().getShape(),
1968 -1,
1970 } else if (segment->isLastSegment()) {
1971 planGeometry.updateGeometry(segment->getLane()->getLaneGeometry().getShape(),
1972 -1,
1976 } else {
1977 planGeometry = segment->getLane()->getLaneGeometry();
1978 }
1979 // calculate path width double
1980 const double drawingWidth = s.addSize.getExaggeration(s, segment->getLane()) * planWidth * 2;
1981 // check if draw with double width
1982 const bool drawHalfWidth = ((inspectedElements.getFirstAC() != myPlanElement) && (inspectedElements.getFirstAC() != planParent) && !gViewObjectsHandler.isObjectSelected(myPlanElement));
1983 // get end pos radius
1984 const double endPosRadius = getEndPosRadius(s, segment, drawHalfWidth);
1985 // draw geometry only if we'rent in drawForObjectUnderCursor mode
1986 if ((tagProperty.isPlanPerson() && s.checkDrawPerson(d, myPlanElement->isAttributeCarrierSelected())) ||
1987 (tagProperty.isPlanContainer() && s.checkDrawContainer(d, myPlanElement->isAttributeCarrierSelected()))) {
1988 // Add a draw matrix
1990 // Start with the drawing of the area traslating matrix to origin
1991 viewNet->drawTranslateFrontAttributeCarrier(myPlanElement, myPlanElement->getType(), offsetFront);
1992 // Set color
1993 GLHelper::setColor(myPlanElement->drawUsingSelectColor() ? planSelectedColor : planColor);
1994 // draw geometry depending of drawWithDoubleWidth
1995 GUIGeometry::drawGeometry(d, planGeometry, drawingWidth * (drawHalfWidth ? 0.5 : 1));
1996 // draw red arrows
1997 drawFromArrow(s, segment->getLane(), segment);
1998 drawToArrow(s, segment->getLane(), segment);
1999 // Pop last matrix
2001 // Draw name if isn't being drawn for selecting
2003 // draw dotted contour
2005 // draw TAZ Center dotted contour
2007 }
2008 // declare trim geometry to draw
2009 const auto& shape = (segment->isFirstSegment() || segment->isLastSegment()) ? planGeometry.getShape() : segment->getLane()->getLaneShape();
2010 // calculate contour and draw dotted geometry (always with double width)
2011 if (segment->isFirstSegment()) {
2012 segment->getContour()->calculateContourExtrudedShape(s, d, myPlanElement, shape, myPlanElement->getType(), drawingWidth, 1, true, false, 0, segment);
2013 } else if (segment->isLastSegment()) {
2014 segment->getContour()->calculateContourExtrudedShape(s, d, myPlanElement, shape, myPlanElement->getType(), drawingWidth, 1, false, false, 0, segment);
2015 // calculate contour for end
2017 } else {
2018 segment->getContour()->calculateContourExtrudedShape(s, d, myPlanElement, shape, myPlanElement->getType(), drawingWidth, 1, false, false, 0, segment);
2019 }
2020 // check if add this path element to redraw buffer
2023 }
2024 }
2025 // check if draw plan parent
2026 if (planParent->getPreviousChildDemandElement(myPlanElement) == nullptr) {
2027 planParent->drawGL(s);
2028 }
2029}
2030
2031
2032void
2034 const double offsetFront, const double planWidth, const RGBColor& planColor, const RGBColor& planSelectedColor) const {
2035 const auto viewNet = myPlanElement->getNet()->getViewNet();
2036 const auto& inspectedElements = viewNet->getInspectedElements();
2037 // get tag property
2038 const auto& tagProperty = myPlanElement->getTagProperty();
2039 // get plan parent
2040 const GNEDemandElement* planParent = myPlanElement->getParentDemandElements().front();
2041 // check if draw plan elements can be drawn
2042 if (drawPlan && myPlanElement->getNet()->getDemandPathManager()->getPathDraw()->checkDrawPathGeometry(s, segment, tagProperty.getTag())) {
2043 // draw boundary
2044 if (tagProperty.isPlacedInRTree() && s.drawBoundaries) {
2046 }
2047 // get detail level
2048 const auto d = s.getDetailLevel(1);
2049 // calculate path width double
2050 const double pathWidthDouble = s.addSize.getExaggeration(s, segment->getLane()) * planWidth * 2;
2051 // check if draw with double width
2052 const bool drawWithDoubleWidth = ((inspectedElements.getFirstAC() == myPlanElement) || (inspectedElements.getFirstAC() == planParent) || gViewObjectsHandler.isObjectSelected(myPlanElement));
2053 // draw geometry only if we'rent in drawForObjectUnderCursor mode
2055 // push a draw matrix
2057 // Start with the drawing of the area traslating matrix to origin
2058 viewNet->drawTranslateFrontAttributeCarrier(myPlanElement, myPlanElement->getType(), offsetFront);
2059 // Set plan color
2060 GLHelper::setColor(myPlanElement->drawUsingSelectColor() ? planSelectedColor : planColor);
2061 // check if draw lane2lane connection or a red line
2062 if (segment->getPreviousLane() && segment->getNextLane()) {
2063 if (segment->getPreviousLane()->getLane2laneConnections().exist(segment->getNextLane())) {
2064 // obtain lane2lane geometry
2065 const GUIGeometry& lane2laneGeometry = segment->getPreviousLane()->getLane2laneConnections().getLane2laneGeometry(segment->getNextLane());
2066 // draw lane2lane
2067 GUIGeometry::drawGeometry(d, lane2laneGeometry, pathWidthDouble * (drawWithDoubleWidth ? 1 : 0.5));
2068 } else {
2069 // Set invalid plan color
2071 // draw line between end of first shape and first position of second shape
2072 GLHelper::drawBoxLines({segment->getPreviousLane()->getLaneShape().back(), segment->getNextLane()->getLaneShape().front()}, (0.5 * pathWidthDouble * (drawWithDoubleWidth ? 1 : 0.5)));
2073 }
2074 } else if (segment->getPreviousLane()) {
2075 // draw line between center of junction and last lane shape
2076 GLHelper::drawBoxLines({segment->getPreviousLane()->getLaneShape().back(), myPlanElement->getParentJunctions().back()->getPositionInView()}, pathWidthDouble * (drawWithDoubleWidth ? 1 : 0.5));
2077 } else if (segment->getNextLane()) {
2078 // draw line between center of junction and first lane shape
2079 GLHelper::drawBoxLines({myPlanElement->getParentJunctions().front()->getPositionInView(), segment->getNextLane()->getLaneShape().front()}, pathWidthDouble * (drawWithDoubleWidth ? 1 : 0.5));
2080 }
2081 // Pop last matrix
2083 // draw lock icon
2085 // draw dotted contour
2087 }
2088 // check if shape dotted contour has to be drawn
2089 if (segment->getPreviousLane() && segment->getNextLane()) {
2090 if (segment->getPreviousLane()->getLane2laneConnections().exist(segment->getNextLane())) {
2091 // get shape
2092 const auto& shape = segment->getPreviousLane()->getLane2laneConnections().getLane2laneGeometry(segment->getNextLane()).getShape();
2093 // calculate contour and draw dotted geometry (always with double width)
2094 segment->getContour()->calculateContourExtrudedShape(s, d, myPlanElement, shape, myPlanElement->getType(), pathWidthDouble, 1, false, false, 0, segment);
2095 }
2096 } else if (segment->getPreviousLane()) {
2097 segment->getContour()->calculateContourExtrudedShape(s, d, myPlanElement, {segment->getPreviousLane()->getLaneShape().back(), myPlanElement->getParentJunctions().back()->getPositionInView()},
2098 myPlanElement->getType(), pathWidthDouble, 1, false, true, 0, segment);
2099 } else if (segment->getNextLane()) {
2100 segment->getContour()->calculateContourExtrudedShape(s, d, myPlanElement, {myPlanElement->getParentJunctions().front()->getPositionInView(), segment->getNextLane()->getLaneShape().front()},
2101 myPlanElement->getType(), pathWidthDouble, 1, true, false, 0, segment);
2102 }
2103 // check if add this path element to redraw buffer
2106 }
2107 }
2108 // check if draw plan parent
2109 if (planParent->getPreviousChildDemandElement(myPlanElement) == nullptr) {
2110 planParent->drawGL(s);
2111 }
2112}
2113
2114
2117 // get previous plan
2118 const auto previousPlan = myPlanElement->getParentDemandElements().at(0)->getPreviousChildDemandElement(myPlanElement);
2119 if (previousPlan) {
2120 // get previous lane
2121 const auto previousLastLane = previousPlan->getLastPathLane();
2122 // get first lane
2123 const auto firstLane = myPlanElement->getFirstPathLane();
2124 // compare edges
2125 if (previousLastLane && firstLane && (previousLastLane->getParentEdge() != firstLane->getParentEdge())) {
2127 }
2128 // in the future, check more elements
2129 }
2130 // get next child
2131 const auto nextPlan = myPlanElement->getParentDemandElements().at(0)->getNextChildDemandElement(myPlanElement);
2132 if (nextPlan) {
2133 // get previous lane
2134 const auto nextFirstLane = nextPlan->getFirstPathLane();
2135 // get first lane
2136 const auto lastLane = myPlanElement->getLastPathLane();
2137 // compare edges
2138 if (nextFirstLane && lastLane && (nextFirstLane->getParentEdge() != lastLane->getParentEdge())) {
2140 }
2141 // in the future, check more elements
2142 }
2143 // all ok, then return true
2145}
2146
2147
2148std::string
2150 // get previous plan
2151 const auto previousPlan = myPlanElement->getParentDemandElements().at(0)->getPreviousChildDemandElement(myPlanElement);
2152 if (previousPlan) {
2153 // get previous lane
2154 const auto previousLastLane = previousPlan->getLastPathLane();
2155 // get first lane
2156 const auto firstLane = myPlanElement->getLastPathLane();
2157 // compare edges
2158 if (previousLastLane && firstLane && (previousLastLane->getParentEdge() != firstLane->getParentEdge())) {
2159 return TLF("Edge '%' is not consecutive with edge '%'", previousLastLane->getParentEdge()->getID(), firstLane->getParentEdge()->getID());
2160 }
2161 // in the future, check more elements
2162 }
2163 // get next child
2164 const auto nextPlan = myPlanElement->getParentDemandElements().at(0)->getNextChildDemandElement(myPlanElement);
2165 if (nextPlan) {
2166 // get previous lane
2167 const auto nextFirstLane = nextPlan->getFirstPathLane();
2168 // get first lane
2169 const auto lastLane = myPlanElement->getLastPathLane();
2170 // compare edges
2171 if (nextFirstLane && lastLane && (nextFirstLane->getParentEdge() != lastLane->getParentEdge())) {
2172 return TLF("Edge '%' is not consecutive with edge '%'", nextFirstLane->getParentEdge()->getID(), lastLane->getParentEdge()->getID());
2173 }
2174 // in the future, check more elements
2175 }
2176 // undefined problem
2177 return "undefined problem";
2178}
2179
2180
2181double
2182GNEDemandElementPlan::getEndPosRadius(const GUIVisualizationSettings& s, const GNESegment* segment, const bool drawHalfWidth) const {
2183 // check if myPlanElement is the last segment
2184 if (segment->isLastSegment()) {
2185 // calculate circle width
2186 const double circleRadius = (drawHalfWidth ? myArrivalPositionDiameter * 0.5 : myArrivalPositionDiameter);
2187 return circleRadius * MIN2((double)0.5, s.laneWidthExaggeration);
2188 } else {
2189 return -1;
2190 }
2191}
2192
2193
2194void
2196 // draw ifcurrent amd next segment is placed over lanes
2197 if (segment->getNextLane()) {
2198 // get firstPosition (last position of current lane shape)
2199 const Position from = lane->getLaneShape().back();
2200 // get lastPosition (first position of next lane shape)
2201 const Position to = segment->getNextLane()->getLaneShape().front();
2202 // push draw matrix
2204 // move front
2205 glTranslated(0, 0, 4);
2206 // draw child line
2208 // pop draw matrix
2210 }
2211}
2212
2213
2214void
2216 // draw the line if previos segment and current segment is placed over lanes
2217 if (segment->getPreviousLane()) {
2218 // get firstPosition (last position of current lane shape)
2219 const Position from = lane->getLaneShape().front();
2220 // get lastPosition (first position of next lane shape)
2221 const Position to = segment->getPreviousLane()->getLaneShape().back();
2222 // push draw matrix
2224 // move front
2225 glTranslated(0, 0, 4);
2226 // draw child line
2228 // pop draw matrix
2230 }
2231}
2232
2233
2234void
2236 // check if myPlanElement is the last segment
2237 if (!s.drawForRectangleSelection && (endPosRadius > 0)) {
2239 // push draw matrix
2241 // translate to pos and move to
2242 glTranslated(geometryEndPos.x(), geometryEndPos.y(), 4);
2243 // resolution of drawn circle depending of the zoom (To improve smothness)
2244 GLHelper::drawFilledCircleDetailled(d, endPosRadius);
2245 // pop draw matrix
2247 }
2248}
2249
2250
2251bool
2252GNEDemandElementPlan::replacePlanParent(const std::string& newParentID) {
2253 std::vector<SumoXMLTag> tags;
2255 tags.push_back(SUMO_TAG_PERSON);
2256 tags.push_back(SUMO_TAG_PERSONFLOW);
2257 } else {
2258 tags.push_back(SUMO_TAG_CONTAINER);
2259 tags.push_back(SUMO_TAG_CONTAINERFLOW);
2260 }
2261 // search new parent and set it
2262 for (const auto& tag : tags) {
2263 if (myPlanElement->getNet()->getAttributeCarriers()->retrieveDemandElement(tag, newParentID, false) != nullptr) {
2264 myPlanElement->replaceDemandElementParent(tag, newParentID, 0);
2265 return true;
2266 }
2267 }
2268 throw ProcessError("Invalid new parent ID");
2269}
2270
2271/****************************************************************************/
@ MID_COPY_TYPED_NAME
Copy typed object name - popup entry.
Definition GUIAppEnum.h:455
@ MID_COPY_NAME
Copy object name - popup entry.
Definition GUIAppEnum.h:453
@ GLO_TAZ
Traffic Assignment Zones (TAZs)
GUIViewObjectsHandler gViewObjectsHandler
@ RIDE_JUNCTION
@ RIDE_CHARGINGSTATION
@ WALK_CONTAINERSTOP
@ PERSONTRIP_JUNCTION
@ TRANSHIP_BUSSTOP
@ TRANSHIP_CHARGINGSTATION
@ TRANSHIP_TRAINSTOP
@ TRANSHIP_TAZ
@ PERSONTRIP_TRAINSTOP
@ WALK_TRAINSTOP
@ PERSONTRIP_BUSSTOP
@ TRANSPORT_TRAINSTOP
@ TRANSHIP_PARKINGAREA
@ TRANSPORT_CONTAINERSTOP
@ PERSONTRIP_CHARGINGSTATION
@ TRANSHIP_EDGE
@ TRANSHIP_EDGES
@ PERSONTRIP_CONTAINERSTOP
@ WALK_BUSSTOP
@ TRANSHIP_CONTAINERSTOP
@ TRANSPORT_EDGE
@ RIDE_BUSSTOP
@ RIDE_CONTAINERSTOP
@ WALK_CHARGINGSTATION
@ WALK_PARKINGAREA
@ TRANSPORT_CHARGINGSTATION
@ TRANSPORT_BUSSTOP
@ TRANSPORT_PARKINGAREA
@ PERSONTRIP_PARKINGAREA
@ RIDE_PARKINGAREA
@ RIDE_TRAINSTOP
@ TRANSPORT_TAZ
@ PERSONTRIP_TAZ
@ PERSONTRIP_EDGE
@ TRANSHIP_JUNCTION
@ WALK_JUNCTION
@ TRANSPORT_JUNCTION
#define TLF(string,...)
Definition MsgHandler.h:317
@ GNE_TAG_RIDE_CHARGINGSTATION_CHARGINGSTATION
@ GNE_TAG_TRANSHIP_TAZ_TAZ
@ GNE_TAG_TRANSPORT_CONTAINERSTOP_TRAINSTOP
@ GNE_TAG_TRANSPORT_CONTAINERSTOP_BUSSTOP
@ GNE_TAG_TRANSHIP_PARKINGAREA_BUSSTOP
@ GNE_TAG_TRANSPORT_TAZ_CONTAINERSTOP
@ GNE_TAG_TRANSHIP_PARKINGAREA_CHARGINGSTATION
@ GNE_TAG_RIDE_EDGE_TAZ
@ GNE_TAG_WALK_BUSSTOP_BUSSTOP
@ GNE_TAG_TRANSPORT_JUNCTION_CHARGINGSTATION
@ GNE_TAG_TRANSHIP_JUNCTION_EDGE
@ GNE_TAG_PERSONTRIP_EDGE_EDGE
@ GNE_TAG_PERSONTRIP_TAZ_EDGE
@ GNE_TAG_TRANSHIP_JUNCTION_CONTAINERSTOP
@ GNE_TAG_PERSONTRIP_EDGE_CONTAINERSTOP
@ GNE_TAG_WALK_EDGE_TAZ
@ GNE_TAG_WALK_PARKINGAREA_CHARGINGSTATION
@ GNE_TAG_WALK_CHARGINGSTATION_JUNCTION
@ GNE_TAG_RIDE_CHARGINGSTATION_TAZ
@ GNE_TAG_PERSONTRIP_CONTAINERSTOP_TAZ
@ GNE_TAG_RIDE_CONTAINERSTOP_BUSSTOP
@ GNE_TAG_TRANSPORT_BUSSTOP_JUNCTION
@ GNE_TAG_RIDE_BUSSTOP_BUSSTOP
@ GNE_TAG_WALK_PARKINGAREA_CONTAINERSTOP
@ GNE_TAG_PERSONTRIP_TAZ_CONTAINERSTOP
@ GNE_TAG_TRANSHIP_CHARGINGSTATION_BUSSTOP
@ GNE_TAG_PERSONTRIP_CHARGINGSTATION_TRAINSTOP
@ GNE_TAG_PERSONTRIP_EDGE_JUNCTION
@ GNE_TAG_TRANSPORT_CHARGINGSTATION_JUNCTION
@ GNE_TAG_TRANSHIP_TRAINSTOP_CHARGINGSTATION
@ GNE_TAG_RIDE_CONTAINERSTOP_CONTAINERSTOP
@ GNE_TAG_TRANSHIP_TRAINSTOP_EDGE
@ GNE_TAG_WALK_TAZ_BUSSTOP
@ GNE_TAG_PERSONTRIP_EDGE_PARKINGAREA
@ GNE_TAG_PERSONTRIP_TRAINSTOP_EDGE
@ GNE_TAG_PERSONTRIP_TRAINSTOP_CONTAINERSTOP
@ GNE_TAG_PERSONTRIP_PARKINGAREA_TRAINSTOP
@ GNE_TAG_STOPCONTAINER_TRAINSTOP
@ GNE_TAG_RIDE_JUNCTION_BUSSTOP
@ GNE_TAG_RIDE_PARKINGAREA_CONTAINERSTOP
@ GNE_TAG_PERSONTRIP_CHARGINGSTATION_PARKINGAREA
@ GNE_TAG_PERSONTRIP_TRAINSTOP_PARKINGAREA
@ GNE_TAG_TRANSPORT_TAZ_PARKINGAREA
@ GNE_TAG_PERSONTRIP_TAZ_CHARGINGSTATION
@ GNE_TAG_RIDE_CONTAINERSTOP_EDGE
@ GNE_TAG_TRANSHIP_TAZ_EDGE
@ GNE_TAG_WALK_BUSSTOP_CHARGINGSTATION
@ GNE_TAG_PERSONTRIP_BUSSTOP_EDGE
@ GNE_TAG_WALK_TRAINSTOP_CHARGINGSTATION
@ SUMO_TAG_TAZ
a traffic assignment zone
@ GNE_TAG_WALK_PARKINGAREA_TRAINSTOP
@ GNE_TAG_WALK_PARKINGAREA_PARKINGAREA
@ GNE_TAG_TRANSPORT_EDGE_TRAINSTOP
@ GNE_TAG_WALK_BUSSTOP_TRAINSTOP
@ GNE_TAG_TRANSHIP_EDGE_CHARGINGSTATION
@ GNE_TAG_PERSONTRIP_TAZ_TRAINSTOP
@ GNE_TAG_TRANSPORT_CONTAINERSTOP_CHARGINGSTATION
@ GNE_TAG_TRANSPORT_CHARGINGSTATION_TAZ
@ GNE_TAG_WALK_TAZ_CONTAINERSTOP
@ GNE_TAG_WALK_PARKINGAREA_JUNCTION
@ GNE_TAG_WALK_CONTAINERSTOP_EDGE
@ GNE_TAG_TRANSHIP_JUNCTION_BUSSTOP
@ GNE_TAG_PERSONTRIP_EDGE_CHARGINGSTATION
@ GNE_TAG_TRANSPORT_EDGE_PARKINGAREA
@ GNE_TAG_TRANSPORT_TRAINSTOP_JUNCTION
@ GNE_TAG_TRANSHIP_PARKINGAREA_JUNCTION
@ GNE_TAG_TRANSHIP_BUSSTOP_CHARGINGSTATION
@ GNE_TAG_TRANSPORT_TAZ_TRAINSTOP
@ GNE_TAG_WALK_EDGE_PARKINGAREA
@ GNE_TAG_TRANSPORT_EDGE_BUSSTOP
@ GNE_TAG_TRANSPORT_CONTAINERSTOP_EDGE
@ GNE_TAG_TRANSPORT_CHARGINGSTATION_PARKINGAREA
@ SUMO_TAG_NOTHING
invalid tag, must be the last one
@ GNE_TAG_WALK_PARKINGAREA_EDGE
@ GNE_TAG_TRANSHIP_EDGE_EDGE
@ GNE_TAG_RIDE_TAZ_EDGE
@ GNE_TAG_RIDE_TRAINSTOP_JUNCTION
@ GNE_TAG_WALK_EDGES
@ GNE_TAG_RIDE_TRAINSTOP_CONTAINERSTOP
@ GNE_TAG_TRANSPORT_JUNCTION_PARKINGAREA
@ GNE_TAG_RIDE_CHARGINGSTATION_EDGE
@ GNE_TAG_RIDE_CHARGINGSTATION_CONTAINERSTOP
@ GNE_TAG_WALK_CONTAINERSTOP_CHARGINGSTATION
@ SUMO_TAG_CONTAINERFLOW
@ GNE_TAG_TRANSHIP_PARKINGAREA_CONTAINERSTOP
@ GNE_TAG_TRANSPORT_TRAINSTOP_TAZ
@ GNE_TAG_WALK_BUSSTOP_JUNCTION
@ GNE_TAG_TRANSHIP_CHARGINGSTATION_TRAINSTOP
@ GNE_TAG_TRANSHIP_EDGE_CONTAINERSTOP
@ GNE_TAG_WALK_CONTAINERSTOP_JUNCTION
@ GNE_TAG_TRANSPORT_PARKINGAREA_PARKINGAREA
@ GNE_TAG_RIDE_EDGE_JUNCTION
@ GNE_TAG_TRANSPORT_CHARGINGSTATION_TRAINSTOP
@ GNE_TAG_TRANSPORT_TRAINSTOP_TRAINSTOP
@ GNE_TAG_RIDE_PARKINGAREA_TAZ
@ GNE_TAG_WALK_CHARGINGSTATION_TRAINSTOP
@ GNE_TAG_PERSONTRIP_BUSSTOP_CONTAINERSTOP
@ GNE_TAG_TRANSPORT_TRAINSTOP_CONTAINERSTOP
@ GNE_TAG_PERSONTRIP_PARKINGAREA_TAZ
@ GNE_TAG_STOPCONTAINER_EDGE
@ GNE_TAG_WALK_TRAINSTOP_TAZ
@ GNE_TAG_PERSONTRIP_PARKINGAREA_JUNCTION
@ GNE_TAG_TRANSPORT_JUNCTION_BUSSTOP
@ GNE_TAG_TRANSHIP_JUNCTION_PARKINGAREA
@ GNE_TAG_STOPCONTAINER_PARKINGAREA
@ GNE_TAG_PERSONTRIP_CONTAINERSTOP_TRAINSTOP
@ GNE_TAG_TRANSPORT_CHARGINGSTATION_CONTAINERSTOP
@ GNE_TAG_TRANSPORT_TRAINSTOP_CHARGINGSTATION
@ GNE_TAG_TRANSPORT_PARKINGAREA_CONTAINERSTOP
@ GNE_TAG_STOPPERSON_BUSSTOP
@ GNE_TAG_TRANSPORT_BUSSTOP_CONTAINERSTOP
@ SUMO_TAG_STOP
stop for vehicles
@ GNE_TAG_PERSONTRIP_BUSSTOP_TRAINSTOP
@ GNE_TAG_RIDE_PARKINGAREA_BUSSTOP
@ GNE_TAG_PERSONTRIP_CHARGINGSTATION_TAZ
@ GNE_TAG_RIDE_TAZ_TRAINSTOP
@ GNE_TAG_PERSONTRIP_CONTAINERSTOP_EDGE
@ GNE_TAG_TRANSHIP_CONTAINERSTOP_PARKINGAREA
@ GNE_TAG_PERSONTRIP_JUNCTION_BUSSTOP
@ GNE_TAG_TRANSHIP_BUSSTOP_CONTAINERSTOP
@ GNE_TAG_PERSONTRIP_CHARGINGSTATION_BUSSTOP
@ GNE_TAG_TRANSPORT_PARKINGAREA_EDGE
@ GNE_TAG_PERSONTRIP_TRAINSTOP_TAZ
@ GNE_TAG_RIDE_PARKINGAREA_JUNCTION
@ GNE_TAG_TRANSHIP_PARKINGAREA_TRAINSTOP
@ GNE_TAG_RIDE_JUNCTION_JUNCTION
@ GNE_TAG_WALK_BUSSTOP_CONTAINERSTOP
@ GNE_TAG_RIDE_BUSSTOP_TAZ
@ GNE_TAG_PERSONTRIP_TAZ_PARKINGAREA
@ GNE_TAG_TRANSHIP_BUSSTOP_JUNCTION
@ GNE_TAG_RIDE_JUNCTION_PARKINGAREA
@ GNE_TAG_TRANSPORT_EDGE_TAZ
@ GNE_TAG_PERSONTRIP_CONTAINERSTOP_PARKINGAREA
@ GNE_TAG_WALK_JUNCTION_PARKINGAREA
@ GNE_TAG_TRANSHIP_EDGE_TAZ
@ GNE_TAG_RIDE_TRAINSTOP_TAZ
@ GNE_TAG_RIDE_TRAINSTOP_CHARGINGSTATION
@ GNE_TAG_WALK_CHARGINGSTATION_BUSSTOP
@ GNE_TAG_PERSONTRIP_JUNCTION_TRAINSTOP
@ GNE_TAG_RIDE_JUNCTION_TRAINSTOP
@ GNE_TAG_WALK_CONTAINERSTOP_TAZ
@ GNE_TAG_PERSONTRIP_TRAINSTOP_BUSSTOP
@ GNE_TAG_TRANSHIP_BUSSTOP_EDGE
@ GNE_TAG_TRANSHIP_TRAINSTOP_JUNCTION
@ GNE_TAG_TRANSPORT_CHARGINGSTATION_CHARGINGSTATION
@ GNE_TAG_TRANSHIP_EDGE_JUNCTION
@ GNE_TAG_PERSONTRIP_BUSSTOP_JUNCTION
@ GNE_TAG_TRANSHIP_EDGES
@ GNE_TAG_TRANSHIP_TAZ_TRAINSTOP
@ GNE_TAG_WALK_JUNCTION_CONTAINERSTOP
@ GNE_TAG_STOPCONTAINER_CONTAINERSTOP
@ GNE_TAG_RIDE_TAZ_CONTAINERSTOP
@ GNE_TAG_RIDE_BUSSTOP_TRAINSTOP
@ GNE_TAG_TRANSHIP_CHARGINGSTATION_EDGE
@ GNE_TAG_PERSONTRIP_EDGE_TRAINSTOP
@ GNE_TAG_RIDE_BUSSTOP_EDGE
@ GNE_TAG_RIDE_TRAINSTOP_BUSSTOP
@ GNE_TAG_TRANSPORT_CONTAINERSTOP_TAZ
@ GNE_TAG_WALK_TRAINSTOP_EDGE
@ GNE_TAG_RIDE_EDGE_EDGE
@ GNE_TAG_PERSONTRIP_PARKINGAREA_EDGE
@ GNE_TAG_TRANSPORT_BUSSTOP_CHARGINGSTATION
@ GNE_TAG_RIDE_JUNCTION_CONTAINERSTOP
@ GNE_TAG_TRANSPORT_PARKINGAREA_TAZ
@ GNE_TAG_PERSONTRIP_PARKINGAREA_CONTAINERSTOP
@ GNE_TAG_PERSONTRIP_TRAINSTOP_TRAINSTOP
@ GNE_TAG_TRANSPORT_EDGE_EDGE
@ GNE_TAG_WALK_EDGE_TRAINSTOP
@ GNE_TAG_WALK_TAZ_CHARGINGSTATION
@ GNE_TAG_TRANSPORT_EDGE_CONTAINERSTOP
@ GNE_TAG_STOPCONTAINER_BUSSTOP
@ GNE_TAG_WALK_JUNCTION_TAZ
@ GNE_TAG_WALK_JUNCTION_CHARGINGSTATION
@ GNE_TAG_WALK_CHARGINGSTATION_TAZ
@ GNE_TAG_PERSONTRIP_TAZ_BUSSTOP
@ GNE_TAG_RIDE_PARKINGAREA_CHARGINGSTATION
@ GNE_TAG_RIDE_BUSSTOP_JUNCTION
@ GNE_TAG_PERSONTRIP_CHARGINGSTATION_JUNCTION
@ GNE_TAG_PERSONTRIP_CHARGINGSTATION_CHARGINGSTATION
@ GNE_TAG_WALK_JUNCTION_JUNCTION
@ GNE_TAG_TRANSPORT_BUSSTOP_TAZ
@ GNE_TAG_RIDE_JUNCTION_CHARGINGSTATION
@ GNE_TAG_TRANSPORT_PARKINGAREA_TRAINSTOP
@ SUMO_TAG_CONTAINER
@ GNE_TAG_TRANSHIP_PARKINGAREA_TAZ
@ GNE_TAG_TRANSHIP_PARKINGAREA_PARKINGAREA
@ GNE_TAG_WALK_CONTAINERSTOP_PARKINGAREA
@ GNE_TAG_TRANSHIP_TAZ_PARKINGAREA
@ GNE_TAG_WALK_EDGE_EDGE
@ GNE_TAG_PERSONTRIP_TAZ_TAZ
@ GNE_TAG_TRANSPORT_CONTAINERSTOP_JUNCTION
@ GNE_TAG_TRANSHIP_TAZ_BUSSTOP
@ GNE_TAG_TRANSPORT_TAZ_EDGE
@ GNE_TAG_TRANSHIP_CHARGINGSTATION_CHARGINGSTATION
@ GNE_TAG_RIDE_EDGE_CHARGINGSTATION
@ GNE_TAG_TRANSPORT_TAZ_TAZ
@ GNE_TAG_PERSONTRIP_CHARGINGSTATION_EDGE
@ GNE_TAG_PERSONTRIP_EDGE_BUSSTOP
@ GNE_TAG_TRANSPORT_EDGE_JUNCTION
@ GNE_TAG_WALK_CHARGINGSTATION_CONTAINERSTOP
@ GNE_TAG_TRANSPORT_TAZ_BUSSTOP
@ GNE_TAG_WALK_BUSSTOP_PARKINGAREA
@ GNE_TAG_WALK_CHARGINGSTATION_PARKINGAREA
@ GNE_TAG_TRANSPORT_JUNCTION_JUNCTION
@ GNE_TAG_PERSONTRIP_CHARGINGSTATION_CONTAINERSTOP
@ GNE_TAG_TRANSHIP_BUSSTOP_TRAINSTOP
@ GNE_TAG_PERSONTRIP_BUSSTOP_TAZ
@ GNE_TAG_RIDE_TAZ_PARKINGAREA
@ GNE_TAG_WALK_CONTAINERSTOP_BUSSTOP
@ GNE_TAG_RIDE_CHARGINGSTATION_PARKINGAREA
@ GNE_TAG_RIDE_CHARGINGSTATION_BUSSTOP
@ GNE_TAG_PERSONTRIP_CONTAINERSTOP_CONTAINERSTOP
@ GNE_TAG_TRANSHIP_CONTAINERSTOP_TAZ
@ GNE_TAG_TRANSPORT_CHARGINGSTATION_EDGE
@ GNE_TAG_PERSONTRIP_BUSSTOP_CHARGINGSTATION
@ GNE_TAG_WALK_BUSSTOP_EDGE
@ GNE_TAG_RIDE_JUNCTION_TAZ
@ GNE_TAG_TRANSPORT_TRAINSTOP_BUSSTOP
@ GNE_TAG_WALK_JUNCTION_TRAINSTOP
@ GNE_TAG_RIDE_TAZ_TAZ
@ GNE_TAG_TRANSHIP_EDGE_TRAINSTOP
@ GNE_TAG_TRANSHIP_TRAINSTOP_TRAINSTOP
@ GNE_TAG_RIDE_PARKINGAREA_PARKINGAREA
@ GNE_TAG_WALK_TRAINSTOP_PARKINGAREA
@ GNE_TAG_RIDE_EDGE_BUSSTOP
@ GNE_TAG_WALK_TAZ_JUNCTION
@ GNE_TAG_RIDE_TAZ_JUNCTION
@ GNE_TAG_PERSONTRIP_JUNCTION_PARKINGAREA
@ GNE_TAG_TRANSPORT_BUSSTOP_TRAINSTOP
@ GNE_TAG_TRANSPORT_TRAINSTOP_PARKINGAREA
@ GNE_TAG_TRANSPORT_PARKINGAREA_JUNCTION
@ GNE_TAG_STOPPERSON_CONTAINERSTOP
@ GNE_TAG_WALK_BUSSTOP_TAZ
@ GNE_TAG_RIDE_CONTAINERSTOP_CHARGINGSTATION
@ GNE_TAG_TRANSPORT_CONTAINERSTOP_CONTAINERSTOP
@ GNE_TAG_PERSONTRIP_BUSSTOP_BUSSTOP
@ GNE_TAG_TRANSHIP_BUSSTOP_PARKINGAREA
@ GNE_TAG_PERSONTRIP_JUNCTION_JUNCTION
@ GNE_TAG_TRANSHIP_CONTAINERSTOP_JUNCTION
@ GNE_TAG_WALK_TAZ_TAZ
@ GNE_TAG_WALK_TRAINSTOP_BUSSTOP
@ GNE_TAG_TRANSHIP_JUNCTION_TRAINSTOP
@ GNE_TAG_WALK_TAZ_EDGE
@ GNE_TAG_PERSONTRIP_TAZ_JUNCTION
@ GNE_TAG_WALK_EDGE_CHARGINGSTATION
@ GNE_TAG_TRANSPORT_JUNCTION_TAZ
@ GNE_TAG_TRANSPORT_PARKINGAREA_BUSSTOP
@ GNE_TAG_RIDE_EDGE_TRAINSTOP
@ GNE_TAG_TRANSHIP_TAZ_JUNCTION
@ SUMO_TAG_PERSON
@ GNE_TAG_TRANSHIP_JUNCTION_CHARGINGSTATION
@ GNE_TAG_WALK_TRAINSTOP_CONTAINERSTOP
@ GNE_TAG_WALK_JUNCTION_BUSSTOP
@ GNE_TAG_TRANSHIP_JUNCTION_JUNCTION
@ GNE_TAG_PERSONTRIP_CONTAINERSTOP_JUNCTION
@ GNE_TAG_WALK_JUNCTION_EDGE
@ GNE_TAG_PERSONTRIP_BUSSTOP_PARKINGAREA
@ GNE_TAG_TRANSHIP_CONTAINERSTOP_TRAINSTOP
@ GNE_TAG_PERSONTRIP_PARKINGAREA_BUSSTOP
@ GNE_TAG_RIDE_CHARGINGSTATION_JUNCTION
@ GNE_TAG_RIDE_BUSSTOP_CHARGINGSTATION
@ GNE_TAG_TRANSPORT_JUNCTION_TRAINSTOP
@ GNE_TAG_WALK_EDGE_CONTAINERSTOP
@ GNE_TAG_WALK_TRAINSTOP_JUNCTION
@ GNE_TAG_TRANSHIP_CHARGINGSTATION_PARKINGAREA
@ GNE_TAG_STOPPERSON_CHARGINGSTATION
@ GNE_TAG_TRANSHIP_CHARGINGSTATION_TAZ
@ GNE_TAG_TRANSPORT_BUSSTOP_EDGE
@ GNE_TAG_TRANSHIP_CONTAINERSTOP_BUSSTOP
@ GNE_TAG_WALK_PARKINGAREA_TAZ
@ GNE_TAG_PERSONTRIP_JUNCTION_EDGE
@ GNE_TAG_RIDE_CONTAINERSTOP_PARKINGAREA
@ GNE_TAG_RIDE_CHARGINGSTATION_TRAINSTOP
@ GNE_TAG_STOPPERSON_TRAINSTOP
@ GNE_TAG_TRANSPORT_CHARGINGSTATION_BUSSTOP
@ GNE_TAG_PERSONTRIP_PARKINGAREA_CHARGINGSTATION
@ GNE_TAG_TRANSHIP_CHARGINGSTATION_CONTAINERSTOP
@ GNE_TAG_TRANSHIP_EDGE_BUSSTOP
@ GNE_TAG_RIDE_BUSSTOP_PARKINGAREA
@ GNE_TAG_WALK_EDGE_JUNCTION
@ GNE_TAG_RIDE_PARKINGAREA_EDGE
@ GNE_TAG_PERSONTRIP_JUNCTION_TAZ
@ GNE_TAG_TRANSHIP_PARKINGAREA_EDGE
@ GNE_TAG_TRANSPORT_PARKINGAREA_CHARGINGSTATION
@ GNE_TAG_TRANSHIP_TRAINSTOP_CONTAINERSTOP
@ GNE_TAG_PERSONTRIP_JUNCTION_CONTAINERSTOP
@ GNE_TAG_WALK_TRAINSTOP_TRAINSTOP
@ GNE_TAG_WALK_CHARGINGSTATION_EDGE
@ GNE_TAG_TRANSHIP_EDGE_PARKINGAREA
@ GNE_TAG_WALK_EDGE_BUSSTOP
@ GNE_TAG_PERSONTRIP_PARKINGAREA_PARKINGAREA
@ GNE_TAG_TRANSHIP_TRAINSTOP_BUSSTOP
@ GNE_TAG_TRANSHIP_BUSSTOP_BUSSTOP
@ GNE_TAG_TRANSPORT_TRAINSTOP_EDGE
@ GNE_TAG_PERSONTRIP_TRAINSTOP_CHARGINGSTATION
@ GNE_TAG_TRANSPORT_EDGE_CHARGINGSTATION
@ GNE_TAG_TRANSHIP_CONTAINERSTOP_CONTAINERSTOP
@ GNE_TAG_WALK_CONTAINERSTOP_TRAINSTOP
@ GNE_TAG_RIDE_EDGE_PARKINGAREA
@ GNE_TAG_TRANSHIP_CHARGINGSTATION_JUNCTION
@ GNE_TAG_RIDE_BUSSTOP_CONTAINERSTOP
@ GNE_TAG_WALK_TAZ_TRAINSTOP
@ GNE_TAG_PERSONTRIP_CONTAINERSTOP_CHARGINGSTATION
@ GNE_TAG_RIDE_JUNCTION_EDGE
@ GNE_TAG_TRANSHIP_TRAINSTOP_PARKINGAREA
@ GNE_TAG_PERSONTRIP_CONTAINERSTOP_BUSSTOP
@ GNE_TAG_TRANSHIP_JUNCTION_TAZ
@ GNE_TAG_TRANSPORT_JUNCTION_CONTAINERSTOP
@ GNE_TAG_TRANSPORT_TAZ_CHARGINGSTATION
@ GNE_TAG_TRANSPORT_TAZ_JUNCTION
@ GNE_TAG_RIDE_TRAINSTOP_TRAINSTOP
@ GNE_TAG_TRANSPORT_JUNCTION_EDGE
@ GNE_TAG_TRANSPORT_BUSSTOP_BUSSTOP
@ GNE_TAG_WALK_PARKINGAREA_BUSSTOP
@ GNE_TAG_RIDE_CONTAINERSTOP_TAZ
@ GNE_TAG_STOPCONTAINER_CHARGINGSTATION
@ GNE_TAG_TRANSPORT_BUSSTOP_PARKINGAREA
@ GNE_TAG_WALK_TAZ_PARKINGAREA
@ GNE_TAG_TRANSHIP_TAZ_CHARGINGSTATION
@ GNE_TAG_TRANSHIP_BUSSTOP_TAZ
@ GNE_TAG_PERSONTRIP_TRAINSTOP_JUNCTION
@ GNE_TAG_RIDE_CONTAINERSTOP_TRAINSTOP
@ GNE_TAG_RIDE_TAZ_CHARGINGSTATION
@ GNE_TAG_STOPPERSON_EDGE
@ GNE_TAG_RIDE_CONTAINERSTOP_JUNCTION
@ GNE_TAG_PERSONTRIP_JUNCTION_CHARGINGSTATION
@ GNE_TAG_RIDE_PARKINGAREA_TRAINSTOP
@ GNE_TAG_TRANSPORT_CONTAINERSTOP_PARKINGAREA
@ GNE_TAG_TRANSHIP_CONTAINERSTOP_CHARGINGSTATION
@ GNE_TAG_WALK_ROUTE
@ GNE_TAG_PERSONTRIP_EDGE_TAZ
@ GNE_TAG_RIDE_TAZ_BUSSTOP
@ GNE_TAG_WALK_CONTAINERSTOP_CONTAINERSTOP
@ GNE_TAG_RIDE_TRAINSTOP_PARKINGAREA
@ SUMO_TAG_PERSONFLOW
@ GNE_TAG_TRANSHIP_CONTAINERSTOP_EDGE
@ GNE_TAG_WALK_CHARGINGSTATION_CHARGINGSTATION
@ GNE_TAG_TRANSHIP_TRAINSTOP_TAZ
@ GNE_TAG_RIDE_EDGE_CONTAINERSTOP
@ GNE_TAG_STOPPERSON_PARKINGAREA
@ GNE_TAG_RIDE_TRAINSTOP_EDGE
@ GNE_TAG_TRANSHIP_TAZ_CONTAINERSTOP
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
@ SUMO_ATTR_STARTPOS
@ GNE_ATTR_FROM_TRAINSTOP
@ GNE_ATTR_FROM_BUSSTOP
@ GNE_ATTR_PLAN_GEOMETRY_STARTPOS
person/container geometry start position
@ SUMO_ATTR_FROM_JUNCTION
@ SUMO_ATTR_CONTAINER_STOP
@ SUMO_ATTR_PARKING_AREA
@ SUMO_ATTR_EDGE
@ SUMO_ATTR_BUS_STOP
@ SUMO_ATTR_TRAIN_STOP
@ SUMO_ATTR_ENDPOS
@ SUMO_ATTR_TO_JUNCTION
@ GNE_ATTR_PARENT
parent of an additional element
@ SUMO_ATTR_ARRIVALPOS
@ GNE_ATTR_SELECTED
element is selected
@ GNE_ATTR_TAZ_CENTROID
TAZ Center (uses to return the TAZ centroid if center is not defined)
@ SUMO_ATTR_EDGES
the edges of a route
@ SUMO_ATTR_CHARGING_STATION
@ SUMO_ATTR_DEPARTPOS
@ GNE_ATTR_FROM_PARKINGAREA
@ GNE_ATTR_FROM_CONTAINERSTOP
@ SUMO_ATTR_TO_TAZ
@ SUMO_ATTR_CENTER
@ SUMO_ATTR_TO
@ SUMO_ATTR_FROM
@ SUMO_ATTR_FROM_TAZ
@ GNE_ATTR_FROM_CHARGINGSTATION
@ GNE_ATTR_PLAN_GEOMETRY_ENDPOS
person/container geometry end position
@ SUMO_ATTR_ROUTE
@ SUMO_ATTR_ID
@ SUMO_ATTR_DURATION
const double INVALID_DOUBLE
invalid double
Definition StdDefs.h:64
T MIN2(T a, T b)
Definition StdDefs.h:76
const double SUMO_const_halfLaneWidth
Definition StdDefs.h:49
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
Position getCenter() const
Returns the center of the boundary.
Definition Boundary.cpp:112
void add(double x, double y, double z=0)
Makes the boundary include the given coordinate.
Definition Boundary.cpp:78
bool isInitialised() const
check if Boundary is Initialised
Definition Boundary.cpp:259
Boundary & grow(double by)
extends the boundary by the given amount
Definition Boundary.cpp:343
plan parameters (used for group all from-to parameters related with plans)
std::string fromJunction
from junction
std::string fromContainerStop
from containerStop
std::string fromTrainStop
from trainStop
std::string toParkingArea
to parkingArea
std::vector< std::string > consecutiveEdges
consecutive edges
bool isSingleEdgePlan() const
check if this is a single-edge plan
std::string fromChargingStation
from chargingStation
std::string toChargingStation
to chargingStation
std::string fromParkingArea
from parkingArea
std::string toContainerStop
to containerStop
static void setColor(const RGBColor &c)
Sets the gl-color to this value.
Definition GLHelper.cpp:654
static void drawTriangleAtEnd(const Position &p1, const Position &p2, double tLength, double tWidth, const double extraOffset=0)
Draws a triangle at the end of the given line.
Definition GLHelper.cpp:629
static void popMatrix()
pop matrix
Definition GLHelper.cpp:130
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:347
static void drawBoundary(const GUIVisualizationSettings &s, const Boundary &b)
Draw a boundary (used for debugging)
Definition GLHelper.cpp:966
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:539
static void pushMatrix()
push matrix
Definition GLHelper.cpp:117
bool isAttributeCarrierSelected() const
check if attribute carrier is selected
const std::string & getTagStr() const
get tag assigned to this object in string format
const GNETagProperties & getTagProperty() const
get tagProperty associated with this Attribute Carrier
bool isTemplate() const
check if this AC is template
void unselectAttributeCarrier(const bool changeFlag=true)
unselect attribute carrier using GUIGlobalSelection
bool drawUsingSelectColor() const
check if attribute carrier must be drawn using selecting color.
GNENet * myNet
pointer to net
GNENet * getNet() const
get pointer to net
static std::string parseIDs(const std::vector< T > &ACs)
parses a list of specific Attribute Carriers into a string of IDs
void selectAttributeCarrier(const bool changeFlag=true)
select attribute carrier using GUIGlobalSelection
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 calculateContourCircleShape(const GUIVisualizationSettings &s, const GUIVisualizationSettings::Detail d, const GUIGlObject *glObject, const Position &pos, double radius, const double layer, const double scale) const
calculate contour (circle elements)
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
calculate contour extruded (used in elements formed by a central shape)
void 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...)
bool checkDrawPathContour(const GUIVisualizationSettings &s, const GUIVisualizationSettings::Detail d, const GNEAttributeCarrier *AC) const
drawing contour functions
virtual void updateGeometry()=0
update pre-computed geometry information
virtual SUMOVehicleClass getVClass() const =0
obtain VClass related with this demand element
void replaceDemandElementParent(SumoXMLTag tag, const std::string &value, const int parentIndex)
replace demand element parent
virtual GNELane * getLastPathLane() const =0
get last path lane
virtual GNELane * getFirstPathLane() const =0
get first path lane
GUIGeometry myDemandElementGeometry
demand element geometry (also called "stacked geometry")
void replaceLastParentEdge(const std::string &value)
replace the last parent edge
virtual std::string getAttribute(SumoXMLAttr key) const =0
virtual void computePathElement()=0
compute pathElement
void replaceFirstParentEdge(const std::string &value)
replace the first parent edge
virtual Position getPositionInView() const =0
Returns position of demand element in view.
const GUIGeometry & getDemandElementGeometry()
get demand element geometry (stacked)
Problem
enum class for demandElement problems
GNEDemandElement * getPreviousChildDemandElement(const GNEDemandElement *demandElement) const
get previous child demand element to the given demand element
virtual void drawGL(const GUIVisualizationSettings &s) const =0
Draws the object.
static std::pair< SumoXMLTag, GUIIcon > getPersonTripTagIcon(const CommonXMLStructure::PlanParameters &planParameters)
get the personTrip tag and icon for the combination
Boundary myPlanBoundary
plan boundary
bool isPlanValid(SumoXMLAttr key, const std::string &value)
check if plan attribute is valid
Boundary getPlanCenteringBoundary() const
get plan centering boundary
Position getPlanPositionInView() const
Returns position of additional in view.
std::string getPersonPlanProblem() const
get plan problem
static std::pair< SumoXMLTag, GUIIcon > getContainerStopTagIcon(const CommonXMLStructure::PlanParameters &planParameters)
get the container stop tag and icon for the combination
void computePlanPathElement()
compute plan pathElement
Position getPlanAttributePosition(SumoXMLAttr key) const
get plan attribute position
GNEDemandElement::Problem isPlanPersonValid() const
check if plan is valid
static std::pair< SumoXMLTag, GUIIcon > getRideTagIcon(const CommonXMLStructure::PlanParameters &planParameters)
get the ride tag and icon for the combination
GNEContour myPlanContourEnd
variable used for draw contour end
GUIGLObjectPopupMenu * getPlanPopUpMenu(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own popup-menu.
GNEDemandElementPlan(GNEDemandElement *planElement, const double departPosition, const double arrivalPosition)
constructor
std::string getPlanHierarchyName() const
get plan Hierarchy Name (Used in AC Hierarchy)
void drawEndPosition(const GUIVisualizationSettings &s, const GUIVisualizationSettings::Detail d, const double endPosRadius) const
draw to arrow
void drawFromArrow(const GUIVisualizationSettings &s, const GNELane *lane, const GNESegment *segment) const
draw from arrow
void writeLocationAttributes(OutputDevice &device) const
write plan element common attributes
bool checkDrawPersonPlan() const
check if person plan can be drawn
static std::pair< SumoXMLTag, GUIIcon > getPersonStopTagIcon(const CommonXMLStructure::PlanParameters &planParameters)
get the person stop tag and icon for the combination
GNEContour myPlanContour
variable used for draw central contour
double getEndPosRadius(const GUIVisualizationSettings &s, const GNESegment *segment, const bool drawHalfWidth) const
get end position radius
GNEMoveOperation * getPlanMoveOperation()
get move operation
double getPlanAttributeDouble(SumoXMLAttr key) const
get plan attribute double
void setPlanAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
set plan attribute
double myArrivalPosition
arrival position (used in all plans over edges)
double myDepartPosition
depart position (used in tranships)
static std::pair< SumoXMLTag, GUIIcon > getWalkTagIcon(const CommonXMLStructure::PlanParameters &planParameters)
get the walk tag and icon for the combination
static const double myArrivalPositionDiameter
arrival position diameter
void drawToArrow(const GUIVisualizationSettings &s, const GNELane *lane, const GNESegment *segment) const
draw to arrow
std::string getPlanAttribute(SumoXMLAttr key) const
get plan attribute string
bool isPlanAttributeEnabled(SumoXMLAttr key) const
check if plan attribute is enabled
bool checkDrawContainerPlan() const
check if container plan can be drawn
static std::pair< SumoXMLTag, GUIIcon > getTranshipTagIcon(const CommonXMLStructure::PlanParameters &planParameters)
get the tranship tag and icon for the combination
GNELane * getLastPlanPathLane() const
get last plan path lane
GNEDemandElement * myPlanElement
pointer to plan element
void updatePlanCenteringBoundary(const bool updateGrid)
update plan centering boundary
void drawPlanGL(const bool drawPlan, const GUIVisualizationSettings &s, const RGBColor &planColor, const RGBColor &planSelectedColor) const
draw plan
void updatePlanGeometry()
update pre-computed geometry information
GNELane * getFirstPlanPathLane() const
get first plan path lane
void drawPlanLanePartial(const bool drawPlan, const GUIVisualizationSettings &s, const GNESegment *segment, const double offsetFront, const double planWidth, const RGBColor &planColor, const RGBColor &planSelectedColor) const
draw plan partial lane
void drawPlanJunctionPartial(const bool drawPlan, const GUIVisualizationSettings &s, const GNESegment *segment, const double offsetFront, const double planWidth, const RGBColor &planColor, const RGBColor &planSelectedColor) const
draw plan partial junction
void writeOriginStop(OutputDevice &device) const
write initial stop stage if plan starts at a stopping place
bool replacePlanParent(const std::string &newParentID)
replace plan parent
static std::pair< SumoXMLTag, GUIIcon > getTransportTagIcon(const CommonXMLStructure::PlanParameters &planParameters)
get the transport tag and icon for the combination
const std::vector< GNEJunction * > & getParentJunctions() const
get parent junctions
const std::vector< GNEDemandElement * > & getChildDemandElements() const
return child demand elements
const std::vector< GNEAdditional * > getParentStoppingPlaces() const
get parent stoppingPlaces (used by plans)
const std::vector< GNEAdditional * > getParentTAZs() const
get parent TAZs (used by plans)
const std::vector< GNEDemandElement * > & getParentDemandElements() const
get parent demand elements
const std::vector< GNEAdditional * > & getParentAdditionals() const
get parent additionals
const std::vector< GNEEdge * > & getParentEdges() const
get parent edges
bool exist(const GNELane *toLane) const
check if exist a lane2lane geometry for the given toLane
const GUIGeometry & getLane2laneGeometry(const GNELane *toLane) const
get lane2lane geometry
This lane is powered by an underlying GNEEdge and basically knows how to draw itself.
Definition GNELane.h:46
const PositionVector & getLaneShape() const
get elements shape
Definition GNELane.cpp:214
const GNELane2laneConnection & getLane2laneConnections() const
get Lane2laneConnection struct
Definition GNELane.cpp:662
const GUIGeometry & getLaneGeometry() const
get lane geometry
Definition GNELane.cpp:208
move operation
GNEDemandElement * retrieveDemandElement(SumoXMLTag type, const std::string &id, bool hardFail=true) const
Returns the named demand element.
void addGLObjectIntoGrid(GNEAttributeCarrier *AC)
add GL Object into net
Definition GNENet.cpp:1386
void removeGLObjectFromGrid(GNEAttributeCarrier *AC)
add GL Object into net
Definition GNENet.cpp:1396
GNEPathManager * getDemandPathManager()
get demand path manager
Definition GNENet.cpp:145
GNENetHelper::AttributeCarriers * getAttributeCarriers() const
get all attribute carriers used in this net
Definition GNENet.cpp:127
GNEViewNet * getViewNet() const
get view net
Definition GNENet.cpp:2155
bool checkDrawPathGeometry(const GUIVisualizationSettings &s, const GNELane *lane, SumoXMLTag tag)
check if path element geometry must be drawn in the given lane
PathDraw * getPathDraw()
obtain instance of PathDraw
void calculateConsecutivePathEdges(GNEPathElement *pathElement, SUMOVehicleClass vClass, const std::vector< GNEEdge * > &edges, const int firstLaneIndex=-1, const int lastLaneIndex=-1)
calculate consecutive path edges
const GNELane * getLane() const
get lane associated with this segment
const GNELane * getNextLane() const
get next lane
const GNELane * getPreviousLane() const
get previous lane
bool isFirstSegment() const
check if segment is the first path's segment
GNEContour * getContour() const
bool isLastSegment() const
check if segment is the last path's segment
bool planFromJunction() const
return true if tag correspond to a plan that starts in junction
bool planToStoppingPlace() const
return true if tag correspond to a plan that ends in stoppingPlace
bool planStoppingPlace() const
return true if tag correspond to a plan placed in stoppingPlace
bool planToJunction() const
return true if tag correspond to a plan that starts in junction
bool planFromStoppingPlace() const
return true if tag correspond to a plan that starts in stoppingPlace
bool planFromEdge() const
return true if tag correspond to a plan that starts in edge
bool isPlanPerson() const
return true if tag correspond to a person plan
bool planToEdge() const
return true if tag correspond to a plan that starts in edge
GNEViewNetHelper::InspectedElements & getInspectedElements()
get inspected elements
void buildSelectionACPopupEntry(GUIGLObjectPopupMenu *ret, GNEAttributeCarrier *AC)
Builds an entry which allows to (de)select the object.
static FXMenuCommand * buildFXMenuCommand(FXComposite *p, const std::string &text, FXIcon *icon, FXObject *tgt, FXSelector sel, const bool disable=false)
build menu command
The popup menu of a globject.
void clearGeometry()
clear geometry
static void drawGeometry(const GUIVisualizationSettings::Detail d, const GUIGeometry &geometry, const double width, double offset=0)
draw geometry
static void drawChildLine(const GUIVisualizationSettings &s, const Position &child, const Position &parent, const RGBColor &color, const bool drawEntire, const double lineWidth)
draw line between child and parent (used in netedit)
const PositionVector & getShape() const
The shape of the additional element.
void updateGeometry(const PositionVector &shape)
update entire geometry
void buildShowParamsPopupEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds an entry which allows to open the parameter window.
virtual Boundary getCenteringBoundary() const =0
void buildCenterPopupEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds an entry which allows to center to the object.
void buildPopupHeader(GUIGLObjectPopupMenu *ret, GUIMainWindow &app, bool addSeparator=true)
Builds the header.
GUIGlObjectType getType() const
Returns the type of the object as coded in GUIGlObjectType.
void buildPositionCopyEntry(GUIGLObjectPopupMenu *ret, const GUIMainWindow &app) const
Builds an entry which allows to copy the cursor position if geo projection is used,...
void drawName(const Position &pos, const double scale, const GUIVisualizationTextSettings &settings, const double angle=0, bool forceShow=false) const
draw name of item
virtual Position getPositionInformation() const
Returns the cursor's x/y position within the network.
void addToRedrawPathElements(const GNEPathElement *pathElement)
add path element to redrawing set
bool isPathElementMarkForRedraw(const GNEPathElement *pathElement) const
check if the given path element has to be redraw again
bool isObjectSelected(const GUIGlObject *GLObject) const
check if element was already selected
Stores the information about how to visualize structures.
GUIVisualizationTextSettings addName
bool drawBoundaries
enable or disable draw boundaries
bool drawForRectangleSelection
whether drawing is performed for the purpose of selecting objects using a rectangle
GUIVisualizationSizeSettings addSize
GUIVisualizationWidthSettings widthSettings
width settings
Detail getDetailLevel(const double exaggeration) const
return the detail level
double laneWidthExaggeration
The lane exaggeration (upscale thickness)
bool checkDrawContainer(Detail d, const bool selected) const
check if draw container
GUIVisualizationDottedContourSettings dottedContourSettings
dotted contour settings
double scale
information about a lane's width (temporary, used for a single view)
bool drawForViewObjectsHandler
whether drawing is performed for the purpose of selecting objects in view using ViewObjectsHandler
bool checkDrawPerson(Detail d, const bool selected) const
check if draw person
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.
bool closeTag(const std::string &comment="")
Closes the most recently opened tag and optionally adds a comment.
A point in 2D or 3D with translation and scaling methods.
Definition Position.h:37
double distanceSquaredTo2D(const Position &p2) const
returns the square of the distance to another position (Only using x and y positions)
Definition Position.h:281
static const Position INVALID
used to indicate that a position is valid
Definition Position.h:322
double x() const
Returns the x-position.
Definition Position.h:55
double y() const
Returns the y-position.
Definition Position.h:60
Boundary getBoxBoundary() const
Returns a boundary enclosing this list of lines.
static const RGBColor RED
named colors
Definition RGBColor.h:185
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
static const double segmentWidth
width of dotted contour segments
double getExaggeration(const GUIVisualizationSettings &s, const GUIGlObject *o, double factor=20) const
return the drawing size including exaggeration and constantSize values
double personTripWidth
width for person trips