SUMO - Simulation of Urban MObility
GNESelectorFrame.cpp
Go to the documentation of this file.
1 /****************************************************************************/
7 // The Widget for modifying selections of network-elements
8 // (some elements adapted from GUIDialog_GLChosenEditor)
9 /****************************************************************************/
10 // SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/
11 // Copyright (C) 2001-2016 DLR (http://www.dlr.de/) and contributors
12 /****************************************************************************/
13 //
14 // This file is part of SUMO.
15 // SUMO is free software: you can redistribute it and/or modify
16 // it under the terms of the GNU General Public License as published by
17 // the Free Software Foundation, either version 3 of the License, or
18 // (at your option) any later version.
19 //
20 /****************************************************************************/
21 
22 
23 // ===========================================================================
24 // included modules
25 // ===========================================================================
26 #ifdef _MSC_VER
27 #include <windows_config.h>
28 #else
29 #include <config.h>
30 #endif
31 
32 #ifdef HAVE_VERSION_H
33 #include <version.h>
34 #endif
35 
36 #include <iostream>
45 #include "GNESelectorFrame.h"
46 #include "GNEViewNet.h"
47 #include "GNEViewParent.h"
48 #include "GNENet.h"
49 #include "GNEJunction.h"
50 #include "GNEEdge.h"
51 #include "GNELane.h"
52 #include "GNEUndoList.h"
53 #include "GNEChange_Selection.h"
54 #include "GNEAttributeCarrier.h"
55 
56 #ifdef CHECK_MEMORY_LEAKS
57 #include <foreign/nvwa/debug_new.h>
58 #endif // CHECK_MEMORY_LEAKS
59 
60 
61 // ===========================================================================
62 // FOX callback mapping
63 // ===========================================================================
64 FXDEFMAP(GNESelectorFrame) GNESelectorFrameMap[] = {
65  FXMAPFUNC(SEL_COMMAND, MID_CHOOSEN_LOAD, GNESelectorFrame::onCmdLoad),
66  FXMAPFUNC(SEL_COMMAND, MID_CHOOSEN_SAVE, GNESelectorFrame::onCmdSave),
67  FXMAPFUNC(SEL_COMMAND, MID_CHOOSEN_INVERT, GNESelectorFrame::onCmdInvert),
68  FXMAPFUNC(SEL_COMMAND, MID_CHOOSEN_CLEAR, GNESelectorFrame::onCmdClear),
69  FXMAPFUNC(SEL_COMMAND, MID_GNE_SELMB_TAG, GNESelectorFrame::onCmdSelMBTag),
71  FXMAPFUNC(SEL_COMMAND, MID_HELP, GNESelectorFrame::onCmdHelp),
73 };
74 
75 // Object implementation
76 FXIMPLEMENT(GNESelectorFrame, FXScrollWindow, GNESelectorFrameMap, ARRAYNUMBER(GNESelectorFrameMap))
77 
78 // ===========================================================================
79 // method definitions
80 // ===========================================================================
81 GNESelectorFrame::GNESelectorFrame(FXComposite* parent, GNEViewNet* viewNet):
82  GNEFrame(parent, viewNet, getStats().c_str()),
83  mySetOperation(SET_ADD),
84  mySetOperationTarget(mySetOperation),
85  ALL_VCLASS_NAMES_MATCH_STRING("all " + joinToString(SumoVehicleClassStrings.getStrings(), " ")) {
86  // selection modification mode
87  FXGroupBox* selBox = new FXGroupBox(myContentFrame, "Modification Mode",
88  GROUPBOX_NORMAL | FRAME_GROOVE | LAYOUT_FILL_X, 2, 0, 0, 0, 4, 2, 2, 2);
89  new FXRadioButton(selBox, "add\t\tSelected objects are added to the previous selection",
90  &mySetOperationTarget, FXDataTarget::ID_OPTION + SET_ADD);
91  new FXRadioButton(selBox, "remove\t\tSelected objects are removed from the previous selection",
92  &mySetOperationTarget, FXDataTarget::ID_OPTION + SET_SUB);
93  new FXRadioButton(selBox, "keep\t\tRestrict previous selection by the current selection",
94  &mySetOperationTarget, FXDataTarget::ID_OPTION + SET_RESTRICT);
95  new FXRadioButton(selBox, "replace\t\tReplace previous selection by the current selection",
96  &mySetOperationTarget, FXDataTarget::ID_OPTION + SET_REPLACE);
97 
98  // selection by expression matching (match box)
99  FXGroupBox* matchBox = new FXGroupBox(myContentFrame, "Match Attribute",
100  GROUPBOX_NORMAL | FRAME_GROOVE | LAYOUT_FILL_X, 2, 0, 0, 0, 4, 2, 2, 2);
101  myMatchTagBox = new FXListBox(matchBox, this, MID_GNE_SELMB_TAG);
102  const std::vector<SumoXMLTag>& tags = GNEAttributeCarrier::allowedTags();
103  for (std::vector<SumoXMLTag>::const_iterator it = tags.begin(); it != tags.end(); it++) {
104  myMatchTagBox->appendItem(toString(*it).c_str());
105  }
106  myMatchTagBox->setCurrentItem(1); // edges
107  myMatchTagBox->setNumVisible(myMatchTagBox->getNumItems());
108  myMatchAttrBox = new FXListBox(matchBox);
109  onCmdSelMBTag(0, 0, 0);
110  myMatchAttrBox->setCurrentItem(3); // speed
111  myMatchString = new FXTextField(matchBox, 12, this, MID_GNE_SELMB_STRING, TEXTFIELD_NORMAL, 0, 0, 0, 0, 4, 2, 0, 2);
112  myMatchString->setText(">10.0");
113  new FXButton(matchBox, "Help", 0, this, MID_HELP);
114 
115  FXGroupBox* selSizeBox = new FXGroupBox(myContentFrame, "Visual Scaling",
116  GROUPBOX_NORMAL | FRAME_GROOVE | LAYOUT_FILL_X, 2, 0, 0, 0, 4, 2, 2, 2);
117  mySelectionScaling =
118  new FXRealSpinDial(selSizeBox, 7, this, MID_GNE_SELECT_SCALE,
119  LAYOUT_TOP | FRAME_SUNKEN | FRAME_THICK | LAYOUT_FILL_Y);
120  mySelectionScaling->setNumberFormat(1);
121  mySelectionScaling->setIncrements(0.1, .5, 1);
122  mySelectionScaling->setRange(1, 100);
123  mySelectionScaling->setValue(1);
124  mySelectionScaling->setHelpText("Enlarge selected objects");
125 
126  // additional buttons
127  // new FXHorizontalSeparator(this,SEPARATOR_GROOVE|LAYOUT_FILL_X);
128  // "Clear List"
129  new FXButton(myContentFrame, "Clear\t\t", 0, this, MID_CHOOSEN_CLEAR,
130  ICON_BEFORE_TEXT | LAYOUT_FILL_X | FRAME_THICK | FRAME_RAISED,
131  0, 0, 0, 0, 4, 4, 3, 3);
132  // "Invert"
133  new FXButton(myContentFrame, "Invert\t\t", 0, this, MID_CHOOSEN_INVERT,
134  ICON_BEFORE_TEXT | LAYOUT_FILL_X | FRAME_THICK | FRAME_RAISED,
135  0, 0, 0, 0, 4, 4, 3, 3);
136  // "Save"
137  new FXButton(myContentFrame, "Save\t\tSave ids of currently selected objects to a file.", 0, this, MID_CHOOSEN_SAVE,
138  ICON_BEFORE_TEXT | LAYOUT_FILL_X | FRAME_THICK | FRAME_RAISED,
139  0, 0, 0, 0, 4, 4, 3, 3);
140 
141  // "Load"
142  new FXButton(myContentFrame, "Load\t\tLoad ids from a file according to the current modfication mode.", 0, this, MID_CHOOSEN_LOAD,
143  ICON_BEFORE_TEXT | LAYOUT_FILL_X | FRAME_THICK | FRAME_RAISED,
144  0, 0, 0, 0, 4, 4, 3, 3);
145 
146 
147  // Selection Hint
148  new FXLabel(myContentFrame, "Hold <SHIFT> for\nrectangle selection.\nPress <DEL> to\ndelete selected items.", 0, JUSTIFY_LEFT);
149 }
150 
151 
154 }
155 
156 long
157 GNESelectorFrame::onCmdLoad(FXObject*, FXSelector, void*) {
158  // get the new file name
159  FXFileDialog opendialog(this, "Open List of Selected Items");
160  opendialog.setIcon(GUIIconSubSys::getIcon(ICON_EMPTY));
161  opendialog.setSelectMode(SELECTFILE_EXISTING);
162  opendialog.setPatternList("Selection files (*.txt)\nAll files (*)");
163  if (gCurrentFolder.length() != 0) {
164  opendialog.setDirectory(gCurrentFolder);
165  }
166  if (opendialog.execute()) {
167  gCurrentFolder = opendialog.getDirectory();
168  std::string file = opendialog.getFilename().text();
169  // @todo maybe rewrite so that mySetOperation also applies to loaded items?
170  std::string errors;
171  std::set<GUIGlID> ids = gSelected.loadIDs(file, errors);
172  handleIDs(std::vector<GUIGlID>(ids.begin(), ids.end()), false);
173  if (errors != "") {
174  FXMessageBox::error(this, MBOX_OK, "Errors while loading Selection", "%s", errors.c_str());
175  }
176  }
177  myViewNet->update();
178  return 1;
179 }
180 
181 
182 long
183 GNESelectorFrame::onCmdSave(FXObject*, FXSelector, void*) {
184  FXString file = MFXUtils::getFilename2Write(
185  this, "Save List of selected Items", ".txt", GUIIconSubSys::getIcon(ICON_EMPTY), gCurrentFolder);
186  if (file == "") {
187  return 1;
188  }
189  try {
190  gSelected.save(file.text());
191  } catch (IOError& e) {
192  FXMessageBox::error(this, MBOX_OK, "Storing Selection failed", "%s", e.what());
193  }
194  return 1;
195 }
196 
197 
198 long
199 GNESelectorFrame::onCmdClear(FXObject*, FXSelector, void*) {
200  myViewNet->getUndoList()->add(new GNEChange_Selection(std::set<GUIGlID>(), gSelected.getSelected(), true), true);
201  myViewNet->update();
202  return 1;
203 }
204 
205 
206 long
207 GNESelectorFrame::onCmdInvert(FXObject*, FXSelector, void*) {
208  std::set<GUIGlID> ids = myViewNet->getNet()->getGlIDs(GLO_JUNCTION);
209  for (std::set<GUIGlID>::const_iterator it = ids.begin(); it != ids.end(); it++) {
211  }
213  for (std::set<GUIGlID>::const_iterator it = ids.begin(); it != ids.end(); it++) {
215  }
217  for (std::set<GUIGlID>::const_iterator it = ids.begin(); it != ids.end(); it++) {
219  }
220  myViewNet->update();
221  return 1;
222 }
223 
224 
225 long
226 GNESelectorFrame::onCmdSelMBTag(FXObject*, FXSelector, void*) {
227  const std::vector<SumoXMLTag>& tags = GNEAttributeCarrier::allowedTags();
228  SumoXMLTag tag = tags[myMatchTagBox->getCurrentItem()];
229  myMatchAttrBox->clearItems();
230  const std::vector<std::pair <SumoXMLAttr, std::string> >& attrs = GNEAttributeCarrier::allowedAttributes(tag);
231  for (std::vector<std::pair <SumoXMLAttr, std::string> >::const_iterator it = attrs.begin(); it != attrs.end(); it++) {
232  myMatchAttrBox->appendItem(toString(it->first).c_str());
233  }
234 
235  // @ToDo: Here can be placed a butto to set the default value
236  myMatchAttrBox->setNumVisible(myMatchAttrBox->getNumItems());
237  update();
238  return 1;
239 }
240 
241 
242 long
243 GNESelectorFrame::onCmdSelMBString(FXObject*, FXSelector, void*) {
244  const std::vector<SumoXMLTag>& tags = GNEAttributeCarrier::allowedTags();
245  SumoXMLTag tag = tags[myMatchTagBox->getCurrentItem()];
246  const std::vector<std::pair <SumoXMLAttr, std::string> >& attrs = GNEAttributeCarrier::allowedAttributes(tag);
247  SumoXMLAttr attr = attrs.at(myMatchAttrBox->getCurrentItem()).first;
248  std::string expr(myMatchString->getText().text());
249  bool valid = true;
250 
251  if (expr == "") {
252  // the empty expression matches all objects
253  handleIDs(getMatches(tag, attr, '@', 0, expr), false);
254  } else if (GNEAttributeCarrier::isNumerical(attr)) {
255  // The expression must have the form
256  // <val matches if attr < val
257  // >val matches if attr > val
258  // =val matches if attr = val
259  // val matches if attr = val
260  char compOp = expr[0];
261  if (compOp == '<' || compOp == '>' || compOp == '=') {
262  expr = expr.substr(1);
263  } else {
264  compOp = '=';
265  }
266  SUMOReal val;
267  std::istringstream buf(expr);
268  buf >> val;
269  if (!buf.fail() && (int)buf.tellg() == (int)expr.size()) {
270  handleIDs(getMatches(tag, attr, compOp, val, expr), false);
271  } else {
272  valid = false;
273  }
274  } else {
275  // The expression must have the form
276  // =str: matches if <str> is an exact match
277  // !str: matches if <str> is not a substring
278  // ^str: matches if <str> is not an exact match
279  // str: matches if <str> is a substring (sends compOp '@')
280  // Alternatively, if the expression is empty it matches all objects
281  char compOp = expr[0];
282  if (compOp == '=' || compOp == '!' || compOp == '^') {
283  expr = expr.substr(1);
284  } else {
285  compOp = '@';
286  }
287  handleIDs(getMatches(tag, attr, compOp, 0, expr), false);
288  }
289  if (valid) {
290  myMatchString->setTextColor(FXRGB(0, 0, 0));
291  myMatchString->killFocus();
292  } else {
293  myMatchString->setTextColor(FXRGB(255, 0, 0));
294  }
295 
296  return 1;
297 }
298 
299 
300 long
301 GNESelectorFrame::onCmdHelp(FXObject*, FXSelector, void*) {
302  FXDialogBox* helpDialog = new FXDialogBox(this, "Match Attribute Help", DECOR_CLOSE | DECOR_TITLE);
303  std::ostringstream help;
304  help
305  << "The 'Match Attribute' controls allow to specify a set of objects which are then applied to the current selection "
306  << "according to the current 'Modification Mode'.\n"
307  << "1. Select an object type from the first input box\n"
308  << "2. Select an attribute from the second input box\n"
309  << "3. Enter a 'match expression' in the third input box and press <return>\n"
310  << "\n"
311  << "The empty expression matches all objects\n"
312  << "For numerical attributes the match expression must consist of a comparison operator ('<', '>', '=') and a number.\n"
313  << "An object matches if the comparison between its attribute and the given number by the given operator evaluates to 'true'\n"
314  << "\n"
315  << "For string attributes the match expression must consist of a comparison operator ('', '=', '!', '^') and a string.\n"
316  << " '' (no operator) matches if string is a substring of that object'ts attribute.\n"
317  << " '=' matches if string is an exact match.\n"
318  << " '!' matches if string is not a substring.\n"
319  << " '^' matches if string is not an exact match.\n"
320  << "\n"
321  << "Examples:\n"
322  << "junction; id; 'foo' -> match all junctions that have 'foo' in their id\n"
323  << "junction; type; '=priority' -> match all junctions of type 'priority', but not of type 'priority_stop'\n"
324  << "edge; speed; '>10' -> match all edges with a speed above 10\n";
325  new FXLabel(helpDialog, help.str().c_str(), 0, JUSTIFY_LEFT);
326  // "OK"
327  new FXButton(helpDialog, "OK\t\tSave modifications", 0, helpDialog, FXDialogBox::ID_ACCEPT,
328  ICON_BEFORE_TEXT | LAYOUT_FILL_X | FRAME_THICK | FRAME_RAISED,
329  0, 0, 0, 0, 4, 4, 3, 3);
330  helpDialog->create();
331  helpDialog->show();
332  return 1;
333 }
334 
335 
336 long
337 GNESelectorFrame::onCmdScaleSelection(FXObject*, FXSelector, void*) {
339  myViewNet->update();
340  return 1;
341 }
342 
343 
344 void
346  gSelected.add2Update(this);
347  selectionUpdated(); // selection may have changed due to deletions
348  FXScrollWindow::show();
349  // Show and Frame Area in which this GNEFrame is placed
351 }
352 
353 
354 void
357  FXScrollWindow::hide();
358  // Hide Frame Area in which this GNEFrame is placed
360 }
361 
362 
363 std::string
365  return "Selection:\n" +
366  toString(gSelected.getSelected(GLO_JUNCTION).size()) + " Junctions\n" +
367  toString(gSelected.getSelected(GLO_EDGE).size()) + " Edges\n" +
368  toString(gSelected.getSelected(GLO_LANE).size()) + " Lanes\n" +
369  toString(gSelected.getSelected(GLO_ADDITIONAL).size()) + " Additionals\n";
370 }
371 
372 
373 void
375  myFrameHeaderLabel->setText(getStats().c_str());
376  update();
377 }
378 
379 
380 void
381 GNESelectorFrame::handleIDs(std::vector<GUIGlID> ids, bool selectEdges, SetOperation setop) {
382  const SetOperation setOperation = (setop == SET_DEFAULT ? (SetOperation)mySetOperation : setop);
383  std::set<GUIGlID> previousSelection;
384  myViewNet->getUndoList()->p_begin("change selection");
385  if (setOperation == SET_REPLACE) {
386  myViewNet->getUndoList()->add(new GNEChange_Selection(std::set<GUIGlID>(), gSelected.getSelected(), true), true);
387  } else if (setOperation == SET_RESTRICT) {
388  previousSelection = gSelected.getSelected(); // have to make a copy
389  myViewNet->getUndoList()->add(new GNEChange_Selection(std::set<GUIGlID>(), gSelected.getSelected(), true), true);
390  }
391  // handle ids
392  GUIGlObject* object;
393  GUIGlObjectType type;
394  std::set<GUIGlID> idsSet(ids.begin(), ids.end());
395  std::set<GUIGlID> selected;
396  std::set<GUIGlID> deselected;
397  if (myViewNet->autoSelectNodes()) {
398  for (std::vector<GUIGlID>::const_iterator it = ids.begin(); it != ids.end(); it++) {
399  GUIGlID id = *it;
400  if (id > 0) { // net object?
402  if (object->getType() == GLO_LANE && selectEdges) {
403  const GNEEdge& edge = (static_cast<GNELane*>(object))->getParentEdge();
404  idsSet.insert(edge.getSource()->getGlID());
405  idsSet.insert(edge.getDest()->getGlID());
406  }
408  }
409  }
410  }
411  for (std::set<GUIGlID>::const_iterator it = idsSet.begin(); it != idsSet.end(); it++) {
412  GUIGlID id = *it;
413  if (id > 0) { // net object?
415  if (object == 0) {
416  // in debug mode we would like to know about this.
417  // It might be caused by a corrupted gl-name stack.
418  // However, most cases of uninitizliaed values would go hidden since 0 is assumed to be the net object anyway
419  assert(false);
420  continue;
421  }
422  type = object->getType();
424  if (type == GLO_LANE && selectEdges) {
425  // @note edge may be selected/deselected multiple times but this shouldn't
426  // hurt unless we add SET_TOGGLE
427  id = (static_cast<GNELane*>(object))->getParentEdge().getGlID();
428  }
429  // doing the switch outside the loop requires functional techniques. this was deemed to ugly
430  switch (setOperation) {
433  selected.insert(id);
434  break;
436  deselected.insert(id);
437  break;
439  if (previousSelection.count(id)) {
440  selected.insert(id);
441  }
442  break;
443  default:
444  break;
445  }
446  }
447  }
448  myViewNet->getUndoList()->add(new GNEChange_Selection(selected, deselected, true), true);
450  myViewNet->update();
451 }
452 
453 
454 std::vector<GUIGlID>
455 GNESelectorFrame::getMatches(SumoXMLTag tag, SumoXMLAttr attr, char compOp, SUMOReal val, const std::string& expr) {
456  GUIGlObject* object;
458  std::vector<GUIGlID> result;
459  const std::set<GUIGlID> allIDs = myViewNet->getNet()->getGlIDs();
460  const bool numerical = GNEAttributeCarrier::isNumerical(attr);
461  for (std::set<GUIGlID>::const_iterator it = allIDs.begin(); it != allIDs.end(); it++) {
462  GUIGlID id = *it;
464  if (!object) {
465  throw ProcessError("Unkown object passed to GNESelectorFrame::getMatches (id=" + toString(id) + ").");
466  }
467  ac = dynamic_cast<GNEAttributeCarrier*>(object);
468  if (ac && ac->getTag() == tag) { // not all objects need to be attribute carriers
469  if (expr == "") {
470  result.push_back(id);
471  } else if (numerical) {
472  SUMOReal acVal;
473  std::istringstream buf(ac->getAttribute(attr));
474  buf >> acVal;
475  switch (compOp) {
476  case '<':
477  if (acVal < val) {
478  result.push_back(id);
479  }
480  break;
481  case '>':
482  if (acVal > val) {
483  result.push_back(id);
484  }
485  break;
486  case '=':
487  if (acVal == val) {
488  result.push_back(id);
489  }
490  break;
491  }
492  } else {
493  // string match
494  std::string acVal = ac->getAttribute(attr);
495  if ((attr == SUMO_ATTR_ALLOW || attr == SUMO_ATTR_DISALLOW) && acVal == "all") {
497  }
498  switch (compOp) {
499  case '@':
500  if (acVal.find(expr) != std::string::npos) {
501  result.push_back(id);
502  }
503  break;
504  case '!':
505  if (acVal.find(expr) == std::string::npos) {
506  result.push_back(id);
507  }
508  break;
509  case '=':
510  if (acVal == expr) {
511  result.push_back(id);
512  }
513  break;
514  case '^':
515  if (acVal != expr) {
516  result.push_back(id);
517  }
518  break;
519  }
520  }
521  }
523  }
524  return result;
525 }
526 
527 /****************************************************************************/
SumoXMLTag
Numbers representing SUMO-XML - element names.
bool selectEdges()
whether inspection, selection and inversion should apply to edges or to lanes
Definition: GNEViewNet.cpp:307
void selectionUpdated()
called if currently registered for updates for changes of global selection
void hideFramesArea()
hide frames area if all GNEFrames are hidden
FXuint mySetOperation
how to modify selection
static bool isNumerical(SumoXMLAttr attr)
whether an attribute is numerical (int or float)
long onCmdSelMBString(FXObject *, FXSelector, void *)
Called when the user enters a new selection expression.
std::string getStats() const
get stats
GUIGlObjectType
SetOperation
FOX-declaration.
FXDEFMAP(GNESelectorFrame) GNESelectorFrameMap[]
long onCmdSave(FXObject *, FXSelector, void *)
Called when the user presses the Save-button.
void toggleSelection(GUIGlID id)
Toggles selection of an object.
std::set< GUIGlID > getGlIDs(GUIGlObjectType type=GLO_MAX)
Definition: GNENet.cpp:740
void show()
show Frame
FXTextField * myMatchString
string of the match
FXRealSpinDial * mySelectionScaling
selection scaling
void showFramesArea()
show frames area if at least a GNEFrame is showed
FXListBox * myMatchTagBox
tag of the match box
void setSelectionScaling(SUMOReal selectionScale)
set selection scaling
Definition: GNEViewNet.cpp:319
void remove2Update()
Removes the dialog to be updated.
Deselect selected items.
Definition: GUIAppEnum.h:351
This lane is powered by an underlying GNEEdge and basically knows how to draw itself.
Definition: GNELane.h:54
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:86
long onCmdLoad(FXObject *, FXSelector, void *)
std::vector< GUIGlID > getMatches(SumoXMLTag tag, SumoXMLAttr attr, char compOp, SUMOReal val, const std::string &expr)
return objects of the given type with matching attrs
FXString gCurrentFolder
The folder used as last.
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
Save set.
Definition: GUIAppEnum.h:343
GNEViewParent * getViewParent() const
get the net object
Definition: GNEViewNet.cpp:839
virtual std::string getAttribute(SumoXMLAttr key) const =0
static FXString getFilename2Write(FXWindow *parent, const FXString &header, const FXString &extension, FXIcon *icon, FXString &currentFolder)
Returns the file name to write.
Definition: MFXUtils.cpp:95
GUIGlID getGlID() const
Returns the numerical id of the object.
static const std::vector< std::pair< SumoXMLAttr, std::string > > & allowedAttributes(SumoXMLTag tag)
get all editable attributes for tag and their default values.
long onCmdHelp(FXObject *, FXSelector, void *)
Called when the user clicks the help button.
GNEUndoList * getUndoList() const
get the undoList object
Definition: GNEViewNet.cpp:851
GNEViewNet * myViewNet
the window to inform when the tls is modfied
Definition: GNEFrame.h:85
std::set< GUIGlID > loadIDs(const std::string &filename, std::string &msgOut, GUIGlObjectType type=GLO_MAX, int maxErrors=16)
Loads a selection list (optionally with restricted type) and returns the ids of all active objects...
~GNESelectorFrame()
Destructor.
GUIGlObjectType getType() const
Returns the type of the object as coded in GUIGlObjectType.
long onCmdScaleSelection(FXObject *, FXSelector, void *)
Called when the user changes visual scaling.
long onCmdClear(FXObject *, FXSelector, void *)
Called when the user presses the Clear-button.
selector match box messages
Definition: GUIAppEnum.h:420
const std::set< GUIGlID > & getSelected() const
Returns the list of ids of all selected objects.
static const std::vector< SumoXMLTag > & allowedTags()
get all editable for tag.
FXdouble getValue() const
Return current value.
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:93
FXLabel * myFrameHeaderLabel
the label for the frame&#39;s header
Definition: GNEFrame.h:91
static GUIGlObjectStorage gIDStorage
A single static instance of this class.
bool autoSelectNodes()
whether to autoselect nodes or to lanes
Definition: GNEViewNet.cpp:313
StringBijection< SUMOVehicleClass > SumoVehicleClassStrings(sumoVehicleClassStringInitializer, SVC_CUSTOM2, false)
const std::string ALL_VCLASS_NAMES_MATCH_STRING
the string that should be matched against if attr &#39;allowed&#39; or &#39;disalloed&#39; are set to "all" ...
std::string toString(const T &t, std::streamsize accuracy=OUTPUT_ACCURACY)
Definition: ToString.h:55
Clear set.
Definition: GUIAppEnum.h:345
A road/street connecting two junctions (netedit-version)
Definition: GNEEdge.h:54
unsigned int GUIGlID
Definition: GUIGlObject.h:50
compound additional
void add2Update(UpdateTarget *updateTarget)
Adds a dialog to be updated.
Load set.
Definition: GUIAppEnum.h:341
long onCmdInvert(FXObject *, FXSelector, void *)
Called when the user presses the Invert-button.
an edge
FXListBox * myMatchAttrBox
attributes of the match box
GNEJunction * getDest() const
returns the destination-junction
Definition: GNEEdge.cpp:145
GNENet * getNet() const
get the net object
Definition: GNEViewNet.cpp:845
void handleIDs(std::vector< GUIGlID > ids, bool selectEdges, SetOperation setop=SET_DEFAULT)
apply list of ids to the current selection according to SetOperation,
std::string joinToString(const std::vector< T > &v, const T_BETWEEN &between, std::streamsize accuracy=OUTPUT_ACCURACY)
Definition: ToString.h:188
SumoXMLTag getTag() const
get Tag assigned to this object
#define SUMOReal
Definition: config.h:213
void unblockObject(GUIGlID id)
Marks an object as unblocked.
void hide()
hide Frame
Spinner control.
GUIGlObject * getObjectBlocking(GUIGlID id)
Returns the object from the container locking it.
long onCmdSelMBTag(FXObject *, FXSelector, void *)
Called when the user selectes a tag in the match box.
GUISelectedStorage gSelected
A global holder of selected objects.
static FXIcon * getIcon(GUIIcon which)
returns a icon previously defined in the enum GUIIcon
GNEJunction * getSource() const
returns the source-junction
Definition: GNEEdge.cpp:139
void save(GUIGlObjectType type, const std::string &filename)
Saves a selection list.
a junction