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 onCmdInvert(0, 0, 0);
478 onCmdDelete(0, 0, 0);
480 mySelectorFrameParent->getViewNet()->getUndoList()->end();
487 const auto& ACs = mySelectorFrameParent->myViewNet->getNet()->getAttributeCarriers();
488 const bool selectEdges = mySelectorFrameParent->getViewNet()->getNetworkViewOptions().selectEdges();
490 std::unordered_set<GNEAttributeCarrier*> networkACs;
492 for (
const auto& junction : ACs->getJunctions()) {
493 networkACs.insert(junction.second);
495 for (
const auto& incomingEdge : junction.second->getGNEIncomingEdges()) {
496 if (!filterLanes || selectEdges) {
497 networkACs.insert(incomingEdge);
500 if (!filterLanes || !selectEdges) {
501 for (
const auto& lane : incomingEdge->getChildLanes()) {
502 networkACs.insert(lane);
506 for (
const auto& connection : incomingEdge->getGNEConnections()) {
507 networkACs.insert(connection);
511 for (
const auto& crossing : junction.second->getGNECrossings()) {
512 networkACs.insert(crossing);
515 for (
const auto& walkingArea : junction.second->getGNEWalkingAreas()) {
516 networkACs.insert(walkingArea);
520 for (
const auto& additionalTags : ACs->getAdditionals()) {
521 for (
const auto& additional : additionalTags.second) {
522 if (additional.second->getTagProperty()->isSelectable()) {
523 networkACs.insert(additional.second);
530 for (
const auto& networkAC : networkACs) {
531 const auto networkACObjectType = networkAC->getGUIGlObject()->getType();
534 massiveSelection.
lockedTypes[networkACObjectType] = networkAC->getGUIGlObject()->isGLObjectLocked();
537 if (networkAC->isAttributeCarrierSelected()) {
543 return massiveSelection;
549 const auto& ACs = mySelectorFrameParent->myViewNet->getNet()->getAttributeCarriers();
553 for (
const auto& demandElementTag : ACs->getDemandElements()) {
554 for (
const auto& demandElement : demandElementTag.second) {
555 if (demandElement.second->getTagProperty()->isSelectable()) {
556 const auto networkACObjectType = demandElement.first->getType();
559 massiveSelection.
lockedTypes[networkACObjectType] = demandElement.first->isGLObjectLocked();
562 if (demandElement.second->isAttributeCarrierSelected()) {
565 massiveSelection.
ACsToSelect[demandElement.second] = massiveSelection.
lockedTypes.at(networkACObjectType);
570 return massiveSelection;
576 const auto& ACs = mySelectorFrameParent->myViewNet->getNet()->getAttributeCarriers();
580 for (
const auto& genericDataTag : mySelectorFrameParent->myViewNet->getNet()->getAttributeCarriers()->getGenericDatas()) {
581 for (
const auto& genericData : genericDataTag.second) {
582 if (genericData.second->getTagProperty()->isSelectable()) {
583 const auto networkACObjectType = genericData.first->getType();
586 massiveSelection.
lockedTypes[networkACObjectType] = genericData.first->isGLObjectLocked();
589 if (genericData.second->isAttributeCarrierSelected()) {
597 return massiveSelection;
604 const GNEQuestionBasicDialog questionDialog(mySelectorFrameParent->getViewNet()->getViewParent()->getGNEAppWindows(),
606 TL(
"Confirm selection operation"),
607 TL(
"There are locked elements in the current selection."),
608 TL(
"Apply operation to locked elements?"));
618 ACsToSelect.reserve(bucketSize);
619 ACsToUnselect.reserve(bucketSize);
627 return (ACsToSelect.size() + ACsToUnselect.size()) > 0;
639 mySelectorFrameParent(selectorFrameParent),
666 for (
const auto& item :
myItems) {
678 if (obj == myParentsComboBox) {
679 for (
const auto& item : myItems) {
680 if (item.second == myParentsComboBox->getText().text()) {
682 mySelectParentsButton->enable();
683 myUnselectParentsButton->enable();
687 myCurrentSelectedParent = item.first;
692 myCurrentSelectedParent = Selection::NOTHING;
694 mySelectParentsButton->disable();
695 myUnselectParentsButton->disable();
698 }
else if (obj == myChildrenComboBox) {
699 for (
const auto& item : myItems) {
700 if (item.second == myChildrenComboBox->getText().text()) {
702 mySelectChildrenButton->enable();
703 myUnselectChildrenButton->enable();
707 myCurrentSelectedChild = item.first;
712 myCurrentSelectedChild = Selection::NOTHING;
714 mySelectChildrenButton->disable();
715 myUnselectChildrenButton->disable();
725 const auto viewNet = mySelectorFrameParent->getViewNet();
727 const auto selectedACs = viewNet->getNet()->getAttributeCarriers()->getSelectedAttributeCarriers(
true);
729 if ((selectedACs.size() > 0) && (myCurrentSelectedParent != Selection::NOTHING)) {
731 std::vector<GNEAttributeCarrier*> editedParents;
732 for (
const auto& selectedAC : selectedACs) {
734 const auto connection = viewNet->getNet()->getAttributeCarriers()->retrieveConnection(selectedAC->getGUIGlObject());
735 editedParents.push_back(connection->getLaneFrom());
736 editedParents.push_back(connection->getLaneTo());
738 const auto crossing = viewNet->getNet()->getAttributeCarriers()->retrieveCrossing(selectedAC->getGUIGlObject());
739 editedParents.push_back(crossing->getParentJunctions().front());
742 const auto hierarchicalElement = selectedAC->getHierarchicalElement();
744 if ((myCurrentSelectedParent == Selection::ALL) || (myCurrentSelectedParent == Selection::JUNCTION)) {
745 editedParents.insert(editedParents.end(), hierarchicalElement->getParentJunctions().begin(), hierarchicalElement->getParentJunctions().end());
748 if ((myCurrentSelectedParent == Selection::ALL) || (myCurrentSelectedParent == Selection::EDGE)) {
749 if (selectedAC->getTagProperty()->getTag() ==
SUMO_TAG_LANE) {
752 }
else if (selectedAC->getTagProperty()->getTag() ==
SUMO_TAG_TAZ) {
754 for (
const auto& tss : selectedAC->getHierarchicalElement()->getChildTAZSourceSinks()) {
755 editedParents.push_back(tss->getParentEdges().front());
758 editedParents.insert(editedParents.end(), hierarchicalElement->getParentEdges().begin(), hierarchicalElement->getParentEdges().end());
762 if ((myCurrentSelectedParent == Selection::ALL) || (myCurrentSelectedParent == Selection::LANE)) {
763 editedParents.insert(editedParents.end(), hierarchicalElement->getParentLanes().begin(), hierarchicalElement->getParentLanes().end());
766 if ((myCurrentSelectedParent == Selection::ALL) || (myCurrentSelectedParent == Selection::ADDITIONAL)) {
767 editedParents.insert(editedParents.end(), hierarchicalElement->getParentAdditionals().begin(), hierarchicalElement->getParentAdditionals().end());
770 if ((myCurrentSelectedParent == Selection::ALL) || (myCurrentSelectedParent == Selection::WIRE)) {
771 editedParents.insert(editedParents.end(), hierarchicalElement->getParentAdditionals().begin(), hierarchicalElement->getParentAdditionals().end());
774 if ((myCurrentSelectedParent == Selection::ALL) || (myCurrentSelectedParent == Selection::DEMAND)) {
775 editedParents.insert(editedParents.end(), hierarchicalElement->getParentDemandElements().begin(), hierarchicalElement->getParentDemandElements().end());
778 if ((myCurrentSelectedParent == Selection::ALL) || (myCurrentSelectedParent == Selection::DATA)) {
779 editedParents.insert(editedParents.end(), hierarchicalElement->getParentGenericDatas().begin(), hierarchicalElement->getParentGenericDatas().end());
784 if (editedParents.size() > 0) {
785 if (editedParents.size() > 1) {
788 for (
const auto& HE : editedParents) {
789 if (obj == mySelectParentsButton) {
795 if (editedParents.size() > 1) {
796 viewNet->getUndoList()->end();
800 mySelectorFrameParent->mySelectionInformation->updateInformationLabel();
811 const auto selectedACs = mySelectorFrameParent->getViewNet()->getNet()->getAttributeCarriers()->getSelectedAttributeCarriers(
true);
813 if ((selectedACs.size() > 0) && (myCurrentSelectedChild != Selection::NOTHING)) {
815 std::vector<GNEAttributeCarrier*> editedChildren;
816 for (
const auto& selectedAC : selectedACs) {
818 const auto hierarchicalElement = selectedAC->getHierarchicalElement();
820 if ((myCurrentSelectedChild == Selection::ALL) || (myCurrentSelectedChild == Selection::JUNCTION)) {
823 const auto junction =
dynamic_cast<GNEJunction*
>(selectedAC);
825 editedChildren.insert(editedChildren.end(), junction->getGNEIncomingEdges().begin(), junction->getGNEIncomingEdges().end());
826 editedChildren.insert(editedChildren.end(), junction->getGNEOutgoingEdges().begin(), junction->getGNEOutgoingEdges().end());
828 editedChildren.insert(editedChildren.end(), hierarchicalElement->getChildJunctions().begin(), hierarchicalElement->getChildJunctions().end());
832 if ((myCurrentSelectedChild == Selection::ALL) || (myCurrentSelectedChild == Selection::EDGE)) {
833 if (selectedAC->getTagProperty()->getTag() ==
SUMO_TAG_EDGE) {
835 const auto edge =
dynamic_cast<GNEEdge*
>(selectedAC);
837 editedChildren.insert(editedChildren.end(), edge->getChildLanes().begin(), edge->getChildLanes().end());
839 editedChildren.insert(editedChildren.end(), hierarchicalElement->getChildEdges().begin(), hierarchicalElement->getChildEdges().end());
843 if ((myCurrentSelectedChild == Selection::ALL) || (myCurrentSelectedChild == Selection::CONNECTION)) {
844 if (selectedAC->getTagProperty()->getTag() ==
SUMO_TAG_EDGE) {
846 const auto edge =
dynamic_cast<GNEEdge*
>(selectedAC);
848 editedChildren.insert(editedChildren.end(), edge->getGNEConnections().begin(), edge->getGNEConnections().end());
849 }
else if (selectedAC->getTagProperty()->getTag() ==
SUMO_TAG_LANE) {
851 const auto lane =
dynamic_cast<GNELane*
>(selectedAC);
853 for (
const auto& connection : lane->getParentEdge()->getGNEConnections()) {
855 editedChildren.push_back(connection);
860 const auto junction =
dynamic_cast<GNEJunction*
>(selectedAC);
864 editedChildren.insert(editedChildren.end(), connections.begin(), connections.end());
868 if ((myCurrentSelectedChild == Selection::ALL) || (myCurrentSelectedChild == Selection::CROSSING)) {
871 const auto junction =
dynamic_cast<GNEJunction*
>(selectedAC);
873 editedChildren.insert(editedChildren.end(), junction->getGNECrossings().begin(), junction->getGNECrossings().end());
877 if ((myCurrentSelectedChild == Selection::ALL) || (myCurrentSelectedChild == Selection::LANE)) {
878 editedChildren.insert(editedChildren.end(), hierarchicalElement->getChildLanes().begin(), hierarchicalElement->getChildLanes().end());
881 if ((myCurrentSelectedChild == Selection::ALL) || (myCurrentSelectedChild == Selection::ADDITIONAL)) {
883 for (
const auto& additionalChild : hierarchicalElement->getChildAdditionals()) {
884 if (!additionalChild->getTagProperty()->isWireElement() && !additionalChild->getTagProperty()->isSymbol()) {
885 editedChildren.push_back(additionalChild);
890 if ((myCurrentSelectedChild == Selection::ALL) || (myCurrentSelectedChild == Selection::WIRE)) {
892 for (
const auto& wireChild : hierarchicalElement->getChildAdditionals()) {
893 if (wireChild->getTagProperty()->isWireElement() && !wireChild->getTagProperty()->isSymbol()) {
894 editedChildren.push_back(wireChild);
899 if ((myCurrentSelectedChild == Selection::ALL) || (myCurrentSelectedChild == Selection::DEMAND)) {
900 editedChildren.insert(editedChildren.end(), hierarchicalElement->getChildDemandElements().begin(), hierarchicalElement->getChildDemandElements().end());
903 if ((myCurrentSelectedChild == Selection::ALL) || (myCurrentSelectedChild == Selection::DATA)) {
904 editedChildren.insert(editedChildren.end(), hierarchicalElement->getChildGenericDatas().begin(), hierarchicalElement->getChildGenericDatas().end());
908 if (editedChildren.size() > 0) {
909 if (editedChildren.size() > 1) {
910 mySelectorFrameParent->getViewNet()->getUndoList()->begin(
GUIIcon::SELECT,
TL(
"select children"));
912 for (
const auto& HE : editedChildren) {
913 if (obj == mySelectChildrenButton) {
916 HE->setAttribute(
GNE_ATTR_SELECTED,
"false", mySelectorFrameParent->getViewNet()->getUndoList());
919 if (editedChildren.size() > 1) {
920 mySelectorFrameParent->getViewNet()->getUndoList()->end();
924 mySelectorFrameParent->mySelectionInformation->updateInformationLabel();
926 mySelectorFrameParent->getViewNet()->update();
949 GNEFrame(viewParent, viewNet,
TL(
"Selection")) {
1005 if (AC ==
nullptr) {
1013 if ((AC->getTagProperty()->isNetworkElement() || AC->getTagProperty()->isAdditionalElement()) &&
1026 if (filteredGLObjects.size() > 1) {
1030 if (AC->isAttributeCarrierSelected()) {
1031 AC->unselectAttributeCarrier();
1033 AC->selectAttributeCarrier();
1047 std::set<std::pair<std::string, GNEAttributeCarrier*> > ACsToSelect, ACsToUnselect;
1053 for (
const auto& selectedAC : selectedACs) {
1054 ACsToUnselect.insert(std::make_pair(selectedAC->getID(), selectedAC));
1058 for (
const auto& AC : ACs) {
1060 switch (setOperation) {
1062 ACsToUnselect.insert(std::make_pair(AC->getID(), AC));
1065 if (ACsToUnselect.find(std::make_pair(AC->getID(), AC)) != ACsToUnselect.end()) {
1066 ACsToSelect.insert(std::make_pair(AC->getID(), AC));
1070 ACsToSelect.insert(std::make_pair(AC->getID(), AC));
1076 std::set<GNEEdge*> edgesToSelect;
1078 for (
const auto& AC : ACsToSelect) {
1079 if (AC.second->getTagProperty()->getTag() ==
SUMO_TAG_EDGE) {
1084 for (
const auto& edgeToSelect : edgesToSelect) {
1086 ACsToSelect.insert(std::make_pair(edgeToSelect->getFromJunction()->getID(), edgeToSelect->getFromJunction()));
1087 for (
const auto& connectionToSelect : edgeToSelect->getFromJunction()->getGNEConnections()) {
1088 ACsToSelect.insert(std::make_pair(connectionToSelect->getID(), connectionToSelect));
1090 for (
const auto& fromCrossingToSelect : edgeToSelect->getFromJunction()->getGNECrossings()) {
1091 ACsToSelect.insert(std::make_pair(fromCrossingToSelect->getID(), fromCrossingToSelect));
1093 for (
const auto& fromWalkingAreaToSelect : edgeToSelect->getFromJunction()->getGNEWalkingAreas()) {
1094 ACsToSelect.insert(std::make_pair(fromWalkingAreaToSelect->getID(), fromWalkingAreaToSelect));
1097 ACsToSelect.insert(std::make_pair(edgeToSelect->getToJunction()->getID(), edgeToSelect->getToJunction()));
1098 for (
const auto& connectionToSelect : edgeToSelect->getToJunction()->getGNEConnections()) {
1099 ACsToSelect.insert(std::make_pair(connectionToSelect->getID(), connectionToSelect));
1101 for (
const auto& toCrossingToSelect : edgeToSelect->getToJunction()->getGNECrossings()) {
1102 ACsToSelect.insert(std::make_pair(toCrossingToSelect->getID(), toCrossingToSelect));
1104 for (
const auto& toWalkingAreaToSelect : edgeToSelect->getToJunction()->getGNEWalkingAreas()) {
1105 ACsToSelect.insert(std::make_pair(toWalkingAreaToSelect->getID(), toWalkingAreaToSelect));
1110 if ((ACsToSelect.size() + ACsToUnselect.size()) > 0) {
1113 for (
const auto& ACToUnselect : ACsToUnselect) {
1114 if (ACToUnselect.second->getTagProperty()->isSelectable()) {
1118 for (
const auto& ACToSelect : ACsToSelect) {
1119 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