83 mySelectorFrameParent(selectorFrameParent) {
97 const auto ACs = mySelectorFrameParent->getViewNet()->getNet()->getAttributeCarriers();
99 if (mySelectorFrameParent->getViewNet()->getEditModes().isCurrentSupermodeNetwork()) {
100 updateInformationLabel(
TL(
"Junctions"), ACs->getNumberOfSelectedJunctions());
101 updateInformationLabel(
TL(
"Edges"), ACs->getNumberOfSelectedEdges());
102 updateInformationLabel(
TL(
"Lanes"), ACs->getNumberOfSelectedLanes());
103 updateInformationLabel(
TL(
"Connections"), ACs->getNumberOfSelectedConnections());
104 updateInformationLabel(
TL(
"Crossings"), ACs->getNumberOfSelectedCrossings());
105 updateInformationLabel(
TL(
"WalkingAreas"), ACs->getNumberOfSelectedWalkingAreas());
106 updateInformationLabel(
TL(
"Additionals"), ACs->getNumberOfSelectedPureAdditionals());
107 updateInformationLabel(
TL(
"Wires"), ACs->getNumberOfSelectedWires());
108 updateInformationLabel(
TL(
"TAZs"), ACs->getNumberOfSelectedTAZs());
109 updateInformationLabel(
TL(
"Polygons"), ACs->getNumberOfSelectedPolygons());
110 updateInformationLabel(
TL(
"POIs"), ACs->getNumberOfSelectedPOIs());
111 updateInformationLabel(
TL(
"JuPedSim elements"),
112 ACs->getNumberOfSelectedJpsWalkableAreas() +
113 ACs->getNumberOfSelectedJpsObstacles());
114 }
else if (mySelectorFrameParent->getViewNet()->getEditModes().isCurrentSupermodeDemand()) {
115 updateInformationLabel(
TL(
"Routes"), ACs->getNumberOfSelectedRoutes());
116 updateInformationLabel(
TL(
"Vehicles"), ACs->getNumberOfSelectedVehicles());
117 updateInformationLabel(
TL(
"Persons"), ACs->getNumberOfSelectedPersons());
118 updateInformationLabel(
TL(
"Person trips"), ACs->getNumberOfSelectedPersonTrips());
119 updateInformationLabel(
TL(
"Walks"), ACs->getNumberOfSelectedWalks());
120 updateInformationLabel(
TL(
"Rides"), ACs->getNumberOfSelectedRides());
121 updateInformationLabel(
TL(
"Containers"), ACs->getNumberOfSelectedContainers());
122 updateInformationLabel(
TL(
"Transport"), ACs->getNumberOfSelectedTransport());
123 updateInformationLabel(
TL(
"Tranships"), ACs->getNumberOfSelectedTranships());
124 updateInformationLabel(
TL(
"Stops"), ACs->getNumberOfSelectedStops());
125 }
else if (mySelectorFrameParent->getViewNet()->getEditModes().isCurrentSupermodeData()) {
126 updateInformationLabel(
TL(
"EdgeDatas"), ACs->getNumberOfSelectedEdgeDatas());
127 updateInformationLabel(
TL(
"EdgeRelDatas"), ACs->getNumberOfSelectedEdgeRelDatas());
128 updateInformationLabel(
TL(
"EdgeTAZRel"), ACs->getNumberOfSelectedEdgeTAZRel());
132 if (numberLines == 0) {
134 }
else if (numberLines > 1) {
175 return myModificationModeType;
181 if (obj == myAddRadioButton) {
182 myModificationModeType = Operation::ADD;
183 myAddRadioButton->setCheck(
true);
184 myRemoveRadioButton->setCheck(
false);
185 myKeepRadioButton->setCheck(
false);
186 myReplaceRadioButton->setCheck(
false);
188 }
else if (obj == myRemoveRadioButton) {
189 myModificationModeType = Operation::SUB;
190 myAddRadioButton->setCheck(
false);
191 myRemoveRadioButton->setCheck(
true);
192 myKeepRadioButton->setCheck(
false);
193 myReplaceRadioButton->setCheck(
false);
195 }
else if (obj == myKeepRadioButton) {
196 myModificationModeType = Operation::RESTRICT;
197 myAddRadioButton->setCheck(
false);
198 myRemoveRadioButton->setCheck(
false);
199 myKeepRadioButton->setCheck(
true);
200 myReplaceRadioButton->setCheck(
false);
202 }
else if (obj == myReplaceRadioButton) {
203 myModificationModeType = Operation::REPLACE;
204 myAddRadioButton->setCheck(
false);
205 myRemoveRadioButton->setCheck(
false);
206 myKeepRadioButton->setCheck(
false);
207 myReplaceRadioButton->setCheck(
true);
220 mySelectorFrameParent(selectorFrameParent) {
238 mySelectorFrameParent->myViewNet->setSelectorFrameScale(mySelectionScaling->getValue());
239 mySelectorFrameParent->myViewNet->updateViewNet();
249 mySelectorFrameParent(selectorFrameParent) {
253 FXVerticalFrame* col1 =
new FXVerticalFrame(selectionButtons, LAYOUT_FILL_X, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
254 FXVerticalFrame* col2 =
new FXVerticalFrame(selectionButtons, LAYOUT_FILL_X, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
276 std::vector<GNEAttributeCarrier*> loadedACs;
277 std::ifstream strm(file.c_str());
283 std::map<const std::string, GNEAttributeCarrier*> GLFUllNameAC;
285 for (
const auto& GLObject : GLObjects) {
294 while (strm.good()) {
298 if (line.length() != 0) {
310 loadedACs.push_back(AC);
316 if (loadedACs.size() > 0) {
318 mySelectorFrameParent->handleIDs(loadedACs);
319 mySelectorFrameParent->myViewNet->getUndoList()->end();
328 FXFileDialog opendialog(getCollapsableFrame(),
TL(
"Open List of Selected Items"));
330 opendialog.setSelectMode(SELECTFILE_EXISTING);
335 if (opendialog.execute()) {
337 loadFromFile(opendialog.getFilename().text());
354 const auto selectedACs = mySelectorFrameParent->myViewNet->getNet()->getAttributeCarriers()->getSelectedAttributeCarriers(
false);
355 for (
const auto& selectedAC : selectedACs) {
364 GNEErrorBasicDialog(mySelectorFrameParent->getViewNet()->getViewParent()->getGNEAppWindows(),
365 TL(
"Storing Selection failed"), e.what());
373 const auto& editModes = mySelectorFrameParent->myViewNet->getEditModes();
374 GNEUndoList* undoList = mySelectorFrameParent->myViewNet->getUndoList();
377 editModes.isCurrentSupermodeNetwork() ? processMassiveNetworkElementSelection(
false) :
378 editModes.isCurrentSupermodeDemand() ? processMassiveDemandElementSelection() :
379 processMassiveDataElementSelection();
383 bool askedContinueIfLock =
false;
384 bool addLockedElements =
false;
385 bool unlockedElements =
false;
386 for (
const auto& ACToUnselect : massiveSelection.
ACsToUnselect) {
387 if (ACToUnselect.second ==
false) {
389 unlockedElements =
true;
390 }
else if (!askedContinueIfLock) {
391 addLockedElements = askContinueIfLock();
393 askedContinueIfLock =
true;
396 if (unlockedElements || addLockedElements) {
398 for (
const auto& ACToUnselect : massiveSelection.
ACsToUnselect) {
399 if (addLockedElements || !ACToUnselect.second) {
403 mySelectorFrameParent->myViewNet->getUndoList()->end();
406 mySelectorFrameParent->myViewNet->updateViewNet();
413 mySelectorFrameParent->getViewNet()->hotkeyDel();
420 const auto& editModes = mySelectorFrameParent->myViewNet->getEditModes();
421 GNEUndoList* undoList = mySelectorFrameParent->myViewNet->getUndoList();
424 editModes.isCurrentSupermodeNetwork() ? processMassiveNetworkElementSelection(
true) :
425 editModes.isCurrentSupermodeDemand() ? processMassiveDemandElementSelection() :
426 processMassiveDataElementSelection();
430 bool askedContinueIfLock =
false;
431 bool addLockedElements =
false;
432 bool unlockedElements =
false;
433 for (
const auto& ACToSelect : massiveSelection.
ACsToSelect) {
434 if (ACToSelect.second ==
false) {
436 unlockedElements =
true;
437 }
else if (!askedContinueIfLock) {
438 addLockedElements = askContinueIfLock();
440 askedContinueIfLock =
true;
443 for (
const auto& ACToUnselect : massiveSelection.
ACsToUnselect) {
444 if (ACToUnselect.second ==
false) {
446 unlockedElements =
true;
447 }
else if (!askedContinueIfLock) {
448 addLockedElements = askContinueIfLock();
450 askedContinueIfLock =
true;
453 if (unlockedElements || addLockedElements) {
455 for (
const auto& ACToSelect : massiveSelection.
ACsToSelect) {
456 if (addLockedElements || !ACToSelect.second) {
460 for (
const auto& ACToUnselect : massiveSelection.
ACsToUnselect) {
461 if (addLockedElements || !ACToUnselect.second) {
465 mySelectorFrameParent->myViewNet->getUndoList()->end();
477 if (mySelectorFrameParent->myViewNet->getEditModes().isCurrentSupermodeNetwork()) {
479 std::unordered_set<GNENetworkElement*> networkElementsToRemove;
480 std::unordered_set<GNENetworkElement*> edgesToKeep;
482 for (
const auto& junction : mySelectorFrameParent->myViewNet->getNet()->getAttributeCarriers()->getJunctions()) {
483 if (!junction.second->isAttributeCarrierSelected()) {
484 networkElementsToRemove.insert(junction.second);
487 for (
const auto& incomingEdge : junction.second->getGNEIncomingEdges()) {
488 if (!incomingEdge->isAttributeCarrierSelected()) {
489 networkElementsToRemove.insert(incomingEdge);
491 edgesToKeep.insert(incomingEdge);
496 for (
const auto& edge : edgesToKeep) {
497 for (
const auto& junctionParent : edge->getParentJunctions()) {
498 auto it = networkElementsToRemove.find(junctionParent);
499 if (it != networkElementsToRemove.end()) {
500 networkElementsToRemove.erase(it);
505 const auto shapeElementsToRemove = mySelectorFrameParent->myViewNet->getNet()->getAttributeCarriers()->getUnselectedShapes();
507 for (
const auto shapeElement : shapeElementsToRemove) {
508 mySelectorFrameParent->getViewNet()->getNet()->deleteAdditional(shapeElement, mySelectorFrameParent->getViewNet()->getUndoList());
510 for (
const auto networkElement : networkElementsToRemove) {
511 mySelectorFrameParent->getViewNet()->getNet()->deleteNetworkElement(networkElement, mySelectorFrameParent->getViewNet()->getUndoList());
514 onCmdInvert(0, 0, 0);
515 onCmdDelete(0, 0, 0);
518 mySelectorFrameParent->getViewNet()->getUndoList()->end();
525 const auto& ACs = mySelectorFrameParent->myViewNet->getNet()->getAttributeCarriers();
526 const bool selectEdges = mySelectorFrameParent->getViewNet()->getNetworkViewOptions().selectEdges();
528 std::unordered_set<GNEAttributeCarrier*> networkACs;
530 for (
const auto& junction : ACs->getJunctions()) {
531 networkACs.insert(junction.second);
533 for (
const auto& incomingEdge : junction.second->getGNEIncomingEdges()) {
534 if (!filterLanes || selectEdges) {
535 networkACs.insert(incomingEdge);
538 if (!filterLanes || !selectEdges) {
539 for (
const auto& lane : incomingEdge->getChildLanes()) {
540 networkACs.insert(lane);
544 for (
const auto& connection : incomingEdge->getGNEConnections()) {
545 networkACs.insert(connection);
549 for (
const auto& crossing : junction.second->getGNECrossings()) {
550 networkACs.insert(crossing);
553 for (
const auto& walkingArea : junction.second->getGNEWalkingAreas()) {
554 networkACs.insert(walkingArea);
558 for (
const auto& additionalTags : ACs->getAdditionals()) {
559 for (
const auto& additional : additionalTags.second) {
560 if (additional.second->getTagProperty()->isSelectable()) {
561 networkACs.insert(additional.second);
568 for (
const auto& networkAC : networkACs) {
569 const auto networkACObjectType = networkAC->getGUIGlObject()->getType();
572 massiveSelection.
lockedTypes[networkACObjectType] = networkAC->getGUIGlObject()->isGLObjectLocked();
575 if (networkAC->isAttributeCarrierSelected()) {
581 return massiveSelection;
587 const auto& ACs = mySelectorFrameParent->myViewNet->getNet()->getAttributeCarriers();
591 for (
const auto& demandElementTag : ACs->getDemandElements()) {
592 for (
const auto& demandElement : demandElementTag.second) {
593 if (demandElement.second->getTagProperty()->isSelectable()) {
594 const auto networkACObjectType = demandElement.first->getType();
597 massiveSelection.
lockedTypes[networkACObjectType] = demandElement.first->isGLObjectLocked();
600 if (demandElement.second->isAttributeCarrierSelected()) {
603 massiveSelection.
ACsToSelect[demandElement.second] = massiveSelection.
lockedTypes.at(networkACObjectType);
608 return massiveSelection;
614 const auto& ACs = mySelectorFrameParent->myViewNet->getNet()->getAttributeCarriers();
618 for (
const auto& genericDataTag : mySelectorFrameParent->myViewNet->getNet()->getAttributeCarriers()->getGenericDatas()) {
619 for (
const auto& genericData : genericDataTag.second) {
620 if (genericData.second->getTagProperty()->isSelectable()) {
621 const auto networkACObjectType = genericData.first->getType();
624 massiveSelection.
lockedTypes[networkACObjectType] = genericData.first->isGLObjectLocked();
627 if (genericData.second->isAttributeCarrierSelected()) {
635 return massiveSelection;
642 const GNEQuestionBasicDialog questionDialog(mySelectorFrameParent->getViewNet()->getViewParent()->getGNEAppWindows(),
644 TL(
"Confirm selection operation"),
645 TL(
"There are locked elements in the current selection."),
646 TL(
"Apply operation to locked elements?"));
656 ACsToSelect.reserve(bucketSize);
657 ACsToUnselect.reserve(bucketSize);
665 return (ACsToSelect.size() + ACsToUnselect.size()) > 0;
677 mySelectorFrameParent(selectorFrameParent),
704 for (
const auto& item :
myItems) {
716 if (obj == myParentsComboBox) {
717 for (
const auto& item : myItems) {
718 if (item.second == myParentsComboBox->getText().text()) {
720 mySelectParentsButton->enable();
721 myUnselectParentsButton->enable();
725 myCurrentSelectedParent = item.first;
730 myCurrentSelectedParent = Selection::NOTHING;
732 mySelectParentsButton->disable();
733 myUnselectParentsButton->disable();
736 }
else if (obj == myChildrenComboBox) {
737 for (
const auto& item : myItems) {
738 if (item.second == myChildrenComboBox->getText().text()) {
740 mySelectChildrenButton->enable();
741 myUnselectChildrenButton->enable();
745 myCurrentSelectedChild = item.first;
750 myCurrentSelectedChild = Selection::NOTHING;
752 mySelectChildrenButton->disable();
753 myUnselectChildrenButton->disable();
763 const auto viewNet = mySelectorFrameParent->getViewNet();
765 const auto selectedACs = viewNet->getNet()->getAttributeCarriers()->getSelectedAttributeCarriers(
true);
767 if ((selectedACs.size() > 0) && (myCurrentSelectedParent != Selection::NOTHING)) {
769 std::vector<GNEAttributeCarrier*> editedParents;
770 for (
const auto& selectedAC : selectedACs) {
772 const auto connection = viewNet->getNet()->getAttributeCarriers()->retrieveConnection(selectedAC->getGUIGlObject());
773 editedParents.push_back(connection->getLaneFrom());
774 editedParents.push_back(connection->getLaneTo());
776 const auto crossing = viewNet->getNet()->getAttributeCarriers()->retrieveCrossing(selectedAC->getGUIGlObject());
777 editedParents.push_back(crossing->getParentJunctions().front());
780 const auto hierarchicalElement = selectedAC->getHierarchicalElement();
782 if ((myCurrentSelectedParent == Selection::ALL) || (myCurrentSelectedParent == Selection::JUNCTION)) {
783 editedParents.insert(editedParents.end(), hierarchicalElement->getParentJunctions().begin(), hierarchicalElement->getParentJunctions().end());
786 if ((myCurrentSelectedParent == Selection::ALL) || (myCurrentSelectedParent == Selection::EDGE)) {
787 if (selectedAC->getTagProperty()->getTag() ==
SUMO_TAG_LANE) {
790 }
else if (selectedAC->getTagProperty()->getTag() ==
SUMO_TAG_TAZ) {
792 for (
const auto& tss : selectedAC->getHierarchicalElement()->getChildTAZSourceSinks()) {
793 editedParents.push_back(tss->getParentEdges().front());
796 editedParents.insert(editedParents.end(), hierarchicalElement->getParentEdges().begin(), hierarchicalElement->getParentEdges().end());
800 if ((myCurrentSelectedParent == Selection::ALL) || (myCurrentSelectedParent == Selection::LANE)) {
801 editedParents.insert(editedParents.end(), hierarchicalElement->getParentLanes().begin(), hierarchicalElement->getParentLanes().end());
804 if ((myCurrentSelectedParent == Selection::ALL) || (myCurrentSelectedParent == Selection::ADDITIONAL)) {
805 editedParents.insert(editedParents.end(), hierarchicalElement->getParentAdditionals().begin(), hierarchicalElement->getParentAdditionals().end());
808 if ((myCurrentSelectedParent == Selection::ALL) || (myCurrentSelectedParent == Selection::WIRE)) {
809 editedParents.insert(editedParents.end(), hierarchicalElement->getParentAdditionals().begin(), hierarchicalElement->getParentAdditionals().end());
812 if ((myCurrentSelectedParent == Selection::ALL) || (myCurrentSelectedParent == Selection::DEMAND)) {
813 editedParents.insert(editedParents.end(), hierarchicalElement->getParentDemandElements().begin(), hierarchicalElement->getParentDemandElements().end());
816 if ((myCurrentSelectedParent == Selection::ALL) || (myCurrentSelectedParent == Selection::DATA)) {
817 editedParents.insert(editedParents.end(), hierarchicalElement->getParentGenericDatas().begin(), hierarchicalElement->getParentGenericDatas().end());
822 if (editedParents.size() > 0) {
823 if (editedParents.size() > 1) {
826 for (
const auto& HE : editedParents) {
827 if (obj == mySelectParentsButton) {
833 if (editedParents.size() > 1) {
834 viewNet->getUndoList()->end();
838 mySelectorFrameParent->mySelectionInformation->updateInformationLabel();
849 const auto selectedACs = mySelectorFrameParent->getViewNet()->getNet()->getAttributeCarriers()->getSelectedAttributeCarriers(
true);
851 if ((selectedACs.size() > 0) && (myCurrentSelectedChild != Selection::NOTHING)) {
853 std::vector<GNEAttributeCarrier*> editedChildren;
854 for (
const auto& selectedAC : selectedACs) {
856 const auto hierarchicalElement = selectedAC->getHierarchicalElement();
858 if ((myCurrentSelectedChild == Selection::ALL) || (myCurrentSelectedChild == Selection::JUNCTION)) {
861 const auto junction =
dynamic_cast<GNEJunction*
>(selectedAC);
863 editedChildren.insert(editedChildren.end(), junction->getGNEIncomingEdges().begin(), junction->getGNEIncomingEdges().end());
864 editedChildren.insert(editedChildren.end(), junction->getGNEOutgoingEdges().begin(), junction->getGNEOutgoingEdges().end());
866 editedChildren.insert(editedChildren.end(), hierarchicalElement->getChildJunctions().begin(), hierarchicalElement->getChildJunctions().end());
870 if ((myCurrentSelectedChild == Selection::ALL) || (myCurrentSelectedChild == Selection::EDGE)) {
871 if (selectedAC->getTagProperty()->getTag() ==
SUMO_TAG_EDGE) {
873 const auto edge =
dynamic_cast<GNEEdge*
>(selectedAC);
875 editedChildren.insert(editedChildren.end(), edge->getChildLanes().begin(), edge->getChildLanes().end());
877 editedChildren.insert(editedChildren.end(), hierarchicalElement->getChildEdges().begin(), hierarchicalElement->getChildEdges().end());
881 if ((myCurrentSelectedChild == Selection::ALL) || (myCurrentSelectedChild == Selection::CONNECTION)) {
882 if (selectedAC->getTagProperty()->getTag() ==
SUMO_TAG_EDGE) {
884 const auto edge =
dynamic_cast<GNEEdge*
>(selectedAC);
886 editedChildren.insert(editedChildren.end(), edge->getGNEConnections().begin(), edge->getGNEConnections().end());
887 }
else if (selectedAC->getTagProperty()->getTag() ==
SUMO_TAG_LANE) {
889 const auto lane =
dynamic_cast<GNELane*
>(selectedAC);
891 for (
const auto& connection : lane->getParentEdge()->getGNEConnections()) {
893 editedChildren.push_back(connection);
898 const auto junction =
dynamic_cast<GNEJunction*
>(selectedAC);
902 editedChildren.insert(editedChildren.end(), connections.begin(), connections.end());
906 if ((myCurrentSelectedChild == Selection::ALL) || (myCurrentSelectedChild == Selection::CROSSING)) {
909 const auto junction =
dynamic_cast<GNEJunction*
>(selectedAC);
911 editedChildren.insert(editedChildren.end(), junction->getGNECrossings().begin(), junction->getGNECrossings().end());
915 if ((myCurrentSelectedChild == Selection::ALL) || (myCurrentSelectedChild == Selection::LANE)) {
916 editedChildren.insert(editedChildren.end(), hierarchicalElement->getChildLanes().begin(), hierarchicalElement->getChildLanes().end());
919 if ((myCurrentSelectedChild == Selection::ALL) || (myCurrentSelectedChild == Selection::ADDITIONAL)) {
921 for (
const auto& additionalChild : hierarchicalElement->getChildAdditionals()) {
922 if (!additionalChild->getTagProperty()->isWireElement() && !additionalChild->getTagProperty()->isSymbol()) {
923 editedChildren.push_back(additionalChild);
928 if ((myCurrentSelectedChild == Selection::ALL) || (myCurrentSelectedChild == Selection::WIRE)) {
930 for (
const auto& wireChild : hierarchicalElement->getChildAdditionals()) {
931 if (wireChild->getTagProperty()->isWireElement() && !wireChild->getTagProperty()->isSymbol()) {
932 editedChildren.push_back(wireChild);
937 if ((myCurrentSelectedChild == Selection::ALL) || (myCurrentSelectedChild == Selection::DEMAND)) {
938 editedChildren.insert(editedChildren.end(), hierarchicalElement->getChildDemandElements().begin(), hierarchicalElement->getChildDemandElements().end());
941 if ((myCurrentSelectedChild == Selection::ALL) || (myCurrentSelectedChild == Selection::DATA)) {
942 editedChildren.insert(editedChildren.end(), hierarchicalElement->getChildGenericDatas().begin(), hierarchicalElement->getChildGenericDatas().end());
946 if (editedChildren.size() > 0) {
947 if (editedChildren.size() > 1) {
948 mySelectorFrameParent->getViewNet()->getUndoList()->begin(
GUIIcon::SELECT,
TL(
"select children"));
950 for (
const auto& HE : editedChildren) {
951 if (obj == mySelectChildrenButton) {
954 HE->setAttribute(
GNE_ATTR_SELECTED,
"false", mySelectorFrameParent->getViewNet()->getUndoList());
957 if (editedChildren.size() > 1) {
958 mySelectorFrameParent->getViewNet()->getUndoList()->end();
962 mySelectorFrameParent->mySelectionInformation->updateInformationLabel();
964 mySelectorFrameParent->getViewNet()->update();
987 GNEFrame(viewParent, viewNet,
TL(
"Selection")) {
1043 if (AC ==
nullptr) {
1051 if ((AC->getTagProperty()->isNetworkElement() || AC->getTagProperty()->isAdditionalElement()) &&
1064 if (filteredGLObjects.size() > 1) {
1068 if (AC->isAttributeCarrierSelected()) {
1069 AC->unselectAttributeCarrier();
1071 AC->selectAttributeCarrier();
1085 std::set<std::pair<std::string, GNEAttributeCarrier*> > ACsToSelect, ACsToUnselect;
1091 for (
const auto& selectedAC : selectedACs) {
1092 ACsToUnselect.insert(std::make_pair(selectedAC->getID(), selectedAC));
1096 for (
const auto& AC : ACs) {
1098 switch (setOperation) {
1100 ACsToUnselect.insert(std::make_pair(AC->getID(), AC));
1103 if (ACsToUnselect.find(std::make_pair(AC->getID(), AC)) != ACsToUnselect.end()) {
1104 ACsToSelect.insert(std::make_pair(AC->getID(), AC));
1108 ACsToSelect.insert(std::make_pair(AC->getID(), AC));
1114 std::set<GNEEdge*> edgesToSelect;
1116 for (
const auto& AC : ACsToSelect) {
1117 if (AC.second->getTagProperty()->getTag() ==
SUMO_TAG_EDGE) {
1122 for (
const auto& edgeToSelect : edgesToSelect) {
1124 ACsToSelect.insert(std::make_pair(edgeToSelect->getFromJunction()->getID(), edgeToSelect->getFromJunction()));
1125 for (
const auto& connectionToSelect : edgeToSelect->getFromJunction()->getGNEConnections()) {
1126 ACsToSelect.insert(std::make_pair(connectionToSelect->getID(), connectionToSelect));
1128 for (
const auto& fromCrossingToSelect : edgeToSelect->getFromJunction()->getGNECrossings()) {
1129 ACsToSelect.insert(std::make_pair(fromCrossingToSelect->getID(), fromCrossingToSelect));
1131 for (
const auto& fromWalkingAreaToSelect : edgeToSelect->getFromJunction()->getGNEWalkingAreas()) {
1132 ACsToSelect.insert(std::make_pair(fromWalkingAreaToSelect->getID(), fromWalkingAreaToSelect));
1135 ACsToSelect.insert(std::make_pair(edgeToSelect->getToJunction()->getID(), edgeToSelect->getToJunction()));
1136 for (
const auto& connectionToSelect : edgeToSelect->getToJunction()->getGNEConnections()) {
1137 ACsToSelect.insert(std::make_pair(connectionToSelect->getID(), connectionToSelect));
1139 for (
const auto& toCrossingToSelect : edgeToSelect->getToJunction()->getGNECrossings()) {
1140 ACsToSelect.insert(std::make_pair(toCrossingToSelect->getID(), toCrossingToSelect));
1142 for (
const auto& toWalkingAreaToSelect : edgeToSelect->getToJunction()->getGNEWalkingAreas()) {
1143 ACsToSelect.insert(std::make_pair(toWalkingAreaToSelect->getID(), toWalkingAreaToSelect));
1148 if ((ACsToSelect.size() + ACsToUnselect.size()) > 0) {
1151 for (
const auto& ACToUnselect : ACsToUnselect) {
1152 if (ACToUnselect.second->getTagProperty()->isSelectable()) {
1156 for (
const auto& ACToSelect : ACsToSelect) {
1157 if (ACToSelect.second->getTagProperty()->isSelectable()) {
FXDEFMAP(GNESelectorFrame::ModificationMode) ModificationModeMap[]
@ NETWORK
Network mode (Edges, junctions, 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 GUIDesignTextColorRed
red color (for invalid text)
#define GUIDesignComboBox
#define GUIDesignAuxiliarHorizontalFrame
design for auxiliar (Without borders) horizontal frame used to pack another frames
#define GUIDesignComboBoxVisibleItems
#define GUIDesignLabelThick(justify)
label extended over frame with thick and with text justify to left
#define GUIDesignTextColorBlack
black color (for correct text)
#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(...)
@ SUMO_TAG_TAZ
a traffic assignment zone
@ SUMO_TAG_CONNECTION
connectioon between two lanes
@ SUMO_TAG_JUNCTION
begin/end of the description of a junction
@ SUMO_TAG_CROSSING
crossing between edges for pedestrians
@ SUMO_TAG_LANE
begin/end of the description of a single lane
@ SUMO_TAG_EDGE
begin/end of the description of an edge
@ GNE_ATTR_SELECTED
element is selected
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
const std::string getID() const override
get ID (all Attribute Carriers have one)
bool isTemplate() const
check if this AC is template
const GNETagProperties * getTagProperty() const
get tagProperty associated with this Attribute Carrier
virtual GUIGlObject * getGUIGlObject()=0
get GUIGlObject associated with this AttributeCarrier
Result getResult() const
get result to indicate if this dialog was closed accepting or rejecting changes
GNEViewNet * getViewNet() const
get view net
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
GNEGroupBoxModule (based on FXGroupBox)
void setText(const std::string &text)
set text
FXVerticalFrame * getCollapsableFrame()
get collapsable frame (used by all elements that will be collapsed if button is toggled)
std::vector< GNEConnection * > getGNEConnections() const
Returns all GNEConnections vinculated with this junction.
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList) override
GNEEdge * getParentEdge() const
get parent edge
void showMatchAttribute()
show match attributes
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
void updateFrameAfterUndoRedo()
function called after undo/redo in the current frame
ModificationMode * getModificationModeModul() const
get modification mode modul
GNESelectorFrame::SelectionOperation * mySelectionOperation
modul for selection operations
~GNESelectorFrame()
Destructor.
GNESelectorFrame::SelectionInformation * mySelectionInformation
modul for selection information
GNESelectorFrame::VisualScaling * myVisualScaling
modul for visual scaling
GNESelectorFrame::Information * myInformation
information modul
GNESelectorFrame::SelectionHierarchy * mySelectionHierarchy
modul for selection hierarchy
GNESelectorFrame::ModificationMode * myModificationMode
modul for change modification mode
GNEMatchAttribute * myMatchAttribute
modul for match attribute
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
GNEViewParent * getViewParent() const
get the net object
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.
GNEApplicationWindow * getGNEAppWindows() const
get GNE Application Windows
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
MFXStaticToolTip * getStaticTooltipMenu() const
get static toolTip for menus
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.
static FXString getFilename2Write(FXWindow *parent, const FXString &header, const FXString &extensions, 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.
static StringBijection< TXTFileExtension > TXTFileExtensions
TXT file Extensions.
const std::string & getString(const T key) const
get string
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