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-2018 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 /****************************************************************************/
15 // The Widget for modifying selections of network-elements
16 // (some elements adapted from GUIDialog_GLChosenEditor)
17 /****************************************************************************/
18 
19 
20 // ===========================================================================
21 // included modules
22 // ===========================================================================
23 #include <config.h>
24 
25 #include <iostream>
33 #include <netedit/GNEViewNet.h>
34 #include <netedit/GNEViewParent.h>
35 #include <netedit/GNENet.h>
44 #include <netedit/GNEUndoList.h>
46 
47 #include "GNESelectorFrame.h"
48 
49 
50 // ===========================================================================
51 // FOX callback mapping
52 // ===========================================================================
53 FXDEFMAP(GNESelectorFrame::ModificationMode) ModificationModeMap[] = {
55 };
56 
57 FXDEFMAP(GNESelectorFrame::ElementSet) ElementSetMap[] = {
59 };
60 
61 FXDEFMAP(GNESelectorFrame::MatchAttribute) MatchAttributeMap[] = {
66 };
67 
68 FXDEFMAP(GNESelectorFrame::VisualScaling) VisualScalingMap[] = {
70 };
71 
72 FXDEFMAP(GNESelectorFrame::SelectionOperation) SelectionOperationMap[] = {
77 };
78 
79 // Object implementation
80 FXIMPLEMENT(GNESelectorFrame::ModificationMode, FXGroupBox, ModificationModeMap, ARRAYNUMBER(ModificationModeMap))
81 FXIMPLEMENT(GNESelectorFrame::ElementSet, FXGroupBox, ElementSetMap, ARRAYNUMBER(ElementSetMap))
82 FXIMPLEMENT(GNESelectorFrame::MatchAttribute, FXGroupBox, MatchAttributeMap, ARRAYNUMBER(MatchAttributeMap))
83 FXIMPLEMENT(GNESelectorFrame::VisualScaling, FXGroupBox, VisualScalingMap, ARRAYNUMBER(VisualScalingMap))
84 FXIMPLEMENT(GNESelectorFrame::SelectionOperation, FXGroupBox, SelectionOperationMap, ARRAYNUMBER(SelectionOperationMap))
85 
86 // ===========================================================================
87 // method definitions
88 // ===========================================================================
89 
90 GNESelectorFrame::GNESelectorFrame(FXHorizontalFrame* horizontalFrameParent, GNEViewNet* viewNet):
91  GNEFrame(horizontalFrameParent, viewNet, "Selection") {
92  // create selectedItems modul
93  myLockGLObjectTypes = new LockGLObjectTypes(this);
94  // create Modification Mode modul
95  myModificationMode = new ModificationMode(this);
96  // create ElementSet modul
97  myElementSet = new ElementSet(this);
98  // create MatchAttribute modul
99  myMatchAttribute = new MatchAttribute(this);
100  // create VisualScaling modul
101  myVisualScaling = new VisualScaling(this);
102  // create SelectionOperation modul
103  mySelectionOperation = new SelectionOperation(this);
104  // Create groupbox for information about selections
105  FXGroupBox* selectionHintGroupBox = new FXGroupBox(myContentFrame, "Information", GUIDesignGroupBoxFrame);
106  // Create Selection Hint
107  new FXLabel(selectionHintGroupBox, " - Hold <SHIFT> for \n rectangle selection.\n - Press <DEL> to\n delete selected items.", 0, GUIDesignLabelFrameInformation);
108 }
109 
110 
112 
113 
114 void
116  // update selected items
118  // Show frame
119  GNEFrame::show();
120 }
121 
122 
123 void
125  // hide frame
126  GNEFrame::hide();
127 }
128 
129 
132  return myLockGLObjectTypes;
133 }
134 
135 
136 void
138  // for clear selection, simply change all GNE_ATTR_SELECTED attribute of current selected elements
139  myViewNet->getUndoList()->p_begin("clear selection");
140  std::vector<GNEAttributeCarrier*> selectedAC = myViewNet->getNet()->getSelectedAttributeCarriers();
141  // change attribute GNE_ATTR_SELECTED of all selected items to false
142  for (auto i : selectedAC) {
143  i->setAttribute(GNE_ATTR_SELECTED, "false", myViewNet->getUndoList());
144  }
145  // finish clear selection
147  // update current selected items
149  // update view
150  myViewNet->update();
151 }
152 
153 
154 void
155 GNESelectorFrame::handleIDs(const std::vector<GNEAttributeCarrier*>& ACs, ModificationMode::SetOperation setop) {
157  // declare two sets of attribute carriers, one for select and another for unselect
158  std::set<std::pair<std::string, GNEAttributeCarrier*> > ACToSelect;
159  std::set<std::pair<std::string, GNEAttributeCarrier*> > ACToUnselect;
160  // in restrict AND replace mode all current selected attribute carriers will be unselected
161  if ((setOperation == ModificationMode::SET_REPLACE) || (setOperation == ModificationMode::SET_RESTRICT)) {
162  for (auto i : myViewNet->getNet()->getSelectedAttributeCarriers()) {
163  ACToUnselect.insert(std::pair<std::string, GNEAttributeCarrier*>(i->getID(), i));
164  }
165  }
166  // handle ids
167  for (auto i : ACs) {
168  // iterate over AtributeCarriers an place it in ACToSelect or ACToUnselect
169  switch (setOperation) {
171  ACToUnselect.insert(std::pair<std::string, GNEAttributeCarrier*>(i->getID(), i));
172  break;
174  if (ACToUnselect.find(std::pair<std::string, GNEAttributeCarrier*>(i->getID(), i)) != ACToUnselect.end()) {
175  ACToSelect.insert(std::pair<std::string, GNEAttributeCarrier*>(i->getID(), i));
176  }
177  break;
178  default:
179  ACToSelect.insert(std::pair<std::string, GNEAttributeCarrier*>(i->getID(), i));
180  break;
181  }
182  }
183  // select junctions and their connections if Auto select junctions is enabled (note: only for "add mode")
185  std::vector<GNEEdge*> edgesToSelect;
186  // iterate over ACToSelect and extract edges
187  for (auto i : ACToSelect) {
188  if (i.second->getTag() == SUMO_TAG_EDGE) {
189  edgesToSelect.push_back(dynamic_cast<GNEEdge*>(i.second));
190  }
191  }
192  // iterate over extracted edges
193  for (auto i : edgesToSelect) {
194  // select junction source and all their connections and crossings
195  ACToSelect.insert(std::make_pair(i->getGNEJunctionSource()->getID(), i->getGNEJunctionSource()));
196  for (auto j : i->getGNEJunctionSource()->getGNEConnections()) {
197  ACToSelect.insert(std::make_pair(j->getID(), j));
198  }
199  for (auto j : i->getGNEJunctionSource()->getGNECrossings()) {
200  ACToSelect.insert(std::make_pair(j->getID(), j));
201  }
202  // select junction destiny and all their connections crossings
203  ACToSelect.insert(std::make_pair(i->getGNEJunctionDestiny()->getID(), i->getGNEJunctionDestiny()));
204  for (auto j : i->getGNEJunctionDestiny()->getGNEConnections()) {
205  ACToSelect.insert(std::make_pair(j->getID(), j));
206  }
207  for (auto j : i->getGNEJunctionDestiny()->getGNECrossings()) {
208  ACToSelect.insert(std::make_pair(j->getID(), j));
209  }
210  }
211  }
212  // only continue if there is ACs to select or unselect
213  if ((ACToSelect.size() + ACToUnselect.size()) > 0) {
214  // first unselect AC of ACToUnselect and then selects AC of ACToSelect
215  myViewNet->getUndoList()->p_begin("selection using rectangle");
216  for (auto i : ACToUnselect) {
217  if (GNEAttributeCarrier::getTagProperties(i.second->getTag()).isSelectable()) {
218  i.second->setAttribute(GNE_ATTR_SELECTED, "false", myViewNet->getUndoList());
219  }
220  }
221  for (auto i : ACToSelect) {
222  if (GNEAttributeCarrier::getTagProperties(i.second->getTag()).isSelectable()) {
223  i.second->setAttribute(GNE_ATTR_SELECTED, "true", myViewNet->getUndoList());
224  }
225  }
226  // finish operation
228  }
229  // update current selected items
231  // update view
232  myViewNet->update();
233 }
234 
235 
238  return myModificationMode;
239 }
240 
241 
242 std::vector<GNEAttributeCarrier*>
243 GNESelectorFrame::getMatches(SumoXMLTag ACTag, SumoXMLAttr ACAttr, char compOp, double val, const std::string& expr) {
244  std::vector<GNEAttributeCarrier*> result;
245  std::vector<GNEAttributeCarrier*> allACbyTag = myViewNet->getNet()->retrieveAttributeCarriers(ACTag);
246  const auto& tagValue = GNEAttributeCarrier::getTagProperties(ACTag);
247  for (auto it : allACbyTag) {
248  if (expr == "") {
249  result.push_back(it);
250  } else if (tagValue.hasAttribute(ACAttr) && tagValue.getAttribute(ACAttr).isNumerical()) {
251  double acVal;
252  std::istringstream buf(it->getAttribute(ACAttr));
253  buf >> acVal;
254  switch (compOp) {
255  case '<':
256  if (acVal < val) {
257  result.push_back(it);
258  }
259  break;
260  case '>':
261  if (acVal > val) {
262  result.push_back(it);
263  }
264  break;
265  case '=':
266  if (acVal == val) {
267  result.push_back(it);
268  }
269  break;
270  }
271  } else {
272  // string match
273  std::string acVal = it->getAttributeForSelection(ACAttr);
274  switch (compOp) {
275  case '@':
276  if (acVal.find(expr) != std::string::npos) {
277  result.push_back(it);
278  }
279  break;
280  case '!':
281  if (acVal.find(expr) == std::string::npos) {
282  result.push_back(it);
283  }
284  break;
285  case '=':
286  if (acVal == expr) {
287  result.push_back(it);
288  }
289  break;
290  case '^':
291  if (acVal != expr) {
292  result.push_back(it);
293  }
294  break;
295  }
296  }
297  }
298  return result;
299 }
300 
301 // ---------------------------------------------------------------------------
302 // ModificationMode::LockGLObjectTypes - methods
303 // ---------------------------------------------------------------------------
304 
306  FXGroupBox(selectorFrameParent->myContentFrame, "Selected items", GUIDesignGroupBoxFrame),
307  mySelectorFrameParent(selectorFrameParent) {
308  // create combo box and labels for selected items
309  FXMatrix* mLockGLObjectTypes = new FXMatrix(this, 3, (LAYOUT_FILL_X | LAYOUT_BOTTOM | LAYOUT_LEFT | MATRIX_BY_COLUMNS), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
310  // create typeEntries for the different elements
311  myTypeEntries[GLO_JUNCTION] = ObjectTypeEntry(mLockGLObjectTypes, "Junctions", "junction");
312  myTypeEntries[GLO_EDGE] = ObjectTypeEntry(mLockGLObjectTypes, "Edges", "edge");
313  myTypeEntries[GLO_LANE] = ObjectTypeEntry(mLockGLObjectTypes, "Lanes", "lane");
314  myTypeEntries[GLO_CONNECTION] = ObjectTypeEntry(mLockGLObjectTypes, "Connections", "connection");
315  myTypeEntries[GLO_ADDITIONAL] = ObjectTypeEntry(mLockGLObjectTypes, "Additionals", "additional");
316  myTypeEntries[GLO_CROSSING] = ObjectTypeEntry(mLockGLObjectTypes, "Crossings", "crossing");
317  myTypeEntries[GLO_POLYGON] = ObjectTypeEntry(mLockGLObjectTypes, "Polygons", "polygon");
318  myTypeEntries[GLO_POI] = ObjectTypeEntry(mLockGLObjectTypes, "POIs", "POI");
319 }
320 
321 
323 
324 
325 void
327  myTypeEntries[GLO_JUNCTION].count->setText(toString(mySelectorFrameParent->getViewNet()->getNet()->retrieveJunctions(true).size()).c_str());
328  myTypeEntries[GLO_EDGE].count->setText(toString(mySelectorFrameParent->getViewNet()->getNet()->retrieveEdges(true).size()).c_str());
329  myTypeEntries[GLO_LANE].count->setText(toString(mySelectorFrameParent->getViewNet()->getNet()->retrieveLanes(true).size()).c_str());
332  myTypeEntries[GLO_CROSSING].count->setText(toString(mySelectorFrameParent->getViewNet()->getNet()->retrieveCrossings(true).size()).c_str());
334  myTypeEntries[GLO_POI].count->setText(toString(mySelectorFrameParent->getViewNet()->getNet()->retrieveShapes(SUMO_TAG_POI, true).size()).c_str());
335  // show information in debug mode
336  WRITE_DEBUG("Current selection: " +
337  toString(mySelectorFrameParent->getViewNet()->getNet()->retrieveJunctions(true).size()) + " Junctions, " +
338  toString(mySelectorFrameParent->getViewNet()->getNet()->retrieveEdges(true).size()) + " Edges, " +
339  toString(mySelectorFrameParent->getViewNet()->getNet()->retrieveLanes(true).size()) + " Lanes, " +
340  toString(mySelectorFrameParent->getViewNet()->getNet()->retrieveConnections(true).size()) + " connections, " +
341  toString(mySelectorFrameParent->getViewNet()->getNet()->retrieveAdditionals(true).size()) + " Additionals, " +
342  toString(mySelectorFrameParent->getViewNet()->getNet()->retrieveCrossings(true).size()) + " Crossings, " +
343  toString(mySelectorFrameParent->getViewNet()->getNet()->retrieveShapes(SUMO_TAG_POLY, true).size()) + " Polygons, " +
345 }
346 
347 
348 bool
350  if ((type >= 100) && (type < 199)) {
351  return myTypeEntries.at(GLO_ADDITIONAL).locked->getCheck() != FALSE;
352  } else {
353  return myTypeEntries.at(type).locked->getCheck() != FALSE;
354  }
355 }
356 
357 
358 GNESelectorFrame::LockGLObjectTypes::ObjectTypeEntry::ObjectTypeEntry(FXMatrix* parent, const std::string& label, const std::string& label2) {
359  count = new FXLabel(parent, "0", 0, GUIDesignLabelLeft);
360  typeName = new FXLabel(parent, label.c_str(), 0, GUIDesignLabelLeft);
361  locked = new FXMenuCheck(parent, ("lock\t\tLock " + label2 + " selection").c_str(), 0, 0, LAYOUT_FILL_X | LAYOUT_RIGHT);
362 }
363 
364 // ---------------------------------------------------------------------------
365 // ModificationMode::ModificationMode - methods
366 // ---------------------------------------------------------------------------
367 
369  FXGroupBox(selectorFrameParent->myContentFrame, "Modification Mode", GUIDesignGroupBoxFrame),
370  mySelectorFrameParent(selectorFrameParent),
371  myModificationModeType(SET_ADD) {
372  // Create all options buttons
373  myAddRadioButton = new FXRadioButton(this, "add\t\tSelected objects are added to the previous selection",
375  myRemoveRadioButton = new FXRadioButton(this, "remove\t\tSelected objects are removed from the previous selection",
377  myKeepRadioButton = new FXRadioButton(this, "keep\t\tRestrict previous selection by the current selection",
379  myReplaceRadioButton = new FXRadioButton(this, "replace\t\tReplace previous selection by the current selection",
381  myAddRadioButton->setCheck(true);
382 }
383 
384 
386 
387 
390  return myModificationModeType;
391 }
392 
393 
394 long
396  if (obj == myAddRadioButton) {
398  myAddRadioButton->setCheck(true);
399  myRemoveRadioButton->setCheck(false);
400  myKeepRadioButton->setCheck(false);
401  myReplaceRadioButton->setCheck(false);
402  return 1;
403  } else if (obj == myRemoveRadioButton) {
405  myAddRadioButton->setCheck(false);
406  myRemoveRadioButton->setCheck(true);
407  myKeepRadioButton->setCheck(false);
408  myReplaceRadioButton->setCheck(false);
409  return 1;
410  } else if (obj == myKeepRadioButton) {
412  myAddRadioButton->setCheck(false);
413  myRemoveRadioButton->setCheck(false);
414  myKeepRadioButton->setCheck(true);
415  myReplaceRadioButton->setCheck(false);
416  return 1;
417  } else if (obj == myReplaceRadioButton) {
419  myAddRadioButton->setCheck(false);
420  myRemoveRadioButton->setCheck(false);
421  myKeepRadioButton->setCheck(false);
422  myReplaceRadioButton->setCheck(true);
423  return 1;
424  } else {
425  return 0;
426  }
427 }
428 
429 // ---------------------------------------------------------------------------
430 // ModificationMode::ElementSet - methods
431 // ---------------------------------------------------------------------------
432 
434  FXGroupBox(selectorFrameParent->myContentFrame, "Element Set", GUIDesignGroupBoxFrame),
435  mySelectorFrameParent(selectorFrameParent),
436  myCurrentElementSet(ELEMENTSET_NETELEMENT) {
437  // Create MatchTagBox for tags and fill it
439  mySetComboBox->appendItem("Net Element");
440  mySetComboBox->appendItem("Additional");
441  mySetComboBox->appendItem("Shape");
442  mySetComboBox->setNumVisible(mySetComboBox->getNumItems());
443 }
444 
445 
447 
448 
451  return myCurrentElementSet;
452 }
453 
454 
455 long
457  if (mySetComboBox->getText() == "Net Element") {
459  mySetComboBox->setTextColor(FXRGB(0, 0, 0));
460  // enable match attribute
462  } else if (mySetComboBox->getText() == "Additional") {
464  mySetComboBox->setTextColor(FXRGB(0, 0, 0));
465  // enable match attribute
467  } else if (mySetComboBox->getText() == "Shape") {
469  mySetComboBox->setTextColor(FXRGB(0, 0, 0));
470  // enable match attribute
472  } else {
474  mySetComboBox->setTextColor(FXRGB(255, 0, 0));
475  // disable match attribute
477  }
478  return 1;
479 }
480 
481 // ---------------------------------------------------------------------------
482 // ModificationMode::MatchAttribute - methods
483 // ---------------------------------------------------------------------------
484 
486  FXGroupBox(selectorFrameParent->myContentFrame, "Match Attribute", GUIDesignGroupBoxFrame),
487  mySelectorFrameParent(selectorFrameParent),
488  myCurrentTag(SUMO_TAG_EDGE),
489  myCurrentAttribute(SUMO_ATTR_ID) {
490  // Create MatchTagBox for tags
492  // Create listBox for Attributes
494  // Create TextField for Match string
496  // Create help button
497  new FXButton(this, "Help", 0, this, MID_HELP, GUIDesignButtonRectangular);
498  // Fill list of sub-items (first element will be "edge")
500  // Set speed of edge as default attribute
501  myMatchAttrComboBox->setText("speed");
503  // Set default value for Match string
504  myMatchString->setText(">10.0");
505 }
506 
507 
509 
510 
511 void
513  // enable comboboxes and text field
514  myMatchTagComboBox->enable();
515  myMatchAttrComboBox->enable();
516  myMatchString->enable();
517  // Clear items of myMatchTagComboBox
518  myMatchTagComboBox->clearItems();
519  // Set items depending of current item set
521  auto listOfTags = GNEAttributeCarrier::allowedNetElementsTags(true);
522  for (auto i : listOfTags) {
523  myMatchTagComboBox->appendItem(toString(i).c_str());
524  }
526  auto listOfTags = GNEAttributeCarrier::allowedAdditionalTags(true);
527  for (auto i : listOfTags) {
528  myMatchTagComboBox->appendItem(toString(i).c_str());
529  }
531  auto listOfTags = GNEAttributeCarrier::allowedShapeTags(true);
532  for (auto i : listOfTags) {
533  myMatchTagComboBox->appendItem(toString(i).c_str());
534  }
535  } else {
536  throw ProcessError("Invalid element set");
537  }
538  // set first item as current item
539  myMatchTagComboBox->setCurrentItem(0);
540  myMatchTagComboBox->setNumVisible(myMatchTagComboBox->getNumItems());
541  // Fill attributes with the current element type
542  onCmdSelMBTag(0, 0, 0);
543 }
544 
545 
546 void
548  // disable comboboxes and text field
549  myMatchTagComboBox->disable();
550  myMatchAttrComboBox->disable();
551  myMatchString->disable();
552  // change colors to black (even if there are invalid values)
553  myMatchTagComboBox->setTextColor(FXRGB(0, 0, 0));
554  myMatchAttrComboBox->setTextColor(FXRGB(0, 0, 0));
555  myMatchString->setTextColor(FXRGB(0, 0, 0));
556 }
557 
558 
559 long
560 GNESelectorFrame::MatchAttribute::onCmdSelMBTag(FXObject*, FXSelector, void*) {
561  // First check what type of elementes is being selected
563  // find current element tag
565  auto listOfTags = GNEAttributeCarrier::allowedNetElementsTags(true);
566  for (auto i : listOfTags) {
567  if (toString(i) == myMatchTagComboBox->getText().text()) {
568  myCurrentTag = i;
569  }
570  }
572  auto listOfTags = GNEAttributeCarrier::allowedAdditionalTags(true);
573  for (auto i : listOfTags) {
574  if (toString(i) == myMatchTagComboBox->getText().text()) {
575  myCurrentTag = i;
576  }
577  }
579  auto listOfTags = GNEAttributeCarrier::allowedShapeTags(true);
580  for (auto i : listOfTags) {
581  if (toString(i) == myMatchTagComboBox->getText().text()) {
582  myCurrentTag = i;
583  }
584  }
585  } else {
586  throw ProcessError("Unkown set");
587  }
588  // check that typed-by-user value is correct
590  // obtain tag property (only for improve code legibility)
591  const auto& tagValue = GNEAttributeCarrier::getTagProperties(myCurrentTag);
592  // set color and enable items
593  myMatchTagComboBox->setTextColor(FXRGB(0, 0, 0));
594  myMatchAttrComboBox->enable();
595  myMatchString->enable();
596  myMatchAttrComboBox->clearItems();
597  // fill attribute combo box
598  for (auto it : tagValue) {
599  myMatchAttrComboBox->appendItem(toString(it.first).c_str());
600  }
601  // Add extra attribute "generic"
602  myMatchAttrComboBox->appendItem(toString(GNE_ATTR_GENERIC).c_str());
603  // check if item can block movement
604  if (tagValue.canBlockMovement()) {
606  }
607  // check if item can block shape
608  if (tagValue.canBlockShape()) {
609  myMatchAttrComboBox->appendItem(toString(GNE_ATTR_BLOCK_SHAPE).c_str());
610  }
611  // check if item can close shape
612  if (tagValue.canCloseShape()) {
613  myMatchAttrComboBox->appendItem(toString(GNE_ATTR_CLOSE_SHAPE).c_str());
614  }
615  // check if item can have parent
616  if (tagValue.hasParent()) {
617  myMatchAttrComboBox->appendItem(toString(GNE_ATTR_PARENT).c_str());
618  }
619  // @ToDo: Here can be placed a button to set the default value
620  myMatchAttrComboBox->setNumVisible(myMatchAttrComboBox->getNumItems());
621  onCmdSelMBAttribute(0, 0, 0);
622  } else {
623  // change color to red and disable items
624  myMatchTagComboBox->setTextColor(FXRGB(255, 0, 0));
625  myMatchAttrComboBox->disable();
626  myMatchString->disable();
627  }
628  update();
629  return 1;
630 }
631 
632 
633 long
635  // first obtain a copy of item attributes vinculated with current tag
636  auto tagPropertiesCopy = GNEAttributeCarrier::getTagProperties(myCurrentTag);
637  // obtain tag property (only for improve code legibility)
638  const auto& tagValue = GNEAttributeCarrier::getTagProperties(myCurrentTag);
639  // add an extra AttributeValues to allow select ACs using as criterium "generic parameters"
640  tagPropertiesCopy.addAttribute(GNE_ATTR_GENERIC, GNEAttributeCarrier::AttrProperty::ATTRPROPERTY_STRING, "", "");
641  // add extra attribute if item can block movement
642  if (tagValue.canBlockMovement()) {
643  // add an extra AttributeValues to allow select ACs using as criterium "block movement"
644  tagPropertiesCopy.addAttribute(GNE_ATTR_BLOCK_MOVEMENT, GNEAttributeCarrier::AttrProperty::ATTRPROPERTY_BOOL, "", "false");
645  }
646  // add extra attribute if item can block shape
647  if (tagValue.canBlockShape()) {
648  // add an extra AttributeValues to allow select ACs using as criterium "block shape"
649  tagPropertiesCopy.addAttribute(GNE_ATTR_BLOCK_SHAPE, GNEAttributeCarrier::AttrProperty::ATTRPROPERTY_BOOL, "", "false");
650  }
651  // add extra attribute if item can close shape
652  if (tagValue.canCloseShape()) {
653  // add an extra AttributeValues to allow select ACs using as criterium "close shape"
654  tagPropertiesCopy.addAttribute(GNE_ATTR_CLOSE_SHAPE, GNEAttributeCarrier::AttrProperty::ATTRPROPERTY_BOOL, "", "true");
655  }
656  // add extra attribute if item can have parent
657  if (tagValue.hasParent()) {
658  // add an extra AttributeValues to allow select ACs using as criterium "parent"
659  tagPropertiesCopy.addAttribute(GNE_ATTR_PARENT, GNEAttributeCarrier::AttrProperty::ATTRPROPERTY_STRING, "", "");
660  }
661  // set current selected attribute
663  for (auto i : tagPropertiesCopy) {
664  if (toString(i.first) == myMatchAttrComboBox->getText().text()) {
665  myCurrentAttribute = i.first;
666  }
667  }
668  // check if selected attribute is valid
670  myMatchAttrComboBox->setTextColor(FXRGB(0, 0, 0));
671  myMatchString->enable();
672  } else {
673  myMatchAttrComboBox->setTextColor(FXRGB(255, 0, 0));
674  myMatchString->disable();
675  }
676  return 1;
677 }
678 
679 
680 long
682  // obtain expresion
683  std::string expr(myMatchString->getText().text());
684  const auto& tagValue = GNEAttributeCarrier::getTagProperties(myCurrentTag);
685  bool valid = true;
686  if (expr == "") {
687  // the empty expression matches all objects
689  } else if (tagValue.hasAttribute(myCurrentAttribute) && tagValue.getAttribute(myCurrentAttribute).isNumerical()) {
690  // The expression must have the form
691  // <val matches if attr < val
692  // >val matches if attr > val
693  // =val matches if attr = val
694  // val matches if attr = val
695  char compOp = expr[0];
696  if (compOp == '<' || compOp == '>' || compOp == '=') {
697  expr = expr.substr(1);
698  } else {
699  compOp = '=';
700  }
701  // check if value can be parsed to double
702  if (GNEAttributeCarrier::canParse<double>(expr.c_str())) {
703  mySelectorFrameParent->handleIDs(mySelectorFrameParent->getMatches(myCurrentTag, myCurrentAttribute, compOp, GNEAttributeCarrier::parse<double>(expr.c_str()), expr));
704  } else {
705  valid = false;
706  }
707  } else {
708  // The expression must have the form
709  // =str: matches if <str> is an exact match
710  // !str: matches if <str> is not a substring
711  // ^str: matches if <str> is not an exact match
712  // str: matches if <str> is a substring (sends compOp '@')
713  // Alternatively, if the expression is empty it matches all objects
714  char compOp = expr[0];
715  if (compOp == '=' || compOp == '!' || compOp == '^') {
716  expr = expr.substr(1);
717  } else {
718  compOp = '@';
719  }
721  }
722  if (valid) {
723  myMatchString->setTextColor(FXRGB(0, 0, 0));
724  myMatchString->killFocus();
725  } else {
726  myMatchString->setTextColor(FXRGB(255, 0, 0));
727  }
728  return 1;
729 }
730 
731 
732 long
733 GNESelectorFrame::MatchAttribute::onCmdHelp(FXObject*, FXSelector, void*) {
734  // Create dialog box
735  FXDialogBox* additionalNeteditAttributesHelpDialog = new FXDialogBox(this, "Netedit Parameters Help", GUIDesignDialogBox);
736  additionalNeteditAttributesHelpDialog->setIcon(GUIIconSubSys::getIcon(ICON_MODEADDITIONAL));
737  // set help text
738  std::ostringstream help;
739  help
740  << "- The 'Match Attribute' controls allow to specify a set of objects which are then applied to the current selection\n"
741  << " according to the current 'Modification Mode'.\n"
742  << " 1. Select an object type from the first input box\n"
743  << " 2. Select an attribute from the second input box\n"
744  << " 3. Enter a 'match expression' in the third input box and press <return>\n"
745  << "\n"
746  << "- The empty expression matches all objects\n"
747  << "- For numerical attributes the match expression must consist of a comparison operator ('<', '>', '=') and a number.\n"
748  << "- An object matches if the comparison between its attribute and the given number by the given operator evaluates to 'true'\n"
749  << "\n"
750  << "- For string attributes the match expression must consist of a comparison operator ('', '=', '!', '^') and a string.\n"
751  << " '' (no operator) matches if string is a substring of that object'ts attribute.\n"
752  << " '=' matches if string is an exact match.\n"
753  << " '!' matches if string is not a substring.\n"
754  << " '^' matches if string is not an exact match.\n"
755  << "\n"
756  << "- Examples:\n"
757  << " junction; id; 'foo' -> match all junctions that have 'foo' in their id\n"
758  << " junction; type; '=priority' -> match all junctions of type 'priority', but not of type 'priority_stop'\n"
759  << " edge; speed; '>10' -> match all edges with a speed above 10\n";
760  // Create label with the help text
761  new FXLabel(additionalNeteditAttributesHelpDialog, help.str().c_str(), 0, GUIDesignLabelFrameInformation);
762  // Create horizontal separator
763  new FXHorizontalSeparator(additionalNeteditAttributesHelpDialog, GUIDesignHorizontalSeparator);
764  // Create frame for OK Button
765  FXHorizontalFrame* myHorizontalFrameOKButton = new FXHorizontalFrame(additionalNeteditAttributesHelpDialog, GUIDesignAuxiliarHorizontalFrame);
766  // Create Button Close (And two more horizontal frames to center it)
767  new FXHorizontalFrame(myHorizontalFrameOKButton, GUIDesignAuxiliarHorizontalFrame);
768  new FXButton(myHorizontalFrameOKButton, "OK\t\tclose", GUIIconSubSys::getIcon(ICON_ACCEPT), additionalNeteditAttributesHelpDialog, FXDialogBox::ID_ACCEPT, GUIDesignButtonOK);
769  new FXHorizontalFrame(myHorizontalFrameOKButton, GUIDesignAuxiliarHorizontalFrame);
770  // Write Warning in console if we're in testing mode
771  WRITE_DEBUG("Opening help dialog of selector frame");
772  // create Dialog
773  additionalNeteditAttributesHelpDialog->create();
774  // show in the given position
775  additionalNeteditAttributesHelpDialog->show(PLACEMENT_CURSOR);
776  // refresh APP
777  getApp()->refresh();
778  // open as modal dialog (will block all windows until stop() or stopModal() is called)
779  getApp()->runModalFor(additionalNeteditAttributesHelpDialog);
780  // Write Warning in console if we're in testing mode
781  WRITE_DEBUG("Close help dialog of selector frame");
782  return 1;
783 }
784 
785 // ---------------------------------------------------------------------------
786 // ModificationMode::VisualScaling - methods
787 // ---------------------------------------------------------------------------
788 
790  FXGroupBox(selectorFrameParent->myContentFrame, "Visual Scaling", GUIDesignGroupBoxFrame),
791  mySelectorFrameParent(selectorFrameParent) {
792  // Create spin button and configure it
793  mySelectionScaling = new FXRealSpinner(this, 7, this, MID_GNE_SELECTORFRAME_SELECTSCALE, GUIDesignSpinDial);
794  //mySelectionScaling->setNumberFormat(1);
795  //mySelectionScaling->setIncrements(0.1, .5, 1);
796  mySelectionScaling->setIncrement(0.5);
797  mySelectionScaling->setRange(1, 100);
798  mySelectionScaling->setValue(1);
799  mySelectionScaling->setHelpText("Enlarge selected objects");
800 }
801 
802 
804 
805 
806 long
808  // set scale in viewnet
810  mySelectorFrameParent->getViewNet()->update();
811  return 1;
812 }
813 
814 // ---------------------------------------------------------------------------
815 // ModificationMode::SelectionOperation - methods
816 // ---------------------------------------------------------------------------
817 
819  FXGroupBox(selectorFrameParent->myContentFrame, "Operations for selections", GUIDesignGroupBoxFrame),
820  mySelectorFrameParent(selectorFrameParent) {
821  // Create "Clear List" Button
822  new FXButton(this, "Clear\t\t", 0, this, MID_CHOOSEN_CLEAR, GUIDesignButton);
823  // Create "Invert" Button
824  new FXButton(this, "Invert\t\t", 0, this, MID_CHOOSEN_INVERT, GUIDesignButton);
825  // Create "Save" Button
826  new FXButton(this, "Save\t\tSave ids of currently selected objects to a file.", 0, this, MID_CHOOSEN_SAVE, GUIDesignButton);
827  // Create "Load" Button
828  new FXButton(this, "Load\t\tLoad ids from a file according to the current modfication mode.", 0, this, MID_CHOOSEN_LOAD, GUIDesignButton);
829 }
830 
831 
833 
834 
835 long
836 GNESelectorFrame::SelectionOperation::onCmdLoad(FXObject*, FXSelector, void*) {
837  // get the new file name
838  FXFileDialog opendialog(this, "Open List of Selected Items");
839  opendialog.setIcon(GUIIconSubSys::getIcon(ICON_EMPTY));
840  opendialog.setSelectMode(SELECTFILE_EXISTING);
841  opendialog.setPatternList("Selection files (*.txt)\nAll files (*)");
842  if (gCurrentFolder.length() != 0) {
843  opendialog.setDirectory(gCurrentFolder);
844  }
845  if (opendialog.execute()) {
846  std::vector<GNEAttributeCarrier*> loadedACs;
847  gCurrentFolder = opendialog.getDirectory();
848  std::string file = opendialog.getFilename().text();
849  std::ostringstream msg;
850  std::ifstream strm(file.c_str());
851  // check if file can be opened
852  if (!strm.good()) {
853  WRITE_ERROR("Could not open '" + file + "'.");
854  return 0;
855  }
856  while (strm.good()) {
857  std::string line;
858  strm >> line;
859  // check if line isn't empty
860  if (line.length() != 0) {
861  // obtain GLObject
863  // check if GUIGlObject exist and their their GL type isn't blocked
864  if ((object != nullptr) && !mySelectorFrameParent->myLockGLObjectTypes->IsObjectTypeLocked(object->getType())) {
865  // obtain GNEAttributeCarrier
867  // check if AC exist and if is selectable
868  if (AC != nullptr) {
869  loadedACs.push_back(AC);
870  }
871  }
872  }
873  }
874  // change selected attribute in loaded ACs allowing undo/redo
875  if (loadedACs.size() > 0) {
876  mySelectorFrameParent->getViewNet()->getUndoList()->p_begin("load selection");
877  mySelectorFrameParent->handleIDs(loadedACs);
879  }
880  // update list of current selected items
882  }
883  mySelectorFrameParent->getViewNet()->update();
884  return 1;
885 }
886 
887 
888 long
889 GNESelectorFrame::SelectionOperation::onCmdSave(FXObject*, FXSelector, void*) {
890  FXString file = MFXUtils::getFilename2Write(
891  this, "Save List of selected Items", ".txt", GUIIconSubSys::getIcon(ICON_EMPTY), gCurrentFolder);
892  if (file == "") {
893  return 1;
894  }
895  try {
896  OutputDevice& dev = OutputDevice::getDevice(file.text());
898  GUIGlObject* object = dynamic_cast<GUIGlObject*>(i);
899  if (object) {
900  dev << GUIGlObject::TypeNames.getString(object->getType()) << ":" << i->getID() << "\n";
901  }
902  }
903  dev.close();
904  } catch (IOError& e) {
905  // write warning if netedit is running in testing mode
906  WRITE_DEBUG("Opening FXMessageBox 'error storing selection'");
907  // open message box error
908  FXMessageBox::error(this, MBOX_OK, "Storing Selection failed", "%s", e.what());
909  // write warning if netedit is running in testing mode
910  WRITE_DEBUG("Closed FXMessageBox 'error storing selection' with 'OK'");
911  }
912  return 1;
913 }
914 
915 
916 long
918  // clear current selection
920  return 1;
921 }
922 
923 
924 long
926  // first make a copy of current selected elements
927  std::vector<GNEAttributeCarrier*> copyOfSelectedAC = mySelectorFrameParent->getViewNet()->getNet()->getSelectedAttributeCarriers();
928  // for invert selection, first clean current selection and next select elements of set "unselectedElements"
929  mySelectorFrameParent->getViewNet()->getUndoList()->p_begin("invert selection");
930  // select junctions, edges, lanes connections and crossings
931  std::vector<GNEJunction*> junctions = mySelectorFrameParent->getViewNet()->getNet()->retrieveJunctions();
932  for (auto i : junctions) {
933  i->setAttribute(GNE_ATTR_SELECTED, "true", mySelectorFrameParent->getViewNet()->getUndoList());
934  // due we iterate over all junctions, only it's neccesary iterate over incoming edges
935  for (auto j : i->getGNEIncomingEdges()) {
936  // only select edges if "select edges" flag is enabled. In other case, select only lanes
938  j->setAttribute(GNE_ATTR_SELECTED, "true", mySelectorFrameParent->getViewNet()->getUndoList());
939  } else {
940  for (auto k : j->getLanes()) {
941  k->setAttribute(GNE_ATTR_SELECTED, "true", mySelectorFrameParent->getViewNet()->getUndoList());
942  }
943  }
944  // select connections
945  for (auto k : j->getGNEConnections()) {
946  k->setAttribute(GNE_ATTR_SELECTED, "true", mySelectorFrameParent->getViewNet()->getUndoList());
947  }
948  }
949  // select crossings
950  for (auto j : i->getGNECrossings()) {
951  j->setAttribute(GNE_ATTR_SELECTED, "true", mySelectorFrameParent->getViewNet()->getUndoList());
952  }
953  }
954  // select additionals
955  std::vector<GNEAdditional*> additionals = mySelectorFrameParent->getViewNet()->getNet()->retrieveAdditionals();
956  for (auto i : additionals) {
957  if (GNEAttributeCarrier::getTagProperties(i->getTag()).isSelectable()) {
958  i->setAttribute(GNE_ATTR_SELECTED, "true", mySelectorFrameParent->getViewNet()->getUndoList());
959  }
960  }
961  // select polygons
962  for (auto i : mySelectorFrameParent->getViewNet()->getNet()->getPolygons()) {
963  dynamic_cast<GNEPoly*>(i.second)->setAttribute(GNE_ATTR_SELECTED, "true", mySelectorFrameParent->getViewNet()->getUndoList());
964  }
965  // select POIs
966  for (auto i : mySelectorFrameParent->getViewNet()->getNet()->getPOIs()) {
967  dynamic_cast<GNEPOI*>(i.second)->setAttribute(GNE_ATTR_SELECTED, "true", mySelectorFrameParent->getViewNet()->getUndoList());
968  }
969  // now iterate over all elements of "copyOfSelectedAC" and undselect it
970  for (auto i : copyOfSelectedAC) {
972  }
973  // finish selection operation
975  // update current selected items
977  // update view
978  mySelectorFrameParent->getViewNet()->update();
979  return 1;
980 }
981 
982 
983 /****************************************************************************/
long onCmdSave(FXObject *, FXSelector, void *)
Called when the user presses the Save-button.
std::vector< GNEJunction * > retrieveJunctions(bool onlySelected=false)
return all junctions
Definition: GNENet.cpp:1107
a tl-logic
GNESelectorFrame * mySelectorFrameParent
pointer to Selector Frame Parent
std::vector< GNELane * > retrieveLanes(bool onlySelected=false)
return all lanes
Definition: GNENet.cpp:1059
void close()
Closes the device and removes it from the dictionary.
SumoXMLTag
Numbers representing SUMO-XML - element names.
bool selectEdges()
whether inspection, selection and inversion should apply to edges or to lanes
Definition: GNEViewNet.cpp:337
#define GUIDesignComboBoxNCol
number of column of every combo box
Definition: GUIDesigns.h:205
static std::vector< SumoXMLTag > allowedAdditionalTags(bool onlyDrawables)
get all editable for tag additional elements
a polygon
FXRadioButton * myReplaceRadioButton
replace radio button
GUIGlObjectType
FXComboBox * mySetComboBox
Combo Box with the element sets.
SetOperation getModificationMode() const
get current modification mode
block shape of a graphic element (Used mainly in GNEShapes)
void handleIDs(const std::vector< GNEAttributeCarrier *> &ACs, ModificationMode::SetOperation setop=ModificationMode::SET_DEFAULT)
apply list of ids to the current selection according to SetOperation,
Save set.
Definition: GUIAppEnum.h:350
const Polygons & getPolygons() const
Returns all polygons.
ObjectTypeEntry()
Definition: GNEPOI.h:44
GNEAttributeCarrier * retrieveAttributeCarrier(const GUIGlID id, bool failHard=true)
get a single attribute carrier based on a GLID
Definition: GNENet.cpp:1181
a connection
const std::string & getString(const T key) const
void show()
show Frame
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
method for setting the attribute and letting the object perform additional changes ...
Definition: GNEPOI.cpp:332
FXRadioButton * myAddRadioButton
add radio button
Close shape of a polygon (Used by GNEPolys)
std::vector< GNEConnection * > retrieveConnections(bool onlySelected=false) const
return all connections
Definition: GNENet.cpp:994
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:78
FXString gCurrentFolder
The folder used as last.
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
begin/end of the description of a Point of interest
select tag in selector frame
Definition: GUIAppEnum.h:551
void disableMatchAttribute()
disable match attributes
ElementSetType myCurrentElementSet
current element set selected
std::vector< GNEAttributeCarrier * > getSelectedAttributeCarriers()
get all selected attribute carriers
Definition: GNENet.cpp:1751
static FXString getFilename2Write(FXWindow *parent, const FXString &header, const FXString &extension, FXIcon *icon, FXString &currentFolder)
Returns the file name to write.
Definition: MFXUtils.cpp:84
generic attribute
GNEViewNet * getViewNet() const
get view net
Definition: GNEFrame.cpp:766
void enableMatchAttribute()
enable match attributes
FXRealSpinner * mySelectionScaling
Spinner for selection scaling.
long onCmdLoad(FXObject *, FXSelector, void *)
Called when the user presses the Load-button.
#define GUIDesignComboBox
Definition: GUIDesigns.h:195
GNEViewNet * myViewNet
View Net for changes.
Definition: GNEFrame.h:232
bool IsObjectTypeLocked(GUIGlObjectType type) const
check if an object is locked
~GNESelectorFrame()
Destructor.
set subset of elements
Definition: GUIAppEnum.h:346
FXComboBox * myMatchTagComboBox
tag of the match box
GNESelectorFrame * mySelectorFrameParent
pointer to Selector Frame Parent
changes the visual scaling of selected items
Definition: GUIAppEnum.h:557
GNESelectorFrame * mySelectorFrameParent
pointer to Selector Frame Parent
FXComboBox * myMatchAttrComboBox
attributes of the match box
GNEUndoList * getUndoList() const
get the undoList object
long onCmdSelMBString(FXObject *, FXSelector, void *)
Called when the user enters a new selection expression.
set type of selection
Definition: GUIAppEnum.h:344
long onCmdSelectModificationMode(FXObject *, FXSelector, void *)
LockGLObjectTypes * getLockGLObjectTypes() const
get selected items
GUIGlObjectType getType() const
Returns the type of the object as coded in GUIGlObjectType.
#define GUIDesignHorizontalSeparator
Definition: GUIDesigns.h:295
FXDEFMAP(GNESelectorFrame::ModificationMode) ModificationModeMap[]
#define GUIDesignTextField
Definition: GUIDesigns.h:34
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
Definition: ToString.h:49
FXVerticalFrame * myContentFrame
Vertical frame that holds all widgets of frame.
Definition: GNEFrame.h:235
help button
Definition: GUIAppEnum.h:400
void p_end()
End undo command sub-group. If the sub-group is still empty, it will be deleted; otherwise, the sub-group will be added as a new command into parent group. A matching begin() must have been called previously.
Definition: GNEUndoList.cpp:85
Deselect selected items.
Definition: GUIAppEnum.h:358
#define GUIDesignAuxiliarHorizontalFrame
design for auxiliar (Without borders) horizontal frame used to pack another frames ...
Definition: GUIDesigns.h:258
LockGLObjectTypes(GNESelectorFrame *selectorFrameParent)
constructor
FXTextField * myMatchString
string of the match
static std::vector< SumoXMLTag > allowedShapeTags(bool onlyDrawables)
get all editable for tag shape elements
static GUIGlObjectStorage gIDStorage
A single static instance of this class.
GNESelectorFrame * mySelectorFrameParent
pointer to Selector Frame Parent
block movement of a graphic element
invalid attribute
bool autoSelectNodes()
whether to autoselect nodes or to lanes
Definition: GNEViewNet.cpp:357
std::map< GUIGlObjectType, ObjectTypeEntry > myTypeEntries
check boxes for type-based selection locking and selected object counts
void updateLockGLObjectTypes()
update selected items
#define WRITE_DEBUG(msg)
Definition: MsgHandler.h:249
std::vector< GNEShape * > retrieveShapes(SumoXMLTag shapeTag, bool onlySelected=false)
return shape by type shapes
Definition: GNENet.cpp:1120
#define GUIDesignLabelFrameInformation
label extended over frame without thick and with text justify to left, used to show information in fr...
Definition: GUIDesigns.h:184
long onCmdSelectElementSet(FXObject *, FXSelector, void *)
Called when the user change the set of element to search (netElement, Additional or shape) ...
FXRadioButton * myKeepRadioButton
keep button
SumoXMLAttr myCurrentAttribute
current SumoXMLTag Attribute
#define GUIDesignButtonRectangular
little button rectangular (46x23) used in frames (For example, in "help" buttons) ...
Definition: GUIDesigns.h:60
std::vector< GNEAttributeCarrier * > retrieveAttributeCarriers(SumoXMLTag type=SUMO_TAG_NOTHING)
get the attribute carriers based on Type
Definition: GNENet.cpp:1204
SumoXMLTag myCurrentTag
current SumoXMLTag tag
begin/end of the description of an edge
long onCmdSelMBTag(FXObject *, FXSelector, void *)
Called when the user selectes a tag in the match box.
void setSelectionScaling(double selectionScale)
set selection scaling
Definition: GNEViewNet.cpp:363
#define WRITE_ERROR(msg)
Definition: MsgHandler.h:248
long onCmdClear(FXObject *, FXSelector, void *)
Called when the user presses the Clear-button.
#define GUIDesignTextFieldNCol
Num of column of text field.
Definition: GUIDesigns.h:46
reserved GLO type to pack all additionals
long onCmdInvert(FXObject *, FXSelector, void *)
Called when the user presses the Invert-button.
ModificationMode * getModificationModeModul() const
get modification mode modul
#define GUIDesignButton
Definition: GUIDesigns.h:54
LockGLObjectTypes * myLockGLObjectTypes
modul for lock selected items
virtual void show()
show Frame
Definition: GNEFrame.cpp:741
#define GUIDesignDialogBox
Definition: GUIDesigns.h:407
std::vector< GNEEdge * > retrieveEdges(bool onlySelected=false)
return all edges
Definition: GNENet.cpp:1046
MatchAttribute * myMatchAttribute
modul for matchA ttribute
long onCmdSelMBAttribute(FXObject *, FXSelector, void *)
Called when the user selectes a tag in the match box.
#define GUIDesignGroupBoxFrame
Group box design extended over frame.
Definition: GUIDesigns.h:227
std::vector< GNEAdditional * > retrieveAdditionals(bool onlySelected=false) const
return all additionals
Definition: GNENet.cpp:1807
static OutputDevice & getDevice(const std::string &name)
Returns the described OutputDevice.
void clearCurrentSelection() const
clear current selection with possibility of undo/redo
static StringBijection< GUIGlObjectType > TypeNames
associates object types with strings
Definition: GUIGlObject.h:69
element is selected
an edge
ElementSetType getElementSet() const
get current selected element set
virtual void hide()
hide Frame
Definition: GNEFrame.cpp:750
std::vector< GNECrossing * > retrieveCrossings(bool onlySelected=false) const
return all crossings
Definition: GNENet.cpp:1030
GNENet * getNet() const
get the net object
GNESelectorFrame * mySelectorFrameParent
pointer to Selector Frame Parent
GUIGlID getGlID() const
Returns the numerical id of the object.
#define GUIDesignButtonOK
Definition: GUIDesigns.h:96
Static storage of an output device and its base (abstract) implementation.
Definition: OutputDevice.h:64
#define GUIDesignSpinDial
Definition: GUIDesigns.h:315
ModificationMode * myModificationMode
modul for change modification mode
parent of an additional element
FXRadioButton * myRemoveRadioButton
remove radio button
long onCmdHelp(FXObject *, FXSelector, void *)
Called when the user clicks the help button.
Load set.
Definition: GUIAppEnum.h:348
static std::vector< SumoXMLTag > allowedNetElementsTags(bool onlyDrawables)
get all editable for tag net elements
static const TagValues & getTagProperties(SumoXMLTag tag)
get Tag Properties
void hide()
hide Frame
#define GUIDesignLabelLeft
Definition: GUIDesigns.h:145
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
select attribute in selector frame
Definition: GUIAppEnum.h:553
GNESelectorFrame * mySelectorFrameParent
pointer to Selector Frame Parent
GUIGlObject * getObjectBlocking(GUIGlID id)
Returns the object from the container locking it.
#define GUIDesignRadioButton
Definition: GUIDesigns.h:135
long onCmdScaleSelection(FXObject *, FXSelector, void *)
Called when the user changes visual scaling.
ElementSet * myElementSet
modul for select element set
static FXIcon * getIcon(GUIIcon which)
returns a icon previously defined in the enum GUIIcon
Clear set.
Definition: GUIAppEnum.h:352
begin/end of the description of a polygon
a junction
SetOperation myModificationModeType
how to modify selection
const POIs & getPOIs() const
Returns all pois.