78 mySelectorFrameParent(selectorFrameParent) {
92 const auto ACs = mySelectorFrameParent->getViewNet()->getNet()->getAttributeCarriers();
94 if (mySelectorFrameParent->getViewNet()->getEditModes().isCurrentSupermodeNetwork()) {
95 updateInformationLabel(
TL(
"Junctions"), ACs->getNumberOfSelectedJunctions());
96 updateInformationLabel(
TL(
"Edges"), ACs->getNumberOfSelectedEdges());
97 updateInformationLabel(
TL(
"Lanes"), ACs->getNumberOfSelectedLanes());
98 updateInformationLabel(
TL(
"Connections"), ACs->getNumberOfSelectedConnections());
99 updateInformationLabel(
TL(
"Crossings"), ACs->getNumberOfSelectedCrossings());
100 updateInformationLabel(
TL(
"WalkingAreas"), ACs->getNumberOfSelectedWalkingAreas());
101 updateInformationLabel(
TL(
"Additionals"), ACs->getNumberOfSelectedPureAdditionals());
102 updateInformationLabel(
TL(
"Wires"), ACs->getNumberOfSelectedWires());
103 updateInformationLabel(
TL(
"TAZs"), ACs->getNumberOfSelectedTAZs());
104 updateInformationLabel(
TL(
"Polygons"), ACs->getNumberOfSelectedPolygons());
105 updateInformationLabel(
TL(
"POIs"), ACs->getNumberOfSelectedPOIs());
106 updateInformationLabel(
TL(
"JuPedSim elements"),
107 ACs->getNumberOfSelectedJpsWalkableAreas() +
108 ACs->getNumberOfSelectedJpsObstacles());
109 }
else if (mySelectorFrameParent->getViewNet()->getEditModes().isCurrentSupermodeDemand()) {
110 updateInformationLabel(
TL(
"Routes"), ACs->getNumberOfSelectedRoutes());
111 updateInformationLabel(
TL(
"Vehicles"), ACs->getNumberOfSelectedVehicles());
112 updateInformationLabel(
TL(
"Persons"), ACs->getNumberOfSelectedPersons());
113 updateInformationLabel(
TL(
"Person trips"), ACs->getNumberOfSelectedPersonTrips());
114 updateInformationLabel(
TL(
"Walks"), ACs->getNumberOfSelectedWalks());
115 updateInformationLabel(
TL(
"Rides"), ACs->getNumberOfSelectedRides());
116 updateInformationLabel(
TL(
"Containers"), ACs->getNumberOfSelectedContainers());
117 updateInformationLabel(
TL(
"Transport"), ACs->getNumberOfSelectedTransport());
118 updateInformationLabel(
TL(
"Tranships"), ACs->getNumberOfSelectedTranships());
119 updateInformationLabel(
TL(
"Stops"), ACs->getNumberOfSelectedStops());
120 }
else if (mySelectorFrameParent->getViewNet()->getEditModes().isCurrentSupermodeData()) {
121 updateInformationLabel(
TL(
"EdgeDatas"), ACs->getNumberOfSelectedEdgeDatas());
122 updateInformationLabel(
TL(
"EdgeRelDatas"), ACs->getNumberOfSelectedEdgeRelDatas());
123 updateInformationLabel(
TL(
"EdgeTAZRel"), ACs->getNumberOfSelectedEdgeTAZRel());
127 if (numberLines == 0) {
129 }
else if (numberLines > 1) {
170 return myModificationModeType;
176 if (obj == myAddRadioButton) {
177 myModificationModeType = Operation::ADD;
178 myAddRadioButton->setCheck(
true);
179 myRemoveRadioButton->setCheck(
false);
180 myKeepRadioButton->setCheck(
false);
181 myReplaceRadioButton->setCheck(
false);
183 }
else if (obj == myRemoveRadioButton) {
184 myModificationModeType = Operation::SUB;
185 myAddRadioButton->setCheck(
false);
186 myRemoveRadioButton->setCheck(
true);
187 myKeepRadioButton->setCheck(
false);
188 myReplaceRadioButton->setCheck(
false);
190 }
else if (obj == myKeepRadioButton) {
191 myModificationModeType = Operation::RESTRICT;
192 myAddRadioButton->setCheck(
false);
193 myRemoveRadioButton->setCheck(
false);
194 myKeepRadioButton->setCheck(
true);
195 myReplaceRadioButton->setCheck(
false);
197 }
else if (obj == myReplaceRadioButton) {
198 myModificationModeType = Operation::REPLACE;
199 myAddRadioButton->setCheck(
false);
200 myRemoveRadioButton->setCheck(
false);
201 myKeepRadioButton->setCheck(
false);
202 myReplaceRadioButton->setCheck(
true);
215 mySelectorFrameParent(selectorFrameParent) {
233 mySelectorFrameParent->myViewNet->setSelectorFrameScale(mySelectionScaling->getValue());
234 mySelectorFrameParent->myViewNet->updateViewNet();
244 mySelectorFrameParent(selectorFrameParent) {
248 FXVerticalFrame* col1 =
new FXVerticalFrame(selectionButtons, LAYOUT_FILL_X, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
249 FXVerticalFrame* col2 =
new FXVerticalFrame(selectionButtons, LAYOUT_FILL_X, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
271 std::vector<GNEAttributeCarrier*> loadedACs;
272 std::ifstream strm(file.c_str());
278 std::map<const std::string, GNEAttributeCarrier*> GLFUllNameAC;
280 for (
const auto& GLObject : GLObjects) {
289 while (strm.good()) {
293 if (line.length() != 0) {
305 loadedACs.push_back(AC);
311 if (loadedACs.size() > 0) {
313 mySelectorFrameParent->handleIDs(loadedACs);
314 mySelectorFrameParent->myViewNet->getUndoList()->end();
323 FXFileDialog opendialog(getCollapsableFrame(),
TL(
"Open List of Selected Items"));
325 opendialog.setSelectMode(SELECTFILE_EXISTING);
330 if (opendialog.execute()) {
332 loadFromFile(opendialog.getFilename().text());
349 const auto selectedACs = mySelectorFrameParent->myViewNet->getNet()->getAttributeCarriers()->getSelectedAttributeCarriers(
false);
350 for (
const auto& selectedAC : selectedACs) {
359 FXMessageBox::error(getCollapsableFrame(), MBOX_OK,
"Storing Selection failed",
"%s", e.what());
367 const auto& editModes = mySelectorFrameParent->myViewNet->getEditModes();
368 GNEUndoList* undoList = mySelectorFrameParent->myViewNet->getUndoList();
371 editModes.isCurrentSupermodeNetwork() ? processMassiveNetworkElementSelection(
false) :
372 editModes.isCurrentSupermodeDemand() ? processMassiveDemandElementSelection() :
373 processMassiveDataElementSelection();
377 bool askedContinueIfLock =
false;
378 bool addLockedElements =
false;
379 bool unlockedElements =
false;
380 for (
const auto& ACToUnselect : massiveSelection.
ACsToUnselect) {
381 if (ACToUnselect.second ==
false) {
383 unlockedElements =
true;
384 }
else if (!askedContinueIfLock) {
385 addLockedElements = askContinueIfLock();
387 askedContinueIfLock =
true;
390 if (unlockedElements || addLockedElements) {
392 for (
const auto& ACToUnselect : massiveSelection.
ACsToUnselect) {
393 if (addLockedElements || !ACToUnselect.second) {
397 mySelectorFrameParent->myViewNet->getUndoList()->end();
400 mySelectorFrameParent->myViewNet->updateViewNet();
407 mySelectorFrameParent->getViewNet()->hotkeyDel();
414 const auto& editModes = mySelectorFrameParent->myViewNet->getEditModes();
415 GNEUndoList* undoList = mySelectorFrameParent->myViewNet->getUndoList();
418 editModes.isCurrentSupermodeNetwork() ? processMassiveNetworkElementSelection(
true) :
419 editModes.isCurrentSupermodeDemand() ? processMassiveDemandElementSelection() :
420 processMassiveDataElementSelection();
424 bool askedContinueIfLock =
false;
425 bool addLockedElements =
false;
426 bool unlockedElements =
false;
427 for (
const auto& ACToSelect : massiveSelection.
ACsToSelect) {
428 if (ACToSelect.second ==
false) {
430 unlockedElements =
true;
431 }
else if (!askedContinueIfLock) {
432 addLockedElements = askContinueIfLock();
434 askedContinueIfLock =
true;
437 for (
const auto& ACToUnselect : massiveSelection.
ACsToUnselect) {
438 if (ACToUnselect.second ==
false) {
440 unlockedElements =
true;
441 }
else if (!askedContinueIfLock) {
442 addLockedElements = askContinueIfLock();
444 askedContinueIfLock =
true;
447 if (unlockedElements || addLockedElements) {
449 for (
const auto& ACToSelect : massiveSelection.
ACsToSelect) {
450 if (addLockedElements || !ACToSelect.second) {
454 for (
const auto& ACToUnselect : massiveSelection.
ACsToUnselect) {
455 if (addLockedElements || !ACToUnselect.second) {
459 mySelectorFrameParent->myViewNet->getUndoList()->end();
471 onCmdInvert(0, 0, 0);
472 onCmdDelete(0, 0, 0);
474 mySelectorFrameParent->getViewNet()->getUndoList()->end();
481 const auto& ACs = mySelectorFrameParent->myViewNet->getNet()->getAttributeCarriers();
482 const bool selectEdges = mySelectorFrameParent->getViewNet()->getNetworkViewOptions().selectEdges();
484 std::unordered_set<GNEAttributeCarrier*> networkACs;
486 for (
const auto& junction : ACs->getJunctions()) {
487 networkACs.insert(junction.second);
489 for (
const auto& incomingEdge : junction.second->getGNEIncomingEdges()) {
490 if (!filterLanes || selectEdges) {
491 networkACs.insert(incomingEdge);
494 if (!filterLanes || !selectEdges) {
495 for (
const auto& lane : incomingEdge->getChildLanes()) {
496 networkACs.insert(lane);
500 for (
const auto& connection : incomingEdge->getGNEConnections()) {
501 networkACs.insert(connection);
505 for (
const auto& crossing : junction.second->getGNECrossings()) {
506 networkACs.insert(crossing);
509 for (
const auto& walkingArea : junction.second->getGNEWalkingAreas()) {
510 networkACs.insert(walkingArea);
514 for (
const auto& additionalTags : ACs->getAdditionals()) {
515 for (
const auto& additional : additionalTags.second) {
516 if (additional.second->getTagProperty()->isSelectable()) {
517 networkACs.insert(additional.second);
524 for (
const auto& networkAC : networkACs) {
525 const auto networkACObjectType = networkAC->getGUIGlObject()->getType();
528 massiveSelection.
lockedTypes[networkACObjectType] = networkAC->getGUIGlObject()->isGLObjectLocked();
531 if (networkAC->isAttributeCarrierSelected()) {
537 return massiveSelection;
543 const auto& ACs = mySelectorFrameParent->myViewNet->getNet()->getAttributeCarriers();
547 for (
const auto& demandElementTag : ACs->getDemandElements()) {
548 for (
const auto& demandElement : demandElementTag.second) {
549 if (demandElement.second->getTagProperty()->isSelectable()) {
550 const auto networkACObjectType = demandElement.first->getType();
553 massiveSelection.
lockedTypes[networkACObjectType] = demandElement.first->isGLObjectLocked();
556 if (demandElement.second->isAttributeCarrierSelected()) {
559 massiveSelection.
ACsToSelect[demandElement.second] = massiveSelection.
lockedTypes.at(networkACObjectType);
564 return massiveSelection;
570 const auto& ACs = mySelectorFrameParent->myViewNet->getNet()->getAttributeCarriers();
574 for (
const auto& genericDataTag : mySelectorFrameParent->myViewNet->getNet()->getAttributeCarriers()->getGenericDatas()) {
575 for (
const auto& genericData : genericDataTag.second) {
576 if (genericData.second->getTagProperty()->isSelectable()) {
577 const auto networkACObjectType = genericData.first->getType();
580 massiveSelection.
lockedTypes[networkACObjectType] = genericData.first->isGLObjectLocked();
583 if (genericData.second->isAttributeCarrierSelected()) {
591 return massiveSelection;
598 const FXuint answer = FXMessageBox::question(mySelectorFrameParent->getViewNet()->getApp(),
599 MBOX_YES_NO,
"Confirm selection operation",
"There are locked elements in the current selection.\nApply operation to locked elements?");
612 ACsToSelect.reserve(bucketSize);
613 ACsToUnselect.reserve(bucketSize);
621 return (ACsToSelect.size() + ACsToUnselect.size()) > 0;
633 mySelectorFrameParent(selectorFrameParent),
659 for (
const auto& item :
myItems) {
671 if (obj == myParentsComboBox) {
672 for (
const auto& item : myItems) {
673 if (item.second == myParentsComboBox->getText().text()) {
675 mySelectParentsButton->enable();
676 myUnselectParentsButton->enable();
678 myParentsComboBox->setTextColor(FXRGB(0, 0, 0));
680 myCurrentSelectedParent = item.first;
685 myCurrentSelectedParent = Selection::NOTHING;
687 mySelectParentsButton->disable();
688 myUnselectParentsButton->disable();
689 myParentsComboBox->setTextColor(FXRGB(255, 0, 0));
691 }
else if (obj == myChildrenComboBox) {
692 for (
const auto& item : myItems) {
693 if (item.second == myChildrenComboBox->getText().text()) {
695 mySelectChildrenButton->enable();
696 myUnselectChildrenButton->enable();
698 myChildrenComboBox->setTextColor(FXRGB(0, 0, 0));
700 myCurrentSelectedChild = item.first;
705 myCurrentSelectedChild = Selection::NOTHING;
707 mySelectChildrenButton->disable();
708 myUnselectChildrenButton->disable();
709 myChildrenComboBox->setTextColor(FXRGB(255, 0, 0));
718 const auto viewNet = mySelectorFrameParent->getViewNet();
720 const auto selectedACs = viewNet->getNet()->getAttributeCarriers()->getSelectedAttributeCarriers(
true);
722 if ((selectedACs.size() > 0) && (myCurrentSelectedParent != Selection::NOTHING)) {
724 std::vector<GNEAttributeCarrier*> editedParents;
725 for (
const auto& selectedAC : selectedACs) {
727 const auto connection = viewNet->getNet()->getAttributeCarriers()->retrieveConnection(selectedAC->getGUIGlObject());
728 editedParents.push_back(connection->getLaneFrom());
729 editedParents.push_back(connection->getLaneTo());
731 const auto crossing = viewNet->getNet()->getAttributeCarriers()->retrieveCrossing(selectedAC->getGUIGlObject());
732 editedParents.push_back(crossing->getParentJunctions().front());
735 const auto hierarchicalElement = selectedAC->getHierarchicalElement();
737 if ((myCurrentSelectedParent == Selection::ALL) || (myCurrentSelectedParent == Selection::JUNCTION)) {
738 editedParents.insert(editedParents.end(), hierarchicalElement->getParentJunctions().begin(), hierarchicalElement->getParentJunctions().end());
741 if ((myCurrentSelectedParent == Selection::ALL) || (myCurrentSelectedParent == Selection::EDGE)) {
742 if (selectedAC->getTagProperty()->getTag() ==
SUMO_TAG_LANE) {
746 editedParents.insert(editedParents.end(), hierarchicalElement->getParentEdges().begin(), hierarchicalElement->getParentEdges().end());
750 if ((myCurrentSelectedParent == Selection::ALL) || (myCurrentSelectedParent == Selection::LANE)) {
751 editedParents.insert(editedParents.end(), hierarchicalElement->getParentLanes().begin(), hierarchicalElement->getParentLanes().end());
754 if ((myCurrentSelectedParent == Selection::ALL) || (myCurrentSelectedParent == Selection::ADDITIONAL)) {
755 editedParents.insert(editedParents.end(), hierarchicalElement->getParentAdditionals().begin(), hierarchicalElement->getParentAdditionals().end());
758 if ((myCurrentSelectedParent == Selection::ALL) || (myCurrentSelectedParent == Selection::WIRE)) {
759 editedParents.insert(editedParents.end(), hierarchicalElement->getParentAdditionals().begin(), hierarchicalElement->getParentAdditionals().end());
762 if ((myCurrentSelectedParent == Selection::ALL) || (myCurrentSelectedParent == Selection::DEMAND)) {
763 editedParents.insert(editedParents.end(), hierarchicalElement->getParentDemandElements().begin(), hierarchicalElement->getParentDemandElements().end());
766 if ((myCurrentSelectedParent == Selection::ALL) || (myCurrentSelectedParent == Selection::DATA)) {
767 editedParents.insert(editedParents.end(), hierarchicalElement->getParentGenericDatas().begin(), hierarchicalElement->getParentGenericDatas().end());
772 if (editedParents.size() > 0) {
773 if (editedParents.size() > 1) {
776 for (
const auto& HE : editedParents) {
777 if (obj == mySelectParentsButton) {
783 if (editedParents.size() > 1) {
784 viewNet->getUndoList()->end();
788 mySelectorFrameParent->mySelectionInformation->updateInformationLabel();
799 const auto selectedACs = mySelectorFrameParent->getViewNet()->getNet()->getAttributeCarriers()->getSelectedAttributeCarriers(
true);
801 if ((selectedACs.size() > 0) && (myCurrentSelectedChild != Selection::NOTHING)) {
803 std::vector<GNEAttributeCarrier*> editedChildren;
804 for (
const auto& selectedAC : selectedACs) {
806 const auto hierarchicalElement = selectedAC->getHierarchicalElement();
808 if ((myCurrentSelectedChild == Selection::ALL) || (myCurrentSelectedChild == Selection::JUNCTION)) {
811 const auto junction =
dynamic_cast<GNEJunction*
>(selectedAC);
813 editedChildren.insert(editedChildren.end(), junction->getGNEIncomingEdges().begin(), junction->getGNEIncomingEdges().end());
814 editedChildren.insert(editedChildren.end(), junction->getGNEOutgoingEdges().begin(), junction->getGNEOutgoingEdges().end());
816 editedChildren.insert(editedChildren.end(), hierarchicalElement->getChildJunctions().begin(), hierarchicalElement->getChildJunctions().end());
820 if ((myCurrentSelectedChild == Selection::ALL) || (myCurrentSelectedChild == Selection::EDGE)) {
821 if (selectedAC->getTagProperty()->getTag() ==
SUMO_TAG_EDGE) {
823 const auto edge =
dynamic_cast<GNEEdge*
>(selectedAC);
825 editedChildren.insert(editedChildren.end(), edge->getChildLanes().begin(), edge->getChildLanes().end());
827 editedChildren.insert(editedChildren.end(), hierarchicalElement->getChildEdges().begin(), hierarchicalElement->getChildEdges().end());
831 if ((myCurrentSelectedChild == Selection::ALL) || (myCurrentSelectedChild == Selection::CONNECTION)) {
832 if (selectedAC->getTagProperty()->getTag() ==
SUMO_TAG_EDGE) {
834 const auto edge =
dynamic_cast<GNEEdge*
>(selectedAC);
836 editedChildren.insert(editedChildren.end(), edge->getGNEConnections().begin(), edge->getGNEConnections().end());
837 }
else if (selectedAC->getTagProperty()->getTag() ==
SUMO_TAG_LANE) {
839 const auto lane =
dynamic_cast<GNELane*
>(selectedAC);
841 for (
const auto& connection : lane->getParentEdge()->getGNEConnections()) {
843 editedChildren.push_back(connection);
848 const auto junction =
dynamic_cast<GNEJunction*
>(selectedAC);
852 editedChildren.insert(editedChildren.end(), connections.begin(), connections.end());
856 if ((myCurrentSelectedChild == Selection::ALL) || (myCurrentSelectedChild == Selection::CROSSING)) {
859 const auto junction =
dynamic_cast<GNEJunction*
>(selectedAC);
861 editedChildren.insert(editedChildren.end(), junction->getGNECrossings().begin(), junction->getGNECrossings().end());
865 if ((myCurrentSelectedChild == Selection::ALL) || (myCurrentSelectedChild == Selection::LANE)) {
866 editedChildren.insert(editedChildren.end(), hierarchicalElement->getChildLanes().begin(), hierarchicalElement->getChildLanes().end());
869 if ((myCurrentSelectedChild == Selection::ALL) || (myCurrentSelectedChild == Selection::ADDITIONAL)) {
871 for (
const auto& additionalChild : hierarchicalElement->getChildAdditionals()) {
872 if (!additionalChild->getTagProperty()->isWireElement() && !additionalChild->getTagProperty()->isSymbol()) {
873 editedChildren.push_back(additionalChild);
878 if ((myCurrentSelectedChild == Selection::ALL) || (myCurrentSelectedChild == Selection::WIRE)) {
880 for (
const auto& wireChild : hierarchicalElement->getChildAdditionals()) {
881 if (wireChild->getTagProperty()->isWireElement() && !wireChild->getTagProperty()->isSymbol()) {
882 editedChildren.push_back(wireChild);
887 if ((myCurrentSelectedChild == Selection::ALL) || (myCurrentSelectedChild == Selection::DEMAND)) {
888 editedChildren.insert(editedChildren.end(), hierarchicalElement->getChildDemandElements().begin(), hierarchicalElement->getChildDemandElements().end());
891 if ((myCurrentSelectedChild == Selection::ALL) || (myCurrentSelectedChild == Selection::DATA)) {
892 editedChildren.insert(editedChildren.end(), hierarchicalElement->getChildGenericDatas().begin(), hierarchicalElement->getChildGenericDatas().end());
896 if (editedChildren.size() > 0) {
897 if (editedChildren.size() > 1) {
898 mySelectorFrameParent->getViewNet()->getUndoList()->begin(
GUIIcon::SELECT,
TL(
"select children"));
900 for (
const auto& HE : editedChildren) {
901 if (obj == mySelectChildrenButton) {
904 HE->setAttribute(
GNE_ATTR_SELECTED,
"false", mySelectorFrameParent->getViewNet()->getUndoList());
907 if (editedChildren.size() > 1) {
908 mySelectorFrameParent->getViewNet()->getUndoList()->end();
912 mySelectorFrameParent->mySelectionInformation->updateInformationLabel();
914 mySelectorFrameParent->getViewNet()->update();
937 GNEFrame(viewParent, viewNet,
TL(
"Selection")) {
1001 if ((AC->getTagProperty()->isNetworkElement() || AC->getTagProperty()->isAdditionalElement()) &&
1014 if (filteredGLObjects.size() > 1) {
1018 if (AC->isAttributeCarrierSelected()) {
1019 AC->unselectAttributeCarrier();
1021 AC->selectAttributeCarrier();
1035 std::set<std::pair<std::string, GNEAttributeCarrier*> > ACsToSelect, ACsToUnselect;
1041 for (
const auto& selectedAC : selectedACs) {
1042 ACsToUnselect.insert(std::make_pair(selectedAC->getID(), selectedAC));
1046 for (
const auto& AC : ACs) {
1048 switch (setOperation) {
1050 ACsToUnselect.insert(std::make_pair(AC->getID(), AC));
1053 if (ACsToUnselect.find(std::make_pair(AC->getID(), AC)) != ACsToUnselect.end()) {
1054 ACsToSelect.insert(std::make_pair(AC->getID(), AC));
1058 ACsToSelect.insert(std::make_pair(AC->getID(), AC));
1064 std::set<GNEEdge*> edgesToSelect;
1066 for (
const auto& AC : ACsToSelect) {
1067 if (AC.second->getTagProperty()->getTag() ==
SUMO_TAG_EDGE) {
1072 for (
const auto& edgeToSelect : edgesToSelect) {
1074 ACsToSelect.insert(std::make_pair(edgeToSelect->getFromJunction()->getID(), edgeToSelect->getFromJunction()));
1075 for (
const auto& connectionToSelect : edgeToSelect->getFromJunction()->getGNEConnections()) {
1076 ACsToSelect.insert(std::make_pair(connectionToSelect->getID(), connectionToSelect));
1078 for (
const auto& fromCrossingToSelect : edgeToSelect->getFromJunction()->getGNECrossings()) {
1079 ACsToSelect.insert(std::make_pair(fromCrossingToSelect->getID(), fromCrossingToSelect));
1081 for (
const auto& fromWalkingAreaToSelect : edgeToSelect->getFromJunction()->getGNEWalkingAreas()) {
1082 ACsToSelect.insert(std::make_pair(fromWalkingAreaToSelect->getID(), fromWalkingAreaToSelect));
1085 ACsToSelect.insert(std::make_pair(edgeToSelect->getToJunction()->getID(), edgeToSelect->getToJunction()));
1086 for (
const auto& connectionToSelect : edgeToSelect->getToJunction()->getGNEConnections()) {
1087 ACsToSelect.insert(std::make_pair(connectionToSelect->getID(), connectionToSelect));
1089 for (
const auto& toCrossingToSelect : edgeToSelect->getToJunction()->getGNECrossings()) {
1090 ACsToSelect.insert(std::make_pair(toCrossingToSelect->getID(), toCrossingToSelect));
1092 for (
const auto& toWalkingAreaToSelect : edgeToSelect->getToJunction()->getGNEWalkingAreas()) {
1093 ACsToSelect.insert(std::make_pair(toWalkingAreaToSelect->getID(), toWalkingAreaToSelect));
1098 if ((ACsToSelect.size() + ACsToUnselect.size()) > 0) {
1101 for (
const auto& ACToUnselect : ACsToUnselect) {
1102 if (ACToUnselect.second->getTagProperty()->isSelectable()) {
1106 for (
const auto& ACToSelect : ACsToSelect) {
1107 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 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 GUIDesignComboBoxVisibleItems
#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(...)
@ 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
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
A road/street connecting two junctions (netedit-version)
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
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
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 &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