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();
1358 if (myDepartPosition < 0) {
1359 return "";
1360 } else {
1361 return toString(myDepartPosition);
1362 }
1363 case SUMO_ATTR_ENDPOS:
1365 if (myArrivalPosition < 0) {
1366 return "";
1367 } else {
1369 }
1370 // route
1371 case SUMO_ATTR_ROUTE:
1372 return myPlanElement->getParentDemandElements().at(1)->getID();
1373 // edges
1374 case SUMO_ATTR_EDGE:
1375 case SUMO_ATTR_EDGES:
1377 // stoppingPlaces (single and back)
1378 case SUMO_ATTR_BUS_STOP:
1383 return myPlanElement->getParentStoppingPlaces().back()->getID();
1384 // from elements
1385 case SUMO_ATTR_FROM:
1386 return myPlanElement->getParentEdges().front()->getID();
1388 return myPlanElement->getParentJunctions().front()->getID();
1389 case SUMO_ATTR_FROM_TAZ:
1390 return myPlanElement->getParentTAZs().front()->getID();
1396 return myPlanElement->getParentStoppingPlaces().front()->getID();
1397 // to elements
1398 case SUMO_ATTR_TO:
1399 return myPlanElement->getParentEdges().back()->getID();
1401 return myPlanElement->getParentJunctions().back()->getID();
1402 case SUMO_ATTR_TO_TAZ:
1403 return myPlanElement->getParentTAZs().back()->getID();
1404 default:
1405 return myPlanElement->getCommonAttribute(key);
1406 }
1407}
1408
1409
1410double
1412 // get tag property
1413 const auto& tagProperty = myPlanElement->getTagProperty();
1414 // declare plan parent
1415 const auto planParent = myPlanElement->getParentDemandElements().at(0);
1416 // continue depending of key
1417 switch (key) {
1419 if (tagProperty.planStoppingPlace()) {
1420 // use startpos of stoppingPlace parent (stops)
1421 return myPlanElement->getParentStoppingPlaces().front()->getAttributeDouble(SUMO_ATTR_STARTPOS);
1422 } else if (tagProperty.planFromStoppingPlace()) {
1423 // use end position of stoppingPlace parent (for plans that starts in stoppingPlaces)
1424 return myPlanElement->getParentStoppingPlaces().front()->getAttributeDouble(SUMO_ATTR_ENDPOS);
1425 } else if (tagProperty.planFromTAZ()) {
1426 return 0;
1427 } else if (tagProperty.planFromJunction()) {
1428 return -1;
1429 } else {
1430 // get previous plan element
1431 const auto previousPlan = planParent->getPreviousChildDemandElement(myPlanElement);
1432 // continue depending of previous plan
1433 if (previousPlan) {
1434 // use previous plan end position (normally the arrival position)
1435 const auto posOverLane = previousPlan->getAttributeDouble(GNE_ATTR_PLAN_GEOMETRY_ENDPOS);
1436 // if posOverLane is -1, means that previousPlan ends in the end of lane.
1437 if (posOverLane == -1) {
1438 // INVALID_DOUBLE will put the startPositio at the end of line
1439 return INVALID_DOUBLE;
1440 } else {
1441 return previousPlan->getAttributeDouble(GNE_ATTR_PLAN_GEOMETRY_ENDPOS);
1442 }
1443 } else {
1444 // use depart position defined in parent (person or container)
1445 return planParent->getAttributeDouble(SUMO_ATTR_DEPARTPOS);
1446 }
1447 }
1448 }
1450 // continue depending of parents
1451 if (tagProperty.planStoppingPlace()) {
1452 // use end position of the stoppingPlace (stops)
1453 return myPlanElement->getParentStoppingPlaces().back()->getAttributeDouble(SUMO_ATTR_ENDPOS);
1454 } else if (tagProperty.planToStoppingPlace()) {
1455 // use start position of the stoppingPlace (for elements that ends in stoppingPlaces)
1456 return myPlanElement->getParentStoppingPlaces().back()->getAttributeDouble(SUMO_ATTR_STARTPOS);
1457 } else if (tagProperty.planToJunction() || tagProperty.planToTAZ()) {
1458 // junctions and TAZs return always -1
1459 return -1;
1460 } else if ((tagProperty.isPlanStopPerson() || tagProperty.isPlanStopContainer()) && tagProperty.planEdge()) {
1461 // elements that ends in stop always uses the end (arrival) position of the stops over edges
1462 return myArrivalPosition;
1463 } else {
1464 // check if next plan is a stop over edge
1465 const auto nextPlan = planParent->getNextChildDemandElement(myPlanElement);
1466 if (nextPlan && (nextPlan->getTagProperty().isPlanStopPerson() ||
1467 nextPlan->getTagProperty().isPlanStopContainer()) &&
1468 nextPlan->getTagProperty().planEdge()) {
1469 // if next plan is an stop over stoppingPlaces, use ends of stoppingPlace
1470 return nextPlan->getAttributeDouble(GNE_ATTR_PLAN_GEOMETRY_ENDPOS);
1471 } else {
1472 // use arrival position
1473 return myArrivalPosition;
1474 }
1475 }
1477 return myDepartPosition;
1478 case SUMO_ATTR_ENDPOS:
1480 return myArrivalPosition;
1481 default:
1482 throw InvalidArgument(myPlanElement->getTagStr() + " doesn't have a doubleattribute of type '" + toString(key) + "'");
1483 }
1484}
1485
1486
1489 // get tag property
1490 const auto& tagProperty = myPlanElement->getTagProperty();
1491 // declare plan parent
1492 const auto planParent = myPlanElement->getParentDemandElements().at(0);
1493 // continue depending of key
1494 switch (key) {
1496 // get previous plan
1497 const auto previousPlan = planParent->getPreviousChildDemandElement(myPlanElement);
1498 if (previousPlan && previousPlan->getTagProperty().isPlanStop() && previousPlan->getTagProperty().planStoppingPlace()) {
1499 return previousPlan->getParentStoppingPlaces().front()->getAdditionalGeometry().getShape().back();
1500 }
1501 // continue depending of from element
1502 if (tagProperty.planStoppingPlace()) {
1503 return myPlanElement->getParentStoppingPlaces().front()->getAdditionalGeometry().getShape().front();
1504 } else if (tagProperty.planFromStoppingPlace()) {
1505 return myPlanElement->getParentStoppingPlaces().front()->getAdditionalGeometry().getShape().back();
1506 } else if (tagProperty.planFromJunction()) {
1507 // junction view position
1508 return myPlanElement->getParentJunctions().front()->getPositionInView();
1509 } else if (tagProperty.planFromTAZ()) {
1510 if (myPlanElement->getParentTAZs().front()->getAttribute(SUMO_ATTR_CENTER).empty()) {
1511 return myPlanElement->getParentTAZs().front()->getAttributePosition(GNE_ATTR_TAZ_CENTROID);
1512 } else {
1513 return myPlanElement->getParentTAZs().front()->getAttributePosition(SUMO_ATTR_CENTER);
1514 }
1515 } else if (tagProperty.planConsecutiveEdges() || tagProperty.planRoute() || tagProperty.planFromEdge()) {
1516 // get first path lane
1517 const auto firstLane = myPlanElement->getFirstPathLane();
1518 // check if first lane exists
1519 if (firstLane == nullptr) {
1520 return Position::INVALID;
1521 }
1522 // declare lane position
1523 double lanePosition = 0;
1524 // continue depending of conditions
1525 if (previousPlan) {
1526 // use previous geometry end position
1527 lanePosition = previousPlan->getAttributeDouble(GNE_ATTR_PLAN_GEOMETRY_ENDPOS);
1528 } else {
1529 // use departPos defined in planParent
1530 lanePosition = planParent->getAttributeDouble(SUMO_ATTR_DEPARTPOS);
1531 }
1532 // get lane shape
1533 const auto& laneShape = firstLane->getLaneShape();
1534 // continue depending of lane position
1535 if (lanePosition <= 0) {
1536 return laneShape.front();
1537 } else if (lanePosition >= laneShape.length2D()) {
1538 return laneShape.back();
1539 } else {
1540 return laneShape.positionAtOffset2D(lanePosition);
1541 }
1542 } else {
1543 return Position::INVALID;
1544 }
1545 }
1547 // check parents
1548 if (tagProperty.planToJunction()) {
1549 // junctions
1550 return myPlanElement->getParentJunctions().back()->getPositionInView();
1551 } else if (tagProperty.planStoppingPlace()) {
1552 // get additional back shape (stops)
1553 return myPlanElement->getParentStoppingPlaces().back()->getAdditionalGeometry().getShape().back();
1554 } else if (tagProperty.planToStoppingPlace()) {
1555 // get additional front shape
1556 return myPlanElement->getParentStoppingPlaces().back()->getAdditionalGeometry().getShape().front();
1557 } else if (tagProperty.planToTAZ()) {
1558 // taz
1559 if (myPlanElement->getParentTAZs().back()->getAttribute(SUMO_ATTR_CENTER).empty()) {
1560 return myPlanElement->getParentTAZs().back()->getAttributePosition(GNE_ATTR_TAZ_CENTROID);
1561 } else {
1562 return myPlanElement->getParentTAZs().back()->getAttributePosition(SUMO_ATTR_CENTER);
1563 }
1564 } else if (tagProperty.planConsecutiveEdges() || tagProperty.planRoute() || tagProperty.planFromEdge()) {
1565 // get next plan
1566 const auto nextPlan = planParent->getNextChildDemandElement(myPlanElement);
1567 // if next plan exist, then use their first lane (needed to maintain connectivity with rides)
1568 const auto lastLane = nextPlan ? nextPlan->getFirstPathLane() : myPlanElement->getLastPathLane();
1569 // check if last lane exists
1570 if (lastLane == nullptr) {
1571 return Position::INVALID;
1572 }
1573 // get lane shape
1574 const auto& laneShape = lastLane->getLaneShape();
1575 // continue depending of arrival position
1576 if (nextPlan && nextPlan->getTagProperty().isPlanStop()) {
1577 return nextPlan->getAttributePosition(GNE_ATTR_PLAN_GEOMETRY_ENDPOS);
1578 } else if (myArrivalPosition == 0) {
1579 return laneShape.front();
1580 } else if ((myArrivalPosition == -1) || (myArrivalPosition >= laneShape.length2D())) {
1581 return laneShape.back();
1582 } else {
1583 return laneShape.positionAtOffset2D(myArrivalPosition);
1584 }
1585 } else {
1586 return Position::INVALID;
1587 }
1588 }
1589 default:
1590 throw InvalidArgument(myPlanElement->getTagStr() + " doesn't have a position attribute of type '" + toString(key) + "'");
1591 }
1592}
1593
1594
1595void
1596GNEDemandElementPlan::setPlanAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList) {
1597 // continue depending of key
1598 switch (key) {
1599 // common attributes
1602 case SUMO_ATTR_ENDPOS:
1603 case GNE_ATTR_PARENT:
1605 break;
1606 default:
1607 myPlanElement->setCommonAttribute(key, value, undoList);
1608 break;
1609 }
1610}
1611
1612
1613bool
1614GNEDemandElementPlan::isPlanValid(SumoXMLAttr key, const std::string& value) {
1615 // continue depending of key
1616 switch (key) {
1617 // common attributes
1618 case GNE_ATTR_PARENT:
1619 return false;
1622 if (value.empty()) {
1623 return true;
1624 } else if (GNEAttributeCarrier::canParse<double>(value)) {
1625 return GNEAttributeCarrier::parse<double>(value) >= 0;
1626 } else {
1627 return false;
1628 }
1629 case SUMO_ATTR_ENDPOS:
1630 return GNEAttributeCarrier::canParse<double>(value);
1631 default:
1632 return myPlanElement->isCommonValid(key, value);
1633 }
1634}
1635
1636
1637bool
1639 switch (key) {
1640 // edges
1641 case SUMO_ATTR_EDGES:
1642 // edge
1643 case SUMO_ATTR_EDGE:
1644 // route
1645 case SUMO_ATTR_ROUTE:
1646 // from
1647 case SUMO_ATTR_FROM:
1649 case SUMO_ATTR_FROM_TAZ:
1655 // to
1656 case SUMO_ATTR_TO:
1658 case SUMO_ATTR_TO_TAZ:
1659 case SUMO_ATTR_BUS_STOP:
1664 // depart pos (temporal, probably will be removed)
1666 return false;
1667 default:
1668 return true;
1669 }
1670}
1671
1672
1673void
1675 bool recompute = false;
1676 switch (key) {
1677 // from-to attributes (needed if we're replacing junction by geometry points and similar operations)
1678 case SUMO_ATTR_FROM:
1680 recompute = true;
1681 break;
1682 case SUMO_ATTR_TO:
1684 recompute = true;
1685 break;
1686 // Common plan attributes
1687 case GNE_ATTR_PARENT:
1688 replacePlanParent(value);
1689 break;
1691 if (value.empty()) {
1692 myDepartPosition = -1;
1693 } else {
1694 myDepartPosition = GNEAttributeCarrier::parse<double>(value);
1695 }
1696 recompute = true;
1697 break;
1698 case SUMO_ATTR_ENDPOS:
1700 if (value.empty()) {
1701 myArrivalPosition = -1;
1702 } else {
1703 myArrivalPosition = GNEAttributeCarrier::parse<double>(value);
1704 }
1705 recompute = true;
1706 break;
1707 default:
1708 myPlanElement->setCommonAttribute(key, value);
1709 break;
1710 }
1711 // check if compute geometry and path
1712 if (recompute && !myPlanElement->isTemplate()) {
1715 }
1716}
1717
1718
1719std::string
1721 // get tag property
1722 const auto& tagProperty = myPlanElement->getTagProperty();
1723 // declare result
1724 std::string result;
1725 // clear result
1726 int index = 0;
1727 while (tagProperty.getTagStr().at(index) != ':') {
1728 result.push_back(tagProperty.getTagStr().at(index));
1729 index++;
1730 }
1731 result += ": ";
1732 // continue depending of attributes
1733 if (tagProperty.planConsecutiveEdges()) {
1734 // edges
1735 return result + myPlanElement->getParentEdges().front()->getID() + " ... " + myPlanElement->getParentEdges().back()->getID();
1736 } else if (tagProperty.planRoute()) {
1737 // route
1738 return result + myPlanElement->getParentDemandElements().at(1)->getID();
1739 } else if (tagProperty.planEdge()) {
1740 // edge
1741 return result + myPlanElement->getParentEdges().front()->getID();
1742 } else if (tagProperty.planStoppingPlace()) {
1743 // stoppingPlace
1744 return myPlanElement->getParentStoppingPlaces().front()->getID();
1745 } else {
1746 // stoppingPlace
1747 if (tagProperty.planFromStoppingPlace()) {
1748 result += myPlanElement->getParentStoppingPlaces().front()->getID();
1749 }
1750 // TAZ
1751 if (tagProperty.planFromTAZ()) {
1752 result += myPlanElement->getParentTAZs().front()->getID();
1753 }
1754 // junction
1755 if (tagProperty.planFromJunction()) {
1756 result += myPlanElement->getParentJunctions().front()->getID();
1757 }
1758 // edge
1759 if (tagProperty.planFromEdge()) {
1760 result += myPlanElement->getParentEdges().front()->getID();
1761 }
1762 // arrow
1763 result += " -> ";
1764 // stoppingPlace
1765 if (tagProperty.planToStoppingPlace()) {
1766 result += myPlanElement->getParentStoppingPlaces().back()->getID();
1767 }
1768 // TAZ
1769 if (tagProperty.planToTAZ()) {
1770 result += myPlanElement->getParentTAZs().back()->getID();
1771 }
1772 // junction
1773 if (tagProperty.planToJunction()) {
1774 result += myPlanElement->getParentJunctions().back()->getID();
1775 }
1776 // edge
1777 if (tagProperty.planToEdge()) {
1778 result += myPlanElement->getParentEdges().back()->getID();
1779 }
1780 return result;
1781 }
1782}
1783
1784
1785bool
1787 const auto viewNet = myPlanElement->getNet()->getViewNet();
1788 const auto& inspectedElements = viewNet->getInspectedElements();
1789 // check conditions
1790 if (viewNet->getEditModes().isCurrentSupermodeNetwork() &&
1791 viewNet->getNetworkViewOptions().showDemandElements() &&
1792 viewNet->getDemandViewOptions().showAllPersonPlans()) {
1793 // show all person plans in network mode
1794 return true;
1795 } else if (viewNet->getEditModes().isCurrentSupermodeDemand() &&
1796 viewNet->getDemandViewOptions().showAllPersonPlans()) {
1797 // show all person plans
1798 return true;
1799 } else if (viewNet->getEditModes().isCurrentSupermodeDemand() && myPlanElement->isAttributeCarrierSelected()) {
1800 // show selected
1801 return true;
1802 } else if (inspectedElements.isACInspected(myPlanElement->getParentDemandElements().front())) {
1803 // person parent is inspected
1804 return true;
1805 } else if (viewNet->getDemandViewOptions().getLockedPerson() == myPlanElement->getParentDemandElements().front()) {
1806 // person parent is locked
1807 return true;
1808 } else {
1809 // check if parent
1810 if (inspectedElements.getFirstAC() && inspectedElements.getFirstAC()->getTagProperty().isPlanPerson() &&
1811 (inspectedElements.getFirstAC()->getAttribute(GNE_ATTR_PARENT) == myPlanElement->getAttribute(GNE_ATTR_PARENT))) {
1812 // common person parent
1813 return true;
1814 } else {
1815 // all conditions are false
1816 return false;
1817 }
1818 }
1819}
1820
1821
1822bool
1824 const auto viewNet = myPlanElement->getNet()->getViewNet();
1825 const auto& inspectedElements = viewNet->getInspectedElements();
1826 // check conditions
1827 if (viewNet->getEditModes().isCurrentSupermodeNetwork() &&
1828 viewNet->getNetworkViewOptions().showDemandElements() &&
1829 viewNet->getDemandViewOptions().showAllContainerPlans()) {
1830 // show all container plans in network mode
1831 return true;
1832 } else if (viewNet->getEditModes().isCurrentSupermodeDemand() &&
1833 viewNet->getDemandViewOptions().showAllContainerPlans()) {
1834 // show all container plans
1835 return true;
1836 } else if (viewNet->getEditModes().isCurrentSupermodeDemand() && myPlanElement->isAttributeCarrierSelected()) {
1837 // show selected
1838 return true;
1839 } else if (inspectedElements.isACInspected(myPlanElement->getParentDemandElements().front())) {
1840 // container parent is inspected
1841 return true;
1842 } else if (viewNet->getDemandViewOptions().getLockedContainer() == myPlanElement->getParentDemandElements().front()) {
1843 // container parent is locked
1844 return true;
1845 } else {
1846 // check if parent is inspected
1847 if (inspectedElements.getFirstAC() && inspectedElements.getFirstAC()->getTagProperty().isPlanContainer() &&
1848 (inspectedElements.getFirstAC()->getAttribute(GNE_ATTR_PARENT) == myPlanElement->getAttribute(GNE_ATTR_PARENT))) {
1849 // common container parent
1850 return true;
1851 } else {
1852 // all conditions are false
1853 return false;
1854 }
1855 }
1856}
1857
1858
1859void
1860GNEDemandElementPlan::drawPlanGL(const bool drawPlan, const GUIVisualizationSettings& s, const RGBColor& planColor, const RGBColor& planSelectedColor) const {
1861 const auto viewNet = myPlanElement->getNet()->getViewNet();
1862 const auto& inspectedElements = viewNet->getInspectedElements();
1863 // get plan parent
1864 const GNEDemandElement* planParent = myPlanElement->getParentDemandElements().front();
1865 // get tag property
1866 const auto& tagProperty = myPlanElement->getTagProperty();
1867 // get plan geometry
1868 auto& planGeometry = myPlanElement->myDemandElementGeometry;
1869 // draw relations between TAZs
1870 if (drawPlan && (planGeometry.getShape().size() > 0)) {
1871 // draw boundary
1872 if (s.drawBoundaries) {
1874 }
1875 // get detail level
1876 const auto d = s.getDetailLevel(1);
1877 // check if draw with double width
1878 const bool drawHalfWidth = ((inspectedElements.getFirstAC() != myPlanElement) && (inspectedElements.getFirstAC() != planParent) && !gViewObjectsHandler.isObjectSelected(myPlanElement));
1879 // calculate path width
1880 double pathWidth = s.widthSettings.walkWidth;
1881 if (tagProperty.isPlanRide()) {
1882 pathWidth = s.widthSettings.rideWidth;
1883 } else if (tagProperty.isPlanPersonTrip()) {
1884 pathWidth = s.widthSettings.personTripWidth;
1885 }
1886 // draw geometry only if we'rent in drawForObjectUnderCursor mode
1887 if ((tagProperty.isPlanPerson() && s.checkDrawPerson(d, myPlanElement->isAttributeCarrierSelected())) ||
1888 (tagProperty.isPlanContainer() && s.checkDrawContainer(d, myPlanElement->isAttributeCarrierSelected()))) {
1889 // push matrix
1891 // translate to front
1893 // set color
1894 GLHelper::setColor(myPlanElement->drawUsingSelectColor() ? planSelectedColor : planColor);
1895 // draw line
1896 GUIGeometry::drawGeometry(d, planGeometry, pathWidth * (drawHalfWidth ? 1 : 2));
1897 if (drawHalfWidth) {
1898 GLHelper::drawTriangleAtEnd(planGeometry.getShape().front(), planGeometry.getShape().back(), 0.5, 0.5, 0.5);
1899 } else {
1900 GLHelper::drawTriangleAtEnd(planGeometry.getShape().front(), planGeometry.getShape().back(), 1, 1, 1);
1901 }
1902 // pop matrix
1904 // draw dotted contour
1906 }
1907 // calculate contour and draw dotted geometry
1908 myPlanContour.calculateContourExtrudedShape(s, d, myPlanElement, planGeometry.getShape(), myPlanElement->getType(), pathWidth * 2,
1909 1, true, true, 0, nullptr, nullptr);
1910 // calculate contour for end
1911 myPlanContourEnd.calculateContourCircleShape(s, d, myPlanElement, planGeometry.getShape().back(), 1, myPlanElement->getType(), 1, nullptr);
1912 }
1913 // check if draw plan parent
1914 if (planParent->getPreviousChildDemandElement(myPlanElement) == nullptr) {
1915 planParent->drawGL(s);
1916 }
1917}
1918
1919
1920void
1922 const double offsetFront, const double planWidth, const RGBColor& planColor, const RGBColor& planSelectedColor) const {
1923 const auto viewNet = myPlanElement->getNet()->getViewNet();
1924 const auto& inspectedElements = viewNet->getInspectedElements();
1925 // get tag property
1926 const auto& tagProperty = myPlanElement->getTagProperty();
1927 // get plan parent
1928 const GNEDemandElement* planParent = myPlanElement->getParentDemandElements().front();
1929 // check if draw plan element can be drawn
1930 if (drawPlan && segment->getLane() && myPlanElement->getNet()->getDemandPathManager()->getPathDraw()->checkDrawPathGeometry(s, segment->getLane(), tagProperty.getTag())) {
1931 // draw boundary
1932 if (tagProperty.isPlacedInRTree() && s.drawBoundaries) {
1934 }
1935 // get detail level
1936 const auto d = s.getDetailLevel(1);
1937 // declare path geometry
1938 GUIGeometry planGeometry;
1939 // update pathGeometry depending of first and last segment
1940 if (segment->isFirstSegment() && segment->isLastSegment()) {
1941 if (tagProperty.planFromTAZ()) {
1942 planGeometry.updateGeometry(segment->getLane()->getLaneGeometry().getShape(),
1947 } else if (tagProperty.planToTAZ()) {
1948 planGeometry.updateGeometry(segment->getLane()->getLaneGeometry().getShape(),
1953 } else {
1954 planGeometry.updateGeometry(segment->getLane()->getLaneGeometry().getShape(),
1959 }
1960 } else if (segment->isFirstSegment()) {
1961 planGeometry.updateGeometry(segment->getLane()->getLaneGeometry().getShape(),
1964 -1,
1966 } else if (segment->isLastSegment()) {
1967 planGeometry.updateGeometry(segment->getLane()->getLaneGeometry().getShape(),
1968 -1,
1972 } else {
1973 planGeometry = segment->getLane()->getLaneGeometry();
1974 }
1975 // calculate path width double
1976 const double drawingWidth = s.addSize.getExaggeration(s, segment->getLane()) * planWidth * 2;
1977 // check if draw with double width
1978 const bool drawHalfWidth = ((inspectedElements.getFirstAC() != myPlanElement) && (inspectedElements.getFirstAC() != planParent) && !gViewObjectsHandler.isObjectSelected(myPlanElement));
1979 // get end pos radius
1980 const double endPosRadius = getEndPosRadius(s, segment, drawHalfWidth);
1981 // draw geometry only if we'rent in drawForObjectUnderCursor mode
1982 if ((tagProperty.isPlanPerson() && s.checkDrawPerson(d, myPlanElement->isAttributeCarrierSelected())) ||
1983 (tagProperty.isPlanContainer() && s.checkDrawContainer(d, myPlanElement->isAttributeCarrierSelected()))) {
1984 // Add a draw matrix
1986 // Start with the drawing of the area traslating matrix to origin
1988 // Set color
1989 GLHelper::setColor(myPlanElement->drawUsingSelectColor() ? planSelectedColor : planColor);
1990 // draw geometry depending of drawWithDoubleWidth
1991 GUIGeometry::drawGeometry(d, planGeometry, drawingWidth * (drawHalfWidth ? 0.5 : 1));
1992 // draw red arrows
1993 drawFromArrow(s, segment->getLane(), segment);
1994 drawToArrow(s, segment->getLane(), segment);
1995 // Pop last matrix
1997 // Draw name if isn't being drawn for selecting
1999 // draw dotted contour
2001 // draw TAZ Center dotted contour
2003 }
2004 // declare trim geometry to draw
2005 const auto& shape = (segment->isFirstSegment() || segment->isLastSegment()) ? planGeometry.getShape() : segment->getLane()->getLaneShape();
2006 // calculate contour and draw dotted geometry (always with double width)
2007 if (segment->isFirstSegment()) {
2008 segment->getContour()->calculateContourExtrudedShape(s, d, myPlanElement, shape, myPlanElement->getType(), drawingWidth, 1, true, false,
2009 0, segment, segment->getLane()->getParentEdge());
2010 } else if (segment->isLastSegment()) {
2011 segment->getContour()->calculateContourExtrudedShape(s, d, myPlanElement, shape, myPlanElement->getType(), drawingWidth, 1, false, false,
2012 0, segment, segment->getLane()->getParentEdge());
2013 // calculate contour for end
2015 myPlanElement->getType(), 1, segment->getLane());
2016 } else {
2017 segment->getContour()->calculateContourExtrudedShape(s, d, myPlanElement, shape, myPlanElement->getType(), drawingWidth, 1, false, false, 0,
2018 segment, segment->getLane()->getParentEdge());
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
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, segment->getJunction());
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, segment->getJunction());
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, segment->getJunction());
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 (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_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:649
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:624
static void popMatrix()
pop matrix
Definition GLHelper.cpp:131
static void drawBoxLines(const PositionVector &geom, const std::vector< double > &rots, const std::vector< double > &lengths, double width, int cornerDetail=0, double offset=0)
Draws thick lines.
Definition GLHelper.cpp:348
static void drawBoundary(const GUIVisualizationSettings &s, const Boundary &b)
Draw a boundary (used for debugging)
Definition GLHelper.cpp:961
static void drawFilledCircleDetailled(const GUIVisualizationSettings::Detail d, const double radius)
Draws a filled circle around (0,0) depending of level of detail.
Definition GLHelper.cpp:534
static void pushMatrix()
push matrix
Definition GLHelper.cpp:118
bool isAttributeCarrierSelected() const
check if attribute carrier is selected
void setCommonAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
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
bool drawUsingSelectColor() const
check if attribute carrier must be drawn using selecting color.
bool isCommonValid(SumoXMLAttr key, const std::string &value)
void drawInLayer(const double typeOrLayer, const double extraOffset=0) const
draw element in the given layer, or in front if corresponding flag is enabled
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
std::string getCommonAttribute(SumoXMLAttr key) const
const GNETagProperties & myTagProperty
reference to tagProperty associated with this attribute carrier
static void changeAttribute(GNEAttributeCarrier *AC, SumoXMLAttr key, const std::string &value, GNEUndoList *undoList, const bool force=false)
change attribute
void calculateContourExtrudedShape(const GUIVisualizationSettings &s, const GUIVisualizationSettings::Detail d, const GUIGlObject *glObject, const PositionVector &shape, const double layer, const double extrusionWidth, const double scale, const bool closeFirstExtrem, const bool closeLastExtrem, const double offset, const GNESegment *segment, const GUIGlObject *boundaryParent, const bool addToSelectedObjects=true) const
calculate contour extruded (used in elements formed by a central shape)
void calculateContourCircleShape(const GUIVisualizationSettings &s, const GUIVisualizationSettings::Detail d, const GUIGlObject *glObject, const Position &pos, double radius, const double layer, const double scale, const GUIGlObject *boundaryParent) const
calculate contour (circle elements)
bool drawDottedContours(const GUIVisualizationSettings &s, const GUIVisualizationSettings::Detail d, const GNEAttributeCarrier *AC, const double lineWidth, const bool addOffset) const
draw dotted contours (basics, select, delete, inspect...)
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
GNEEdge * getParentEdge() const
get parent edge
Definition GNELane.cpp:196
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:1390
void removeGLObjectFromGrid(GNEAttributeCarrier *AC)
add GL Object into net
Definition GNENet.cpp:1400
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:2163
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 GNEJunction * getJunction() const
get junction 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
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