Eclipse SUMO - Simulation of Urban MObility
GNESelectorFrame.cpp
Go to the documentation of this file.
1 /****************************************************************************/
2 // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
3 // Copyright (C) 2001-2019 German Aerospace Center (DLR) and others.
4 // This program and the accompanying materials
5 // are made available under the terms of the Eclipse Public License v2.0
6 // which accompanies this distribution, and is available at
7 // http://www.eclipse.org/legal/epl-v20.html
8 // SPDX-License-Identifier: EPL-2.0
9 /****************************************************************************/
14 // The Widget for modifying selections of network-elements
15 /****************************************************************************/
16 
17 
18 // ===========================================================================
19 // included modules
20 // ===========================================================================
21 #include <config.h>
22 
23 #include <netedit/GNENet.h>
24 #include <netedit/GNEUndoList.h>
25 #include <netedit/GNEViewNet.h>
37 
38 #include "GNESelectorFrame.h"
39 
40 
41 // ===========================================================================
42 // FOX callback mapping
43 // ===========================================================================
46 };
47 
48 FXDEFMAP(GNESelectorFrame::ModificationMode) ModificationModeMap[] = {
50 };
51 
54 };
55 
61 };
62 
65 };
66 
67 FXDEFMAP(GNESelectorFrame::SelectionOperation) SelectionOperationMap[] = {
72 };
73 
74 // Object implementation
75 FXIMPLEMENT(GNESelectorFrame::LockGLObjectTypes::ObjectTypeEntry, FXObject, ObjectTypeEntryMap, ARRAYNUMBER(ObjectTypeEntryMap))
76 FXIMPLEMENT(GNESelectorFrame::ModificationMode, FXGroupBox, ModificationModeMap, ARRAYNUMBER(ModificationModeMap))
77 FXIMPLEMENT(GNESelectorFrame::ElementSet, FXGroupBox, ElementSetMap, ARRAYNUMBER(ElementSetMap))
78 FXIMPLEMENT(GNESelectorFrame::MatchAttribute, FXGroupBox, MatchAttributeMap, ARRAYNUMBER(MatchAttributeMap))
79 FXIMPLEMENT(GNESelectorFrame::VisualScaling, FXGroupBox, VisualScalingMap, ARRAYNUMBER(VisualScalingMap))
80 FXIMPLEMENT(GNESelectorFrame::SelectionOperation, FXGroupBox, SelectionOperationMap, ARRAYNUMBER(SelectionOperationMap))
81 
82 // ===========================================================================
83 // method definitions
84 // ===========================================================================
85 
86 GNESelectorFrame::GNESelectorFrame(FXHorizontalFrame* horizontalFrameParent, GNEViewNet* viewNet):
87  GNEFrame(horizontalFrameParent, viewNet, "Selection") {
88  // create selectedItems modul
89  myLockGLObjectTypes = new LockGLObjectTypes(this);
90  // create Modification Mode modul
91  myModificationMode = new ModificationMode(this);
92  // create ElementSet modul
93  myElementSet = new ElementSet(this);
94  // create MatchAttribute modul
95  myMatchAttribute = new MatchAttribute(this);
96  // create VisualScaling modul
97  myVisualScaling = new VisualScaling(this);
98  // create SelectionOperation modul
99  mySelectionOperation = new SelectionOperation(this);
100  // Create groupbox for information about selections
101  FXGroupBox* selectionHintGroupBox = new FXGroupBox(myContentFrame, "Information", GUIDesignGroupBoxFrame);
102  // Create Selection Hint
103  new FXLabel(selectionHintGroupBox, " - Hold <SHIFT> for \n rectangle selection.\n - Press <DEL> to\n delete selected items.", nullptr, GUIDesignLabelFrameInformation);
104 
105 }
106 
107 
109 
110 
111 void
113  // show Type Entries depending of current supermode
115  // refresh element set
117  // Show frame
118  GNEFrame::show();
119 }
120 
121 
122 void
124  // hide frame
125  GNEFrame::hide();
126 }
127 
128 
129 void
131  // only continue if there is element for selecting
132  if (ACsToSelected()) {
133  // for invert selection, first clean current selection and next select elements of set "unselectedElements"
134  myViewNet->getUndoList()->p_begin("invert selection");
135  // invert selection of elements depending of current supermode
137  // iterate over junctions
138  for (const auto& i : myViewNet->getNet()->getAttributeCarriers().junctions) {
139  // check if junction selection is locked
141  if (i.second->isAttributeCarrierSelected()) {
142  i.second->setAttribute(GNE_ATTR_SELECTED, "false", myViewNet->getUndoList());
143  }
144  }
145  // due we iterate over all junctions, only it's neccesary iterate over incoming edges
146  for (const auto& j : i.second->getGNEIncomingEdges()) {
147  // check if edge selection is locked
149  if (j->isAttributeCarrierSelected()) {
150  j->setAttribute(GNE_ATTR_SELECTED, "false", myViewNet->getUndoList());
151  }
152  }
153  // check if lane selection is locked
155  for (auto k : j->getLanes()) {
156  if (k->isAttributeCarrierSelected()) {
157  k->setAttribute(GNE_ATTR_SELECTED, "false", myViewNet->getUndoList());
158  }
159  }
160  }
161  // check if connection selection is locked
163  for (const auto& k : j->getGNEConnections()) {
164  if (k->isAttributeCarrierSelected()) {
165  k->setAttribute(GNE_ATTR_SELECTED, "false", myViewNet->getUndoList());
166  }
167  }
168  }
169  }
170  // check if crossing selection is locked
172  for (const auto& j : i.second->getGNECrossings()) {
173  if (j->isAttributeCarrierSelected()) {
174  j->setAttribute(GNE_ATTR_SELECTED, "false", myViewNet->getUndoList());
175  }
176  }
177  }
178  }
179  // check if additionals selection is locked
181  for (const auto& i : myViewNet->getNet()->getAttributeCarriers().additionals) {
182  // first check if additional is selectable
184  for (const auto& j : i.second) {
185  if (j.second->isAttributeCarrierSelected()) {
186  j.second->setAttribute(GNE_ATTR_SELECTED, "false", myViewNet->getUndoList());
187  }
188  }
189  }
190  }
191  }
192  // select polygons
194  for (const auto& i : myViewNet->getNet()->getPolygons()) {
195  GNEShape* shape = dynamic_cast<GNEShape*>(i.second);
196  if (shape->isAttributeCarrierSelected()) {
198  }
199  }
200  }
201  // select POIs
203  for (const auto& i : myViewNet->getNet()->getPOIs()) {
204  GNEShape* shape = dynamic_cast<GNEShape*>(i.second);
205  if (shape->isAttributeCarrierSelected()) {
207  }
208  }
209  }
210  } else {
211  // select routes
213  for (const auto& i : myViewNet->getNet()->getAttributeCarriers().demandElements.at(SUMO_TAG_ROUTE)) {
214  if (i.second->isAttributeCarrierSelected()) {
215  i.second->setAttribute(GNE_ATTR_SELECTED, "false", myViewNet->getUndoList());
216  }
217  }
218  }
219  // select embedded route
222  if (i.second->isAttributeCarrierSelected()) {
223  i.second->setAttribute(GNE_ATTR_SELECTED, "false", myViewNet->getUndoList());
224  }
225  }
226  }
227  // select vehicles
229  for (const auto& i : myViewNet->getNet()->getAttributeCarriers().demandElements.at(SUMO_TAG_VEHICLE)) {
230  if (i.second->isAttributeCarrierSelected()) {
231  i.second->setAttribute(GNE_ATTR_SELECTED, "false", myViewNet->getUndoList());
232  }
233  }
234  }
235  // select trips
237  for (const auto& i : myViewNet->getNet()->getAttributeCarriers().demandElements.at(SUMO_TAG_TRIP)) {
238  if (i.second->isAttributeCarrierSelected()) {
239  i.second->setAttribute(GNE_ATTR_SELECTED, "false", myViewNet->getUndoList());
240  }
241  }
242  }
243  // select flows
245  for (const auto& i : myViewNet->getNet()->getAttributeCarriers().demandElements.at(SUMO_TAG_FLOW)) {
246  if (i.second->isAttributeCarrierSelected()) {
247  i.second->setAttribute(GNE_ATTR_SELECTED, "false", myViewNet->getUndoList());
248  }
249  }
250  }
251  // select route flows
253  for (const auto& i : myViewNet->getNet()->getAttributeCarriers().demandElements.at(SUMO_TAG_ROUTEFLOW)) {
254  if (i.second->isAttributeCarrierSelected()) {
255  i.second->setAttribute(GNE_ATTR_SELECTED, "false", myViewNet->getUndoList());
256  }
257  }
258  }
259  // select stops
261  for (const auto& i : myViewNet->getNet()->getAttributeCarriers().demandElements.at(SUMO_TAG_STOP_LANE)) {
262  if (i.second->isAttributeCarrierSelected()) {
263  i.second->setAttribute(GNE_ATTR_SELECTED, "false", myViewNet->getUndoList());
264  }
265  }
267  if (i.second->isAttributeCarrierSelected()) {
268  i.second->setAttribute(GNE_ATTR_SELECTED, "false", myViewNet->getUndoList());
269  }
270  }
272  if (i.second->isAttributeCarrierSelected()) {
273  i.second->setAttribute(GNE_ATTR_SELECTED, "false", myViewNet->getUndoList());
274  }
275  }
277  if (i.second->isAttributeCarrierSelected()) {
278  i.second->setAttribute(GNE_ATTR_SELECTED, "false", myViewNet->getUndoList());
279  }
280  }
282  if (i.second->isAttributeCarrierSelected()) {
283  i.second->setAttribute(GNE_ATTR_SELECTED, "false", myViewNet->getUndoList());
284  }
285  }
286  }
287  // select person
289  for (const auto& i : myViewNet->getNet()->getAttributeCarriers().demandElements.at(SUMO_TAG_PERSON)) {
290  if (i.second->isAttributeCarrierSelected()) {
291  i.second->setAttribute(GNE_ATTR_SELECTED, "false", myViewNet->getUndoList());
292  }
293  }
294  }
295  // select person flows
298  if (i.second->isAttributeCarrierSelected()) {
299  i.second->setAttribute(GNE_ATTR_SELECTED, "false", myViewNet->getUndoList());
300  }
301  }
302  }
303  // select person trips
306  if (i.second->isAttributeCarrierSelected()) {
307  i.second->setAttribute(GNE_ATTR_SELECTED, "false", myViewNet->getUndoList());
308  }
309  }
311  if (i.second->isAttributeCarrierSelected()) {
312  i.second->setAttribute(GNE_ATTR_SELECTED, "false", myViewNet->getUndoList());
313  }
314  }
315  }
316  // select ride
319  if (i.second->isAttributeCarrierSelected()) {
320  i.second->setAttribute(GNE_ATTR_SELECTED, "false", myViewNet->getUndoList());
321  }
322  }
324  if (i.second->isAttributeCarrierSelected()) {
325  i.second->setAttribute(GNE_ATTR_SELECTED, "false", myViewNet->getUndoList());
326  }
327  }
328  }
329  // select walks
332  if (i.second->isAttributeCarrierSelected()) {
333  i.second->setAttribute(GNE_ATTR_SELECTED, "false", myViewNet->getUndoList());
334  }
335  }
337  if (i.second->isAttributeCarrierSelected()) {
338  i.second->setAttribute(GNE_ATTR_SELECTED, "false", myViewNet->getUndoList());
339  }
340  }
342  if (i.second->isAttributeCarrierSelected()) {
343  i.second->setAttribute(GNE_ATTR_SELECTED, "false", myViewNet->getUndoList());
344  }
345  }
346  }
347  // select person stops
350  if (i.second->isAttributeCarrierSelected()) {
351  i.second->setAttribute(GNE_ATTR_SELECTED, "false", myViewNet->getUndoList());
352  }
353  }
355  if (i.second->isAttributeCarrierSelected()) {
356  i.second->setAttribute(GNE_ATTR_SELECTED, "false", myViewNet->getUndoList());
357  }
358  }
359  }
360  }
361  // finish selection operation
363  // update view
364  myViewNet->update();
365  }
366 }
367 
368 
369 void
370 GNESelectorFrame::handleIDs(const std::vector<GNEAttributeCarrier*>& ACs, ModificationMode::SetOperation setop) {
372  // declare two sets of attribute carriers, one for select and another for unselect
373  std::set<std::pair<std::string, GNEAttributeCarrier*> > ACToSelect;
374  std::set<std::pair<std::string, GNEAttributeCarrier*> > ACToUnselect;
375  // in restrict AND replace mode all current selected attribute carriers will be unselected
376  if ((setOperation == ModificationMode::SET_REPLACE) || (setOperation == ModificationMode::SET_RESTRICT)) {
377  // obtain selected ACs depending of current supermode
378  std::vector<GNEAttributeCarrier*> selectedAC = myViewNet->getNet()->getSelectedAttributeCarriers(false);
379  // add id into ACs to unselect
380  for (auto i : selectedAC) {
381  ACToUnselect.insert(std::pair<std::string, GNEAttributeCarrier*>(i->getID(), i));
382  }
383  }
384  // handle ids
385  for (auto i : ACs) {
386  // iterate over AtributeCarriers an place it in ACToSelect or ACToUnselect
387  switch (setOperation) {
389  ACToUnselect.insert(std::pair<std::string, GNEAttributeCarrier*>(i->getID(), i));
390  break;
392  if (ACToUnselect.find(std::pair<std::string, GNEAttributeCarrier*>(i->getID(), i)) != ACToUnselect.end()) {
393  ACToSelect.insert(std::pair<std::string, GNEAttributeCarrier*>(i->getID(), i));
394  }
395  break;
396  default:
397  ACToSelect.insert(std::pair<std::string, GNEAttributeCarrier*>(i->getID(), i));
398  break;
399  }
400  }
401  // select junctions and their connections if Auto select junctions is enabled (note: only for "add mode")
403  std::vector<GNEEdge*> edgesToSelect;
404  // iterate over ACToSelect and extract edges
405  for (auto i : ACToSelect) {
406  if (i.second->getTagProperty().getTag() == SUMO_TAG_EDGE) {
407  edgesToSelect.push_back(dynamic_cast<GNEEdge*>(i.second));
408  }
409  }
410  // iterate over extracted edges
411  for (auto i : edgesToSelect) {
412  // select junction source and all their connections and crossings
413  ACToSelect.insert(std::make_pair(i->getGNEJunctionSource()->getID(), i->getGNEJunctionSource()));
414  for (auto j : i->getGNEJunctionSource()->getGNEConnections()) {
415  ACToSelect.insert(std::make_pair(j->getID(), j));
416  }
417  for (auto j : i->getGNEJunctionSource()->getGNECrossings()) {
418  ACToSelect.insert(std::make_pair(j->getID(), j));
419  }
420  // select junction destiny and all their connections crossings
421  ACToSelect.insert(std::make_pair(i->getGNEJunctionDestiny()->getID(), i->getGNEJunctionDestiny()));
422  for (auto j : i->getGNEJunctionDestiny()->getGNEConnections()) {
423  ACToSelect.insert(std::make_pair(j->getID(), j));
424  }
425  for (auto j : i->getGNEJunctionDestiny()->getGNECrossings()) {
426  ACToSelect.insert(std::make_pair(j->getID(), j));
427  }
428  }
429  }
430  // only continue if there is ACs to select or unselect
431  if ((ACToSelect.size() + ACToUnselect.size()) > 0) {
432  // first unselect AC of ACToUnselect and then selects AC of ACToSelect
433  myViewNet->getUndoList()->p_begin("selection using rectangle");
434  for (auto i : ACToUnselect) {
435  if (i.second->getTagProperty().isSelectable()) {
436  i.second->setAttribute(GNE_ATTR_SELECTED, "false", myViewNet->getUndoList());
437  }
438  }
439  for (auto i : ACToSelect) {
440  if (i.second->getTagProperty().isSelectable()) {
441  i.second->setAttribute(GNE_ATTR_SELECTED, "true", myViewNet->getUndoList());
442  }
443  }
444  // finish operation
446  }
447  // update view
448  myViewNet->update();
449 }
450 
451 
454  return myModificationMode;
455 }
456 
457 
460  return myLockGLObjectTypes;
461 }
462 
463 
464 std::vector<GNEAttributeCarrier*>
465 GNESelectorFrame::getMatches(SumoXMLTag ACTag, SumoXMLAttr ACAttr, char compOp, double val, const std::string& expr) {
466  std::vector<GNEAttributeCarrier*> result;
467  std::vector<GNEAttributeCarrier*> allACbyTag = myViewNet->getNet()->retrieveAttributeCarriers(ACTag);
468  const auto& tagValue = GNEAttributeCarrier::getTagProperties(ACTag);
469  for (auto it : allACbyTag) {
470  if (expr == "") {
471  result.push_back(it);
472  } else if (tagValue.hasAttribute(ACAttr) && tagValue.getAttributeProperties(ACAttr).isNumerical()) {
473  double acVal;
474  std::istringstream buf(it->getAttribute(ACAttr));
475  buf >> acVal;
476  switch (compOp) {
477  case '<':
478  if (acVal < val) {
479  result.push_back(it);
480  }
481  break;
482  case '>':
483  if (acVal > val) {
484  result.push_back(it);
485  }
486  break;
487  case '=':
488  if (acVal == val) {
489  result.push_back(it);
490  }
491  break;
492  }
493  } else {
494  // string match
495  std::string acVal = it->getAttributeForSelection(ACAttr);
496  switch (compOp) {
497  case '@':
498  if (acVal.find(expr) != std::string::npos) {
499  result.push_back(it);
500  }
501  break;
502  case '!':
503  if (acVal.find(expr) == std::string::npos) {
504  result.push_back(it);
505  }
506  break;
507  case '=':
508  if (acVal == expr) {
509  result.push_back(it);
510  }
511  break;
512  case '^':
513  if (acVal != expr) {
514  result.push_back(it);
515  }
516  break;
517  }
518  }
519  }
520  return result;
521 }
522 
523 // ---------------------------------------------------------------------------
524 // ModificationMode::LockGLObjectTypes - methods
525 // ---------------------------------------------------------------------------
526 
528  FXGroupBox(selectorFrameParent->myContentFrame, "Locked selected items", GUIDesignGroupBoxFrame),
529  mySelectorFrameParent(selectorFrameParent) {
530  // create a matrix for TypeEntries
531  FXMatrix* matrixLockGLObjectTypes = new FXMatrix(this, 3, GUIDesignMatrixLockGLTypes);
532  // create typeEntries for the different Network elements
533  myTypeEntries[GLO_JUNCTION] = std::make_pair(Supermode::GNE_SUPERMODE_NETWORK, new ObjectTypeEntry(matrixLockGLObjectTypes, "Junctions"));
534  myTypeEntries[GLO_EDGE] = std::make_pair(Supermode::GNE_SUPERMODE_NETWORK, new ObjectTypeEntry(matrixLockGLObjectTypes, "Edges"));
535  myTypeEntries[GLO_LANE] = std::make_pair(Supermode::GNE_SUPERMODE_NETWORK, new ObjectTypeEntry(matrixLockGLObjectTypes, "Lanes"));
536  myTypeEntries[GLO_CONNECTION] = std::make_pair(Supermode::GNE_SUPERMODE_NETWORK, new ObjectTypeEntry(matrixLockGLObjectTypes, "Connections"));
537  myTypeEntries[GLO_ADDITIONAL] = std::make_pair(Supermode::GNE_SUPERMODE_NETWORK, new ObjectTypeEntry(matrixLockGLObjectTypes, "Additionals"));
538  myTypeEntries[GLO_CROSSING] = std::make_pair(Supermode::GNE_SUPERMODE_NETWORK, new ObjectTypeEntry(matrixLockGLObjectTypes, "Crossings"));
539  myTypeEntries[GLO_POLYGON] = std::make_pair(Supermode::GNE_SUPERMODE_NETWORK, new ObjectTypeEntry(matrixLockGLObjectTypes, "Polygons"));
540  myTypeEntries[GLO_POI] = std::make_pair(Supermode::GNE_SUPERMODE_NETWORK, new ObjectTypeEntry(matrixLockGLObjectTypes, "POIs"));
541  // create typeEntries for the different Demand elements
542  myTypeEntries[GLO_ROUTE] = std::make_pair(Supermode::GNE_SUPERMODE_DEMAND, new ObjectTypeEntry(matrixLockGLObjectTypes, "Routes"));
543  myTypeEntries[GLO_EMBEDDEDROUTE] = std::make_pair(Supermode::GNE_SUPERMODE_DEMAND, new ObjectTypeEntry(matrixLockGLObjectTypes, "Emb.Routes"));
544  myTypeEntries[GLO_VEHICLE] = std::make_pair(Supermode::GNE_SUPERMODE_DEMAND, new ObjectTypeEntry(matrixLockGLObjectTypes, "Vehicles"));
545  myTypeEntries[GLO_ROUTEFLOW] = std::make_pair(Supermode::GNE_SUPERMODE_DEMAND, new ObjectTypeEntry(matrixLockGLObjectTypes, "Flows"));
546  myTypeEntries[GLO_TRIP] = std::make_pair(Supermode::GNE_SUPERMODE_DEMAND, new ObjectTypeEntry(matrixLockGLObjectTypes, "Trips"));
547  myTypeEntries[GLO_FLOW] = std::make_pair(Supermode::GNE_SUPERMODE_DEMAND, new ObjectTypeEntry(matrixLockGLObjectTypes, "Flow"));
548  myTypeEntries[GLO_STOP] = std::make_pair(Supermode::GNE_SUPERMODE_DEMAND, new ObjectTypeEntry(matrixLockGLObjectTypes, "Stops"));
549  myTypeEntries[GLO_PERSON] = std::make_pair(Supermode::GNE_SUPERMODE_DEMAND, new ObjectTypeEntry(matrixLockGLObjectTypes, "Person"));
550  myTypeEntries[GLO_PERSONFLOW] = std::make_pair(Supermode::GNE_SUPERMODE_DEMAND, new ObjectTypeEntry(matrixLockGLObjectTypes, "PersonFlow"));
551  myTypeEntries[GLO_PERSONTRIP] = std::make_pair(Supermode::GNE_SUPERMODE_DEMAND, new ObjectTypeEntry(matrixLockGLObjectTypes, "PersonTrip"));
552  myTypeEntries[GLO_RIDE] = std::make_pair(Supermode::GNE_SUPERMODE_DEMAND, new ObjectTypeEntry(matrixLockGLObjectTypes, "Ride"));
553  myTypeEntries[GLO_WALK] = std::make_pair(Supermode::GNE_SUPERMODE_DEMAND, new ObjectTypeEntry(matrixLockGLObjectTypes, "Walk"));
554  myTypeEntries[GLO_PERSONSTOP] = std::make_pair(Supermode::GNE_SUPERMODE_DEMAND, new ObjectTypeEntry(matrixLockGLObjectTypes, "Personstop"));
555 }
556 
557 
559  // remove all type entries
560  for (const auto& i : myTypeEntries) {
561  delete i.second.second;
562  }
563 }
564 
565 
566 void
568  myTypeEntries.at(type).second->counterUp();
569 }
570 
571 
572 void
574  myTypeEntries.at(type).second->counterDown();
575 }
576 
577 
578 bool
580  if ((type >= 100) && (type < 199)) {
581  return myTypeEntries.at(GLO_ADDITIONAL).second->isGLTypeLocked();
582  } else {
583  return myTypeEntries.at(type).second->isGLTypeLocked();
584  }
585 }
586 
587 
588 void
590  for (const auto& i : myTypeEntries) {
591  // showr or hidde type entries depending of current supermode
592  if (i.second.first == mySelectorFrameParent->myViewNet->getEditModes().currentSupermode) {
593  i.second.second->showObjectTypeEntry();
594  } else {
595  i.second.second->hideObjectTypeEntry();
596  }
597  }
598  // recalc frame parent
599  recalc();
600 }
601 
602 
603 GNESelectorFrame::LockGLObjectTypes::ObjectTypeEntry::ObjectTypeEntry(FXMatrix* matrixParent, const std::string& label) :
604  FXObject(),
605  myCounter(0) {
606  // create elements
607  myLabelCounter = new FXLabel(matrixParent, "0", nullptr, GUIDesignLabelLeft);
608  myLabelTypeName = new FXLabel(matrixParent, (label + " ").c_str(), nullptr, GUIDesignLabelLeft);
609  myCheckBoxLocked = new FXCheckButton(matrixParent, "unlocked", this, MID_GNE_SET_ATTRIBUTE, GUIDesignCheckButton);
610 }
611 
612 
613 void
615  myLabelCounter->show();
616  myLabelTypeName->show();
617  myCheckBoxLocked->show();
618 }
619 
620 
621 void
623  myLabelCounter->hide();
624  myLabelTypeName->hide();
625  myCheckBoxLocked->hide();
626 }
627 
628 
629 void
631  myCounter++;
632  myLabelCounter->setText(toString(myCounter).c_str());
633 }
634 
635 
636 void
638  myCounter--;
639  myLabelCounter->setText(toString(myCounter).c_str());
640 }
641 
642 
643 bool
645  return (myCheckBoxLocked->getCheck() == TRUE);
646 }
647 
648 
649 long
651  if (myCheckBoxLocked->getCheck() == TRUE) {
652  myCheckBoxLocked->setText("locked");
653  } else {
654  myCheckBoxLocked->setText("unlocked");
655  }
656  return 1;
657 }
658 
659 // ---------------------------------------------------------------------------
660 // ModificationMode::ModificationMode - methods
661 // ---------------------------------------------------------------------------
662 
664  FXGroupBox(selectorFrameParent->myContentFrame, "Modification Mode", GUIDesignGroupBoxFrame),
665  myModificationModeType(SET_ADD) {
666  // Create all options buttons
667  myAddRadioButton = new FXRadioButton(this, "add\t\tSelected objects are added to the previous selection",
669  myRemoveRadioButton = new FXRadioButton(this, "remove\t\tSelected objects are removed from the previous selection",
671  myKeepRadioButton = new FXRadioButton(this, "keep\t\tRestrict previous selection by the current selection",
673  myReplaceRadioButton = new FXRadioButton(this, "replace\t\tReplace previous selection by the current selection",
675  myAddRadioButton->setCheck(true);
676 }
677 
678 
680 
681 
684  return myModificationModeType;
685 }
686 
687 
688 long
690  if (obj == myAddRadioButton) {
691  myModificationModeType = SET_ADD;
692  myAddRadioButton->setCheck(true);
693  myRemoveRadioButton->setCheck(false);
694  myKeepRadioButton->setCheck(false);
695  myReplaceRadioButton->setCheck(false);
696  return 1;
697  } else if (obj == myRemoveRadioButton) {
698  myModificationModeType = SET_SUB;
699  myAddRadioButton->setCheck(false);
700  myRemoveRadioButton->setCheck(true);
701  myKeepRadioButton->setCheck(false);
702  myReplaceRadioButton->setCheck(false);
703  return 1;
704  } else if (obj == myKeepRadioButton) {
705  myModificationModeType = SET_RESTRICT;
706  myAddRadioButton->setCheck(false);
707  myRemoveRadioButton->setCheck(false);
708  myKeepRadioButton->setCheck(true);
709  myReplaceRadioButton->setCheck(false);
710  return 1;
711  } else if (obj == myReplaceRadioButton) {
712  myModificationModeType = SET_REPLACE;
713  myAddRadioButton->setCheck(false);
714  myRemoveRadioButton->setCheck(false);
715  myKeepRadioButton->setCheck(false);
716  myReplaceRadioButton->setCheck(true);
717  return 1;
718  } else {
719  return 0;
720  }
721 }
722 
723 // ---------------------------------------------------------------------------
724 // ModificationMode::ElementSet - methods
725 // ---------------------------------------------------------------------------
726 
728  FXGroupBox(selectorFrameParent->myContentFrame, "Element Set", GUIDesignGroupBoxFrame),
729  mySelectorFrameParent(selectorFrameParent),
730  myCurrentElementSet(ELEMENTSET_NETELEMENT) {
731  // Create MatchTagBox for tags and fill it
733 }
734 
735 
737 
738 
741  return myCurrentElementSet;
742 }
743 
744 
745 void
747  // first clear item
748  mySetComboBox->clearItems();
749  // now fill elements depending of supermode
750  if (mySelectorFrameParent->myViewNet->getEditModes().currentSupermode == GNE_SUPERMODE_NETWORK) {
751  mySetComboBox->appendItem("Net Element");
752  mySetComboBox->appendItem("Additional");
753  mySetComboBox->appendItem("Shape");
754  } else {
755  mySetComboBox->appendItem("Demand Element");
756  }
757  mySetComboBox->setNumVisible(mySetComboBox->getNumItems());
758  // update rest of elements
759  onCmdSelectElementSet(0, 0, 0);
760 }
761 
762 
763 long
765  // check depending of current supermode
766  if (mySelectorFrameParent->myViewNet->getEditModes().currentSupermode == GNE_SUPERMODE_NETWORK) {
767  if (mySetComboBox->getText() == "Net Element") {
768  myCurrentElementSet = ELEMENTSET_NETELEMENT;
769  mySetComboBox->setTextColor(FXRGB(0, 0, 0));
770  // enable match attribute
771  mySelectorFrameParent->myMatchAttribute->enableMatchAttribute();
772  } else if (mySetComboBox->getText() == "Additional") {
773  myCurrentElementSet = ELEMENTSET_ADDITIONAL;
774  mySetComboBox->setTextColor(FXRGB(0, 0, 0));
775  // enable match attribute
776  mySelectorFrameParent->myMatchAttribute->enableMatchAttribute();
777  } else if (mySetComboBox->getText() == "Shape") {
778  myCurrentElementSet = ELEMENTSET_SHAPE;
779  mySetComboBox->setTextColor(FXRGB(0, 0, 0));
780  // enable match attribute
781  mySelectorFrameParent->myMatchAttribute->enableMatchAttribute();
782  } else {
783  myCurrentElementSet = ELEMENTSET_INVALID;
784  mySetComboBox->setTextColor(FXRGB(255, 0, 0));
785  // disable match attribute
786  mySelectorFrameParent->myMatchAttribute->disableMatchAttribute();
787  }
788  } else {
789  if (mySetComboBox->getText() == "Demand Element") {
790  myCurrentElementSet = ELEMENTSET_DEMANDELEMENT;
791  mySetComboBox->setTextColor(FXRGB(0, 0, 0));
792  // enable match attribute
793  mySelectorFrameParent->myMatchAttribute->enableMatchAttribute();
794  } else {
795  myCurrentElementSet = ELEMENTSET_INVALID;
796  mySetComboBox->setTextColor(FXRGB(255, 0, 0));
797  // disable match attribute
798  mySelectorFrameParent->myMatchAttribute->disableMatchAttribute();
799  }
800  }
801  return 1;
802 }
803 
804 // ---------------------------------------------------------------------------
805 // ModificationMode::MatchAttribute - methods
806 // ---------------------------------------------------------------------------
807 
809  FXGroupBox(selectorFrameParent->myContentFrame, "Match Attribute", GUIDesignGroupBoxFrame),
810  mySelectorFrameParent(selectorFrameParent),
811  myCurrentTag(SUMO_TAG_EDGE),
812  myCurrentAttribute(SUMO_ATTR_ID) {
813  // Create MatchTagBox for tags
815  // Create listBox for Attributes
817  // Create TextField for Match string
819  // Create help button
820  new FXButton(this, "Help", nullptr, this, MID_HELP, GUIDesignButtonRectangular);
821  // Fill list of sub-items (first element will be "edge")
823  // Set speed of edge as default attribute
824  myMatchAttrComboBox->setText("speed");
826  // Set default value for Match string
827  myMatchString->setText(">10.0");
828 }
829 
830 
832 
833 
834 void
836  // enable comboboxes and text field
837  myMatchTagComboBox->enable();
838  myMatchAttrComboBox->enable();
839  myMatchString->enable();
840  // Clear items of myMatchTagComboBox
841  myMatchTagComboBox->clearItems();
842  // Set items depending of current item set
843  std::vector<SumoXMLTag> listOfTags;
844  if (mySelectorFrameParent->myElementSet->getElementSet() == ElementSet::ELEMENTSET_NETELEMENT) {
845  listOfTags = GNEAttributeCarrier::allowedTagsByCategory(GNEAttributeCarrier::TagType::TAGTYPE_NETELEMENT, true);
846  } else if (mySelectorFrameParent->myElementSet->getElementSet() == ElementSet::ELEMENTSET_ADDITIONAL) {
847  listOfTags = GNEAttributeCarrier::allowedTagsByCategory(GNEAttributeCarrier::TagType::TAGTYPE_ADDITIONAL | GNEAttributeCarrier::TagType::TAGTYPE_TAZ, true);
848  } else if (mySelectorFrameParent->myElementSet->getElementSet() == ElementSet::ELEMENTSET_SHAPE) {
849  listOfTags = GNEAttributeCarrier::allowedTagsByCategory(GNEAttributeCarrier::TagType::TAGTYPE_SHAPE, true);
850  } else if (mySelectorFrameParent->myElementSet->getElementSet() == ElementSet::ELEMENTSET_DEMANDELEMENT) {
851  listOfTags = GNEAttributeCarrier::allowedTagsByCategory(GNEAttributeCarrier::TagType::TAGTYPE_DEMANDELEMENT | GNEAttributeCarrier::TagType::TAGTYPE_STOP, true);
852  } else {
853  throw ProcessError("Invalid element set");
854  }
855  // fill combo box
856  for (auto i : listOfTags) {
857  myMatchTagComboBox->appendItem(toString(i).c_str());
858  }
859  // set first item as current item
860  myMatchTagComboBox->setCurrentItem(0);
861  myMatchTagComboBox->setNumVisible(myMatchTagComboBox->getNumItems());
862  // Fill attributes with the current element type
863  onCmdSelMBTag(nullptr, 0, nullptr);
864 }
865 
866 
867 void
869  // disable comboboxes and text field
870  myMatchTagComboBox->disable();
871  myMatchAttrComboBox->disable();
872  myMatchString->disable();
873  // change colors to black (even if there are invalid values)
874  myMatchTagComboBox->setTextColor(FXRGB(0, 0, 0));
875  myMatchAttrComboBox->setTextColor(FXRGB(0, 0, 0));
876  myMatchString->setTextColor(FXRGB(0, 0, 0));
877 }
878 
879 
880 long
881 GNESelectorFrame::MatchAttribute::onCmdSelMBTag(FXObject*, FXSelector, void*) {
882  // First check what type of elementes is being selected
883  myCurrentTag = SUMO_TAG_NOTHING;
884  // find current element tag
885  std::vector<SumoXMLTag> listOfTags;
886  if (mySelectorFrameParent->myElementSet->getElementSet() == ElementSet::ELEMENTSET_NETELEMENT) {
887  listOfTags = GNEAttributeCarrier::allowedTagsByCategory(GNEAttributeCarrier::TagType::TAGTYPE_NETELEMENT, true);
888  } else if (mySelectorFrameParent->myElementSet->getElementSet() == ElementSet::ELEMENTSET_ADDITIONAL) {
889  listOfTags = GNEAttributeCarrier::allowedTagsByCategory(GNEAttributeCarrier::TagType::TAGTYPE_ADDITIONAL | GNEAttributeCarrier::TagType::TAGTYPE_TAZ, true);
890  } else if (mySelectorFrameParent->myElementSet->getElementSet() == ElementSet::ELEMENTSET_SHAPE) {
891  listOfTags = GNEAttributeCarrier::allowedTagsByCategory(GNEAttributeCarrier::TagType::TAGTYPE_SHAPE, true);
892  } else if (mySelectorFrameParent->myElementSet->getElementSet() == ElementSet::ELEMENTSET_DEMANDELEMENT) {
893  listOfTags = GNEAttributeCarrier::allowedTagsByCategory(GNEAttributeCarrier::TagType::TAGTYPE_DEMANDELEMENT | GNEAttributeCarrier::TagType::TAGTYPE_STOP, true);
894  } else {
895  throw ProcessError("Unkown set");
896  }
897  // fill myMatchTagComboBox
898  for (auto i : listOfTags) {
899  if (toString(i) == myMatchTagComboBox->getText().text()) {
900  myCurrentTag = i;
901  }
902  }
903  // check that typed-by-user value is correct
904  if (myCurrentTag != SUMO_TAG_NOTHING) {
905  // obtain tag property (only for improve code legibility)
906  const auto& tagValue = GNEAttributeCarrier::getTagProperties(myCurrentTag);
907  // set color and enable items
908  myMatchTagComboBox->setTextColor(FXRGB(0, 0, 0));
909  myMatchAttrComboBox->enable();
910  myMatchString->enable();
911  myMatchAttrComboBox->clearItems();
912  // fill attribute combo box
913  for (auto it : tagValue) {
914  myMatchAttrComboBox->appendItem(it.getAttrStr().c_str());
915  }
916  // Add extra attribute "Parameter"
917  myMatchAttrComboBox->appendItem(toString(GNE_ATTR_PARAMETERS).c_str());
918  // check if item can block movement
919  if (tagValue.canBlockMovement()) {
920  myMatchAttrComboBox->appendItem(toString(GNE_ATTR_BLOCK_MOVEMENT).c_str());
921  }
922  // check if item can block shape
923  if (tagValue.canBlockShape()) {
924  myMatchAttrComboBox->appendItem(toString(GNE_ATTR_BLOCK_SHAPE).c_str());
925  }
926  // check if item can close shape
927  if (tagValue.canCloseShape()) {
928  myMatchAttrComboBox->appendItem(toString(GNE_ATTR_CLOSE_SHAPE).c_str());
929  }
930  // check if item can have parent
931  if (tagValue.hasParent()) {
932  myMatchAttrComboBox->appendItem(toString(GNE_ATTR_PARENT).c_str());
933  }
934  // @ToDo: Here can be placed a button to set the default value
935  myMatchAttrComboBox->setNumVisible(myMatchAttrComboBox->getNumItems());
936  // check if we have to update attribute
937  if (tagValue.hasAttribute(myCurrentAttribute)) {
938  myMatchAttrComboBox->setText(toString(myCurrentAttribute).c_str());
939  } else {
940  onCmdSelMBAttribute(nullptr, 0, nullptr);
941  }
942  } else {
943  // change color to red and disable items
944  myMatchTagComboBox->setTextColor(FXRGB(255, 0, 0));
945  myMatchAttrComboBox->disable();
946  myMatchString->disable();
947  }
948  update();
949  return 1;
950 }
951 
952 
953 long
955  // first obtain a copy of item attributes vinculated with current tag
956  auto tagPropertiesCopy = GNEAttributeCarrier::getTagProperties(myCurrentTag);
957  // obtain tag property (only for improve code legibility)
958  const auto& tagValue = GNEAttributeCarrier::getTagProperties(myCurrentTag);
959  // add an extra AttributeValues to allow select ACs using as criterium "parameters"
962  GNEAttributeCarrier::AttrProperty::ATTRPROPERTY_STRING,
963  "Parameters");
964  tagPropertiesCopy.addAttribute(extraAttrProperty);
965  // add extra attribute if item can block movement
966  if (tagValue.canBlockMovement()) {
967  // add an extra AttributeValues to allow select ACs using as criterium "block movement"
969  GNEAttributeCarrier::AttrProperty::ATTRPROPERTY_BOOL | GNEAttributeCarrier::AttrProperty::ATTRPROPERTY_DEFAULTVALUESTATIC,
970  "Block movement",
971  "false");
972  tagPropertiesCopy.addAttribute(extraAttrProperty);
973  }
974  // add extra attribute if item can block shape
975  if (tagValue.canBlockShape()) {
976  // add an extra AttributeValues to allow select ACs using as criterium "block shape"
978  GNEAttributeCarrier::AttrProperty::ATTRPROPERTY_BOOL | GNEAttributeCarrier::AttrProperty::ATTRPROPERTY_DEFAULTVALUESTATIC,
979  "Block shape",
980  "false");
981  tagPropertiesCopy.addAttribute(extraAttrProperty);
982  }
983  // add extra attribute if item can close shape
984  if (tagValue.canCloseShape()) {
985  // add an extra AttributeValues to allow select ACs using as criterium "close shape"
987  GNEAttributeCarrier::AttrProperty::ATTRPROPERTY_BOOL | GNEAttributeCarrier::AttrProperty::ATTRPROPERTY_DEFAULTVALUESTATIC,
988  "Close shape",
989  "true");
990  tagPropertiesCopy.addAttribute(extraAttrProperty);
991  }
992  // add extra attribute if item can have parent
993  if (tagValue.hasParent()) {
994  // add an extra AttributeValues to allow select ACs using as criterium "parent"
996  GNEAttributeCarrier::AttrProperty::ATTRPROPERTY_STRING,
997  "Parent element");
998  tagPropertiesCopy.addAttribute(extraAttrProperty);
999  }
1000  // set current selected attribute
1001  myCurrentAttribute = SUMO_ATTR_NOTHING;
1002  for (const auto& i : tagPropertiesCopy) {
1003  if (i.getAttrStr() == myMatchAttrComboBox->getText().text()) {
1004  myCurrentAttribute = i.getAttr();
1005  }
1006  }
1007  // check if selected attribute is valid
1008  if (myCurrentAttribute != SUMO_ATTR_NOTHING) {
1009  myMatchAttrComboBox->setTextColor(FXRGB(0, 0, 0));
1010  myMatchString->enable();
1011  } else {
1012  myMatchAttrComboBox->setTextColor(FXRGB(255, 0, 0));
1013  myMatchString->disable();
1014  }
1015  return 1;
1016 }
1017 
1018 
1019 long
1021  // obtain expresion
1022  std::string expr(myMatchString->getText().text());
1023  const auto& tagValue = GNEAttributeCarrier::getTagProperties(myCurrentTag);
1024  bool valid = true;
1025  if (expr == "") {
1026  // the empty expression matches all objects
1027  mySelectorFrameParent->handleIDs(mySelectorFrameParent->getMatches(myCurrentTag, myCurrentAttribute, '@', 0, expr));
1028  } else if (tagValue.hasAttribute(myCurrentAttribute) && tagValue.getAttributeProperties(myCurrentAttribute).isNumerical()) {
1029  // The expression must have the form
1030  // <val matches if attr < val
1031  // >val matches if attr > val
1032  // =val matches if attr = val
1033  // val matches if attr = val
1034  char compOp = expr[0];
1035  if (compOp == '<' || compOp == '>' || compOp == '=') {
1036  expr = expr.substr(1);
1037  } else {
1038  compOp = '=';
1039  }
1040  // check if value can be parsed to double
1041  if (GNEAttributeCarrier::canParse<double>(expr.c_str())) {
1042  mySelectorFrameParent->handleIDs(mySelectorFrameParent->getMatches(myCurrentTag, myCurrentAttribute, compOp, GNEAttributeCarrier::parse<double>(expr.c_str()), expr));
1043  } else {
1044  valid = false;
1045  }
1046  } else {
1047  // The expression must have the form
1048  // =str: matches if <str> is an exact match
1049  // !str: matches if <str> is not a substring
1050  // ^str: matches if <str> is not an exact match
1051  // str: matches if <str> is a substring (sends compOp '@')
1052  // Alternatively, if the expression is empty it matches all objects
1053  char compOp = expr[0];
1054  if (compOp == '=' || compOp == '!' || compOp == '^') {
1055  expr = expr.substr(1);
1056  } else {
1057  compOp = '@';
1058  }
1059  mySelectorFrameParent->handleIDs(mySelectorFrameParent->getMatches(myCurrentTag, myCurrentAttribute, compOp, 0, expr));
1060  }
1061  if (valid) {
1062  myMatchString->setTextColor(FXRGB(0, 0, 0));
1063  myMatchString->killFocus();
1064  } else {
1065  myMatchString->setTextColor(FXRGB(255, 0, 0));
1066  }
1067  return 1;
1068 }
1069 
1070 
1071 long
1072 GNESelectorFrame::MatchAttribute::onCmdHelp(FXObject*, FXSelector, void*) {
1073  // Create dialog box
1074  FXDialogBox* additionalNeteditAttributesHelpDialog = new FXDialogBox(this, "Netedit Parameters Help", GUIDesignDialogBox);
1075  additionalNeteditAttributesHelpDialog->setIcon(GUIIconSubSys::getIcon(ICON_MODEADDITIONAL));
1076  // set help text
1077  std::ostringstream help;
1078  help
1079  << "- The 'Match Attribute' controls allow to specify a set of objects which are then applied to the current selection\n"
1080  << " according to the current 'Modification Mode'.\n"
1081  << " 1. Select an object type from the first input box\n"
1082  << " 2. Select an attribute from the second input box\n"
1083  << " 3. Enter a 'match expression' in the third input box and press <return>\n"
1084  << "\n"
1085  << "- The empty expression matches all objects\n"
1086  << "- For numerical attributes the match expression must consist of a comparison operator ('<', '>', '=') and a number.\n"
1087  << "- An object matches if the comparison between its attribute and the given number by the given operator evaluates to 'true'\n"
1088  << "\n"
1089  << "- For string attributes the match expression must consist of a comparison operator ('', '=', '!', '^') and a string.\n"
1090  << " '' (no operator) matches if string is a substring of that object'ts attribute.\n"
1091  << " '=' matches if string is an exact match.\n"
1092  << " '!' matches if string is not a substring.\n"
1093  << " '^' matches if string is not an exact match.\n"
1094  << "\n"
1095  << "- Examples:\n"
1096  << " junction; id; 'foo' -> match all junctions that have 'foo' in their id\n"
1097  << " junction; type; '=priority' -> match all junctions of type 'priority', but not of type 'priority_stop'\n"
1098  << " edge; speed; '>10' -> match all edges with a speed above 10\n";
1099  // Create label with the help text
1100  new FXLabel(additionalNeteditAttributesHelpDialog, help.str().c_str(), nullptr, GUIDesignLabelFrameInformation);
1101  // Create horizontal separator
1102  new FXHorizontalSeparator(additionalNeteditAttributesHelpDialog, GUIDesignHorizontalSeparator);
1103  // Create frame for OK Button
1104  FXHorizontalFrame* myHorizontalFrameOKButton = new FXHorizontalFrame(additionalNeteditAttributesHelpDialog, GUIDesignAuxiliarHorizontalFrame);
1105  // Create Button Close (And two more horizontal frames to center it)
1106  new FXHorizontalFrame(myHorizontalFrameOKButton, GUIDesignAuxiliarHorizontalFrame);
1107  new FXButton(myHorizontalFrameOKButton, "OK\t\tclose", GUIIconSubSys::getIcon(ICON_ACCEPT), additionalNeteditAttributesHelpDialog, FXDialogBox::ID_ACCEPT, GUIDesignButtonOK);
1108  new FXHorizontalFrame(myHorizontalFrameOKButton, GUIDesignAuxiliarHorizontalFrame);
1109  // Write Warning in console if we're in testing mode
1110  WRITE_DEBUG("Opening help dialog of selector frame");
1111  // create Dialog
1112  additionalNeteditAttributesHelpDialog->create();
1113  // show in the given position
1114  additionalNeteditAttributesHelpDialog->show(PLACEMENT_CURSOR);
1115  // refresh APP
1116  getApp()->refresh();
1117  // open as modal dialog (will block all windows until stop() or stopModal() is called)
1118  getApp()->runModalFor(additionalNeteditAttributesHelpDialog);
1119  // Write Warning in console if we're in testing mode
1120  WRITE_DEBUG("Close help dialog of selector frame");
1121  return 1;
1122 }
1123 
1124 // ---------------------------------------------------------------------------
1125 // ModificationMode::VisualScaling - methods
1126 // ---------------------------------------------------------------------------
1127 
1129  FXGroupBox(selectorFrameParent->myContentFrame, "Visual Scaling", GUIDesignGroupBoxFrame),
1130  mySelectorFrameParent(selectorFrameParent) {
1131  // Create spin button and configure it
1132  mySelectionScaling = new FXRealSpinner(this, 7, this, MID_GNE_SELECTORFRAME_SELECTSCALE, GUIDesignSpinDial);
1133  //mySelectionScaling->setNumberFormat(1);
1134  //mySelectionScaling->setIncrements(0.1, .5, 1);
1135  mySelectionScaling->setIncrement(0.5);
1136  mySelectionScaling->setRange(1, 100000);
1137  mySelectionScaling->setValue(1);
1138  mySelectionScaling->setHelpText("Enlarge selected objects");
1139 }
1140 
1141 
1143 
1144 
1145 long
1147  // set scale in viewnet
1148  mySelectorFrameParent->myViewNet->setSelectionScaling(mySelectionScaling->getValue());
1149  mySelectorFrameParent->myViewNet->update();
1150  return 1;
1151 }
1152 
1153 // ---------------------------------------------------------------------------
1154 // ModificationMode::SelectionOperation - methods
1155 // ---------------------------------------------------------------------------
1156 
1158  FXGroupBox(selectorFrameParent->myContentFrame, "Operations for selections", GUIDesignGroupBoxFrame),
1159  mySelectorFrameParent(selectorFrameParent) {
1160  // Create "Clear List" Button
1161  new FXButton(this, "Clear\t\t", nullptr, this, MID_CHOOSEN_CLEAR, GUIDesignButton);
1162  // Create "Invert" Button
1163  new FXButton(this, "Invert\t\t", nullptr, this, MID_CHOOSEN_INVERT, GUIDesignButton);
1164  // Create "Save" Button
1165  new FXButton(this, "Save\t\tSave ids of currently selected objects to a file.", nullptr, this, MID_CHOOSEN_SAVE, GUIDesignButton);
1166  // Create "Load" Button
1167  new FXButton(this, "Load\t\tLoad ids from a file according to the current modfication mode.", nullptr, this, MID_CHOOSEN_LOAD, GUIDesignButton);
1168 }
1169 
1170 
1172 
1173 
1174 long
1176  // get the new file name
1177  FXFileDialog opendialog(this, "Open List of Selected Items");
1178  opendialog.setIcon(GUIIconSubSys::getIcon(ICON_EMPTY));
1179  opendialog.setSelectMode(SELECTFILE_EXISTING);
1180  opendialog.setPatternList("Selection files (*.txt)\nAll files (*)");
1181  if (gCurrentFolder.length() != 0) {
1182  opendialog.setDirectory(gCurrentFolder);
1183  }
1184  if (opendialog.execute()) {
1185  std::vector<GNEAttributeCarrier*> loadedACs;
1186  gCurrentFolder = opendialog.getDirectory();
1187  std::string file = opendialog.getFilename().text();
1188  std::ostringstream msg;
1189  std::ifstream strm(file.c_str());
1190  // check if file can be opened
1191  if (!strm.good()) {
1192  WRITE_ERROR("Could not open '" + file + "'.");
1193  return 0;
1194  }
1195  while (strm.good()) {
1196  std::string line;
1197  strm >> line;
1198  // check if line isn't empty
1199  if (line.length() != 0) {
1200  // obtain GLObject
1202  // check if GUIGlObject exist and their their GL type isn't blocked
1203  if ((object != nullptr) && !mySelectorFrameParent->myLockGLObjectTypes->IsObjectTypeLocked(object->getType())) {
1204  // obtain GNEAttributeCarrier
1205  GNEAttributeCarrier* AC = mySelectorFrameParent->myViewNet->getNet()->retrieveAttributeCarrier(object->getGlID(), false);
1206  // check if AC exist and if is selectable
1207  if (AC && AC->getTagProperty().isSelectable())
1208  // now check if we're in the correct supermode to load this element
1209  if (((mySelectorFrameParent->myViewNet->getEditModes().currentSupermode == GNE_SUPERMODE_NETWORK) && !AC->getTagProperty().isDemandElement()) ||
1210  ((mySelectorFrameParent->myViewNet->getEditModes().currentSupermode == GNE_SUPERMODE_DEMAND) && AC->getTagProperty().isDemandElement())) {
1211  loadedACs.push_back(AC);
1212  }
1213  }
1214  }
1215  }
1216  // change selected attribute in loaded ACs allowing undo/redo
1217  if (loadedACs.size() > 0) {
1218  mySelectorFrameParent->myViewNet->getUndoList()->p_begin("load selection");
1219  mySelectorFrameParent->handleIDs(loadedACs);
1220  mySelectorFrameParent->myViewNet->getUndoList()->p_end();
1221  }
1222  }
1223  mySelectorFrameParent->myViewNet->update();
1224  return 1;
1225 }
1226 
1227 
1228 long
1230  FXString file = MFXUtils::getFilename2Write(
1231  this, "Save List of selected Items", ".txt", GUIIconSubSys::getIcon(ICON_EMPTY), gCurrentFolder);
1232  if (file == "") {
1233  return 1;
1234  }
1235  try {
1236  OutputDevice& dev = OutputDevice::getDevice(file.text());
1237  for (auto i : mySelectorFrameParent->myViewNet->getNet()->getSelectedAttributeCarriers(false)) {
1238  GUIGlObject* object = dynamic_cast<GUIGlObject*>(i);
1239  if (object) {
1240  dev << GUIGlObject::TypeNames.getString(object->getType()) << ":" << i->getID() << "\n";
1241  }
1242  }
1243  dev.close();
1244  } catch (IOError& e) {
1245  // write warning if netedit is running in testing mode
1246  WRITE_DEBUG("Opening FXMessageBox 'error storing selection'");
1247  // open message box error
1248  FXMessageBox::error(this, MBOX_OK, "Storing Selection failed", "%s", e.what());
1249  // write warning if netedit is running in testing mode
1250  WRITE_DEBUG("Closed FXMessageBox 'error storing selection' with 'OK'");
1251  }
1252  return 1;
1253 }
1254 
1255 
1256 long
1258  // clear current selection
1259  mySelectorFrameParent->clearCurrentSelection();
1260  return 1;
1261 }
1262 
1263 
1264 long
1266  // only continue if there is element for selecting
1267  if (mySelectorFrameParent->ACsToSelected()) {
1268  // obtan locks (only for improve code legibly)
1269  LockGLObjectTypes* locks = mySelectorFrameParent->getLockGLObjectTypes();
1270  // for invert selection, first clean current selection and next select elements of set "unselectedElements"
1271  mySelectorFrameParent->myViewNet->getUndoList()->p_begin("invert selection");
1272  // invert selection of elements depending of current supermode
1273  if (mySelectorFrameParent->myViewNet->getEditModes().currentSupermode == GNE_SUPERMODE_NETWORK) {
1274  // iterate over junctions
1275  for (const auto& i : mySelectorFrameParent->myViewNet->getNet()->getAttributeCarriers().junctions) {
1276  // check if junction selection is locked
1277  if (!locks->IsObjectTypeLocked(GLO_JUNCTION)) {
1278  if (i.second->isAttributeCarrierSelected()) {
1279  i.second->setAttribute(GNE_ATTR_SELECTED, "false", mySelectorFrameParent->myViewNet->getUndoList());
1280  } else {
1281  i.second->setAttribute(GNE_ATTR_SELECTED, "true", mySelectorFrameParent->myViewNet->getUndoList());
1282  }
1283  }
1284  // due we iterate over all junctions, only it's neccesary iterate over incoming edges
1285  for (const auto& j : i.second->getGNEIncomingEdges()) {
1286  // only select edges if "select edges" flag is enabled. In other case, select only lanes
1287  if (mySelectorFrameParent->myViewNet->getNetworkViewOptions().selectEdges()) {
1288  // check if edge selection is locked
1289  if (!locks->IsObjectTypeLocked(GLO_EDGE)) {
1290  if (j->isAttributeCarrierSelected()) {
1291  j->setAttribute(GNE_ATTR_SELECTED, "false", mySelectorFrameParent->myViewNet->getUndoList());
1292  } else {
1293  j->setAttribute(GNE_ATTR_SELECTED, "true", mySelectorFrameParent->myViewNet->getUndoList());
1294  }
1295  }
1296  } else {
1297  // check if lane selection is locked
1298  if (!locks->IsObjectTypeLocked(GLO_LANE)) {
1299  for (auto k : j->getLanes()) {
1300  if (k->isAttributeCarrierSelected()) {
1301  k->setAttribute(GNE_ATTR_SELECTED, "false", mySelectorFrameParent->myViewNet->getUndoList());
1302  } else {
1303  k->setAttribute(GNE_ATTR_SELECTED, "true", mySelectorFrameParent->myViewNet->getUndoList());
1304  }
1305  }
1306  }
1307  }
1308  // check if connection selection is locked
1309  if (!locks->IsObjectTypeLocked(GLO_CONNECTION)) {
1310  for (const auto& k : j->getGNEConnections()) {
1311  if (k->isAttributeCarrierSelected()) {
1312  k->setAttribute(GNE_ATTR_SELECTED, "false", mySelectorFrameParent->myViewNet->getUndoList());
1313  } else {
1314  k->setAttribute(GNE_ATTR_SELECTED, "true", mySelectorFrameParent->myViewNet->getUndoList());
1315  }
1316  }
1317  }
1318  }
1319  // check if crossing selection is locked
1320  if (!locks->IsObjectTypeLocked(GLO_CROSSING)) {
1321  for (const auto& j : i.second->getGNECrossings()) {
1322  if (j->isAttributeCarrierSelected()) {
1323  j->setAttribute(GNE_ATTR_SELECTED, "false", mySelectorFrameParent->myViewNet->getUndoList());
1324  } else {
1325  j->setAttribute(GNE_ATTR_SELECTED, "true", mySelectorFrameParent->myViewNet->getUndoList());
1326  }
1327  }
1328  }
1329  }
1330  // check if additionals selection is locked
1331  if (!locks->IsObjectTypeLocked(GLO_ADDITIONAL)) {
1332  for (const auto& i : mySelectorFrameParent->myViewNet->getNet()->getAttributeCarriers().additionals) {
1333  // first check if additional is selectable
1335  for (const auto& j : i.second) {
1336  if (j.second->isAttributeCarrierSelected()) {
1337  j.second->setAttribute(GNE_ATTR_SELECTED, "false", mySelectorFrameParent->myViewNet->getUndoList());
1338  } else {
1339  j.second->setAttribute(GNE_ATTR_SELECTED, "true", mySelectorFrameParent->myViewNet->getUndoList());
1340  }
1341  }
1342  }
1343  }
1344  }
1345  // select polygons
1346  if (!locks->IsObjectTypeLocked(GLO_POLYGON)) {
1347  for (const auto& i : mySelectorFrameParent->myViewNet->getNet()->getPolygons()) {
1348  GNEShape* shape = dynamic_cast<GNEShape*>(i.second);
1349  if (shape->isAttributeCarrierSelected()) {
1350  shape->setAttribute(GNE_ATTR_SELECTED, "false", mySelectorFrameParent->myViewNet->getUndoList());
1351  } else {
1352  shape->setAttribute(GNE_ATTR_SELECTED, "true", mySelectorFrameParent->myViewNet->getUndoList());
1353  }
1354  }
1355  }
1356  // select POIs
1357  if (!locks->IsObjectTypeLocked(GLO_POI)) {
1358  for (const auto& i : mySelectorFrameParent->myViewNet->getNet()->getPOIs()) {
1359  GNEShape* shape = dynamic_cast<GNEShape*>(i.second);
1360  if (shape->isAttributeCarrierSelected()) {
1361  shape->setAttribute(GNE_ATTR_SELECTED, "false", mySelectorFrameParent->myViewNet->getUndoList());
1362  } else {
1363  shape->setAttribute(GNE_ATTR_SELECTED, "true", mySelectorFrameParent->myViewNet->getUndoList());
1364  }
1365  }
1366  }
1367  } else {
1368  // select routes
1369  if (!locks->IsObjectTypeLocked(GLO_ROUTE)) {
1370  for (const auto& i : mySelectorFrameParent->myViewNet->getNet()->getAttributeCarriers().demandElements.at(SUMO_TAG_ROUTE)) {
1371  if (i.second->isAttributeCarrierSelected()) {
1372  i.second->setAttribute(GNE_ATTR_SELECTED, "false", mySelectorFrameParent->myViewNet->getUndoList());
1373  } else {
1374  i.second->setAttribute(GNE_ATTR_SELECTED, "true", mySelectorFrameParent->myViewNet->getUndoList());
1375  }
1376  }
1377  }
1378  // select embedded routes
1379  if (!locks->IsObjectTypeLocked(GLO_EMBEDDEDROUTE)) {
1380  for (const auto& i : mySelectorFrameParent->myViewNet->getNet()->getAttributeCarriers().demandElements.at(SUMO_TAG_EMBEDDEDROUTE)) {
1381  if (i.second->isAttributeCarrierSelected()) {
1382  i.second->setAttribute(GNE_ATTR_SELECTED, "false", mySelectorFrameParent->myViewNet->getUndoList());
1383  } else {
1384  i.second->setAttribute(GNE_ATTR_SELECTED, "true", mySelectorFrameParent->myViewNet->getUndoList());
1385  }
1386  }
1387  }
1388  // select vehicles
1389  if (!locks->IsObjectTypeLocked(GLO_VEHICLE)) {
1390  for (const auto& i : mySelectorFrameParent->myViewNet->getNet()->getAttributeCarriers().demandElements.at(SUMO_TAG_VEHICLE)) {
1391  if (i.second->isAttributeCarrierSelected()) {
1392  i.second->setAttribute(GNE_ATTR_SELECTED, "false", mySelectorFrameParent->myViewNet->getUndoList());
1393  } else {
1394  i.second->setAttribute(GNE_ATTR_SELECTED, "true", mySelectorFrameParent->myViewNet->getUndoList());
1395  }
1396  }
1397  }
1398  // select trips
1399  if (!locks->IsObjectTypeLocked(GLO_TRIP)) {
1400  for (const auto& i : mySelectorFrameParent->myViewNet->getNet()->getAttributeCarriers().demandElements.at(SUMO_TAG_TRIP)) {
1401  if (i.second->isAttributeCarrierSelected()) {
1402  i.second->setAttribute(GNE_ATTR_SELECTED, "false", mySelectorFrameParent->myViewNet->getUndoList());
1403  } else {
1404  i.second->setAttribute(GNE_ATTR_SELECTED, "true", mySelectorFrameParent->myViewNet->getUndoList());
1405  }
1406  }
1407  }
1408  // select flows
1409  if (!locks->IsObjectTypeLocked(GLO_FLOW)) {
1410  for (const auto& i : mySelectorFrameParent->myViewNet->getNet()->getAttributeCarriers().demandElements.at(SUMO_TAG_FLOW)) {
1411  if (i.second->isAttributeCarrierSelected()) {
1412  i.second->setAttribute(GNE_ATTR_SELECTED, "false", mySelectorFrameParent->myViewNet->getUndoList());
1413  } else {
1414  i.second->setAttribute(GNE_ATTR_SELECTED, "true", mySelectorFrameParent->myViewNet->getUndoList());
1415  }
1416  }
1417  }
1418  // select route flows
1419  if (!locks->IsObjectTypeLocked(GLO_ROUTEFLOW)) {
1420  for (const auto& i : mySelectorFrameParent->myViewNet->getNet()->getAttributeCarriers().demandElements.at(SUMO_TAG_ROUTEFLOW)) {
1421  if (i.second->isAttributeCarrierSelected()) {
1422  i.second->setAttribute(GNE_ATTR_SELECTED, "false", mySelectorFrameParent->myViewNet->getUndoList());
1423  } else {
1424  i.second->setAttribute(GNE_ATTR_SELECTED, "true", mySelectorFrameParent->myViewNet->getUndoList());
1425  }
1426  }
1427  }
1428  // select stops
1429  if (!locks->IsObjectTypeLocked(GLO_STOP)) {
1430  for (const auto& i : mySelectorFrameParent->myViewNet->getNet()->getAttributeCarriers().demandElements.at(SUMO_TAG_STOP_LANE)) {
1431  if (i.second->isAttributeCarrierSelected()) {
1432  i.second->setAttribute(GNE_ATTR_SELECTED, "false", mySelectorFrameParent->myViewNet->getUndoList());
1433  } else {
1434  i.second->setAttribute(GNE_ATTR_SELECTED, "true", mySelectorFrameParent->myViewNet->getUndoList());
1435  }
1436  }
1437  for (const auto& i : mySelectorFrameParent->myViewNet->getNet()->getAttributeCarriers().demandElements.at(SUMO_TAG_STOP_BUSSTOP)) {
1438  if (i.second->isAttributeCarrierSelected()) {
1439  i.second->setAttribute(GNE_ATTR_SELECTED, "false", mySelectorFrameParent->myViewNet->getUndoList());
1440  } else {
1441  i.second->setAttribute(GNE_ATTR_SELECTED, "true", mySelectorFrameParent->myViewNet->getUndoList());
1442  }
1443  }
1444  for (const auto& i : mySelectorFrameParent->myViewNet->getNet()->getAttributeCarriers().demandElements.at(SUMO_TAG_STOP_CONTAINERSTOP)) {
1445  if (i.second->isAttributeCarrierSelected()) {
1446  i.second->setAttribute(GNE_ATTR_SELECTED, "false", mySelectorFrameParent->myViewNet->getUndoList());
1447  } else {
1448  i.second->setAttribute(GNE_ATTR_SELECTED, "true", mySelectorFrameParent->myViewNet->getUndoList());
1449  }
1450  }
1451  for (const auto& i : mySelectorFrameParent->myViewNet->getNet()->getAttributeCarriers().demandElements.at(SUMO_TAG_STOP_CHARGINGSTATION)) {
1452  if (i.second->isAttributeCarrierSelected()) {
1453  i.second->setAttribute(GNE_ATTR_SELECTED, "false", mySelectorFrameParent->myViewNet->getUndoList());
1454  } else {
1455  i.second->setAttribute(GNE_ATTR_SELECTED, "true", mySelectorFrameParent->myViewNet->getUndoList());
1456  }
1457  }
1458  for (const auto& i : mySelectorFrameParent->myViewNet->getNet()->getAttributeCarriers().demandElements.at(SUMO_TAG_STOP_PARKINGAREA)) {
1459  if (i.second->isAttributeCarrierSelected()) {
1460  i.second->setAttribute(GNE_ATTR_SELECTED, "false", mySelectorFrameParent->myViewNet->getUndoList());
1461  } else {
1462  i.second->setAttribute(GNE_ATTR_SELECTED, "true", mySelectorFrameParent->myViewNet->getUndoList());
1463  }
1464  }
1465  }
1466  // select person
1467  if (!locks->IsObjectTypeLocked(GLO_PERSON)) {
1468  for (const auto& i : mySelectorFrameParent->myViewNet->getNet()->getAttributeCarriers().demandElements.at(SUMO_TAG_PERSON)) {
1469  if (i.second->isAttributeCarrierSelected()) {
1470  i.second->setAttribute(GNE_ATTR_SELECTED, "false", mySelectorFrameParent->myViewNet->getUndoList());
1471  } else {
1472  i.second->setAttribute(GNE_ATTR_SELECTED, "true", mySelectorFrameParent->myViewNet->getUndoList());
1473  }
1474  }
1475  }
1476  // select person flow
1477  if (!locks->IsObjectTypeLocked(GLO_PERSONFLOW)) {
1478  for (const auto& i : mySelectorFrameParent->myViewNet->getNet()->getAttributeCarriers().demandElements.at(SUMO_TAG_PERSONFLOW)) {
1479  if (i.second->isAttributeCarrierSelected()) {
1480  i.second->setAttribute(GNE_ATTR_SELECTED, "false", mySelectorFrameParent->myViewNet->getUndoList());
1481  } else {
1482  i.second->setAttribute(GNE_ATTR_SELECTED, "true", mySelectorFrameParent->myViewNet->getUndoList());
1483  }
1484  }
1485  }
1486  // select person trip
1487  if (!locks->IsObjectTypeLocked(GLO_PERSONTRIP)) {
1488  for (const auto& i : mySelectorFrameParent->myViewNet->getNet()->getAttributeCarriers().demandElements.at(SUMO_TAG_PERSONTRIP_FROMTO)) {
1489  if (i.second->isAttributeCarrierSelected()) {
1490  i.second->setAttribute(GNE_ATTR_SELECTED, "false", mySelectorFrameParent->myViewNet->getUndoList());
1491  } else {
1492  i.second->setAttribute(GNE_ATTR_SELECTED, "true", mySelectorFrameParent->myViewNet->getUndoList());
1493  }
1494  }
1495  for (const auto& i : mySelectorFrameParent->myViewNet->getNet()->getAttributeCarriers().demandElements.at(SUMO_TAG_PERSONTRIP_BUSSTOP)) {
1496  if (i.second->isAttributeCarrierSelected()) {
1497  i.second->setAttribute(GNE_ATTR_SELECTED, "false", mySelectorFrameParent->myViewNet->getUndoList());
1498  } else {
1499  i.second->setAttribute(GNE_ATTR_SELECTED, "true", mySelectorFrameParent->myViewNet->getUndoList());
1500  }
1501  }
1502  }
1503  // select ride
1504  if (!locks->IsObjectTypeLocked(GLO_RIDE)) {
1505  for (const auto& i : mySelectorFrameParent->myViewNet->getNet()->getAttributeCarriers().demandElements.at(SUMO_TAG_RIDE_FROMTO)) {
1506  if (i.second->isAttributeCarrierSelected()) {
1507  i.second->setAttribute(GNE_ATTR_SELECTED, "false", mySelectorFrameParent->myViewNet->getUndoList());
1508  } else {
1509  i.second->setAttribute(GNE_ATTR_SELECTED, "true", mySelectorFrameParent->myViewNet->getUndoList());
1510  }
1511  }
1512  for (const auto& i : mySelectorFrameParent->myViewNet->getNet()->getAttributeCarriers().demandElements.at(SUMO_TAG_RIDE_BUSSTOP)) {
1513  if (i.second->isAttributeCarrierSelected()) {
1514  i.second->setAttribute(GNE_ATTR_SELECTED, "false", mySelectorFrameParent->myViewNet->getUndoList());
1515  } else {
1516  i.second->setAttribute(GNE_ATTR_SELECTED, "true", mySelectorFrameParent->myViewNet->getUndoList());
1517  }
1518  }
1519  }
1520  // select walks
1521  if (!locks->IsObjectTypeLocked(GLO_WALK)) {
1522  for (const auto& i : mySelectorFrameParent->myViewNet->getNet()->getAttributeCarriers().demandElements.at(SUMO_TAG_WALK_FROMTO)) {
1523  if (i.second->isAttributeCarrierSelected()) {
1524  i.second->setAttribute(GNE_ATTR_SELECTED, "false", mySelectorFrameParent->myViewNet->getUndoList());
1525  } else {
1526  i.second->setAttribute(GNE_ATTR_SELECTED, "true", mySelectorFrameParent->myViewNet->getUndoList());
1527  }
1528  }
1529  for (const auto& i : mySelectorFrameParent->myViewNet->getNet()->getAttributeCarriers().demandElements.at(SUMO_TAG_WALK_BUSSTOP)) {
1530  if (i.second->isAttributeCarrierSelected()) {
1531  i.second->setAttribute(GNE_ATTR_SELECTED, "false", mySelectorFrameParent->myViewNet->getUndoList());
1532  } else {
1533  i.second->setAttribute(GNE_ATTR_SELECTED, "true", mySelectorFrameParent->myViewNet->getUndoList());
1534  }
1535  }
1536  for (const auto& i : mySelectorFrameParent->myViewNet->getNet()->getAttributeCarriers().demandElements.at(SUMO_TAG_WALK_ROUTE)) {
1537  if (i.second->isAttributeCarrierSelected()) {
1538  i.second->setAttribute(GNE_ATTR_SELECTED, "false", mySelectorFrameParent->myViewNet->getUndoList());
1539  } else {
1540  i.second->setAttribute(GNE_ATTR_SELECTED, "true", mySelectorFrameParent->myViewNet->getUndoList());
1541  }
1542  }
1543  }
1544  // select person stops
1545  if (!locks->IsObjectTypeLocked(GLO_PERSONSTOP)) {
1546  for (const auto& i : mySelectorFrameParent->myViewNet->getNet()->getAttributeCarriers().demandElements.at(SUMO_TAG_PERSONSTOP_LANE)) {
1547  if (i.second->isAttributeCarrierSelected()) {
1548  i.second->setAttribute(GNE_ATTR_SELECTED, "false", mySelectorFrameParent->myViewNet->getUndoList());
1549  } else {
1550  i.second->setAttribute(GNE_ATTR_SELECTED, "true", mySelectorFrameParent->myViewNet->getUndoList());
1551  }
1552  }
1553 
1554  for (const auto& i : mySelectorFrameParent->myViewNet->getNet()->getAttributeCarriers().demandElements.at(SUMO_TAG_PERSONSTOP_BUSSTOP)) {
1555  if (i.second->isAttributeCarrierSelected()) {
1556  i.second->setAttribute(GNE_ATTR_SELECTED, "false", mySelectorFrameParent->myViewNet->getUndoList());
1557  } else {
1558  i.second->setAttribute(GNE_ATTR_SELECTED, "true", mySelectorFrameParent->myViewNet->getUndoList());
1559  }
1560  }
1561  }
1562  }
1563  // finish selection operation
1564  mySelectorFrameParent->myViewNet->getUndoList()->p_end();
1565  // update view
1566  mySelectorFrameParent->myViewNet->update();
1567  }
1568  return 1;
1569 }
1570 
1571 
1572 bool
1575  // check if exist junction and edges
1577  return true;
1578  }
1580  return true;
1581  }
1582  // check if additionals selection is locked
1584  for (const auto& i : myViewNet->getNet()->getAttributeCarriers().additionals) {
1585  // first check if additional is selectable
1586  if (GNEAttributeCarrier::getTagProperties(i.first).isSelectable() && (myViewNet->getNet()->getAttributeCarriers().additionals.at(i.first).size() > 0)) {
1587  return true;
1588  }
1589  }
1590  }
1591  // select polygons
1593  return true;
1594  }
1595  // select POIs
1597  return true;
1598  }
1599  } else {
1600  // select routes
1602  return true;
1603  }
1604  // select embedded routes
1606  return true;
1607  }
1608  // select vehicles
1610  return true;
1611  }
1612  // select trips
1614  return true;
1615  }
1616  // select flows
1618  return true;
1619  }
1620  // select route flows
1622  return true;
1623  }
1624  // select stops
1630  return true;
1631  }
1632  }
1633  // select person
1635  return true;
1636  }
1637  // select person flows
1639  return true;
1640  }
1641  // select persontrips
1645  return true;
1646  }
1647  }
1648  // select ride
1652  return true;
1653  }
1654  }
1655  // select walks
1660  return true;
1661  }
1662  }
1663  // select person stops
1667  return true;
1668  }
1669  }
1670  }
1671  // nothing to select
1672  return false;
1673 }
1674 
1675 /****************************************************************************/
GUIGlObject::getType
GUIGlObjectType getType() const
Returns the type of the object as coded in GUIGlObjectType.
Definition: GUIGlObject.cpp:180
GNESelectorFrame::ModificationMode::myAddRadioButton
FXRadioButton * myAddRadioButton
add radio button
Definition: GNESelectorFrame.h:156
GNESelectorFrame::~GNESelectorFrame
~GNESelectorFrame()
Destructor.
Definition: GNESelectorFrame.cpp:108
SUMO_TAG_WALK_FROMTO
@ SUMO_TAG_WALK_FROMTO
Definition: SUMOXMLDefinitions.h:307
FXDEFMAP
FXDEFMAP(GNESelectorFrame::LockGLObjectTypes::ObjectTypeEntry) ObjectTypeEntryMap[]
GNESelectorFrame::ModificationMode::getModificationMode
SetOperation getModificationMode() const
get current modification mode
Definition: GNESelectorFrame.cpp:683
GNESelectorFrame::ModificationMode::SET_DEFAULT
@ SET_DEFAULT
Definition: GNESelectorFrame.h:132
GLO_CONNECTION
@ GLO_CONNECTION
a connection
Definition: GUIGlObjectTypes.h:54
GUIDesignAuxiliarHorizontalFrame
#define GUIDesignAuxiliarHorizontalFrame
design for auxiliar (Without borders) horizontal frame used to pack another frames
Definition: GUIDesigns.h:273
GNENet::getAttributeCarriers
const AttributeCarriers & getAttributeCarriers() const
retrieve all attribute carriers of Net
Definition: GNENet.cpp:1063
ICON_ACCEPT
@ ICON_ACCEPT
Definition: GUIIcons.h:386
GNESelectorFrame::LockGLObjectTypes::ObjectTypeEntry::ObjectTypeEntry
ObjectTypeEntry(FXMatrix *matrixParent, const std::string &label)
FOX-declaration.
Definition: GNESelectorFrame.cpp:603
GUIDesignSpinDial
#define GUIDesignSpinDial
Definition: GUIDesigns.h:341
GNESelectorFrame::handleIDs
void handleIDs(const std::vector< GNEAttributeCarrier * > &ACs, ModificationMode::SetOperation setop=ModificationMode::SET_DEFAULT)
apply list of ids to the current selection according to SetOperation,
Definition: GNESelectorFrame.cpp:370
SUMO_TAG_STOP_PARKINGAREA
@ SUMO_TAG_STOP_PARKINGAREA
stop placed over a parking area (used in netedit)
Definition: SUMOXMLDefinitions.h:188
GUIDesignTextFieldNCol
#define GUIDesignTextFieldNCol
Num of column of text field.
Definition: GUIDesigns.h:42
GNEAdditional.h
MID_CHOOSEN_INVERT
@ MID_CHOOSEN_INVERT
Deselect selected items.
Definition: GUIAppEnum.h:524
GNESelectorFrame::getModificationModeModul
ModificationMode * getModificationModeModul() const
get modification mode modul
Definition: GNESelectorFrame.cpp:453
GNESelectorFrame::MatchAttribute::MatchAttribute
MatchAttribute(GNESelectorFrame *selectorFrameParent)
FOX-declaration.
Definition: GNESelectorFrame.cpp:808
GNENet::AttributeCarriers::junctions
std::map< std::string, GNEJunction * > junctions
map with the name and pointer to junctions of net
Definition: GNENet.h:95
SUMO_TAG_STOP_LANE
@ SUMO_TAG_STOP_LANE
stop placed over a lane (used in netedit)
Definition: SUMOXMLDefinitions.h:180
OutputDevice
Static storage of an output device and its base (abstract) implementation.
Definition: OutputDevice.h:63
GNESelectorFrame::VisualScaling::VisualScaling
VisualScaling(GNESelectorFrame *selectorFrameParent)
FOX-declaration.
Definition: GNESelectorFrame.cpp:1128
GNESelectorFrame::show
void show()
show Frame
Definition: GNESelectorFrame.cpp:112
StringBijection::getString
const std::string & getString(const T key) const
Definition: StringBijection.h:106
GNEUndoList::p_end
void p_end()
End undo command sub-group. If the sub-group is still empty, it will be deleted; otherwise,...
Definition: GNEUndoList.cpp:79
GNESelectorFrame::ModificationMode::SET_RESTRICT
@ SET_RESTRICT
Definition: GNESelectorFrame.h:130
GLO_PERSONTRIP
@ GLO_PERSONTRIP
a person trip
Definition: GUIGlObjectTypes.h:127
GNESelectorFrame::SelectionOperation::SelectionOperation
SelectionOperation(GNESelectorFrame *selectorFrameParent)
FOX-declaration.
Definition: GNESelectorFrame.cpp:1157
ICON_EMPTY
@ ICON_EMPTY
Definition: GUIIcons.h:41
GNESelectorFrame::ModificationMode::myRemoveRadioButton
FXRadioButton * myRemoveRadioButton
remove radio button
Definition: GNESelectorFrame.h:159
GNESelectorFrame::VisualScaling::~VisualScaling
~VisualScaling()
destructor
Definition: GNESelectorFrame.cpp:1142
SUMO_TAG_WALK_ROUTE
@ SUMO_TAG_WALK_ROUTE
Definition: SUMOXMLDefinitions.h:309
GLO_PERSONSTOP
@ GLO_PERSONSTOP
a person stop
Definition: GUIGlObjectTypes.h:135
GNESelectorFrame::ModificationMode
Definition: GNESelectorFrame.h:121
GNESelectorFrame::ModificationMode::SET_REPLACE
@ SET_REPLACE
Definition: GNESelectorFrame.h:131
MID_CHOOSEN_CLEAR
@ MID_CHOOSEN_CLEAR
Clear set.
Definition: GUIAppEnum.h:518
GNESelectorFrame::ModificationMode::myKeepRadioButton
FXRadioButton * myKeepRadioButton
keep button
Definition: GNESelectorFrame.h:162
GUIGlObject::TypeNames
static StringBijection< GUIGlObjectType > TypeNames
associates object types with strings
Definition: GUIGlObject.h:68
GNESelectorFrame::ElementSet::getElementSet
ElementSetType getElementSet() const
get current selected element set
Definition: GNESelectorFrame.cpp:740
GNESelectorFrame::LockGLObjectTypes::~LockGLObjectTypes
~LockGLObjectTypes()
destructor
Definition: GNESelectorFrame.cpp:558
SUMO_TAG_PERSON
@ SUMO_TAG_PERSON
Definition: SUMOXMLDefinitions.h:295
GNESelectorFrame::ElementSet::ELEMENTSET_NETELEMENT
@ ELEMENTSET_NETELEMENT
Definition: GNESelectorFrame.h:182
GNENet::getSelectedAttributeCarriers
std::vector< GNEAttributeCarrier * > getSelectedAttributeCarriers(bool ignoreCurrentSupermode)
get all selected attribute carriers (or only relative to current supermode
Definition: GNENet.cpp:2123
ICON_MODEADDITIONAL
@ ICON_MODEADDITIONAL
Definition: GUIIcons.h:220
GUIDesignButtonOK
#define GUIDesignButtonOK
Definition: GUIDesigns.h:98
GNESelectorFrame::SelectionOperation::~SelectionOperation
~SelectionOperation()
destructor
Definition: GNESelectorFrame.cpp:1171
GNESelectorFrame::ElementSet::ElementSet
ElementSet(GNESelectorFrame *selectorFrameParent)
constructor
Definition: GNESelectorFrame.cpp:727
GUIDesignComboBoxNCol
#define GUIDesignComboBoxNCol
number of column of every combo box
Definition: GUIDesigns.h:217
GNEFrame
Definition: GNEFrame.h:34
GNESelectorFrame::MatchAttribute::disableMatchAttribute
void disableMatchAttribute()
disable match attributes
Definition: GNESelectorFrame.cpp:868
GNEViewNet
Definition: GNEViewNet.h:42
GLO_FLOW
@ GLO_FLOW
a flow
Definition: GUIGlObjectTypes.h:145
SUMO_ATTR_SPEED
@ SUMO_ATTR_SPEED
Definition: SUMOXMLDefinitions.h:384
GLO_PERSON
@ GLO_PERSON
Definition: GUIGlObjectTypes.h:159
GNESelectorFrame::hide
void hide()
hide Frame
Definition: GNESelectorFrame.cpp:123
SUMO_ATTR_ID
@ SUMO_ATTR_ID
Definition: SUMOXMLDefinitions.h:378
SUMO_TAG_NOTHING
@ SUMO_TAG_NOTHING
invalid tag
Definition: SUMOXMLDefinitions.h:43
GLO_VEHICLE
@ GLO_VEHICLE
Definition: GUIGlObjectTypes.h:141
GUIDesigns.h
GNESelectorFrame::myElementSet
ElementSet * myElementSet
modul for select element set
Definition: GNESelectorFrame.h:415
GLO_CROSSING
@ GLO_CROSSING
a tl-logic
Definition: GUIGlObjectTypes.h:52
GUIDesignTextField
#define GUIDesignTextField
Definition: GUIDesigns.h:33
GNESelectorFrame::ElementSet::ELEMENTSET_ADDITIONAL
@ ELEMENTSET_ADDITIONAL
Definition: GNESelectorFrame.h:183
MID_GNE_SET_ATTRIBUTE
@ MID_GNE_SET_ATTRIBUTE
attribute edited
Definition: GUIAppEnum.h:646
GNEViewNet::update
void update() const
Mark the entire GNEViewNet to be repainted later.
Definition: GNEViewNet.cpp:299
GNENet::AttributeCarriers::additionals
std::map< SumoXMLTag, std::map< std::string, GNEAdditional * > > additionals
map with the name and pointer to additional elements of net
Definition: GNENet.h:101
GUIIconSubSys::getIcon
static FXIcon * getIcon(GUIIcon which)
returns a icon previously defined in the enum GUIIcon
Definition: GUIIconSubSys.cpp:609
GNESelectorFrame::MatchAttribute::enableMatchAttribute
void enableMatchAttribute()
enable match attributes
Definition: GNESelectorFrame.cpp:835
GNESelectorFrame::SelectionOperation::onCmdInvert
long onCmdInvert(FXObject *, FXSelector, void *)
Called when the user presses the Invert-button.
Definition: GNESelectorFrame.cpp:1265
OutputDevice::close
void close()
Closes the device and removes it from the dictionary.
Definition: OutputDevice.cpp:207
GLO_RIDE
@ GLO_RIDE
Definition: GUIGlObjectTypes.h:123
GLO_PERSONFLOW
@ GLO_PERSONFLOW
a person flow
Definition: GUIGlObjectTypes.h:161
GNEFrame::myContentFrame
FXVerticalFrame * myContentFrame
Vertical frame that holds all widgets of frame.
Definition: GNEFrame.h:124
MID_CHOOSEN_ELEMENTS
@ MID_CHOOSEN_ELEMENTS
set subset of elements
Definition: GUIAppEnum.h:512
GNESelectorFrame::ModificationMode::SET_SUB
@ SET_SUB
Definition: GNESelectorFrame.h:129
MID_CHOOSEN_LOAD
@ MID_CHOOSEN_LOAD
Load set.
Definition: GUIAppEnum.h:514
SumoXMLTag
SumoXMLTag
Numbers representing SUMO-XML - element names.
Definition: SUMOXMLDefinitions.h:41
GNESelectorFrame::MatchAttribute::myMatchTagComboBox
FXComboBox * myMatchTagComboBox
tag of the match box
Definition: GNESelectorFrame.h:279
MFXUtils::getFilename2Write
static FXString getFilename2Write(FXWindow *parent, const FXString &header, const FXString &extension, FXIcon *icon, FXString &currentFolder)
Returns the file name to write.
Definition: MFXUtils.cpp:83
GUIDesignButton
#define GUIDesignButton
Definition: GUIDesigns.h:50
GNESelectorFrame::MatchAttribute::myMatchAttrComboBox
FXComboBox * myMatchAttrComboBox
attributes of the match box
Definition: GNESelectorFrame.h:282
GUIGlObjectStorage.h
GNESelectorFrame
Definition: GNESelectorFrame.h:32
GLO_POLYGON
@ GLO_POLYGON
a polygon
Definition: GUIGlObjectTypes.h:104
GUIAppEnum.h
GNEJunction.h
GUIDesignLabelFrameInformation
#define GUIDesignLabelFrameInformation
label extended over frame without thick and with text justify to left, used to show information in fr...
Definition: GUIDesigns.h:194
GUIGlObjectType
GUIGlObjectType
Definition: GUIGlObjectTypes.h:39
GUIDesignButtonRectangular
#define GUIDesignButtonRectangular
little button rectangular (46x23) used in frames (For example, in "help" buttons)
Definition: GUIDesigns.h:56
GNEEdge
A road/street connecting two junctions (netedit-version)
Definition: GNEEdge.h:51
MID_HELP
@ MID_HELP
help button
Definition: GUIAppEnum.h:553
GNEViewNet::getNet
GNENet * getNet() const
get the net object
Definition: GNEViewNet.cpp:1014
GNESelectorFrame::LockGLObjectTypes::ObjectTypeEntry::myLabelCounter
FXLabel * myLabelCounter
label counter
Definition: GNESelectorFrame.h:79
GNENet::AttributeCarriers::edges
std::map< std::string, GNEEdge * > edges
map with the name and pointer to edges of net
Definition: GNENet.h:98
GNESelectorFrame::ElementSet::~ElementSet
~ElementSet()
destructor
Definition: GNESelectorFrame.cpp:736
GNERoute.h
GNESelectorFrame::LockGLObjectTypes::ObjectTypeEntry::hideObjectTypeEntry
void hideObjectTypeEntry()
hide ObjectTypeEntry
Definition: GNESelectorFrame.cpp:622
GNESelectorFrame::VisualScaling::onCmdScaleSelection
long onCmdScaleSelection(FXObject *, FXSelector, void *)
Called when the user changes visual scaling.
Definition: GNESelectorFrame.cpp:1146
GNESelectorFrame::VisualScaling
Definition: GNESelectorFrame.h:298
SUMO_TAG_ROUTEFLOW
@ SUMO_TAG_ROUTEFLOW
a flow definition nusing a route instead of a from-to edges route (used in NETEDIT)
Definition: SUMOXMLDefinitions.h:151
GNESelectorFrame::LockGLObjectTypes
Definition: GNESelectorFrame.h:40
NamedObjectCont::size
int size() const
Returns the number of stored items within the container.
Definition: NamedObjectCont.h:116
SUMO_TAG_FLOW
@ SUMO_TAG_FLOW
a flow definitio nusing a from-to edges instead of a route (used by router)
Definition: SUMOXMLDefinitions.h:149
GNEAttributeCarrier::getTagProperty
const TagProperties & getTagProperty() const
get Tag Property assigned to this object
Definition: GNEAttributeCarrier.cpp:1273
SUMO_TAG_STOP_CHARGINGSTATION
@ SUMO_TAG_STOP_CHARGINGSTATION
stop placed over a charging station (used in netedit)
Definition: SUMOXMLDefinitions.h:186
GNEShape
Definition: GNEShape.h:34
GNEAttributeCarrier::AttributeProperties
struct with the attribute Properties
Definition: GNEAttributeCarrier.h:97
GNEAttributeCarrier::allowedTagsByCategory
static std::vector< SumoXMLTag > allowedTagsByCategory(int tagPropertyCategory, bool onlyDrawables)
get tags of all editable element types using TagProperty Type (TAGTYPE_NETELEMENT,...
Definition: GNEAttributeCarrier.cpp:1333
SUMO_TAG_PERSONSTOP_LANE
@ SUMO_TAG_PERSONSTOP_LANE
Definition: SUMOXMLDefinitions.h:313
GNESelectorFrame::MatchAttribute::onCmdSelMBString
long onCmdSelMBString(FXObject *, FXSelector, void *)
Called when the user enters a new selection expression.
Definition: GNESelectorFrame.cpp:1020
GNESelectorFrame::LockGLObjectTypes::LockGLObjectTypes
LockGLObjectTypes(GNESelectorFrame *selectorFrameParent)
constructor
Definition: GNESelectorFrame.cpp:527
GNESelectorFrame::LockGLObjectTypes::showTypeEntries
void showTypeEntries()
show type Entries (depending if we're in Network or demand supermode)
Definition: GNESelectorFrame.cpp:589
GUIDesignMatrixLockGLTypes
#define GUIDesignMatrixLockGLTypes
Matrix for pack GLTypes (used in GNESelectorFrame)
Definition: GUIDesigns.h:254
GUIDesignHorizontalSeparator
#define GUIDesignHorizontalSeparator
Definition: GUIDesigns.h:321
GNEAttributeCarrier::TagProperties::isDemandElement
bool isDemandElement() const
return true if tag correspond to a demand element
Definition: GNEAttributeCarrier.cpp:715
SUMO_ATTR_NOTHING
@ SUMO_ATTR_NOTHING
invalid attribute
Definition: SUMOXMLDefinitions.h:374
GNEViewNet.h
GNESelectorFrame::ElementSet::ElementSetType
ElementSetType
FOX-declaration.
Definition: GNESelectorFrame.h:181
GNEViewNet::autoSelectNodes
bool autoSelectNodes()
whether to autoselect nodes or to lanes
Definition: GNEViewNet.cpp:529
GUIGlObject::getGlID
GUIGlID getGlID() const
Returns the numerical id of the object.
Definition: GUIGlObject.cpp:149
update
GNESelectorFrame::MatchAttribute::myMatchString
FXTextField * myMatchString
string of the match
Definition: GNESelectorFrame.h:291
GLO_WALK
@ GLO_WALK
a walk
Definition: GUIGlObjectTypes.h:125
SUMO_TAG_EDGE
@ SUMO_TAG_EDGE
begin/end of the description of an edge
Definition: SUMOXMLDefinitions.h:47
GNE_ATTR_PARAMETERS
@ GNE_ATTR_PARAMETERS
parameters "key1=value1|key2=value2|...|keyN=valueN"
Definition: SUMOXMLDefinitions.h:989
GUIDesignLabelLeft
#define GUIDesignLabelLeft
Definition: GUIDesigns.h:149
GNE_ATTR_CLOSE_SHAPE
@ GNE_ATTR_CLOSE_SHAPE
Close shape of a polygon (Used by GNEPolys)
Definition: SUMOXMLDefinitions.h:985
GNE_SUPERMODE_NETWORK
@ GNE_SUPERMODE_NETWORK
Network mode (Edges, junctions, etc..)
Definition: GNEViewNetHelper.h:46
ProcessError
Definition: UtilExceptions.h:39
GNEViewNetHelper::EditModes::currentSupermode
Supermode currentSupermode
the current supermode
Definition: GNEViewNetHelper.h:305
GLO_ROUTE
@ GLO_ROUTE
Definition: GUIGlObjectTypes.h:115
GUIDesignCheckButton
#define GUIDesignCheckButton
checkButton placed in left position
Definition: GUIDesigns.h:115
GLO_TRIP
@ GLO_TRIP
a trip
Definition: GUIGlObjectTypes.h:143
GLO_EDGE
@ GLO_EDGE
an edge
Definition: GUIGlObjectTypes.h:46
GNESelectorFrame::SelectionOperation
Definition: GNESelectorFrame.h:332
GNEEdge.h
MID_GNE_SELECTORFRAME_PROCESSSTRING
@ MID_GNE_SELECTORFRAME_PROCESSSTRING
process string
Definition: GUIAppEnum.h:712
GNE_ATTR_BLOCK_SHAPE
@ GNE_ATTR_BLOCK_SHAPE
block shape of a graphic element (Used mainly in GNEShapes)
Definition: SUMOXMLDefinitions.h:983
GNEFrame::myViewNet
GNEViewNet * myViewNet
View Net.
Definition: GNEFrame.h:121
GNEViewNet::getUndoList
GNEUndoList * getUndoList() const
get the undoList object
Definition: GNEViewNet.cpp:1020
GNESelectorFrame::ElementSet::ELEMENTSET_DEMANDELEMENT
@ ELEMENTSET_DEMANDELEMENT
Definition: GNESelectorFrame.h:185
GLO_POI
@ GLO_POI
a poi
Definition: GUIGlObjectTypes.h:106
GUIDesignGroupBoxFrame
#define GUIDesignGroupBoxFrame
Group box design extended over frame.
Definition: GUIDesigns.h:239
GLO_LANE
@ GLO_LANE
a lane
Definition: GUIGlObjectTypes.h:48
GNESelectorFrame::MatchAttribute::myCurrentAttribute
SumoXMLAttr myCurrentAttribute
current SumoXMLTag Attribute
Definition: GNESelectorFrame.h:288
MID_GNE_SELECTORFRAME_SELECTSCALE
@ MID_GNE_SELECTORFRAME_SELECTSCALE
changes the visual scaling of selected items
Definition: GUIAppEnum.h:714
SUMO_TAG_PERSONTRIP_BUSSTOP
@ SUMO_TAG_PERSONTRIP_BUSSTOP
Definition: SUMOXMLDefinitions.h:305
GNESelectorFrame::getMatches
std::vector< GNEAttributeCarrier * > getMatches(SumoXMLTag ACTag, SumoXMLAttr ACAttr, char compOp, double val, const std::string &expr)
return ACs of the given type with matching attrs
Definition: GNESelectorFrame.cpp:465
GNESelectorFrame::ModificationMode::ModificationMode
ModificationMode(GNESelectorFrame *selectorFrameParent)
constructor
Definition: GNESelectorFrame.cpp:663
GUIGlObjectStorage::getObjectBlocking
GUIGlObject * getObjectBlocking(GUIGlID id)
Returns the object from the container locking it.
Definition: GUIGlObjectStorage.cpp:62
GNESelectorFrame::ModificationMode::SET_ADD
@ SET_ADD
Definition: GNESelectorFrame.h:128
GNESelectorFrame::ElementSet::refreshElementSet
void refreshElementSet()
refresh element set
Definition: GNESelectorFrame.cpp:746
GUIGlObject
Definition: GUIGlObject.h:65
GNESelectorFrame::LockGLObjectTypes::ObjectTypeEntry::myCheckBoxLocked
FXCheckButton * myCheckBoxLocked
check box to check if GLObject type is blocked
Definition: GNESelectorFrame.h:85
MID_GNE_SELECTORFRAME_SELECTATTRIBUTE
@ MID_GNE_SELECTORFRAME_SELECTATTRIBUTE
select attribute in selector frame
Definition: GUIAppEnum.h:710
GNECrossing.h
gCurrentFolder
FXString gCurrentFolder
The folder used as last.
Definition: GUIIOGlobals.cpp:32
GNENet::AttributeCarriers::demandElements
std::map< SumoXMLTag, std::map< std::string, GNEDemandElement * > > demandElements
map with the name and pointer to demand elements of net
Definition: GNENet.h:104
SUMO_TAG_VEHICLE
@ SUMO_TAG_VEHICLE
description of a vehicle
Definition: SUMOXMLDefinitions.h:119
GNESelectorFrame::SelectionOperation::onCmdClear
long onCmdClear(FXObject *, FXSelector, void *)
Called when the user presses the Clear-button.
Definition: GNESelectorFrame.cpp:1257
GNELane.h
GNESelectorFrame::ModificationMode::~ModificationMode
~ModificationMode()
destructor
Definition: GNESelectorFrame.cpp:679
GNESelectorFrame::LockGLObjectTypes::ObjectTypeEntry::myLabelTypeName
FXLabel * myLabelTypeName
label type nane
Definition: GNESelectorFrame.h:82
GNESelectorFrame::SelectionOperation::onCmdSave
long onCmdSave(FXObject *, FXSelector, void *)
Called when the user presses the Save-button.
Definition: GNESelectorFrame.cpp:1229
GNESelectorFrame::MatchAttribute::onCmdSelMBTag
long onCmdSelMBTag(FXObject *, FXSelector, void *)
Called when the user selectes a tag in the match box.
Definition: GNESelectorFrame.cpp:881
GNESelectorFrame::myModificationMode
ModificationMode * myModificationMode
modul for change modification mode
Definition: GNESelectorFrame.h:412
ShapeContainer::getPOIs
const POIs & getPOIs() const
Returns all pois.
Definition: ShapeContainer.h:154
MID_CHOOSEN_SAVE
@ MID_CHOOSEN_SAVE
Save set.
Definition: GUIAppEnum.h:516
GNENet::retrieveAttributeCarriers
std::vector< GNEAttributeCarrier * > retrieveAttributeCarriers(SumoXMLTag type=SUMO_TAG_NOTHING)
get the attribute carriers based on Type
Definition: GNENet.cpp:1357
GNESelectorFrame::LockGLObjectTypes::ObjectTypeEntry
class for object types entries
Definition: GNESelectorFrame.h:44
toString
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
Definition: ToString.h:47
GNEAttributeCarrier::TagProperties::isSelectable
bool isSelectable() const
return true if tag correspond to a selectable element
Definition: GNEAttributeCarrier.cpp:798
GNESelectorFrame.h
SUMO_TAG_STOP_CONTAINERSTOP
@ SUMO_TAG_STOP_CONTAINERSTOP
stop placed over a containerStop (used in netedit)
Definition: SUMOXMLDefinitions.h:184
OutputDevice::getDevice
static OutputDevice & getDevice(const std::string &name)
Returns the described OutputDevice.
Definition: OutputDevice.cpp:54
GNESelectorFrame::LockGLObjectTypes::ObjectTypeEntry::showObjectTypeEntry
void showObjectTypeEntry()
show ObjectTypeEntry
Definition: GNESelectorFrame.cpp:614
GNESelectorFrame::LockGLObjectTypes::myTypeEntries
std::map< GUIGlObjectType, std::pair< Supermode, ObjectTypeEntry * > > myTypeEntries
check boxes for type-based selection locking and selected object counts
Definition: GNESelectorFrame.h:114
GNESelectorFrame::MatchAttribute
Definition: GNESelectorFrame.h:229
GNE_SUPERMODE_DEMAND
@ GNE_SUPERMODE_DEMAND
Demanding mode (Routes, Vehicles etc..)
Definition: GNEViewNetHelper.h:48
GUIDesignRadioButton
#define GUIDesignRadioButton
Definition: GUIDesigns.h:139
GNESelectorFrame::ElementSet
Definition: GNESelectorFrame.h:175
MID_GNE_SELECTORFRAME_SELECTTAG
@ MID_GNE_SELECTORFRAME_SELECTTAG
select tag in selector frame
Definition: GUIAppEnum.h:708
GNE_ATTR_BLOCK_MOVEMENT
@ GNE_ATTR_BLOCK_MOVEMENT
block movement of a graphic element
Definition: SUMOXMLDefinitions.h:981
GNEShape::setAttribute
virtual void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)=0
GUIDesignComboBox
#define GUIDesignComboBox
Definition: GUIDesigns.h:205
GUIGlObjectStorage::gIDStorage
static GUIGlObjectStorage gIDStorage
A single static instance of this class.
Definition: GUIGlObjectStorage.h:140
SUMO_TAG_PERSONTRIP_FROMTO
@ SUMO_TAG_PERSONTRIP_FROMTO
Definition: SUMOXMLDefinitions.h:304
GNESelectorFrame::myLockGLObjectTypes
LockGLObjectTypes * myLockGLObjectTypes
modul for lock selected items
Definition: GNESelectorFrame.h:409
SUMO_TAG_RIDE_BUSSTOP
@ SUMO_TAG_RIDE_BUSSTOP
Definition: SUMOXMLDefinitions.h:311
IOError
Definition: UtilExceptions.h:161
GNESelectorFrame::LockGLObjectTypes::ObjectTypeEntry::counterDown
void counterDown()
down count
Definition: GNESelectorFrame.cpp:637
GNESelectorFrame::clearCurrentSelection
void clearCurrentSelection() const
clear current selection with possibility of undo/redo
Definition: GNESelectorFrame.cpp:130
GNESelectorFrame::MatchAttribute::onCmdSelMBAttribute
long onCmdSelMBAttribute(FXObject *, FXSelector, void *)
Called when the user selectes a tag in the match box.
Definition: GNESelectorFrame.cpp:954
GNESelectorFrame::ElementSet::ELEMENTSET_SHAPE
@ ELEMENTSET_SHAPE
Definition: GNESelectorFrame.h:184
SUMO_TAG_WALK_BUSSTOP
@ SUMO_TAG_WALK_BUSSTOP
Definition: SUMOXMLDefinitions.h:308
GNESelectorFrame::ModificationMode::myReplaceRadioButton
FXRadioButton * myReplaceRadioButton
replace radio button
Definition: GNESelectorFrame.h:165
GNESelectorFrame::LockGLObjectTypes::ObjectTypeEntry::isGLTypeLocked
bool isGLTypeLocked() const
check if current GLType is blocked
Definition: GNESelectorFrame.cpp:644
SUMO_TAG_ROUTE
@ SUMO_TAG_ROUTE
begin/end of the description of a route
Definition: SUMOXMLDefinitions.h:125
config.h
GNEAttributeCarrier::getTagProperties
static const TagProperties & getTagProperties(SumoXMLTag tag)
get Tag Properties
Definition: GNEAttributeCarrier.cpp:1298
SUMO_TAG_PERSONFLOW
@ SUMO_TAG_PERSONFLOW
Definition: SUMOXMLDefinitions.h:299
GLO_ADDITIONAL
@ GLO_ADDITIONAL
reserved GLO type to pack all additionals
Definition: GUIGlObjectTypes.h:59
GLO_JUNCTION
@ GLO_JUNCTION
a junction
Definition: GUIGlObjectTypes.h:50
GNE_ATTR_SELECTED
@ GNE_ATTR_SELECTED
element is selected
Definition: SUMOXMLDefinitions.h:971
GNEViewNet::getEditModes
const GNEViewNetHelper::EditModes & getEditModes() const
get edit modes
Definition: GNEViewNet.cpp:434
SUMO_TAG_STOP_BUSSTOP
@ SUMO_TAG_STOP_BUSSTOP
stop placed over a busStop (used in netedit)
Definition: SUMOXMLDefinitions.h:182
GNESelectorFrame::LockGLObjectTypes::IsObjectTypeLocked
bool IsObjectTypeLocked(const GUIGlObjectType type) const
check if an object is locked
Definition: GNESelectorFrame.cpp:579
GNESelectorFrame::ElementSet::onCmdSelectElementSet
long onCmdSelectElementSet(FXObject *, FXSelector, void *)
Called when the user change the set of element to search (netElement, Additional or shape)
Definition: GNESelectorFrame.cpp:764
GNESelectorFrame::LockGLObjectTypes::ObjectTypeEntry::onCmdSetCheckBox
long onCmdSetCheckBox(FXObject *, FXSelector, void *)
Definition: GNESelectorFrame.cpp:650
GNEPOI.h
GNESelectorFrame::LockGLObjectTypes::removeLockedObject
void removeLockedObject(const GUIGlObjectType type)
set object unselected
Definition: GNESelectorFrame.cpp:573
ShapeContainer::getPolygons
const Polygons & getPolygons() const
Returns all polygons.
Definition: ShapeContainer.h:149
SUMO_TAG_PERSONSTOP_BUSSTOP
@ SUMO_TAG_PERSONSTOP_BUSSTOP
Definition: SUMOXMLDefinitions.h:312
GNESelectorFrame::VisualScaling::mySelectionScaling
FXRealSpinner * mySelectionScaling
Spinner for selection scaling.
Definition: GNESelectorFrame.h:325
GNESelectorFrame::MatchAttribute::onCmdHelp
long onCmdHelp(FXObject *, FXSelector, void *)
Called when the user clicks the help button.
Definition: GNESelectorFrame.cpp:1072
GNEUndoList::p_begin
void p_begin(const std::string &description)
Begin undo command sub-group. This begins a new group of commands that are treated as a single comman...
Definition: GNEUndoList.cpp:72
SumoXMLAttr
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
Definition: SUMOXMLDefinitions.h:372
GNESelectorFrame::ElementSet::mySetComboBox
FXComboBox * mySetComboBox
Combo Box with the element sets.
Definition: GNESelectorFrame.h:219
SUMO_TAG_EMBEDDEDROUTE
@ SUMO_TAG_EMBEDDEDROUTE
begin/end of the description of a embedded route (used in NETEDIT)
Definition: SUMOXMLDefinitions.h:127
GNESelectorFrame::ACsToSelected
bool ACsToSelected() const
check if there is ACs to select/unselect
Definition: GNESelectorFrame.cpp:1573
GNEFrame::show
virtual void show()
show Frame
Definition: GNEFrame.cpp:107
GLO_ROUTEFLOW
@ GLO_ROUTEFLOW
a routeFlow
Definition: GUIGlObjectTypes.h:147
WRITE_ERROR
#define WRITE_ERROR(msg)
Definition: MsgHandler.h:283
WRITE_DEBUG
#define WRITE_DEBUG(msg)
Definition: MsgHandler.h:284
GNEAttributeCarrier
Definition: GNEAttributeCarrier.h:54
GNESelectorFrame::LockGLObjectTypes::ObjectTypeEntry::counterUp
void counterUp()
up count
Definition: GNESelectorFrame.cpp:630
SUMO_TAG_RIDE_FROMTO
@ SUMO_TAG_RIDE_FROMTO
Definition: SUMOXMLDefinitions.h:310
GNESelectorFrame::ModificationMode::onCmdSelectModificationMode
long onCmdSelectModificationMode(FXObject *, FXSelector, void *)
Definition: GNESelectorFrame.cpp:689
GNEFrame::hide
virtual void hide()
hide Frame
Definition: GNEFrame.cpp:116
GNENet.h
SUMO_TAG_TRIP
@ SUMO_TAG_TRIP
a single trip definition (used by router)
Definition: SUMOXMLDefinitions.h:145
GLO_STOP
@ GLO_STOP
Definition: GUIGlObjectTypes.h:133
GNEShape::isAttributeCarrierSelected
bool isAttributeCarrierSelected() const
check if attribute carrier is selected
Definition: GNEShape.cpp:138
GLO_EMBEDDEDROUTE
@ GLO_EMBEDDEDROUTE
a embedded route
Definition: GUIGlObjectTypes.h:117
GNESelectorFrame::getLockGLObjectTypes
LockGLObjectTypes * getLockGLObjectTypes() const
get selected items Modul
Definition: GNESelectorFrame.cpp:459
GNESelectorFrame::ModificationMode::SetOperation
SetOperation
FOX-declaration.
Definition: GNESelectorFrame.h:127
GNEUndoList.h
MID_CHOOSEN_OPERATION
@ MID_CHOOSEN_OPERATION
set type of selection
Definition: GUIAppEnum.h:510
GNESelectorFrame::MatchAttribute::~MatchAttribute
~MatchAttribute()
destructor
Definition: GNESelectorFrame.cpp:831
GUIDesignDialogBox
#define GUIDesignDialogBox
Definition: GUIDesigns.h:433
GNE_ATTR_PARENT
@ GNE_ATTR_PARENT
parent of an additional element
Definition: SUMOXMLDefinitions.h:987
GNEConnection.h
GNESelectorFrame::LockGLObjectTypes::addedLockedObject
void addedLockedObject(const GUIGlObjectType type)
set object selected
Definition: GNESelectorFrame.cpp:567
GNESelectorFrame::SelectionOperation::onCmdLoad
long onCmdLoad(FXObject *, FXSelector, void *)
Called when the user presses the Load-button.
Definition: GNESelectorFrame.cpp:1175