80 mySelectorFrameParent(selectorFrameParent) {
94 const auto ACs = mySelectorFrameParent->getViewNet()->getNet()->getAttributeCarriers();
96 if (mySelectorFrameParent->getViewNet()->getEditModes().isCurrentSupermodeNetwork()) {
97 updateInformationLabel(
TL(
"Junctions"), ACs->getNumberOfSelectedJunctions());
98 updateInformationLabel(
TL(
"Edges"), ACs->getNumberOfSelectedEdges());
99 updateInformationLabel(
TL(
"Lanes"), ACs->getNumberOfSelectedLanes());
100 updateInformationLabel(
TL(
"Connections"), ACs->getNumberOfSelectedConnections());
101 updateInformationLabel(
TL(
"Crossings"), ACs->getNumberOfSelectedCrossings());
102 updateInformationLabel(
TL(
"WalkingAreas"), ACs->getNumberOfSelectedWalkingAreas());
103 updateInformationLabel(
TL(
"Additionals"), ACs->getNumberOfSelectedPureAdditionals());
104 updateInformationLabel(
TL(
"Wires"), ACs->getNumberOfSelectedWires());
105 updateInformationLabel(
TL(
"TAZs"), ACs->getNumberOfSelectedTAZs());
106 updateInformationLabel(
TL(
"TAZSources"), ACs->getNumberOfSelectedTAZSources());
107 updateInformationLabel(
TL(
"TAZSinks"), ACs->getNumberOfSelectedTAZSinks());
108 updateInformationLabel(
TL(
"Polygons"), ACs->getNumberOfSelectedPolygons());
109 updateInformationLabel(
TL(
"POIs"), ACs->getNumberOfSelectedPOIs());
110 updateInformationLabel(
TL(
"JuPedSim elements"),
111 ACs->getNumberOfSelectedJpsWalkableAreas() +
112 ACs->getNumberOfSelectedJpsObstacles());
113 }
else if (mySelectorFrameParent->getViewNet()->getEditModes().isCurrentSupermodeDemand()) {
114 updateInformationLabel(
TL(
"Routes"), ACs->getNumberOfSelectedRoutes());
115 updateInformationLabel(
TL(
"Vehicles"), ACs->getNumberOfSelectedVehicles());
116 updateInformationLabel(
TL(
"Persons"), ACs->getNumberOfSelectedPersons());
117 updateInformationLabel(
TL(
"Person trips"), ACs->getNumberOfSelectedPersonTrips());
118 updateInformationLabel(
TL(
"Walks"), ACs->getNumberOfSelectedWalks());
119 updateInformationLabel(
TL(
"Rides"), ACs->getNumberOfSelectedRides());
120 updateInformationLabel(
TL(
"Containers"), ACs->getNumberOfSelectedContainers());
121 updateInformationLabel(
TL(
"Transport"), ACs->getNumberOfSelectedTransport());
122 updateInformationLabel(
TL(
"Tranships"), ACs->getNumberOfSelectedTranships());
123 updateInformationLabel(
TL(
"Stops"), ACs->getNumberOfSelectedStops());
124 }
else if (mySelectorFrameParent->getViewNet()->getEditModes().isCurrentSupermodeData()) {
125 updateInformationLabel(
TL(
"EdgeDatas"), ACs->getNumberOfSelectedEdgeDatas());
126 updateInformationLabel(
TL(
"EdgeRelDatas"), ACs->getNumberOfSelectedEdgeRelDatas());
127 updateInformationLabel(
TL(
"EdgeTAZRel"), ACs->getNumberOfSelectedEdgeTAZRel());
131 if (numberLines == 0) {
133 }
else if (numberLines > 1) {
174 return myModificationModeType;
180 if (obj == myAddRadioButton) {
181 myModificationModeType = Operation::ADD;
182 myAddRadioButton->setCheck(
true);
183 myRemoveRadioButton->setCheck(
false);
184 myKeepRadioButton->setCheck(
false);
185 myReplaceRadioButton->setCheck(
false);
187 }
else if (obj == myRemoveRadioButton) {
188 myModificationModeType = Operation::SUB;
189 myAddRadioButton->setCheck(
false);
190 myRemoveRadioButton->setCheck(
true);
191 myKeepRadioButton->setCheck(
false);
192 myReplaceRadioButton->setCheck(
false);
194 }
else if (obj == myKeepRadioButton) {
195 myModificationModeType = Operation::RESTRICT;
196 myAddRadioButton->setCheck(
false);
197 myRemoveRadioButton->setCheck(
false);
198 myKeepRadioButton->setCheck(
true);
199 myReplaceRadioButton->setCheck(
false);
201 }
else if (obj == myReplaceRadioButton) {
202 myModificationModeType = Operation::REPLACE;
203 myAddRadioButton->setCheck(
false);
204 myRemoveRadioButton->setCheck(
false);
205 myKeepRadioButton->setCheck(
false);
206 myReplaceRadioButton->setCheck(
true);
219 mySelectorFrameParent(selectorFrameParent) {
237 mySelectorFrameParent->myViewNet->setSelectorFrameScale(mySelectionScaling->getValue());
238 mySelectorFrameParent->myViewNet->updateViewNet();
248 mySelectorFrameParent(selectorFrameParent) {
252 FXVerticalFrame* col1 =
new FXVerticalFrame(selectionButtons, LAYOUT_FILL_X, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
253 FXVerticalFrame* col2 =
new FXVerticalFrame(selectionButtons, LAYOUT_FILL_X, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
275 std::vector<GNEAttributeCarrier*> loadedACs;
276 std::ifstream strm(file.c_str());
282 std::map<const std::string, GNEAttributeCarrier*> GLFUllNameAC;
284 for (
const auto& GLObject : GLObjects) {
293 while (strm.good()) {
297 if (line.length() != 0) {
309 loadedACs.push_back(AC);
315 if (loadedACs.size() > 0) {
317 mySelectorFrameParent->handleIDs(loadedACs);
318 mySelectorFrameParent->myViewNet->getUndoList()->end();
327 FXFileDialog opendialog(getCollapsableFrame(),
TL(
"Open List of Selected Items"));
329 opendialog.setSelectMode(SELECTFILE_EXISTING);
330 opendialog.setPatternList(
"Selection files (*.txt)\nAll files (*)");
334 if (opendialog.execute()) {
336 loadFromFile(opendialog.getFilename().text());
345 TL(
"Save List of selected Items"),
".txt",
353 const auto selectedACs = mySelectorFrameParent->myViewNet->getNet()->getAttributeCarriers()->getSelectedAttributeCarriers(
false);
354 for (
const auto& selectedAC : selectedACs) {
363 WRITE_DEBUG(
"Opening FXMessageBox 'error storing selection'");
365 FXMessageBox::error(getCollapsableFrame(), MBOX_OK,
"Storing Selection failed",
"%s", e.what());
367 WRITE_DEBUG(
"Closed FXMessageBox 'error storing selection' with 'OK'");
375 const auto& editModes = mySelectorFrameParent->myViewNet->getEditModes();
376 GNEUndoList* undoList = mySelectorFrameParent->myViewNet->getUndoList();
379 editModes.isCurrentSupermodeNetwork() ? processMassiveNetworkElementSelection(
false) :
380 editModes.isCurrentSupermodeDemand() ? processMassiveDemandElementSelection() :
381 processMassiveDataElementSelection();
385 bool askedContinueIfLock =
false;
386 bool addLockedElements =
false;
387 bool unlockedElements =
false;
388 for (
const auto& ACToUnselect : massiveSelection.
ACsToUnselect) {
389 if (ACToUnselect.second ==
false) {
391 unlockedElements =
true;
392 }
else if (!askedContinueIfLock) {
393 addLockedElements = askContinueIfLock();
395 askedContinueIfLock =
true;
398 if (unlockedElements || addLockedElements) {
400 for (
const auto& ACToUnselect : massiveSelection.
ACsToUnselect) {
401 if (addLockedElements || !ACToUnselect.second) {
405 mySelectorFrameParent->myViewNet->getUndoList()->end();
414 mySelectorFrameParent->getViewNet()->hotkeyDel();
421 const auto& editModes = mySelectorFrameParent->myViewNet->getEditModes();
422 GNEUndoList* undoList = mySelectorFrameParent->myViewNet->getUndoList();
425 editModes.isCurrentSupermodeNetwork() ? processMassiveNetworkElementSelection(
true) :
426 editModes.isCurrentSupermodeDemand() ? processMassiveDemandElementSelection() :
427 processMassiveDataElementSelection();
431 bool askedContinueIfLock =
false;
432 bool addLockedElements =
false;
433 bool unlockedElements =
false;
434 for (
const auto& ACToSelect : massiveSelection.
ACsToSelect) {
435 if (ACToSelect.second ==
false) {
437 unlockedElements =
true;
438 }
else if (!askedContinueIfLock) {
439 addLockedElements = askContinueIfLock();
441 askedContinueIfLock =
true;
444 for (
const auto& ACToUnselect : massiveSelection.
ACsToUnselect) {
445 if (ACToUnselect.second ==
false) {
447 unlockedElements =
true;
448 }
else if (!askedContinueIfLock) {
449 addLockedElements = askContinueIfLock();
451 askedContinueIfLock =
true;
454 if (unlockedElements || addLockedElements) {
456 for (
const auto& ACToSelect : massiveSelection.
ACsToSelect) {
457 if (addLockedElements || !ACToSelect.second) {
461 for (
const auto& ACToUnselect : massiveSelection.
ACsToUnselect) {
462 if (addLockedElements || !ACToUnselect.second) {
466 mySelectorFrameParent->myViewNet->getUndoList()->end();
478 onCmdInvert(0, 0, 0);
479 onCmdDelete(0, 0, 0);
481 mySelectorFrameParent->getViewNet()->getUndoList()->end();
488 const auto& ACs = mySelectorFrameParent->myViewNet->getNet()->getAttributeCarriers();
489 const bool selectEdges = mySelectorFrameParent->getViewNet()->getNetworkViewOptions().selectEdges();
491 std::unordered_set<GNEAttributeCarrier*> networkACs;
493 for (
const auto& junction : ACs->getJunctions()) {
494 networkACs.insert(junction.second);
496 for (
const auto& incomingEdge : junction.second->getGNEIncomingEdges()) {
497 if (!filterLanes || selectEdges) {
498 networkACs.insert(incomingEdge);
501 if (!filterLanes || !selectEdges) {
502 for (
const auto& lane : incomingEdge->getLanes()) {
503 networkACs.insert(lane);
507 for (
const auto& connection : incomingEdge->getGNEConnections()) {
508 networkACs.insert(connection);
512 for (
const auto& crossing : junction.second->getGNECrossings()) {
513 networkACs.insert(crossing);
516 for (
const auto& walkingArea : junction.second->getGNEWalkingAreas()) {
517 networkACs.insert(walkingArea);
521 for (
const auto& additionalTags : ACs->getAdditionals()) {
522 for (
const auto& additional : additionalTags.second) {
523 if (additional.second->getTagProperty().isSelectable()) {
524 networkACs.insert(additional.second);
531 for (
const auto& networkAC : networkACs) {
532 const auto networkACObjectType = networkAC->getGUIGlObject()->getType();
535 massiveSelection.
lockedTypes[networkACObjectType] = networkAC->getGUIGlObject()->isGLObjectLocked();
538 if (networkAC->isAttributeCarrierSelected()) {
544 return massiveSelection;
550 const auto& ACs = mySelectorFrameParent->myViewNet->getNet()->getAttributeCarriers();
554 for (
const auto& demandElementTag : ACs->getDemandElements()) {
555 for (
const auto& demandElement : demandElementTag.second) {
556 if (demandElement.second->getTagProperty().isSelectable()) {
557 const auto networkACObjectType = demandElement.first->getType();
560 massiveSelection.
lockedTypes[networkACObjectType] = demandElement.first->isGLObjectLocked();
563 if (demandElement.second->isAttributeCarrierSelected()) {
566 massiveSelection.
ACsToSelect[demandElement.second] = massiveSelection.
lockedTypes.at(networkACObjectType);
571 return massiveSelection;
577 const auto& ACs = mySelectorFrameParent->myViewNet->getNet()->getAttributeCarriers();
581 for (
const auto& genericDataTag : mySelectorFrameParent->myViewNet->getNet()->getAttributeCarriers()->getGenericDatas()) {
582 for (
const auto& genericData : genericDataTag.second) {
583 if (genericData.second->getTagProperty().isSelectable()) {
584 const auto networkACObjectType = genericData.first->getType();
587 massiveSelection.
lockedTypes[networkACObjectType] = genericData.first->isGLObjectLocked();
590 if (genericData.second->isAttributeCarrierSelected()) {
598 return massiveSelection;
604 WRITE_DEBUG(
"Opening FXMessageBox 'confirm selection operation'");
606 const FXuint answer = FXMessageBox::question(mySelectorFrameParent->getViewNet()->getApp(),
607 MBOX_YES_NO,
"Confirm selection operation",
"There are locked elements in the current selection.\nApply operation to locked elements?");
611 WRITE_DEBUG(
"Closed FXMessageBox 'confirm selection operation' with 'No'");
612 }
else if (answer == 4) {
613 WRITE_DEBUG(
"Closed FXMessageBox 'confirm selection operation' with 'ESC'");
618 WRITE_DEBUG(
"Closed FXMessageBox 'confirm selection operation' with 'Yes'");
628 ACsToSelect.reserve(bucketSize);
629 ACsToUnselect.reserve(bucketSize);
637 return (ACsToSelect.size() + ACsToUnselect.size()) > 0;
649 mySelectorFrameParent(selectorFrameParent),
675 for (
const auto& item :
myItems) {
687 if (obj == myParentsComboBox) {
688 for (
const auto& item : myItems) {
689 if (item.second == myParentsComboBox->getText().text()) {
691 mySelectParentsButton->enable();
692 myUnselectParentsButton->enable();
694 myParentsComboBox->setTextColor(FXRGB(0, 0, 0));
696 myCurrentSelectedParent = item.first;
701 myCurrentSelectedParent = Selection::NOTHING;
703 mySelectParentsButton->disable();
704 myUnselectParentsButton->disable();
705 myParentsComboBox->setTextColor(FXRGB(255, 0, 0));
707 }
else if (obj == myChildrenComboBox) {
708 for (
const auto& item : myItems) {
709 if (item.second == myChildrenComboBox->getText().text()) {
711 mySelectChildrenButton->enable();
712 myUnselectChildrenButton->enable();
714 myChildrenComboBox->setTextColor(FXRGB(0, 0, 0));
716 myCurrentSelectedChild = item.first;
721 myCurrentSelectedChild = Selection::NOTHING;
723 mySelectChildrenButton->disable();
724 myUnselectChildrenButton->disable();
725 myChildrenComboBox->setTextColor(FXRGB(255, 0, 0));
735 const auto selectedACs = mySelectorFrameParent->getViewNet()->getNet()->getAttributeCarriers()->getSelectedAttributeCarriers(
true);
737 if ((selectedACs.size() > 0) && (myCurrentSelectedParent != Selection::NOTHING)) {
739 std::vector<GNEHierarchicalElement*> HEToSelect;
740 for (
const auto& selectedAC : selectedACs) {
742 const auto HE = selectedAC->getHierarchicalElement();
744 if ((myCurrentSelectedParent == Selection::ALL) || (myCurrentSelectedParent == Selection::JUNCTION)) {
745 HEToSelect.insert(HEToSelect.end(), HE->getParentJunctions().begin(), HE->getParentJunctions().end());
748 if ((myCurrentSelectedParent == Selection::ALL) || (myCurrentSelectedParent == Selection::EDGE)) {
749 if (selectedAC->getTagProperty().getTag() ==
SUMO_TAG_LANE) {
753 HEToSelect.insert(HEToSelect.end(), HE->getParentEdges().begin(), HE->getParentEdges().end());
757 if ((myCurrentSelectedParent == Selection::ALL) || (myCurrentSelectedParent == Selection::LANE)) {
758 HEToSelect.insert(HEToSelect.end(), HE->getParentLanes().begin(), HE->getParentLanes().end());
761 if ((myCurrentSelectedParent == Selection::ALL) || (myCurrentSelectedParent == Selection::ADDITIONAL)) {
762 HEToSelect.insert(HEToSelect.end(), HE->getParentAdditionals().begin(), HE->getParentAdditionals().end());
765 if ((myCurrentSelectedParent == Selection::ALL) || (myCurrentSelectedParent == Selection::WIRE)) {
766 HEToSelect.insert(HEToSelect.end(), HE->getParentAdditionals().begin(), HE->getParentAdditionals().end());
769 if ((myCurrentSelectedParent == Selection::ALL) || (myCurrentSelectedParent == Selection::DEMAND)) {
770 HEToSelect.insert(HEToSelect.end(), HE->getParentDemandElements().begin(), HE->getParentDemandElements().end());
773 if ((myCurrentSelectedParent == Selection::ALL) || (myCurrentSelectedParent == Selection::DATA)) {
774 HEToSelect.insert(HEToSelect.end(), HE->getParentGenericDatas().begin(), HE->getParentGenericDatas().end());
778 if (HEToSelect.size() > 0) {
779 if (HEToSelect.size() > 1) {
780 mySelectorFrameParent->getViewNet()->getUndoList()->begin(
GUIIcon::SELECT,
TL(
"select parents"));
782 for (
const auto& HE : HEToSelect) {
783 if (obj == mySelectParentsButton) {
784 HE->setAttribute(
GNE_ATTR_SELECTED,
"true", mySelectorFrameParent->getViewNet()->getUndoList());
786 HE->setAttribute(
GNE_ATTR_SELECTED,
"false", mySelectorFrameParent->getViewNet()->getUndoList());
789 if (HEToSelect.size() > 1) {
790 mySelectorFrameParent->getViewNet()->getUndoList()->end();
794 mySelectorFrameParent->mySelectionInformation->updateInformationLabel();
796 mySelectorFrameParent->getViewNet()->update();
805 const auto selectedACs = mySelectorFrameParent->getViewNet()->getNet()->getAttributeCarriers()->getSelectedAttributeCarriers(
true);
807 if ((selectedACs.size() > 0) && (myCurrentSelectedChild != Selection::NOTHING)) {
809 std::vector<GNEHierarchicalElement*> HEToSelect;
810 for (
const auto& selectedAC : selectedACs) {
812 const auto HE = selectedAC->getHierarchicalElement();
814 if ((myCurrentSelectedChild == Selection::ALL) || (myCurrentSelectedChild == Selection::JUNCTION)) {
817 const auto junction =
dynamic_cast<GNEJunction*
>(selectedAC);
819 HEToSelect.insert(HEToSelect.end(), junction->getGNEIncomingEdges().begin(), junction->getGNEIncomingEdges().end());
820 HEToSelect.insert(HEToSelect.end(), junction->getGNEOutgoingEdges().begin(), junction->getGNEOutgoingEdges().end());
822 HEToSelect.insert(HEToSelect.end(), HE->getChildJunctions().begin(), HE->getChildJunctions().end());
826 if ((myCurrentSelectedChild == Selection::ALL) || (myCurrentSelectedChild == Selection::EDGE)) {
827 if (selectedAC->getTagProperty().getTag() ==
SUMO_TAG_EDGE) {
829 const auto edge =
dynamic_cast<GNEEdge*
>(selectedAC);
831 HEToSelect.insert(HEToSelect.end(), edge->getLanes().begin(), edge->getLanes().end());
833 HEToSelect.insert(HEToSelect.end(), HE->getChildEdges().begin(), HE->getChildEdges().end());
837 if ((myCurrentSelectedChild == Selection::ALL) || (myCurrentSelectedChild == Selection::CONNECTION)) {
838 if (selectedAC->getTagProperty().getTag() ==
SUMO_TAG_EDGE) {
840 const auto edge =
dynamic_cast<GNEEdge*
>(selectedAC);
842 HEToSelect.insert(HEToSelect.end(), edge->getGNEConnections().begin(), edge->getGNEConnections().end());
843 }
else if (selectedAC->getTagProperty().getTag() ==
SUMO_TAG_LANE) {
845 const auto lane =
dynamic_cast<GNELane*
>(selectedAC);
847 for (
const auto& connection : lane->getParentEdge()->getGNEConnections()) {
849 HEToSelect.push_back(connection);
854 const auto junction =
dynamic_cast<GNEJunction*
>(selectedAC);
858 HEToSelect.insert(HEToSelect.end(), connections.begin(), connections.end());
862 if ((myCurrentSelectedChild == Selection::ALL) || (myCurrentSelectedChild == Selection::CROSSING)) {
865 const auto junction =
dynamic_cast<GNEJunction*
>(selectedAC);
867 HEToSelect.insert(HEToSelect.end(), junction->getGNECrossings().begin(), junction->getGNECrossings().end());
871 if ((myCurrentSelectedChild == Selection::ALL) || (myCurrentSelectedChild == Selection::LANE)) {
872 HEToSelect.insert(HEToSelect.end(), HE->getChildLanes().begin(), HE->getChildLanes().end());
875 if ((myCurrentSelectedChild == Selection::ALL) || (myCurrentSelectedChild == Selection::ADDITIONAL)) {
877 for (
const auto& additionalChild : HE->getChildAdditionals()) {
878 if (!additionalChild->getTagProperty().isWireElement() && !additionalChild->getTagProperty().isSymbol()) {
879 HEToSelect.push_back(additionalChild);
884 if ((myCurrentSelectedChild == Selection::ALL) || (myCurrentSelectedChild == Selection::WIRE)) {
886 for (
const auto& wireChild : HE->getChildAdditionals()) {
887 if (wireChild->getTagProperty().isWireElement() && !wireChild->getTagProperty().isSymbol()) {
888 HEToSelect.push_back(wireChild);
893 if ((myCurrentSelectedChild == Selection::ALL) || (myCurrentSelectedChild == Selection::DEMAND)) {
894 HEToSelect.insert(HEToSelect.end(), HE->getChildDemandElements().begin(), HE->getChildDemandElements().end());
897 if ((myCurrentSelectedChild == Selection::ALL) || (myCurrentSelectedChild == Selection::DATA)) {
898 HEToSelect.insert(HEToSelect.end(), HE->getChildGenericDatas().begin(), HE->getChildGenericDatas().end());
902 if (HEToSelect.size() > 0) {
903 if (HEToSelect.size() > 1) {
904 mySelectorFrameParent->getViewNet()->getUndoList()->begin(
GUIIcon::SELECT,
TL(
"select children"));
906 for (
const auto& HE : HEToSelect) {
907 if (obj == mySelectChildrenButton) {
910 HE->setAttribute(
GNE_ATTR_SELECTED,
"false", mySelectorFrameParent->getViewNet()->getUndoList());
913 if (HEToSelect.size() > 1) {
914 mySelectorFrameParent->getViewNet()->getUndoList()->end();
918 mySelectorFrameParent->mySelectionInformation->updateInformationLabel();
920 mySelectorFrameParent->getViewNet()->update();
943 GNEFrame(viewParent, viewNet,
TL(
"Selection")) {
1017 if (AC ==
nullptr) {
1025 if ((AC->getTagProperty().isNetworkElement() || AC->getTagProperty().isAdditionalElement()) &&
1038 if (filteredGLObjects.size() > 1) {
1042 if (AC->isAttributeCarrierSelected()) {
1043 AC->unselectAttributeCarrier();
1045 AC->selectAttributeCarrier();
1059 std::set<std::pair<std::string, GNEAttributeCarrier*> > ACsToSelect, ACsToUnselect;
1065 for (
const auto& selectedAC : selectedACs) {
1066 ACsToUnselect.insert(std::make_pair(selectedAC->getID(), selectedAC));
1070 for (
const auto& AC : ACs) {
1072 switch (setOperation) {
1074 ACsToUnselect.insert(std::make_pair(AC->getID(), AC));
1077 if (ACsToUnselect.find(std::make_pair(AC->getID(), AC)) != ACsToUnselect.end()) {
1078 ACsToSelect.insert(std::make_pair(AC->getID(), AC));
1082 ACsToSelect.insert(std::make_pair(AC->getID(), AC));
1088 std::set<GNEEdge*> edgesToSelect;
1090 for (
const auto& AC : ACsToSelect) {
1091 if (AC.second->getTagProperty().getTag() ==
SUMO_TAG_EDGE) {
1096 for (
const auto& edgeToSelect : edgesToSelect) {
1098 ACsToSelect.insert(std::make_pair(edgeToSelect->getFromJunction()->getID(), edgeToSelect->getFromJunction()));
1099 for (
const auto& connectionToSelect : edgeToSelect->getFromJunction()->getGNEConnections()) {
1100 ACsToSelect.insert(std::make_pair(connectionToSelect->getID(), connectionToSelect));
1102 for (
const auto& fromCrossingToSelect : edgeToSelect->getFromJunction()->getGNECrossings()) {
1103 ACsToSelect.insert(std::make_pair(fromCrossingToSelect->getID(), fromCrossingToSelect));
1105 for (
const auto& fromWalkingAreaToSelect : edgeToSelect->getFromJunction()->getGNEWalkingAreas()) {
1106 ACsToSelect.insert(std::make_pair(fromWalkingAreaToSelect->getID(), fromWalkingAreaToSelect));
1109 ACsToSelect.insert(std::make_pair(edgeToSelect->getToJunction()->getID(), edgeToSelect->getToJunction()));
1110 for (
const auto& connectionToSelect : edgeToSelect->getToJunction()->getGNEConnections()) {
1111 ACsToSelect.insert(std::make_pair(connectionToSelect->getID(), connectionToSelect));
1113 for (
const auto& toCrossingToSelect : edgeToSelect->getToJunction()->getGNECrossings()) {
1114 ACsToSelect.insert(std::make_pair(toCrossingToSelect->getID(), toCrossingToSelect));
1116 for (
const auto& toWalkingAreaToSelect : edgeToSelect->getToJunction()->getGNEWalkingAreas()) {
1117 ACsToSelect.insert(std::make_pair(toWalkingAreaToSelect->getID(), toWalkingAreaToSelect));
1122 if ((ACsToSelect.size() + ACsToUnselect.size()) > 0) {
1125 for (
const auto& ACToUnselect : ACsToUnselect) {
1126 if (ACToUnselect.second->getTagProperty().isSelectable()) {
1130 for (
const auto& ACToSelect : ACsToSelect) {
1131 if (ACToSelect.second->getTagProperty().isSelectable()) {
1141std::vector<GNEAttributeCarrier*>
1143 std::vector<GNEAttributeCarrier*> result;
1149 for (
const auto& AC : allACbyTag) {
1150 if (expr ==
"" && compOp ==
'@') {
1151 result.push_back(AC);
1152 }
else if (tagValue.hasAttribute(ACAttr) && tagValue.getAttributeProperties(ACAttr).isNumerical()) {
1154 std::istringstream buf(AC->getAttribute(ACAttr));
1159 result.push_back(AC);
1164 result.push_back(AC);
1169 result.push_back(AC);
1175 std::string acVal = AC->getAttributeForSelection(ACAttr);
1178 if (acVal.find(expr) != std::string::npos) {
1179 result.push_back(AC);
1183 if (acVal.find(expr) == std::string::npos) {
1184 result.push_back(AC);
1188 if (acVal == expr) {
1189 result.push_back(AC);
1193 if (acVal != expr) {
1194 result.push_back(AC);
1204std::vector<GNEAttributeCarrier*>
1206 std::vector<GNEAttributeCarrier*> result;
1208 for (
const auto& genericData : genericDatas) {
1209 if (expr ==
"" && compOp ==
'@') {
1210 result.push_back(genericData);
1213 std::istringstream buf(genericData->getParameter(attr,
"0"));
1218 result.push_back(genericData);
1223 result.push_back(genericData);
1228 result.push_back(genericData);
1234 std::string acVal = genericData->getAttributeForSelection(
GNE_ATTR_PARENT);
1237 if (acVal.find(expr) != std::string::npos) {
1238 result.push_back(genericData);
1242 if (acVal.find(expr) == std::string::npos) {
1243 result.push_back(genericData);
1247 if (acVal == expr) {
1248 result.push_back(genericData);
1252 if (acVal != expr) {
1253 result.push_back(genericData);
FXDEFMAP(GNESelectorFrame::ModificationMode) ModificationModeMap[]
@ NETWORK
Network mode (Edges, junctions, etc..)
@ DATA
Data mode (edgeData, LaneData etc..)
@ DEMAND
Demand mode (Routes, Vehicles etc..)
@ MID_GNE_SELECTORFRAME_SELECTSCALE
changes the visual scaling of selected items
@ MID_GNE_SELECTORFRAME_CHILDREN
select/unselect children
@ MID_CHOOSEN_SAVE
Save set.
@ MID_CHOOSEN_INVERT
Deselect selected items.
@ MID_CHOOSEN_DELETE
delete set
@ MID_CHOOSEN_OPERATION
set type of selection
@ MID_CHOOSEN_LOAD
Load set.
@ MID_CHOOSEN_REDUCE
simplify network reduction
@ MID_CHOOSEN_CLEAR
Clear set.
@ MID_GNE_SELECT
select element
@ MID_GNE_SELECTORFRAME_PARENTS
select/unselect parents
#define GUIDesignSpinDial
#define GUIDesignComboBox
#define GUIDesignComboBoxNCol
number of column of every combo box
#define GUIDesignAuxiliarHorizontalFrame
design for auxiliar (Without borders) horizontal frame used to pack another frames
#define GUIDesignComboBoxVisibleItemsMedium
combo box medium small
#define GUIDesignLabelThick(justify)
label extended over frame with thick and with text justify to left
#define GUIDesignRadioButton
#define GUIDesignLabelFrameInformation
label extended over frame without thick and with text justify to left, used to show information in fr...
FXString gCurrentFolder
The folder used as last.
#define WRITE_ERRORF(...)
SumoXMLTag
Numbers representing SUMO-XML - element names.
@ SUMO_TAG_VEHICLE
description of a vehicle
@ SUMO_TAG_JUNCTION
begin/end of the description of a junction
@ SUMO_TAG_LANE
begin/end of the description of a single lane
@ SUMO_TAG_EDGE
begin/end of the description of an edge
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
@ GNE_ATTR_PARENT
parent of an additional element
@ GNE_ATTR_SELECTED
element is selected
@ GNE_ATTR_PARAMETERS
parameters "key1=value1|key2=value2|...|keyN=valueN"
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
const std::string getID() const
get ID (all Attribute Carriers have one)
const GNETagProperties & getTagProperty() const
get tagProperty associated with this Attribute Carrier
bool isTemplate() const
check if this AC is template
virtual GUIGlObject * getGUIGlObject()=0
A road/street connecting two junctions (netedit-version)
void hideElementSet()
hide element set
void showElementSet()
show element set
GNEViewNet * myViewNet
FOX need this.
FXVerticalFrame * myContentFrame
Vertical frame that holds all widgets of frame.
virtual void show()
show Frame
virtual void hide()
hide Frame
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
std::vector< GNEConnection * > getGNEConnections() const
Returns all GNEConnections vinculated with this junction.
This lane is powered by an underlying GNEEdge and basically knows how to draw itself.
GNEEdge * getParentEdge() const
get parent edge
std::vector< GNEAttributeCarrier * > retrieveAttributeCarriers(SumoXMLTag tag=SUMO_TAG_NOTHING)
get the attribute carriers based on Type
GNEEdge * retrieveEdge(const std::string &id, bool hardFail=true) const
get edge by id
std::vector< GNEAttributeCarrier * > getSelectedAttributeCarriers(const bool ignoreCurrentSupermode)
get all selected attribute carriers (or only relative to current supermode
GNENetHelper::AttributeCarriers * getAttributeCarriers() const
get all attribute carriers used in this net
FXRadioButton * myReplaceRadioButton
replace radio button
Operation
FOX-declaration.
ModificationMode(GNESelectorFrame *selectorFrameParent)
constructor
long onCmdSelectModificationMode(FXObject *, FXSelector, void *)
FXRadioButton * myAddRadioButton
FOX need this.
~ModificationMode()
destructor
Operation getModificationMode() const
get current modification mode
FXRadioButton * myRemoveRadioButton
remove radio button
FXRadioButton * myKeepRadioButton
keep button
SelectionHierarchy(GNESelectorFrame *selectorFrameParent)
FOX-declaration.
MFXComboBoxIcon * myChildrenComboBox
comboBox for children
~SelectionHierarchy()
destructor
FXButton * myUnselectParentsButton
unselect parents button
FXButton * mySelectParentsButton
select parents button
FXButton * myUnselectChildrenButton
unselect parents button
long onCmdParents(FXObject *obj, FXSelector, void *)
called when user press select/unselect parents button
long onCmdChildren(FXObject *obj, FXSelector, void *)
called when user press select/unselect children button
long onCmdSelectItem(FXObject *obj, FXSelector, void *)
called when user select an item in comboBox
MFXComboBoxIcon * myParentsComboBox
comboBox for parents
const std::vector< std::pair< Selection, std::string > > myItems
FXButton * mySelectChildrenButton
select children button
SelectionOperation(GNESelectorFrame *selectorFrameParent)
FOX-declaration.
long onCmdSave(FXObject *, FXSelector, void *)
Called when the user presses the Save-button.
MassiveSelection processMassiveNetworkElementSelection(const bool filterLanes) const
process massive network element selection
bool askContinueIfLock() const
ask if continue due locking
long onCmdDelete(FXObject *, FXSelector, void *)
Called when the user presses the delete-button.
long onCmdReduce(FXObject *, FXSelector, void *)
Called when the user presses the Reduce-button.
~SelectionOperation()
destructor
long onCmdInvert(FXObject *, FXSelector, void *)
Called when the user presses the Invert-button.
long onCmdClear(FXObject *, FXSelector, void *)
Called when the user presses the Clear-button.
long onCmdLoad(FXObject *, FXSelector, void *)
Called when the user presses the Load-button.
void loadFromFile(const std::string &file) const
load from file
MassiveSelection processMassiveDataElementSelection() const
process massive dataelement selection
MassiveSelection processMassiveDemandElementSelection() const
process massive demand element selection
~VisualScaling()
destructor
long onCmdScaleSelection(FXObject *, FXSelector, void *)
Called when the user changes visual scaling.
VisualScaling(GNESelectorFrame *selectorFrameParent)
FOX-declaration.
FXRealSpinner * mySelectionScaling
Spinner for selection scaling.
FXVerticalFrame * getContentFrame() const
get vertical frame that holds all widgets of frame
std::vector< GNEAttributeCarrier * > getMatches(const SumoXMLTag ACTag, const SumoXMLAttr ACAttr, const char compOp, const double val, const std::string &expr)
return ACs of the given type with matching attrs
void updateFrameAfterUndoRedo()
function called after undo/redo in the current frame
ModificationMode * getModificationModeModul() const
get modification mode modul
std::vector< GNEAttributeCarrier * > getGenericMatches(const std::vector< GNEGenericData * > &genericDatas, const std::string &attr, const char compOp, const double val, const std::string &expr)
return GenericDatas of the given type with matching attrs
GNESelectorFrame::SelectionOperation * mySelectionOperation
modul for selection operations
~GNESelectorFrame()
Destructor.
GNESelectorFrame::SelectionInformation * mySelectionInformation
modul for selection information
GNESelectorFrame::VisualScaling * myVisualScaling
modul for visual scaling
GNEElementSet * myDemandElementSet
moduls for select demand element set
GNESelectorFrame::Information * myInformation
information modul
GNESelectorFrame::SelectionHierarchy * mySelectionHierarchy
modul for selection hierarchy
GNEElementSet * myNetworkElementSet
moduls for select network element set
GNEElementSet * myDataElementSet
moduls for select data element set
GNESelectorFrame::ModificationMode * myModificationMode
modul for change modification mode
void clearCurrentSelection() const
clear current selection with possibility of undo/redo
GNESelectorFrame::SelectionOperation * getSelectionOperationModul() const
get selection operation modul
void handleIDs(const std::vector< GNEAttributeCarrier * > &ACs, const ModificationMode::Operation setop=ModificationMode::Operation::DEFAULT)
apply list of ids to the current selection according to Operation,
GNESelectorFrame(GNEViewParent *viewParent, GNEViewNet *viewNet)
Constructor.
SelectionInformation * getSelectionInformation() const
get modul for selection information
bool selectAttributeCarrier(const GNEViewNetHelper::ViewObjectsSelector &viewObjects)
select attribute carrier (element)
bool isDataElement() const
return true if tag correspond to a data element
bool isSelectable() const
return true if tag correspond to a selectable element
bool isDemandElement() const
return true if tag correspond to a demand element
void end()
End undo command sub-group. If the sub-group is still empty, it will be deleted; otherwise,...
void begin(GUIIcon icon, const std::string &description)
Begin undo command sub-group with current supermode. This begins a new group of commands that are tre...
bool isObjectLocked(GUIGlObjectType objectType, const bool selected) const
check if given GLObject is locked for inspect, select, delete and move
class used to group all variables related with objects under cursor after a click over view
GNEAttributeCarrier * getAttributeCarrierFront() const
get front attribute carrier or a pointer to nullptr
const std::vector< GUIGlObject * > & getGLObjects() const
get vector with GL objects
GNENet * getNet() const
get the net object
const GNEViewNetHelper::EditModes & getEditModes() const
get edit modes
void openSelectDialogAtCursor(const std::vector< GUIGlObject * > &GLObjects)
open select dialog at cursor
bool autoSelectNodes()
whether to autoselect nodes or to lanes
GNEUndoList * getUndoList() const
get the undoList object
GNEViewNetHelper::LockManager & getLockManager()
get lock manager
A single child window which contains a view of the simulation area.
static FXButton * buildFXButton(FXComposite *p, const std::string &text, const std::string &tip, const std::string &help, FXIcon *ic, FXObject *tgt, FXSelector sel, FXuint opts=BUTTON_NORMAL, FXint x=0, FXint y=0, FXint w=0, FXint h=0, FXint pl=DEFAULT_PAD, FXint pr=DEFAULT_PAD, FXint pt=DEFAULT_PAD, FXint pb=DEFAULT_PAD)
build button
static FXRadioButton * buildFXRadioButton(FXComposite *p, const std::string &text, const std::string &tip, const std::string &help, FXObject *tgt, FXSelector sel, FXuint opts=RADIOBUTTON_NORMAL, FXint x=0, FXint y=0, FXint w=0, FXint h=0, FXint pl=DEFAULT_PAD, FXint pr=DEFAULT_PAD, FXint pt=DEFAULT_PAD, FXint pb=DEFAULT_PAD)
build radio button
static StringBijection< GUIGlObjectType > TypeNames
associates object types with strings
GUIGlObjectType getType() const
Returns the type of the object as coded in GUIGlObjectType.
const std::vector< GUIGlObject * > & getAllGLObjects() const
Returns the set of all known objects.
static GUIGlObjectStorage gIDStorage
A single static instance of this class.
static FXIcon * getIcon(const GUIIcon which)
returns a icon previously defined in the enum GUIIcon
FXint appendIconItem(const FXString &text, FXIcon *icon=nullptr, FXColor bgColor=FXRGB(255, 255, 255), void *ptr=nullptr)
append icon item in the last position
A list item which allows for custom coloring.
MFXGroupBoxModule (based on FXGroupBox)
FXVerticalFrame * getCollapsableFrame()
get collapsable frame (used by all elements that will be collapsed if button is toggled)
void setText(const std::string &text)
set text
static FXString getFilename2Write(FXWindow *parent, const FXString &header, const FXString &extension, FXIcon *icon, FXString ¤tFolder)
Returns the file name to write.
Static storage of an output device and its base (abstract) implementation.
void close()
Closes the device and removes it from the dictionary.
static OutputDevice & getDevice(const std::string &name, bool usePrefix=true)
Returns the described OutputDevice.
const std::string & getString(const T key) const
static std::string replace(std::string str, const std::string &what, const std::string &by)
Replaces all occurrences of the second string by the third string within the first string.
static bool startsWith(const std::string &str, const std::string prefix)
Checks whether a given string starts with the prefix.
~MassiveSelection()
destructor
std::unordered_map< GNEAttributeCarrier *, bool > ACsToSelect
ACs to select (the bool flag shows if element is locked)
std::map< GUIGlObjectType, bool > lockedTypes
locked types
std::unordered_map< GNEAttributeCarrier *, bool > ACsToUnselect
ACs to select (the bool flag shows if element is locked)
bool isElementToProcess() const
check if there are element to process
MassiveSelection()
constructor (invalidated)
bool isCurrentSupermodeDemand() const
@check if current supermode is Demand
bool isCurrentSupermodeData() const
@check if current supermode is Data
bool isCurrentSupermodeNetwork() const
@check if current supermode is Network
static std::vector< GUIGlObject * > filterElementsByLayer(const std::vector< GUIGlObject * > &GLObjects)
filter elements based on the layer