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/GNEUndoList.h>
25#include <netedit/GNEViewNet.h>
28
30#include "GNERoute.h"
31
32// ===========================================================================
33// static definitions
34// ===========================================================================
35
37
38// ===========================================================================
39// GNEDemandElement method definitions
40// ===========================================================================
41
42std::pair<SumoXMLTag, GUIIcon>
44 if (planParameters.isSingleEdgePlan()) {
45 return std::make_pair(GNE_TAG_WALK_EDGE_EDGE, GUIIcon::WALK_EDGE);
46 } else if (planParameters.consecutiveEdges.size() > 0) {
47 return std::make_pair(GNE_TAG_WALK_EDGES, GUIIcon::WALK_EDGES);
48 } else if (!planParameters.toRoute.empty()) {
49 return std::make_pair(GNE_TAG_WALK_ROUTE, GUIIcon::WALK_ROUTE);
50 } else if (!planParameters.fromEdge.empty()) {
51 if (!planParameters.toEdge.empty()) {
52 return std::make_pair(GNE_TAG_WALK_EDGE_EDGE, GUIIcon::WALK_EDGE);
53 } else if (!planParameters.toTAZ.empty()) {
54 return std::make_pair(GNE_TAG_WALK_EDGE_TAZ, GUIIcon::WALK_TAZ);
55 } else if (!planParameters.toJunction.empty()) {
57 } else if (!planParameters.toBusStop.empty()) {
59 } else if (!planParameters.toTrainStop.empty()) {
61 } else if (!planParameters.toContainerStop.empty()) {
63 } else if (!planParameters.toChargingStation.empty()) {
65 } else if (!planParameters.toParkingArea.empty()) {
67 } else {
68 return std::make_pair(SUMO_TAG_NOTHING, GUIIcon::EMPTY);
69 }
70 } else if (!planParameters.fromTAZ.empty()) {
71 if (!planParameters.toEdge.empty()) {
72 return std::make_pair(GNE_TAG_WALK_TAZ_EDGE, GUIIcon::WALK_EDGE);
73 } else if (!planParameters.toTAZ.empty()) {
74 return std::make_pair(GNE_TAG_WALK_TAZ_TAZ, GUIIcon::WALK_TAZ);
75 } else if (!planParameters.toJunction.empty()) {
77 } else if (!planParameters.toBusStop.empty()) {
78 return std::make_pair(GNE_TAG_WALK_TAZ_BUSSTOP, GUIIcon::WALK_BUSSTOP);
79 } else if (!planParameters.toTrainStop.empty()) {
81 } else if (!planParameters.toContainerStop.empty()) {
83 } else if (!planParameters.toChargingStation.empty()) {
85 } else if (!planParameters.toParkingArea.empty()) {
87 } else {
88 return std::make_pair(SUMO_TAG_NOTHING, GUIIcon::EMPTY);
89 }
90 } else if (!planParameters.fromJunction.empty()) {
91 if (!planParameters.toEdge.empty()) {
92 return std::make_pair(GNE_TAG_WALK_JUNCTION_EDGE, GUIIcon::WALK_EDGE);
93 } else if (!planParameters.toTAZ.empty()) {
94 return std::make_pair(GNE_TAG_WALK_JUNCTION_TAZ, GUIIcon::WALK_TAZ);
95 } else if (!planParameters.toJunction.empty()) {
97 } else if (!planParameters.toBusStop.empty()) {
99 } else if (!planParameters.toTrainStop.empty()) {
101 } else if (!planParameters.toContainerStop.empty()) {
103 } else if (!planParameters.toChargingStation.empty()) {
105 } else if (!planParameters.toParkingArea.empty()) {
107 } else {
108 return std::make_pair(SUMO_TAG_NOTHING, GUIIcon::EMPTY);
109 }
110 } else if (!planParameters.fromBusStop.empty()) {
111 if (!planParameters.toEdge.empty()) {
112 return std::make_pair(GNE_TAG_WALK_BUSSTOP_EDGE, GUIIcon::WALK_EDGE);
113 } else if (!planParameters.toTAZ.empty()) {
114 return std::make_pair(GNE_TAG_WALK_BUSSTOP_TAZ, GUIIcon::WALK_TAZ);
115 } else if (!planParameters.toJunction.empty()) {
117 } else if (!planParameters.toBusStop.empty()) {
119 } else if (!planParameters.toTrainStop.empty()) {
121 } else if (!planParameters.toContainerStop.empty()) {
123 } else if (!planParameters.toChargingStation.empty()) {
125 } else if (!planParameters.toParkingArea.empty()) {
127 } else {
128 return std::make_pair(SUMO_TAG_NOTHING, GUIIcon::EMPTY);
129 }
130 } else if (!planParameters.fromTrainStop.empty()) {
131 if (!planParameters.toEdge.empty()) {
132 return std::make_pair(GNE_TAG_WALK_TRAINSTOP_EDGE, GUIIcon::WALK_EDGE);
133 } else if (!planParameters.toTAZ.empty()) {
134 return std::make_pair(GNE_TAG_WALK_TRAINSTOP_TAZ, GUIIcon::WALK_TAZ);
135 } else if (!planParameters.toJunction.empty()) {
137 } else if (!planParameters.toBusStop.empty()) {
139 } else if (!planParameters.toTrainStop.empty()) {
141 } else if (!planParameters.toContainerStop.empty()) {
143 } else if (!planParameters.toChargingStation.empty()) {
145 } else if (!planParameters.toParkingArea.empty()) {
147 } else {
148 return std::make_pair(SUMO_TAG_NOTHING, GUIIcon::EMPTY);
149 }
150 } else if (!planParameters.fromContainerStop.empty()) {
151 if (!planParameters.toEdge.empty()) {
153 } else if (!planParameters.toTAZ.empty()) {
155 } else if (!planParameters.toJunction.empty()) {
157 } else if (!planParameters.toBusStop.empty()) {
159 } else if (!planParameters.toTrainStop.empty()) {
161 } else if (!planParameters.toContainerStop.empty()) {
163 } else if (!planParameters.toChargingStation.empty()) {
165 } else if (!planParameters.toParkingArea.empty()) {
167 } else {
168 return std::make_pair(SUMO_TAG_NOTHING, GUIIcon::EMPTY);
169 }
170 } else if (!planParameters.fromChargingStation.empty()) {
171 if (!planParameters.toEdge.empty()) {
173 } else if (!planParameters.toTAZ.empty()) {
175 } else if (!planParameters.toJunction.empty()) {
177 } else if (!planParameters.toBusStop.empty()) {
179 } else if (!planParameters.toTrainStop.empty()) {
181 } else if (!planParameters.toContainerStop.empty()) {
183 } else if (!planParameters.toChargingStation.empty()) {
185 } else if (!planParameters.toParkingArea.empty()) {
187 } else {
188 return std::make_pair(SUMO_TAG_NOTHING, GUIIcon::EMPTY);
189 }
190 } else if (!planParameters.fromParkingArea.empty()) {
191 if (!planParameters.toEdge.empty()) {
193 } else if (!planParameters.toTAZ.empty()) {
194 return std::make_pair(GNE_TAG_WALK_PARKINGAREA_TAZ, GUIIcon::WALK_TAZ);
195 } else if (!planParameters.toJunction.empty()) {
197 } else if (!planParameters.toBusStop.empty()) {
199 } else if (!planParameters.toTrainStop.empty()) {
201 } else if (!planParameters.toContainerStop.empty()) {
203 } else if (!planParameters.toChargingStation.empty()) {
205 } else if (!planParameters.toParkingArea.empty()) {
207 } else {
208 return std::make_pair(SUMO_TAG_NOTHING, GUIIcon::EMPTY);
209 }
210 } else {
211 return std::make_pair(SUMO_TAG_NOTHING, GUIIcon::EMPTY);
212 }
213}
214
215
216std::pair<SumoXMLTag, GUIIcon>
218 if (planParameters.isSingleEdgePlan()) {
220 } else if (!planParameters.fromEdge.empty()) {
221 if (!planParameters.toEdge.empty()) {
223 } else if (!planParameters.toTAZ.empty()) {
225 } else if (!planParameters.toJunction.empty()) {
227 } else if (!planParameters.toBusStop.empty()) {
229 } else if (!planParameters.toTrainStop.empty()) {
231 } else if (!planParameters.toContainerStop.empty()) {
233 } else if (!planParameters.toChargingStation.empty()) {
235 } else if (!planParameters.toParkingArea.empty()) {
237 } else {
238 return std::make_pair(SUMO_TAG_NOTHING, GUIIcon::EMPTY);
239 }
240 } else if (!planParameters.fromTAZ.empty()) {
241 if (!planParameters.toEdge.empty()) {
243 } else if (!planParameters.toTAZ.empty()) {
245 } else if (!planParameters.toJunction.empty()) {
247 } else if (!planParameters.toBusStop.empty()) {
249 } else if (!planParameters.toTrainStop.empty()) {
251 } else if (!planParameters.toContainerStop.empty()) {
253 } else if (!planParameters.toChargingStation.empty()) {
255 } else if (!planParameters.toParkingArea.empty()) {
257 } else {
258 return std::make_pair(SUMO_TAG_NOTHING, GUIIcon::EMPTY);
259 }
260 } else if (!planParameters.fromJunction.empty()) {
261 if (!planParameters.toEdge.empty()) {
263 } else if (!planParameters.toTAZ.empty()) {
265 } else if (!planParameters.toJunction.empty()) {
267 } else if (!planParameters.toBusStop.empty()) {
269 } else if (!planParameters.toTrainStop.empty()) {
271 } else if (!planParameters.toContainerStop.empty()) {
273 } else if (!planParameters.toChargingStation.empty()) {
275 } else if (!planParameters.toParkingArea.empty()) {
277 } else {
278 return std::make_pair(SUMO_TAG_NOTHING, GUIIcon::EMPTY);
279 }
280 } else if (!planParameters.fromBusStop.empty()) {
281 if (!planParameters.toEdge.empty()) {
283 } else if (!planParameters.toTAZ.empty()) {
285 } else if (!planParameters.toJunction.empty()) {
287 } else if (!planParameters.toBusStop.empty()) {
289 } else if (!planParameters.toTrainStop.empty()) {
291 } else if (!planParameters.toContainerStop.empty()) {
293 } else if (!planParameters.toChargingStation.empty()) {
295 } else if (!planParameters.toParkingArea.empty()) {
297 } else {
298 return std::make_pair(SUMO_TAG_NOTHING, GUIIcon::EMPTY);
299 }
300 } else if (!planParameters.fromTrainStop.empty()) {
301 if (!planParameters.toEdge.empty()) {
303 } else if (!planParameters.toTAZ.empty()) {
305 } else if (!planParameters.toJunction.empty()) {
307 } else if (!planParameters.toBusStop.empty()) {
309 } else if (!planParameters.toTrainStop.empty()) {
311 } else if (!planParameters.toContainerStop.empty()) {
313 } else if (!planParameters.toChargingStation.empty()) {
315 } else if (!planParameters.toParkingArea.empty()) {
317 } else {
318 return std::make_pair(SUMO_TAG_NOTHING, GUIIcon::EMPTY);
319 }
320 } else if (!planParameters.fromContainerStop.empty()) {
321 if (!planParameters.toEdge.empty()) {
323 } else if (!planParameters.toTAZ.empty()) {
325 } else if (!planParameters.toJunction.empty()) {
327 } else if (!planParameters.toBusStop.empty()) {
329 } else if (!planParameters.toTrainStop.empty()) {
331 } else if (!planParameters.toContainerStop.empty()) {
333 } else if (!planParameters.toChargingStation.empty()) {
335 } else if (!planParameters.toParkingArea.empty()) {
337 } else {
338 return std::make_pair(SUMO_TAG_NOTHING, GUIIcon::EMPTY);
339 }
340 } else if (!planParameters.fromChargingStation.empty()) {
341 if (!planParameters.toEdge.empty()) {
343 } else if (!planParameters.toTAZ.empty()) {
345 } else if (!planParameters.toJunction.empty()) {
347 } else if (!planParameters.toBusStop.empty()) {
349 } else if (!planParameters.toTrainStop.empty()) {
351 } else if (!planParameters.toContainerStop.empty()) {
353 } else if (!planParameters.toChargingStation.empty()) {
355 } else if (!planParameters.toParkingArea.empty()) {
357 } else {
358 return std::make_pair(SUMO_TAG_NOTHING, GUIIcon::EMPTY);
359 }
360 } else if (!planParameters.fromParkingArea.empty()) {
361 if (!planParameters.toEdge.empty()) {
363 } else if (!planParameters.toTAZ.empty()) {
365 } else if (!planParameters.toJunction.empty()) {
367 } else if (!planParameters.toBusStop.empty()) {
369 } else if (!planParameters.toTrainStop.empty()) {
371 } else if (!planParameters.toContainerStop.empty()) {
373 } else if (!planParameters.toChargingStation.empty()) {
375 } else if (!planParameters.toParkingArea.empty()) {
377 } else {
378 return std::make_pair(SUMO_TAG_NOTHING, GUIIcon::EMPTY);
379 }
380 } else {
381 return std::make_pair(SUMO_TAG_NOTHING, GUIIcon::EMPTY);
382 }
383}
384
385
386std::pair<SumoXMLTag, GUIIcon>
388 if (planParameters.isSingleEdgePlan()) {
389 return std::make_pair(GNE_TAG_RIDE_EDGE_EDGE, GUIIcon::RIDE_EDGE);
390 } else if (!planParameters.fromEdge.empty()) {
391 if (!planParameters.toEdge.empty()) {
392 return std::make_pair(GNE_TAG_RIDE_EDGE_EDGE, GUIIcon::RIDE_EDGE);
393 } else if (!planParameters.toTAZ.empty()) {
394 return std::make_pair(GNE_TAG_RIDE_EDGE_TAZ, GUIIcon::RIDE_TAZ);
395 } else if (!planParameters.toJunction.empty()) {
397 } else if (!planParameters.toBusStop.empty()) {
398 return std::make_pair(GNE_TAG_RIDE_EDGE_BUSSTOP, GUIIcon::RIDE_BUSSTOP);
399 } else if (!planParameters.toTrainStop.empty()) {
401 } else if (!planParameters.toContainerStop.empty()) {
403 } else if (!planParameters.toChargingStation.empty()) {
405 } else if (!planParameters.toParkingArea.empty()) {
407 } else {
408 return std::make_pair(SUMO_TAG_NOTHING, GUIIcon::EMPTY);
409 }
410 } else if (!planParameters.fromTAZ.empty()) {
411 if (!planParameters.toEdge.empty()) {
412 return std::make_pair(GNE_TAG_RIDE_TAZ_EDGE, GUIIcon::RIDE_EDGE);
413 } else if (!planParameters.toTAZ.empty()) {
414 return std::make_pair(GNE_TAG_RIDE_TAZ_TAZ, GUIIcon::RIDE_TAZ);
415 } else if (!planParameters.toJunction.empty()) {
417 } else if (!planParameters.toBusStop.empty()) {
418 return std::make_pair(GNE_TAG_RIDE_TAZ_BUSSTOP, GUIIcon::RIDE_BUSSTOP);
419 } else if (!planParameters.toTrainStop.empty()) {
421 } else if (!planParameters.toContainerStop.empty()) {
423 } else if (!planParameters.toChargingStation.empty()) {
425 } else if (!planParameters.toParkingArea.empty()) {
427 } else {
428 return std::make_pair(SUMO_TAG_NOTHING, GUIIcon::EMPTY);
429 }
430 } else if (!planParameters.fromJunction.empty()) {
431 if (!planParameters.toEdge.empty()) {
432 return std::make_pair(GNE_TAG_RIDE_JUNCTION_EDGE, GUIIcon::RIDE_EDGE);
433 } else if (!planParameters.toTAZ.empty()) {
434 return std::make_pair(GNE_TAG_RIDE_JUNCTION_TAZ, GUIIcon::RIDE_TAZ);
435 } else if (!planParameters.toJunction.empty()) {
437 } else if (!planParameters.toBusStop.empty()) {
439 } else if (!planParameters.toTrainStop.empty()) {
441 } else if (!planParameters.toContainerStop.empty()) {
443 } else if (!planParameters.toChargingStation.empty()) {
445 } else if (!planParameters.toParkingArea.empty()) {
447 } else {
448 return std::make_pair(SUMO_TAG_NOTHING, GUIIcon::EMPTY);
449 }
450 } else if (!planParameters.fromBusStop.empty()) {
451 if (!planParameters.toEdge.empty()) {
452 return std::make_pair(GNE_TAG_RIDE_BUSSTOP_EDGE, GUIIcon::RIDE_EDGE);
453 } else if (!planParameters.toTAZ.empty()) {
454 return std::make_pair(GNE_TAG_RIDE_BUSSTOP_TAZ, GUIIcon::RIDE_TAZ);
455 } else if (!planParameters.toJunction.empty()) {
457 } else if (!planParameters.toBusStop.empty()) {
459 } else if (!planParameters.toTrainStop.empty()) {
461 } else if (!planParameters.toContainerStop.empty()) {
463 } else if (!planParameters.toChargingStation.empty()) {
465 } else if (!planParameters.toParkingArea.empty()) {
467 } else {
468 return std::make_pair(SUMO_TAG_NOTHING, GUIIcon::EMPTY);
469 }
470 } else if (!planParameters.fromTrainStop.empty()) {
471 if (!planParameters.toEdge.empty()) {
472 return std::make_pair(GNE_TAG_RIDE_TRAINSTOP_EDGE, GUIIcon::RIDE_EDGE);
473 } else if (!planParameters.toTAZ.empty()) {
474 return std::make_pair(GNE_TAG_RIDE_TRAINSTOP_TAZ, GUIIcon::RIDE_TAZ);
475 } else if (!planParameters.toJunction.empty()) {
477 } else if (!planParameters.toBusStop.empty()) {
479 } else if (!planParameters.toTrainStop.empty()) {
481 } else if (!planParameters.toContainerStop.empty()) {
483 } else if (!planParameters.toChargingStation.empty()) {
485 } else if (!planParameters.toParkingArea.empty()) {
487 } else {
488 return std::make_pair(SUMO_TAG_NOTHING, GUIIcon::EMPTY);
489 }
490 } else if (!planParameters.fromContainerStop.empty()) {
491 if (!planParameters.toEdge.empty()) {
493 } else if (!planParameters.toTAZ.empty()) {
495 } else if (!planParameters.toJunction.empty()) {
497 } else if (!planParameters.toBusStop.empty()) {
499 } else if (!planParameters.toTrainStop.empty()) {
501 } else if (!planParameters.toContainerStop.empty()) {
503 } else if (!planParameters.toChargingStation.empty()) {
505 } else if (!planParameters.toParkingArea.empty()) {
507 } else {
508 return std::make_pair(SUMO_TAG_NOTHING, GUIIcon::EMPTY);
509 }
510 } else if (!planParameters.fromChargingStation.empty()) {
511 if (!planParameters.toEdge.empty()) {
513 } else if (!planParameters.toTAZ.empty()) {
515 } else if (!planParameters.toJunction.empty()) {
517 } else if (!planParameters.toBusStop.empty()) {
519 } else if (!planParameters.toTrainStop.empty()) {
521 } else if (!planParameters.toContainerStop.empty()) {
523 } else if (!planParameters.toChargingStation.empty()) {
525 } else if (!planParameters.toParkingArea.empty()) {
527 } else {
528 return std::make_pair(SUMO_TAG_NOTHING, GUIIcon::EMPTY);
529 }
530 } else if (!planParameters.fromParkingArea.empty()) {
531 if (!planParameters.toEdge.empty()) {
533 } else if (!planParameters.toTAZ.empty()) {
534 return std::make_pair(GNE_TAG_RIDE_PARKINGAREA_TAZ, GUIIcon::RIDE_TAZ);
535 } else if (!planParameters.toJunction.empty()) {
537 } else if (!planParameters.toBusStop.empty()) {
539 } else if (!planParameters.toTrainStop.empty()) {
541 } else if (!planParameters.toContainerStop.empty()) {
543 } else if (!planParameters.toChargingStation.empty()) {
545 } else if (!planParameters.toParkingArea.empty()) {
547 } else {
548 return std::make_pair(SUMO_TAG_NOTHING, GUIIcon::EMPTY);
549 }
550 } else {
551 return std::make_pair(SUMO_TAG_NOTHING, GUIIcon::EMPTY);
552 }
553}
554
555
556std::pair<SumoXMLTag, GUIIcon>
558 if (planParameters.isSingleEdgePlan()) {
560 } else if (!planParameters.fromEdge.empty()) {
561 if (!planParameters.toEdge.empty()) {
563 } else if (!planParameters.toTAZ.empty()) {
565 } else if (!planParameters.toJunction.empty()) {
567 } else if (!planParameters.toBusStop.empty()) {
569 } else if (!planParameters.toTrainStop.empty()) {
571 } else if (!planParameters.toContainerStop.empty()) {
573 } else if (!planParameters.toChargingStation.empty()) {
575 } else if (!planParameters.toParkingArea.empty()) {
577 } else {
578 return std::make_pair(SUMO_TAG_NOTHING, GUIIcon::EMPTY);
579 }
580 } else if (!planParameters.fromTAZ.empty()) {
581 if (!planParameters.toEdge.empty()) {
583 } else if (!planParameters.toTAZ.empty()) {
585 } else if (!planParameters.toJunction.empty()) {
587 } else if (!planParameters.toBusStop.empty()) {
589 } else if (!planParameters.toTrainStop.empty()) {
591 } else if (!planParameters.toContainerStop.empty()) {
593 } else if (!planParameters.toChargingStation.empty()) {
595 } else if (!planParameters.toParkingArea.empty()) {
597 } else {
598 return std::make_pair(SUMO_TAG_NOTHING, GUIIcon::EMPTY);
599 }
600 } else if (!planParameters.fromJunction.empty()) {
601 if (!planParameters.toEdge.empty()) {
603 } else if (!planParameters.toTAZ.empty()) {
605 } else if (!planParameters.toJunction.empty()) {
607 } else if (!planParameters.toBusStop.empty()) {
609 } else if (!planParameters.toTrainStop.empty()) {
611 } else if (!planParameters.toContainerStop.empty()) {
613 } else if (!planParameters.toChargingStation.empty()) {
615 } else if (!planParameters.toParkingArea.empty()) {
617 } else {
618 return std::make_pair(SUMO_TAG_NOTHING, GUIIcon::EMPTY);
619 }
620 } else if (!planParameters.fromBusStop.empty()) {
621 if (!planParameters.toEdge.empty()) {
623 } else if (!planParameters.toTAZ.empty()) {
625 } else if (!planParameters.toJunction.empty()) {
627 } else if (!planParameters.toBusStop.empty()) {
629 } else if (!planParameters.toTrainStop.empty()) {
631 } else if (!planParameters.toContainerStop.empty()) {
633 } else if (!planParameters.toChargingStation.empty()) {
635 } else if (!planParameters.toParkingArea.empty()) {
637 } else {
638 return std::make_pair(SUMO_TAG_NOTHING, GUIIcon::EMPTY);
639 }
640 } else if (!planParameters.fromTrainStop.empty()) {
641 if (!planParameters.toEdge.empty()) {
643 } else if (!planParameters.toTAZ.empty()) {
645 } else if (!planParameters.toJunction.empty()) {
647 } else if (!planParameters.toBusStop.empty()) {
649 } else if (!planParameters.toTrainStop.empty()) {
651 } else if (!planParameters.toContainerStop.empty()) {
653 } else if (!planParameters.toChargingStation.empty()) {
655 } else if (!planParameters.toParkingArea.empty()) {
657 } else {
658 return std::make_pair(SUMO_TAG_NOTHING, GUIIcon::EMPTY);
659 }
660 } else if (!planParameters.fromContainerStop.empty()) {
661 if (!planParameters.toEdge.empty()) {
663 } else if (!planParameters.toTAZ.empty()) {
665 } else if (!planParameters.toJunction.empty()) {
667 } else if (!planParameters.toBusStop.empty()) {
669 } else if (!planParameters.toTrainStop.empty()) {
671 } else if (!planParameters.toContainerStop.empty()) {
673 } else if (!planParameters.toChargingStation.empty()) {
675 } else if (!planParameters.toParkingArea.empty()) {
677 } else {
678 return std::make_pair(SUMO_TAG_NOTHING, GUIIcon::EMPTY);
679 }
680 } else if (!planParameters.fromChargingStation.empty()) {
681 if (!planParameters.toEdge.empty()) {
683 } else if (!planParameters.toTAZ.empty()) {
685 } else if (!planParameters.toJunction.empty()) {
687 } else if (!planParameters.toBusStop.empty()) {
689 } else if (!planParameters.toTrainStop.empty()) {
691 } else if (!planParameters.toContainerStop.empty()) {
693 } else if (!planParameters.toChargingStation.empty()) {
695 } else if (!planParameters.toParkingArea.empty()) {
697 } else {
698 return std::make_pair(SUMO_TAG_NOTHING, GUIIcon::EMPTY);
699 }
700 } else if (!planParameters.fromParkingArea.empty()) {
701 if (!planParameters.toEdge.empty()) {
703 } else if (!planParameters.toTAZ.empty()) {
705 } else if (!planParameters.toJunction.empty()) {
707 } else if (!planParameters.toBusStop.empty()) {
709 } else if (!planParameters.toTrainStop.empty()) {
711 } else if (!planParameters.toContainerStop.empty()) {
713 } else if (!planParameters.toChargingStation.empty()) {
715 } else if (!planParameters.toParkingArea.empty()) {
717 } else {
718 return std::make_pair(SUMO_TAG_NOTHING, GUIIcon::EMPTY);
719 }
720 } else {
721 return std::make_pair(SUMO_TAG_NOTHING, GUIIcon::EMPTY);
722 }
723}
724
725
726std::pair<SumoXMLTag, GUIIcon>
728 if (planParameters.isSingleEdgePlan()) {
730 } else if (planParameters.consecutiveEdges.size() > 0) {
731 return std::make_pair(GNE_TAG_TRANSHIP_EDGES, GUIIcon::TRANSHIP_EDGES);
732 } else if (!planParameters.fromEdge.empty()) {
733 if (!planParameters.toEdge.empty()) {
735 } else if (!planParameters.toTAZ.empty()) {
736 return std::make_pair(GNE_TAG_TRANSHIP_EDGE_TAZ, GUIIcon::TRANSHIP_TAZ);
737 } else if (!planParameters.toJunction.empty()) {
739 } else if (!planParameters.toBusStop.empty()) {
741 } else if (!planParameters.toTrainStop.empty()) {
743 } else if (!planParameters.toContainerStop.empty()) {
745 } else if (!planParameters.toChargingStation.empty()) {
747 } else if (!planParameters.toParkingArea.empty()) {
749 } else {
750 return std::make_pair(SUMO_TAG_NOTHING, GUIIcon::EMPTY);
751 }
752 } else if (!planParameters.fromTAZ.empty()) {
753 if (!planParameters.toEdge.empty()) {
755 } else if (!planParameters.toTAZ.empty()) {
756 return std::make_pair(GNE_TAG_TRANSHIP_TAZ_TAZ, GUIIcon::TRANSHIP_TAZ);
757 } else if (!planParameters.toJunction.empty()) {
759 } else if (!planParameters.toBusStop.empty()) {
761 } else if (!planParameters.toTrainStop.empty()) {
763 } else if (!planParameters.toContainerStop.empty()) {
765 } else if (!planParameters.toChargingStation.empty()) {
767 } else if (!planParameters.toParkingArea.empty()) {
769 } else {
770 return std::make_pair(SUMO_TAG_NOTHING, GUIIcon::EMPTY);
771 }
772 } else if (!planParameters.fromJunction.empty()) {
773 if (!planParameters.toEdge.empty()) {
775 } else if (!planParameters.toTAZ.empty()) {
777 } else if (!planParameters.toJunction.empty()) {
779 } else if (!planParameters.toBusStop.empty()) {
781 } else if (!planParameters.toTrainStop.empty()) {
783 } else if (!planParameters.toContainerStop.empty()) {
785 } else if (!planParameters.toChargingStation.empty()) {
787 } else if (!planParameters.toParkingArea.empty()) {
789 } else {
790 return std::make_pair(SUMO_TAG_NOTHING, GUIIcon::EMPTY);
791 }
792 } else if (!planParameters.fromBusStop.empty()) {
793 if (!planParameters.toEdge.empty()) {
795 } else if (!planParameters.toTAZ.empty()) {
797 } else if (!planParameters.toJunction.empty()) {
799 } else if (!planParameters.toBusStop.empty()) {
801 } else if (!planParameters.toTrainStop.empty()) {
803 } else if (!planParameters.toContainerStop.empty()) {
805 } else if (!planParameters.toChargingStation.empty()) {
807 } else if (!planParameters.toParkingArea.empty()) {
809 } else {
810 return std::make_pair(SUMO_TAG_NOTHING, GUIIcon::EMPTY);
811 }
812 } else if (!planParameters.fromTrainStop.empty()) {
813 if (!planParameters.toEdge.empty()) {
815 } else if (!planParameters.toTAZ.empty()) {
817 } else if (!planParameters.toJunction.empty()) {
819 } else if (!planParameters.toBusStop.empty()) {
821 } else if (!planParameters.toTrainStop.empty()) {
823 } else if (!planParameters.toContainerStop.empty()) {
825 } else if (!planParameters.toChargingStation.empty()) {
827 } else if (!planParameters.toParkingArea.empty()) {
829 } else {
830 return std::make_pair(SUMO_TAG_NOTHING, GUIIcon::EMPTY);
831 }
832 } else if (!planParameters.fromContainerStop.empty()) {
833 if (!planParameters.toEdge.empty()) {
835 } else if (!planParameters.toTAZ.empty()) {
837 } else if (!planParameters.toJunction.empty()) {
839 } else if (!planParameters.toBusStop.empty()) {
841 } else if (!planParameters.toTrainStop.empty()) {
843 } else if (!planParameters.toContainerStop.empty()) {
845 } else if (!planParameters.toChargingStation.empty()) {
847 } else if (!planParameters.toParkingArea.empty()) {
849 } else {
850 return std::make_pair(SUMO_TAG_NOTHING, GUIIcon::EMPTY);
851 }
852 } else if (!planParameters.fromChargingStation.empty()) {
853 if (!planParameters.toEdge.empty()) {
855 } else if (!planParameters.toTAZ.empty()) {
857 } else if (!planParameters.toJunction.empty()) {
859 } else if (!planParameters.toBusStop.empty()) {
861 } else if (!planParameters.toTrainStop.empty()) {
863 } else if (!planParameters.toContainerStop.empty()) {
865 } else if (!planParameters.toChargingStation.empty()) {
867 } else if (!planParameters.toParkingArea.empty()) {
869 } else {
870 return std::make_pair(SUMO_TAG_NOTHING, GUIIcon::EMPTY);
871 }
872 } else if (!planParameters.fromParkingArea.empty()) {
873 if (!planParameters.toEdge.empty()) {
875 } else if (!planParameters.toTAZ.empty()) {
877 } else if (!planParameters.toJunction.empty()) {
879 } else if (!planParameters.toBusStop.empty()) {
881 } else if (!planParameters.toTrainStop.empty()) {
883 } else if (!planParameters.toContainerStop.empty()) {
885 } else if (!planParameters.toChargingStation.empty()) {
887 } else if (!planParameters.toParkingArea.empty()) {
889 } else {
890 return std::make_pair(SUMO_TAG_NOTHING, GUIIcon::EMPTY);
891 }
892 } else {
893 return std::make_pair(SUMO_TAG_NOTHING, GUIIcon::EMPTY);
894 }
895}
896
897
898std::pair<SumoXMLTag, GUIIcon>
900 if (!planParameters.toEdge.empty()) {
901 return std::make_pair(GNE_TAG_STOPPERSON_EDGE, GUIIcon::STOPELEMENT);
902 } else if (!planParameters.toBusStop.empty()) {
903 return std::make_pair(GNE_TAG_STOPPERSON_BUSSTOP, GUIIcon::STOPELEMENT);
904 } else if (!planParameters.toTrainStop.empty()) {
906 } else if (!planParameters.toContainerStop.empty()) {
908 } else if (!planParameters.toChargingStation.empty()) {
910 } else if (!planParameters.toParkingArea.empty()) {
912 } else {
913 return std::make_pair(SUMO_TAG_NOTHING, GUIIcon::EMPTY);
914 }
915}
916
917
918std::pair<SumoXMLTag, GUIIcon>
920 if (!planParameters.toEdge.empty()) {
921 return std::make_pair(GNE_TAG_STOPCONTAINER_EDGE, GUIIcon::STOPELEMENT);
922 } else if (!planParameters.toBusStop.empty()) {
924 } else if (!planParameters.toTrainStop.empty()) {
926 } else if (!planParameters.toContainerStop.empty()) {
928 } else if (!planParameters.toChargingStation.empty()) {
930 } else if (!planParameters.toParkingArea.empty()) {
932 } else {
933 return std::make_pair(SUMO_TAG_NOTHING, GUIIcon::EMPTY);
934 }
935}
936
937
938GNEDemandElementPlan::GNEDemandElementPlan(GNEDemandElement* planElement, const double departPosition, const double arrivalPosition) :
939 myDepartPosition(departPosition),
940 myArrivalPosition(arrivalPosition),
941 myPlanElement(planElement) {
942 // update centering boundary without updating grid
944}
945
946
949 // get tag property
950 const auto& tagProperty = myPlanElement->getTagProperty();
951 // only move personTrips defined over edges
952 if (tagProperty.planToEdge() || tagProperty.planConsecutiveEdges() || tagProperty.planEdge()) {
953 // get geometry end pos
955 // calculate circle width squared
956 const double circleWidthSquared = myArrivalPositionDiameter * myArrivalPositionDiameter;
957 // check if we clicked over a geometry end pos
958 if (myPlanElement->myNet->getViewNet()->getPositionInformation().distanceSquaredTo2D(geometryEndPos) <= ((circleWidthSquared + 2))) {
959 // continue depending of parent edges
960 if (myPlanElement->getParentEdges().size() > 0) {
961 return new GNEMoveOperation(myPlanElement, myPlanElement->getParentEdges().back()->getLaneByAllowedVClass(myPlanElement->getVClass()), myArrivalPosition, false);
962 } else {
963 return new GNEMoveOperation(myPlanElement, myPlanElement->getParentDemandElements().at(1)->getParentEdges().back()->getLaneByAllowedVClass(myPlanElement->getVClass()), myArrivalPosition, false);
964 }
965 }
966 }
967 return nullptr;
968}
969
970
971void
973 const auto& tagProperty = myPlanElement->getTagProperty();
974 // write attributes depending of parent elements
975 if (tagProperty.planConsecutiveEdges()) {
977 } else if (tagProperty.planRoute()) {
979 } else if (tagProperty.planEdge()) {
980 device.writeAttr(SUMO_ATTR_EDGE, myPlanElement->getParentEdges().front()->getID());
981 } else if (tagProperty.planBusStop()) {
983 } else if (tagProperty.planTrainStop()) {
985 } else if (tagProperty.planContainerStop()) {
987 } else if (tagProperty.planChargingStation()) {
989 } else if (tagProperty.planParkingArea()) {
991 } else {
992 // write from attribute (if this is the first element)
993 if (myPlanElement->getParentDemandElements().at(0)->getPreviousChildDemandElement(myPlanElement) == nullptr) {
994 // check if write edge or junction
995 if (tagProperty.planFromEdge()) {
996 device.writeAttr(SUMO_ATTR_FROM, myPlanElement->getParentEdges().front()->getID());
997 } else if (tagProperty.planFromTAZ()) {
998 device.writeAttr(SUMO_ATTR_FROM_TAZ, myPlanElement->getParentTAZs().front()->getID());
999 } else if (tagProperty.planFromJunction()) {
1001 }
1002 // origin stopping places are transformed into an intial stop stage (see writeOriginStop)
1003 }
1004 // continue writting to attribute
1005 if (tagProperty.planToEdge()) {
1006 device.writeAttr(SUMO_ATTR_TO, myPlanElement->getParentEdges().back()->getID());
1007 } else if (tagProperty.planToJunction()) {
1009 } else if (tagProperty.planToTAZ()) {
1010 device.writeAttr(SUMO_ATTR_TO_TAZ, myPlanElement->getParentTAZs().back()->getID());
1011 } else if (tagProperty.planToBusStop()) {
1013 } else if (tagProperty.planToTrainStop()) {
1015 } else if (tagProperty.planToContainerStop()) {
1017 } else if (tagProperty.planToChargingStation()) {
1019 } else if (tagProperty.planToParkingArea()) {
1021 }
1022 }
1023 // check if write depart position
1024 if (tagProperty.hasAttribute(SUMO_ATTR_DEPARTPOS) && (myDepartPosition > 0)) {
1026 }
1027 // check if write arrival position
1028 if (tagProperty.hasAttribute(SUMO_ATTR_ARRIVALPOS) && (myArrivalPosition > 0)) {
1030 }
1031 // check if write end position
1032 if (tagProperty.hasAttribute(SUMO_ATTR_ENDPOS)) {
1034 }
1035}
1036
1037
1038void
1040 const auto& tagProperty = myPlanElement->getTagProperty();
1041 // write an extra stop element with duration 0 over a stopping place (if this is the first element)
1042 if (tagProperty.planFromStoppingPlace()
1043 && myPlanElement->getParentDemandElements().at(0)->getPreviousChildDemandElement(myPlanElement) == nullptr) {
1044 device.openTag(SUMO_TAG_STOP);
1045 const std::string stopID = myPlanElement->getParentStoppingPlaces().front()->getID();
1046 if (tagProperty.planFromBusStop()) {
1047 device.writeAttr(SUMO_ATTR_BUS_STOP, stopID);
1048 } else if (tagProperty.planFromTrainStop()) {
1049 device.writeAttr(SUMO_ATTR_TRAIN_STOP, stopID);
1050 } else if (tagProperty.planFromContainerStop()) {
1051 device.writeAttr(SUMO_ATTR_CONTAINER_STOP, stopID);
1052 } else if (tagProperty.planFromChargingStation()) {
1053 device.writeAttr(SUMO_ATTR_CHARGING_STATION, stopID);
1054 } else if (tagProperty.planFromParkingArea()) {
1055 device.writeAttr(SUMO_ATTR_PARKING_AREA, stopID);
1056 }
1057 device.writeAttr(SUMO_ATTR_DURATION, 0);
1058 device.closeTag();
1059 }
1060}
1061
1062
1066 // build header
1068 // build menu command for center button and copy cursor position to clipboard
1071 // build menu commands for names
1072 GUIDesigns::buildFXMenuCommand(ret, "Copy " + myPlanElement->getTagStr() + " name to clipboard", nullptr, ret, MID_COPY_NAME);
1073 GUIDesigns::buildFXMenuCommand(ret, "Copy " + myPlanElement->getTagStr() + " typed name to clipboard", nullptr, ret, MID_COPY_TYPED_NAME);
1074 new FXMenuSeparator(ret);
1075 // build selection and show parameters menu
1078 GUIDesigns::buildFXMenuCommand(ret, ("Cursor position in view: " + toString(getPlanPositionInView().x()) + "," + toString(getPlanPositionInView().y())).c_str(), nullptr, nullptr, 0);
1079 return ret;
1080}
1081
1082
1083GNELane*
1085 // get tag property
1086 const auto& tagProperty = myPlanElement->getTagProperty();
1087 // get vclass
1088 auto vClass = myPlanElement->getVClass();
1089 // continue depending of parents
1090 if (tagProperty.planRoute()) {
1091 // route
1092 return myPlanElement->getParentDemandElements().at(1)->getParentEdges().front()->getLaneByAllowedVClass(vClass);
1093 } else if (tagProperty.planConsecutiveEdges() || tagProperty.planFromEdge() || tagProperty.planEdge()) {
1094 // edges
1095 return myPlanElement->getParentEdges().front()->getLaneByAllowedVClass(vClass);
1096 } else if (tagProperty.planStoppingPlace() || tagProperty.planFromStoppingPlace() || tagProperty.planToStoppingPlace()) {
1097 // additional
1098 return myPlanElement->getParentStoppingPlaces().front()->getParentLanes().front();
1099 } else {
1100 // in other cases (TAZ, junctions, etc.) return null
1101 return nullptr;
1102 }
1103}
1104
1105
1106GNELane*
1108 // get tag property
1109 const auto& tagProperty = myPlanElement->getTagProperty();
1110 // get vclass
1111 auto vClass = myPlanElement->getVClass();
1112 // check parents
1113 if (tagProperty.planRoute()) {
1114 // route
1115 return myPlanElement->getParentDemandElements().at(1)->getParentEdges().back()->getLaneByAllowedVClass(vClass);
1116 } else if (tagProperty.planConsecutiveEdges() || tagProperty.planToEdge() || tagProperty.planEdge()) {
1117 // edges
1118 return myPlanElement->getParentEdges().back()->getLaneByAllowedVClass(vClass);
1119 } else if (tagProperty.planStoppingPlace() || tagProperty.planFromStoppingPlace() || tagProperty.planToStoppingPlace()) {
1120 // additional
1121 return myPlanElement->getParentStoppingPlaces().back()->getParentLanes().front()->getParentEdge()->getLaneByAllowedVClass(vClass);
1122 } else {
1123 // in other cases (TAZ, junctions, etc.) return null
1124 return nullptr;
1125 }
1126}
1127
1128
1129void
1131 // get tag property
1132 const auto& tagProperty = myPlanElement->getTagProperty();
1133 // get vClass
1134 auto vClass = myPlanElement->getVClass();
1135 // get path manager
1136 auto pathManager = myPlanElement->getNet()->getDemandPathManager();
1137 // continue depending of parents
1138 if (tagProperty.planRoute()) {
1139 // calculate consecutive path using route edges
1140 pathManager->calculateConsecutivePathEdges(myPlanElement, vClass, myPlanElement->getParentDemandElements().at(1)->getParentEdges());
1141 } else if (tagProperty.planConsecutiveEdges()) {
1142 // calculate consecutive path using edges
1143 pathManager->calculateConsecutivePathEdges(myPlanElement, vClass, myPlanElement->getParentEdges());
1145 // calculate path using junctions
1146 pathManager->calculatePath(myPlanElement, vClass, myPlanElement->getParentJunctions().front(), myPlanElement->getParentJunctions().back());
1148 // declare last lane
1149 GNELane* lastLane = nullptr;
1151 lastLane = myPlanElement->getParentStoppingPlaces().back()->getParentLanes().back();
1153 lastLane = myPlanElement->getParentStoppingPlaces().back()->getParentLanes().front();
1154 } else if (myPlanElement->myTagProperty.planToEdge()) {
1155 lastLane = myPlanElement->getParentEdges().back()->getLaneByAllowedVClass(vClass);
1156 }
1157 // calculate path
1158 if (lastLane) {
1159 pathManager->calculatePath(myPlanElement, vClass, myPlanElement->getParentJunctions().front(), lastLane);
1160 }
1162 // declare first lane
1163 GNELane* firstLane = nullptr;
1165 firstLane = myPlanElement->getParentStoppingPlaces().front()->getParentLanes().back();
1167 firstLane = myPlanElement->getParentStoppingPlaces().front()->getParentLanes().front();
1169 firstLane = myPlanElement->getParentEdges().front()->getLaneByAllowedVClass(vClass);
1170 }
1171 // calculate path
1172 if (firstLane) {
1173 pathManager->calculatePath(myPlanElement, vClass, firstLane, myPlanElement->getParentJunctions().back());
1174 }
1175 } else {
1176 // declare first edge
1177 GNELane* firstLane = nullptr;
1179 firstLane = myPlanElement->getParentEdges().front()->getLaneByAllowedVClass(vClass);
1181 firstLane = myPlanElement->getParentStoppingPlaces().front()->getParentLanes().back();
1183 firstLane = myPlanElement->getParentStoppingPlaces().front()->getParentLanes().front();
1184 }
1185 // declare last lane
1186 GNELane* lastLane = nullptr;
1188 lastLane = myPlanElement->getParentEdges().back()->getLaneByAllowedVClass(vClass);
1190 lastLane = myPlanElement->getParentStoppingPlaces().back()->getParentLanes().back();
1192 lastLane = myPlanElement->getParentStoppingPlaces().back()->getParentLanes().front();
1193 }
1194 if (firstLane && lastLane) {
1195 pathManager->calculatePath(myPlanElement, vClass, firstLane, lastLane);
1196 } else if (firstLane) {
1197 pathManager->calculateConsecutivePathLanes(myPlanElement, {firstLane});
1198 } else if (lastLane) {
1199 pathManager->calculateConsecutivePathLanes(myPlanElement, {lastLane});
1200 }
1201 }
1202 // update geometry
1204}
1205
1206
1207void
1209 // get tag property
1210 const auto& tagProperty = myPlanElement->getTagProperty();
1211 // check if plan start or end in a TAZ (becase in this case has to be inserted in RTREE
1212 if (tagProperty.planFromTAZ() || tagProperty.planToTAZ()) {
1213 // declare first and last positions
1214 Position firstPos = Position::INVALID;
1215 Position lastPos = Position::INVALID;
1216 // set first position
1217 if (tagProperty.planFromEdge()) {
1218 // from junction
1219 firstPos = myPlanElement->getFirstPathLane()->getLaneShape().back();
1220 } else if (tagProperty.planFromJunction()) {
1221 // from junction
1222 firstPos = myPlanElement->getParentJunctions().front()->getPositionInView();
1223 } else if (tagProperty.planFromStoppingPlace()) {
1224 // end of stoppingPlace lane shape
1225 firstPos = myPlanElement->getParentStoppingPlaces().front()->getParentLanes().front()->getLaneShape().back();
1226 } else if (tagProperty.planFromTAZ()) {
1227 // from TAZ
1228 if (myPlanElement->getParentTAZs().front()->getAttribute(SUMO_ATTR_CENTER).empty()) {
1229 firstPos = myPlanElement->getParentTAZs().front()->getAttributePosition(GNE_ATTR_TAZ_CENTROID);
1230 } else {
1231 firstPos = myPlanElement->getParentTAZs().front()->getAttributePosition(SUMO_ATTR_CENTER);
1232 }
1233 }
1234 // set last position
1235 if (tagProperty.planToEdge()) {
1236 // from junction
1237 lastPos = myPlanElement->getLastPathLane()->getLaneShape().back();
1238 } else if (tagProperty.planToJunction()) {
1239 // from junction
1240 lastPos = myPlanElement->getParentJunctions().back()->getPositionInView();
1241 } else if (tagProperty.planToStoppingPlace()) {
1242 // end of stoppingPlace lane shape
1243 lastPos = myPlanElement->getParentStoppingPlaces().back()->getParentLanes().front()->getLaneShape().front();
1244 } else if (tagProperty.planToTAZ()) {
1245 // from TAZ
1246 if (myPlanElement->getParentTAZs().back()->getAttribute(SUMO_ATTR_CENTER).empty()) {
1247 lastPos = myPlanElement->getParentTAZs().back()->getAttributePosition(GNE_ATTR_TAZ_CENTROID);
1248 } else {
1249 lastPos = myPlanElement->getParentTAZs().back()->getAttributePosition(SUMO_ATTR_CENTER);
1250 }
1251 }
1252 // use both position to calculate a line
1253 if ((firstPos != Position::INVALID) && (lastPos != Position::INVALID)) {
1255 } else {
1257 }
1258 }
1259 // update centering boundary
1261 // update child demand elements
1262 for (const auto& demandElement : myPlanElement->getChildDemandElements()) {
1263 demandElement->updateGeometry();
1264 }
1265}
1266
1267
1272
1273
1274void
1276 // remove additional from grid
1277 if (myPlanBoundary.isInitialised() && updateGrid) {
1279 }
1281 // if this element is over route, add their boundary
1282 if (myPlanElement->getParentDemandElements().size() > 1) {
1283 myPlanBoundary.add(myPlanElement->getParentDemandElements().at(1)->getCenteringBoundary());
1284 }
1285 // add the combination of all parent edges's boundaries
1286 for (const auto& edge : myPlanElement->getParentEdges()) {
1287 myPlanBoundary.add(edge->getCenteringBoundary());
1288 }
1289 // add the combination of all parent edges's boundaries
1290 for (const auto& junction : myPlanElement->getParentJunctions()) {
1291 myPlanBoundary.add(junction->getCenteringBoundary());
1292 }
1293 // add the combination of all parent additional's boundaries (stoppingPlaces and TAZs)
1294 for (const auto& additional : myPlanElement->getParentAdditionals()) {
1295 if (additional->getTagProperty().getTag() == SUMO_TAG_TAZ) {
1296 if (additional->getAttribute(SUMO_ATTR_CENTER).empty()) {
1297 myPlanBoundary.add(additional->getAttributePosition(GNE_ATTR_TAZ_CENTROID));
1298 } else {
1299 myPlanBoundary.add(additional->getAttributePosition(SUMO_ATTR_CENTER));
1300 }
1301 } else {
1302 myPlanBoundary.add(additional->getCenteringBoundary());
1303 }
1304 }
1305 // check if is valid
1308 }
1309 // add additional into RTREE again
1310 if (myPlanBoundary.isInitialised() && updateGrid) {
1312 }
1313}
1314
1315
1318 // get tag property
1319 const auto& tagProperty = myPlanElement->getTagProperty();
1320 // continue depending of parents
1321 if (tagProperty.planRoute()) {
1322 // route
1323 return myPlanElement->getParentDemandElements().at(1)->getPositionInView();
1324 } else if (tagProperty.isPlanStop()) {
1326 } else if (tagProperty.planFromEdge() || tagProperty.planConsecutiveEdges() || tagProperty.planEdge()) {
1327 // first edge
1328 return myPlanElement->getParentEdges().front()->getPositionInView();
1329 } else if (tagProperty.planFromJunction()) {
1330 // first junction
1331 return myPlanElement->getParentJunctions().front()->getPositionInView();
1332 } else if (tagProperty.planStoppingPlace() || tagProperty.planFromStoppingPlace()) {
1333 // first additional
1334 return myPlanElement->getParentStoppingPlaces().front()->getPositionInView();
1335 } else if (tagProperty.planFromTAZ()) {
1336 if (myPlanElement->getParentTAZs().front()->getAttribute(SUMO_ATTR_CENTER).empty()) {
1337 return myPlanElement->getParentTAZs().front()->getAttributePosition(GNE_ATTR_TAZ_CENTROID);
1338 } else {
1339 return myPlanElement->getParentTAZs().front()->getAttributePosition(SUMO_ATTR_CENTER);
1340 }
1341 } else {
1342 // return parent position
1343 return Position(0, 0);
1344 }
1345}
1346
1347
1348std::string
1350 // continue depending of key
1351 switch (key) {
1352 // Common plan attributes
1353 case SUMO_ATTR_ID:
1354 case GNE_ATTR_PARENT:
1355 return myPlanElement->getParentDemandElements().at(0)->getID();
1356 case GNE_ATTR_SELECTED:
1359 if (myDepartPosition < 0) {
1360 return "";
1361 } else {
1362 return toString(myDepartPosition);
1363 }
1364 case SUMO_ATTR_ENDPOS:
1366 if (myArrivalPosition < 0) {
1367 return "";
1368 } else {
1370 }
1371 // route
1372 case SUMO_ATTR_ROUTE:
1373 return myPlanElement->getParentDemandElements().at(1)->getID();
1374 // edges
1375 case SUMO_ATTR_EDGE:
1376 case SUMO_ATTR_EDGES:
1378 // stoppingPlaces (single and back)
1379 case SUMO_ATTR_BUS_STOP:
1384 return myPlanElement->getParentStoppingPlaces().back()->getID();
1385 // from elements
1386 case SUMO_ATTR_FROM:
1387 return myPlanElement->getParentEdges().front()->getID();
1389 return myPlanElement->getParentJunctions().front()->getID();
1390 case SUMO_ATTR_FROM_TAZ:
1391 return myPlanElement->getParentTAZs().front()->getID();
1397 return myPlanElement->getParentStoppingPlaces().front()->getID();
1398 // to elements
1399 case SUMO_ATTR_TO:
1400 return myPlanElement->getParentEdges().back()->getID();
1402 return myPlanElement->getParentJunctions().back()->getID();
1403 case SUMO_ATTR_TO_TAZ:
1404 return myPlanElement->getParentTAZs().back()->getID();
1405 default:
1406 throw InvalidArgument(myPlanElement->getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'");
1407 }
1408}
1409
1410
1411double
1413 // get tag property
1414 const auto& tagProperty = myPlanElement->getTagProperty();
1415 // declare plan parent
1416 const auto planParent = myPlanElement->getParentDemandElements().at(0);
1417 // continue depending of key
1418 switch (key) {
1420 if (tagProperty.planStoppingPlace()) {
1421 // use startpos of stoppingPlace parent (stops)
1422 return myPlanElement->getParentStoppingPlaces().front()->getAttributeDouble(SUMO_ATTR_STARTPOS);
1423 } else if (tagProperty.planFromStoppingPlace()) {
1424 // use end position of stoppingPlace parent (for plans that starts in stoppingPlaces)
1425 return myPlanElement->getParentStoppingPlaces().front()->getAttributeDouble(SUMO_ATTR_ENDPOS);
1426 } else if (tagProperty.planFromTAZ()) {
1427 return 0;
1428 } else if (tagProperty.planFromJunction()) {
1429 return -1;
1430 } else {
1431 // get previous plan element
1432 const auto previousPlan = planParent->getPreviousChildDemandElement(myPlanElement);
1433 // continue depending of previous plan
1434 if (previousPlan) {
1435 // use previous plan end position (normally the arrival position)
1436 const auto posOverLane = previousPlan->getAttributeDouble(GNE_ATTR_PLAN_GEOMETRY_ENDPOS);
1437 // if posOverLane is -1, means that previousPlan ends in the end of lane.
1438 if (posOverLane == -1) {
1439 // INVALID_DOUBLE will put the startPositio at the end of line
1440 return INVALID_DOUBLE;
1441 } else {
1442 return previousPlan->getAttributeDouble(GNE_ATTR_PLAN_GEOMETRY_ENDPOS);
1443 }
1444 } else {
1445 // use depart position defined in parent (person or container)
1446 return planParent->getAttributeDouble(SUMO_ATTR_DEPARTPOS);
1447 }
1448 }
1449 }
1451 // continue depending of parents
1452 if (tagProperty.planStoppingPlace()) {
1453 // use end position of the stoppingPlace (stops)
1454 return myPlanElement->getParentStoppingPlaces().back()->getAttributeDouble(SUMO_ATTR_ENDPOS);
1455 } else if (tagProperty.planToStoppingPlace()) {
1456 // use start position of the stoppingPlace (for elements that ends in stoppingPlaces)
1457 return myPlanElement->getParentStoppingPlaces().back()->getAttributeDouble(SUMO_ATTR_STARTPOS);
1458 } else if (tagProperty.planToJunction() || tagProperty.planToTAZ()) {
1459 // junctions and TAZs return always -1
1460 return -1;
1461 } else if ((tagProperty.isPlanStopPerson() || tagProperty.isPlanStopContainer()) && tagProperty.planEdge()) {
1462 // elements that ends in stop always uses the end (arrival) position of the stops over edges
1463 return myArrivalPosition;
1464 } else {
1465 // check if next plan is a stop over edge
1466 const auto nextPlan = planParent->getNextChildDemandElement(myPlanElement);
1467 if (nextPlan && (nextPlan->getTagProperty().isPlanStopPerson() ||
1468 nextPlan->getTagProperty().isPlanStopContainer()) &&
1469 nextPlan->getTagProperty().planEdge()) {
1470 // if next plan is an stop over stoppingPlaces, use ends of stoppingPlace
1471 return nextPlan->getAttributeDouble(GNE_ATTR_PLAN_GEOMETRY_ENDPOS);
1472 } else {
1473 // use arrival position
1474 return myArrivalPosition;
1475 }
1476 }
1478 return myDepartPosition;
1479 case SUMO_ATTR_ENDPOS:
1481 return myArrivalPosition;
1482 default:
1483 throw InvalidArgument(myPlanElement->getTagStr() + " doesn't have a doubleattribute of type '" + toString(key) + "'");
1484 }
1485}
1486
1487
1490 // get tag property
1491 const auto& tagProperty = myPlanElement->getTagProperty();
1492 // declare plan parent
1493 const auto planParent = myPlanElement->getParentDemandElements().at(0);
1494 // continue depending of key
1495 switch (key) {
1497 // get previous plan
1498 const auto previousPlan = planParent->getPreviousChildDemandElement(myPlanElement);
1499 if (previousPlan && previousPlan->getTagProperty().isPlanStop() && previousPlan->getTagProperty().planStoppingPlace()) {
1500 return previousPlan->getParentStoppingPlaces().front()->getAdditionalGeometry().getShape().back();
1501 }
1502 // continue depending of from element
1503 if (tagProperty.planStoppingPlace()) {
1504 return myPlanElement->getParentStoppingPlaces().front()->getAdditionalGeometry().getShape().front();
1505 } else if (tagProperty.planFromStoppingPlace()) {
1506 return myPlanElement->getParentStoppingPlaces().front()->getAdditionalGeometry().getShape().back();
1507 } else if (tagProperty.planFromJunction()) {
1508 // junction view position
1509 return myPlanElement->getParentJunctions().front()->getPositionInView();
1510 } else if (tagProperty.planFromTAZ()) {
1511 if (myPlanElement->getParentTAZs().front()->getAttribute(SUMO_ATTR_CENTER).empty()) {
1512 return myPlanElement->getParentTAZs().front()->getAttributePosition(GNE_ATTR_TAZ_CENTROID);
1513 } else {
1514 return myPlanElement->getParentTAZs().front()->getAttributePosition(SUMO_ATTR_CENTER);
1515 }
1516 } else if (tagProperty.planConsecutiveEdges() || tagProperty.planRoute() || tagProperty.planFromEdge()) {
1517 // get first path lane
1518 const auto firstLane = myPlanElement->getFirstPathLane();
1519 // check if first lane exists
1520 if (firstLane == nullptr) {
1521 return Position::INVALID;
1522 }
1523 // declare lane position
1524 double lanePosition = 0;
1525 // continue depending of conditions
1526 if (previousPlan) {
1527 // use previous geometry end position
1528 lanePosition = previousPlan->getAttributeDouble(GNE_ATTR_PLAN_GEOMETRY_ENDPOS);
1529 } else {
1530 // use departPos defined in planParent
1531 lanePosition = planParent->getAttributeDouble(SUMO_ATTR_DEPARTPOS);
1532 }
1533 // get lane shape
1534 const auto& laneShape = firstLane->getLaneShape();
1535 // continue depending of lane position
1536 if (lanePosition <= 0) {
1537 return laneShape.front();
1538 } else if (lanePosition >= laneShape.length2D()) {
1539 return laneShape.back();
1540 } else {
1541 return laneShape.positionAtOffset2D(lanePosition);
1542 }
1543 } else {
1544 return Position::INVALID;
1545 }
1546 }
1548 // check parents
1549 if (tagProperty.planToJunction()) {
1550 // junctions
1551 return myPlanElement->getParentJunctions().back()->getPositionInView();
1552 } else if (tagProperty.planStoppingPlace()) {
1553 // get additional back shape (stops)
1554 return myPlanElement->getParentStoppingPlaces().back()->getAdditionalGeometry().getShape().back();
1555 } else if (tagProperty.planToStoppingPlace()) {
1556 // get additional front shape
1557 return myPlanElement->getParentStoppingPlaces().back()->getAdditionalGeometry().getShape().front();
1558 } else if (tagProperty.planToTAZ()) {
1559 // taz
1560 if (myPlanElement->getParentTAZs().back()->getAttribute(SUMO_ATTR_CENTER).empty()) {
1561 return myPlanElement->getParentTAZs().back()->getAttributePosition(GNE_ATTR_TAZ_CENTROID);
1562 } else {
1563 return myPlanElement->getParentTAZs().back()->getAttributePosition(SUMO_ATTR_CENTER);
1564 }
1565 } else if (tagProperty.planConsecutiveEdges() || tagProperty.planRoute() || tagProperty.planFromEdge()) {
1566 // get next plan
1567 const auto nextPlan = planParent->getNextChildDemandElement(myPlanElement);
1568 // if next plan exist, then use their first lane (needed to maintain connectivity with rides)
1569 const auto lastLane = nextPlan ? nextPlan->getFirstPathLane() : myPlanElement->getLastPathLane();
1570 // check if last lane exists
1571 if (lastLane == nullptr) {
1572 return Position::INVALID;
1573 }
1574 // get lane shape
1575 const auto& laneShape = lastLane->getLaneShape();
1576 // continue depending of arrival position
1577 if (nextPlan && nextPlan->getTagProperty().isPlanStop()) {
1578 return nextPlan->getAttributePosition(GNE_ATTR_PLAN_GEOMETRY_ENDPOS);
1579 } else if (myArrivalPosition == 0) {
1580 return laneShape.front();
1581 } else if ((myArrivalPosition == -1) || (myArrivalPosition >= laneShape.length2D())) {
1582 return laneShape.back();
1583 } else {
1584 return laneShape.positionAtOffset2D(myArrivalPosition);
1585 }
1586 } else {
1587 return Position::INVALID;
1588 }
1589 }
1590 default:
1591 throw InvalidArgument(myPlanElement->getTagStr() + " doesn't have a position attribute of type '" + toString(key) + "'");
1592 }
1593}
1594
1595
1596void
1597GNEDemandElementPlan::setPlanAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList) {
1598 // continue depending of key
1599 switch (key) {
1600 // common attributes
1603 case SUMO_ATTR_ENDPOS:
1604 case GNE_ATTR_PARENT:
1605 case GNE_ATTR_SELECTED:
1607 break;
1608 default:
1609 throw InvalidArgument(myPlanElement->getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'");
1610 }
1611}
1612
1613
1614bool
1615GNEDemandElementPlan::isPlanValid(SumoXMLAttr key, const std::string& value) {
1616 // continue depending of key
1617 switch (key) {
1618 // common attributes
1619 case GNE_ATTR_PARENT:
1620 return false;
1623 if (value.empty()) {
1624 return true;
1625 } else if (GNEAttributeCarrier::canParse<double>(value)) {
1626 return GNEAttributeCarrier::parse<double>(value) >= 0;
1627 } else {
1628 return false;
1629 }
1630 case SUMO_ATTR_ENDPOS:
1631 return GNEAttributeCarrier::canParse<double>(value);
1632 case GNE_ATTR_SELECTED:
1633 return GNEAttributeCarrier::canParse<bool>(value);
1634 default:
1635 throw InvalidArgument(myPlanElement->getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'");
1636 }
1637}
1638
1639
1640bool
1642 switch (key) {
1643 // edges
1644 case SUMO_ATTR_EDGES:
1645 // edge
1646 case SUMO_ATTR_EDGE:
1647 // route
1648 case SUMO_ATTR_ROUTE:
1649 // from
1650 case SUMO_ATTR_FROM:
1652 case SUMO_ATTR_FROM_TAZ:
1658 // to
1659 case SUMO_ATTR_TO:
1661 case SUMO_ATTR_TO_TAZ:
1662 case SUMO_ATTR_BUS_STOP:
1667 // depart pos (temporal, probably will be removed)
1669 return false;
1670 default:
1671 return true;
1672 }
1673}
1674
1675
1676void
1678 switch (key) {
1679 // from-to attributes (needed if we're replacing junction by geometry points and similar operations)
1680 case SUMO_ATTR_FROM:
1682 break;
1683 case SUMO_ATTR_TO:
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 break;
1697 case SUMO_ATTR_ENDPOS:
1699 if (value.empty()) {
1700 myArrivalPosition = -1;
1701 } else {
1702 myArrivalPosition = GNEAttributeCarrier::parse<double>(value);
1703 }
1704 break;
1705 case GNE_ATTR_SELECTED:
1706 if (GNEAttributeCarrier::parse<bool>(value)) {
1708 } else {
1710 }
1711 // check if compute geometry and path
1712 if (!myPlanElement->isTemplate()) {
1715 }
1716 break;
1717 default:
1718 throw InvalidArgument(myPlanElement->getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'");
1719 }
1720}
1721
1722
1723std::string
1725 // get tag property
1726 const auto& tagProperty = myPlanElement->getTagProperty();
1727 // declare result
1728 std::string result;
1729 // clear result
1730 int index = 0;
1731 while (tagProperty.getTagStr().at(index) != ':') {
1732 result.push_back(tagProperty.getTagStr().at(index));
1733 index++;
1734 }
1735 result += ": ";
1736 // continue depending of attributes
1737 if (tagProperty.planConsecutiveEdges()) {
1738 // edges
1739 return result + myPlanElement->getParentEdges().front()->getID() + " ... " + myPlanElement->getParentEdges().back()->getID();
1740 } else if (tagProperty.planRoute()) {
1741 // route
1742 return result + myPlanElement->getParentDemandElements().at(1)->getID();
1743 } else if (tagProperty.planEdge()) {
1744 // edge
1745 return result + myPlanElement->getParentEdges().front()->getID();
1746 } else if (tagProperty.planStoppingPlace()) {
1747 // stoppingPlace
1748 return myPlanElement->getParentStoppingPlaces().front()->getID();
1749 } else {
1750 // stoppingPlace
1751 if (tagProperty.planFromStoppingPlace()) {
1752 result += myPlanElement->getParentStoppingPlaces().front()->getID();
1753 }
1754 // TAZ
1755 if (tagProperty.planFromTAZ()) {
1756 result += myPlanElement->getParentTAZs().front()->getID();
1757 }
1758 // junction
1759 if (tagProperty.planFromJunction()) {
1760 result += myPlanElement->getParentJunctions().front()->getID();
1761 }
1762 // edge
1763 if (tagProperty.planFromEdge()) {
1764 result += myPlanElement->getParentEdges().front()->getID();
1765 }
1766 // arrow
1767 result += " -> ";
1768 // stoppingPlace
1769 if (tagProperty.planToStoppingPlace()) {
1770 result += myPlanElement->getParentStoppingPlaces().back()->getID();
1771 }
1772 // TAZ
1773 if (tagProperty.planToTAZ()) {
1774 result += myPlanElement->getParentTAZs().back()->getID();
1775 }
1776 // junction
1777 if (tagProperty.planToJunction()) {
1778 result += myPlanElement->getParentJunctions().back()->getID();
1779 }
1780 // edge
1781 if (tagProperty.planToEdge()) {
1782 result += myPlanElement->getParentEdges().back()->getID();
1783 }
1784 return result;
1785 }
1786}
1787
1788
1789bool
1791 // get view net
1792 auto viewNet = myPlanElement->getNet()->getViewNet();
1793 // check conditions
1794 if (viewNet->getEditModes().isCurrentSupermodeNetwork() &&
1795 viewNet->getNetworkViewOptions().showDemandElements() &&
1796 viewNet->getDemandViewOptions().showAllPersonPlans()) {
1797 // show all person plans in network mode
1798 return true;
1799 } else if (viewNet->getEditModes().isCurrentSupermodeDemand() &&
1800 viewNet->getDemandViewOptions().showAllPersonPlans()) {
1801 // show all person plans
1802 return true;
1803 } else if (viewNet->getEditModes().isCurrentSupermodeDemand() && myPlanElement->isAttributeCarrierSelected()) {
1804 // show selected
1805 return true;
1806 } else if (viewNet->isAttributeCarrierInspected(myPlanElement->getParentDemandElements().front())) {
1807 // person parent is inspected
1808 return true;
1809 } else if (viewNet->getDemandViewOptions().getLockedPerson() == myPlanElement->getParentDemandElements().front()) {
1810 // person parent is locked
1811 return true;
1812 } else if (viewNet->getInspectedAttributeCarriers().empty()) {
1813 // nothing is inspected
1814 return false;
1815 } else {
1816 // get inspected AC
1817 const GNEAttributeCarrier* AC = viewNet->getInspectedAttributeCarriers().front();
1818 // check condition
1820 // common person parent
1821 return true;
1822 } else {
1823 // all conditions are false
1824 return false;
1825 }
1826 }
1827}
1828
1829
1830bool
1832 // get view net
1833 auto viewNet = myPlanElement->getNet()->getViewNet();
1834 // check conditions
1835 if (viewNet->getEditModes().isCurrentSupermodeNetwork() &&
1836 viewNet->getNetworkViewOptions().showDemandElements() &&
1837 viewNet->getDemandViewOptions().showAllContainerPlans()) {
1838 // show all container plans in network mode
1839 return true;
1840 } else if (viewNet->getEditModes().isCurrentSupermodeDemand() &&
1841 viewNet->getDemandViewOptions().showAllContainerPlans()) {
1842 // show all container plans
1843 return true;
1844 } else if (viewNet->getEditModes().isCurrentSupermodeDemand() && myPlanElement->isAttributeCarrierSelected()) {
1845 // show selected
1846 return true;
1847 } else if (viewNet->isAttributeCarrierInspected(myPlanElement->getParentDemandElements().front())) {
1848 // container parent is inspected
1849 return true;
1850 } else if (viewNet->getDemandViewOptions().getLockedContainer() == myPlanElement->getParentDemandElements().front()) {
1851 // container parent is locked
1852 return true;
1853 } else if (viewNet->getInspectedAttributeCarriers().empty()) {
1854 // nothing is inspected
1855 return false;
1856 } else {
1857 // get inspected AC
1858 const GNEAttributeCarrier* AC = viewNet->getInspectedAttributeCarriers().front();
1859 // check condition
1861 // common container parent
1862 return true;
1863 } else {
1864 // all conditions are false
1865 return false;
1866 }
1867 }
1868}
1869
1870
1871void
1872GNEDemandElementPlan::drawPlanGL(const bool drawPlan, const GUIVisualizationSettings& s, const RGBColor& planColor, const RGBColor& planSelectedColor) const {
1873 // get plan parent
1874 const GNEDemandElement* planParent = myPlanElement->getParentDemandElements().front();
1875 // get tag property
1876 const auto& tagProperty = myPlanElement->getTagProperty();
1877 // get plan geometry
1878 auto& planGeometry = myPlanElement->myDemandElementGeometry;
1879 // draw relations between TAZs
1880 if (drawPlan && (planGeometry.getShape().size() > 0)) {
1881 // draw boundary
1882 if (s.drawBoundaries) {
1884 }
1885 // get detail level
1886 const auto d = s.getDetailLevel(1);
1887 // get viewNet
1888 auto viewNet = myPlanElement->getNet()->getViewNet();
1889 // get inspected attribute carriers
1890 const auto& inspectedACs = viewNet->getInspectedAttributeCarriers();
1891 // get inspected plan
1892 const GNEAttributeCarrier* planInspected = (inspectedACs.size() > 0) ? inspectedACs.front() : nullptr;
1893 // check if draw with double width
1894 const bool drawHalfWidth = ((planInspected != myPlanElement) && (planInspected != planParent) && !gViewObjectsHandler.isObjectSelected(myPlanElement));
1895 // calculate path width
1896 double pathWidth = s.widthSettings.walkWidth;
1897 if (tagProperty.isPlanRide()) {
1898 pathWidth = s.widthSettings.rideWidth;
1899 } else if (tagProperty.isPlanPersonTrip()) {
1900 pathWidth = s.widthSettings.personTripWidth;
1901 }
1902 // draw geometry only if we'rent in drawForObjectUnderCursor mode
1903 if ((tagProperty.isPlanPerson() && s.checkDrawPerson(d, myPlanElement->isAttributeCarrierSelected())) ||
1904 (tagProperty.isPlanContainer() && s.checkDrawContainer(d, myPlanElement->isAttributeCarrierSelected()))) {
1905 // push matrix
1907 // translate to front
1908 viewNet->drawTranslateFrontAttributeCarrier(myPlanElement, GLO_TAZ + 1);
1909 // set color
1910 GLHelper::setColor(myPlanElement->drawUsingSelectColor() ? planSelectedColor : planColor);
1911 // draw line
1912 GUIGeometry::drawGeometry(d, planGeometry, pathWidth * (drawHalfWidth ? 1 : 2));
1913 if (drawHalfWidth) {
1914 GLHelper::drawTriangleAtEnd(planGeometry.getShape().front(), planGeometry.getShape().back(), 0.5, 0.5, 0.5);
1915 } else {
1916 GLHelper::drawTriangleAtEnd(planGeometry.getShape().front(), planGeometry.getShape().back(), 1, 1, 1);
1917 }
1918 // pop matrix
1920 // draw dotted contour
1922 }
1923 // calculate contour and draw dotted geometry
1924 myPlanContour.calculateContourExtrudedShape(s, d, myPlanElement, planGeometry.getShape(), myPlanElement->getType(), pathWidth * 2, 1, true, true, 0);
1925 // calculate contour for end
1926 myPlanContourEnd.calculateContourCircleShape(s, d, myPlanElement, planGeometry.getShape().back(), 1, myPlanElement->getType(), 1);
1927 }
1928 // check if draw plan parent
1929 if (planParent->getPreviousChildDemandElement(myPlanElement) == nullptr) {
1930 planParent->drawGL(s);
1931 }
1932}
1933
1934
1935void
1937 const double offsetFront, const double planWidth, const RGBColor& planColor, const RGBColor& planSelectedColor) const {
1938 // get view net
1939 auto viewNet = myPlanElement->getNet()->getViewNet();
1940 // get tag property
1941 const auto& tagProperty = myPlanElement->getTagProperty();
1942 // get plan parent
1943 const GNEDemandElement* planParent = myPlanElement->getParentDemandElements().front();
1944 // check if draw plan element can be drawn
1945 if (drawPlan && segment->getLane() && myPlanElement->getNet()->getDemandPathManager()->getPathDraw()->checkDrawPathGeometry(s, segment->getLane(), tagProperty.getTag())) {
1946 // draw boundary
1947 if (tagProperty.isPlacedInRTree() && s.drawBoundaries) {
1949 }
1950 // get detail level
1951 const auto d = s.getDetailLevel(1);
1952 // get inspected attribute carriers
1953 const auto& inspectedACs = viewNet->getInspectedAttributeCarriers();
1954 // get inspected plan
1955 const GNEAttributeCarrier* planInspected = (inspectedACs.size() > 0) ? inspectedACs.front() : nullptr;
1956 // declare path geometry
1957 GUIGeometry planGeometry;
1958 // update pathGeometry depending of first and last segment
1959 if (segment->isFirstSegment() && segment->isLastSegment()) {
1960 if (tagProperty.planFromTAZ()) {
1961 planGeometry.updateGeometry(segment->getLane()->getLaneGeometry().getShape(),
1966 } else if (tagProperty.planToTAZ()) {
1967 planGeometry.updateGeometry(segment->getLane()->getLaneGeometry().getShape(),
1972 } else {
1973 planGeometry.updateGeometry(segment->getLane()->getLaneGeometry().getShape(),
1978 }
1979 } else if (segment->isFirstSegment()) {
1980 planGeometry.updateGeometry(segment->getLane()->getLaneGeometry().getShape(),
1983 -1,
1985 } else if (segment->isLastSegment()) {
1986 planGeometry.updateGeometry(segment->getLane()->getLaneGeometry().getShape(),
1987 -1,
1991 } else {
1992 planGeometry = segment->getLane()->getLaneGeometry();
1993 }
1994 // calculate path width double
1995 const double drawingWidth = s.addSize.getExaggeration(s, segment->getLane()) * planWidth * 2;
1996 // check if draw with double width
1997 const bool drawHalfWidth = ((planInspected != myPlanElement) && (planInspected != planParent) && !gViewObjectsHandler.isObjectSelected(myPlanElement));
1998 // get end pos radius
1999 const double endPosRadius = getEndPosRadius(s, segment, drawHalfWidth);
2000 // draw geometry only if we'rent in drawForObjectUnderCursor mode
2001 if ((tagProperty.isPlanPerson() && s.checkDrawPerson(d, myPlanElement->isAttributeCarrierSelected())) ||
2002 (tagProperty.isPlanContainer() && s.checkDrawContainer(d, myPlanElement->isAttributeCarrierSelected()))) {
2003 // Add a draw matrix
2005 // Start with the drawing of the area traslating matrix to origin
2006 viewNet->drawTranslateFrontAttributeCarrier(myPlanElement, myPlanElement->getType(), offsetFront);
2007 // Set color
2008 GLHelper::setColor(myPlanElement->drawUsingSelectColor() ? planSelectedColor : planColor);
2009 // draw geometry depending of drawWithDoubleWidth
2010 GUIGeometry::drawGeometry(d, planGeometry, drawingWidth * (drawHalfWidth ? 0.5 : 1));
2011 // draw red arrows
2012 drawFromArrow(s, segment->getLane(), segment);
2013 drawToArrow(s, segment->getLane(), segment);
2014 // Pop last matrix
2016 // Draw name if isn't being drawn for selecting
2018 // draw dotted contour
2020 // draw TAZ Center dotted contour
2022 }
2023 // declare trim geometry to draw
2024 const auto& shape = (segment->isFirstSegment() || segment->isLastSegment()) ? planGeometry.getShape() : segment->getLane()->getLaneShape();
2025 // calculate contour and draw dotted geometry (always with double width)
2026 if (segment->isFirstSegment()) {
2027 segment->getContour()->calculateContourExtrudedShape(s, d, myPlanElement, shape, myPlanElement->getType(), drawingWidth, 1, true, false, 0);
2028 } else if (segment->isLastSegment()) {
2029 segment->getContour()->calculateContourExtrudedShape(s, d, myPlanElement, shape, myPlanElement->getType(), drawingWidth, 1, false, false, 0);
2030 // calculate contour for end
2032 } else {
2033 segment->getContour()->calculateContourExtrudedShape(s, d, myPlanElement, shape, myPlanElement->getType(), drawingWidth, 1, false, false, 0);
2034 }
2035 }
2036 // check if draw plan parent
2037 if (planParent->getPreviousChildDemandElement(myPlanElement) == nullptr) {
2038 planParent->drawGL(s);
2039 }
2040}
2041
2042
2043void
2045 const double offsetFront, const double planWidth, const RGBColor& planColor, const RGBColor& planSelectedColor) const {
2046 // get view net
2047 auto viewNet = myPlanElement->getNet()->getViewNet();
2048 // get tag property
2049 const auto& tagProperty = myPlanElement->getTagProperty();
2050 // get plan parent
2051 const GNEDemandElement* planParent = myPlanElement->getParentDemandElements().front();
2052 // check if draw plan elements can be drawn
2053 if (drawPlan && myPlanElement->getNet()->getDemandPathManager()->getPathDraw()->checkDrawPathGeometry(s, segment, tagProperty.getTag())) {
2054 // draw boundary
2055 if (tagProperty.isPlacedInRTree() && s.drawBoundaries) {
2057 }
2058 // get detail level
2059 const auto d = s.getDetailLevel(1);
2060 // get inspected attribute carriers
2061 const auto& inspectedACs = viewNet->getInspectedAttributeCarriers();
2062 // get inspected plan
2063 const GNEAttributeCarrier* planInspected = (inspectedACs.size() > 0) ? inspectedACs.front() : nullptr;
2064 // calculate path width double
2065 const double pathWidthDouble = s.addSize.getExaggeration(s, segment->getLane()) * planWidth * 2;
2066 // check if draw with double width
2067 const bool drawWithDoubleWidth = ((planInspected == myPlanElement) || (planInspected == planParent) || gViewObjectsHandler.isObjectSelected(myPlanElement));
2068 // draw geometry only if we'rent in drawForObjectUnderCursor mode
2070 // push a draw matrix
2072 // Start with the drawing of the area traslating matrix to origin
2073 viewNet->drawTranslateFrontAttributeCarrier(myPlanElement, myPlanElement->getType(), offsetFront);
2074 // Set plan color
2075 GLHelper::setColor(myPlanElement->drawUsingSelectColor() ? planSelectedColor : planColor);
2076 // check if draw lane2lane connection or a red line
2077 if (segment->getPreviousLane() && segment->getNextLane()) {
2078 if (segment->getPreviousLane()->getLane2laneConnections().exist(segment->getNextLane())) {
2079 // obtain lane2lane geometry
2080 const GUIGeometry& lane2laneGeometry = segment->getPreviousLane()->getLane2laneConnections().getLane2laneGeometry(segment->getNextLane());
2081 // draw lane2lane
2082 GUIGeometry::drawGeometry(d, lane2laneGeometry, pathWidthDouble * (drawWithDoubleWidth ? 1 : 0.5));
2083 } else {
2084 // Set invalid plan color
2086 // draw line between end of first shape and first position of second shape
2087 GLHelper::drawBoxLines({segment->getPreviousLane()->getLaneShape().back(), segment->getNextLane()->getLaneShape().front()}, (0.5 * pathWidthDouble * (drawWithDoubleWidth ? 1 : 0.5)));
2088 }
2089 } else if (segment->getPreviousLane()) {
2090 // draw line between center of junction and last lane shape
2091 GLHelper::drawBoxLines({segment->getPreviousLane()->getLaneShape().back(), myPlanElement->getParentJunctions().back()->getPositionInView()}, pathWidthDouble * (drawWithDoubleWidth ? 1 : 0.5));
2092 } else if (segment->getNextLane()) {
2093 // draw line between center of junction and first lane shape
2094 GLHelper::drawBoxLines({myPlanElement->getParentJunctions().front()->getPositionInView(), segment->getNextLane()->getLaneShape().front()}, pathWidthDouble * (drawWithDoubleWidth ? 1 : 0.5));
2095 }
2096 // Pop last matrix
2098 // draw lock icon
2100 // draw dotted contour
2102 }
2103 // check if shape dotted contour has to be drawn
2104 if (segment->getPreviousLane() && segment->getNextLane()) {
2105 if (segment->getPreviousLane()->getLane2laneConnections().exist(segment->getNextLane())) {
2106 // get shape
2107 const auto& shape = segment->getPreviousLane()->getLane2laneConnections().getLane2laneGeometry(segment->getNextLane()).getShape();
2108 // calculate contour and draw dotted geometry (always with double width)
2109 segment->getContour()->calculateContourExtrudedShape(s, d, myPlanElement, shape, myPlanElement->getType(), pathWidthDouble, 1, false, false, 0);
2110 }
2111 } else if (segment->getPreviousLane()) {
2112 segment->getContour()->calculateContourExtrudedShape(s, d, myPlanElement, {segment->getPreviousLane()->getLaneShape().back(), myPlanElement->getParentJunctions().back()->getPositionInView()},
2113 myPlanElement->getType(), pathWidthDouble, 1, false, true, 0);
2114 } else if (segment->getNextLane()) {
2115 segment->getContour()->calculateContourExtrudedShape(s, d, myPlanElement, {myPlanElement->getParentJunctions().front()->getPositionInView(), segment->getNextLane()->getLaneShape().front()},
2116 myPlanElement->getType(), pathWidthDouble, 1, true, false, 0);
2117 }
2118 }
2119 // check if draw plan parent
2120 if (planParent->getPreviousChildDemandElement(myPlanElement) == nullptr) {
2121 planParent->drawGL(s);
2122 }
2123}
2124
2125
2128 // get previous plan
2129 const auto previousPlan = myPlanElement->getParentDemandElements().at(0)->getPreviousChildDemandElement(myPlanElement);
2130 if (previousPlan) {
2131 // get previous lane
2132 const auto previousLastLane = previousPlan->getLastPathLane();
2133 // get first lane
2134 const auto firstLane = myPlanElement->getFirstPathLane();
2135 // compare edges
2136 if (previousLastLane && firstLane && (previousLastLane->getParentEdge() != firstLane->getParentEdge())) {
2138 }
2139 // in the future, check more elements
2140 }
2141 // get next child
2142 const auto nextPlan = myPlanElement->getParentDemandElements().at(0)->getNextChildDemandElement(myPlanElement);
2143 if (nextPlan) {
2144 // get previous lane
2145 const auto nextFirstLane = nextPlan->getFirstPathLane();
2146 // get first lane
2147 const auto lastLane = myPlanElement->getLastPathLane();
2148 // compare edges
2149 if (nextFirstLane && lastLane && (nextFirstLane->getParentEdge() != lastLane->getParentEdge())) {
2151 }
2152 // in the future, check more elements
2153 }
2154 // all ok, then return true
2156}
2157
2158
2159std::string
2161 // get previous plan
2162 const auto previousPlan = myPlanElement->getParentDemandElements().at(0)->getPreviousChildDemandElement(myPlanElement);
2163 if (previousPlan) {
2164 // get previous lane
2165 const auto previousLastLane = previousPlan->getLastPathLane();
2166 // get first lane
2167 const auto firstLane = myPlanElement->getLastPathLane();
2168 // compare edges
2169 if (previousLastLane && firstLane && (previousLastLane->getParentEdge() != firstLane->getParentEdge())) {
2170 return TLF("Edge '%' is not consecutive with edge '%'", previousLastLane->getParentEdge()->getID(), firstLane->getParentEdge()->getID());
2171 }
2172 // in the future, check more elements
2173 }
2174 // get next child
2175 const auto nextPlan = myPlanElement->getParentDemandElements().at(0)->getNextChildDemandElement(myPlanElement);
2176 if (nextPlan) {
2177 // get previous lane
2178 const auto nextFirstLane = nextPlan->getFirstPathLane();
2179 // get first lane
2180 const auto lastLane = myPlanElement->getLastPathLane();
2181 // compare edges
2182 if (nextFirstLane && lastLane && (nextFirstLane->getParentEdge() != lastLane->getParentEdge())) {
2183 return TLF("Edge '%' is not consecutive with edge '%'", nextFirstLane->getParentEdge()->getID(), lastLane->getParentEdge()->getID());
2184 }
2185 // in the future, check more elements
2186 }
2187 // undefined problem
2188 return "undefined problem";
2189}
2190
2191
2192double
2193GNEDemandElementPlan::getEndPosRadius(const GUIVisualizationSettings& s, const GNEPathManager::Segment* segment, const bool drawHalfWidth) const {
2194 // check if myPlanElement is the last segment
2195 if (segment->isLastSegment()) {
2196 // calculate circle width
2197 const double circleRadius = (drawHalfWidth ? myArrivalPositionDiameter * 0.5 : myArrivalPositionDiameter);
2198 return circleRadius * MIN2((double)0.5, s.laneWidthExaggeration);
2199 } else {
2200 return -1;
2201 }
2202}
2203
2204
2205void
2207 // draw ifcurrent amd next segment is placed over lanes
2208 if (segment->getNextLane()) {
2209 // get firstPosition (last position of current lane shape)
2210 const Position from = lane->getLaneShape().back();
2211 // get lastPosition (first position of next lane shape)
2212 const Position to = segment->getNextLane()->getLaneShape().front();
2213 // push draw matrix
2215 // move front
2216 glTranslated(0, 0, 4);
2217 // draw child line
2219 // pop draw matrix
2221 }
2222}
2223
2224
2225void
2227 // draw the line if previos segment and current segment is placed over lanes
2228 if (segment->getPreviousLane()) {
2229 // get firstPosition (last position of current lane shape)
2230 const Position from = lane->getLaneShape().front();
2231 // get lastPosition (first position of next lane shape)
2232 const Position to = segment->getPreviousLane()->getLaneShape().back();
2233 // push draw matrix
2235 // move front
2236 glTranslated(0, 0, 4);
2237 // draw child line
2239 // pop draw matrix
2241 }
2242}
2243
2244
2245void
2247 // check if myPlanElement is the last segment
2248 if (!s.drawForRectangleSelection && (endPosRadius > 0)) {
2250 // push draw matrix
2252 // translate to pos and move to
2253 glTranslated(geometryEndPos.x(), geometryEndPos.y(), 4);
2254 // resolution of drawn circle depending of the zoom (To improve smothness)
2255 GLHelper::drawFilledCircleDetailled(d, endPosRadius);
2256 // pop draw matrix
2258 }
2259}
2260
2261
2262bool
2263GNEDemandElementPlan::replacePlanParent(const std::string& newParentID) {
2264 std::vector<SumoXMLTag> tags;
2266 tags.push_back(SUMO_TAG_PERSON);
2267 tags.push_back(SUMO_TAG_PERSONFLOW);
2268 } else {
2269 tags.push_back(SUMO_TAG_CONTAINER);
2270 tags.push_back(SUMO_TAG_CONTAINERFLOW);
2271 }
2272 // search new parent and set it
2273 for (const auto& tag : tags) {
2274 if (myPlanElement->getNet()->getAttributeCarriers()->retrieveDemandElement(tag, newParentID, false) != nullptr) {
2275 myPlanElement->replaceDemandElementParent(tag, newParentID, 0);
2276 return true;
2277 }
2278 }
2279 throw ProcessError("Invalid new parent ID");
2280}
2281
2282/****************************************************************************/
@ MID_COPY_TYPED_NAME
Copy typed object name - popup entry.
Definition GUIAppEnum.h:455
@ MID_COPY_NAME
Copy object name - popup entry.
Definition GUIAppEnum.h:453
@ GLO_TAZ
Traffic Assignment Zones (TAZs)
GUIViewObjectsHandler gViewObjectsHandler
@ RIDE_JUNCTION
@ RIDE_CHARGINGSTATION
@ WALK_CONTAINERSTOP
@ PERSONTRIP_JUNCTION
@ TRANSHIP_BUSSTOP
@ TRANSHIP_CHARGINGSTATION
@ TRANSHIP_TRAINSTOP
@ TRANSHIP_TAZ
@ PERSONTRIP_TRAINSTOP
@ WALK_TRAINSTOP
@ PERSONTRIP_BUSSTOP
@ TRANSPORT_TRAINSTOP
@ TRANSHIP_PARKINGAREA
@ TRANSPORT_CONTAINERSTOP
@ PERSONTRIP_CHARGINGSTATION
@ TRANSHIP_EDGE
@ TRANSHIP_EDGES
@ PERSONTRIP_CONTAINERSTOP
@ WALK_BUSSTOP
@ TRANSHIP_CONTAINERSTOP
@ TRANSPORT_EDGE
@ RIDE_BUSSTOP
@ RIDE_CONTAINERSTOP
@ WALK_CHARGINGSTATION
@ WALK_PARKINGAREA
@ TRANSPORT_CHARGINGSTATION
@ TRANSPORT_BUSSTOP
@ TRANSPORT_PARKINGAREA
@ PERSONTRIP_PARKINGAREA
@ RIDE_PARKINGAREA
@ RIDE_TRAINSTOP
@ TRANSPORT_TAZ
@ PERSONTRIP_TAZ
@ PERSONTRIP_EDGE
@ TRANSHIP_JUNCTION
@ WALK_JUNCTION
@ TRANSPORT_JUNCTION
#define TLF(string,...)
Definition MsgHandler.h:317
@ GNE_TAG_RIDE_CHARGINGSTATION_CHARGINGSTATION
@ GNE_TAG_TRANSHIP_TAZ_TAZ
@ GNE_TAG_TRANSPORT_CONTAINERSTOP_TRAINSTOP
@ GNE_TAG_TRANSPORT_CONTAINERSTOP_BUSSTOP
@ GNE_TAG_TRANSHIP_PARKINGAREA_BUSSTOP
@ GNE_TAG_TRANSPORT_TAZ_CONTAINERSTOP
@ GNE_TAG_TRANSHIP_PARKINGAREA_CHARGINGSTATION
@ GNE_TAG_RIDE_EDGE_TAZ
@ GNE_TAG_WALK_BUSSTOP_BUSSTOP
@ GNE_TAG_TRANSPORT_JUNCTION_CHARGINGSTATION
@ GNE_TAG_TRANSHIP_JUNCTION_EDGE
@ GNE_TAG_PERSONTRIP_EDGE_EDGE
@ GNE_TAG_PERSONTRIP_TAZ_EDGE
@ GNE_TAG_TRANSHIP_JUNCTION_CONTAINERSTOP
@ GNE_TAG_PERSONTRIP_EDGE_CONTAINERSTOP
@ GNE_TAG_WALK_EDGE_TAZ
@ GNE_TAG_WALK_PARKINGAREA_CHARGINGSTATION
@ GNE_TAG_WALK_CHARGINGSTATION_JUNCTION
@ GNE_TAG_RIDE_CHARGINGSTATION_TAZ
@ GNE_TAG_PERSONTRIP_CONTAINERSTOP_TAZ
@ GNE_TAG_RIDE_CONTAINERSTOP_BUSSTOP
@ GNE_TAG_TRANSPORT_BUSSTOP_JUNCTION
@ GNE_TAG_RIDE_BUSSTOP_BUSSTOP
@ GNE_TAG_WALK_PARKINGAREA_CONTAINERSTOP
@ GNE_TAG_PERSONTRIP_TAZ_CONTAINERSTOP
@ GNE_TAG_TRANSHIP_CHARGINGSTATION_BUSSTOP
@ GNE_TAG_PERSONTRIP_CHARGINGSTATION_TRAINSTOP
@ GNE_TAG_PERSONTRIP_EDGE_JUNCTION
@ GNE_TAG_TRANSPORT_CHARGINGSTATION_JUNCTION
@ GNE_TAG_TRANSHIP_TRAINSTOP_CHARGINGSTATION
@ GNE_TAG_RIDE_CONTAINERSTOP_CONTAINERSTOP
@ GNE_TAG_TRANSHIP_TRAINSTOP_EDGE
@ GNE_TAG_WALK_TAZ_BUSSTOP
@ GNE_TAG_PERSONTRIP_EDGE_PARKINGAREA
@ GNE_TAG_PERSONTRIP_TRAINSTOP_EDGE
@ GNE_TAG_PERSONTRIP_TRAINSTOP_CONTAINERSTOP
@ GNE_TAG_PERSONTRIP_PARKINGAREA_TRAINSTOP
@ GNE_TAG_STOPCONTAINER_TRAINSTOP
@ GNE_TAG_RIDE_JUNCTION_BUSSTOP
@ GNE_TAG_RIDE_PARKINGAREA_CONTAINERSTOP
@ GNE_TAG_PERSONTRIP_CHARGINGSTATION_PARKINGAREA
@ GNE_TAG_PERSONTRIP_TRAINSTOP_PARKINGAREA
@ GNE_TAG_TRANSPORT_TAZ_PARKINGAREA
@ GNE_TAG_PERSONTRIP_TAZ_CHARGINGSTATION
@ GNE_TAG_RIDE_CONTAINERSTOP_EDGE
@ GNE_TAG_TRANSHIP_TAZ_EDGE
@ GNE_TAG_WALK_BUSSTOP_CHARGINGSTATION
@ GNE_TAG_PERSONTRIP_BUSSTOP_EDGE
@ GNE_TAG_WALK_TRAINSTOP_CHARGINGSTATION
@ SUMO_TAG_TAZ
a traffic assignment zone
@ GNE_TAG_WALK_PARKINGAREA_TRAINSTOP
@ GNE_TAG_WALK_PARKINGAREA_PARKINGAREA
@ GNE_TAG_TRANSPORT_EDGE_TRAINSTOP
@ GNE_TAG_WALK_BUSSTOP_TRAINSTOP
@ GNE_TAG_TRANSHIP_EDGE_CHARGINGSTATION
@ GNE_TAG_PERSONTRIP_TAZ_TRAINSTOP
@ GNE_TAG_TRANSPORT_CONTAINERSTOP_CHARGINGSTATION
@ GNE_TAG_TRANSPORT_CHARGINGSTATION_TAZ
@ GNE_TAG_WALK_TAZ_CONTAINERSTOP
@ GNE_TAG_WALK_PARKINGAREA_JUNCTION
@ GNE_TAG_WALK_CONTAINERSTOP_EDGE
@ GNE_TAG_TRANSHIP_JUNCTION_BUSSTOP
@ GNE_TAG_PERSONTRIP_EDGE_CHARGINGSTATION
@ GNE_TAG_TRANSPORT_EDGE_PARKINGAREA
@ GNE_TAG_TRANSPORT_TRAINSTOP_JUNCTION
@ GNE_TAG_TRANSHIP_PARKINGAREA_JUNCTION
@ GNE_TAG_TRANSHIP_BUSSTOP_CHARGINGSTATION
@ GNE_TAG_TRANSPORT_TAZ_TRAINSTOP
@ GNE_TAG_WALK_EDGE_PARKINGAREA
@ GNE_TAG_TRANSPORT_EDGE_BUSSTOP
@ GNE_TAG_TRANSPORT_CONTAINERSTOP_EDGE
@ GNE_TAG_TRANSPORT_CHARGINGSTATION_PARKINGAREA
@ SUMO_TAG_NOTHING
invalid tag, must be the last one
@ GNE_TAG_WALK_PARKINGAREA_EDGE
@ GNE_TAG_TRANSHIP_EDGE_EDGE
@ GNE_TAG_RIDE_TAZ_EDGE
@ GNE_TAG_RIDE_TRAINSTOP_JUNCTION
@ GNE_TAG_WALK_EDGES
@ GNE_TAG_RIDE_TRAINSTOP_CONTAINERSTOP
@ GNE_TAG_TRANSPORT_JUNCTION_PARKINGAREA
@ GNE_TAG_RIDE_CHARGINGSTATION_EDGE
@ GNE_TAG_RIDE_CHARGINGSTATION_CONTAINERSTOP
@ GNE_TAG_WALK_CONTAINERSTOP_CHARGINGSTATION
@ SUMO_TAG_CONTAINERFLOW
@ GNE_TAG_TRANSHIP_PARKINGAREA_CONTAINERSTOP
@ GNE_TAG_TRANSPORT_TRAINSTOP_TAZ
@ GNE_TAG_WALK_BUSSTOP_JUNCTION
@ GNE_TAG_TRANSHIP_CHARGINGSTATION_TRAINSTOP
@ GNE_TAG_TRANSHIP_EDGE_CONTAINERSTOP
@ GNE_TAG_WALK_CONTAINERSTOP_JUNCTION
@ GNE_TAG_TRANSPORT_PARKINGAREA_PARKINGAREA
@ GNE_TAG_RIDE_EDGE_JUNCTION
@ GNE_TAG_TRANSPORT_CHARGINGSTATION_TRAINSTOP
@ GNE_TAG_TRANSPORT_TRAINSTOP_TRAINSTOP
@ GNE_TAG_RIDE_PARKINGAREA_TAZ
@ GNE_TAG_WALK_CHARGINGSTATION_TRAINSTOP
@ GNE_TAG_PERSONTRIP_BUSSTOP_CONTAINERSTOP
@ GNE_TAG_TRANSPORT_TRAINSTOP_CONTAINERSTOP
@ GNE_TAG_PERSONTRIP_PARKINGAREA_TAZ
@ GNE_TAG_STOPCONTAINER_EDGE
@ GNE_TAG_WALK_TRAINSTOP_TAZ
@ GNE_TAG_PERSONTRIP_PARKINGAREA_JUNCTION
@ GNE_TAG_TRANSPORT_JUNCTION_BUSSTOP
@ GNE_TAG_TRANSHIP_JUNCTION_PARKINGAREA
@ GNE_TAG_STOPCONTAINER_PARKINGAREA
@ GNE_TAG_PERSONTRIP_CONTAINERSTOP_TRAINSTOP
@ GNE_TAG_TRANSPORT_CHARGINGSTATION_CONTAINERSTOP
@ GNE_TAG_TRANSPORT_TRAINSTOP_CHARGINGSTATION
@ GNE_TAG_TRANSPORT_PARKINGAREA_CONTAINERSTOP
@ GNE_TAG_STOPPERSON_BUSSTOP
@ GNE_TAG_TRANSPORT_BUSSTOP_CONTAINERSTOP
@ SUMO_TAG_STOP
stop for vehicles
@ GNE_TAG_PERSONTRIP_BUSSTOP_TRAINSTOP
@ GNE_TAG_RIDE_PARKINGAREA_BUSSTOP
@ GNE_TAG_PERSONTRIP_CHARGINGSTATION_TAZ
@ GNE_TAG_RIDE_TAZ_TRAINSTOP
@ GNE_TAG_PERSONTRIP_CONTAINERSTOP_EDGE
@ GNE_TAG_TRANSHIP_CONTAINERSTOP_PARKINGAREA
@ GNE_TAG_PERSONTRIP_JUNCTION_BUSSTOP
@ GNE_TAG_TRANSHIP_BUSSTOP_CONTAINERSTOP
@ GNE_TAG_PERSONTRIP_CHARGINGSTATION_BUSSTOP
@ GNE_TAG_TRANSPORT_PARKINGAREA_EDGE
@ GNE_TAG_PERSONTRIP_TRAINSTOP_TAZ
@ GNE_TAG_RIDE_PARKINGAREA_JUNCTION
@ GNE_TAG_TRANSHIP_PARKINGAREA_TRAINSTOP
@ GNE_TAG_RIDE_JUNCTION_JUNCTION
@ GNE_TAG_WALK_BUSSTOP_CONTAINERSTOP
@ GNE_TAG_RIDE_BUSSTOP_TAZ
@ GNE_TAG_PERSONTRIP_TAZ_PARKINGAREA
@ GNE_TAG_TRANSHIP_BUSSTOP_JUNCTION
@ GNE_TAG_RIDE_JUNCTION_PARKINGAREA
@ GNE_TAG_TRANSPORT_EDGE_TAZ
@ GNE_TAG_PERSONTRIP_CONTAINERSTOP_PARKINGAREA
@ GNE_TAG_WALK_JUNCTION_PARKINGAREA
@ GNE_TAG_TRANSHIP_EDGE_TAZ
@ GNE_TAG_RIDE_TRAINSTOP_TAZ
@ GNE_TAG_RIDE_TRAINSTOP_CHARGINGSTATION
@ GNE_TAG_WALK_CHARGINGSTATION_BUSSTOP
@ GNE_TAG_PERSONTRIP_JUNCTION_TRAINSTOP
@ GNE_TAG_RIDE_JUNCTION_TRAINSTOP
@ GNE_TAG_WALK_CONTAINERSTOP_TAZ
@ GNE_TAG_PERSONTRIP_TRAINSTOP_BUSSTOP
@ GNE_TAG_TRANSHIP_BUSSTOP_EDGE
@ GNE_TAG_TRANSHIP_TRAINSTOP_JUNCTION
@ GNE_TAG_TRANSPORT_CHARGINGSTATION_CHARGINGSTATION
@ GNE_TAG_TRANSHIP_EDGE_JUNCTION
@ GNE_TAG_PERSONTRIP_BUSSTOP_JUNCTION
@ GNE_TAG_TRANSHIP_EDGES
@ GNE_TAG_TRANSHIP_TAZ_TRAINSTOP
@ GNE_TAG_WALK_JUNCTION_CONTAINERSTOP
@ GNE_TAG_STOPCONTAINER_CONTAINERSTOP
@ GNE_TAG_RIDE_TAZ_CONTAINERSTOP
@ GNE_TAG_RIDE_BUSSTOP_TRAINSTOP
@ GNE_TAG_TRANSHIP_CHARGINGSTATION_EDGE
@ GNE_TAG_PERSONTRIP_EDGE_TRAINSTOP
@ GNE_TAG_RIDE_BUSSTOP_EDGE
@ GNE_TAG_RIDE_TRAINSTOP_BUSSTOP
@ GNE_TAG_TRANSPORT_CONTAINERSTOP_TAZ
@ GNE_TAG_WALK_TRAINSTOP_EDGE
@ GNE_TAG_RIDE_EDGE_EDGE
@ GNE_TAG_PERSONTRIP_PARKINGAREA_EDGE
@ GNE_TAG_TRANSPORT_BUSSTOP_CHARGINGSTATION
@ GNE_TAG_RIDE_JUNCTION_CONTAINERSTOP
@ GNE_TAG_TRANSPORT_PARKINGAREA_TAZ
@ GNE_TAG_PERSONTRIP_PARKINGAREA_CONTAINERSTOP
@ GNE_TAG_PERSONTRIP_TRAINSTOP_TRAINSTOP
@ GNE_TAG_TRANSPORT_EDGE_EDGE
@ GNE_TAG_WALK_EDGE_TRAINSTOP
@ GNE_TAG_WALK_TAZ_CHARGINGSTATION
@ GNE_TAG_TRANSPORT_EDGE_CONTAINERSTOP
@ GNE_TAG_STOPCONTAINER_BUSSTOP
@ GNE_TAG_WALK_JUNCTION_TAZ
@ GNE_TAG_WALK_JUNCTION_CHARGINGSTATION
@ GNE_TAG_WALK_CHARGINGSTATION_TAZ
@ GNE_TAG_PERSONTRIP_TAZ_BUSSTOP
@ GNE_TAG_RIDE_PARKINGAREA_CHARGINGSTATION
@ GNE_TAG_RIDE_BUSSTOP_JUNCTION
@ GNE_TAG_PERSONTRIP_CHARGINGSTATION_JUNCTION
@ GNE_TAG_PERSONTRIP_CHARGINGSTATION_CHARGINGSTATION
@ GNE_TAG_WALK_JUNCTION_JUNCTION
@ GNE_TAG_TRANSPORT_BUSSTOP_TAZ
@ GNE_TAG_RIDE_JUNCTION_CHARGINGSTATION
@ GNE_TAG_TRANSPORT_PARKINGAREA_TRAINSTOP
@ SUMO_TAG_CONTAINER
@ GNE_TAG_TRANSHIP_PARKINGAREA_TAZ
@ GNE_TAG_TRANSHIP_PARKINGAREA_PARKINGAREA
@ GNE_TAG_WALK_CONTAINERSTOP_PARKINGAREA
@ GNE_TAG_TRANSHIP_TAZ_PARKINGAREA
@ GNE_TAG_WALK_EDGE_EDGE
@ GNE_TAG_PERSONTRIP_TAZ_TAZ
@ GNE_TAG_TRANSPORT_CONTAINERSTOP_JUNCTION
@ GNE_TAG_TRANSHIP_TAZ_BUSSTOP
@ GNE_TAG_TRANSPORT_TAZ_EDGE
@ GNE_TAG_TRANSHIP_CHARGINGSTATION_CHARGINGSTATION
@ GNE_TAG_RIDE_EDGE_CHARGINGSTATION
@ GNE_TAG_TRANSPORT_TAZ_TAZ
@ GNE_TAG_PERSONTRIP_CHARGINGSTATION_EDGE
@ GNE_TAG_PERSONTRIP_EDGE_BUSSTOP
@ GNE_TAG_TRANSPORT_EDGE_JUNCTION
@ GNE_TAG_WALK_CHARGINGSTATION_CONTAINERSTOP
@ GNE_TAG_TRANSPORT_TAZ_BUSSTOP
@ GNE_TAG_WALK_BUSSTOP_PARKINGAREA
@ GNE_TAG_WALK_CHARGINGSTATION_PARKINGAREA
@ GNE_TAG_TRANSPORT_JUNCTION_JUNCTION
@ GNE_TAG_PERSONTRIP_CHARGINGSTATION_CONTAINERSTOP
@ GNE_TAG_TRANSHIP_BUSSTOP_TRAINSTOP
@ GNE_TAG_PERSONTRIP_BUSSTOP_TAZ
@ GNE_TAG_RIDE_TAZ_PARKINGAREA
@ GNE_TAG_WALK_CONTAINERSTOP_BUSSTOP
@ GNE_TAG_RIDE_CHARGINGSTATION_PARKINGAREA
@ GNE_TAG_RIDE_CHARGINGSTATION_BUSSTOP
@ GNE_TAG_PERSONTRIP_CONTAINERSTOP_CONTAINERSTOP
@ GNE_TAG_TRANSHIP_CONTAINERSTOP_TAZ
@ GNE_TAG_TRANSPORT_CHARGINGSTATION_EDGE
@ GNE_TAG_PERSONTRIP_BUSSTOP_CHARGINGSTATION
@ GNE_TAG_WALK_BUSSTOP_EDGE
@ GNE_TAG_RIDE_JUNCTION_TAZ
@ GNE_TAG_TRANSPORT_TRAINSTOP_BUSSTOP
@ GNE_TAG_WALK_JUNCTION_TRAINSTOP
@ GNE_TAG_RIDE_TAZ_TAZ
@ GNE_TAG_TRANSHIP_EDGE_TRAINSTOP
@ GNE_TAG_TRANSHIP_TRAINSTOP_TRAINSTOP
@ GNE_TAG_RIDE_PARKINGAREA_PARKINGAREA
@ GNE_TAG_WALK_TRAINSTOP_PARKINGAREA
@ GNE_TAG_RIDE_EDGE_BUSSTOP
@ GNE_TAG_WALK_TAZ_JUNCTION
@ GNE_TAG_RIDE_TAZ_JUNCTION
@ GNE_TAG_PERSONTRIP_JUNCTION_PARKINGAREA
@ GNE_TAG_TRANSPORT_BUSSTOP_TRAINSTOP
@ GNE_TAG_TRANSPORT_TRAINSTOP_PARKINGAREA
@ GNE_TAG_TRANSPORT_PARKINGAREA_JUNCTION
@ GNE_TAG_STOPPERSON_CONTAINERSTOP
@ GNE_TAG_WALK_BUSSTOP_TAZ
@ GNE_TAG_RIDE_CONTAINERSTOP_CHARGINGSTATION
@ GNE_TAG_TRANSPORT_CONTAINERSTOP_CONTAINERSTOP
@ GNE_TAG_PERSONTRIP_BUSSTOP_BUSSTOP
@ GNE_TAG_TRANSHIP_BUSSTOP_PARKINGAREA
@ GNE_TAG_PERSONTRIP_JUNCTION_JUNCTION
@ GNE_TAG_TRANSHIP_CONTAINERSTOP_JUNCTION
@ GNE_TAG_WALK_TAZ_TAZ
@ GNE_TAG_WALK_TRAINSTOP_BUSSTOP
@ GNE_TAG_TRANSHIP_JUNCTION_TRAINSTOP
@ GNE_TAG_WALK_TAZ_EDGE
@ GNE_TAG_PERSONTRIP_TAZ_JUNCTION
@ GNE_TAG_WALK_EDGE_CHARGINGSTATION
@ GNE_TAG_TRANSPORT_JUNCTION_TAZ
@ GNE_TAG_TRANSPORT_PARKINGAREA_BUSSTOP
@ GNE_TAG_RIDE_EDGE_TRAINSTOP
@ GNE_TAG_TRANSHIP_TAZ_JUNCTION
@ SUMO_TAG_PERSON
@ GNE_TAG_TRANSHIP_JUNCTION_CHARGINGSTATION
@ GNE_TAG_WALK_TRAINSTOP_CONTAINERSTOP
@ GNE_TAG_WALK_JUNCTION_BUSSTOP
@ GNE_TAG_TRANSHIP_JUNCTION_JUNCTION
@ GNE_TAG_PERSONTRIP_CONTAINERSTOP_JUNCTION
@ GNE_TAG_WALK_JUNCTION_EDGE
@ GNE_TAG_PERSONTRIP_BUSSTOP_PARKINGAREA
@ GNE_TAG_TRANSHIP_CONTAINERSTOP_TRAINSTOP
@ GNE_TAG_PERSONTRIP_PARKINGAREA_BUSSTOP
@ GNE_TAG_RIDE_CHARGINGSTATION_JUNCTION
@ GNE_TAG_RIDE_BUSSTOP_CHARGINGSTATION
@ GNE_TAG_TRANSPORT_JUNCTION_TRAINSTOP
@ GNE_TAG_WALK_EDGE_CONTAINERSTOP
@ GNE_TAG_WALK_TRAINSTOP_JUNCTION
@ GNE_TAG_TRANSHIP_CHARGINGSTATION_PARKINGAREA
@ GNE_TAG_STOPPERSON_CHARGINGSTATION
@ GNE_TAG_TRANSHIP_CHARGINGSTATION_TAZ
@ GNE_TAG_TRANSPORT_BUSSTOP_EDGE
@ GNE_TAG_TRANSHIP_CONTAINERSTOP_BUSSTOP
@ GNE_TAG_WALK_PARKINGAREA_TAZ
@ GNE_TAG_PERSONTRIP_JUNCTION_EDGE
@ GNE_TAG_RIDE_CONTAINERSTOP_PARKINGAREA
@ GNE_TAG_RIDE_CHARGINGSTATION_TRAINSTOP
@ GNE_TAG_STOPPERSON_TRAINSTOP
@ GNE_TAG_TRANSPORT_CHARGINGSTATION_BUSSTOP
@ GNE_TAG_PERSONTRIP_PARKINGAREA_CHARGINGSTATION
@ GNE_TAG_TRANSHIP_CHARGINGSTATION_CONTAINERSTOP
@ GNE_TAG_TRANSHIP_EDGE_BUSSTOP
@ GNE_TAG_RIDE_BUSSTOP_PARKINGAREA
@ GNE_TAG_WALK_EDGE_JUNCTION
@ GNE_TAG_RIDE_PARKINGAREA_EDGE
@ GNE_TAG_PERSONTRIP_JUNCTION_TAZ
@ GNE_TAG_TRANSHIP_PARKINGAREA_EDGE
@ GNE_TAG_TRANSPORT_PARKINGAREA_CHARGINGSTATION
@ GNE_TAG_TRANSHIP_TRAINSTOP_CONTAINERSTOP
@ GNE_TAG_PERSONTRIP_JUNCTION_CONTAINERSTOP
@ GNE_TAG_WALK_TRAINSTOP_TRAINSTOP
@ GNE_TAG_WALK_CHARGINGSTATION_EDGE
@ GNE_TAG_TRANSHIP_EDGE_PARKINGAREA
@ GNE_TAG_WALK_EDGE_BUSSTOP
@ GNE_TAG_PERSONTRIP_PARKINGAREA_PARKINGAREA
@ GNE_TAG_TRANSHIP_TRAINSTOP_BUSSTOP
@ GNE_TAG_TRANSHIP_BUSSTOP_BUSSTOP
@ GNE_TAG_TRANSPORT_TRAINSTOP_EDGE
@ GNE_TAG_PERSONTRIP_TRAINSTOP_CHARGINGSTATION
@ GNE_TAG_TRANSPORT_EDGE_CHARGINGSTATION
@ GNE_TAG_TRANSHIP_CONTAINERSTOP_CONTAINERSTOP
@ GNE_TAG_WALK_CONTAINERSTOP_TRAINSTOP
@ GNE_TAG_RIDE_EDGE_PARKINGAREA
@ GNE_TAG_TRANSHIP_CHARGINGSTATION_JUNCTION
@ GNE_TAG_RIDE_BUSSTOP_CONTAINERSTOP
@ GNE_TAG_WALK_TAZ_TRAINSTOP
@ GNE_TAG_PERSONTRIP_CONTAINERSTOP_CHARGINGSTATION
@ GNE_TAG_RIDE_JUNCTION_EDGE
@ GNE_TAG_TRANSHIP_TRAINSTOP_PARKINGAREA
@ GNE_TAG_PERSONTRIP_CONTAINERSTOP_BUSSTOP
@ GNE_TAG_TRANSHIP_JUNCTION_TAZ
@ GNE_TAG_TRANSPORT_JUNCTION_CONTAINERSTOP
@ GNE_TAG_TRANSPORT_TAZ_CHARGINGSTATION
@ GNE_TAG_TRANSPORT_TAZ_JUNCTION
@ GNE_TAG_RIDE_TRAINSTOP_TRAINSTOP
@ GNE_TAG_TRANSPORT_JUNCTION_EDGE
@ GNE_TAG_TRANSPORT_BUSSTOP_BUSSTOP
@ GNE_TAG_WALK_PARKINGAREA_BUSSTOP
@ GNE_TAG_RIDE_CONTAINERSTOP_TAZ
@ GNE_TAG_STOPCONTAINER_CHARGINGSTATION
@ GNE_TAG_TRANSPORT_BUSSTOP_PARKINGAREA
@ GNE_TAG_WALK_TAZ_PARKINGAREA
@ GNE_TAG_TRANSHIP_TAZ_CHARGINGSTATION
@ GNE_TAG_TRANSHIP_BUSSTOP_TAZ
@ GNE_TAG_PERSONTRIP_TRAINSTOP_JUNCTION
@ GNE_TAG_RIDE_CONTAINERSTOP_TRAINSTOP
@ GNE_TAG_RIDE_TAZ_CHARGINGSTATION
@ GNE_TAG_STOPPERSON_EDGE
@ GNE_TAG_RIDE_CONTAINERSTOP_JUNCTION
@ GNE_TAG_PERSONTRIP_JUNCTION_CHARGINGSTATION
@ GNE_TAG_RIDE_PARKINGAREA_TRAINSTOP
@ GNE_TAG_TRANSPORT_CONTAINERSTOP_PARKINGAREA
@ GNE_TAG_TRANSHIP_CONTAINERSTOP_CHARGINGSTATION
@ GNE_TAG_WALK_ROUTE
@ GNE_TAG_PERSONTRIP_EDGE_TAZ
@ GNE_TAG_RIDE_TAZ_BUSSTOP
@ GNE_TAG_WALK_CONTAINERSTOP_CONTAINERSTOP
@ GNE_TAG_RIDE_TRAINSTOP_PARKINGAREA
@ SUMO_TAG_PERSONFLOW
@ GNE_TAG_TRANSHIP_CONTAINERSTOP_EDGE
@ GNE_TAG_WALK_CHARGINGSTATION_CHARGINGSTATION
@ GNE_TAG_TRANSHIP_TRAINSTOP_TAZ
@ GNE_TAG_RIDE_EDGE_CONTAINERSTOP
@ GNE_TAG_STOPPERSON_PARKINGAREA
@ GNE_TAG_RIDE_TRAINSTOP_EDGE
@ GNE_TAG_TRANSHIP_TAZ_CONTAINERSTOP
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
@ SUMO_ATTR_STARTPOS
@ GNE_ATTR_FROM_TRAINSTOP
@ GNE_ATTR_FROM_BUSSTOP
@ GNE_ATTR_PLAN_GEOMETRY_STARTPOS
person/container geometry start position
@ SUMO_ATTR_FROM_JUNCTION
@ SUMO_ATTR_CONTAINER_STOP
@ SUMO_ATTR_PARKING_AREA
@ SUMO_ATTR_EDGE
@ SUMO_ATTR_BUS_STOP
@ SUMO_ATTR_TRAIN_STOP
@ SUMO_ATTR_ENDPOS
@ SUMO_ATTR_TO_JUNCTION
@ GNE_ATTR_PARENT
parent of an additional element
@ SUMO_ATTR_ARRIVALPOS
@ GNE_ATTR_SELECTED
element is selected
@ GNE_ATTR_TAZ_CENTROID
TAZ Center (uses to return the TAZ centroid if center is not defined)
@ SUMO_ATTR_EDGES
the edges of a route
@ SUMO_ATTR_CHARGING_STATION
@ SUMO_ATTR_DEPARTPOS
@ GNE_ATTR_FROM_PARKINGAREA
@ GNE_ATTR_FROM_CONTAINERSTOP
@ SUMO_ATTR_TO_TAZ
@ SUMO_ATTR_CENTER
@ SUMO_ATTR_TO
@ SUMO_ATTR_FROM
@ SUMO_ATTR_FROM_TAZ
@ GNE_ATTR_FROM_CHARGINGSTATION
@ GNE_ATTR_PLAN_GEOMETRY_ENDPOS
person/container geometry end position
@ SUMO_ATTR_ROUTE
@ SUMO_ATTR_ID
@ SUMO_ATTR_DURATION
const double INVALID_DOUBLE
invalid double
Definition StdDefs.h:64
T MIN2(T a, T b)
Definition StdDefs.h:76
const double SUMO_const_halfLaneWidth
Definition StdDefs.h:49
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
Definition ToString.h:46
A class that stores a 2D geometrical boundary.
Definition Boundary.h:39
Position getCenter() const
Returns the center of the boundary.
Definition Boundary.cpp:112
void add(double x, double y, double z=0)
Makes the boundary include the given coordinate.
Definition Boundary.cpp:78
bool isInitialised() const
check if Boundary is Initialised
Definition Boundary.cpp:259
Boundary & grow(double by)
extends the boundary by the given amount
Definition Boundary.cpp:343
plan parameters (used for group all from-to parameters related with plans)
std::string fromJunction
from junction
std::string fromContainerStop
from containerStop
std::string fromTrainStop
from trainStop
std::string toParkingArea
to parkingArea
std::vector< std::string > consecutiveEdges
consecutive edges
bool isSingleEdgePlan() const
check if this is a single-edge plan
std::string fromChargingStation
from chargingStation
std::string toChargingStation
to chargingStation
std::string fromParkingArea
from parkingArea
std::string toContainerStop
to containerStop
static void setColor(const RGBColor &c)
Sets the gl-color to this value.
Definition GLHelper.cpp:654
static void drawTriangleAtEnd(const Position &p1, const Position &p2, double tLength, double tWidth, const double extraOffset=0)
Draws a triangle at the end of the given line.
Definition GLHelper.cpp:629
static void popMatrix()
pop matrix
Definition GLHelper.cpp:130
static void drawBoxLines(const PositionVector &geom, const std::vector< double > &rots, const std::vector< double > &lengths, double width, int cornerDetail=0, double offset=0)
Draws thick lines.
Definition GLHelper.cpp:347
static void drawBoundary(const GUIVisualizationSettings &s, const Boundary &b)
Draw a boundary (used for debugging)
Definition GLHelper.cpp:966
static void drawFilledCircleDetailled(const GUIVisualizationSettings::Detail d, const double radius)
Draws a filled circle around (0,0) depending of level of detail.
Definition GLHelper.cpp:539
static void pushMatrix()
push matrix
Definition GLHelper.cpp:117
bool isAttributeCarrierSelected() const
check if attribute carrier is selected
const std::string & getTagStr() const
get tag assigned to this object in string format
const GNETagProperties & getTagProperty() const
get tagProperty associated with this Attribute Carrier
bool isTemplate() const
check if this AC is template
void unselectAttributeCarrier(const bool changeFlag=true)
unselect attribute carrier using GUIGlobalSelection
bool drawUsingSelectColor() const
check if attribute carrier must be drawn using selecting color.
GNENet * myNet
pointer to net
GNENet * getNet() const
get pointer to net
static std::string parseIDs(const std::vector< T > &ACs)
parses a list of specific Attribute Carriers into a string of IDs
void selectAttributeCarrier(const bool changeFlag=true)
select attribute carrier using GUIGlobalSelection
virtual std::string getAttribute(SumoXMLAttr key) const =0
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
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
calculate contour (circle elements)
void drawDottedContours(const GUIVisualizationSettings &s, const GUIVisualizationSettings::Detail d, const GNEAttributeCarrier *AC, const double lineWidth, const bool addOffset) const
draw dotted contours (basics, select, delete, inspect...)
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
void drawPlanLanePartial(const bool drawPlan, const GUIVisualizationSettings &s, const GNEPathManager::Segment *segment, const double offsetFront, const double planWidth, const RGBColor &planColor, const RGBColor &planSelectedColor) const
draw plan partial lane
GNEContour myPlanContourEnd
variable used for draw contour end
GUIGLObjectPopupMenu * getPlanPopUpMenu(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own popup-menu.
void drawPlanJunctionPartial(const bool drawPlan, const GUIVisualizationSettings &s, const GNEPathManager::Segment *segment, const double offsetFront, const double planWidth, const RGBColor &planColor, const RGBColor &planSelectedColor) const
draw plan partial junction
GNEDemandElementPlan(GNEDemandElement *planElement, const double departPosition, const double arrivalPosition)
constructor
void drawFromArrow(const GUIVisualizationSettings &s, const GNELane *lane, const GNEPathManager::Segment *segment) const
draw from arrow
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 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
GNEMoveOperation * getPlanMoveOperation()
get move operation
void drawToArrow(const GUIVisualizationSettings &s, const GNELane *lane, const GNEPathManager::Segment *segment) const
draw to arrow
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
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 writeOriginStop(OutputDevice &device) const
write initial stop stage if plan starts at a stopping place
bool replacePlanParent(const std::string &newParentID)
replace plan parent
double getEndPosRadius(const GUIVisualizationSettings &s, const GNEPathManager::Segment *segment, const bool drawHalfWidth) const
get end position radius
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:664
const GUIGeometry & getLaneGeometry() const
get lane geometry
Definition GNELane.cpp:208
move operation
GNEDemandElement * retrieveDemandElement(SumoXMLTag type, const std::string &id, bool hardFail=true) const
Returns the named demand element.
void addGLObjectIntoGrid(GNEAttributeCarrier *AC)
add GL Object into net
Definition GNENet.cpp:1378
void removeGLObjectFromGrid(GNEAttributeCarrier *AC)
add GL Object into net
Definition GNENet.cpp:1388
GNEPathManager * getDemandPathManager()
get demand path manager
Definition GNENet.cpp:142
GNENetHelper::AttributeCarriers * getAttributeCarriers() const
get all attribute carriers used in this net
Definition GNENet.cpp:125
GNEViewNet * getViewNet() const
get view net
Definition GNENet.cpp:2147
bool checkDrawPathGeometry(const GUIVisualizationSettings &s, const GNELane *lane, SumoXMLTag tag)
check if path element geometry must be drawn in the given lane
const GNELane * getPreviousLane() const
get previous lane
GNEContour * getContour() const
getcontour associated with segment
const GNELane * getNextLane() const
get next lane
const GNELane * getLane() const
get lane associated with this segment
bool isLastSegment() const
check if segment is the last path's segment
bool isFirstSegment() const
check if segment is the first path's segment
PathDraw * getPathDraw()
obtain instance of PathDraw
void calculateConsecutivePathEdges(PathElement *pathElement, SUMOVehicleClass vClass, const std::vector< GNEEdge * > &edges, const int firstLaneIndex=-1, const int lastLaneIndex=-1)
calculate consecutive path edges
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 isPlanContainer() const
return true if tag correspond to a container plan
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
const std::vector< GNEAttributeCarrier * > & getInspectedAttributeCarriers() const
get inspected attribute carriers
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.
bool isObjectSelected(const GUIGlObject *GLObject) const
check if element was already selected
Stores the information about how to visualize structures.
GUIVisualizationTextSettings addName
bool drawBoundaries
enable or disable draw boundaries
bool drawForRectangleSelection
whether drawing is performed for the purpose of selecting objects using a rectangle
GUIVisualizationSizeSettings addSize
GUIVisualizationWidthSettings widthSettings
width settings
Detail getDetailLevel(const double exaggeration) const
return the detail level
double laneWidthExaggeration
The lane exaggeration (upscale thickness)
bool checkDrawContainer(Detail d, const bool selected) const
check if draw container
GUIVisualizationDottedContourSettings dottedContourSettings
dotted contour settings
double scale
information about a lane's width (temporary, used for a single view)
bool drawForViewObjectsHandler
whether drawing is performed for the purpose of selecting objects in view using ViewObjectsHandler
bool checkDrawPerson(Detail d, const bool selected) const
check if draw person
Static storage of an output device and its base (abstract) implementation.
OutputDevice & writeAttr(const SumoXMLAttr attr, const T &val)
writes a named attribute
OutputDevice & openTag(const std::string &xmlElement)
Opens an XML tag.
bool closeTag(const std::string &comment="")
Closes the most recently opened tag and optionally adds a comment.
A point in 2D or 3D with translation and scaling methods.
Definition Position.h:37
double distanceSquaredTo2D(const Position &p2) const
returns the square of the distance to another position (Only using x and y positions)
Definition Position.h:281
static const Position INVALID
used to indicate that a position is valid
Definition Position.h:322
double x() const
Returns the x-position.
Definition Position.h:55
double y() const
Returns the y-position.
Definition Position.h:60
Boundary getBoxBoundary() const
Returns a boundary enclosing this list of lines.
static const RGBColor RED
named colors
Definition RGBColor.h:185
static void drawLockIcon(const GUIVisualizationSettings::Detail d, const GNEAttributeCarrier *AC, GUIGlObjectType type, const Position position, const double exaggeration, const double size=0.5, const double offsetx=0, const double offsety=0)
draw lock icon
static const double segmentWidth
width of dotted contour segments
double getExaggeration(const GUIVisualizationSettings &s, const GUIGlObject *o, double factor=20) const
return the drawing size including exaggeration and constantSize values
double personTripWidth
width for person trips