@@ -511,7 +511,7 @@ GNEViewParent::onCmdLocate(FXObject*, FXSelector sel, void*) {
511
511
// check that viewNet exist
512
512
if (viewNet) {
513
513
// declare a vector in which save attribute carriers to locate
514
- std::vector< GNEAttributeCarrier*> ACsToLocate;
514
+ std::map<std::string, GNEAttributeCarrier*> ACsToLocate;
515
515
int messageId = FXSELID (sel);
516
516
GNEDialogACChooser** chooserLoc = nullptr ;
517
517
std::string locateTitle;
@@ -520,21 +520,21 @@ GNEViewParent::onCmdLocate(FXObject*, FXSelector sel, void*) {
520
520
chooserLoc = &myACChoosers.ACChooserJunction ;
521
521
locateTitle = TL (" Junction Chooser" );
522
522
for (const auto & junction : viewNet->getNet ()->getAttributeCarriers ()->getJunctions ()) {
523
- ACsToLocate. push_back ( junction.second ) ;
523
+ ACsToLocate[junction. second -> getID ()] = junction.second ;
524
524
}
525
525
break ;
526
526
case MID_HOTKEY_SHIFT_E_LOCATEEDGE:
527
527
chooserLoc = &myACChoosers.ACChooserEdges ;
528
528
locateTitle = TL (" Edge Chooser" );
529
529
for (const auto & edge : viewNet->getNet ()->getAttributeCarriers ()->getEdges ()) {
530
- ACsToLocate. push_back ( edge.second ) ;
530
+ ACsToLocate[edge. second -> getID ()] = edge.second ;
531
531
}
532
532
break ;
533
533
case MID_HOTKEY_SHIFT_W_LOCATEWALKINGAREA:
534
534
chooserLoc = &myACChoosers.ACChooserWalkingAreas ;
535
535
locateTitle = TL (" WalkingArea Chooser" );
536
536
for (const auto & walkingArea : viewNet->getNet ()->getAttributeCarriers ()->getWalkingAreas ()) {
537
- ACsToLocate. push_back ( walkingArea.second ) ;
537
+ ACsToLocate[walkingArea. second -> getID ()] = walkingArea.second ;
538
538
}
539
539
break ;
540
540
case MID_HOTKEY_SHIFT_V_LOCATEVEHICLE: {
@@ -543,7 +543,7 @@ GNEViewParent::onCmdLocate(FXObject*, FXSelector sel, void*) {
543
543
// fill ACsToLocate with all vehicles
544
544
for (const auto & vehicleTag : NamespaceIDs::vehicles) {
545
545
for (const auto & vehicle : viewNet->getNet ()->getAttributeCarriers ()->getDemandElements ().at (vehicleTag)) {
546
- ACsToLocate. push_back ( vehicle.second ) ;
546
+ ACsToLocate[vehicle. second -> getID ()] = vehicle.second ;
547
547
}
548
548
}
549
549
break ;
@@ -554,7 +554,7 @@ GNEViewParent::onCmdLocate(FXObject*, FXSelector sel, void*) {
554
554
// fill ACsToLocate with all persons
555
555
for (const auto & personTag : NamespaceIDs::persons) {
556
556
for (const auto & person : viewNet->getNet ()->getAttributeCarriers ()->getDemandElements ().at (personTag)) {
557
- ACsToLocate. push_back ( person.second ) ;
557
+ ACsToLocate[person. second -> getID ()] = person.second ;
558
558
}
559
559
}
560
560
break ;
@@ -564,15 +564,15 @@ GNEViewParent::onCmdLocate(FXObject*, FXSelector sel, void*) {
564
564
// fill ACsToLocate with all containers
565
565
for (const auto & containerTag : NamespaceIDs::containers) {
566
566
for (const auto & container : viewNet->getNet ()->getAttributeCarriers ()->getDemandElements ().at (containerTag)) {
567
- ACsToLocate. push_back ( container.second ) ;
567
+ ACsToLocate[container. second -> getID ()] = container.second ;
568
568
}
569
569
}
570
570
break ;
571
571
case MID_HOTKEY_SHIFT_R_LOCATEROUTE:
572
572
chooserLoc = &myACChoosers.ACChooserRoutes ;
573
573
locateTitle = TL (" Route Chooser" );
574
574
for (const auto & route : viewNet->getNet ()->getAttributeCarriers ()->getDemandElements ().at (SUMO_TAG_ROUTE)) {
575
- ACsToLocate. push_back ( route.second ) ;
575
+ ACsToLocate[route. second -> getID ()] = route.second ;
576
576
}
577
577
break ;
578
578
case MID_HOTKEY_SHIFT_S_LOCATESTOP: {
@@ -581,7 +581,7 @@ GNEViewParent::onCmdLocate(FXObject*, FXSelector sel, void*) {
581
581
// fill ACsToLocate with all vehicles
582
582
for (const auto & stopTag : NamespaceIDs::stops) {
583
583
for (const auto & flowTAZ : viewNet->getNet ()->getAttributeCarriers ()->getDemandElements ().at (stopTag)) {
584
- ACsToLocate. push_back ( flowTAZ.second ) ;
584
+ ACsToLocate[flowTAZ. second -> getID ()] = flowTAZ.second ;
585
585
}
586
586
}
587
587
break ;
@@ -592,7 +592,7 @@ GNEViewParent::onCmdLocate(FXObject*, FXSelector sel, void*) {
592
592
// fill ACsToLocate with junctions that haven TLS
593
593
for (const auto & junction : viewNet->getNet ()->getAttributeCarriers ()->getJunctions ()) {
594
594
if (junction.second ->getNBNode ()->getControllingTLS ().size () > 0 ) {
595
- ACsToLocate. push_back ( junction.second ) ;
595
+ ACsToLocate[junction. second -> getID ()] = junction.second ;
596
596
}
597
597
}
598
598
break ;
@@ -604,7 +604,7 @@ GNEViewParent::onCmdLocate(FXObject*, FXSelector sel, void*) {
604
604
// avoid shapes and TAZs
605
605
if (!tagProperty->isShapeElement () && !tagProperty->isTAZElement ()) {
606
606
for (const auto & additional : additionalTag.second ) {
607
- ACsToLocate. push_back ( additional.second ) ;
607
+ ACsToLocate[additional. second -> getID ()] = additional.second ;
608
608
}
609
609
}
610
610
}
@@ -614,8 +614,8 @@ GNEViewParent::onCmdLocate(FXObject*, FXSelector sel, void*) {
614
614
locateTitle = TL (" POI Chooser" );
615
615
// fill ACsToLocate with all POIs
616
616
for (const auto & POITag : NamespaceIDs::POIs) {
617
- for (const auto & flowTAZ : viewNet->getNet ()->getAttributeCarriers ()->getAdditionals ().at (POITag)) {
618
- ACsToLocate. push_back (flowTAZ .second ) ;
617
+ for (const auto & poi : viewNet->getNet ()->getAttributeCarriers ()->getAdditionals ().at (POITag)) {
618
+ ACsToLocate[poi. second -> getID ()] = poi .second ;
619
619
}
620
620
}
621
621
break ;
@@ -624,8 +624,8 @@ GNEViewParent::onCmdLocate(FXObject*, FXSelector sel, void*) {
624
624
locateTitle = TL (" Poly Chooser" );
625
625
// fill ACsToLocate with all polygons
626
626
for (const auto & polygonTag : NamespaceIDs::polygons) {
627
- for (const auto & flowTAZ : viewNet->getNet ()->getAttributeCarriers ()->getAdditionals ().at (polygonTag)) {
628
- ACsToLocate. push_back (flowTAZ .second ) ;
627
+ for (const auto & polygon : viewNet->getNet ()->getAttributeCarriers ()->getAdditionals ().at (polygonTag)) {
628
+ ACsToLocate[polygon. second -> getID ()] = polygon .second ;
629
629
}
630
630
}
631
631
break ;
0 commit comments