Eclipse SUMO - Simulation of Urban MObility
GNEViewNet.cpp
Go to the documentation of this file.
1 /****************************************************************************/
2 // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo
3 // Copyright (C) 2001-2024 German Aerospace Center (DLR) and others.
4 // This program and the accompanying materials are made available under the
5 // terms of the Eclipse Public License 2.0 which is available at
6 // https://www.eclipse.org/legal/epl-2.0/
7 // This Source Code may also be made available under the following Secondary
8 // Licenses when the conditions for such availability set forth in the Eclipse
9 // Public License 2.0 are satisfied: GNU General Public License, version 2
10 // or later which is available at
11 // https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html
12 // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later
13 /****************************************************************************/
19 // A view on the network being edited (adapted from GUIViewTraffic)
20 /****************************************************************************/
21 
22 #include <netbuild/NBEdgeCont.h>
64 #include <utils/gui/div/GLHelper.h>
73 
74 #include <unordered_set>
75 
76 #include "GNENet.h"
77 #include "GNEUndoList.h"
78 #include "GNEViewNet.h"
79 #include "GNEViewParent.h"
80 #include "GNEApplicationWindow.h"
81 
82 
83 // ===========================================================================
84 // FOX callback mapping
85 // ===========================================================================
86 
87 FXDEFMAP(GNEViewNet) GNEViewNetMap[] = {
88  // Super Modes
92  // Modes
98  FXMAPFUNC(SEL_COMMAND, MID_HOTKEY_I_MODE_INSPECT, GNEViewNet::onCmdSetMode),
104  FXMAPFUNC(SEL_COMMAND, MID_HOTKEY_T_MODE_TLS_TYPE, GNEViewNet::onCmdSetMode),
106  FXMAPFUNC(SEL_COMMAND, MID_HOTKEY_V_MODE_VEHICLE, GNEViewNet::onCmdSetMode),
109  // Network view options
126  // Demand view options
138  // Data view options
147  // Select elements
148  FXMAPFUNC(SEL_COMMAND, MID_ADDSELECT, GNEViewNet::onCmdAddSelected),
149  FXMAPFUNC(SEL_COMMAND, MID_REMOVESELECT, GNEViewNet::onCmdRemoveSelected),
152  // Junctions
165  FXMAPFUNC(SEL_COMMAND, MID_GNE_JUNCTION_ADDTLS, GNEViewNet::onCmdAddTLS),
167  // Connections
170  // Crossings
172  // WalkingArea
174  // Edges
175  FXMAPFUNC(SEL_COMMAND, MID_GNE_EDGE_SPLIT, GNEViewNet::onCmdSplitEdge),
177  FXMAPFUNC(SEL_COMMAND, MID_GNE_EDGE_REVERSE, GNEViewNet::onCmdReverseEdge),
183  FXMAPFUNC(SEL_COMMAND, MID_GNE_EDGE_SMOOTH, GNEViewNet::onCmdSmoothEdges),
189  // Lanes
199  FXMAPFUNC(SEL_COMMAND, MID_GNE_LANE_ADD_BIKE, GNEViewNet::onCmdLaneOperation),
200  FXMAPFUNC(SEL_COMMAND, MID_GNE_LANE_ADD_BUS, GNEViewNet::onCmdLaneOperation),
207  FXMAPFUNC(SEL_COMMAND, MID_REACHABILITY, GNEViewNet::onCmdLaneReachability),
208  // Additionals
210  // Polygons
212  FXMAPFUNC(SEL_COMMAND, MID_GNE_POLYGON_CLOSE, GNEViewNet::onCmdClosePolygon),
213  FXMAPFUNC(SEL_COMMAND, MID_GNE_POLYGON_OPEN, GNEViewNet::onCmdOpenPolygon),
217  // POIs
218  FXMAPFUNC(SEL_COMMAND, MID_GNE_POI_TRANSFORM, GNEViewNet::onCmdTransformPOI),
219  // Demand elements
220  FXMAPFUNC(SEL_COMMAND, MID_GNE_REVERSE, GNEViewNet::onCmdReverse),
221  FXMAPFUNC(SEL_COMMAND, MID_GNE_ADDREVERSE, GNEViewNet::onCmdAddReverse),
222  // Geometry Points
225  // toolbar views
226  FXMAPFUNC(SEL_COMMAND, MID_GNE_VIEW_DEFAULT, GNEViewNet::onCmdSetNeteditView),
228  // IntervalBar
235 };
236 
237 // Object implementation
238 FXIMPLEMENT(GNEViewNet, GUISUMOAbstractView, GNEViewNetMap, ARRAYNUMBER(GNEViewNetMap))
239 
240 
241 // ===========================================================================
242 // member method definitions
243 // ===========================================================================
244 GNEViewNet::GNEViewNet(FXComposite* tmpParent, FXComposite* actualParent, GUIMainWindow& app,
245  GNEViewParent* viewParent, GNENet* net, GNEUndoList* undoList,
246  FXGLVisual* glVis, FXGLCanvas* share) :
247  GUISUMOAbstractView(tmpParent, app, viewParent, net->getGrid(), glVis, share),
248  myViewObjectsSelector(this),
249  myEditModes(this),
250  myTestingMode(this),
251  myCommonCheckableButtons(this),
252  myNetworkCheckableButtons(this),
253  myDemandCheckableButtons(this),
254  myDataCheckableButtons(this),
255  myNetworkViewOptions(this),
256  myDemandViewOptions(this),
257  myDataViewOptions(this),
258  myIntervalBar(this),
259  myMoveSingleElement(this),
260  myMoveMultipleElements(this),
261  myVehicleOptions(this),
262  myVehicleTypeOptions(this),
263  mySaveElements(this),
264  myTimeFormat(this),
265  mySelectingArea(this),
266  myEditNetworkElementShapes(this),
267  myLockManager(this),
268  myViewParent(viewParent),
269  myNet(net),
270  myUndoList(undoList) {
271  // view must be the final member of actualParent
272  reparent(actualParent);
273  // Build edit modes
274  buildEditModeControls();
275  // set this net in Net
276  myNet->setViewNet(this);
277  // set drag delay
278  ((GUIDanielPerspectiveChanger*)myChanger)->setDragDelay(100000000); // 100 milliseconds
279  // Reset textures
281  // init testing mode
282  myTestingMode.initTestingMode();
283  // update grid flags
284  myNetworkViewOptions.menuCheckToggleGrid->setChecked(myVisualizationSettings->showGrid);
285  myDemandViewOptions.menuCheckToggleGrid->setChecked(myVisualizationSettings->showGrid);
286  // update junction shape flags
287  const bool hide = !myVisualizationSettings->drawJunctionShape;
288  myNetworkViewOptions.menuCheckToggleDrawJunctionShape->setChecked(hide);
289  myDemandViewOptions.menuCheckToggleDrawJunctionShape->setChecked(hide);
290  myDataViewOptions.menuCheckToggleDrawJunctionShape->setChecked(hide);
291 }
292 
293 
295 
296 
297 void
299  if (myNet && makeCurrent()) {
300  // declare boundary
301  const Boundary maxBoundary(1000000000.0, 1000000000.0, -1000000000.0, -1000000000.0);
302  // get all objects in boundary
303  const std::vector<GUIGlID> GLIDs = getObjectsInBoundary(maxBoundary);
304  // finish make OpenGL context current
305  makeNonCurrent();
306  // declare set
307  std::set<GNEAttributeCarrier*> ACs;
308  // iterate over GUIGlIDs
309  for (const auto& GLId : GLIDs) {
311  // Make sure that object exists
312  if (AC && AC->getTagProperty().isPlacedInRTree()) {
313  ACs.insert(AC);
314  }
315  }
316  // interate over ACs
317  for (const auto& AC : ACs) {
318  // remove object and insert again with exaggeration
319  myNet->getGrid().removeAdditionalGLObject(AC->getGUIGlObject());
320  myNet->getGrid().addAdditionalGLObject(AC->getGUIGlObject(), AC->getGUIGlObject()->getExaggeration(*myVisualizationSettings));
321  }
322  }
323 }
324 
325 
326 void
328 
329 
330 GUIGlID
334  } else {
335  return 0;
336  }
337 }
338 
339 
340 void
342  // build coloring tools
343  {
344  for (auto it_names : gSchemeStorage.getNames()) {
345  v->getColoringSchemesCombo()->appendIconItem(it_names.c_str());
346  if (it_names == myVisualizationSettings->name) {
348  }
349  }
350  }
351  // for junctions
353  std::string("\t") + TL("Locate Junctions") + std::string("\t") + TL("Locate a junction within the network. (Shift+J)"),
355  // for edges
357  std::string("\t") + TL("Locate Edges") + std::string("\t") + TL("Locate an edge within the network. (Shift+E)"),
359  // for walkingAreas
361  std::string("\t") + TL("Locate WalkingAreas") + std::string("\t") + TL("Locate a walkingArea within the network. (Shift+W)"),
363  // for vehicles
365  std::string("\t") + TL("Locate Vehicles") + std::string("\t") + TL("Locate a vehicle within the network. (Shift+V)"),
367  // for person
369  std::string("\t") + TL("Locate Persons") + std::string("\t") + TL("Locate a person within the network. (Shift+P)"),
371  // for container
373  std::string("\t") + TL("Locate Containers") + std::string("\t") + TL("Locate a container within the network. (Shift+C)"),
375  // for routes
377  std::string("\t") + TL("Locate Route") + std::string("\t") + TL("Locate a route within the network. (Shift+R)"),
379  // for routes
381  std::string("\t") + TL("Locate Stops") + std::string("\t") + TL("Locate a stop within the network. (Shift+S)"),
383  // for persons (currently unused)
384  /*
385  new MFXButtonTooltip(v->getLocatorPopup(),
386  std::string("\t") + TL("Locate Vehicle\tLocate a person within the network.",
387  GUIIconSubSys::getIcon(GUIIcon::LOCATEPERSON), &v, MID_LOCATEPERSON,
388  GUIDesignButtonPopup);
389  */
390  // for tls
392  std::string("\t") + TL("Locate TLS") + std::string("\t") + TL("Locate a tls within the network. (Shift+T)"),
394  // for additional stuff
396  std::string("\t") + TL("Locate Additional") + std::string("\t") + TL("Locate an additional structure within the network. (Shift+A)"),
398  // for pois
400  std::string("\t") + TL("Locate PoI") + std::string("\t") + TL("Locate a PoI within the network. (Shift+O)"),
402  // for polygons
404  std::string("\t") + TL("Locate Polygon") + std::string("\t") + TL("Locate a Polygon within the network. (Shift+L)"),
406 }
407 
408 
409 void
411  // this call is only used for breakpoints (to check when view is updated)
412  GUISUMOAbstractView::update();
413 }
414 
415 
416 void
419 }
420 
421 
422 void
424  if (myEditModes.isJuPedSimView()) {
425  // hide data button (and adjust width)
426  myEditModes.dataButton->hide();
427  // check network modes
428  switch (myEditModes.networkEditMode) {
435  break;
436  default:
437  break;
438  }
439  // check demand modes
440  switch (myEditModes.demandEditMode) {
447  break;
448  default:
449  break;
450  }
451  // go to network mode if we're in data mode
454  } else {
455  // refresh current supermode
457  }
458  } else {
459  // show data button
460  myEditModes.dataButton->show();
461  // refresh current supermode
463  }
464 }
465 
466 
469  return myViewObjectsSelector;
470 }
471 
472 
473 void
475  // clear post drawing elements
477  // set selection boundary in gObjectsInPosition
479  // push matrix
481  // enable draw for object under cursor
483  // draw all GL elements within the small boundary
484  drawGLElements(boundary);
485  // restore draw for object under cursor
487  // pop matrix
489  // check if update front element
492  }
493  // after draw elements, update objects under cursor
495 }
496 
497 
498 void
500  // clear post drawing elements
502  // set selection position in gObjectsInPosition
504  // create an small boundary
505  Boundary positionBoundary;
506  positionBoundary.add(pos);
507  positionBoundary.grow(POSITION_EPS);
508  // push matrix
510  // enable draw for object under cursor
512  // draw all GL elements within the small boundary
513  drawGLElements(positionBoundary);
514  // check if filter edges that have the mouse over their geometry points
517  }
518  // restore draw for object under cursor
520  // pop matrix
522  // check if update front element
525  }
526  // after draw elements, update objects under cursor
528 }
529 
530 
533  return myMoveMultipleElements;
534 }
535 
536 
537 void
539  if (AC->isAttributeCarrierSelected()) {
541  } else {
543  }
544  new FXMenuSeparator(ret);
545 }
546 
547 
548 bool
549 GNEViewNet::setColorScheme(const std::string& name) {
550  if (!gSchemeStorage.contains(name)) {
551  return false;
552  }
553  if (myGUIDialogViewSettings != nullptr) {
554  if (myGUIDialogViewSettings->getCurrentScheme() != name) {
556  }
557  }
558  myVisualizationSettings = &gSchemeStorage.get(name.c_str());
559  updateViewNet();
560  return true;
561 }
562 
563 
564 void
565 GNEViewNet::openObjectDialogAtCursor(const FXEvent* /*ev*/) {
566  // reimplemented from GUISUMOAbstractView due GNEOverlappedInspection
567  ungrab();
568  // make network current
569  if (isEnabled() && myAmInitialised) {
570  // check if we're cliking while alt button is pressed
572  // set clicked popup position
574  // create cursor popup dialog for mark front element
576  // open popup dialog
577  openPopupDialog();
578  } else if (myViewObjectsSelector.getGLObjects().empty()) {
580  } else {
581  // declare filtered objects
582  std::vector<GUIGlObject*> filteredGLObjects;
583  // get GUIGLObject front
584  GUIGlObject* overlappedElement = nullptr;
585  // we need to check if we're inspecting a overlapping element
588  myInspectedAttributeCarriers.size() > 0) {
589  overlappedElement = myInspectedAttributeCarriers.front()->getGUIGlObject();
590  filteredGLObjects.push_back(overlappedElement);
591  }
592  bool connections = false;
593  bool TLS = false;
594  // fill filtered objects
595  for (const auto& glObject : myViewObjectsSelector.getGLObjects()) {
596  // always avoid edges
597  if (glObject->getType() == GLO_EDGE) {
598  continue;
599  }
600  if (glObject->getType() == GLO_CONNECTION) {
601  connections = true;
602  }
603  if (glObject->getType() == GLO_TLLOGIC) {
604  TLS = true;
605  }
606  filteredGLObjects.push_back(glObject);
607  }
608  auto it = filteredGLObjects.begin();
609  if (connections) {
610  // filter junctions if there are connections
611  while (it != filteredGLObjects.end()) {
612  if ((*it)->getType() == GLO_JUNCTION) {
613  it = filteredGLObjects.erase(it);
614  } else {
615  it++;
616  }
617  }
618  } else if (TLS) {
619  // filter all elements except TLLogic
620  while (it != filteredGLObjects.end()) {
621  if ((*it)->getType() != GLO_TLLOGIC) {
622  it = filteredGLObjects.erase(it);
623  } else {
624  it++;
625  }
626  }
627  }
628  // remove duplicated elements using an unordered set
629  auto itDuplicated = filteredGLObjects.begin();
630  std::unordered_set<GUIGlObject*> unorderedSet;
631  for (auto itElement = filteredGLObjects.begin(); itElement != filteredGLObjects.end(); itElement++) {
632  if (unorderedSet.insert(*itElement).second) {
633  *itDuplicated++ = *itElement;
634  }
635  }
636  filteredGLObjects.erase(itDuplicated, filteredGLObjects.end());
637  // open object dialog
638  openObjectDialog(filteredGLObjects);
639  }
640  }
641 }
642 
643 
644 void
645 GNEViewNet::openDeleteDialogAtCursor(const std::vector<GUIGlObject*>& GLObjects) {
646  if (myPopup) {
647  destroyPopup();
648  }
649  // set clicked popup position
651  // create cursor popup dialog for delete element
653  myCreatedPopup = true;
654  // open popup dialog
655  openPopupDialog();
656 }
657 
658 
659 void
660 GNEViewNet::openSelectDialogAtCursor(const std::vector<GUIGlObject*>& GLObjects) {
661  if (myPopup) {
662  destroyPopup();
663  }
664  // set clicked popup position
666  // create cursor popup dialog for select element
668  myCreatedPopup = true;
669  // open popup dialog
670  openPopupDialog();
671 }
672 
673 
674 void
676  // first check if we have to save gui settings in a file (only used for testing purposes)
677  const auto& neteditOptions = OptionsCont::getOptions();
678  if (neteditOptions.getString("gui-testing.setting-output").size() > 0) {
679  try {
680  // open output device
681  OutputDevice& output = OutputDevice::getDevice(neteditOptions.getString("gui-testing.setting-output"));
682  // save view settings
684  myVisualizationSettings->save(output);
685  // save viewport (zoom, X, Y and Z)
686  output.openTag(SUMO_TAG_VIEWPORT);
691  output.closeTag();
692  output.closeTag();
693  // close output device
694  output.close();
695  } catch (...) {
696  WRITE_ERROR(TL("GUI-Settings cannot be saved in ") + neteditOptions.getString("gui-testing.setting-output"));
697  }
698  }
699 }
700 
701 
704  return myEditModes;
705 }
706 
707 
710  return myTestingMode;
711 }
712 
713 
716  return myNetworkViewOptions;
717 }
718 
719 
722  return myDemandViewOptions;
723 }
724 
725 
728  return myDataViewOptions;
729 }
730 
731 
735 }
736 
737 
741 }
742 
743 
744 void
747  assert(!scheme.isFixed());
748  double minValue = std::numeric_limits<double>::infinity();
749  double maxValue = -std::numeric_limits<double>::infinity();
750  // retrieve range
751  bool hasMissingData = false;
752  if (objectType == GLO_LANE) {
753  // XXX (see #3409) multi-colors are not currently handled. this is a quick hack
754  if (active == 9) {
755  active = 8; // segment height, fall back to start height
756  } else if (active == 11) {
757  active = 10; // segment incline, fall back to total incline
758  }
759  for (const auto& lane : myNet->getAttributeCarriers()->getLanes()) {
760  const double val = lane.second->getColorValue(s, active);
761  if (val == s.MISSING_DATA) {
762  hasMissingData = true;
763  continue;
764  }
765  minValue = MIN2(minValue, val);
766  maxValue = MAX2(maxValue, val);
767  }
768  } else if (objectType == GLO_JUNCTION) {
769  if (active == 3) {
770  for (const auto& junction : myNet->getAttributeCarriers()->getJunctions()) {
771  minValue = MIN2(minValue, junction.second.second->getPositionInView().z());
772  maxValue = MAX2(maxValue, junction.second.second->getPositionInView().z());
773  }
774  }
775  } else if (objectType == GLO_TAZRELDATA) {
776  if (active == 4) {
777  for (const auto& genericData : myNet->getAttributeCarriers()->getGenericDatas().at(SUMO_TAG_TAZREL)) {
778  const double value = genericData.second->getColorValue(s, active);
779  if (value == s.MISSING_DATA) {
780  continue;
781  }
782  minValue = MIN2(minValue, value);
783  maxValue = MAX2(maxValue, value);
784  }
785  }
786  }
788  scheme.clear();
789  // add threshold for every distinct value
790  std::set<SVCPermissions> codes;
791  for (const auto& lane : myNet->getAttributeCarriers()->getLanes()) {
792  codes.insert(lane.second->getParentEdge()->getNBEdge()->getPermissions(lane.second->getIndex()));
793  }
794  int step = MAX2(1, 360 / (int)codes.size());
795  int hue = 0;
796  for (SVCPermissions p : codes) {
797  scheme.addColor(RGBColor::fromHSV(hue, 1, 1), (double)p);
798  hue = (hue + step) % 360;
799  }
800  return;
801  }
802  buildMinMaxRainbow(s, scheme, rs, minValue, maxValue, hasMissingData);
803 }
804 
805 
806 void
807 GNEViewNet::setStatusBarText(const std::string& text) {
808  myApp->setStatusBarText(text);
809 }
810 
811 
812 void
815 }
816 
817 
818 bool
821  return false;
822  } else {
824  }
825 }
826 
827 
828 void
829 GNEViewNet::setSelectorFrameScale(double selectionScale) {
831 }
832 
833 
834 bool
837 }
838 
839 
840 bool
843 }
844 
845 
846 bool
847 GNEViewNet::mergeJunctions(GNEJunction* movedJunction, GNEJunction* targetJunction) {
848  if (movedJunction && targetJunction &&
849  !movedJunction->isAttributeCarrierSelected() && !targetJunction->isAttributeCarrierSelected() &&
850  (movedJunction != targetJunction)) {
851  // optionally ask for confirmation
853  WRITE_DEBUG("Opening FXMessageBox 'merge junctions'");
854  // open question box
855  const std::string header = TL("Confirm Junction Merger");
856  const std::string body = (TLF("Do you wish to merge junctions '%' and '%'?\n('%' will be eliminated and its roads added to '%')", movedJunction->getMicrosimID(), targetJunction->getMicrosimID(), movedJunction->getMicrosimID(), targetJunction->getMicrosimID()));
857  const FXuint answer = FXMessageBox::question(this, MBOX_YES_NO, header.c_str(), "%s", body.c_str());
858  if (answer != 1) { //1:yes, 2:no, 4:esc
859  // write warning if netedit is running in testing mode
860  if (answer == 2) {
861  WRITE_DEBUG("Closed FXMessageBox 'merge junctions' with 'No'");
862  } else if (answer == 4) {
863  WRITE_DEBUG("Closed FXMessageBox 'merge junctions' with 'ESC'");
864  }
865  return false;
866  } else {
867  // write warning if netedit is running in testing mode
868  WRITE_DEBUG("Closed FXMessageBox 'merge junctions' with 'Yes'");
869  }
870  }
871  // merge moved and targed junctions
872  myNet->mergeJunctions(movedJunction, targetJunction, myUndoList);
873  return true;
874  } else {
875  return false;
876  }
877 }
878 
879 
880 bool
881 GNEViewNet::aksChangeSupermode(const std::string& operation, Supermode expectedSupermode) {
882  // first check if ignore option is enabled
883  if (OptionsCont::getOptions().getBool("ignore-supermode-question")) {
884  return true;
885  }
886  std::string body;
887  if (expectedSupermode == Supermode::NETWORK) {
888  body = (operation + TL(" requires switch to network mode. Continue?"));
889  } else if (expectedSupermode == Supermode::DEMAND) {
890  body = (operation + TL(" requires switch to demand mode. Continue?"));
891  } else if (expectedSupermode == Supermode::DATA) {
892  body = (operation + TL(" requires switch to data mode. Continue?"));
893  } else {
894  throw ProcessError("invalid expected supermode");
895  }
896  // open question box
897  const auto answer = FXMessageBox::question(myApp, MBOX_YES_NO, TL("Confirm switch mode"), "%s", body.c_str());
898  // restore focus to view net
899  setFocus();
900  // return answer
901  if (answer == MBOX_CLICKED_YES) {
902  myEditModes.setSupermode(expectedSupermode, true);
903  return true;
904  } else {
905  return false;
906  }
907 }
908 
909 
910 bool
912  // separate conditions for code legibly
914  const bool selectingDetectors = myViewParent->getTLSEditorFrame()->getTLSAttributes()->isSetDetectorsToggleButtonEnabled();
915  return (TLSMode && selectingDetectors);
916 }
917 
918 
919 bool
921  // separate conditions for code legibly
923  const bool selectingJunctions = myViewParent->getTLSEditorFrame()->getTLSJunction()->isJoiningJunctions();
924  return (TLSMode && selectingJunctions);
925 }
926 
927 
930  return mySaveElements;
931 }
932 
933 
936  return myTimeFormat;
937 }
938 
939 
940 bool
942  // Get selected lanes
943  const auto selectedLanes = myNet->getAttributeCarriers()->getSelectedLanes();
944  // Declare map of edges and lanes
945  std::map<GNEEdge*, GNELane*> mapOfEdgesAndLanes;
946  // Iterate over selected lanes
947  for (const auto& selectedLane : selectedLanes) {
948  mapOfEdgesAndLanes[myNet->getAttributeCarriers()->retrieveEdge(selectedLane->getParentEdge()->getID())] = selectedLane;
949  }
950  // Throw warning dialog if there hare multiple lanes selected in the same edge
951  if (mapOfEdgesAndLanes.size() != selectedLanes.size()) {
952  const std::string header = TL("Multiple lane in the same edge selected");
953  const std::string bodyA = TL("There are selected lanes that belong to the same edge.");
954  const std::string bodyB = TLF("Only one lane per edge will be restricted to %.", toString(vclass));
955  FXMessageBox::information(getApp(), MBOX_OK, header.c_str(), "%s", (bodyA + std::string("\n") + bodyB).c_str());
956  }
957  // If we handeln a set of lanes
958  if (mapOfEdgesAndLanes.size() > 0) {
959  // declare counter for number of Sidewalks
960  int counter = 0;
961  // iterate over selected lanes
962  for (const auto& edgeLane : mapOfEdgesAndLanes) {
963  if (edgeLane.first->hasRestrictedLane(vclass)) {
964  counter++;
965  }
966  }
967  // if all edges parent own a Sidewalk, stop function
968  if (counter == (int)mapOfEdgesAndLanes.size()) {
969  const std::string header = TLF("Set vclass to % for selected lanes", toString(vclass));
970  const std::string body = TL("All lanes own already another lane in the same edge with a restriction for ");
971  FXMessageBox::information(getApp(), MBOX_OK, header.c_str(), "%s", (body + toString(vclass) + ".").c_str());
972  return 0;
973  } else {
974  WRITE_DEBUG("Opening FXMessageBox 'restrict lanes'");
975  // Ask confirmation to user
976  const std::string header = TLF("Set vclass to % for selected lanes", toString(vclass));
977  const std::string body = TLF("% lanes will be restricted to %. Continue?", toString(mapOfEdgesAndLanes.size() - counter), toString(vclass));
978  FXuint answer = FXMessageBox::question(getApp(), MBOX_YES_NO, header.c_str(), "%s", body.c_str());
979  if (answer != 1) { //1:yes, 2:no, 4:esc
980  // write warning if netedit is running in testing mode
981  if (answer == 2) {
982  WRITE_DEBUG("Closed FXMessageBox 'restrict lanes' with 'No'");
983  } else if (answer == 4) {
984  WRITE_DEBUG("Closed FXMessageBox 'restrict lanes' with 'ESC'");
985  }
986  return 0;
987  } else {
988  // write warning if netedit is running in testing mode
989  WRITE_DEBUG("Closed FXMessageBox 'restrict lanes' with 'Yes'");
990  }
991  }
992  // begin undo operation
993  myUndoList->begin(lane, "restrict lanes to " + toString(vclass));
994  // iterate over selected lanes
995  for (const auto& edgeLane : mapOfEdgesAndLanes) {
996  // Transform lane to Sidewalk
997  myNet->restrictLane(vclass, edgeLane.second, myUndoList);
998  }
999  // end undo operation
1000  myUndoList->end();
1001  } else {
1002  // If only have a single lane, start undo/redo operation
1003  myUndoList->begin(lane, TL("restrict lane to ") + toString(vclass));
1004  // Transform lane to Sidewalk
1005  myNet->restrictLane(vclass, lane, myUndoList);
1006  // end undo operation
1007  myUndoList->end();
1008  }
1009  return 1;
1010 }
1011 
1012 
1013 bool
1014 GNEViewNet::addRestrictedLane(GNELane* lane, SUMOVehicleClass vclass, const bool insertAtFront) {
1015  // Get selected edges
1016  const auto selectedEdges = myNet->getAttributeCarriers()->getSelectedEdges();
1017  // get selected lanes
1018  const auto selectedLanes = myNet->getAttributeCarriers()->getSelectedLanes();
1019  // Declare set of edges
1020  std::set<GNEEdge*> setOfEdges;
1021  // Fill set of edges with vector of edges
1022  for (const auto& edge : selectedEdges) {
1023  setOfEdges.insert(edge);
1024  }
1025  // iterate over selected lanes
1026  for (const auto& selectedLane : selectedLanes) {
1027  // Insert pointer to edge into set of edges (To avoid duplicates)
1028  setOfEdges.insert(myNet->getAttributeCarriers()->retrieveEdge(selectedLane->getParentEdge()->getID()));
1029  }
1030  // If we handeln a set of edges
1032  // declare counter for number of restrictions
1033  int counter = 0;
1034  // iterate over set of edges
1035  for (const auto& edge : setOfEdges) {
1036  // update counter if edge has already a restricted lane of type "vclass"
1037  if (edge->hasRestrictedLane(vclass)) {
1038  counter++;
1039  }
1040  }
1041  // if all lanes own a Sidewalk, stop function
1042  if (counter == (int)setOfEdges.size()) {
1043  const std::string header = TLF("Add vclass % to selected lanes", toString(vclass));
1044  const std::string body = TLF("All lanes own already another lane in the same edge with a restriction to %.", toString(vclass));
1045  FXMessageBox::information(getApp(), MBOX_OK, header.c_str(), "%s", body.c_str());
1046  return 0;
1047  } else {
1048  WRITE_DEBUG("Opening FXMessageBox 'restrict lanes'");
1049  // Ask confirmation to user
1050  const std::string header = TLF("Add vclass % to selected lanes", toString(vclass));
1051  const std::string body = TLF("% restrictions to % will be added. Continue?", toString(setOfEdges.size() - counter), toString(vclass));
1052  FXuint answer = FXMessageBox::question(getApp(), MBOX_YES_NO, header.c_str(), "%s", body.c_str());
1053  if (answer != 1) { //1:yes, 2:no, 4:esc
1054  // write warning if netedit is running in testing mode
1055  if (answer == 2) {
1056  WRITE_DEBUG("Closed FXMessageBox 'restrict lanes' with 'No'");
1057  } else if (answer == 4) {
1058  WRITE_DEBUG("Closed FXMessageBox 'restrict lanes' with 'ESC'");
1059  }
1060  return 0;
1061  } else {
1062  // write warning if netedit is running in testing mode
1063  WRITE_DEBUG("Closed FXMessageBox 'restrict lanes' with 'Yes'");
1064  }
1065  }
1066  // begin undo operation
1067  myUndoList->begin(lane, TL("add restrictions for ") + toString(vclass));
1068  // iterate over set of edges
1069  for (const auto& edge : setOfEdges) {
1070  // add restricted lane (guess target)
1071  myNet->addRestrictedLane(vclass, edge, -1, myUndoList);
1072  }
1073  // end undo operation
1074  myUndoList->end();
1075  } else {
1076  // If only have a single lane, start undo/redo operation
1077  myUndoList->begin(lane, TL("add vclass for ") + toString(vclass));
1078  // Add restricted lane
1079  if (vclass == SVC_PEDESTRIAN) {
1080  // always add pedestrian lanes on the right
1081  myNet->addRestrictedLane(vclass, lane->getParentEdge(), 0, myUndoList);
1082  } else if (vclass == SVC_IGNORING) {
1083  if (insertAtFront) {
1084  myNet->addGreenVergeLane(lane->getParentEdge(), lane->getIndex() + 1, myUndoList);
1085  } else {
1087  }
1088  } else if (lane->getParentEdge()->getLanes().size() == 1) {
1089  // guess insertion position if there is only 1 lane
1090  myNet->addRestrictedLane(vclass, lane->getParentEdge(), -1, myUndoList);
1091  } else {
1092  myNet->addRestrictedLane(vclass, lane->getParentEdge(), lane->getIndex(), myUndoList);
1093  }
1094  // end undo/redo operation
1095  myUndoList->end();
1096  }
1097  return 1;
1098 }
1099 
1100 
1101 bool
1103  // Get selected edges
1104  const auto selectedEdges = myNet->getAttributeCarriers()->getSelectedEdges();
1105  // get selected lanes
1106  const auto selectedLanes = myNet->getAttributeCarriers()->getSelectedLanes();
1107  // Declare set of edges
1108  std::set<GNEEdge*> setOfEdges;
1109  // Fill set of edges with vector of edges
1110  for (const auto& edge : selectedEdges) {
1111  setOfEdges.insert(edge);
1112  }
1113  // iterate over selected lanes
1114  for (const auto& selectedLane : selectedLanes) {
1115  // Insert pointer to edge into set of edges (To avoid duplicates)
1116  setOfEdges.insert(myNet->getAttributeCarriers()->retrieveEdge(selectedLane->getParentEdge()->getID()));
1117  }
1118  // If we handeln a set of edges
1119  if (setOfEdges.size() > 0) {
1120  // declare counter for number of restrictions
1121  int counter = 0;
1122  // iterate over set of edges
1123  for (const auto& edge : setOfEdges) {
1124  // update counter if edge has already a restricted lane of type "vclass"
1125  if (edge->hasRestrictedLane(vclass)) {
1126  counter++;
1127  }
1128  }
1129  // if all lanes don't own a Sidewalk, stop function
1130  if (counter == 0) {
1131  const std::string header = TLF("Remove vclass % from selected lanes", toString(vclass));
1132  const std::string body = TLF("The selected lanes and edges don't have a restriction to %.", toString(vclass));
1133  FXMessageBox::information(getApp(), MBOX_OK, header.c_str(), "%s", body.c_str());
1134  return 0;
1135  } else {
1136  WRITE_DEBUG("Opening FXMessageBox 'restrict lanes'");
1137  // Ask confirmation to user
1138  const std::string header = TLF("Remove vclass % from selected lanes", toString(vclass));
1139  const std::string body = TLF("% restrictions to % will be removed. Continue?", toString(setOfEdges.size() - counter), toString(vclass));
1140  FXuint answer = FXMessageBox::question(getApp(), MBOX_YES_NO, header.c_str(), "%s", body.c_str());
1141  if (answer != 1) { //1:yes, 2:no, 4:esc
1142  // write warning if netedit is running in testing mode
1143  if (answer == 2) {
1144  WRITE_DEBUG("Closed FXMessageBox 'restrict lanes' with 'No'");
1145  } else if (answer == 4) {
1146  WRITE_DEBUG("Closed FXMessageBox 'restrict lanes' with 'ESC'");
1147  }
1148  return 0;
1149  } else {
1150  // write warning if netedit is running in testing mode
1151  WRITE_DEBUG("Closed FXMessageBox 'restrict lanes' with 'Yes'");
1152  }
1153  }
1154  // begin undo operation
1155  myUndoList->begin(lane, "Remove restrictions for " + toString(vclass));
1156  // iterate over set of edges
1157  for (const auto& edge : setOfEdges) {
1158  // add Sidewalk
1159  myNet->removeRestrictedLane(vclass, edge, myUndoList);
1160  }
1161  // end undo operation
1162  myUndoList->end();
1163  } else {
1164  // If only have a single lane, start undo/redo operation
1165  myUndoList->begin(lane, TL("Remove vclass for ") + toString(vclass));
1166  // Remove Sidewalk
1168  // end undo/redo operation
1169  myUndoList->end();
1170  }
1171  return 1;
1172 }
1173 
1174 
1176  myViewObjectsSelector(this),
1177  myEditModes(this),
1178  myTestingMode(this),
1179  myCommonCheckableButtons(this),
1180  myNetworkCheckableButtons(this),
1181  myDemandCheckableButtons(this),
1182  myDataCheckableButtons(this),
1183  myNetworkViewOptions(this),
1184  myDemandViewOptions(this),
1185  myDataViewOptions(this),
1186  myIntervalBar(this),
1187  myMoveSingleElement(this),
1188  myMoveMultipleElements(this),
1189  myVehicleOptions(this),
1190  myVehicleTypeOptions(this),
1191  mySaveElements(this),
1192  myTimeFormat(this),
1193  mySelectingArea(this),
1194  myEditNetworkElementShapes(this),
1195  myLockManager(this) {
1196 }
1197 
1198 
1199 std::vector<std::string>
1200 GNEViewNet::getEdgeLaneParamKeys(bool edgeKeys) const {
1201  std::set<std::string> keys;
1202  for (const NBEdge* e : myNet->getEdgeCont().getAllEdges()) {
1203  if (edgeKeys) {
1204  for (const auto& item : e->getParametersMap()) {
1205  keys.insert(item.first);
1206  }
1207  for (const auto& con : e->getConnections()) {
1208  for (const auto& item : con.getParametersMap()) {
1209  keys.insert(item.first);
1210  }
1211  }
1212  } else {
1213  for (const auto& lane : e->getLanes()) {
1214  int i = 0;
1215  for (const auto& item : lane.getParametersMap()) {
1216  keys.insert(item.first);
1217  }
1218  for (const auto& con : e->getConnectionsFromLane(i)) {
1219  for (const auto& item : con.getParametersMap()) {
1220  keys.insert(item.first);
1221  }
1222  }
1223  i++;
1224  }
1225  }
1226  }
1227  return std::vector<std::string>(keys.begin(), keys.end());
1228 }
1229 
1230 
1231 std::vector<std::string>
1233  std::set<std::string> keys;
1234  for (const auto& genericData : myNet->getAttributeCarriers()->getGenericDatas().at(GNE_TAG_EDGEREL_SINGLE)) {
1235  for (const auto& parameter : genericData.second->getACParametersMap()) {
1236  keys.insert(parameter.first);
1237  }
1238  }
1239  return std::vector<std::string>(keys.begin(), keys.end());
1240 }
1241 
1242 
1243 std::vector<std::string>
1245  std::set<std::string> keys;
1246  for (const auto& genericData : myNet->getAttributeCarriers()->getGenericDatas().at(SUMO_TAG_TAZREL)) {
1247  for (const auto& parameter : genericData.second->getACParametersMap()) {
1248  keys.insert(parameter.first);
1249  }
1250  }
1251  for (const auto& genericData : myNet->getAttributeCarriers()->getGenericDatas().at(SUMO_TAG_EDGEREL)) {
1252  for (const auto& parameter : genericData.second->getACParametersMap()) {
1253  keys.insert(parameter.first);
1254  }
1255  }
1256  return std::vector<std::string>(keys.begin(), keys.end());
1257 }
1258 
1259 
1260 bool
1264  return true;
1265  } else {
1266  return false;
1267  }
1268 }
1269 
1270 
1271 int
1273  return myDrawingToggle;
1274 }
1275 
1276 
1277 int
1278 GNEViewNet::doPaintGL(int mode, const Boundary& bound) {
1279  // set lefthand and laneIcons
1282  // first step: update objects under cursor
1284  // set render modes
1285  glRenderMode(mode);
1286  glMatrixMode(GL_MODELVIEW);
1288  glDisable(GL_TEXTURE_2D);
1289  glDisable(GL_ALPHA_TEST);
1290  glEnable(GL_BLEND);
1291  glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
1292  glEnable(GL_DEPTH_TEST);
1293  // visualize rectangular selection
1295  // draw certain elements only if we aren't in rectangle selection mode
1297  // draw decals
1298  drawDecals();
1299  // draw grid (and update grid button)
1300  drawGrid();
1301  // update show connections
1303  // draw temporal junction
1305  // draw temporal drawing shape
1307  // draw testing elements
1309  // draw temporal E2 multilane detectors
1311  // draw temporal overhead wires
1313  // draw temporal trip/flow route
1315  // draw temporal person plan route
1318  // draw temporal container plan route
1321  // draw temporal route
1323  // draw temporal edgeRelPath
1325  }
1326  // check menu checks of supermode demand
1328  // enable or disable menuCheckShowAllPersonPlans depending of there is a locked person
1331  } else {
1333  }
1334  }
1335  // clear pathDraw
1337  // draw network (boundary
1339  // draw all GL elements
1340  int hits = drawGLElements(bound);
1341  // draw temporal split junction
1343  // draw temporal roundabout
1345  // draw temporal lines between E1 detectors and junctions in TLS Mode
1347  // draw temporal lines between junctions in TLS Mode
1349  // draw netedit attributes references
1351  // draw test circle
1352  drawTestsCircle();
1353  // pop draw matrix
1355  // update interval bar
1357  // check if recopute boundaries (Deactivated, continue after 1.14 release)
1358  /*
1359  if (gObjectsInPosition.recomputeBoundaries != GLO_NETWORK) {
1360  myNet->getGrid().updateBoundaries(gObjectsInPosition.recomputeBoundaries);
1361  }
1362  */
1363  return hits;
1364 }
1365 
1366 
1367 long
1368 GNEViewNet::onLeftBtnPress(FXObject*, FXSelector, void* eventData) {
1369  // set focus in view net
1370  setFocus();
1371  // update MouseButtonKeyPressed
1372  myMouseButtonKeyPressed.update(eventData);
1373  // process left button press function depending of supermode
1375  processLeftButtonPressNetwork(eventData);
1376  } else if (myEditModes.isCurrentSupermodeDemand()) {
1377  processLeftButtonPressDemand(eventData);
1378  } else if (myEditModes.isCurrentSupermodeData()) {
1379  processLeftButtonPressData(eventData);
1380  }
1381  // update cursor
1382  updateCursor();
1383  // update view
1384  updateViewNet();
1385  return 1;
1386 }
1387 
1388 
1389 long
1390 GNEViewNet::onLeftBtnRelease(FXObject* obj, FXSelector sel, void* eventData) {
1391  // avoid closing Popup dialog in Linux
1392  if (myCreatedPopup) {
1393  myCreatedPopup = false;
1394  return 1;
1395  }
1396  // process parent function
1397  GUISUMOAbstractView::onLeftBtnRelease(obj, sel, eventData);
1398  // update MouseButtonKeyPressed
1399  myMouseButtonKeyPressed.update(eventData);
1400  // process left button release function depending of supermode
1403  } else if (myEditModes.isCurrentSupermodeDemand()) {
1405  } else if (myEditModes.isCurrentSupermodeData()) {
1407  }
1408  // update cursor
1409  updateCursor();
1410  // update view
1411  updateViewNet();
1412  return 1;
1413 }
1414 
1415 
1416 long
1417 GNEViewNet::onMiddleBtnPress(FXObject* obj, FXSelector sel, void* eventData) {
1418  // process parent function
1419  GUISUMOAbstractView::onMiddleBtnPress(obj, sel, eventData);
1420  // update cursor
1421  updateCursor();
1422  // update view
1423  updateViewNet();
1424  return 1;
1425 }
1426 
1427 
1428 long
1429 GNEViewNet::onMiddleBtnRelease(FXObject* obj, FXSelector sel, void* eventData) {
1430  // process parent function
1431  GUISUMOAbstractView::onMiddleBtnRelease(obj, sel, eventData);
1432  // update cursor
1433  updateCursor();
1434  // update view
1435  updateViewNet();
1436  return 1;
1437 }
1438 
1439 
1440 long
1441 GNEViewNet::onRightBtnPress(FXObject* obj, FXSelector sel, void* eventData) {
1442  // update MouseButtonKeyPressed
1443  myMouseButtonKeyPressed.update(eventData);
1444  // update cursor
1445  updateCursor();
1447  // disable right button press during drawing polygon
1448  return 1;
1449  } else {
1450  return GUISUMOAbstractView::onRightBtnPress(obj, sel, eventData);
1451  }
1452 }
1453 
1454 
1455 long
1456 GNEViewNet::onRightBtnRelease(FXObject* obj, FXSelector sel, void* eventData) {
1457  // update MouseButtonKeyPressed
1458  myMouseButtonKeyPressed.update(eventData);
1459  // update cursor
1460  updateCursor();
1461  // disable right button release during drawing polygon
1463  return 1;
1464  } else {
1465  return GUISUMOAbstractView::onRightBtnRelease(obj, sel, eventData);
1466  }
1467 }
1468 
1469 
1470 long
1471 GNEViewNet::onMouseMove(FXObject* obj, FXSelector sel, void* eventData) {
1472  // process mouse move in GUISUMOAbstractView
1473  GUISUMOAbstractView::onMouseMove(obj, sel, eventData);
1474  // update MouseButtonKeyPressed
1475  myMouseButtonKeyPressed.update(eventData);
1476  // update cursor
1477  updateCursor();
1478  // process mouse move function depending of supermode
1481  } else if (myEditModes.isCurrentSupermodeDemand()) {
1483  } else if (myEditModes.isCurrentSupermodeData()) {
1485  }
1486  // update view
1487  updateViewNet();
1488  return 1;
1489 }
1490 
1491 
1492 long
1493 GNEViewNet::onKeyPress(FXObject* o, FXSelector sel, void* eventData) {
1494  // update MouseButtonKeyPressed
1495  myMouseButtonKeyPressed.update(eventData);
1496  // update cursor
1497  updateCursor();
1498  // continue depending of current edit mode
1500  // update viewNet (for temporal junction)
1501  updateViewNet();
1503  // change "delete last created point" depending of shift key
1505  updateViewNet();
1507  // change "delete last created point" depending of shift key
1509  updateViewNet();
1511  updateViewNet();
1512  }
1513  return GUISUMOAbstractView::onKeyPress(o, sel, eventData);
1514 }
1515 
1516 
1517 long
1518 GNEViewNet::onKeyRelease(FXObject* o, FXSelector sel, void* eventData) {
1519  // update MouseButtonKeyPressed
1520  myMouseButtonKeyPressed.update(eventData);
1521  // update cursor
1522  updateCursor();
1523  // continue depending of current edit mode
1525  // update viewNet (for temporal junction)
1526  updateViewNet();
1528  // change "delete last created point" depending of shift key
1530  updateViewNet();
1532  // change "delete last created point" depending of shift key
1534  updateViewNet();
1536  updateViewNet();
1537  }
1538  // check if selecting using rectangle has to be disabled
1541  updateViewNet();
1542  }
1543  return GUISUMOAbstractView::onKeyRelease(o, sel, eventData);
1544 }
1545 
1546 
1547 void
1548 GNEViewNet::abortOperation(bool clearSelection) {
1549  // steal focus from any text fields and place it over view net
1550  setFocus();
1551  // check what supermode is enabled
1553  // abort operation depending of current mode
1555  // abort edge creation in create edge frame
1559  // check if current selection has to be cleaned
1560  if (clearSelection) {
1562  }
1564  // abort changes in Connector Frame
1567  // continue depending of current TLS frame state
1571  myViewParent->getTLSEditorFrame()->getTLSJunction()->onCmdCancelJoin(nullptr, 0, nullptr);
1572  } else {
1574  }
1580  // abort current drawing
1584  // abort current drawing
1586  } else if (myViewParent->getTAZFrame()->getCurrentTAZModule()->getTAZ() != nullptr) {
1587  // finish current editing TAZ
1589  }
1591  myViewParent->getProhibitionFrame()->getSelectionModul()->onCmdCancel(nullptr, 0, nullptr);
1593  // abort both network elements selections
1596  // abort path
1599  // abort path
1601  }
1602  } else if (myEditModes.isCurrentSupermodeDemand()) {
1603  // abort operation depending of current mode
1606  // check if current selection has to be cleaned
1607  if (clearSelection) {
1609  }
1622  }
1623  } else if (myEditModes.isCurrentSupermodeData()) {
1624  // abort operation depending of current mode
1627  // check if current selection has to be cleaned
1628  if (clearSelection) {
1630  }
1635  }
1636  }
1637  // abort undo list
1639  // update view
1640  updateViewNet();
1641 }
1642 
1643 
1644 void
1646  // delete elements depending of current supermode
1649  setStatusBarText(TL("Cannot delete in this mode"));
1651  // delete inspected elements
1652  myUndoList->begin(GUIIcon::MODEDELETE, TL("delete network inspected elements"));
1654  myUndoList->end();
1655  } else {
1656  // get selected ACs
1657  const auto selectedACs = myNet->getAttributeCarriers()->getSelectedAttributeCarriers(false);
1658  // delete selected elements
1659  if (selectedACs.size() > 0) {
1660  myUndoList->begin(GUIIcon::MODEDELETE, TL("delete network selection"));
1661  deleteNetworkAttributeCarriers(selectedACs);
1662  myUndoList->end();
1663  }
1664  }
1665  } else if (myEditModes.isCurrentSupermodeDemand()) {
1667  // delete inspected elements
1668  myUndoList->begin(GUIIcon::MODEDELETE, TL("delete demand inspected elements"));
1670  myUndoList->end();
1671  } else {
1672  // get selected ACs
1673  const auto selectedACs = myNet->getAttributeCarriers()->getSelectedAttributeCarriers(false);
1674  // delete selected elements
1675  if (selectedACs.size() > 0) {
1676  myUndoList->begin(GUIIcon::MODEDELETE, TL("delete demand selection"));
1677  deleteDemandAttributeCarriers(selectedACs);
1678  myUndoList->end();
1679  }
1680  }
1681  } else if (myEditModes.isCurrentSupermodeData()) {
1683  // delete inspected elements
1684  myUndoList->begin(GUIIcon::MODEDELETE, TL("delete data inspected elements"));
1686  myUndoList->end();
1687  } else {
1688  // get selected ACs
1689  const auto selectedACs = myNet->getAttributeCarriers()->getSelectedAttributeCarriers(false);
1690  // delete selected elements
1691  if (selectedACs.size() > 0) {
1692  myUndoList->begin(GUIIcon::MODEDELETE, TL("delete data selection"));
1693  deleteDataAttributeCarriers(selectedACs);
1694  myUndoList->end();
1695  }
1696  }
1697  }
1698  // update view
1699  updateViewNet();
1700 }
1701 
1702 
1703 void
1705  // check what supermode is enabled
1707  // abort operation depending of current mode
1709  // Accept changes in Connector Frame
1712  // continue depending of current TLS frame state
1716  myViewParent->getTLSEditorFrame()->getTLSJunction()->onCmdAcceptJoin(nullptr, 0, nullptr);
1719  }
1724  // stop current drawing
1726  } else {
1727  // start drawing
1729  }
1734  // stop current drawing
1736  } else if (myViewParent->getTAZFrame()->getCurrentTAZModule()->getTAZ() == nullptr) {
1737  // start drawing
1740  // save pending changes
1742  }
1744  // create path element
1747  // create path element
1749  }
1750  } else if (myEditModes.isCurrentSupermodeDemand()) {
1754  myViewParent->getVehicleFrame()->getPathCreator()->onCmdCreatePath(nullptr, 0, nullptr);
1756  myViewParent->getPersonFrame()->getPlanCreator()->onCmdCreatePath(nullptr, 0, nullptr);
1758  myViewParent->getPersonPlanFrame()->getPlanCreator()->onCmdCreatePath(nullptr, 0, nullptr);
1760  myViewParent->getContainerFrame()->getPlanCreator()->onCmdCreatePath(nullptr, 0, nullptr);
1763  }
1764  } else if (myEditModes.isCurrentSupermodeData()) {
1769  }
1770  }
1771 }
1772 
1773 
1774 void
1776  // check what supermode is enabled
1780  }
1781  } else if (myEditModes.isCurrentSupermodeDemand()) {
1794  }
1795  } else if (myEditModes.isCurrentSupermodeData()) {
1798  }
1799  }
1800 }
1801 
1802 void
1804  // if there is a visible frame, set focus over it. In other case, set focus over ViewNet
1805  if (myCurrentFrame != nullptr) {
1807  } else {
1808  setFocus();
1809  }
1810 }
1811 
1812 
1815  return myViewParent;
1816 }
1817 
1818 
1819 GNENet*
1821  return myNet;
1822 }
1823 
1824 
1825 GNEUndoList*
1827  return myUndoList;
1828 }
1829 
1830 
1833  return myIntervalBar;
1834 }
1835 
1836 
1837 const std::vector<GNEAttributeCarrier*>&
1840 }
1841 
1842 
1845  return myLockManager;
1846 }
1847 
1848 
1849 void
1850 GNEViewNet::setInspectedAttributeCarriers(const std::vector<GNEAttributeCarrier*> ACs) {
1852 }
1853 
1854 
1855 bool
1857  if (myInspectedAttributeCarriers.empty()) {
1858  return false;
1859  } else {
1860  // search AC in myInspectedAttributeCarriers
1861  const auto it = std::find(myInspectedAttributeCarriers.begin(), myInspectedAttributeCarriers.end(), AC);
1862  if (it == myInspectedAttributeCarriers.end()) {
1863  return false;
1864  } else {
1865  return true;
1866  }
1867  }
1868 }
1869 
1870 
1871 void
1873  // search AC in myInspectedAttributeCarriers
1874  const auto it = std::find(myInspectedAttributeCarriers.begin(), myInspectedAttributeCarriers.end(), AC);
1875  if (it != myInspectedAttributeCarriers.end()) {
1876  myInspectedAttributeCarriers.erase(it);
1878  }
1879 }
1880 
1881 
1882 const GNEAttributeCarrier*
1884  return myFrontAttributeCarrier;
1885 }
1886 
1887 
1888 const GUIGlObject*
1892  } else {
1893  return nullptr;
1894  }
1895 }
1896 
1897 
1898 void
1901  update();
1902 }
1903 
1904 
1905 void
1906 GNEViewNet::drawTranslateFrontAttributeCarrier(const GNEAttributeCarrier* AC, double typeOrLayer, const double extraOffset) {
1907  if (myFrontAttributeCarrier == AC) {
1908  glTranslated(0, 0, GLO_FRONTELEMENT + extraOffset);
1909  } else {
1910  glTranslated(0, 0, typeOrLayer + extraOffset);
1911  }
1912 }
1913 
1914 
1915 bool
1918 }
1919 
1920 
1921 bool
1922 GNEViewNet::checkOverLockedElement(const GUIGlObject* GLObject, const bool isSelected) const {
1923  // check if elemet is blocked
1924  if (myLockManager.isObjectLocked(GLObject->getType(), isSelected)) {
1925  return false;
1926  }
1927  // get front GLObject
1928  const auto glObjectFront = myViewObjectsSelector.getGUIGlObjectFront();
1929  // check if element is under cursor
1930  if (glObjectFront) {
1931  if (glObjectFront == GLObject) {
1932  return true;
1933  } else if (glObjectFront->getType() == GLObject->getType()) {
1934  for (const auto& glObjectUnderCursor : myViewObjectsSelector.getGLObjects()) {
1935  if (glObjectUnderCursor == GLObject) {
1936  return true;
1937  }
1938  }
1939  }
1940  }
1941  return false;
1942 }
1943 
1944 
1947  return myLastCreatedRoute;
1948 }
1949 
1950 
1951 void
1953  myLastCreatedRoute = lastCreatedRoute;
1954 }
1955 
1956 
1957 GNEJunction*
1959  // get first object that can be found in their container
1960  for (const auto& glObjectLayer : gViewObjectsHandler.getSelectedObjects()) {
1961  for (const auto& glObject : glObjectLayer.second) {
1962  auto junction = myNet->getAttributeCarriers()->retrieveJunction(glObject.object, false);
1963  if (junction) {
1964  return junction;
1965  }
1966  }
1967  }
1968  return nullptr;
1969 }
1970 
1971 
1974  // get first object that can be found in their container
1975  for (const auto& glObjectLayer : gViewObjectsHandler.getSelectedObjects()) {
1976  for (const auto& glObject : glObjectLayer.second) {
1977  auto connection = myNet->getAttributeCarriers()->retrieveConnection(glObject.object, false);
1978  if (connection) {
1979  return connection;
1980  }
1981  }
1982  }
1983  return nullptr;
1984 }
1985 
1986 
1987 GNECrossing*
1989  // get first object that can be found in their container
1990  for (const auto& glObjectLayer : gViewObjectsHandler.getSelectedObjects()) {
1991  for (const auto& glObject : glObjectLayer.second) {
1992  auto crossing = myNet->getAttributeCarriers()->retrieveCrossing(glObject.object, false);
1993  if (crossing) {
1994  return crossing;
1995  }
1996  }
1997  }
1998  return nullptr;
1999 }
2000 
2001 
2004  // get first object that can be found in their container
2005  for (const auto& glObjectLayer : gViewObjectsHandler.getSelectedObjects()) {
2006  for (const auto& glObject : glObjectLayer.second) {
2007  auto walkingArea = myNet->getAttributeCarriers()->retrieveWalkingArea(glObject.object, false);
2008  if (walkingArea) {
2009  return walkingArea;
2010  }
2011  }
2012  }
2013  return nullptr;
2014 }
2015 
2016 
2017 GNEEdge*
2019  // get first object that can be found in their container
2020  for (const auto& glObjectLayer : gViewObjectsHandler.getSelectedObjects()) {
2021  for (const auto& glObject : glObjectLayer.second) {
2022  auto edge = myNet->getAttributeCarriers()->retrieveEdge(glObject.object, false);
2023  if (edge) {
2024  return edge;
2025  }
2026  }
2027  }
2028  return nullptr;
2029 }
2030 
2031 
2032 GNELane*
2034  // get first object that can be found in their container
2035  for (const auto& glObjectLayer : gViewObjectsHandler.getSelectedObjects()) {
2036  for (const auto& glObject : glObjectLayer.second) {
2037  auto lane = myNet->getAttributeCarriers()->retrieveLane(glObject.object, false);
2038  if (lane) {
2039  return lane;
2040  }
2041  }
2042  }
2043  return nullptr;
2044 }
2045 
2046 
2049  // get first object that can be found in their container
2050  for (const auto& glObjectLayer : gViewObjectsHandler.getSelectedObjects()) {
2051  for (const auto& glObject : glObjectLayer.second) {
2052  auto additionalElement = myNet->getAttributeCarriers()->retrieveAdditional(glObject.object, false);
2053  if (additionalElement) {
2054  return additionalElement;
2055  }
2056  }
2057  }
2058  return nullptr;
2059 }
2060 
2061 
2064  // get first object that can be found in their container
2065  for (const auto& glObjectLayer : gViewObjectsHandler.getSelectedObjects()) {
2066  for (const auto& glObject : glObjectLayer.second) {
2067  auto demandElement = myNet->getAttributeCarriers()->retrieveDemandElement(glObject.object, false);
2068  if (demandElement) {
2069  return demandElement;
2070  }
2071  }
2072  }
2073  return nullptr;
2074 }
2075 
2076 
2077 GNEPoly*
2079  // get first object that can be parsed to poly element
2080  for (const auto& glObjectLayer : gViewObjectsHandler.getSelectedObjects()) {
2081  for (const auto& glObject : glObjectLayer.second) {
2082  auto polygon = dynamic_cast<GNEPoly*>(myNet->getAttributeCarriers()->retrieveAdditional(glObject.object, false));
2083  if (polygon) {
2084  return polygon;
2085  }
2086  }
2087  }
2088  return nullptr;
2089 }
2090 
2091 
2092 GNEPOI*
2094  // get first object that can be parsed to POI element
2095  for (const auto& glObjectLayer : gViewObjectsHandler.getSelectedObjects()) {
2096  for (const auto& glObject : glObjectLayer.second) {
2097  auto POI = dynamic_cast<GNEPOI*>(myNet->getAttributeCarriers()->retrieveAdditional(glObject.object, false));
2098  if (POI) {
2099  return POI;
2100  }
2101  }
2102  }
2103  return nullptr;
2104 }
2105 
2106 
2107 GNETAZ*
2109  // get first object that can be parsed to TAZ element
2110  for (const auto& glObjectLayer : gViewObjectsHandler.getSelectedObjects()) {
2111  for (const auto& glObject : glObjectLayer.second) {
2112  auto TAZ = dynamic_cast<GNETAZ*>(myNet->getAttributeCarriers()->retrieveAdditional(glObject.object, false));
2113  if (TAZ) {
2114  return TAZ;
2115  }
2116  }
2117  }
2118  return nullptr;
2119 }
2120 
2121 
2122 long
2123 GNEViewNet::onCmdSetSupermode(FXObject*, FXSelector sel, void*) {
2124  // check what network mode will be set
2125  switch (FXSELID(sel)) {
2127  if (myEditModes.networkButton->shown()) {
2129  }
2130  break;
2132  if (myEditModes.demandButton->shown()) {
2134  }
2135  break;
2137  if (myEditModes.dataButton->shown()) {
2139  }
2140  break;
2141  default:
2142  break;
2143  }
2144  return 1;
2145 }
2146 
2147 
2148 long
2149 GNEViewNet::onCmdSetMode(FXObject*, FXSelector sel, void*) {
2150  // first filter modes depending of view
2151  if (myEditModes.isJuPedSimView()) {
2152  // network
2154  switch (FXSELID(sel)) {
2155  // common
2159  // infrastructure
2164  // shapes
2167  break;
2168  default:
2169  return 0;
2170  }
2171  }
2172  // demand
2174  switch (FXSELID(sel)) {
2175  // common
2179  // persons
2182  // routes
2185  // types
2188  break;
2189  default:
2190  return 0;
2191  }
2192  }
2193  // data
2195  // all modes disabled
2196  return 0;
2197  }
2198  }
2199  // continue depending of supermode
2201  // check what network mode will be set
2202  switch (FXSELID(sel)) {
2205  break;
2208  break;
2211  break;
2214  break;
2217  break;
2220  break;
2223  break;
2226  break;
2229  break;
2232  break;
2235  break;
2238  break;
2241  break;
2244  break;
2245  default:
2246  break;
2247  }
2248  } else if (myEditModes.isCurrentSupermodeDemand()) {
2249  // check what demand mode will be set
2250  switch (FXSELID(sel)) {
2253  break;
2256  break;
2259  break;
2262  break;
2265  break;
2268  break;
2271  break;
2274  break;
2277  break;
2280  break;
2283  break;
2286  break;
2289  break;
2292  break;
2293  default:
2294  break;
2295  }
2296  } else if (myEditModes.isCurrentSupermodeData()) {
2297  // check what demand mode will be set
2298  switch (FXSELID(sel)) {
2301  break;
2304  break;
2307  break;
2310  break;
2313  break;
2316  break;
2319  break;
2320  default:
2321  break;
2322  }
2323  }
2324  return 1;
2325 }
2326 
2327 
2328 long
2329 GNEViewNet::onCmdSplitEdge(FXObject*, FXSelector, void*) {
2330  GNEEdge* edge = getEdgeAtPopupPosition();
2331  if (edge != nullptr) {
2333  }
2334  return 1;
2335 }
2336 
2337 
2338 long
2339 GNEViewNet::onCmdSplitEdgeBidi(FXObject*, FXSelector, void*) {
2340  GNEEdge* edge = getEdgeAtPopupPosition();
2341  if (edge != nullptr) {
2342  // obtain reverse edge
2343  const auto oppositeEdges = edge->getOppositeEdges();
2344  // check that reverse edge works
2345  if (oppositeEdges.size() > 0) {
2346  for (const auto& oppositeEdge : oppositeEdges) {
2347  // get reverse inner geometry
2348  const auto reverseGeometry = oppositeEdge->getNBEdge()->getInnerGeometry().reverse();
2349  if (reverseGeometry == edge->getNBEdge()->getInnerGeometry()) {
2350  myNet->splitEdgesBidi(edge, oppositeEdge, edge->getSplitPos(getPopupPosition()), myUndoList);
2351  return 1;
2352  }
2353  }
2354  }
2355  }
2356  return 1;
2357 }
2358 
2359 
2360 long
2361 GNEViewNet::onCmdReverseEdge(FXObject*, FXSelector, void*) {
2362  GNEEdge* edge = getEdgeAtPopupPosition();
2363  if (edge != nullptr) {
2364  if (edge->isAttributeCarrierSelected()) {
2365  myUndoList->begin(edge, TL("Reverse selected edges"));
2366  const auto selectedEdges = myNet->getAttributeCarriers()->getSelectedEdges();
2367  for (const auto& selectedEdge : selectedEdges) {
2368  myNet->reverseEdge(selectedEdge, myUndoList);
2369  }
2370  myUndoList->end();
2371  } else {
2372  myUndoList->begin(edge, TL("Reverse edge"));
2373  myNet->reverseEdge(edge, myUndoList);
2374  myUndoList->end();
2375  }
2376  }
2377  return 1;
2378 }
2379 
2380 
2381 long
2382 GNEViewNet::onCmdAddReversedEdge(FXObject*, FXSelector, void*) {
2383  GNEEdge* edge = getEdgeAtPopupPosition();
2384  if (edge != nullptr) {
2385  if (edge->isAttributeCarrierSelected()) {
2386  myUndoList->begin(edge, TL("Add Reverse edge for selected edges"));
2387  const auto selectedEdges = myNet->getAttributeCarriers()->getSelectedEdges();
2388  for (const auto& selectedEdge : selectedEdges) {
2389  myNet->addReversedEdge(selectedEdge, false, myUndoList);
2390  }
2391  myUndoList->end();
2392  } else {
2393  myUndoList->begin(edge, TL("Add reverse edge"));
2394  myNet->addReversedEdge(edge, false, myUndoList);
2395  myUndoList->end();
2396  }
2397  }
2398  return 1;
2399 }
2400 
2401 
2402 long
2403 GNEViewNet::onCmdAddReversedEdgeDisconnected(FXObject*, FXSelector, void*) {
2404  GNEEdge* edge = getEdgeAtPopupPosition();
2405  if (edge != nullptr) {
2406  if (edge->isAttributeCarrierSelected()) {
2407  myUndoList->begin(edge, TL("Add Reverse disconnected edge for selected edges"));
2408  const auto selectedEdges = myNet->getAttributeCarriers()->getSelectedEdges();
2409  for (const auto& selectedEdge : selectedEdges) {
2410  myNet->addReversedEdge(selectedEdge, true, myUndoList);
2411  }
2412  myUndoList->end();
2413  } else {
2414  myUndoList->begin(edge, TL("Add reverse disconnected edge"));
2415  myNet->addReversedEdge(edge, true, myUndoList);
2416  myUndoList->end();
2417  }
2418  }
2419  return 1;
2420 }
2421 
2422 
2423 long
2424 GNEViewNet::onCmdEditEdgeEndpoint(FXObject*, FXSelector, void*) {
2425  GNEEdge* edge = getEdgeAtPopupPosition();
2426  if (edge != nullptr) {
2427  // snap to active grid the Popup position
2429  }
2430  return 1;
2431 }
2432 
2433 
2434 long
2435 GNEViewNet::onCmdResetEdgeEndpoint(FXObject*, FXSelector, void*) {
2436  GNEEdge* edge = getEdgeAtPopupPosition();
2437  if (edge != nullptr) {
2438  // check if edge is selected
2439  if (edge->isAttributeCarrierSelected()) {
2440  // get all selected edges
2441  const auto selectedEdges = myNet->getAttributeCarriers()->getSelectedEdges();
2442  // begin operation
2443  myUndoList->begin(edge, TL("reset geometry points"));
2444  // iterate over selected edges
2445  for (const auto& selectedEdge : selectedEdges) {
2446  // reset both end points
2447  selectedEdge->resetBothEndpoint(myUndoList);
2448  }
2449  // end operation
2450  myUndoList->end();
2451  } else {
2453  }
2454  }
2455  return 1;
2456 }
2457 
2458 
2459 long
2460 GNEViewNet::onCmdStraightenEdges(FXObject*, FXSelector, void*) {
2461  GNEEdge* edge = getEdgeAtPopupPosition();
2462  if (edge != nullptr) {
2463  if (edge->isAttributeCarrierSelected()) {
2464  myUndoList->begin(edge, TL("straighten selected edges"));
2465  const auto selectedEdges = myNet->getAttributeCarriers()->getSelectedEdges();
2466  for (const auto& selectedEdge : selectedEdges) {
2467  selectedEdge->setAttribute(SUMO_ATTR_SHAPE, "", myUndoList);
2468  }
2469  myUndoList->end();
2470  } else {
2471 
2472  myUndoList->begin(edge, TL("straighten edge"));
2474  myUndoList->end();
2475  }
2476  }
2477  return 1;
2478 }
2479 
2480 
2481 long
2482 GNEViewNet::onCmdSmoothEdges(FXObject*, FXSelector, void*) {
2483  GNEEdge* edge = getEdgeAtPopupPosition();
2484  if (edge != nullptr) {
2485  if (edge->isAttributeCarrierSelected()) {
2486  myUndoList->begin(edge, TL("smooth selected edges"));
2487  const auto selectedEdges = myNet->getAttributeCarriers()->getSelectedEdges();
2488  for (const auto& selectedEdge : selectedEdges) {
2489  selectedEdge->smooth(myUndoList);
2490  }
2491  myUndoList->end();
2492  } else {
2493  myUndoList->begin(edge, TL("smooth edge"));
2494  edge->smooth(myUndoList);
2495  myUndoList->end();
2496  }
2497  }
2498  return 1;
2499 }
2500 
2501 
2502 long
2503 GNEViewNet::onCmdStraightenEdgesElevation(FXObject*, FXSelector, void*) {
2504  GNEEdge* edge = getEdgeAtPopupPosition();
2505  if (edge != nullptr) {
2506  if (edge->isAttributeCarrierSelected()) {
2507  myUndoList->begin(edge, TL("straighten elevation of selected edges"));
2508  const auto selectedEdges = myNet->getAttributeCarriers()->getSelectedEdges();
2509  for (const auto& selectedEdge : selectedEdges) {
2510  selectedEdge->straightenElevation(myUndoList);
2511  }
2512  myUndoList->end();
2513  } else {
2514  myUndoList->begin(edge, TL("straighten edge elevation"));
2516  myUndoList->end();
2517  }
2518  }
2519  return 1;
2520 }
2521 
2522 
2523 long
2524 GNEViewNet::onCmdSmoothEdgesElevation(FXObject*, FXSelector, void*) {
2525  GNEEdge* edge = getEdgeAtPopupPosition();
2526  if (edge != nullptr) {
2527  if (edge->isAttributeCarrierSelected()) {
2528  myUndoList->begin(edge, TL("smooth elevation of selected edges"));
2529  const auto selectedEdges = myNet->getAttributeCarriers()->getSelectedEdges();
2530  for (const auto& selectedEdge : selectedEdges) {
2531  selectedEdge->smoothElevation(myUndoList);
2532  }
2533  myUndoList->end();
2534  } else {
2535  myUndoList->begin(edge, TL("smooth edge elevation"));
2536  edge->smoothElevation(myUndoList);
2537  myUndoList->end();
2538  }
2539  }
2540  return 1;
2541 }
2542 
2543 
2544 long
2545 GNEViewNet::onCmdResetLength(FXObject*, FXSelector, void*) {
2546  GNEEdge* edge = getEdgeAtPopupPosition();
2547  if (edge != nullptr) {
2548  if (edge->isAttributeCarrierSelected()) {
2549  myUndoList->begin(edge, TL("reset edge lengths"));
2550  const auto selectedEdges = myNet->getAttributeCarriers()->getSelectedEdges();
2551  for (const auto& selectedEdge : selectedEdges) {
2552  selectedEdge->setAttribute(SUMO_ATTR_LENGTH, "-1", myUndoList);
2553  }
2554  myUndoList->end();
2555  } else {
2557  }
2558  }
2559  return 1;
2560 }
2561 
2562 
2563 long
2564 GNEViewNet::onCmdEdgeUseAsTemplate(FXObject*, FXSelector, void*) {
2565  GNEEdge* edge = getEdgeAtPopupPosition();
2566  if (edge != nullptr) {
2568  }
2569  return 1;
2570 }
2571 
2572 
2573 long
2574 GNEViewNet::onCmdEgeApplyTemplate(FXObject*, FXSelector, void*) {
2575  GNEEdge* edge = getEdgeAtPopupPosition();
2576  if ((edge != nullptr) && myViewParent->getInspectorFrame()->getTemplateEditor()->getEdgeTemplate()) {
2577  // begin copy template
2578  myUndoList->begin(edge, TL("copy edge template"));
2579  // copy template
2581  // end copy template
2582  myUndoList->end();
2583  // update view (to see visual changes)
2584  updateViewNet();
2585  }
2586  return 1;
2587 }
2588 
2589 
2590 long
2591 GNEViewNet::onCmdSimplifyShape(FXObject*, FXSelector, void*) {
2592  // get polygon under mouse
2593  GNEPoly* polygonUnderMouse = getPolygonAtPopupPosition();
2594  // check polygon
2595  if (polygonUnderMouse) {
2596  // check if shape is selected
2597  if (polygonUnderMouse->isAttributeCarrierSelected()) {
2598  // begin undo-list
2599  myNet->getViewNet()->getUndoList()->begin(polygonUnderMouse, TL("simplify shapes"));
2600  // get shapes
2601  const auto selectedShapes = myNet->getAttributeCarriers()->getSelectedShapes();
2602  // iterate over shapes
2603  for (const auto& selectedShape : selectedShapes) {
2604  // check if shape is a poly
2605  if ((selectedShape->getTagProperty().getTag() == SUMO_TAG_POLY) ||
2606  (selectedShape->getTagProperty().getTag() == GNE_TAG_JPS_WALKABLEAREA) ||
2607  (selectedShape->getTagProperty().getTag() == GNE_TAG_JPS_OBSTACLE)) {
2608  // simplify shape
2609  dynamic_cast<GNEPoly*>(selectedShape)->simplifyShape();
2610  }
2611  }
2612  // end undo-list
2613  myNet->getViewNet()->getUndoList()->end();
2614  } else {
2615  polygonUnderMouse->simplifyShape();
2616  }
2617  }
2618  updateViewNet();
2619  return 1;
2620 }
2621 
2622 
2623 long
2624 GNEViewNet::onCmdDeleteGeometryPoint(FXObject*, FXSelector, void*) {
2625  GNEPoly* polygonUnderMouse = getPolygonAtPopupPosition();
2626  if (polygonUnderMouse) {
2627  polygonUnderMouse->deleteGeometryPoint(getPopupPosition());
2628  }
2629  updateViewNet();
2630  return 1;
2631 }
2632 
2633 
2634 long
2635 GNEViewNet::onCmdClosePolygon(FXObject*, FXSelector, void*) {
2636  // get polygon under mouse
2637  GNEPoly* polygonUnderMouse = getPolygonAtPopupPosition();
2638  // check polygon
2639  if (polygonUnderMouse) {
2640  // check if shape is selected
2641  if (polygonUnderMouse->isAttributeCarrierSelected()) {
2642  // begin undo-list
2643  myNet->getViewNet()->getUndoList()->begin(polygonUnderMouse, TL("close polygon shapes"));
2644  // get selectedshapes
2645  const auto selectedShapes = myNet->getAttributeCarriers()->getSelectedShapes();
2646  // iterate over shapes
2647  for (const auto& selectedShape : selectedShapes) {
2648  // check if shape is a poly
2649  if ((selectedShape->getTagProperty().getTag() == SUMO_TAG_POLY) ||
2650  (selectedShape->getTagProperty().getTag() == GNE_TAG_JPS_WALKABLEAREA) ||
2651  (selectedShape->getTagProperty().getTag() == GNE_TAG_JPS_OBSTACLE)) {
2652  // close polygon
2653  dynamic_cast<GNEPoly*>(selectedShape)->closePolygon();
2654  }
2655  }
2656  // end undo-list
2657  myNet->getViewNet()->getUndoList()->end();
2658  } else {
2659  polygonUnderMouse->closePolygon();
2660  }
2661  }
2662  updateViewNet();
2663  return 1;
2664 }
2665 
2666 
2667 long
2668 GNEViewNet::onCmdOpenPolygon(FXObject*, FXSelector, void*) {
2669  // get polygon under mouse
2670  GNEPoly* polygonUnderMouse = getPolygonAtPopupPosition();
2671  // check polygon
2672  if (polygonUnderMouse) {
2673  // check if shape is selected
2674  if (polygonUnderMouse->isAttributeCarrierSelected()) {
2675  // begin undo-list
2676  myNet->getViewNet()->getUndoList()->begin(polygonUnderMouse, TL("open polygon shapes"));
2677  // get shapes
2678  const auto selectedShapes = myNet->getAttributeCarriers()->getSelectedShapes();
2679  // iterate over shapes
2680  for (const auto& selectedShape : selectedShapes) {
2681  // check if shape is a poly
2682  if ((selectedShape->getTagProperty().getTag() == SUMO_TAG_POLY) ||
2683  (selectedShape->getTagProperty().getTag() == GNE_TAG_JPS_WALKABLEAREA) ||
2684  (selectedShape->getTagProperty().getTag() == GNE_TAG_JPS_OBSTACLE)) {
2685  // open polygon
2686  dynamic_cast<GNEPoly*>(selectedShape)->openPolygon();
2687  }
2688  }
2689  // end undo-list
2690  myNet->getViewNet()->getUndoList()->end();
2691  } else {
2692  polygonUnderMouse->openPolygon();
2693  }
2694  }
2695  updateViewNet();
2696  return 1;
2697 }
2698 
2699 
2700 long
2701 GNEViewNet::onCmdSelectPolygonElements(FXObject*, FXSelector, void*) {
2702  // get polygon under mouse
2703  GNEPoly* polygonUnderMouse = getPolygonAtPopupPosition();
2704  // check polygon
2705  if (polygonUnderMouse) {
2706  // get ACs in boundary
2707  updateObjectsInBoundary(polygonUnderMouse->getShape().getBoxBoundary());
2708  // declare filtered ACs
2709  std::vector<GNEAttributeCarrier*> filteredACs;
2710  // iterate over obtained GUIGlIDs
2711  for (const auto& AC : myViewObjectsSelector.getAttributeCarriers()) {
2712  if (AC->getTagProperty().getTag() == SUMO_TAG_EDGE) {
2713  if (checkSelectEdges() && myNet->getAttributeCarriers()->isNetworkElementAroundShape(AC, polygonUnderMouse->getShape())) {
2714  filteredACs.push_back(AC);
2715  }
2716  } else if (AC->getTagProperty().getTag() == SUMO_TAG_LANE) {
2717  if (!checkSelectEdges() && myNet->getAttributeCarriers()->isNetworkElementAroundShape(AC, polygonUnderMouse->getShape())) {
2718  filteredACs.push_back(AC);
2719  }
2720  } else if ((AC != polygonUnderMouse) && myNet->getAttributeCarriers()->isNetworkElementAroundShape(AC, polygonUnderMouse->getShape())) {
2721  filteredACs.push_back(AC);
2722  }
2723  }
2724  // continue if there are ACs
2725  if (filteredACs.size() > 0) {
2726  // begin undo-list
2727  myNet->getViewNet()->getUndoList()->begin(GUIIcon::MODESELECT, TL("select within polygon boundary"));
2728  // iterate over shapes
2729  for (const auto& AC : filteredACs) {
2730  AC->setAttribute(GNE_ATTR_SELECTED, "true", myUndoList);
2731  }
2732  // end undo-list
2733  myNet->getViewNet()->getUndoList()->end();
2734  }
2735  }
2736  updateViewNet();
2737  return 1;
2738 }
2739 
2740 
2741 long
2742 GNEViewNet::onCmdSetFirstGeometryPoint(FXObject*, FXSelector, void*) {
2743  GNEPoly* polygonUnderMouse = getPolygonAtPopupPosition();
2744  if (polygonUnderMouse) {
2745  polygonUnderMouse->changeFirstGeometryPoint(polygonUnderMouse->getVertexIndex(getPopupPosition(), false));
2746  updateViewNet();
2747  }
2748 
2749  return 1;
2750 }
2751 
2752 
2753 long
2754 GNEViewNet::onCmdTransformPOI(FXObject*, FXSelector, void*) {
2755  // declare additional handler
2756  GNEAdditionalHandler additionalHanlder(myNet, true, false);
2757  // obtain POI at popup position
2759  if (POI) {
2760  // check what type of POI will be transformed
2761  if (POI->getTagProperty().getTag() == SUMO_TAG_POI) {
2762  // obtain lanes around POI boundary
2763  std::vector<GUIGlID> GLIDs = getObjectsInBoundary(POI->getCenteringBoundary());
2764  std::vector<GNELane*> lanes;
2765  for (const auto& GLID : GLIDs) {
2766  GNELane* lane = dynamic_cast<GNELane*>(GUIGlObjectStorage::gIDStorage.getObjectBlocking(GLID));
2767  if (lane) {
2768  lanes.push_back(lane);
2769  }
2770  }
2771  if (lanes.empty()) {
2772  WRITE_WARNINGF(TL("No lanes around % to attach it"), toString(SUMO_TAG_POI));
2773  } else {
2774  // obtain nearest lane to POI
2775  GNELane* nearestLane = lanes.front();
2776  double minorPosOverLane = nearestLane->getLaneShape().nearest_offset_to_point2D(POI->getPositionInView());
2777  double minorLateralOffset = nearestLane->getLaneShape().positionAtOffset(minorPosOverLane).distanceTo(POI->getPositionInView());
2778  for (const auto& lane : lanes) {
2779  double posOverLane = lane->getLaneShape().nearest_offset_to_point2D(POI->getPositionInView());
2780  double lateralOffset = lane->getLaneShape().positionAtOffset(posOverLane).distanceTo(POI->getPositionInView());
2781  if (lateralOffset < minorLateralOffset) {
2782  minorPosOverLane = posOverLane;
2783  minorLateralOffset = lateralOffset;
2784  nearestLane = lane;
2785  }
2786  }
2787  // get sumo base object of POI (And all common attributes)
2788  CommonXMLStructure::SumoBaseObject* POIBaseObject = POI->getSumoBaseObject();
2789  // add specific attributes
2790  POIBaseObject->addStringAttribute(SUMO_ATTR_LANE, nearestLane->getID());
2791  POIBaseObject->addDoubleAttribute(SUMO_ATTR_POSITION, minorPosOverLane);
2792  POIBaseObject->addBoolAttribute(SUMO_ATTR_FRIENDLY_POS, POI->getFriendlyPos());
2793  POIBaseObject->addDoubleAttribute(SUMO_ATTR_POSITION_LAT, 0);
2794  // remove POI
2795  myUndoList->begin(POI, TL("attach POI into lane"));
2797  // add new POI use route handler
2798  additionalHanlder.parseSumoBaseObject(POIBaseObject);
2799  myUndoList->end();
2800  }
2801  } else {
2802  // get sumo base object of POI (And all common attributes)
2803  CommonXMLStructure::SumoBaseObject* POIBaseObject = POI->getSumoBaseObject();
2804  // add specific attributes
2805  POIBaseObject->addDoubleAttribute(SUMO_ATTR_X, POI->x());
2806  POIBaseObject->addDoubleAttribute(SUMO_ATTR_Y, POI->y());
2807  // remove POI
2808  myUndoList->begin(POI, TL("release POI from lane"));
2810  // add new POI use route handler
2811  additionalHanlder.parseSumoBaseObject(POIBaseObject);
2812  myUndoList->end();
2813  }
2814  // update view after transform
2815  updateViewNet();
2816  }
2817  return 1;
2818 }
2819 
2820 
2821 long
2822 GNEViewNet::onCmdReverse(FXObject*, FXSelector, void*) {
2823  // obtain demand element at popup position
2825  if (demandElement) {
2826  // begin undo list
2827  myUndoList->begin(demandElement, TLF("reverse % '%'", demandElement->getTagStr(), demandElement->getID()));
2828  GNERouteHandler::reverse(demandElement);
2829  myUndoList->end();
2830  }
2831  return 1;
2832 }
2833 
2834 
2835 long
2836 GNEViewNet::onCmdAddReverse(FXObject*, FXSelector, void*) {
2837  // obtain demand element at popup position
2839  if (demandElement) {
2840  // begin undo list
2841  myUndoList->begin(demandElement, TLF("add reverse '%'", demandElement->getTagStr()));
2842  GNERouteHandler::addReverse(demandElement);
2843  myUndoList->end();
2844  }
2845  return 1;
2846 }
2847 
2848 
2849 long
2850 GNEViewNet::onCmdSetCustomGeometryPoint(FXObject*, FXSelector, void*) {
2851  // get element at popup position
2852  GNELane* lane = getLaneAtPopupPosition();
2855  // check element
2856  if (lane != nullptr) {
2857  // make a copy of edge geometry
2858  PositionVector edgeGeometry = lane->getParentEdge()->getNBEdge()->getGeometry();
2859  // get index position
2860  const int index = edgeGeometry.indexOfClosest(getPositionInformation(), true);
2861  // get new position
2862  Position newPosition = edgeGeometry[index];
2863  // edit using modal GNEGeometryPointDialog
2864  GNEGeometryPointDialog(this, &newPosition); // NOSONAR, constructor returns after dialog has been closed
2865  // now check position
2866  if (newPosition != edgeGeometry[index]) {
2867  // update new position
2868  edgeGeometry[index] = newPosition;
2869  // begin undo list
2870  myUndoList->begin(lane->getParentEdge(), TL("change edge Geometry Point position"));
2871  // continue depending of index
2872  if (index == 0) {
2873  // change shape start
2875  } else if (index == ((int)edgeGeometry.size() - 1)) {
2876  // change shape end
2878  } else {
2879  // remove front and back geometry points
2880  edgeGeometry.pop_front();
2881  edgeGeometry.pop_back();
2882  // change shape
2884  }
2885  // end undo list
2886  myUndoList->end();
2887  }
2888  } else if (poly != nullptr) {
2889  // make a copy of polygon geometry
2890  PositionVector polygonGeometry = poly->getShape();
2891  // get index position
2892  const int index = polygonGeometry.indexOfClosest(getPositionInformation(), true);
2893  // get new position
2894  Position newPosition = polygonGeometry[index];
2895  // edit using modal GNEGeometryPointDialog
2896  GNEGeometryPointDialog(this, &newPosition); // NOSONAR, constructor returns after dialog has been closed
2897  // now check position
2898  if (newPosition != polygonGeometry[index]) {
2899  // update new position
2900  polygonGeometry[index] = newPosition;
2901  // begin undo list
2902  myUndoList->begin(poly, TL("change polygon Geometry Point position"));
2903  // change shape
2905  // end undo list
2906  myUndoList->end();
2907  }
2908  } else if (TAZ != nullptr) {
2909  // make a copy of TAZ geometry
2910  PositionVector TAZGeometry = TAZ->getAdditionalGeometry().getShape();
2911  // get index position
2912  const int index = TAZGeometry.indexOfClosest(getPositionInformation(), true);
2913  // get new position
2914  Position newPosition = TAZGeometry[index];
2915  // edit using modal GNEGeometryPointDialog
2916  GNEGeometryPointDialog(this, &newPosition); // NOSONAR, constructor returns after dialog has been closed
2917  // now check position
2918  if (newPosition != TAZGeometry[index]) {
2919  // update new position
2920  TAZGeometry[index] = newPosition;
2921  // begin undo list
2922  myUndoList->begin(TAZ, TL("change TAZ Geometry Point position"));
2923  // change shape
2925  // end undo list
2926  myUndoList->end();
2927  }
2928  }
2929  return 1;
2930 }
2931 
2932 
2933 long
2934 GNEViewNet::onCmdResetEndPoints(FXObject*, FXSelector, void*) {
2935  // get lane at popup position
2936  GNELane* laneAtPopupPosition = getLaneAtPopupPosition();
2937  // check element
2938  if (laneAtPopupPosition != nullptr) {
2939  // get parent edge
2940  GNEEdge* edge = laneAtPopupPosition->getParentEdge();
2941  // check if edge is selected
2942  if (edge->isAttributeCarrierSelected()) {
2943  // get selected edges
2944  const auto selectedEdges = myNet->getAttributeCarriers()->getSelectedEdges();
2945  // begin undo list
2946  myUndoList->begin(edge, TL("reset end points of selected edges"));
2947  // iterate over edges
2948  for (const auto& selectedEdge : selectedEdges) {
2949  // reset both end points
2950  selectedEdge->setAttribute(GNE_ATTR_SHAPE_START, "", myUndoList);
2951  selectedEdge->setAttribute(GNE_ATTR_SHAPE_END, "", myUndoList);
2952  }
2953  // end undo list
2954  myUndoList->end();
2955  } else {
2956  // begin undo list
2957  myUndoList->begin(edge, TL("reset end points of edge '") + edge->getID());
2958  // reset both end points
2961  // end undo list
2962  myUndoList->end();
2963  }
2964  }
2965  return 1;
2966 }
2967 
2968 
2969 long
2970 GNEViewNet::onCmdDuplicateLane(FXObject*, FXSelector, void*) {
2971  GNELane* laneAtPopupPosition = getLaneAtPopupPosition();
2972  if (laneAtPopupPosition != nullptr) {
2973  // when duplicating an unselected lane, keep all connections as they
2974  // are, otherwise recompute them
2975  if (laneAtPopupPosition->isAttributeCarrierSelected()) {
2976  myUndoList->begin(laneAtPopupPosition, TL("duplicate selected lanes"));
2977  const auto selectedLanes = myNet->getAttributeCarriers()->getSelectedLanes();
2978  for (const auto& lane : selectedLanes) {
2979  myNet->duplicateLane(lane, myUndoList, true);
2980  }
2981  myUndoList->end();
2982  } else {
2983  myUndoList->begin(laneAtPopupPosition, TL("duplicate lane"));
2984  myNet->duplicateLane(laneAtPopupPosition, myUndoList, false);
2985  myUndoList->end();
2986  }
2987  }
2988  return 1;
2989 }
2990 
2991 
2992 long
2993 GNEViewNet::onCmdEditLaneShape(FXObject*, FXSelector, void*) {
2994  // Obtain lane under mouse
2995  GNELane* lane = getLaneAtPopupPosition();
2996  if (lane) {
2998  }
2999  // destroy pop-up and update view Net
3000  destroyPopup();
3001  setFocus();
3002  return 1;
3003 }
3004 
3005 
3006 long
3007 GNEViewNet::onCmdResetLaneCustomShape(FXObject*, FXSelector, void*) {
3008  GNELane* laneAtPopupPosition = getLaneAtPopupPosition();
3009  if (laneAtPopupPosition != nullptr) {
3010  // when duplicating an unselected lane, keep all connections as they
3011  // are, otherwise recompute them
3012  if (laneAtPopupPosition->isAttributeCarrierSelected()) {
3013  myUndoList->begin(laneAtPopupPosition, TL("reset custom lane shapes"));
3014  const auto selectedLanes = myNet->getAttributeCarriers()->getSelectedLanes();
3015  for (const auto& lane : selectedLanes) {
3016  lane->setAttribute(SUMO_ATTR_CUSTOMSHAPE, "", myUndoList);
3017  }
3018  myUndoList->end();
3019  } else {
3020  myUndoList->begin(laneAtPopupPosition, TL("reset custom lane shape"));
3021  laneAtPopupPosition->setAttribute(SUMO_ATTR_CUSTOMSHAPE, "", myUndoList);
3022  myUndoList->end();
3023  }
3024  }
3025  return 1;
3026 }
3027 
3028 
3029 long
3030 GNEViewNet::onCmdResetOppositeLane(FXObject*, FXSelector, void*) {
3031  GNELane* laneAtPopupPosition = getLaneAtPopupPosition();
3032  if (laneAtPopupPosition != nullptr) {
3033  // when duplicating an unselected lane, keep all connections as they
3034  // are, otherwise recompute them
3035  if (laneAtPopupPosition->isAttributeCarrierSelected()) {
3036  myUndoList->begin(laneAtPopupPosition, TL("reset opposite lanes"));
3037  const auto selectedLanes = myNet->getAttributeCarriers()->getSelectedLanes();
3038  for (const auto& lane : selectedLanes) {
3039  lane->setAttribute(GNE_ATTR_OPPOSITE, "", myUndoList);
3040  }
3041  myUndoList->end();
3042  } else {
3043  myUndoList->begin(laneAtPopupPosition, TL("reset opposite lane"));
3044  laneAtPopupPosition->setAttribute(GNE_ATTR_OPPOSITE, "", myUndoList);
3045  myUndoList->end();
3046  }
3047  }
3048  return 1;
3049 }
3050 
3051 
3052 long
3053 GNEViewNet::onCmdLaneOperation(FXObject*, FXSelector sel, void*) {
3054  GNELane* laneAtPopupPosition = getLaneAtPopupPosition();
3055  if (laneAtPopupPosition) {
3056  // check lane operation
3057  switch (FXSELID(sel)) {
3059  return restrictLane(laneAtPopupPosition, SVC_PEDESTRIAN);
3061  return restrictLane(laneAtPopupPosition, SVC_BICYCLE);
3063  return restrictLane(laneAtPopupPosition, SVC_BUS);
3065  return restrictLane(laneAtPopupPosition, SVC_IGNORING);
3067  return addRestrictedLane(laneAtPopupPosition, SVC_PEDESTRIAN, false);
3068  case MID_GNE_LANE_ADD_BIKE:
3069  return addRestrictedLane(laneAtPopupPosition, SVC_BICYCLE, false);
3070  case MID_GNE_LANE_ADD_BUS:
3071  return addRestrictedLane(laneAtPopupPosition, SVC_BUS, false);
3073  return addRestrictedLane(laneAtPopupPosition, SVC_IGNORING, true);
3075  return addRestrictedLane(laneAtPopupPosition, SVC_IGNORING, false);
3077  return removeRestrictedLane(laneAtPopupPosition, SVC_PEDESTRIAN);
3079  return removeRestrictedLane(laneAtPopupPosition, SVC_BICYCLE);
3081  return removeRestrictedLane(laneAtPopupPosition, SVC_BUS);
3083  return removeRestrictedLane(laneAtPopupPosition, SVC_IGNORING);
3084  default:
3085  return 0;
3086  }
3087  } else {
3088  return 0;
3089  }
3090 }
3091 
3092 
3093 long
3094 GNEViewNet::onCmdLaneReachability(FXObject* menu, FXSelector, void*) {
3095  GNELane* laneAtPopupPosition = getLaneAtPopupPosition();
3096  if (laneAtPopupPosition != nullptr) {
3097  // obtain vClass
3098  const SUMOVehicleClass vClass = SumoVehicleClassStrings.get(dynamic_cast<FXMenuCommand*>(menu)->getText().text());
3099  // calculate reachability
3100  myNet->getPathManager()->getPathCalculator()->calculateReachability(vClass, laneAtPopupPosition->getParentEdge());
3101  // select all lanes with reachability greater than 0
3102  myUndoList->begin(laneAtPopupPosition, TL("select lane reachability"));
3103  for (const auto& edge : myNet->getAttributeCarriers()->getEdges()) {
3104  for (const auto& lane : edge.second.second->getLanes()) {
3105  if (lane->getReachability() >= 0) {
3106  lane->setAttribute(GNE_ATTR_SELECTED, "true", myUndoList);
3107  }
3108  }
3109  }
3110  myUndoList->end();
3111  }
3112  // update viewNet
3113  updateViewNet();
3114  return 1;
3115 }
3116 
3117 
3118 long
3119 GNEViewNet::onCmdOpenAdditionalDialog(FXObject*, FXSelector, void*) {
3120  // retrieve additional under cursor
3122  // check if additional can open dialog
3123  if (addtional && addtional->getTagProperty().hasDialog()) {
3124  addtional->openAdditionalDialog();
3125  }
3126  return 1;
3127 }
3128 
3129 
3130 void
3131 GNEViewNet::processClick(void* eventData) {
3132  FXEvent* evt = (FXEvent*)eventData;
3133  // process click
3134  destroyPopup();
3135  setFocus();
3136  myChanger->onLeftBtnPress(eventData);
3137  grab();
3138  // Check there are double click
3139  if (evt->click_count == 2) {
3140  handle(this, FXSEL(SEL_DOUBLECLICKED, 0), eventData);
3141  }
3142 }
3143 
3144 
3145 void
3147  // first check if we're panning
3148  if (myPanning) {
3149  // move view
3152  } else {
3153  // declare flags
3154  bool cursorMoveView = false;
3155  bool cursorInspect = false;
3156  bool cursorSelect = false;
3157  bool cursorMoveElement = false;
3158  bool cursorDelete = false;
3159  // continue depending of supermode
3161  // move view
3167  cursorMoveView = true;
3168  }
3169  // specific mode
3171  cursorInspect = true;
3173  cursorSelect = true;
3175  cursorMoveElement = true;
3177  cursorDelete = true;
3178  }
3179  } else if (myEditModes.isCurrentSupermodeDemand()) {
3180  // move view
3184  cursorMoveView = true;
3185  }
3186  // specific mode
3188  cursorInspect = true;
3190  cursorSelect = true;
3192  cursorMoveElement = true;
3194  cursorDelete = true;
3195  }
3196  } else if (myEditModes.isCurrentSupermodeData()) {
3197  // move view
3199  cursorMoveView = true;
3200  }
3201  // specific mode
3203  cursorInspect = true;
3205  cursorSelect = true;
3207  cursorDelete = true;
3208  }
3209  }
3210  // set cursor
3211  if (myMouseButtonKeyPressed.controlKeyPressed() && cursorMoveView) {
3212  // move view cursor if control key is pressed
3215  } else if (cursorInspect) {
3216  // special case for inspect lanes
3218  // inspect lane cursor
3221  } else {
3222  // inspect cursor
3225  }
3226  } else if (cursorSelect) {
3227  // special case for select lanes
3229  // select lane cursor
3232  } else {
3233  // select cursor
3234  setDefaultCursor(GUICursorSubSys::getCursor(GUICursor::SELECT));
3236  }
3237  } else if (cursorMoveElement) {
3238  // move cursor
3241  } else if (cursorDelete) {
3242  // delete cursor
3245  } else {
3246  // default cursor
3249  }
3250  }
3251 }
3252 
3253 
3254 int
3256  // udpdate drawing toggle
3257  if (myDrawingToggle > 10000) {
3258  myDrawingToggle = 0;
3259  } else {
3260  myDrawingToggle++;
3261  }
3262  // set default scale
3264  // calculate boundary extremes
3265  const float minB[2] = { (float)bound.xmin(), (float)bound.ymin() };
3266  const float maxB[2] = { (float)bound.xmax(), (float)bound.ymax() };
3267  // reset gl line to 1
3268  glLineWidth(1);
3269  // set drawing modes
3270  glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
3271  glEnable(GL_POLYGON_OFFSET_FILL);
3272  glEnable(GL_POLYGON_OFFSET_LINE);
3273  // draw all elements between minB and maxB, obtain objects included in minB and maxB
3274  return myGrid->Search(minB, maxB, *myVisualizationSettings);
3275 }
3276 
3277 
3278 void
3280  // depending of the visualizationSettings, enable or disable check box show grid
3282  // change show grid
3285  // change to true
3288  // update show grid buttons
3291  }
3292  // draw grid only in network and demand mode
3294  paintGLGrid();
3295  }
3296  } else {
3297  // change show grid
3300  // change to false
3303  // update show grid buttons
3306  }
3307  }
3308 }
3309 
3310 
3311 long
3312 GNEViewNet::onCmdResetEdgeEndPoints(FXObject*, FXSelector, void*) {
3313  // Obtain junction under mouse
3315  if (junction) {
3316  myUndoList->begin(GUIIcon::EDGE, TL("reset edge endpoints"));
3317  // are, otherwise recompute them
3318  if (junction->isAttributeCarrierSelected()) {
3319  const auto selectedJunctions = myNet->getAttributeCarriers()->getSelectedJunctions();
3320  for (const auto& selectedJunction : selectedJunctions) {
3321  // reset shape end from incoming edges
3322  for (const auto& incomingEdge : selectedJunction->getGNEIncomingEdges()) {
3323  incomingEdge->setAttribute(GNE_ATTR_SHAPE_END, "", myUndoList);
3324  }
3325  // reset shape start from outgoing edges
3326  for (const auto& outgoingEdge : selectedJunction->getGNEOutgoingEdges()) {
3327  outgoingEdge->setAttribute(GNE_ATTR_SHAPE_START, "", myUndoList);
3328  }
3329  }
3330  } else {
3331  // reset shape end from incoming edges
3332  for (const auto& incomingEdge : junction->getGNEIncomingEdges()) {
3333  incomingEdge->setAttribute(GNE_ATTR_SHAPE_END, "", myUndoList);
3334  }
3335  // reset shape start from outgoing edges
3336  for (const auto& outgoingEdge : junction->getGNEOutgoingEdges()) {
3337  outgoingEdge->setAttribute(GNE_ATTR_SHAPE_START, "", myUndoList);
3338  }
3339  }
3340  myUndoList->end();
3341  }
3342  // destroy pop-up and set focus in view net
3343  destroyPopup();
3344  setFocus();
3345  return 1;
3346 }
3347 
3348 
3349 long
3350 GNEViewNet::onCmdEditJunctionShape(FXObject*, FXSelector, void*) {
3351  // Obtain junction under mouse
3353  if (junction) {
3354  // check if network has to be updated
3355  if (junction->getNBNode()->getShape().size() == 0) {
3356  // recompute the whole network
3358  }
3359  // if grid is enabled, show warning
3361  WRITE_WARNING(TL("Grid is still active, press ctrl+g to deactivate"));
3362  }
3363  // start edit custom shape
3365  }
3366  // destroy pop-up and set focus in view net
3367  destroyPopup();
3368  setFocus();
3369  return 1;
3370 }
3371 
3372 
3373 long
3374 GNEViewNet::onCmdResetJunctionShape(FXObject*, FXSelector, void*) {
3375  // Obtain junction under mouse
3377  if (junction) {
3378  // are, otherwise recompute them
3379  if (junction->isAttributeCarrierSelected()) {
3380  myUndoList->begin(junction, TL("reset custom junction shapes"));
3381  const auto selectedJunctions = myNet->getAttributeCarriers()->getSelectedJunctions();
3382  for (const auto& selectedJunction : selectedJunctions) {
3383  selectedJunction->setAttribute(SUMO_ATTR_SHAPE, "", myUndoList);
3384  }
3385  myUndoList->end();
3386  } else {
3387  myUndoList->begin(junction, TL("reset custom junction shape"));
3388  junction->setAttribute(SUMO_ATTR_SHAPE, "", myUndoList);
3389  myUndoList->end();
3390  }
3391  }
3392  // destroy pop-up and set focus in view net
3393  destroyPopup();
3394  setFocus();
3395  return 1;
3396 }
3397 
3398 
3399 long
3400 GNEViewNet::onCmdReplaceJunction(FXObject*, FXSelector, void*) {
3402  if (junction != nullptr) {
3404  updateViewNet();
3405  }
3406  // destroy pop-up and set focus in view net
3407  destroyPopup();
3408  setFocus();
3409  return 1;
3410 }
3411 
3412 
3413 long
3414 GNEViewNet::onCmdSplitJunction(FXObject*, FXSelector, void*) {
3416  if (junction != nullptr) {
3417  myNet->splitJunction(junction, false, myUndoList);
3418  updateViewNet();
3419  }
3420  // destroy pop-up and set focus in view net
3421  destroyPopup();
3422  setFocus();
3423  return 1;
3424 }
3425 
3426 
3427 long
3428 GNEViewNet::onCmdSplitJunctionReconnect(FXObject*, FXSelector, void*) {
3430  if (junction != nullptr) {
3431  myNet->splitJunction(junction, true, myUndoList);
3432  updateViewNet();
3433  }
3434  // destroy pop-up and set focus in view net
3435  destroyPopup();
3436  setFocus();
3437  return 1;
3438 }
3439 
3440 long
3441 GNEViewNet::onCmdSelectRoundabout(FXObject*, FXSelector, void*) {
3443  if (junction != nullptr) {
3444  myNet->selectRoundabout(junction, myUndoList);
3445  updateViewNet();
3446  }
3447  // destroy pop-up and set focus in view net
3448  destroyPopup();
3449  setFocus();
3450  return 1;
3451 }
3452 
3453 long
3454 GNEViewNet::onCmdConvertRoundabout(FXObject*, FXSelector, void*) {
3456  if (junction != nullptr) {
3457  myNet->createRoundabout(junction, myUndoList);
3458  updateViewNet();
3459  }
3460  // destroy pop-up and set focus in view net
3461  destroyPopup();
3462  setFocus();
3463  return 1;
3464 }
3465 
3466 
3467 long
3468 GNEViewNet::onEnterConvertRoundabout(FXObject*, FXSelector, void*) {
3469  myDrawPreviewRoundabout = true;
3470  update();
3471  return 1;
3472 }
3473 
3474 
3475 long
3476 GNEViewNet::onLeaveConvertRoundabout(FXObject*, FXSelector, void*) {
3477  myDrawPreviewRoundabout = false;
3478  update();
3479  return 1;
3480 }
3481 
3482 
3483 long
3484 GNEViewNet::onCmdClearConnections(FXObject*, FXSelector, void*) {
3486  if (junction != nullptr) {
3487  // make sure we do not inspect the connection will it is being deleted
3488  if ((myInspectedAttributeCarriers.size() > 0) && (myInspectedAttributeCarriers.front()->getTagProperty().getTag() == SUMO_TAG_CONNECTION)) {
3490  }
3491  // make sure that connections isn't the front attribute
3493  myFrontAttributeCarrier = nullptr;
3494  }
3495  // check if we're handling a selection
3496  if (junction->isAttributeCarrierSelected()) {
3497  const auto selectedJunctions = myNet->getAttributeCarriers()->getSelectedJunctions();
3498  myUndoList->begin(GUIIcon::CONNECTION, TL("clear connections of selected junctions"));
3499  for (const auto& selectedJunction : selectedJunctions) {
3500  myNet->clearJunctionConnections(selectedJunction, myUndoList);
3501  }
3502  myUndoList->end();
3503  } else {
3505  }
3506  updateViewNet();
3507  }
3508  // destroy pop-up and set focus in view net
3509  destroyPopup();
3510  setFocus();
3511  return 1;
3512 }
3513 
3514 
3515 long
3516 GNEViewNet::onCmdResetConnections(FXObject*, FXSelector, void*) {
3518  if (junction != nullptr) {
3519  // make sure we do not inspect the connection will it is being deleted
3520  if ((myInspectedAttributeCarriers.size() > 0) && myInspectedAttributeCarriers.front()->getTagProperty().getTag() == SUMO_TAG_CONNECTION) {
3522  }
3523  // make sure that connections isn't the front attribute
3525  myFrontAttributeCarrier = nullptr;
3526  }
3527  // check if we're handling a selection
3528  if (junction->isAttributeCarrierSelected()) {
3529  const auto selectedJunctions = myNet->getAttributeCarriers()->getSelectedJunctions();
3530  myUndoList->begin(GUIIcon::CONNECTION, TL("reset connections of selected junctions"));
3531  for (const auto& selectedJunction : selectedJunctions) {
3532  myNet->resetJunctionConnections(selectedJunction, myUndoList);
3533  }
3534  myUndoList->end();
3535  } else {
3537  }
3538  updateViewNet();
3539  }
3540  // destroy pop-up and set focus in view net
3541  destroyPopup();
3542  setFocus();
3543  return 1;
3544 }
3545 
3546 
3547 long
3548 GNEViewNet::onCmdAddTLS(FXObject*, FXSelector, void*) {
3550  if (junction != nullptr) {
3551  // check if we're adding TLS in multiple junctions
3552  if (junction->isAttributeCarrierSelected()) {
3553  const auto selectedJunctions = myNet->getAttributeCarriers()->getSelectedJunctions();
3554  myNet->getViewNet()->getUndoList()->begin(GUIIcon::MODETLS, TL("add TLS in multiple junctions"));
3555  for (const auto& selectedJunction : selectedJunctions) {
3556  selectedJunction->setAttribute(SUMO_ATTR_TYPE, "traffic_light", myUndoList);
3557  }
3558  myNet->getViewNet()->getUndoList()->end();
3559  } else {
3560  // change junction type
3561  junction->setAttribute(SUMO_ATTR_TYPE, "traffic_light", myUndoList);
3562  // change to TLS Mode
3564  // set junction in TLS mode
3566  }
3567  }
3568  // destroy pop-up and set focus in view net
3569  destroyPopup();
3570  setFocus();
3571  return 1;
3572 }
3573 
3574 
3575 long
3576 GNEViewNet::onCmdAddJoinTLS(FXObject*, FXSelector, void*) {
3578  if (junction != nullptr) {
3579  // check if we're adding TLS in multiple junctions
3580  if (junction->isAttributeCarrierSelected()) {
3581  myNet->getViewNet()->getUndoList()->begin(GUIIcon::MODETLS, TL("add TLS in multiple junctions"));
3582  }
3583  // change junction type
3584  junction->setAttribute(SUMO_ATTR_TYPE, "traffic_light", myUndoList);
3585  // if TLS was sucesfully created, apply the same TLID to other selected junctions
3586  if (junction->getAttribute(SUMO_ATTR_TLID).size() > 0) {
3587  const auto selectedJunctions = myNet->getAttributeCarriers()->getSelectedJunctions();
3588  // iterate over all selected junctions
3589  for (const auto& selectedJunction : selectedJunctions) {
3590  // check that doesn't have a TL
3591  if (selectedJunction->getNBNode()->getControllingTLS().empty()) {
3592  selectedJunction->setAttribute(SUMO_ATTR_TYPE, "traffic_light", myUndoList);
3593  selectedJunction->setAttribute(SUMO_ATTR_TLID, junction->getAttribute(SUMO_ATTR_TLID), myUndoList);
3594  }
3595  }
3596  }
3597  // rename traffic light
3598  if (junction->getNBNode()->getControllingTLS().size() > 0) {
3599  const auto TLSDef = (*junction->getNBNode()->getControllingTLS().begin());
3600  if (!myNet->getTLLogicCont().exist(TLSDef->getID() + "_joined")) {
3601  myUndoList->add(new GNEChange_TLS(junction, TLSDef, TLSDef->getID() + "_joined"), true);
3602  }
3603  }
3604  // end undoList
3605  if (junction->isAttributeCarrierSelected()) {
3606  myNet->getViewNet()->getUndoList()->end();
3607  }
3608  // change to TLS Mode
3610  // set junction in TLS mode
3612  }
3613  // destroy pop-up and set focus in view net
3614  destroyPopup();
3615  setFocus();
3616  return 1;
3617 }
3618 
3619 long
3620 GNEViewNet::onCmdEditConnectionShape(FXObject*, FXSelector, void*) {
3621  // Obtain connection under mouse
3623  if (connection) {
3625  }
3626  // if grid is enabled, show warning
3628  WRITE_WARNING(TL("Grid is still active, press ctrl+g to deactivate"));
3629  }
3630  // destroy pop-up and update view Net
3631  destroyPopup();
3632  setFocus();
3633  return 1;
3634 }
3635 
3636 
3637 long
3638 GNEViewNet::onCmdSmoothConnectionShape(FXObject*, FXSelector, void*) {
3639  // Obtain connection under mouse
3641  if (connection) {
3642  connection->smootShape();
3643  }
3644  // destroy pop-up and update view Net
3645  destroyPopup();
3646  setFocus();
3647  return 1;
3648 }
3649 
3650 
3651 long
3652 GNEViewNet::onCmdEditCrossingShape(FXObject*, FXSelector, void*) {
3653  // Obtain crossing under mouse
3655  if (crossing) {
3656  // check if network has to be updated
3657  if (crossing->getParentJunction()->getNBNode()->getShape().size() == 0) {
3658  // recompute the whole network
3660  }
3661  // if grid is enabled, show warning
3663  WRITE_WARNING(TL("Grid is still active, press ctrl+g to deactivate"));
3664  }
3665  // start edit custom shape
3667  }
3668  // destroy pop-up and update view Net
3669  destroyPopup();
3670  setFocus();
3671  return 1;
3672 }
3673 
3674 
3675 long
3676 GNEViewNet::onCmdEditWalkingAreaShape(FXObject*, FXSelector, void*) {
3677  // Obtain walkingArea under mouse
3679  if (walkingArea) {
3680  // check if network has to be updated
3681  if (walkingArea->getParentJunction()->getNBNode()->getShape().size() == 0) {
3682  // recompute the whole network
3684  // if grid is enabled, show warning
3686  WRITE_WARNING(TL("Grid is still active, press ctrl+g to deactivate"));
3687  }
3688  }
3689  // start edit custom shape
3691  }
3692  // destroy pop-up and update view Net
3693  destroyPopup();
3694  setFocus();
3695  return 1;
3696 }
3697 
3698 
3699 long
3700 GNEViewNet::onCmdToggleSelectEdges(FXObject*, FXSelector sel, void*) {
3701  // Toggle menuCheckSelectEdges
3704  } else {
3706  }
3708  // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
3709  if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_SELECTEDGES)) {
3711  }
3712  return 1;
3713 }
3714 
3715 
3716 long
3717 GNEViewNet::onCmdToggleShowConnections(FXObject*, FXSelector sel, void*) {
3718  // Toggle menuCheckShowConnections
3721  } else {
3723  }
3725  // if show was enabled, init GNEConnections
3728  }
3729  // change flag "showLane2Lane" in myVisualizationSettings
3731  // Hide/show connections require recompute
3732  getNet()->requireRecompute();
3733  // Update viewNet to show/hide connections
3734  updateViewNet();
3735  // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
3736  if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_SHOWCONNECTIONS)) {
3738  }
3739  return 1;
3740 }
3741 
3742 
3743 long
3744 GNEViewNet::onCmdToggleHideConnections(FXObject*, FXSelector sel, void*) {
3745  // Toggle menuCheckHideConnections
3748  } else {
3750  }
3752  // Update viewNet to show/hide connections
3753  updateViewNet();
3754  // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
3755  if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_HIDECONNECTIONS)) {
3757  }
3758  return 1;
3759 }
3760 
3761 
3762 long
3763 GNEViewNet::onCmdToggleShowAdditionalSubElements(FXObject*, FXSelector sel, void*) {
3764  // Toggle menuCheckShowAdditionalSubElements
3767  } else {
3769  }
3771  // Update viewNet to show/hide sub elements
3772  updateViewNet();
3773  // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
3774  if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_SHOWSUBADDITIONALS)) {
3776  }
3777  return 1;
3778 }
3779 
3780 
3781 long
3782 GNEViewNet::onCmdToggleShowTAZElements(FXObject*, FXSelector sel, void*) {
3783  // Toggle menuCheckShowAdditionalSubElements
3786  } else {
3788  }
3790  // Update viewNet to show/hide TAZ elements
3791  updateViewNet();
3792  // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
3793  if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_SHOWTAZELEMENTS)) {
3795  }
3796  return 1;
3797 }
3798 
3799 
3800 long
3801 GNEViewNet::onCmdToggleExtendSelection(FXObject*, FXSelector sel, void*) {
3802  // Toggle menuCheckExtendSelection
3805  } else {
3807  }
3809  // Only update view
3810  updateViewNet();
3811  // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
3812  if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_EXTENDSELECTION)) {
3814  }
3815  return 1;
3816 }
3817 
3818 
3819 long
3820 GNEViewNet::onCmdToggleChangeAllPhases(FXObject*, FXSelector sel, void*) {
3821  // Toggle menuCheckChangeAllPhases
3824  } else {
3826  }
3828  // Only update view
3829  updateViewNet();
3830  // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
3831  if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_CHANGEALLPHASES)) {
3833  }
3834  return 1;
3835 }
3836 
3837 
3838 long
3839 GNEViewNet::onCmdToggleShowGrid(FXObject*, FXSelector sel, void*) {
3840  // show or hide grid depending of myNetworkViewOptions.menuCheckToggleGrid
3845  } else {
3849  }
3852  // update view to show grid
3853  updateViewNet();
3854  // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
3855  if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_TOGGLEGRID)) {
3857  } else if (sel == FXSEL(SEL_COMMAND, MID_GNE_DEMANDVIEWOPTIONS_SHOWGRID)) {
3859  }
3860  return 1;
3861 }
3862 
3863 
3864 long
3865 GNEViewNet::onCmdToggleDrawJunctionShape(FXObject*, FXSelector sel, void*) {
3866  // toggle state
3868  // gui button has 'hide' semantics
3869  const bool hide = !myVisualizationSettings->drawJunctionShape;
3873 
3877  // update view to show DrawJunctionShape
3878  updateViewNet();
3879  // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
3880  if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_TOGGLEDRAWJUNCTIONSHAPE)) {
3882  } else if (sel == FXSEL(SEL_COMMAND, MID_GNE_DEMANDVIEWOPTIONS_TOGGLEDRAWJUNCTIONSHAPE)) {
3884  } else if (sel == FXSEL(SEL_COMMAND, MID_GNE_DATAVIEWOPTIONS_TOGGLEDRAWJUNCTIONSHAPE)) {
3886  }
3887  return 1;
3888 }
3889 
3890 long
3891 GNEViewNet::onCmdToggleDrawSpreadVehicles(FXObject*, FXSelector sel, void*) {
3892  // Toggle menuCheckShowDemandElements
3897  } else {
3900  }
3903  // declare edge set
3904  std::set<GNEEdge*> edgesToUpdate;
3905  // compute vehicle geometry
3906  for (const auto& vehicle : myNet->getAttributeCarriers()->getDemandElements().at(SUMO_TAG_VEHICLE)) {
3907  if (vehicle.second->getParentEdges().size() > 0) {
3908  edgesToUpdate.insert(vehicle.second->getParentEdges().front());
3909  } else if (vehicle.second->getChildDemandElements().size() > 0 && (vehicle.second->getChildDemandElements().front()->getTagProperty().getTag() == GNE_TAG_ROUTE_EMBEDDED)) {
3910  edgesToUpdate.insert(vehicle.second->getChildDemandElements().front()->getParentEdges().front());
3911  }
3912  }
3913  for (const auto& routeFlow : myNet->getAttributeCarriers()->getDemandElements().at(GNE_TAG_FLOW_ROUTE)) {
3914  if (routeFlow.second->getParentEdges().size() > 0) {
3915  edgesToUpdate.insert(routeFlow.second->getParentEdges().front());
3916  } else if (routeFlow.second->getChildDemandElements().size() > 0 && (routeFlow.second->getChildDemandElements().front()->getTagProperty().getTag() == GNE_TAG_ROUTE_EMBEDDED)) {
3917  edgesToUpdate.insert(routeFlow.second->getChildDemandElements().front()->getParentEdges().front());
3918  }
3919  }
3920  for (const auto& trip : myNet->getAttributeCarriers()->getDemandElements().at(SUMO_TAG_TRIP)) {
3921  if (trip.second->getParentEdges().size() > 0) {
3922  edgesToUpdate.insert(trip.second->getParentEdges().front());
3923  }
3924  }
3925  for (const auto& flow : myNet->getAttributeCarriers()->getDemandElements().at(SUMO_TAG_FLOW)) {
3926  if (flow.second->getParentEdges().size() > 0) {
3927  edgesToUpdate.insert(flow.second->getParentEdges().front());
3928  }
3929  }
3930  // update spread geometries of all edges
3931  for (const auto& edge : edgesToUpdate) {
3932  edge->updateVehicleSpreadGeometries();
3933  }
3934  // update view to show new vehicles positions
3935  updateViewNet();
3936  // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
3937  if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_DRAWSPREADVEHICLES)) {
3939  } else if (sel == FXSEL(SEL_COMMAND, MID_GNE_DEMANDVIEWOPTIONS_DRAWSPREADVEHICLES)) {
3941  }
3942  return 1;
3943 }
3944 
3945 
3946 long
3947 GNEViewNet::onCmdToggleWarnAboutMerge(FXObject*, FXSelector sel, void*) {
3948  // Toggle menuCheckWarnAboutMerge
3951  } else {
3953  }
3955  // Only update view
3956  updateViewNet();
3957  // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
3958  if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_ASKFORMERGE)) {
3960  }
3961  return 1;
3962 }
3963 
3964 
3965 long
3966 GNEViewNet::onCmdToggleShowJunctionBubbles(FXObject*, FXSelector sel, void*) {
3967  // Toggle menuCheckShowJunctionBubble
3970  } else {
3972  }
3974  // Only update view
3975  updateViewNet();
3976  // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
3977  if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_SHOWBUBBLES)) {
3979  }
3980  return 1;
3981 }
3982 
3983 
3984 long
3985 GNEViewNet::onCmdToggleMoveElevation(FXObject*, FXSelector sel, void*) {
3986  // Toggle menuCheckMoveElevation
3989  } else {
3991  }
3993  // Only update view
3994  updateViewNet();
3995  // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
3996  if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_MOVEELEVATION)) {
3998  }
3999  return 1;
4000 }
4001 
4002 
4003 long
4004 GNEViewNet::onCmdToggleChainEdges(FXObject*, FXSelector sel, void*) {
4005  // Toggle menuCheckMoveElevation
4008  } else {
4010  }
4012  // Only update view
4013  updateViewNet();
4014  // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4015  if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_CHAINEDGES)) {
4017  }
4018  return 1;
4019 }
4020 
4021 
4022 long
4023 GNEViewNet::onCmdToggleAutoOppositeEdge(FXObject*, FXSelector sel, void*) {
4024  // Toggle menuCheckAutoOppositeEdge
4027  } else {
4029  }
4031  // Only update view
4032  updateViewNet();
4033  // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4034  if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_AUTOOPPOSITEEDGES)) {
4036  }
4037  return 1;
4038 }
4039 
4040 
4041 long
4042 GNEViewNet::onCmdToggleHideNonInspecteDemandElements(FXObject*, FXSelector sel, void*) {
4043  // Toggle menuCheckHideNonInspectedDemandElements
4046  } else {
4048  }
4050  // Only update view
4051  updateViewNet();
4052  // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4053  if (sel == FXSEL(SEL_COMMAND, MID_GNE_DEMANDVIEWOPTIONS_HIDENONINSPECTED)) {
4055  }
4056  return 1;
4057 }
4058 
4059 
4060 long
4061 GNEViewNet::onCmdToggleShowOverlappedRoutes(FXObject*, FXSelector sel, void*) {
4062  // Toggle menuCheckShowOverlappedRoutes
4065  } else {
4067  }
4069  // Only update view
4070  updateViewNet();
4071  // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4072  if (sel == FXSEL(SEL_COMMAND, MID_GNE_DEMANDVIEWOPTIONS_SHOWOVERLAPPEDROUTES)) {
4074  }
4075  return 1;
4076 }
4077 
4078 
4079 long
4080 GNEViewNet::onCmdToggleHideShapes(FXObject*, FXSelector sel, void*) {
4081  // Toggle menuCheckHideShapes
4084  } else {
4086  }
4088  // Only update view
4089  updateViewNet();
4090  // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4091  if (sel == FXSEL(SEL_COMMAND, MID_GNE_DEMANDVIEWOPTIONS_HIDESHAPES)) {
4093  }
4094  return 1;
4095 }
4096 
4097 
4098 long
4099 GNEViewNet::onCmdToggleShowTrips(FXObject*, FXSelector sel, void*) {
4100  // Toggle menuCheckHideShapes
4103  } else {
4105  }
4107  // Only update view
4108  updateViewNet();
4109  // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4110  if (sel == FXSEL(SEL_COMMAND, MID_GNE_DEMANDVIEWOPTIONS_SHOWTRIPS)) {
4112  }
4113  return 1;
4114 }
4115 
4116 
4117 long
4118 GNEViewNet::onCmdToggleShowAllPersonPlans(FXObject*, FXSelector sel, void*) {
4119  // Toggle menuCheckShowAllPersonPlans
4122  } else {
4124  }
4126  // Only update view
4127  updateViewNet();
4128  // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4129  if (sel == FXSEL(SEL_COMMAND, MID_GNE_DEMANDVIEWOPTIONS_SHOWALLPERSONPLANS)) {
4131  }
4132  return 1;
4133 }
4134 
4135 
4136 long
4137 GNEViewNet::onCmdToggleLockPerson(FXObject*, FXSelector sel, void*) {
4138  // Toggle menuCheckLockPerson
4141  } else if ((myInspectedAttributeCarriers.size() > 0) && myInspectedAttributeCarriers.front()->getTagProperty().isPerson()) {
4143  }
4145  // lock or unlock current inspected person depending of menuCheckLockPerson value
4147  // obtain locked person or person plan
4148  const GNEDemandElement* personOrPersonPlan = dynamic_cast<const GNEDemandElement*>(myInspectedAttributeCarriers.front());
4149  if (personOrPersonPlan) {
4150  // lock person depending if casted demand element is either a person or a person plan
4151  if (personOrPersonPlan->getTagProperty().isPerson()) {
4152  myDemandViewOptions.lockPerson(personOrPersonPlan);
4153  } else {
4154  myDemandViewOptions.lockPerson(personOrPersonPlan->getParentDemandElements().front());
4155  }
4156  }
4157  } else {
4158  // unlock current person
4160  }
4161  // update view
4162  updateViewNet();
4163  // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4164  if (sel == FXSEL(SEL_COMMAND, MID_GNE_DEMANDVIEWOPTIONS_LOCKPERSON)) {
4166  }
4167  return 1;
4168 }
4169 
4170 
4171 long
4172 GNEViewNet::onCmdToggleShowAllContainerPlans(FXObject*, FXSelector sel, void*) {
4173  // Toggle menuCheckShowAllContainerPlans
4176  } else {
4178  }
4180  // Only update view
4181  updateViewNet();
4182  // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4183  if (sel == FXSEL(SEL_COMMAND, MID_GNE_DEMANDVIEWOPTIONS_SHOWALLCONTAINERPLANS)) {
4185  }
4186  return 1;
4187 }
4188 
4189 
4190 long
4191 GNEViewNet::onCmdToggleLockContainer(FXObject*, FXSelector sel, void*) {
4192  // Toggle menuCheckLockContainer
4195  } else if ((myInspectedAttributeCarriers.size() > 0) && myInspectedAttributeCarriers.front()->getTagProperty().isContainer()) {
4197  }
4199  // lock or unlock current inspected container depending of menuCheckLockContainer value
4201  // obtain locked container or container plan
4202  const GNEDemandElement* containerOrContainerPlan = dynamic_cast<const GNEDemandElement*>(myInspectedAttributeCarriers.front());
4203  if (containerOrContainerPlan) {
4204  // lock container depending if casted demand element is either a container or a container plan
4205  if (containerOrContainerPlan->getTagProperty().isContainer()) {
4206  myDemandViewOptions.lockContainer(containerOrContainerPlan);
4207  } else {
4208  myDemandViewOptions.lockContainer(containerOrContainerPlan->getParentDemandElements().front());
4209  }
4210  }
4211  } else {
4212  // unlock current container
4214  }
4215  // update view
4216  updateViewNet();
4217  // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4218  if (sel == FXSEL(SEL_COMMAND, MID_GNE_DEMANDVIEWOPTIONS_LOCKCONTAINER)) {
4220  }
4221  return 1;
4222 }
4223 
4224 
4225 long
4226 GNEViewNet::onCmdToggleShowAdditionals(FXObject*, FXSelector sel, void*) {
4227  // Toggle menuCheckShowAdditionals
4230  } else {
4232  }
4234  // Only update view
4235  updateViewNet();
4236  // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4237  if (sel == FXSEL(SEL_COMMAND, MID_GNE_DATAVIEWOPTIONS_SHOWADDITIONALS)) {
4239  }
4240  return 1;
4241 }
4242 
4243 
4244 long
4245 GNEViewNet::onCmdToggleShowShapes(FXObject*, FXSelector sel, void*) {
4246  // Toggle menuCheckShowShapes
4249  } else {
4251  }
4253  // Only update view
4254  updateViewNet();
4255  // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4256  if (sel == FXSEL(SEL_COMMAND, MID_GNE_DATAVIEWOPTIONS_SHOWSHAPES)) {
4258  }
4259  return 1;
4260 }
4261 
4262 
4263 long
4264 GNEViewNet::onCmdToggleShowDemandElementsNetwork(FXObject*, FXSelector sel, void*) {
4265  // Toggle menuCheckShowDemandElements
4268  } else {
4270  }
4272  // compute demand elements
4274  // update view to show demand elements
4275  updateViewNet();
4276  // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4277  if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_SHOWDEMANDELEMENTS)) {
4279  }
4280  return 1;
4281 }
4282 
4283 
4284 long
4285 GNEViewNet::onCmdToggleShowDemandElementsData(FXObject*, FXSelector sel, void*) {
4286  // Toggle menuCheckShowDemandElements
4289  } else {
4291  }
4293  // compute demand elements
4295  // update view to show demand elements
4296  updateViewNet();
4297  // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4298  if (sel == FXSEL(SEL_COMMAND, MID_GNE_DATAVIEWOPTIONS_SHOWDEMANDELEMENTS)) {
4300  }
4301  return 1;
4302 }
4303 
4304 
4305 long
4306 GNEViewNet::onCmdToggleTAZRelDrawing(FXObject*, FXSelector sel, void*) {
4307  // Toggle menuCheckShowDemandElements
4310  } else {
4312  }
4314  // update view to show demand elements
4315  updateViewNet();
4316  // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4317  if (sel == FXSEL(SEL_COMMAND, MID_GNE_DATAVIEWOPTIONS_TAZRELDRAWING)) {
4319  }
4320  return 1;
4321 }
4322 
4323 
4324 long
4325 GNEViewNet::onCmdToggleTAZDrawFill(FXObject*, FXSelector sel, void*) {
4326  // Toggle menuCheckShowDemandElements
4329  } else {
4331  }
4333  // update view to show demand elements
4334  updateViewNet();
4335  // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4336  if (sel == FXSEL(SEL_COMMAND, MID_GNE_DATAVIEWOPTIONS_TAZDRAWFILL)) {
4338  }
4339  return 1;
4340 }
4341 
4342 
4343 long
4344 GNEViewNet::onCmdToggleTAZRelOnlyFrom(FXObject*, FXSelector sel, void*) {
4345  // Toggle menuCheckShowDemandElements
4348  } else {
4350  }
4352  // update view to show demand elements
4353  updateViewNet();
4354  // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4355  if (sel == FXSEL(SEL_COMMAND, MID_GNE_DATAVIEWOPTIONS_TAZRELONLYFROM)) {
4357  }
4358  return 1;
4359 }
4360 
4361 
4362 long
4363 GNEViewNet::onCmdToggleTAZRelOnlyTo(FXObject*, FXSelector sel, void*) {
4364  // Toggle menuCheckShowDemandElements
4367  } else {
4369  }
4371  // update view to show demand elements
4372  updateViewNet();
4373  // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4374  if (sel == FXSEL(SEL_COMMAND, MID_GNE_DATAVIEWOPTIONS_TAZRELONLYTO)) {
4376  }
4377  return 1;
4378 }
4379 
4380 
4381 long
4382 GNEViewNet::onCmdIntervalBarGenericDataType(FXObject*, FXSelector, void*) {
4384  return 1;
4385 }
4386 
4387 
4388 long
4389 GNEViewNet::onCmdIntervalBarDataSet(FXObject*, FXSelector, void*) {
4391  return 1;
4392 }
4393 
4394 
4395 long
4396 GNEViewNet::onCmdIntervalBarLimit(FXObject*, FXSelector, void*) {
4398  return 1;
4399 }
4400 
4401 
4402 long
4403 GNEViewNet::onCmdIntervalBarSetBegin(FXObject*, FXSelector, void*) {
4405  return 1;
4406 }
4407 
4408 
4409 long
4410 GNEViewNet::onCmdIntervalBarSetEnd(FXObject*, FXSelector, void*) {
4412  return 1;
4413 }
4414 
4415 
4416 long
4417 GNEViewNet::onCmdIntervalBarSetParameter(FXObject*, FXSelector, void*) {
4419  return 1;
4420 }
4421 
4422 
4423 long
4424 GNEViewNet::onCmdAddSelected(FXObject*, FXSelector, void*) {
4425  // only select if AC under cursor isn't previously selected
4427  if (AC && !AC->isAttributeCarrierSelected()) {
4428  AC->selectAttributeCarrier();
4429  }
4430  return 1;
4431 }
4432 
4433 
4434 long
4435 GNEViewNet::onCmdRemoveSelected(FXObject*, FXSelector, void*) {
4436  // only unselect if AC under cursor isn't previously selected
4438  if (AC && AC->isAttributeCarrierSelected()) {
4440  }
4441  return 1;
4442 }
4443 
4444 
4445 long
4446 GNEViewNet::onCmdAddEdgeSelected(FXObject*, FXSelector, void*) {
4447  // only select if edge under cursor isn't previously selected
4448  auto edge = myViewObjectsSelector.getEdgeFront();
4449  if (edge && !edge->isAttributeCarrierSelected()) {
4450  edge->selectAttributeCarrier();
4451  }
4452  return 1;
4453 }
4454 
4455 
4456 long
4457 GNEViewNet::onCmdRemoveEdgeSelected(FXObject*, FXSelector, void*) {
4458  // only unselect if edge under cursor isn't previously selected
4459  auto edge = myViewObjectsSelector.getEdgeFront();
4460  if (edge && edge->isAttributeCarrierSelected()) {
4461  edge->unselectAttributeCarrier();
4462  }
4463  return 1;
4464 }
4465 
4466 
4467 long
4468 GNEViewNet::onCmdSetNeteditView(FXObject*, FXSelector sel, void*) {
4469  myEditModes.setView(FXSELID(sel));
4470  update();
4471  return 1;
4472 }
4473 
4474 // ===========================================================================
4475 // private
4476 // ===========================================================================
4477 
4478 void
4480  // build supermode buttons
4482 
4483  // build save elements buttons
4485 
4486  // build time switch buttons
4488 
4489  // build menu checks for Common checkable buttons
4491 
4492  // build menu checks for Network checkable buttons
4494 
4495  // build menu checks for Demand checkable buttons
4497 
4498  // build menu checks of view options Data
4500 
4501  // Create Vertical separator
4503  // XXX for some reason the vertical groove is not visible. adding more spacing to emphasize the separation
4506 
4507  // build menu checks of view options Network
4509 
4510  // build menu checks of view options Demand
4512 
4513  // build menu checks of view options Data
4515 
4516  // build interval bar
4518 }
4519 
4520 
4521 void
4523  // get menu checks
4525  // hide all checkbox of view options Network
4527  // hide all checkbox of view options Demand
4529  // hide all checkbox of view options Data
4531  // disable all common edit modes
4533  // disable all network edit modes
4535  // disable all network edit modes
4537  // hide interval bar
4539  // hide all frames
4541  // hide all menuchecks
4545  // In network mode, always show option "show grid", "draw spread vehicles" and "show demand elements"
4550  menuChecks.menuCheckToggleGrid->show();
4551  menuChecks.menuCheckToggleDrawJunctionShape->show();
4552  menuChecks.menuCheckDrawSpreadVehicles->show();
4553  menuChecks.menuCheckShowDemandElements->show();
4554  // show separator
4555  menuChecks.separator->show();
4556  // enable selected controls
4557  switch (myEditModes.networkEditMode) {
4558  // common modes
4564  // show view options
4569  // show menu checks
4570  menuChecks.menuCheckSelectEdges->show();
4571  menuChecks.menuCheckShowConnections->show();
4572  menuChecks.menuCheckShowAdditionalSubElements->show();
4573  menuChecks.menuCheckShowTAZElements->show();
4574  // update lock menu bar
4576  // show
4577  break;
4586  // show view options
4589  menuChecks.menuCheckShowAdditionalSubElements->show();
4590  menuChecks.menuCheckShowTAZElements->show();
4591  // show menu checks
4592  menuChecks.menuCheckSelectEdges->show();
4593  menuChecks.menuCheckShowConnections->show();
4594  break;
4600  // show view options
4606  // show menu checks
4607  menuChecks.menuCheckSelectEdges->show();
4608  menuChecks.menuCheckShowConnections->show();
4609  menuChecks.menuCheckExtendSelection->show();
4610  menuChecks.menuCheckShowAdditionalSubElements->show();
4611  menuChecks.menuCheckShowTAZElements->show();
4612  break;
4613  // specific modes
4619  // show view options
4622  // show menu checks
4623  menuChecks.menuCheckChainEdges->show();
4624  menuChecks.menuCheckAutoOppositeEdge->show();
4625  break;
4631  // show view options
4635  // show menu checks
4636  menuChecks.menuCheckWarnAboutMerge->show();
4637  menuChecks.menuCheckShowJunctionBubble->show();
4638  menuChecks.menuCheckMoveElevation->show();
4639  break;
4645  break;
4651  // show view options
4653  // show menu checks
4654  menuChecks.menuCheckChangeAllPhases->show();
4655  break;
4661  // show view options
4663  // show menu checks
4664  menuChecks.menuCheckShowAdditionalSubElements->show();
4665  break;
4671  break;
4677  break;
4683  break;
4689  break;
4695  break;
4701  break;
4702  default:
4703  break;
4704  }
4705  // update menuChecks shorcuts
4706  menuChecks.updateShortcuts();
4707  // update common Network buttons
4709  // Update Network buttons
4711  // recalc toolbar
4714  // force repaint because different modes draw different things
4715  onPaint(nullptr, 0, nullptr);
4716  // finally update view
4717  updateViewNet();
4718 }
4719 
4720 
4721 void
4723  // get menu checks
4725  // hide all checkbox of view options Network
4727  // hide all checkbox of view options Demand
4729  // hide all checkbox of view options Data
4731  // disable all common edit modes
4733  // disable all Demand edit modes
4735  // disable all network edit modes
4737  // hide interval bar
4739  // hide all frames
4741  // hide all menuchecks
4745  // always show "hide shapes", "show grid", "draw spread vehicles", "show overlapped routes" and show/lock persons and containers
4756  menuChecks.menuCheckToggleGrid->show();
4757  menuChecks.menuCheckToggleDrawJunctionShape->show();
4758  menuChecks.menuCheckDrawSpreadVehicles->show();
4759  menuChecks.menuCheckHideShapes->show();
4760  menuChecks.menuCheckShowAllTrips->show();
4761  menuChecks.menuCheckShowAllPersonPlans->show();
4762  menuChecks.menuCheckLockPerson->show();
4763  menuChecks.menuCheckShowAllContainerPlans->show();
4764  menuChecks.menuCheckLockContainer->show();
4765  menuChecks.menuCheckShowOverlappedRoutes->show();
4766  // show separator
4767  menuChecks.separator->show();
4768  // enable selected controls
4769  switch (myEditModes.demandEditMode) {
4770  // common modes
4775  // set checkable button
4777  // show view options
4779  // show menu checks
4780  menuChecks.menuCheckHideNonInspectedDemandElements->show();
4781  break;
4786  // set checkable button
4788  break;
4793  // set checkable button
4795  break;
4800  // set checkable button
4802  break;
4803  // specific modes
4808  // set checkable button
4810  break;
4815  // set checkable button
4817  break;
4822  // set checkable button
4824  break;
4829  // set checkable button
4831  break;
4836  // set checkable button
4838  break;
4843  // set checkable button
4845  break;
4850  // set checkable button
4852  break;
4857  // set checkable button
4859  break;
4864  // set checkable button
4866  break;
4871  // set checkable button
4873  break;
4874  default:
4875  break;
4876  }
4877  // update menuChecks shorcuts
4878  menuChecks.updateShortcuts();
4879  // update common Network buttons
4881  // Update Demand buttons
4883  // recalc toolbar
4886  // force repaint because different modes draw different things
4887  onPaint(nullptr, 0, nullptr);
4888  // finally update view
4889  updateViewNet();
4890 }
4891 
4892 
4893 void
4895  // get menu checks
4897  // hide all checkbox of view options Network
4899  // hide all checkbox of view options Demand
4901  // hide all checkbox of view options Data
4903  // disable all common edit modes
4905  // disable all Data edit modes
4907  // show interval bar
4909  // hide all frames
4911  // hide all menuchecks
4915  // In data mode, always show options for show elements
4920  menuChecks.menuCheckToggleDrawJunctionShape->show();
4921  menuChecks.menuCheckShowAdditionals->show();
4922  menuChecks.menuCheckShowShapes->show();
4923  menuChecks.menuCheckShowDemandElements->show();
4924  // show separator
4925  menuChecks.separator->show();
4926  // enable selected controls
4927  switch (myEditModes.dataEditMode) {
4928  // common modes
4933  // set checkable button
4935  // show view option
4940  // show menu check
4941  menuChecks.menuCheckToggleTAZRelDrawing->show();
4942  menuChecks.menuCheckToggleTAZDrawFill->show();
4943  menuChecks.menuCheckToggleTAZRelOnlyFrom->show();
4944  menuChecks.menuCheckToggleTAZRelOnlyTo->show();
4945  break;
4950  // set checkable button
4952  // show toggle TAZRel drawing view option
4956  // show toggle TAZRel drawing menu check
4957  menuChecks.menuCheckToggleTAZRelDrawing->show();
4958  menuChecks.menuCheckToggleTAZRelOnlyFrom->show();
4959  menuChecks.menuCheckToggleTAZRelOnlyTo->show();
4960  break;
4965  // set checkable button
4967  // show toggle TAZRel drawing view option
4971  // show toggle TAZRel drawing menu check
4972  menuChecks.menuCheckToggleTAZRelDrawing->show();
4973  menuChecks.menuCheckToggleTAZRelOnlyFrom->show();
4974  menuChecks.menuCheckToggleTAZRelOnlyTo->show();
4975  break;
4980  // set checkable button
4982  break;
4987  // set checkable button
4989  break;
4994  // set checkable button
4996  // show view option
5001  // show menu check
5002  menuChecks.menuCheckToggleTAZRelDrawing->show();
5003  menuChecks.menuCheckToggleTAZDrawFill->show();
5004  menuChecks.menuCheckToggleTAZRelOnlyFrom->show();
5005  menuChecks.menuCheckToggleTAZRelOnlyTo->show();
5006  break;
5011  // set checkable button
5013  break;
5014  default:
5015  break;
5016  }
5017  // update menuChecks shorcuts
5018  menuChecks.updateShortcuts();
5019  // update common Network buttons
5021  // Update Data buttons
5023  // recalc toolbar
5026  // force repaint because different modes draw different things
5027  onPaint(nullptr, 0, nullptr);
5028  // finally update view
5029  updateViewNet();
5030 }
5031 
5032 
5033 void
5034 GNEViewNet::deleteNetworkAttributeCarriers(const std::vector<GNEAttributeCarrier*> ACs) {
5035  // iterate over ACs and delete it
5036  for (const auto& AC : ACs) {
5037  if (AC->getTagProperty().getTag() == SUMO_TAG_JUNCTION) {
5038  // get junction (note: could be already removed if is a child, then hardfail=false)
5039  GNEJunction* junction = myNet->getAttributeCarriers()->retrieveJunction(AC->getID(), false);
5040  // if exist, remove it
5041  if (junction) {
5042  myNet->deleteJunction(junction, myUndoList);
5043  }
5044  } else if (AC->getTagProperty().getTag() == SUMO_TAG_CROSSING) {
5045  // get crossing (note: could be already removed if is a child, then hardfail=false)
5046  GNECrossing* crossing = myNet->getAttributeCarriers()->retrieveCrossing(AC->getGUIGlObject(), false);
5047  // if exist, remove it
5048  if (crossing) {
5049  myNet->deleteCrossing(crossing, myUndoList);
5050  }
5051  } else if (AC->getTagProperty().getTag() == SUMO_TAG_EDGE) {
5052  // get edge (note: could be already removed if is a child, then hardfail=false)
5053  GNEEdge* edge = myNet->getAttributeCarriers()->retrieveEdge(AC->getID(), false);
5054  // if exist, remove it
5055  if (edge) {
5056  myNet->deleteEdge(edge, myUndoList, false);
5057  }
5058  } else if (AC->getTagProperty().getTag() == SUMO_TAG_LANE) {
5059  // get lane (note: could be already removed if is a child, then hardfail=false)
5060  GNELane* lane = myNet->getAttributeCarriers()->retrieveLane(AC->getGUIGlObject(), false);
5061  // if exist, remove it
5062  if (lane) {
5063  myNet->deleteLane(lane, myUndoList, false);
5064  }
5065  } else if (AC->getTagProperty().getTag() == SUMO_TAG_CONNECTION) {
5066  // get connection (note: could be already removed if is a child, then hardfail=false)
5067  GNEConnection* connection = myNet->getAttributeCarriers()->retrieveConnection(AC->getGUIGlObject(), false);
5068  // if exist, remove it
5069  if (connection) {
5070  myNet->deleteConnection(connection, myUndoList);
5071  }
5072  } else if (AC->getTagProperty().isAdditionalElement()) {
5073  // get additional Element (note: could be already removed if is a child, then hardfail=false)
5074  GNEAdditional* additionalElement = myNet->getAttributeCarriers()->retrieveAdditional(AC->getGUIGlObject(), false);
5075  // if exist, remove it
5076  if (additionalElement) {
5077  myNet->deleteAdditional(additionalElement, myUndoList);
5078  }
5079  }
5080  }
5081 }
5082 
5083 
5084 void
5085 GNEViewNet::deleteDemandAttributeCarriers(const std::vector<GNEAttributeCarrier*> ACs) {
5086  // iterate over ACs and delete it
5087  for (const auto& AC : ACs) {
5088  // get demand Element (note: could be already removed if is a child, then hardfail=false)
5089  GNEDemandElement* demandElement = myNet->getAttributeCarriers()->retrieveDemandElement(AC->getGUIGlObject(), false);
5090  // if exist, remove it
5091  if (demandElement) {
5092  myNet->deleteDemandElement(demandElement, myUndoList);
5093  }
5094  }
5095 }
5096 
5097 
5098 void
5099 GNEViewNet::deleteDataAttributeCarriers(const std::vector<GNEAttributeCarrier*> ACs) {
5100  // iterate over ACs and delete it
5101  for (const auto& AC : ACs) {
5102  if (AC->getTagProperty().getTag() == SUMO_TAG_DATASET) {
5103  // get data set (note: could be already removed if is a child, then hardfail=false)
5104  GNEDataSet* dataSet = myNet->getAttributeCarriers()->retrieveDataSet(AC->getID(), false);
5105  // if exist, remove it
5106  if (dataSet) {
5107  myNet->deleteDataSet(dataSet, myUndoList);
5108  }
5109  } else if (AC->getTagProperty().getTag() == SUMO_TAG_DATAINTERVAL) {
5110  // get data interval (note: could be already removed if is a child, then hardfail=false)
5111  GNEDataInterval* dataInterval = myNet->getAttributeCarriers()->retrieveDataInterval(AC, false);
5112  // if exist, remove it
5113  if (dataInterval) {
5114  myNet->deleteDataInterval(dataInterval, myUndoList);
5115  }
5116  } else {
5117  // get generic data (note: could be already removed if is a child, then hardfail=false)
5118  GNEGenericData* genericData = myNet->getAttributeCarriers()->retrieveGenericData(AC->getGUIGlObject(), false);
5119  // if exist, remove it
5120  if (genericData) {
5121  myNet->deleteGenericData(genericData, myUndoList);
5122  }
5123  }
5124  }
5125 }
5126 
5127 
5128 void
5131  switch (myEditModes.networkEditMode) {
5133  myViewParent->getInspectorFrame()->update();
5134  break;
5135  default:
5136  break;
5137  }
5138  }
5140  switch (myEditModes.demandEditMode) {
5142  myViewParent->getInspectorFrame()->update();
5143  break;
5146  break;
5149  break;
5152  break;
5155  break;
5158  break;
5161  break;
5164  break;
5167  break;
5170  break;
5171  default:
5172  break;
5173  }
5174  }
5176  switch (myEditModes.dataEditMode) {
5178  myViewParent->getInspectorFrame()->update();
5179  break;
5180  default:
5181  break;
5182  }
5183  // update data interval
5185  }
5186  // update view
5187  updateViewNet();
5188 }
5189 
5190 // ---------------------------------------------------------------------------
5191 // Private methods
5192 // ---------------------------------------------------------------------------
5193 
5194 void
5196  PositionVector temporalShape;
5197  bool deleteLastCreatedPoint = false;
5198  // obtain temporal shape and delete last created point flag
5204  deleteLastCreatedPoint = myViewParent->getTAZFrame()->getDrawingShapeModule()->getDeleteLastCreatedPoint();
5205  }
5206  // check if we're in drawing mode
5207  if (temporalShape.size() > 0) {
5208  // draw blue line with the current drawed shape
5210  glLineWidth(2);
5211  glTranslated(0, 0, GLO_TEMPORALSHAPE);
5213  GLHelper::drawLine(temporalShape);
5215  // draw red line from the last point of shape to the current mouse position
5217  glLineWidth(2);
5218  glTranslated(0, 0, GLO_TEMPORALSHAPE);
5219  // draw last line depending if shift key (delete last created point) is pressed
5220  if (deleteLastCreatedPoint) {
5222  } else {
5224  }
5227  }
5228 }
5229 
5230 
5231 void
5233  // first check if we're in correct mode
5238  // get mouse position
5239  const Position mousePosition = snapToActiveGrid(getPositionInformation());
5240  // get junction exaggeration
5241  const double junctionExaggeration = myVisualizationSettings->junctionSize.getExaggeration(*myVisualizationSettings, nullptr, 4);
5242  // get bubble color
5244  // change alpha
5245  bubbleColor.setAlpha(200);
5246  // push layer matrix
5248  // translate to temporal shape layer
5249  glTranslated(0, 0, GLO_TEMPORALSHAPE);
5250  // push junction matrix
5252  // move matrix junction center
5253  glTranslated(mousePosition.x(), mousePosition.y(), 0.1);
5254  // set color
5255  GLHelper::setColor(bubbleColor);
5256  // draw outline circle
5257  const double circleWidth = myVisualizationSettings->neteditSizeSettings.junctionBubbleRadius * junctionExaggeration;
5258  GLHelper::drawOutlineCircle(circleWidth, circleWidth * 0.75, 32);
5259  // pop junction matrix
5261  // draw temporal edge
5263  // set temporal edge color
5264  RGBColor temporalEdgeColor = RGBColor::BLACK;
5265  temporalEdgeColor.setAlpha(200);
5266  // declare temporal edge geometry
5267  GUIGeometry temporalEdgeGeometry;
5268  // calculate geometry between source junction and mouse position
5269  PositionVector temporalEdge = {mousePosition, myViewParent->getCreateEdgeFrame()->getJunctionSource()->getPositionInView()};
5270  // move temporal edge 2 side
5271  temporalEdge.move2side(-1);
5272  // update geometry
5273  temporalEdgeGeometry.updateGeometry(temporalEdge);
5274  // push temporal edge matrix
5276  // set color
5277  GLHelper::setColor(temporalEdgeColor);
5278  // draw temporal edge
5280  // check if we have to draw opposite edge
5282  // move temporal edge to opposite edge
5283  temporalEdge.move2side(2);
5284  // update geometry
5285  temporalEdgeGeometry.updateGeometry(temporalEdge);
5286  // draw temporal edge
5288  }
5289  // pop temporal edge matrix
5291  }
5292  // pop layer matrix
5294  }
5295 }
5296 
5297 
5298 void
5300  // first check if we're in correct mode
5305  (gViewObjectsHandler.markedEdge != nullptr)) {
5306  // calculate split position
5307  const auto lane = gViewObjectsHandler.markedEdge->getLanes().back();
5308  auto shape = lane->getLaneShape();
5309  // move shape to side
5310  shape.move2side(lane->getDrawingConstants()->getDrawingWidth() * -1);
5311  const auto offset = shape.nearest_offset_to_point2D(snapToActiveGrid(getPositionInformation()));
5312  const auto splitPosition = shape.positionAtOffset2D(offset);
5313  // get junction exaggeration
5314  const double junctionExaggeration = myVisualizationSettings->junctionSize.getExaggeration(*myVisualizationSettings, nullptr, 4);
5315  // get bubble color
5317  // push layer matrix
5319  // translate to temporal shape layer
5320  glTranslated(0, 0, GLO_TEMPORALSHAPE);
5321  // push junction matrix
5323  // move matrix junction center
5324  glTranslated(splitPosition.x(), splitPosition.y(), 0.1);
5325  // set color
5326  GLHelper::setColor(bubbleColor);
5327  // draw outline circle
5328  const double circleWidth = myVisualizationSettings->neteditSizeSettings.junctionBubbleRadius * junctionExaggeration;
5329  GLHelper::drawOutlineCircle(circleWidth, circleWidth * 0.75, 32);
5330  // draw filled circle
5331  GLHelper::drawFilledCircle(0.5, 32);
5332  // pop junction matrix
5334  // pop layer matrix
5336  }
5337 }
5338 
5339 
5340 void
5342  // check conditions
5343  if ((myCurrentObjectsDialog.size() > 0) && (myCurrentObjectsDialog.front()->getType() == GLO_JUNCTION) && myDrawPreviewRoundabout) {
5344  // get junction
5345  const auto junction = myNet->getAttributeCarriers()->retrieveJunction(myCurrentObjectsDialog.front()->getMicrosimID());
5346  // push layer matrix
5348  // translate to temporal shape layer
5349  glTranslated(0, 0, GLO_TEMPORALSHAPE);
5350  // push junction matrix
5352  // move matrix junction center
5353  glTranslated(junction->getNBNode()->getPosition().x(), junction->getNBNode()->getPosition().y(), 0.1);
5354  // set color
5356  // draw outline circle
5357  const double circleWidth = (junction->getNBNode()->getRadius() < 0) ? 4.0 : junction->getNBNode()->getRadius();
5358  GLHelper::drawOutlineCircle(circleWidth * 1.30, circleWidth, 32);
5359  // pop junction matrix
5361  // pop layer matrix
5363  }
5364 }
5365 
5366 
5367 void
5369  // check conditions
5371  // get junction
5372  const auto junctionPos = myViewParent->getTLSEditorFrame()->getTLSJunction()->getCurrentJunction()->getNBNode()->getPosition();
5373  // push layer matrix
5375  // translate to TLLogic
5376  glTranslated(0, 0, GLO_TEMPORALSHAPE);
5377  // iterate over all E1 detectors
5378  for (const auto& E1ID : myViewParent->getTLSEditorFrame()->getTLSAttributes()->getE1Detectors()) {
5379  // first check if E1 exists
5380  const auto E1 = myNet->getAttributeCarriers()->retrieveAdditional(SUMO_TAG_INDUCTION_LOOP, E1ID.second, false);
5381  if (E1) {
5382  // push line matrix
5384  // draw line between junction and E1
5385  GUIGeometry::drawChildLine(*myVisualizationSettings, junctionPos, E1->getPositionInView(),
5387  // pop line matrix
5389  }
5390  }
5391  // pop layer matrix
5393  }
5394 }
5395 
5396 
5397 void
5399  // check conditions
5401  // get junction
5402  const auto junctionPos = myViewParent->getTLSEditorFrame()->getTLSJunction()->getCurrentJunction()->getNBNode()->getPosition();
5403  // push layer matrix
5405  // translate to TLLogic
5406  glTranslated(0, 0, GLO_TEMPORALSHAPE);
5407  // iterate over all Junction detectors
5408  for (const auto& selectedJunctionID : myViewParent->getTLSEditorFrame()->getTLSJunction()->getSelectedJunctionIDs()) {
5409  // get junction
5410  const auto selectedJunction = myNet->getAttributeCarriers()->retrieveJunction(selectedJunctionID);
5411  // push line matrix
5413  // draw line between junction and Junction
5414  GUIGeometry::drawChildLine(*myVisualizationSettings, junctionPos, selectedJunction->getPositionInView(),
5416  // pop line matrix
5418  }
5419  // pop layer matrix
5421  }
5422 }
5423 
5424 
5425 void
5429  }
5430 }
5431 
5432 
5433 void
5436  // get mouse position
5437  const Position mousePosition = snapToActiveGrid(getPositionInformation());
5438  // push layer matrix
5440  // translate to test layer, but under magenta square
5441  glTranslated(mousePosition.x(), mousePosition.y(), GLO_TESTELEMENT - 1);
5442  // set color
5444  // draw circle
5446  // pop layer matrix
5448  }
5449 }
5450 
5451 
5452 void
5454  // reset moving selected edge
5456  // decide what to do based on mode
5457  switch (myEditModes.networkEditMode) {
5459  // first swap lane to edges if mySelectEdges is enabled and shift key isn't pressed
5460  if (checkSelectEdges()) {
5462  } else {
5464  }
5465  // now filter locked elements
5467  // check if we're selecting a new parent for the current inspected element
5470  } else {
5471  // process left click in Inspector Frame
5473  }
5474  // process click
5475  processClick(eventData);
5476  break;
5477  }
5479  // first swap lane to edges if mySelectEdges is enabled and shift key isn't pressed
5480  if (checkSelectEdges()) {
5482  } else {
5484  }
5485  // now filter locked elements forcing excluding walkingAreas
5487  // continue depending of AC
5489  // now check if we want only delete geometry points
5491  // only remove geometry point
5494  // remove all selected attribute carriers
5497  }
5498  } else {
5499  // remove attribute carrier under cursor
5501  }
5502  } else {
5503  // process click
5504  processClick(eventData);
5505  }
5506  break;
5507  }
5509  // first swap lane to edges if mySelectEdges is enabled and shift key isn't pressed
5510  if (checkSelectEdges()) {
5512  } else {
5514  }
5515  // now filter locked elements
5517  // avoid to select if control key is pressed
5519  // check if a rect for selecting is being created
5521  // begin rectangle selection
5524  // process click
5525  processClick(eventData);
5526  }
5527  } else {
5528  // process click
5529  processClick(eventData);
5530  }
5531  break;
5533  // check what buttons are pressed
5535  // get edge under cursor
5537  if (edge) {
5538  // obtain reverse edge
5539  const auto oppositeEdges = edge->getOppositeEdges();
5540  // check if we're split one or both edges
5543  } else if (oppositeEdges.size() > 0) {
5544  myNet->splitEdgesBidi(edge, oppositeEdges.front(), edge->getSplitPos(getPositionInformation()), myUndoList);
5545  } else {
5547  }
5548  }
5550  // process left click in create edge frame Frame
5555  }
5556  // process click
5557  processClick(eventData);
5558  break;
5559  }
5561  // editing lane shapes in move mode isn't finished, then always filter lanes
5563  // filter locked elements
5565  // check if we're editing a shape
5567  // check if we're removing a geometry point
5569  // remove geometry point
5572  }
5574  // process click if there isn't movable elements (to move camera using drag an drop)
5575  processClick(eventData);
5576  }
5577  } else {
5578  // get AC under cursor
5580  // check that AC is an network or additional element
5581  if (AC && (AC->getTagProperty().isNetworkElement() || AC->getTagProperty().isAdditionalElement())) {
5582  // check if we're moving a set of selected items
5583  if (AC->isAttributeCarrierSelected()) {
5584  // move selected ACs
5586  // update view
5587  updateViewNet();
5589  // process click if there isn't movable elements (to move camera using drag an drop)
5590  processClick(eventData);
5591  }
5592  } else {
5593  // process click if there isn't movable elements (to move camera using drag an drop)
5594  processClick(eventData);
5595  }
5596  }
5597  break;
5598  }
5600  // check if we're clicked over a non locked lane
5602  // Handle laneclick (shift key may pass connections, Control key allow conflicts)
5604  updateViewNet();
5605  }
5606  // process click
5607  processClick(eventData);
5608  break;
5609  }
5612  // edit TLS in TLSEditor frame
5614  updateViewNet();
5615  }
5616  // process click
5617  processClick(eventData);
5618  break;
5619  }
5621  // avoid create additionals if control key is pressed
5624  WRITE_WARNING(TL("Shift + click to create two additionals in the same position"));
5626  // save last mouse position
5628  // update view to show the new additional
5629  updateViewNet();
5630  }
5631  }
5632  // process click
5633  processClick(eventData);
5634  break;
5635  }
5637  // call function addCrossing from crossing frame
5639  // process click
5640  processClick(eventData);
5641  break;
5642  }
5644  // avoid create TAZs if control key is pressed
5646  // check if we want to create a rect for selecting edges
5648  // begin rectangle selection
5650  } else {
5651  // check if process click was successfully
5653  // view net must be always update
5654  updateViewNet();
5655  }
5656  // process click
5657  processClick(eventData);
5658  }
5659  } else {
5660  // process click
5661  processClick(eventData);
5662  }
5663  break;
5664  }
5666  // avoid create shapes if control key is pressed
5669  // declare processClick flag
5670  bool updateTemporalShape = false;
5671  // process click
5673  // view net must be always update
5674  updateViewNet();
5675  // process click depending of the result of "process click"
5676  if (!updateTemporalShape) {
5677  // process click
5678  processClick(eventData);
5679  }
5680  }
5681  } else {
5682  // process click
5683  processClick(eventData);
5684  }
5685  break;
5686  }
5689  // shift key may pass connections, Control key allow conflicts.
5691  updateViewNet();
5692  }
5693  // process click
5694  processClick(eventData);
5695  break;
5696  }
5698  // avoid create wires if control key is pressed
5701  // update view to show the new wire
5702  updateViewNet();
5703  }
5704  // process click
5705  processClick(eventData);
5706  break;
5707  }
5709  // process click
5710  processClick(eventData);
5711  break;
5712  }
5713  default: {
5714  // process click
5715  processClick(eventData);
5716  }
5717  }
5718 }
5719 
5720 
5721 void
5723  // check moved items
5727  // check if we're creating a rectangle selection or we want only to select a lane
5729  // check if we're selecting all type of elements o we only want a set of edges for TAZ
5733  // process edge selection
5735  }
5737  // check if there is a lane in objects under cursor
5739  // if we clicked over an lane with shift key pressed, select or unselect it
5742  } else {
5744  }
5745  }
5746  }
5747  // finish selection
5749  } else {
5750  // finish moving of single elements
5752  }
5753 }
5754 
5755 
5756 void
5757 GNEViewNet::processMoveMouseNetwork(const bool mouseLeftButtonPressed) {
5758  // change "delete last created point" depending if during movement shift key is pressed
5763  }
5764  // check what type of additional is moved
5766  // move entire selection
5767  myMoveMultipleElements.moveSelection(mouseLeftButtonPressed);
5769  // update selection corner of selecting area
5771  } else {
5772  // move single elements
5773  myMoveSingleElement.moveSingleElement(mouseLeftButtonPressed);
5774  }
5775 }
5776 
5777 
5778 void
5780  // get front AC
5782  // decide what to do based on mode
5783  switch (myEditModes.demandEditMode) {
5785  // filter locked elements
5787  // process left click in Inspector Frame
5789  // process click
5790  processClick(eventData);
5791  break;
5792  }
5794  // check conditions
5795  if (AC) {
5796  // check if we are deleting a selection or an single attribute carrier
5797  if (AC->isAttributeCarrierSelected()) {
5798  if (!AC->getGUIGlObject()->isGLObjectLocked()) {
5800  }
5801  } else {
5803  }
5804  } else {
5805  // process click
5806  processClick(eventData);
5807  }
5808  break;
5809  }
5811  // filter locked elements
5813  // avoid to select if control key is pressed
5815  // check if a rect for selecting is being created
5817  // begin rectangle selection
5820  // process click
5821  processClick(eventData);
5822  }
5823  } else {
5824  // process click
5825  processClick(eventData);
5826  }
5827  break;
5829  // check that AC under cursor is a demand element
5830  if (AC && !myLockManager.isObjectLocked(AC->getGUIGlObject()->getType(), AC->isAttributeCarrierSelected()) &&
5831  AC->getTagProperty().isDemandElement()) {
5832  // check if we're moving a set of selected items
5833  if (AC->isAttributeCarrierSelected()) {
5834  // move selected ACs
5836  // update view
5837  updateViewNet();
5839  // process click if there isn't movable elements (to move camera using drag an drop)
5840  processClick(eventData);
5841  }
5842  } else {
5843  // process click if there isn't movable elements (to move camera using drag an drop)
5844  processClick(eventData);
5845  }
5846  break;
5847  }
5849  // check if we clicked over a lane
5851  // Handle edge click
5853  }
5854  // process click
5855  processClick(eventData);
5856  break;
5857  }
5859  // Handle click
5861  // process click
5862  processClick(eventData);
5863  break;
5864  }
5866  // Handle click
5868  WRITE_WARNING(TL("Control + click to create two stop in the same position"));
5870  // save last mouse position
5872  // update view to show the new additional
5873  updateViewNet();
5874  }
5875  // process click
5876  processClick(eventData);
5877  break;
5878  }
5880  // Handle click
5882  // process click
5883  processClick(eventData);
5884  break;
5885  }
5887  // Handle person plan click
5889  // process click
5890  processClick(eventData);
5891  break;
5892  }
5894  // Handle click
5896  // process click
5897  processClick(eventData);
5898  break;
5899  }
5901  // Handle container plan click
5903  // process click
5904  processClick(eventData);
5905  break;
5906  }
5907  default: {
5908  // process click
5909  processClick(eventData);
5910  }
5911  }
5912 }
5913 
5914 
5915 void
5917  // check moved items
5921  // check if we're creating a rectangle selection or we want only to select a lane
5924  }
5925  // finish selection
5927  } else {
5928  // finish moving of single elements
5930  }
5931 }
5932 
5933 
5934 void
5935 GNEViewNet::processMoveMouseDemand(const bool mouseLeftButtonPressed) {
5937  // update selection corner of selecting area
5939  } else {
5940  // move single elements
5941  myMoveSingleElement.moveSingleElement(mouseLeftButtonPressed);
5942  }
5943 }
5944 
5945 
5946 void
5948  // get AC
5950  // decide what to do based on mode
5951  switch (myEditModes.dataEditMode) {
5953  // filter locked elements
5955  // process left click in Inspector Frame
5956  if (AC && AC->getTagProperty().getTag() == SUMO_TAG_TAZ) {
5958  } else {
5960  }
5961  // process click
5962  processClick(eventData);
5963  break;
5964  }
5966  // check conditions
5967  if (AC) {
5968  // check if we are deleting a selection or an single attribute carrier
5969  if (AC->isAttributeCarrierSelected()) {
5970  if (!AC->getGUIGlObject()->isGLObjectLocked()) {
5972  }
5973  } else {
5975  }
5976  } else {
5977  // process click
5978  processClick(eventData);
5979  }
5980  break;
5981  }
5983  // filter locked elements
5985  // avoid to select if control key is pressed
5987  // check if a rect for selecting is being created
5989  // begin rectangle selection
5992  // process click
5993  processClick(eventData);
5994  }
5995  } else {
5996  // process click
5997  processClick(eventData);
5998  }
5999  break;
6001  // avoid create edgeData if control key is pressed
6004  // update view to show the new edge data
6005  updateViewNet();
6006  }
6007  }
6008  // process click
6009  processClick(eventData);
6010  break;
6012  // avoid create edgeData if control key is pressed
6015  // update view to show the new edge data
6016  updateViewNet();
6017  }
6018  }
6019  // process click
6020  processClick(eventData);
6021  break;
6023  // avoid create TAZData if control key is pressed
6026  // update view to show the new TAZ data
6027  updateViewNet();
6028  }
6029  }
6030  // process click
6031  processClick(eventData);
6032  break;
6034  // avoid create TAZData if control key is pressed
6036  //
6037  }
6038  // process click
6039  processClick(eventData);
6040  break;
6041  default: {
6042  // process click
6043  processClick(eventData);
6044  }
6045  }
6046 }
6047 
6048 
6049 void
6051  // check moved items
6055  // check if we're creating a rectangle selection or we want only to select a lane
6058  }
6059  // finish selection
6061  } else {
6062  // finish moving of single elements
6064  }
6065 }
6066 
6067 
6068 void
6069 GNEViewNet::processMoveMouseData(const bool mouseLeftButtonPressed) {
6071  // update selection corner of selecting area
6073  } else {
6074  // move single elements
6075  myMoveSingleElement.moveSingleElement(mouseLeftButtonPressed);
6076  }
6077 }
6078 
6079 
6080 /****************************************************************************/
FXDEFMAP(GNEViewNet) GNEViewNetMap[]
@ DATA_MEANDATA
mode for create meanData elements
@ DATA_EDGERELDATA
mode for create edgeRelData elements
@ DATA_SELECT
mode for selecting data elements
@ DATA_TAZRELDATA
mode for create TAZRelData elements
@ DATA_INSPECT
mode for inspecting data elements
@ DATA_EDGEDATA
mode for create edgeData elements
@ DATA_DELETE
mode for deleting data elements
Supermode
@brie enum for supermodes
@ NETWORK
Network mode (Edges, junctions, etc..)
@ DATA
Data mode (edgeData, LaneData etc..)
@ DEMAND
Demand mode (Routes, Vehicles etc..)
@ NETWORK_SHAPE
Mode for editing Polygons.
@ NETWORK_DELETE
mode for deleting network elements
@ NETWORK_MOVE
mode for moving network elements
@ NETWORK_WIRE
Mode for editing wires.
@ NETWORK_ADDITIONAL
Mode for editing additionals.
@ NETWORK_TAZ
Mode for editing TAZ.
@ NETWORK_CREATE_EDGE
mode for creating new edges
@ NETWORK_TLS
mode for editing tls
@ NETWORK_CROSSING
Mode for editing crossing.
@ NETWORK_SELECT
mode for selecting network elements
@ NETWORK_INSPECT
mode for inspecting network elements
@ NETWORK_PROHIBITION
Mode for editing connection prohibitions.
@ NETWORK_CONNECT
mode for connecting lanes
@ NETWORK_DECAL
Mode for editing decals.
@ DEMAND_PERSONPLAN
Mode for editing person plan.
@ DEMAND_INSPECT
mode for inspecting demand elements
@ DEMAND_CONTAINER
Mode for editing container.
@ DEMAND_DELETE
mode for deleting demand elements
@ DEMAND_ROUTEDISTRIBUTION
Mode for editing route distributions.
@ DEMAND_PERSON
Mode for editing person.
@ DEMAND_TYPEDISTRIBUTION
Mode for editing type distributions.
@ DEMAND_SELECT
mode for selecting demand elements
@ DEMAND_ROUTE
Mode for editing routes.
@ DEMAND_VEHICLE
Mode for editing vehicles.
@ DEMAND_MOVE
mode for moving demand elements
@ DEMAND_STOP
Mode for editing stops.
@ DEMAND_CONTAINERPLAN
Mode for editing container plan.
@ DEMAND_TYPE
Mode for editing types.
@ MID_GNE_NETWORKVIEWOPTIONS_AUTOOPPOSITEEDGES
automatically create opposite edge
Definition: GUIAppEnum.h:839
@ MID_GNE_ADDSELECT_EDGE
Add edge to selected items - menu entry.
Definition: GUIAppEnum.h:841
@ MID_HOTKEY_F3_SUPERMODE_DEMAND
select demand supermode in netedit
Definition: GUIAppEnum.h:234
@ MID_GNE_LANE_EDIT_SHAPE
edit lane shape
Definition: GUIAppEnum.h:1320
@ MID_GNE_DEMANDVIEWOPTIONS_SHOWALLPERSONPLANS
show all person plans
Definition: GUIAppEnum.h:871
@ MID_HOTKEY_SHIFT_S_LOCATESTOP
Locate stop - button.
Definition: GUIAppEnum.h:188
@ MID_GNE_LANE_TRANSFORM_BIKE
transform lane to bikelane
Definition: GUIAppEnum.h:1328
@ MID_GNE_DATAVIEWOPTIONS_TAZRELDRAWING
toggle TAZRel drawing
Definition: GUIAppEnum.h:895
@ MID_GNE_EDGE_REVERSE
reverse an edge
Definition: GUIAppEnum.h:1230
@ MID_GNE_JUNCTION_ADDTLS
Add TLS into junction.
Definition: GUIAppEnum.h:1268
@ MID_ADDSELECT
Add to selected items - menu entry.
Definition: GUIAppEnum.h:481
@ MID_HOTKEY_U_MODE_DECAL_TYPEDISTRIBUTION
hotkey for mode decal AND type distribution
Definition: GUIAppEnum.h:69
@ MID_GNE_LANE_ADD_BUS
add busLane
Definition: GUIAppEnum.h:1338
@ MID_GNE_NETWORKVIEWOPTIONS_DRAWSPREADVEHICLES
Draw vehicles in begin position or spread in lane.
Definition: GUIAppEnum.h:813
@ MID_GNE_JUNCTION_RESET_EDGE_ENDPOINTS
reset edge endpoints
Definition: GUIAppEnum.h:1262
@ MID_GNE_NETWORKVIEWOPTIONS_MOVEELEVATION
move elevation instead of x,y
Definition: GUIAppEnum.h:835
@ MID_GNE_NETWORKVIEWOPTIONS_HIDECONNECTIONS
hide connections
Definition: GUIAppEnum.h:821
@ MID_GNE_REMOVESELECT_EDGE
Remove edge from selected items - Menu Entry.
Definition: GUIAppEnum.h:843
@ MID_GNE_NETWORKVIEWOPTIONS_SHOWCONNECTIONS
show connections
Definition: GUIAppEnum.h:819
@ MID_GNE_INTERVALBAR_BEGIN
begin changed in InterbalBar
Definition: GUIAppEnum.h:915
@ MID_GNE_DATAVIEWOPTIONS_TAZRELONLYTO
toggle draw TAZRel only to
Definition: GUIAppEnum.h:901
@ MID_GNE_ADDREVERSE
add reverse element
Definition: GUIAppEnum.h:1386
@ MID_GNE_CONNECTION_SMOOTH_SHAPE
@ brief smooth connection shape
Definition: GUIAppEnum.h:1280
@ MID_GNE_DATAVIEWOPTIONS_TOGGLEDRAWJUNCTIONSHAPE
toggle draw junction shape
Definition: GUIAppEnum.h:887
@ MID_GNE_NETWORKVIEWOPTIONS_SHOWTAZELEMENTS
show TAZ elements
Definition: GUIAppEnum.h:825
@ MID_GNE_DEMANDVIEWOPTIONS_LOCKPERSON
lock person
Definition: GUIAppEnum.h:873
@ MID_HOTKEY_Z_MODE_TAZ_TAZREL
hotkey for mode editing TAZ and TAZRel
Definition: GUIAppEnum.h:75
@ MID_GNE_DEMANDVIEWOPTIONS_TOGGLEDRAWJUNCTIONSHAPE
toggle draw junction shape
Definition: GUIAppEnum.h:861
@ MID_GNE_JUNCTION_CLEAR_CONNECTIONS
clear junction's connections
Definition: GUIAppEnum.h:1248
@ MID_HOTKEY_A_MODE_STARTSIMULATION_ADDITIONALS_STOPS
hotkey for start simulation in SUMO and set editing mode additionals AND stops in netedit
Definition: GUIAppEnum.h:43
@ MID_GNE_JUNCTION_SELECT_ROUNDABOUT
select all roundabout nodes and edges of the current roundabout
Definition: GUIAppEnum.h:1264
@ MID_GNE_JUNCTION_RESET_SHAPE
reset junction shape
Definition: GUIAppEnum.h:1260
@ MID_GNE_NETWORKVIEWOPTIONS_ASKFORMERGE
ask before merging junctions
Definition: GUIAppEnum.h:831
@ MID_GNE_JUNCTION_RESET_CONNECTIONS
reset junction's connections
Definition: GUIAppEnum.h:1250
@ MID_GNE_DEMANDVIEWOPTIONS_SHOWGRID
show grid
Definition: GUIAppEnum.h:859
@ MID_GNE_JUNCTION_SPLIT
turn junction into multiple junctions
Definition: GUIAppEnum.h:1254
@ MID_GNE_EDGE_STRAIGHTEN_ELEVATION
interpolate z values linear between junctions
Definition: GUIAppEnum.h:1222
@ MID_HOTKEY_D_MODE_SINGLESIMULATIONSTEP_DELETE
hotkey for perform a single simulation step in SUMO and set delete mode in netedit
Definition: GUIAppEnum.h:49
@ MID_GNE_NETWORKVIEWOPTIONS_CHAINEDGES
create edges in chain mode
Definition: GUIAppEnum.h:837
@ MID_GNE_DATAVIEWOPTIONS_SHOWDEMANDELEMENTS
show demand elements
Definition: GUIAppEnum.h:893
@ MID_GNE_POLYGON_CLOSE
close opened polygon
Definition: GUIAppEnum.h:1294
@ MID_GNE_EDGE_SMOOTH
smooth geometry
Definition: GUIAppEnum.h:1220
@ MID_HOTKEY_C_MODE_CONNECT_CONTAINER
hotkey for mode connecting lanes AND container
Definition: GUIAppEnum.h:45
@ MID_HOTKEY_H_MODE_PROHIBITION_CONTAINERPLAN
hotkey for mode prohibition AND container plan
Definition: GUIAppEnum.h:53
@ MID_HOTKEY_SHIFT_O_LOCATEPOI
Locate poi - button.
Definition: GUIAppEnum.h:182
@ MID_HOTKEY_W_MODE_WIRE_ROUTEDISTRIBUTION
hotkey for mode editing overhead wires AND route distributions
Definition: GUIAppEnum.h:73
@ MID_HOTKEY_T_MODE_TLS_TYPE
hotkey for mode editing TLS AND Vehicle Types
Definition: GUIAppEnum.h:67
@ MID_GNE_LANE_RESET_CUSTOMSHAPE
reset custom shape
Definition: GUIAppEnum.h:1322
@ MID_GNE_EDGE_STRAIGHTEN
remove inner geometry
Definition: GUIAppEnum.h:1218
@ MID_GNE_DEMANDVIEWOPTIONS_HIDESHAPES
hide shapes
Definition: GUIAppEnum.h:867
@ MID_GNE_LANE_TRANSFORM_BUS
transform lane to busLane
Definition: GUIAppEnum.h:1330
@ MID_GNE_POLYGON_SET_FIRST_POINT
Set a vertex of polygon as first vertex.
Definition: GUIAppEnum.h:1298
@ MID_HOTKEY_SHIFT_A_LOCATEADDITIONAL
Locate additional structure - button.
Definition: GUIAppEnum.h:172
@ MID_GNE_LANE_DUPLICATE
duplicate a lane
Definition: GUIAppEnum.h:1318
@ MID_GNE_DATAVIEWOPTIONS_SHOWADDITIONALS
show additionals
Definition: GUIAppEnum.h:889
@ MID_HOTKEY_SHIFT_R_LOCATEROUTE
Locate route - button.
Definition: GUIAppEnum.h:186
@ MID_GNE_NETWORKVIEWOPTIONS_SHOWBUBBLES
show junctions as bubbles
Definition: GUIAppEnum.h:833
@ MID_GNE_LANE_ADD_GREENVERGE_FRONT
add greenVerge front of current lane
Definition: GUIAppEnum.h:1340
@ MID_GNE_INTERVALBAR_END
end changed in InterbalBar
Definition: GUIAppEnum.h:917
@ MID_HOTKEY_SHIFT_W_LOCATEWALKINGAREA
Locate edge - button.
Definition: GUIAppEnum.h:194
@ MID_GNE_NETWORKVIEWOPTIONS_EXTENDSELECTION
extend selection
Definition: GUIAppEnum.h:827
@ MID_GNE_LANE_REMOVE_GREENVERGE
remove greenVerge
Definition: GUIAppEnum.h:1350
@ MID_HOTKEY_S_MODE_STOPSIMULATION_SELECT
hotkey for stop simulation in SUMO and set select mode in netedit
Definition: GUIAppEnum.h:63
@ MID_GNE_EDGE_ADD_REVERSE_DISCONNECTED
add reverse edge disconnected (used for for spreadtype center)
Definition: GUIAppEnum.h:1234
@ MID_GNE_EDGE_SPLIT_BIDI
split an edge
Definition: GUIAppEnum.h:1228
@ MID_GNE_NETWORKVIEWOPTIONS_SHOWSUBADDITIONALS
show sub-additionals
Definition: GUIAppEnum.h:823
@ MID_GNE_JUNCTION_REPLACE
turn junction into geometry node
Definition: GUIAppEnum.h:1252
@ MID_HOTKEY_SHIFT_C_LOCATECONTAINER
Locate container - button.
Definition: GUIAppEnum.h:174
@ MID_GNE_DEMANDVIEWOPTIONS_SHOWALLCONTAINERPLANS
show all container plans
Definition: GUIAppEnum.h:875
@ MID_HOTKEY_SHIFT_V_LOCATEVEHICLE
Locate vehicle - button.
Definition: GUIAppEnum.h:192
@ MID_GNE_VIEW_DEFAULT
set default view
Definition: GUIAppEnum.h:779
@ MID_HOTKEY_F4_SUPERMODE_DATA
select data supermode in netedit
Definition: GUIAppEnum.h:236
@ MID_HOTKEY_SHIFT_L_LOCATEPOLY
Locate polygons - button.
Definition: GUIAppEnum.h:180
@ MID_GNE_LANE_REMOVE_BIKE
remove bikelane
Definition: GUIAppEnum.h:1346
@ MID_HOTKEY_SHIFT_E_LOCATEEDGE
Locate edge - button.
Definition: GUIAppEnum.h:176
@ MID_GNE_VIEW_JUPEDSIM
set juPedSim view
Definition: GUIAppEnum.h:781
@ MID_GNE_POI_TRANSFORM
Transform POI to POILane, and viceversa.
Definition: GUIAppEnum.h:1310
@ MID_GNE_LANE_RESET_OPPOSITELANE
reset opposite lane
Definition: GUIAppEnum.h:1324
@ MID_GNE_INTERVALBAR_PARAMETER
parameter changed in InterbalBar
Definition: GUIAppEnum.h:919
@ MID_HOTKEY_R_MODE_CROSSING_ROUTE_EDGERELDATA
hotkey for mode editing crossing, routes and edge rel datas
Definition: GUIAppEnum.h:65
@ MID_GNE_JUNCTION_CONVERT_ROUNDABOUT
convert junction to roundabout
Definition: GUIAppEnum.h:1266
@ MID_GNE_DATAVIEWOPTIONS_TAZDRAWFILL
toggle draw TAZ fill
Definition: GUIAppEnum.h:897
@ MID_REACHABILITY
show reachability from a given lane
Definition: GUIAppEnum.h:527
@ MID_HOTKEY_L_MODE_PERSONPLAN
hotkey for mode person plan
Definition: GUIAppEnum.h:57
@ MID_GNE_EDGE_RESET_LENGTH
reset custom lengths
Definition: GUIAppEnum.h:1236
@ MID_HOTKEY_V_MODE_VEHICLE
hotkey for mode create vehicles
Definition: GUIAppEnum.h:71
@ MID_HOTKEY_SHIFT_P_LOCATEPERSON
Locate person - button.
Definition: GUIAppEnum.h:184
@ MID_HOTKEY_I_MODE_INSPECT
hotkey for mode inspecting object attributes
Definition: GUIAppEnum.h:55
@ MID_GNE_LANE_REMOVE_BUS
remove busLane
Definition: GUIAppEnum.h:1348
@ MID_GNE_NETWORKVIEWOPTIONS_SHOWDEMANDELEMENTS
show demand elements
Definition: GUIAppEnum.h:815
@ MID_HOTKEY_SHIFT_J_LOCATEJUNCTION
Locate junction - button.
Definition: GUIAppEnum.h:178
@ MID_GNE_POLYGON_SELECT
select elements within polygon boundary
Definition: GUIAppEnum.h:1302
@ MID_GNE_JUNCTION_SPLIT_RECONNECT
turn junction into multiple junctions and reconnect them heuristically
Definition: GUIAppEnum.h:1256
@ MID_GNE_REVERSE
reverse current element
Definition: GUIAppEnum.h:1384
@ MID_OPEN_ADDITIONAL_DIALOG
open additional dialog (used in netedit)
Definition: GUIAppEnum.h:465
@ MID_GNE_WALKINGAREA_EDIT_SHAPE
edit crossing shape
Definition: GUIAppEnum.h:1284
@ MID_GNE_DEMANDVIEWOPTIONS_HIDENONINSPECTED
hide non-inspected demand element
Definition: GUIAppEnum.h:865
@ MID_GNE_JUNCTION_EDIT_SHAPE
edit junction shape
Definition: GUIAppEnum.h:1258
@ MID_GNE_LANE_REMOVE_SIDEWALK
remove sidewalk
Definition: GUIAppEnum.h:1344
@ MID_GNE_EDGE_RESET_ENDPOINT
reset default geometry endpoints
Definition: GUIAppEnum.h:1216
@ MID_GNE_INTERVALBAR_GENERICDATATYPE
generic data selected
Definition: GUIAppEnum.h:909
@ MID_GNE_LANE_ADD_GREENVERGE_BACK
add greenVerge back of current lane
Definition: GUIAppEnum.h:1342
@ MID_GNE_EDGE_SMOOTH_ELEVATION
smooth elevation with regard to adjoining edges
Definition: GUIAppEnum.h:1224
@ MID_GNE_NETWORKVIEWOPTIONS_CHANGEALLPHASES
change all phases
Definition: GUIAppEnum.h:829
@ MID_GNE_DATAVIEWOPTIONS_SHOWSHAPES
show shapes
Definition: GUIAppEnum.h:891
@ MID_HOTKEY_E_MODE_EDGE_EDGEDATA
hotkey for mode adding edges AND edgeDatas
Definition: GUIAppEnum.h:51
@ MID_GNE_DATAVIEWOPTIONS_TAZRELONLYFROM
toggle draw TAZRel only from
Definition: GUIAppEnum.h:899
@ MID_GNE_EDGE_ADD_REVERSE
add reverse edge
Definition: GUIAppEnum.h:1232
@ MID_GNE_EDGE_APPLYTEMPLATE
apply template
Definition: GUIAppEnum.h:1240
@ MID_GNE_EDGE_USEASTEMPLATE
use edge as tempalte
Definition: GUIAppEnum.h:1238
@ MID_GNE_NETWORKVIEWOPTIONS_TOGGLEDRAWJUNCTIONSHAPE
toggle draw junction shape
Definition: GUIAppEnum.h:811
@ MID_GNE_DEMANDVIEWOPTIONS_DRAWSPREADVEHICLES
Draw vehicles in begin position or spread in lane.
Definition: GUIAppEnum.h:863
@ MID_GNE_LANE_ADD_SIDEWALK
add sidewalk
Definition: GUIAppEnum.h:1334
@ MID_GNE_DEMANDVIEWOPTIONS_SHOWOVERLAPPEDROUTES
show overlapped routes
Definition: GUIAppEnum.h:879
@ MID_GNE_RESET_GEOMETRYPOINT
reset geometry point
Definition: GUIAppEnum.h:1021
@ MID_GNE_CONNECTION_EDIT_SHAPE
edit connection shape
Definition: GUIAppEnum.h:1278
@ MID_GNE_INTERVALBAR_DATASET
data set selected
Definition: GUIAppEnum.h:911
@ MID_HOTKEY_SHIFT_T_LOCATETLS
Locate TLS - button.
Definition: GUIAppEnum.h:190
@ MID_GNE_LANE_TRANSFORM_SIDEWALK
transform lane to sidewalk
Definition: GUIAppEnum.h:1326
@ MID_GNE_LANE_ADD_BIKE
add bikelane
Definition: GUIAppEnum.h:1336
@ MID_HOTKEY_M_MODE_MOVE_MEANDATA
hotkey for mode moving element AND mean data
Definition: GUIAppEnum.h:59
@ MID_HOTKEY_F2_SUPERMODE_NETWORK
select network supermode in netedit
Definition: GUIAppEnum.h:232
@ MID_GNE_DEMANDVIEWOPTIONS_LOCKCONTAINER
lock container
Definition: GUIAppEnum.h:877
@ MID_GNE_NETWORKVIEWOPTIONS_SELECTEDGES
select edges
Definition: GUIAppEnum.h:817
@ MID_GNE_EDGE_SPLIT
split an edge
Definition: GUIAppEnum.h:1226
@ MID_GNE_LANE_TRANSFORM_GREENVERGE
transform lane to greenVerge
Definition: GUIAppEnum.h:1332
@ MID_GNE_CUSTOM_GEOMETRYPOINT
set custom geometry point
Definition: GUIAppEnum.h:1019
@ MID_GNE_DEMANDVIEWOPTIONS_SHOWTRIPS
show all trips
Definition: GUIAppEnum.h:869
@ MID_GNE_NETWORKVIEWOPTIONS_TOGGLEGRID
show grid
Definition: GUIAppEnum.h:809
@ MID_GNE_INTERVALBAR_LIMITED
enable/disable show data elements by interval
Definition: GUIAppEnum.h:913
@ MID_GNE_EDGE_EDIT_ENDPOINT
change default geometry endpoints
Definition: GUIAppEnum.h:1214
@ MID_GNE_POLYGON_DELETE_GEOMETRY_POINT
delete geometry point
Definition: GUIAppEnum.h:1300
@ MID_HOTKEY_P_MODE_POLYGON_PERSON
hotkey for mode creating polygons
Definition: GUIAppEnum.h:61
@ MID_GNE_JUNCTION_ADDJOINTLS
Add join TLS into junctions.
Definition: GUIAppEnum.h:1270
@ MID_GNE_CROSSING_EDIT_SHAPE
edit crossing shape
Definition: GUIAppEnum.h:1282
@ MID_GNE_POLYGON_OPEN
open closed polygon
Definition: GUIAppEnum.h:1296
@ MID_GNE_POLYGON_SIMPLIFY_SHAPE
simplify polygon geometry
Definition: GUIAppEnum.h:1292
@ MID_REMOVESELECT
Remove from selected items - Menu Entry.
Definition: GUIAppEnum.h:483
GUICompleteSchemeStorage gSchemeStorage
@ MOVEELEMENT
move element cursor
@ MOVEVIEW
move view cursor
@ SELECT_LANE
select lanecursor
@ DEFAULT
default cursor
@ SELECT
select cursor
@ DELETE_CURSOR
delete cursor
@ INSPECT_LANE
inspect lane cursor
@ INSPECT
inspect cursor
#define GUIDesignButtonPopup
checkable button placed in popup (for example, locate buttons)
Definition: GUIDesigns.h:118
#define GUIDesignVerticalSeparator
vertical separator
Definition: GUIDesigns.h:469
unsigned int GUIGlID
Definition: GUIGlObject.h:43
GUIGlObjectType
@ GLO_TAZRELDATA
TAZ relation data.
@ GLO_WALKINGAREA
a walkingArea
@ GLO_TEMPORALSHAPE
temporal shape (used in netedit)
@ GLO_TESTELEMENT
test element (used in netedit)
@ GLO_JUNCTION
a junction
@ GLO_FRONTELEMENT
front element (used in netedit)
@ GLO_LANE
a lane
@ GLO_CONNECTION
a connection
@ GLO_EDGE
an edge
@ GLO_TLLOGIC
a tl-logic
GUIViewObjectsHandler gViewObjectsHandler
@ LOCATEVEHICLE
@ LOCATEWALKINGAREA
@ LOCATEPERSON
@ LOCATECONTAINER
@ LOCATEJUNCTION
#define WRITE_DEBUG(msg)
Definition: MsgHandler.h:306
#define WRITE_WARNINGF(...)
Definition: MsgHandler.h:296
#define WRITE_ERROR(msg)
Definition: MsgHandler.h:304
#define WRITE_WARNING(msg)
Definition: MsgHandler.h:295
#define TL(string)
Definition: MsgHandler.h:315
#define TLF(string,...)
Definition: MsgHandler.h:317
StringBijection< SUMOVehicleClass > SumoVehicleClassStrings(sumoVehicleClassStringInitializer, SVC_CUSTOM2, false)
long long int SVCPermissions
bitset where each bit declares whether a certain SVC may use this edge/lane
SUMOVehicleClass
Definition of vehicle classes to differ between different lane usage and authority types.
@ SVC_IGNORING
vehicles ignoring classes
@ SVC_BICYCLE
vehicle is a bicycle
@ SVC_BUS
vehicle is a bus
@ SVC_PEDESTRIAN
pedestrian
@ SUMO_TAG_EDGEREL
a relation between two edges
@ SUMO_TAG_DATAINTERVAL
@ SUMO_TAG_TAZ
a traffic assignment zone
@ GNE_TAG_EDGEREL_SINGLE
@ SUMO_TAG_POI
begin/end of the description of a Point of interest
@ SUMO_TAG_VEHICLE
description of a vehicle
@ GNE_TAG_FLOW_ROUTE
a flow definition using a route instead of a from-to edges route
@ SUMO_TAG_FLOW
a flow definition using from and to edges or a route
@ SUMO_TAG_CONNECTION
connectioon between two lanes
@ SUMO_TAG_JUNCTION
begin/end of the description of a junction
@ SUMO_TAG_CROSSING
crossing between edges for pedestrians
@ SUMO_TAG_POLY
begin/end of the description of a polygon
@ SUMO_TAG_LANE
begin/end of the description of a single lane
@ SUMO_TAG_DATASET
@ GNE_TAG_JPS_OBSTACLE
polygon used for draw juPedSim obstacles
@ SUMO_TAG_TAZREL
a relation between two TAZs
@ GNE_TAG_ROUTE_EMBEDDED
embedded route
@ SUMO_TAG_INDUCTION_LOOP
alternative tag for e1 detector
@ GNE_TAG_JPS_WALKABLEAREA
polygon used for draw juPedSim walkable areas
@ SUMO_TAG_VIEWSETTINGS
@ SUMO_TAG_VIEWPORT
@ SUMO_TAG_TRIP
a single trip definition (used by router)
@ SUMO_TAG_EDGE
begin/end of the description of an edge
@ SUMO_ATTR_LANE
@ GNE_ATTR_OPPOSITE
to busStop (used by personPlans)
@ SUMO_ATTR_Y
@ SUMO_ATTR_X
@ GNE_ATTR_SELECTED
element is selected
@ SUMO_ATTR_CUSTOMSHAPE
whether a given shape is user-defined
@ SUMO_ATTR_POSITION_LAT
@ SUMO_ATTR_ZOOM
@ SUMO_ATTR_SHAPE
edge: the shape in xml-definition
@ SUMO_ATTR_ANGLE
@ GNE_ATTR_SHAPE_END
last coordinate of edge shape
@ SUMO_ATTR_TLID
link,node: the traffic light id responsible for this link
@ SUMO_ATTR_FRIENDLY_POS
@ SUMO_ATTR_TYPE
@ SUMO_ATTR_LENGTH
@ GNE_ATTR_SHAPE_START
first coordinate of edge shape
@ SUMO_ATTR_POSITION
const double SUMO_const_laneWidth
Definition: StdDefs.h:48
T MIN2(T a, T b)
Definition: StdDefs.h:76
T MAX2(T a, T b)
Definition: StdDefs.h:82
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
Definition: ToString.h:46
void parseSumoBaseObject(CommonXMLStructure::SumoBaseObject *obj)
parse SumoBaseObject (it's called recursivelly)
A class that stores a 2D geometrical boundary.
Definition: Boundary.h:39
void add(double x, double y, double z=0)
Makes the boundary include the given coordinate.
Definition: Boundary.cpp:78
double ymin() const
Returns minimum y-coordinate.
Definition: Boundary.cpp:130
double xmin() const
Returns minimum x-coordinate.
Definition: Boundary.cpp:118
Boundary & grow(double by)
extends the boundary by the given amount
Definition: Boundary.cpp:319
double ymax() const
Returns maximum y-coordinate.
Definition: Boundary.cpp:136
double xmax() const
Returns maximum x-coordinate.
Definition: Boundary.cpp:124
void addBoolAttribute(const SumoXMLAttr attr, const bool value)
add bool attribute into current SumoBaseObject node
void addDoubleAttribute(const SumoXMLAttr attr, const double value)
add double attribute into current SumoBaseObject node
void addStringAttribute(const SumoXMLAttr attr, const std::string &value)
add string attribute into current SumoBaseObject node
static void drawLine(const Position &beg, double rot, double visLength)
Draws a thin line.
Definition: GLHelper.cpp:438
static void setColor(const RGBColor &c)
Sets the gl-color to this value.
Definition: GLHelper.cpp:654
static void drawOutlineCircle(double radius, double iRadius, int steps=8)
Draws an unfilled circle around (0,0)
Definition: GLHelper.cpp:596
static void drawFilledCircle(const double widradiusth, const int steps=8)
Draws a filled circle around (0,0)
Definition: GLHelper.cpp:569
static void popMatrix()
pop matrix
Definition: GLHelper.cpp:130
static void pushMatrix()
push matrix
Definition: GLHelper.cpp:117
GNEConsecutiveSelector * getConsecutiveLaneSelector() const
get consecutive lane selector
GNENetworkSelector * getLanesSelector() const
get edges selector
bool createPath(const bool useLastRoute)
create path
bool addAdditional(const GNEViewNetHelper::ViewObjectsSelector &viewObjects)
add additional element
GNENetworkSelector * getEdgesSelector() const
get edges selector
GNENeteditAttributes * getNeteditAttributes() const
get Netedit parameter
Builds additional objects for GNENet (busStops, chargingStations, detectors, etc.....
An Element which don't belong to GNENet but has influence in the simulation.
Definition: GNEAdditional.h:49
virtual void openAdditionalDialog()
open Additional Dialog
GNEApplicationWindowHelper::EditMenuCommands & getEditMenuCommands()
get Edit Menu Commands (needed for show/hide menu commands)
GNEApplicationWindowHelper::ToolbarsGrip & getToolbarsGrip()
get ToolbarsGrip
const std::string getID() const
get ID (all Attribute Carriers have one)
bool isAttributeCarrierSelected() const
check if attribute carrier is selected
const std::string & getTagStr() const
get tag assigned to this object in string format
virtual GUIGlObject * getGUIGlObject()=0
const GNETagProperties & getTagProperty() const
get tagProperty associated with this Attribute Carrier
void unselectAttributeCarrier(const bool changeFlag=true)
unselect attribute carrier using GUIGlobalSelection
void selectAttributeCarrier(const bool changeFlag=true)
select attribute carrier using GUIGlobalSelection
static void changeAttribute(GNEAttributeCarrier *AC, SumoXMLAttr key, const std::string &value, GNEUndoList *undoList, const bool force=false)
change attribute
void smootShape()
smoothShape
long onCmdSaveModifications(FXObject *, FXSelector, void *)
Called when the user presses the OK-Button saves any connection modifications.
long onCmdCancelModifications(FXObject *, FXSelector, void *)
Called when the user presses the Cancel-button discards any connection modifications.
ConnectionModifications * getConnectionModifications() const
get pointer to ConnectionModifications modul
void handleLaneClick(const GNEViewNetHelper::ViewObjectsSelector &viewObjects)
either sets the current lane or toggles the connection of the
void drawTemporalConsecutiveLanePath() const
draw temporal consecutive lane path
void abortPathCreation()
abort path creation
void removeLastElement()
remove path element
GNEPlanCreator * getPlanCreator() const
get plan creator module
bool addContainer(const GNEViewNetHelper::ViewObjectsSelector &viewObjects)
add vehicle element
void show()
show Frame
GNEPlanCreator * getPlanCreator() const
get plan creator module
bool addContainerPlanElement(const GNEViewNetHelper::ViewObjectsSelector &viewObjects)
add container plan element
void processClick(const Position &clickedPosition, const GNEViewNetHelper::ViewObjectsSelector &viewObjects, const bool oppositeEdge, const bool chainEdge)
handle processClick and set the relative coloring
void abortEdgeCreation()
abort current edge creation
void show()
show create edge frame
const GNEJunction * getJunctionSource() const
get junction source for new edge
void clearEdgesHotkey()
clear edges (used when user press ESC key in Crossing mode)
void createCrossingHotkey()
create crossing (used when user press ENTER key in Crossing mode)
void addCrossing(const GNEViewNetHelper::ViewObjectsSelector &viewObjects)
add Crossing element
This object is responsible for drawing a shape and for supplying a a popup menu. Messages are routete...
Definition: GNECrossing.h:44
GNEJunction * getParentJunction() const
get parent Junction
An Element which don't belong to GNENet but has influence in the simulation.
bool deleteOnlyGeometryPoints() const
check if only delete geometry points checkbox is enabled
bool removeGeometryPoint(const GNEViewNetHelper::ViewObjectsSelector &viewObjects)
remove geometry point
DeleteOptions * getDeleteOptions() const
get delete options modul
void removeSelectedAttributeCarriers()
remove selected attribute carriers (element)
void removeAttributeCarrier(const GNEViewNetHelper::ViewObjectsSelector &viewObjects)
remove attribute carrier (element)
void show()
show delete frame
void startDrawing()
start drawing
bool isDrawing() const
return true if currently a shape is drawed
bool getDeleteLastCreatedPoint()
get flag delete last created point
void abortDrawing()
abort drawing
void setDeleteLastCreatedPoint(bool value)
enable or disable delete last created point
void stopDrawing()
stop drawing and check if shape can be created
const PositionVector & getTemporalShape() const
get Temporal shape
bool addEdgeData(const GNEViewNetHelper::ViewObjectsSelector &viewObjects, const GNEViewNetHelper::MouseButtonKeyPressed &mouseButtonKeyPressed)
add additional element
A road/street connecting two junctions (netedit-version)
Definition: GNEEdge.h:53
void smooth(GNEUndoList *undoList)
make geometry smooth
Definition: GNEEdge.cpp:2345
NBEdge * getNBEdge() const
returns the internal NBEdge
Definition: GNEEdge.cpp:683
void smoothElevation(GNEUndoList *undoList)
smooth elevation with regard to adjoining edges
Definition: GNEEdge.cpp:2357
const std::vector< GNELane * > & getLanes() const
returns a reference to the lane vector
Definition: GNEEdge.cpp:1047
std::vector< GNEEdge * > getOppositeEdges() const
get opposite edges
Definition: GNEEdge.cpp:624
void copyTemplate(const GNEEdgeTemplate *edgeTemplate, GNEUndoList *undoList)
copy edge attributes from edgetemplate
Definition: GNEEdge.cpp:957
void editEndpoint(Position pos, GNEUndoList *undoList)
makes pos the new geometry endpoint at the appropriate end, or remove current existent endpoint
Definition: GNEEdge.cpp:705
Position getSplitPos(const Position &clickPos)
Definition: GNEEdge.cpp:689
void straightenElevation(GNEUndoList *undoList)
interpolate z values linear between junctions
Definition: GNEEdge.cpp:2262
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
Definition: GNEEdge.cpp:1169
void resetEndpoint(const Position &pos, GNEUndoList *undoList)
restores the endpoint to the junction position at the appropriate end
Definition: GNEEdge.cpp:757
bool addEdgeRelationData(const GNEViewNetHelper::ViewObjectsSelector &viewObjects, const GNEViewNetHelper::MouseButtonKeyPressed &mouseButtonKeyPressed)
add additional element
void focusUpperElement()
focus upper element of frame
Definition: GNEFrame.cpp:109
virtual void show()
show Frame
Definition: GNEFrame.cpp:115
GNEPathCreator * getPathCreator() const
get GNEPathCreator modul
An Element which don't belong to GNENet but has influence in the simulation.
Dialog to edit geometry points.
const std::vector< GNEDemandElement * > & getParentDemandElements() const
get parent demand elements
bool isSelectingParent() const
check if we're selecting a new parent
void setNewParent(GNEAttributeCarrier *clickedAC)
set new parent
void setEdgeTemplate(const GNEEdge *edge)
set edge template
GNEEdgeTemplate * getEdgeTemplate() const
get edge template (to copy attributes from)
void inspectSingleElement(GNEAttributeCarrier *AC)
Inspect a single element.
TemplateEditor * getTemplateEditor() const
get template editor
bool processDemandSupermodeClick(const Position &clickedPosition, GNEViewNetHelper::ViewObjectsSelector &viewObjects)
process click over Viewnet in Supermode Demand
void clearInspectedAC()
Clear all current inspected ACs.
void show()
show inspector frame
GNEOverlappedInspection * getOverlappedInspection() const
get GNEOverlappedInspection modul
GNEInspectorFrame::NeteditAttributesEditor * getNeteditAttributesEditor() const
get Netedit Attributes editor
bool processNetworkSupermodeClick(const Position &clickedPosition, GNEViewNetHelper::ViewObjectsSelector &viewObjects)
process click over Viewnet in Supermode Network
void inspectMultisection(const std::vector< GNEAttributeCarrier * > &ACs)
Inspect the given multi-selection.
bool processDataSupermodeClick(const Position &clickedPosition, GNEViewNetHelper::ViewObjectsSelector &viewObjects)
process click over Viewnet in Supermode Data
const std::vector< GNEEdge * > & getGNEIncomingEdges() const
Returns incoming GNEEdges.
std::string getAttribute(SumoXMLAttr key) const
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
Position getPositionInView() const
Returns position of hierarchical element in view.
const std::vector< GNEEdge * > & getGNEOutgoingEdges() const
Returns incoming GNEEdges.
NBNode * getNBNode() const
Return net build node.
This lane is powered by an underlying GNEEdge and basically knows how to draw itself.
Definition: GNELane.h:46
const PositionVector & getLaneShape() const
get elements shape
Definition: GNELane.cpp:214
int getIndex() const
returns the index of the lane
Definition: GNELane.cpp:642
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
Definition: GNELane.cpp:759
GNEEdge * getParentEdge() const
get parent edge
Definition: GNELane.cpp:196
void show()
show Frame
virtual void removeGeometryPoint(const Position clickedPosition, GNEUndoList *undoList)=0
remove geometry point in the clicked position
void show()
show prohibition frame
GNEAttributeCarrier * retrieveAttributeCarrier(const GUIGlID id, bool hardFail=true) const
get a single attribute carrier based on a GLID
std::vector< GNEAdditional * > getSelectedShapes() const
get selected shapes
GNELane * retrieveLane(const std::string &id, bool hardFail=true, bool checkVolatileChange=false) const
get lane by id
GNECrossing * retrieveCrossing(const GUIGlObject *glObject, bool hardFail=true) const
get Crossing by AC
const std::map< std::string, std::pair< const GUIGlObject *, GNEEdge * > > & getEdges() const
map with the ID and pointer to edges of net
GNEAdditional * retrieveAdditional(SumoXMLTag type, const std::string &id, bool hardFail=true) const
Returns the named additional.
GNEWalkingArea * retrieveWalkingArea(const GUIGlObject *glObject, bool hardFail=true) const
get WalkingArea by GlObject
bool isNetworkElementAroundShape(GNEAttributeCarrier *AC, const PositionVector &shape) const
check if shape of given AC (network element) is around the given shape
GNEJunction * retrieveJunction(const std::string &id, bool hardFail=true) const
get junction by id
GNEDataSet * retrieveDataSet(const std::string &id, bool hardFail=true) const
Returns the named data set.
const std::map< std::string, std::pair< const GUIGlObject *, GNEJunction * > > & getJunctions() const
get junctions
std::vector< GNELane * > getSelectedLanes() const
get selected lanes
std::vector< GNEJunction * > getSelectedJunctions() const
return selected junctions
const std::map< SumoXMLTag, std::map< const GUIGlObject *, GNEGenericData * > > & getGenericDatas() const
get all generic datas
const std::map< const GUIGlObject *, GNELane * > & getLanes() const
get lanes
GNEDataInterval * retrieveDataInterval(const GNEAttributeCarrier *AC, bool hardFail=true) const
Returns the data interval.
GNEEdge * retrieveEdge(const std::string &id, bool hardFail=true) const
get edge by id
std::vector< GNEEdge * > getSelectedEdges() const
return all edges
GNEDemandElement * retrieveDemandElement(SumoXMLTag type, const std::string &id, bool hardFail=true) const
Returns the named demand element.
const std::map< SumoXMLTag, std::map< const GUIGlObject *, GNEDemandElement * > > & getDemandElements() const
get demand elements
GNEGenericData * retrieveGenericData(const GUIGlObject *glObject, bool hardFail=true) const
Returns the generic data.
std::vector< GNEAttributeCarrier * > getSelectedAttributeCarriers(const bool ignoreCurrentSupermode)
get all selected attribute carriers (or only relative to current supermode
GNEConnection * retrieveConnection(const std::string &id, bool hardFail=true) const
get Connection by id
A NBNetBuilder extended by visualisation and editing capabilities.
Definition: GNENet.h:42
void deleteEdge(GNEEdge *edge, GNEUndoList *undoList, bool recomputeConnections)
removes edge
Definition: GNENet.cpp:414
void deleteLane(GNELane *lane, GNEUndoList *undoList, bool recomputeConnections)
removes lane
Definition: GNENet.cpp:578
void deleteCrossing(GNECrossing *crossing, GNEUndoList *undoList)
remove crossing
Definition: GNENet.cpp:633
SUMORTree & getGrid()
Returns the RTree used for visualisation speed-up.
Definition: GNENet.cpp:147
void deleteAdditional(GNEAdditional *additional, GNEUndoList *undoList)
remove additional
Definition: GNENet.cpp:651
void computeAndUpdate(OptionsCont &neteditOptions, bool volatileOptions)
recompute the network and update lane geometries
Definition: GNENet.cpp:2792
void reverseEdge(GNEEdge *edge, GNEUndoList *undoList)
reverse edge
Definition: GNENet.cpp:1025
NBTrafficLightLogicCont & getTLLogicCont()
returns the tllcont of the underlying netbuilder
Definition: GNENet.cpp:2061
bool restrictLane(SUMOVehicleClass vclass, GNELane *lane, GNEUndoList *undoList)
transform lane to restricted lane
Definition: GNENet.cpp:783
GNEJunction * splitEdge(GNEEdge *edge, const Position &pos, GNEUndoList *undoList, GNEJunction *newJunction=0)
split edge at position by inserting a new junction
Definition: GNENet.cpp:885
void deleteDemandElement(GNEDemandElement *demandElement, GNEUndoList *undoList)
remove demand element
Definition: GNENet.cpp:672
void duplicateLane(GNELane *lane, GNEUndoList *undoList, bool recomputeConnections)
duplicates lane
Definition: GNENet.cpp:767
void deleteDataInterval(GNEDataInterval *dataInterval, GNEUndoList *undoList)
remove data interval
Definition: GNENet.cpp:715
void deleteConnection(GNEConnection *connection, GNEUndoList *undoList)
remove connection
Definition: GNENet.cpp:618
void resetJunctionConnections(GNEJunction *junction, GNEUndoList *undoList)
reset junction's connections
Definition: GNENet.cpp:1985
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
Definition: GNENet.cpp:181
void deleteGenericData(GNEGenericData *genericData, GNEUndoList *undoList)
remove generic data
Definition: GNENet.cpp:728
GNENetHelper::AttributeCarriers * getAttributeCarriers() const
get all attribute carriers used in this net
Definition: GNENet.cpp:122
GNEEdge * addReversedEdge(GNEEdge *edge, const bool disconnected, GNEUndoList *undoList)
add reversed edge
Definition: GNENet.cpp:1038
void splitEdgesBidi(GNEEdge *edge, GNEEdge *oppositeEdge, const Position &pos, GNEUndoList *undoList)
split all edges at position by inserting one new junction
Definition: GNENet.cpp:1002
bool removeRestrictedLane(SUMOVehicleClass vclass, GNEEdge *edge, GNEUndoList *undoList)
remove restricted lane
Definition: GNENet.cpp:871
void mergeJunctions(GNEJunction *moved, GNEJunction *target, GNEUndoList *undoList)
merge the given junctions edges between the given junctions will be deleted
Definition: GNENet.cpp:1076
bool addRestrictedLane(SUMOVehicleClass vclass, GNEEdge *edge, int index, GNEUndoList *undoList)
add restricted lane to edge
Definition: GNENet.cpp:818
bool addGreenVergeLane(GNEEdge *edge, int index, GNEUndoList *undoList)
add restricted lane to edge
Definition: GNENet.cpp:854
void deleteDataSet(GNEDataSet *dataSet, GNEUndoList *undoList)
remove data set
Definition: GNENet.cpp:702
void splitJunction(GNEJunction *junction, bool reconnect, GNEUndoList *undoList)
replace the selected junction by a list of junctions for each unique edge endpoint
Definition: GNENet.cpp:1889
void selectRoundabout(GNEJunction *junction, GNEUndoList *undoList)
select all roundabout edges and junctions for the current roundabout
Definition: GNENet.cpp:1109
void replaceJunctionByGeometry(GNEJunction *junction, GNEUndoList *undoList)
replace the selected junction by geometry node(s) and merge the edges
Definition: GNENet.cpp:1835
GNEPathManager * getPathManager()
get path manager
Definition: GNENet.cpp:134
void createRoundabout(GNEJunction *junction, GNEUndoList *undoList)
transform the given junction into a roundabout
Definition: GNENet.cpp:1128
void requireRecompute()
inform the net about the need for recomputation
Definition: GNENet.cpp:1434
void initGNEConnections()
initialize GNEConnections
Definition: GNENet.cpp:2779
void deleteJunction(GNEJunction *junction, GNEUndoList *undoList)
removes junction and all incident edges
Definition: GNENet.cpp:369
NBEdgeCont & getEdgeCont()
returns the NBEdgeCont of the underlying netbuilder
Definition: GNENet.cpp:2067
GNEViewNet * getViewNet() const
get view net
Definition: GNENet.cpp:2055
void clearJunctionConnections(GNEJunction *junction, GNEUndoList *undoList)
clear junction's connections
Definition: GNENet.cpp:1973
void computeDemandElements(GNEApplicationWindow *window)
compute demand elements param[in] window The window to inform about delay
Definition: GNENet.cpp:1383
void drawLaneReference(const GNELane *lane) const
draw lane reference
void clearSelection()
clear selection
bool overlappedInspectionShown() const
check if overlappedInspection modul is shown
bool checkSavedPosition(const Position &clickedPosition) const
check if given position is near to saved position
Definition: GNEPOI.h:43
long onCmdCreatePath(FXObject *, FXSelector, void *)
void abortPathCreation()
abort path creation
void removeLastElement()
remove path element
bool createPath(const bool useLastRoute)
create path
void drawTemporalRoute(const GUIVisualizationSettings &s) const
draw temporal route
void calculateReachability(const SUMOVehicleClass vClass, GNEEdge *originEdge)
calculate reachability for given edge
void clearPathDraw()
clear path draw
PathCalculator * getPathCalculator()
obtain instance of PathCalculator
PathDraw * getPathDraw()
obtain instance of PathDraw
void show()
show Frame
GNEPlanCreator * getPlanCreator() const
get plan creator module
bool addPerson(const GNEViewNetHelper::ViewObjectsSelector &viewObjects)
add vehicle element
void show()
show Frame
bool addPersonPlanElement(const GNEViewNetHelper::ViewObjectsSelector &viewObjects)
add person plan element
GNEPlanCreator * getPlanCreator() const
get plan creator module
void resetSelectedPerson()
reset selected person
void removeLastElement()
remove path element
long onCmdCreatePath(FXObject *, FXSelector, void *)
void abortPathCreation()
abort path creation
void drawTemporalRoute(const GUIVisualizationSettings &s) const
draw temporal route
int getVertexIndex(Position pos, bool snapToGrid)
return index of a vertex of shape, or of a new vertex if position is over an shape's edge
Definition: GNEPoly.cpp:347
void closePolygon(bool allowUndo=true)
close polygon
Definition: GNEPoly.cpp:426
void changeFirstGeometryPoint(int oldIndex, bool allowUndo=true)
change first geometry point
Definition: GNEPoly.cpp:447
void deleteGeometryPoint(const Position &pos, bool allowUndo=true)
delete the geometry point closest to the given pos
Definition: GNEPoly.cpp:363
void simplifyShape(bool allowUndo=true)
replace the current shape with a rectangle
Definition: GNEPoly.cpp:487
void openPolygon(bool allowUndo=true)
open polygon
Definition: GNEPoly.cpp:405
long onCmdCancel(FXObject *, FXSelector, void *)
Called when the user presses the Cancel-button discards any prohibition modifications.
void handleProhibitionClick(const GNEViewNetHelper::ViewObjectsSelector &viewObjects)
handle prohibitions and set the relative coloring
GNEProhibitionFrame::Selection * getSelectionModul() const
get selection module
void show()
show prohibition frame
GNEDistributionFrame::DistributionSelector * getDistributionSelector() const
get route distribution selector
void show()
show delete frame
GNEPathCreator * getPathCreator() const
get path creator module
bool addEdgeRoute(GNEEdge *clickedEdge, const GNEViewNetHelper::MouseButtonKeyPressed &mouseButtonKeyPressed)
add route edge
static void addReverse(GNEDemandElement *element)
add reverse for given demand element
static void reverse(GNEDemandElement *element)
reverse given demand element
void show()
show Frame
void clearCurrentSelection() const
clear current selection with possibility of undo/redo
bool selectAttributeCarrier(const GNEViewNetHelper::ViewObjectsSelector &viewObjects)
select attribute carrier (element)
void show()
show Frame
bool processClick(const Position &clickedPosition, const GNEViewNetHelper::ViewObjectsSelector &viewObjects, bool &updateTemporalShape)
process click over Viewnet
GNEDrawingShape * getDrawingShapeModule() const
get drawing mode editor
void show()
show Frame
bool addStop(const GNEViewNetHelper::ViewObjectsSelector &viewObjects, const GNEViewNetHelper::MouseButtonKeyPressed &mouseButtonKeyPressed)
add Stop element
void setTAZ(GNETAZ *editedTAZ)
set current TAZ
GNETAZ * getTAZ() const
get current TAZ
bool isChangesPending() const
return true if there is changes to save
long onCmdSaveChanges(FXObject *, FXSelector, void *)
TAZSaveChanges * getTAZSaveChangesModule() const
get TAZ Save Changes modul
GNEDrawingShape * getDrawingShapeModule() const
get drawing mode modul
CurrentTAZ * getCurrentTAZModule() const
get Current TAZ modul
void processEdgeSelection(const std::vector< GNEEdge * > &edges)
process selection of edges in view net
bool processClick(const Position &clickedPosition, const GNEViewNetHelper::ViewObjectsSelector &viewObjects)
process click over Viewnet
Definition: GNETAZ.h:34
bool setTAZ(const GNEViewNetHelper::ViewObjectsSelector &viewObjects)
set clicked TAZ
void buildTAZRelationData()
build TAZRelation data
void clearTAZSelection()
clear TAZ selection
bool isSetDetectorsToggleButtonEnabled() const
toggle button for set detectors mode
void disableE1DetectorMode()
disable detector mode
const std::map< std::string, std::string > & getE1Detectors() const
get E1 detectors vinculated with this TLS
bool checkHaveModifications() const
check if current TLS was modified
long onCmdSaveChanges(FXObject *, FXSelector, void *)
Called when the user presses the save-Button.
void discardChanges(const bool editJunctionAgain)
discard changes
const std::vector< std::string > & getSelectedJunctionIDs() const
get selected junction IDs
long onCmdCancelJoin(FXObject *, FXSelector, void *)
cancel join
long onCmdAcceptJoin(FXObject *, FXSelector, void *)
accept join
GNEJunction * getCurrentJunction() const
get current modified junction
bool isJoiningJunctions() const
is joining junctions
GNETLSEditorFrame::TLSAttributes * getTLSAttributes() const
get module for TLS attributes
void editJunction(GNEJunction *junction)
edits the traffic light for the given junction
void editTLS(const Position &clickedPosition, const GNEViewNetHelper::ViewObjectsSelector &viewObjects)
edits the traffic light for the given clicked junction
GNETLSEditorFrame::TLSJunction * getTLSJunction() const
get module for TLS Junction
GNETLSEditorFrame::TLSDefinition * getTLSDefinition() const
get module for TLS Definition
void show()
show inspector frame
bool isContainer() const
return true if tag correspond to a container element
bool isPlacedInRTree() const
return true if Tag correspond to an element that has to be placed in RTREE
SumoXMLTag getTag() const
get Tag vinculated with this attribute Property
bool hasDialog() const
return true if tag correspond to an element that can be edited using a dialog
bool isPerson() const
return true if tag correspond to a person element
GNEDistributionFrame::DistributionSelector * getDistributionSelector() const
get type distribution selector
void show()
show Frame
void end()
End undo command sub-group. If the sub-group is still empty, it will be deleted; otherwise,...
void begin(GUIIcon icon, const std::string &description)
Begin undo command sub-group with current supermode. This begins a new group of commands that are tre...
void abortAllChangeGroups()
reverts and discards ALL active chained change groups
void add(GNEChange *command, bool doit=false, bool merge=true)
Add new command, executing it if desired. The new command will be merged with the previous command if...
GNEPathCreator * getPathCreator() const
get GNEPathCreator module
void show()
show Frame
bool addVehicle(const GNEViewNetHelper::ViewObjectsSelector &viewObjects, const GNEViewNetHelper::MouseButtonKeyPressed &mouseButtonKeyPressed)
add vehicle element
class used to group all variables related to interval bar
void hideIntervalBar()
hide all options menu checks
void setGenericDataType()
set generic data type
void showIntervalBar()
show interval option bar
void buildIntervalBarElements()
build interval bar elements
void setInterval()
update limit by interval
void updateLockMenuBar()
update lock inspect menuBar
bool isObjectLocked(GUIGlObjectType objectType, const bool selected) const
check if given GLObject is locked for inspect, select, delete and move
class used to group all variables related with objects under cursor after a click over view
void updateObjects()
update objects (using gViewObjectsHandler)
GNEConnection * getConnectionFront() const
get front connection or a pointer to nullptr
const std::vector< GNEAttributeCarrier * > & getAttributeCarriers() const
get vector with ACs
void filterEdges()
filter (remove) edges
void filterLockedElements(const std::vector< GUIGlObjectType > ignoreFilter={})
filter locked elements (except the ignoreFilter)
GNEPOI * getPOIFront() const
get front POI or a pointer to nullptr
GNEEdge * getEdgeFront() const
get front edge or a pointer to nullptr
GNEAttributeCarrier * getAttributeCarrierFront() const
get front attribute carrier or a pointer to nullptr
GNELane * getLaneFront() const
get front lane or a pointer to nullptr
GNEAdditional * getAdditionalFront() const
get front additional element or a pointer to nullptr
GNELane * getLaneFrontNonLocked() const
get front lane or a pointer to nullptr checking if is locked
const GUIGlObject * getGUIGlObjectFront() const
get front attribute carrier or a pointer to nullptr
GNENetworkElement * getNetworkElementFront() const
get front network element or a pointer to nullptr
GNEJunction * getJunctionFront() const
get front junction or a pointer to nullptr
void filterLanes()
filter (remove) lanes
const std::vector< GUIGlObject * > & getGLObjects() const
get vector with GL objects
GNEViewNetHelper::EditNetworkElementShapes myEditNetworkElementShapes
struct for grouping all variables related with edit shapes
Definition: GNEViewNet.h:698
long onCmdToggleShowDemandElementsNetwork(FXObject *, FXSelector, void *)
toggle show demand elements (network)
long onCmdClosePolygon(FXObject *, FXSelector, void *)
close opened polygon
long onCmdEditCrossingShape(FXObject *, FXSelector, void *)
edit crossing shape
void processMoveMouseNetwork(const bool mouseLeftButtonPressed)
process move mouse function in Supermode Network
const GNEViewNetHelper::DataViewOptions & getDataViewOptions() const
get data view options
Definition: GNEViewNet.cpp:727
GNENet * getNet() const
get the net object
void deleteNetworkAttributeCarriers(const std::vector< GNEAttributeCarrier * > ACs)
delete given network attribute carriers
long onCmdSetFirstGeometryPoint(FXObject *, FXSelector, void *)
set as first geometry point the closes geometry point
long onCmdEdgeUseAsTemplate(FXObject *, FXSelector, void *)
use edge as template
long onCmdSmoothConnectionShape(FXObject *, FXSelector, void *)
edit connection shape
GNEViewNetHelper::CommonCheckableButtons myCommonCheckableButtons
variable used to save checkable buttons for common supermodes
Definition: GNEViewNet.h:636
long onMouseMove(FXObject *, FXSelector, void *)
called when user moves mouse
const GNEAttributeCarrier * getFrontAttributeCarrier() const
get front attributeCarrier
void hotkeyBackSpace()
handle backspace keypress
GNEDemandElement * myLastCreatedRoute
last created route
Definition: GNEViewNet.h:722
const GNEViewNetHelper::EditModes & getEditModes() const
get edit modes
Definition: GNEViewNet.cpp:703
long onCmdAddSelected(FXObject *, FXSelector, void *)
select AC under cursor
const GNEViewNetHelper::EditNetworkElementShapes & getEditNetworkElementShapes() const
get Edit Shape module
Definition: GNEViewNet.cpp:739
void setFrontAttributeCarrier(GNEAttributeCarrier *AC)
set front attributeCarrier
GNECrossing * getCrossingAtPopupPosition()
try to retrieve a crossing at popup position
void buildViewToolBars(GUIGlChildWindow *v)
builds the view toolbars
Definition: GNEViewNet.cpp:341
void updateNetworkModeSpecificControls()
updates Network mode specific controls
long onCmdAddTLS(FXObject *, FXSelector, void *)
add TLS
long onCmdSmoothEdges(FXObject *, FXSelector, void *)
smooth geometry
long onCmdStraightenEdges(FXObject *, FXSelector, void *)
makes selected edges straight
const GNEViewNetHelper::MouseButtonKeyPressed & getMouseButtonKeyPressed() const
get Key Pressed module
Definition: GNEViewNet.cpp:733
void updateCursor()
update cursor after every click/key press/release
void updateDataModeSpecificControls()
updates Data mode specific controls
GNEEdge * getEdgeAtPopupPosition()
try to retrieve an edge at popup position
long onCmdToggleShowDemandElementsData(FXObject *, FXSelector, void *)
toggle show demand elements (data)
GNEViewNetHelper::EditModes myEditModes
variable used to save variables related with edit moves modes
Definition: GNEViewNet.h:617
long onCmdReplaceJunction(FXObject *, FXSelector, void *)
replace node by geometry
bool restrictLane(GNELane *lane, SUMOVehicleClass vclass)
restrict lane
Definition: GNEViewNet.cpp:941
long onCmdSplitJunction(FXObject *, FXSelector, void *)
split junction into multiple junctions
void drawGrid() const
draw grid and update grid button
long onCmdClearConnections(FXObject *, FXSelector, void *)
clear junction connections
void abortOperation(bool clearSelection=true)
abort current edition operation
long onCmdToggleTAZDrawFill(FXObject *, FXSelector, void *)
toggle TAZdrawFill
long onCmdResetEndPoints(FXObject *, FXSelector, void *)
reset edge end points
void updateObjectsInPosition(const Position &pos)
get objects in the given position
Definition: GNEViewNet.cpp:499
GNEViewNetHelper::TestingMode myTestingMode
variable used to save variables related with testing mode
Definition: GNEViewNet.h:620
GNEDemandElement * getLastCreatedRoute() const
get last created route
long onCmdToggleWarnAboutMerge(FXObject *, FXSelector, void *)
toggle warn for merge
long onCmdToggleDrawSpreadVehicles(FXObject *, FXSelector, void *)
toggle draw vehicles in begin position or spread in lane
GNEPOI * getPOIAtPopupPosition()
try to retrieve a POILane at popup position
GNEViewNetHelper::SelectingArea mySelectingArea
variable used for grouping all variables related with selecting areas
Definition: GNEViewNet.h:695
long onCmdToggleShowConnections(FXObject *, FXSelector, void *)
toggle show connections
void updateObjectsInBoundary(const Boundary &boundary)
get objects in the given boundary
Definition: GNEViewNet.cpp:474
long onCmdLaneReachability(FXObject *, FXSelector sel, void *)
show lane reachability
long onCmdToggleShowTAZElements(FXObject *, FXSelector, void *)
toggle show TAZ elements
GNEViewNetHelper::NetworkCheckableButtons myNetworkCheckableButtons
variable used to save checkable buttons for Supermode Network
Definition: GNEViewNet.h:639
std::vector< std::string > getEdgeDataAttrs() const
return list of loaded edgeData attributes
bool myCreatedPopup
flag for mark if during this frame a popup was created (needed to avoid problems in linux with Cursor...
Definition: GNEViewNet.h:731
void openSelectDialogAtCursor(const std::vector< GUIGlObject * > &GLObjects)
open select dialog at cursor
Definition: GNEViewNet.cpp:660
void openObjectDialogAtCursor(const FXEvent *ev)
open object dialog
Definition: GNEViewNet.cpp:565
void processClick(void *eventData)
Auxiliary function used by onLeftBtnPress(...)
void drawNeteditAttributesReferences()
draw circle in testing mode (needed for grid)
long onCmdSimplifyShape(FXObject *, FXSelector, void *)
simply shape of current polygon
GNELane * getLaneAtPopupPosition()
try to retrieve a lane at popup position
GNEAttributeCarrier * myFrontAttributeCarrier
front attribute carrier
Definition: GNEViewNet.h:719
GNEViewNetHelper::MouseButtonKeyPressed myMouseButtonKeyPressed
variable used to save key status after certain events
Definition: GNEViewNet.h:628
void recalculateBoundaries()
recalculate boundaries
Definition: GNEViewNet.cpp:298
GNEViewNetHelper::IntervalBar myIntervalBar
variable used to save IntervalBar
Definition: GNEViewNet.h:664
GNEViewParent * myViewParent
view parent
Definition: GNEViewNet.h:704
bool showJunctionAsBubbles() const
return true if junction must be showed as bubbles
Definition: GNEViewNet.cpp:841
bool changeAllPhases() const
change all phases
Definition: GNEViewNet.cpp:835
long onCmdEditJunctionShape(FXObject *, FXSelector, void *)
edit junction shape
long onCmdToggleMoveElevation(FXObject *, FXSelector, void *)
toggle move elevation
GNEWalkingArea * getWalkingAreaAtPopupPosition()
try to retrieve a walkingArea at popup position
long onCmdToggleShowAllPersonPlans(FXObject *, FXSelector, void *)
toggle show all person plans in super mode demand
bool setColorScheme(const std::string &name)
set color scheme
Definition: GNEViewNet.cpp:549
int doPaintGL(int mode, const Boundary &bound)
do paintGL
long onCmdOpenAdditionalDialog(FXObject *, FXSelector, void *)
open additional dialog
long onCmdToggleTAZRelOnlyTo(FXObject *, FXSelector, void *)
toggle TAZRez only to
long onCmdEgeApplyTemplate(FXObject *, FXSelector, void *)
apply template to edge
long onCmdSetNeteditView(FXObject *, FXSelector sel, void *)
called when a new view is set
const GNEViewNetHelper::NetworkViewOptions & getNetworkViewOptions() const
get network view options
Definition: GNEViewNet.cpp:715
void hotkeyFocusFrame()
handle focus frame keypress
long onCmdToggleChainEdges(FXObject *, FXSelector, void *)
toggle chain edges
GNEViewNetHelper::DemandViewOptions myDemandViewOptions
variable used to save variables related with view options in supermode Demand
Definition: GNEViewNet.h:656
void drawTemporalJunctionTLSLines() const
draw temporal Junction TLS Lines
std::vector< std::string > getEdgeLaneParamKeys(bool edgeKeys) const
return list of available edge parameters
long onCmdLaneOperation(FXObject *, FXSelector sel, void *)
add/remove/restrict lane
void processMoveMouseData(const bool mouseLeftButtonPressed)
process move mouse function in Supermode Data
GNEFrame * myCurrentFrame
the current frame
Definition: GNEViewNet.h:710
bool autoSelectNodes()
whether to autoselect nodes or to lanes
Definition: GNEViewNet.cpp:819
void drawTemporalRoundabout() const
draw temporal roundabout
long onCmdToggleLockContainer(FXObject *, FXSelector, void *)
toggle lock container in super mode demand
GNEUndoList * myUndoList
a reference to the undolist maintained in the application
Definition: GNEViewNet.h:713
void drawTranslateFrontAttributeCarrier(const GNEAttributeCarrier *AC, double typeOrLayer, const double extraOffset=0)
draw front attributeCarrier
GNEViewNetHelper::NetworkViewOptions myNetworkViewOptions
variable used to save variables related with view options in supermode Network
Definition: GNEViewNet.h:653
void doInit()
called after some features are already initialized
Definition: GNEViewNet.cpp:327
long onCmdResetEdgeEndPoints(FXObject *, FXSelector, void *)
edit junction shape
void buildEditModeControls()
create edit mode buttons and elements
bool isMovingElement() const
check if an element is being moved
GNEViewNetHelper::MoveSingleElementModul myMoveSingleElement
modul used for moving single element
Definition: GNEViewNet.h:670
long onMiddleBtnRelease(FXObject *, FXSelector, void *)
called when user releases mouse's left button
int getDrawingToggle() const
get draw toggle (used to avoid drawing junctions twice)
GNEViewNetHelper::DataCheckableButtons myDataCheckableButtons
variable used to save checkable buttons for Supermode Data
Definition: GNEViewNet.h:645
long onCmdToggleShowGrid(FXObject *, FXSelector, void *)
toggle show grid
void processLeftButtonPressDemand(void *eventData)
process left button press function in Supermode Demand
GNEDemandElement * getDemandElementAtPopupPosition()
try to retrieve a demand element at popup position
GNEViewNetHelper::TimeFormat myTimeFormat
variable used for grouping all variables related with switch time
Definition: GNEViewNet.h:692
long onLeaveConvertRoundabout(FXObject *, FXSelector, void *)
leave to convert junction to roundabout
GNEViewNetHelper::IntervalBar & getIntervalBar()
get interval bar
long onCmdEditLaneShape(FXObject *, FXSelector, void *)
edit lane shape
long onCmdToggleHideNonInspecteDemandElements(FXObject *, FXSelector, void *)
toggle hide non inspected demand elements
GNEViewParent * getViewParent() const
get the net object
long onCmdToggleDrawJunctionShape(FXObject *, FXSelector, void *)
toggle draw junction shape
bool checkOverLockedElement(const GUIGlObject *GLObject, const bool isSelected) const
check if given element is locked (used for drawing select and delete contour)
long onCmdAddReversedEdge(FXObject *, FXSelector, void *)
add reversed edge
void processLeftButtonReleaseNetwork()
process left button release function in Supermode Network
bool checkSelectEdges() const
check if select edges (toggle using button or shift)
long onMiddleBtnPress(FXObject *, FXSelector, void *)
called when user press mouse's left button
long onCmdAddReversedEdgeDisconnected(FXObject *, FXSelector, void *)
add reversed edge disconnected
long onCmdIntervalBarGenericDataType(FXObject *, FXSelector, void *)
change generic data type in interval bar
long onCmdConvertRoundabout(FXObject *, FXSelector, void *)
convert junction to roundabout
long onCmdRemoveEdgeSelected(FXObject *, FXSelector, void *)
unselect Edge under cursor
long onCmdAddReverse(FXObject *, FXSelector, void *)
add a reverse demand element
long onCmdToggleShowShapes(FXObject *, FXSelector, void *)
toggle show shapes in super mode data
long onRightBtnPress(FXObject *, FXSelector, void *)
called when user press mouse's right button
long onCmdOpenPolygon(FXObject *, FXSelector, void *)
open closed polygon
long onCmdSetCustomGeometryPoint(FXObject *, FXSelector, void *)
set custom geometry point
bool removeRestrictedLane(GNELane *lane, SUMOVehicleClass vclass)
remove restricted lane
long onCmdIntervalBarDataSet(FXObject *, FXSelector, void *)
change data set in interval bar
GNEViewNetHelper::SaveElements & getSaveElements()
get variable used to save elements
Definition: GNEViewNet.cpp:929
void processLeftButtonReleaseDemand()
process left button release function in Supermode Demand
void resetLastClickedPosition()
reset last clicked position
Definition: GNEViewNet.cpp:813
const GNEViewNetHelper::TestingMode & getTestingMode() const
get testing mode
Definition: GNEViewNet.cpp:709
GNEUndoList * getUndoList() const
get the undoList object
void processLeftButtonPressData(void *eventData)
process left button press function in Supermode Data
long onCmdTransformPOI(FXObject *, FXSelector, void *)
transform POI to POILane, and vice versa
void saveVisualizationSettings() const
Definition: GNEViewNet.cpp:675
GNEViewNetHelper::SaveElements mySaveElements
variable used for grouping all variables related with salve elements
Definition: GNEViewNet.h:689
const GNEViewNetHelper::MoveMultipleElementModul & getMoveMultipleElementValues() const
get move multiple element values
Definition: GNEViewNet.cpp:532
GNEViewNetHelper::LockManager myLockManager
lock manager
Definition: GNEViewNet.h:701
long onCmdAddEdgeSelected(FXObject *, FXSelector, void *)
select Edge under cursor
long onCmdIntervalBarSetEnd(FXObject *, FXSelector, void *)
change end in interval bar
const GNEViewNetHelper::ViewObjectsSelector & getViewObjectsSelector() const
get objects under cursor
Definition: GNEViewNet.cpp:468
void drawTemporalDrawingShape() const
draw temporal polygon shape in Polygon Mode
void setLastCreatedRoute(GNEDemandElement *lastCreatedRoute)
set last created route
void removeFromAttributeCarrierInspected(const GNEAttributeCarrier *AC)
remove given AC of list of inspected Attribute Carriers
void drawTestsCircle() const
draw circle in testing mode (needed for grid)
long onCmdSplitEdgeBidi(FXObject *, FXSelector, void *)
split edge at cursor position
long onCmdAddJoinTLS(FXObject *, FXSelector, void *)
add Join TLS
GUIGlID getToolTipID()
returns the id of object under cursor to show their tooltip
Definition: GNEViewNet.cpp:331
GNEJunction * getJunctionAtPopupPosition()
try to retrieve a junction at popup position
void drawTemporalSplitJunction() const
draw temporal split junction in create edge mode
long onCmdSetSupermode(FXObject *, FXSelector sel, void *)
long onCmdToggleExtendSelection(FXObject *, FXSelector, void *)
toggle extend selection
GNEViewNetHelper::DemandCheckableButtons myDemandCheckableButtons
variable used to save checkable buttons for Supermode Demand
Definition: GNEViewNet.h:642
const GUIGlObject * getFrontGLObject() const
get front glObject
bool aksChangeSupermode(const std::string &operation, Supermode expectedSupermode)
ask about change supermode
Definition: GNEViewNet.cpp:881
GNETAZ * getTAZAtPopupPosition()
try to retrieve a TAZ at popup position
long onCmdSetMode(FXObject *, FXSelector sel, void *)
called when user press a mode button (Network or demand)
long onCmdResetEdgeEndpoint(FXObject *, FXSelector, void *)
change geometry endpoint
long onCmdIntervalBarSetBegin(FXObject *, FXSelector, void *)
change begin in interval bar
long onCmdResetLength(FXObject *, FXSelector, void *)
reset custom edge lengths
Position myLastClickedPosition
last clicked position
Definition: GNEViewNet.h:728
long onCmdSelectPolygonElements(FXObject *, FXSelector, void *)
select elements within polygon boundary
long onLeftBtnRelease(FXObject *, FXSelector, void *)
called when user releases mouse's left button
long onCmdRemoveSelected(FXObject *, FXSelector, void *)
unselect AC under cursor
long onCmdDeleteGeometryPoint(FXObject *, FXSelector, void *)
delete the closes geometry point
long onCmdDuplicateLane(FXObject *, FXSelector, void *)
duplicate selected lane
std::vector< GNEAttributeCarrier * > myInspectedAttributeCarriers
current inspected attribute carrier
Definition: GNEViewNet.h:716
void processLeftButtonPressNetwork(void *eventData)
mouse process functions
void hotkeyEnter()
handle enter keypress
GNEConnection * getConnectionAtPopupPosition()
try to retrieve a connection at popup position
const std::vector< GNEAttributeCarrier * > & getInspectedAttributeCarriers() const
get inspected attribute carriers
long onKeyPress(FXObject *o, FXSelector sel, void *data)
called when user press a key
long onCmdToggleShowOverlappedRoutes(FXObject *, FXSelector, void *)
toggle hide non inspected demand elements
long onCmdToggleAutoOppositeEdge(FXObject *, FXSelector, void *)
toggle autoOpposite edge
long onCmdSplitEdge(FXObject *, FXSelector, void *)
split edge at cursor position
GNEViewNetHelper::LockManager & getLockManager()
get lock manager
bool mergeJunctions(GNEJunction *movedJunction, GNEJunction *targetJunction)
try to merge moved junction with another junction in that spot return true if merging did take place
Definition: GNEViewNet.cpp:847
long onCmdStraightenEdgesElevation(FXObject *, FXSelector, void *)
interpolate z values linear between junctions
void updateControls()
update control contents after undo/redo or recompute
~GNEViewNet()
destructor
Definition: GNEViewNet.cpp:294
GNEViewNetHelper::MoveMultipleElementModul myMoveMultipleElements
modul used for moving multiple elements
Definition: GNEViewNet.h:673
long onCmdSplitJunctionReconnect(FXObject *, FXSelector, void *)
split junction into multiple junctions and reconnect them
void buildSelectionACPopupEntry(GUIGLObjectPopupMenu *ret, GNEAttributeCarrier *AC)
Builds an entry which allows to (de)select the object.
Definition: GNEViewNet.cpp:538
void hotkeyDel()
handle del keypress
long onCmdToggleChangeAllPhases(FXObject *, FXSelector, void *)
toggle change all phases
long onEnterConvertRoundabout(FXObject *, FXSelector, void *)
enter to convert junction to roundabout
bool myDrawPreviewRoundabout
draw preview roundabout
Definition: GNEViewNet.h:725
bool isAttributeCarrierInspected(const GNEAttributeCarrier *AC) const
check if attribute carrier is being inspected
GNEViewNet()
FOX needs this.
long onCmdToggleTAZRelDrawing(FXObject *, FXSelector, void *)
toggle TAZRel drawing
long onCmdToggleShowJunctionBubbles(FXObject *, FXSelector, void *)
toggle show junction bubbles
bool selectingDetectorsTLSMode() const
check if we're selecting detectors in TLS mode
Definition: GNEViewNet.cpp:911
bool selectingJunctionsTLSMode() const
check if we're selecting junctions in TLS mode
Definition: GNEViewNet.cpp:920
long onCmdToggleShowAdditionalSubElements(FXObject *, FXSelector, void *)
toggle show additional sub-elements
long onCmdSmoothEdgesElevation(FXObject *, FXSelector, void *)
smooth elevation with regard to adjoining edges
long onCmdToggleShowAllContainerPlans(FXObject *, FXSelector, void *)
toggle show all container plans in super mode demand
long onCmdResetJunctionShape(FXObject *, FXSelector, void *)
reset junction shape
long onCmdToggleTAZRelOnlyFrom(FXObject *, FXSelector, void *)
toggle TAZRez only from
long onRightBtnRelease(FXObject *, FXSelector, void *)
called when user releases mouse's right button
void buildColorRainbow(const GUIVisualizationSettings &s, GUIColorScheme &scheme, int active, GUIGlObjectType objectType, const GUIVisualizationRainbowSettings &rs)
recalibrate color scheme according to the current value range
Definition: GNEViewNet.cpp:745
long onCmdIntervalBarSetParameter(FXObject *, FXSelector, void *)
change parameter in interval bar
void drawTemporalE1TLSLines() const
draw temporal E1 TLS Lines
long onCmdReverseEdge(FXObject *, FXSelector, void *)
reverse edge
void deleteDataAttributeCarriers(const std::vector< GNEAttributeCarrier * > ACs)
delete data attribute carriers
void processLeftButtonReleaseData()
process left button release function in Supermode Data
long onCmdToggleShowAdditionals(FXObject *, FXSelector, void *)
toggle show additionals in super mode data
long onCmdToggleLockPerson(FXObject *, FXSelector, void *)
toggle lock person in super mode demand
GNEViewNetHelper::TimeFormat & getTimeFormat()
get variable used to switch between time formats
Definition: GNEViewNet.cpp:935
GNENet * myNet
Pointer to current net. (We are not responsible for deletion)
Definition: GNEViewNet.h:707
GNEPoly * getPolygonAtPopupPosition()
try to retrieve a polygon at popup position
long onCmdToggleSelectEdges(FXObject *, FXSelector, void *)
toggle select edges
GNEViewNetHelper::DataViewOptions myDataViewOptions
variable used to save variables related with view options in supermode Data
Definition: GNEViewNet.h:659
int myDrawingToggle
drawin toggle (used in drawGLElements to avoid draw elements twice)
Definition: GNEViewNet.h:734
long onCmdToggleShowTrips(FXObject *, FXSelector, void *)
toggle show all trips in super mode demand
long onCmdToggleHideShapes(FXObject *, FXSelector, void *)
toggle hide shapes in super mode demand
long onCmdEditEdgeEndpoint(FXObject *, FXSelector, void *)
change geometry endpoint
const GNEViewNetHelper::DemandViewOptions & getDemandViewOptions() const
get demand view options
Definition: GNEViewNet.cpp:721
void deleteDemandAttributeCarriers(const std::vector< GNEAttributeCarrier * > ACs)
delete given demand attribute carriers
void updateViewNet() const
Mark the entire GNEViewNet to be repainted later.
Definition: GNEViewNet.cpp:410
long onCmdToggleHideConnections(FXObject *, FXSelector, void *)
toggle hide connections
void openDeleteDialogAtCursor(const std::vector< GUIGlObject * > &GLObjects)
open delete dialog at cursor
Definition: GNEViewNet.cpp:645
long onKeyRelease(FXObject *o, FXSelector sel, void *data)
called when user release a key
long onCmdResetConnections(FXObject *, FXSelector, void *)
reset junction connections
void setInspectedAttributeCarriers(const std::vector< GNEAttributeCarrier * > ACs)
set inspected attributeCarrier
long onCmdResetLaneCustomShape(FXObject *, FXSelector, void *)
reset custom shapes of selected lanes
bool addRestrictedLane(GNELane *lane, SUMOVehicleClass vclass, const bool insertAtFront)
add restricted lane
void setStatusBarText(const std::string &text)
set statusBar text
Definition: GNEViewNet.cpp:807
long onCmdEditWalkingAreaShape(FXObject *, FXSelector, void *)
edit walkingArea shape
void processMoveMouseDemand(const bool mouseLeftButtonPressed)
process move mouse function in Supermode Demand
long onCmdResetOppositeLane(FXObject *, FXSelector, void *)
reset oppositeLane of current lane
void setSelectorFrameScale(double selectionScale)
set selection scaling (in GNESelectorFrame)
Definition: GNEViewNet.cpp:829
void viewUpdated()
called when view is updated
Definition: GNEViewNet.cpp:423
long onCmdEditConnectionShape(FXObject *, FXSelector, void *)
edit connection shape
void updateDemandModeSpecificControls()
updates Demand mode specific controls
void forceSupemodeNetwork()
force supermode network(used after load/create new network)
Definition: GNEViewNet.cpp:417
GNEAdditional * getAdditionalAtPopupPosition()
try to retrieve a additional at popup position
long onCmdReverse(FXObject *, FXSelector, void *)
reverse current demand element
void drawTemporalJunction() const
draw temporal junction in create edge mode
long onCmdSelectRoundabout(FXObject *, FXSelector, void *)
select all roundabout nodes and edges
long onLeftBtnPress(FXObject *, FXSelector, void *)
std::vector< std::string > getRelDataAttrs() const
return list of loaded edgeRelation and tazRelation attributes
int drawGLElements(const Boundary &bound)
draw functions
long onCmdIntervalBarLimit(FXObject *, FXSelector, void *)
change limit interval in interval bar
GNEViewNetHelper::ViewObjectsSelector myViewObjectsSelector
variable use to select objects in view
Definition: GNEViewNet.h:611
A single child window which contains a view of the simulation area.
Definition: GNEViewParent.h:88
GNECrossingFrame * getCrossingFrame() const
get frame for NETWORK_CROSSING
GNEConnectorFrame * getConnectorFrame() const
get frame for NETWORK_CONNECT
GNEStopFrame * getStopFrame() const
get frame for DEMAND_STOP
GNEProhibitionFrame * getProhibitionFrame() const
get frame for NETWORK_PROHIBITION
GNEPersonPlanFrame * getPersonPlanFrame() const
get frame for DEMAND_PERSONFRAME
GNEMeanDataFrame * getMeanDataFrame() const
get frame for DATA_TAZRELDATA
GNEShapeFrame * getShapeFrame() const
get frame for NETWORK_SHAPE
GNETAZRelDataFrame * getTAZRelDataFrame() const
get frame for DATA_TAZRELDATA
GNEMoveFrame * getMoveFrame() const
get frame for move elements
GNESelectorFrame * getSelectorFrame() const
get frame for select elements
GNEContainerPlanFrame * getContainerPlanFrame() const
get frame for DEMAND_CONTAINERFRAME
GNEEdgeDataFrame * getEdgeDataFrame() const
get frame for DATA_EDGEDATA
GNEDeleteFrame * getDeleteFrame() const
get frame for delete elements
GNETypeDistributionFrame * getTypeDistributionFrame() const
get frame for DEMAND_TYPEDISTRIBUTION
GNEVehicleFrame * getVehicleFrame() const
get frame for DEMAND_VEHICLE
GNEDecalFrame * getDecalFrame() const
get frame for NETWORK_DECAL
void hideAllFrames()
hide all frames
GNETypeFrame * getTypeFrame() const
get frame for DEMAND_TYPE
GNETAZFrame * getTAZFrame() const
get frame for NETWORK_TAZ
GNETLSEditorFrame * getTLSEditorFrame() const
get frame for NETWORK_TLS
GNEApplicationWindow * getGNEAppWindows() const
get GNE Application Windows
GNEContainerFrame * getContainerFrame() const
get frame for DEMAND_CONTAINER
GNEAdditionalFrame * getAdditionalFrame() const
get frame for NETWORK_ADDITIONAL
GNERouteDistributionFrame * getRouteDistributionFrame() const
get frame for DEMAND_ROUTEDISTRIBUTION
GNEWireFrame * getWireFrame() const
get frame for NETWORK_WIRE
GNEPersonFrame * getPersonFrame() const
get frame for DEMAND_PERSON
GNEInspectorFrame * getInspectorFrame() const
get frame for inspect elements
GNEEdgeRelDataFrame * getEdgeRelDataFrame() const
get frame for DATA_EDGERELDATA
GNECreateEdgeFrame * getCreateEdgeFrame() const
get frame for NETWORK_CREATEEDGE
GNERouteFrame * getRouteFrame() const
get frame for DEMAND_ROUTE
This object is responsible for drawing a shape and for supplying a a popup menu. Messages are routete...
GNEJunction * getParentJunction() const
get parent Junction
GNEConsecutiveSelector * getConsecutiveLaneSelector() const
get consecutive lane selector
bool createPath(const bool useLastRoute)
create path
void show()
show wire frame
bool addWire(const GNEViewNetHelper::ViewObjectsSelector &viewObjects)
add wire element
bool contains(const std::string &name) const
Returns the information whether a setting with the given name is stored.
GUIVisualizationSettings & get(const std::string &name)
Returns the named scheme.
const std::vector< std::string > & getNames() const
Returns a list of stored settings names.
Dialog for edit rerouter intervals.
static FXCursor * getCursor(GUICursor which)
returns a cursor previously defined in the enum GUICursor
static FXMenuCommand * buildFXMenuCommand(FXComposite *p, const std::string &text, FXIcon *icon, FXObject *tgt, FXSelector sel, const bool disable=false)
build menu command
Definition: GUIDesigns.cpp:42
std::string getCurrentScheme() const
Returns the name of the currently chosen scheme.
void setCurrentScheme(const std::string &)
Sets the named scheme as the current.
The popup menu of a globject.
static void drawGeometry(const GUIVisualizationSettings::Detail d, const GUIGeometry &geometry, const double width, double offset=0)
draw geometry
static void drawChildLine(const GUIVisualizationSettings &s, const Position &child, const Position &parent, const RGBColor &color, const bool drawEntire, const double lineWidth)
draw line between child and parent (used in netedit)
void updateGeometry(const PositionVector &shape)
update entire geometry
Definition: GUIGeometry.cpp:59
MFXComboBoxIcon * getColoringSchemesCombo()
return combobox with the current coloring schemes (standard, fastest standard, real world....
FXPopup * getLocatorPopup()
@ brief return a pointer to locator popup
GUIGlObjectType getType() const
Returns the type of the object as coded in GUIGlObjectType.
Definition: GUIGlObject.h:156
const std::string & getMicrosimID() const
Returns the id of the object as known to microsim.
Definition: GUIGlObject.h:143
virtual bool isGLObjectLocked() const
check if element is locked (Currently used only in netedit)
GUIGlID getGlID() const
Returns the numerical id of the object.
Definition: GUIGlObject.h:104
GUIGlObject * getObjectBlocking(GUIGlID id) const
Returns the object from the container locking it.
static GUIGlObjectStorage gIDStorage
A single static instance of this class.
static FXIcon * getIcon(const GUIIcon which)
returns a icon previously defined in the enum GUIIcon
MFXStaticToolTip * getStaticTooltipMenu() const
get static toolTip for menus
virtual void setStatusBarText(const std::string &)
get status bar text (can be implemented in children)
virtual double getRotation() const =0
Returns the rotation of the canvas stored in this changer.
virtual double getZoom() const =0
Returns the zoom factor computed stored in this changer.
virtual void onLeftBtnPress(void *data)
mouse functions
virtual double getXPos() const =0
Returns the x-offset of the field to show stored in this changer.
virtual double getYPos() const =0
Returns the y-offset of the field to show stored in this changer.
T getColor(const double value) const
const std::string & getName() const
int addColor(const T &color, const double threshold, const std::string &name="")
bool myAmInitialised
Internal information whether doInit() was called.
Position snapToActiveGrid(const Position &pos, bool snapXY=true) const
Returns a position that is mapped to the closest grid point if the grid is active.
std::vector< GUIGlObject * > myCurrentObjectsDialog
vector with current objects dialog
virtual long onLeftBtnRelease(FXObject *, FXSelector, void *)
const SUMORTree * myGrid
The visualization speed-up.
void openObjectDialog(const std::vector< GUIGlObject * > &objects, const bool filter=true)
open object dialog for the given object
void paintGLGrid() const
paints a grid
FXbool makeCurrent()
A reimplementation due to some internal reasons.
Position myClickedPopupPosition
clicked poup position
void buildMinMaxRainbow(const GUIVisualizationSettings &s, GUIColorScheme &scheme, const GUIVisualizationRainbowSettings &rs, double minValue, double maxValue, bool hasMissingData)
helper function for buildColorRainbow
virtual long onMiddleBtnRelease(FXObject *, FXSelector, void *)
virtual long onMouseMove(FXObject *, FXSelector, void *)
bool myPanning
Panning flag.
GUIMainWindow * myApp
The application.
std::vector< GUIGlID > getObjectsInBoundary(Boundary bound)
returns the ids of all objects in the given boundary
const Position & getPopupPosition() const
get position of current popup
double m2p(double meter) const
meter-to-pixels conversion method
GUIVisualizationSettings * myVisualizationSettings
visualization settings
void destroyPopup()
destroys the popup
virtual long onKeyPress(FXObject *o, FXSelector sel, void *data)
keyboard functions
virtual long onMiddleBtnPress(FXObject *, FXSelector, void *)
virtual Position getPositionInformation() const
Returns the cursor's x/y position within the network.
virtual long onKeyRelease(FXObject *o, FXSelector sel, void *data)
GUIDialog_ViewSettings * myGUIDialogViewSettings
Visualization changer.
void drawDecals()
Draws the stored decals.
virtual long onRightBtnRelease(FXObject *, FXSelector, void *)
GUIPerspectiveChanger * myChanger
The perspective changer.
GUIGLObjectPopupMenu * myPopup
The current popup-menu.
virtual long onPaint(FXObject *, FXSelector, void *)
virtual long onRightBtnPress(FXObject *, FXSelector, void *)
void openPopupDialog()
open popup dialog
static void resetTextures()
Reset textures.
void updateFrontElement(const GUIGlObject *GLObject)
move front element in elements under cursor (currently used only in netedit)
void setSelectionPosition(const Position &pos)
set selection position (usually the mouse position)
void isolateEdgeGeometryPoints()
isolate edge geometry points (used for moving)
void setSelectionBoundary(const Boundary &boundary)
set selection boundary (usually the mouse position)
const GLObjectsSortedContainer & getSelectedObjects() const
get all elements under cursor sorted by layer
void clearSelectedElements()
clear selected elements
const GNEEdge * markedEdge
marked edge (used in create edge mode, for splitting)
const GNELane * markedLane
marked lane (used in create edge mode, for splitting)
Stores the information about how to visualize structures.
GUIVisualizationSizeSettings junctionSize
bool drawForRectangleSelection
whether drawing is performed for the purpose of selecting objects using a rectangle
std::string name
The name of this setting.
bool drawJunctionShape
whether the shape of the junction should be drawn
bool disableLaneIcons
whether drawing is performed in left-hand networks
bool lefthand
whether drawing is performed in left-hand networks
bool showLane2Lane
Information whether lane-to-lane arrows shall be drawn.
GUIVisualizationColorSettings colorSettings
color settings
bool showGrid
Information whether a grid shall be shown.
void save(OutputDevice &dev) const
Writes the settings into an output device.
double scale
information about a lane's width (temporary, used for a single view)
bool drawForViewObjectsHandler
whether drawing is performed for the purpose of selecting objects in view using ViewObjectsHandler
GUIVisualizationAdditionalSettings additionalSettings
Additional settings.
double selectorFrameScale
the current selection scaling in netedit (set in SelectorFrame)
GUIColorer junctionColorer
The junction colorer.
static const std::string SCHEME_NAME_PERMISSION_CODE
GUIVisualizationNeteditSizeSettings neteditSizeSettings
netedit size settings
bool amChecked() const
check if this MFXCheckableButton is checked
void setChecked(bool val, const bool inform=false)
check or uncheck this MFXCheckableButton
long setCurrentItem(const FXint index, FXbool notify=FALSE)
Set the current item (index is zero-based)
FXint getNumItems() const
Return the number of items in the list.
FXint appendIconItem(const FXString &text, FXIcon *icon=nullptr, FXColor bgColor=FXRGB(255, 255, 255), void *ptr=nullptr)
append icon item in the last position
EdgeVector getAllEdges() const
return all edges
The representation of a single edge during network building.
Definition: NBEdge.h:92
const PositionVector & getGeometry() const
Returns the geometry of the edge.
Definition: NBEdge.h:779
const PositionVector getInnerGeometry() const
Returns the geometry of the edge without the endpoints.
Definition: NBEdge.cpp:583
const std::set< NBTrafficLightDefinition * > & getControllingTLS() const
Returns the traffic lights that were assigned to this node (The set of tls that control this node)
Definition: NBNode.h:336
const PositionVector & getShape() const
retrieve the junction shape
Definition: NBNode.cpp:2605
const Position & getPosition() const
Definition: NBNode.h:260
bool exist(const std::string &newID, bool requireComputed=true) const
check if exists a definition with the given ID
bool getBool(const std::string &name) const
Returns the boolean-value of the named option (only for Option_Bool)
static OptionsCont & getOptions()
Retrieves the options.
Definition: OptionsCont.cpp:60
Static storage of an output device and its base (abstract) implementation.
Definition: OutputDevice.h:61
void close()
Closes the device and removes it from the dictionary.
OutputDevice & openTag(const std::string &xmlElement)
Opens an XML tag.
OutputDevice & writeAttr(const SumoXMLAttr attr, const T &val)
writes a named attribute
Definition: OutputDevice.h:254
bool closeTag(const std::string &comment="")
Closes the most recently opened tag and optionally adds a comment.
static OutputDevice & getDevice(const std::string &name, bool usePrefix=true)
Returns the described OutputDevice.
C++ TraCI client API implementation.
Definition: POI.h:34
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:37
static const Position INVALID
used to indicate that a position is valid
Definition: Position.h:317
double distanceTo(const Position &p2) const
returns the euclidean distance in 3 dimensions
Definition: Position.h:261
double distanceSquaredTo(const Position &p2) const
returns the square of the distance to another position
Definition: Position.h:266
double x() const
Returns the x-position.
Definition: Position.h:55
double y() const
Returns the y-position.
Definition: Position.h:60
A list of positions.
Position positionAtOffset(double pos, double lateralOffset=0) const
Returns the position at the given length.
double nearest_offset_to_point2D(const Position &p, bool perpendicular=true) const
return the nearest offest to point 2D
int indexOfClosest(const Position &p, bool twoD=false) const
void move2side(double amount, double maxExtension=100)
move position vector to side using certain amount
Boundary getBoxBoundary() const
Returns a boundary enclosing this list of lines.
void pop_front()
pop first Position
void setAlpha(unsigned char alpha)
Sets a new alpha value.
Definition: RGBColor.cpp:108
static const RGBColor BLUE
Definition: RGBColor.h:187
static const RGBColor ORANGE
Definition: RGBColor.h:191
static const RGBColor GREEN
Definition: RGBColor.h:186
static RGBColor fromHSV(double h, double s, double v)
Converts the given hsv-triplet to rgb, inspired by http://alvyray.com/Papers/CG/hsv2rgb....
Definition: RGBColor.cpp:371
static const RGBColor BLACK
Definition: RGBColor.h:193
static const RGBColor RED
named colors
Definition: RGBColor.h:185
const PositionVector & getShape() const
Returns the shape of the polygon.
Definition: SUMOPolygon.cpp:51
void addAdditionalGLObject(GUIGlObject *o, const double exaggeration=1)
Adds an additional object (detector/shape/trigger) for visualisation.
Definition: SUMORTree.h:124
void removeAdditionalGLObject(GUIGlObject *o, const double exaggeration=1)
Removes an additional object (detector/shape/trigger) from being visualised.
Definition: SUMORTree.h:160
virtual int Search(const float a_min[2], const float a_max[2], const GUIVisualizationSettings &c) const
Find all within search rectangle.
Definition: SUMORTree.h:116
DemandViewOptions demandViewOptions
demand view options
NetworkViewOptions networkViewOptions
network view options
FXMenuBar * modes
The application menu bar (for select, inspect...)
void buildCommonCheckableButtons()
build checkable buttons
void updateCommonCheckableButtons()
update Common checkable buttons
void disableCommonCheckableButtons()
hide all options menu checks
MFXCheckableButton * selectButton
checkable button for edit mode select
MFXCheckableButton * inspectButton
checkable button for edit mode inspect
MFXCheckableButton * deleteButton
checkable button for edit mode delete
void disableDataCheckableButtons()
hide all options menu checks
void buildDataCheckableButtons()
build checkable buttons
void updateDataCheckableButtons()
update Data checkable buttons
MFXCheckableButton * edgeDataButton
checkable button for edit mode "edgeData"
MFXCheckableButton * edgeRelDataButton
checkable button for edit mode "edgeRelData"
MFXCheckableButton * TAZRelDataButton
checkable button for edit mode "TAZRelData"
MFXCheckableButton * meanDataButton
checkable button for edit mode "meanData"
struct used to group all variables related to view options in supermode Data
void hideDataViewOptionsMenuChecks()
hide all options menu checks
MFXCheckableButton * menuCheckToggleTAZDrawFill
menu check to toggle TAZ draw fill
MFXCheckableButton * menuCheckShowAdditionals
menu check to show Additionals
MFXCheckableButton * menuCheckShowShapes
menu check to show Shapes
MFXCheckableButton * menuCheckToggleTAZRelOnlyFrom
menu check to toggle TAZRel only from
MFXCheckableButton * menuCheckToggleDrawJunctionShape
checkable button to show junction shapes
void buildDataViewOptionsMenuChecks()
build menu checks
MFXCheckableButton * menuCheckToggleTAZRelDrawing
menu check to toggle TAZ Rel drawing
MFXCheckableButton * menuCheckShowDemandElements
menu check to show Demand Elements
MFXCheckableButton * menuCheckToggleTAZRelOnlyTo
menu check to toggle TAZRel only to
MFXCheckableButton * routeDistributionButton
checkable button for edit mode create route distributions
MFXCheckableButton * containerButton
checkable button for edit mode create containers
MFXCheckableButton * moveDemandElementsButton
checkable button for edit mode "move demand elements"
MFXCheckableButton * typeButton
checkable button for edit mode create type
void buildDemandCheckableButtons()
build checkable buttons
MFXCheckableButton * vehicleButton
checkable button for edit mode create vehicles
MFXCheckableButton * containerPlanButton
checkable button for edit mode create container plans
MFXCheckableButton * routeButton
checkable button for edit mode create routes
MFXCheckableButton * stopButton
checkable button for edit mode create stops
MFXCheckableButton * personPlanButton
checkable button for edit mode create person plans
MFXCheckableButton * personButton
checkable button for edit mode create persons
void updateDemandCheckableButtons()
update Demand checkable buttons
MFXCheckableButton * typeDistributionButton
checkable button for edit mode create type distribution
void disableDemandCheckableButtons()
hide all options menu checks
struct used to group all variables related to view options in supermode Demand
MFXCheckableButton * menuCheckShowAllTrips
show all trips
void lockPerson(const GNEDemandElement *person)
lock person
MFXCheckableButton * menuCheckToggleGrid
menu check to show grid button
MFXCheckableButton * menuCheckToggleDrawJunctionShape
checkable button to show junction shapes
void lockContainer(const GNEDemandElement *container)
lock container
void buildDemandViewOptionsMenuChecks()
build menu checks
const GNEDemandElement * getLockedPerson() const
get locked person
MFXCheckableButton * menuCheckDrawSpreadVehicles
menu check to draw vehicles in begin position or spread in lane
MFXCheckableButton * menuCheckShowOverlappedRoutes
show overlapped routes
void hideDemandViewOptionsMenuChecks()
hide all options menu checks
MFXCheckableButton * menuCheckShowAllPersonPlans
show all person plans
MFXCheckableButton * menuCheckShowAllContainerPlans
show all container plans
MFXCheckableButton * menuCheckHideNonInspectedDemandElements
Hide non inspected demand elements.
MFXCheckableButton * menuCheckHideShapes
Hide shapes (Polygons and POIs)
MFXCheckableButton * menuCheckLockPerson
Lock Person.
MFXCheckableButton * menuCheckLockContainer
Lock Container.
struct used to group all variables related with Supermodes
DataEditMode dataEditMode
the current Data edit mode
void buildSuperModeButtons()
build checkable buttons
DemandEditMode demandEditMode
the current Demand edit mode
Supermode currentSupermode
the current supermode
NetworkEditMode networkEditMode
the current Network edit mode
bool isCurrentSupermodeDemand() const
@check if current supermode is Demand
void setDemandEditMode(DemandEditMode demandMode, const bool force=false)
set Demand edit mode
MFXCheckableButton * dataButton
checkable button for supermode Data
bool isCurrentSupermodeData() const
@check if current supermode is Data
void setView(FXSelector sel)
set view
bool isCurrentSupermodeNetwork() const
@check if current supermode is Network
MFXCheckableButton * networkButton
checkable button for supermode Network
bool isJuPedSimView() const
check if default view is enabled
void setSupermode(Supermode supermode, const bool force)
set supermode
MFXCheckableButton * demandButton
checkable button for supermode Demand
void setNetworkEditMode(NetworkEditMode networkMode, const bool force=false)
set Network edit mode
void setDataEditMode(DataEditMode dataMode, const bool force=false)
set Data edit mode
struct used to group all variables related with edit shapes of NetworkElements
GNENetworkElement * getEditedNetworkElement() const
pointer to edited network element
void startEditCustomShape(GNENetworkElement *element)
start edit custom shape
class used to group all variables related with mouse buttons and key pressed after certain events
bool shiftKeyPressed() const
check if SHIFT is pressed during current event
bool altKeyPressed() const
check if ALT is pressed during current event
void update(void *eventData)
update status of MouseButtonKeyPressed during current event
bool controlKeyPressed() const
check if CONTROL is pressed during current event
bool mouseLeftButtonPressed() const
check if mouse left button is pressed during current event
struct used to group all variables related with movement of groups of elements
void moveSelection(const bool mouseLeftButtonPressed)
move selection
void finishMoveSelection()
finish moving selection
bool isMovingSelection() const
check if currently there is element being moved
void resetMovingSelectedEdge()
reset flag for moving edge
bool isMovingElements() const
check if there are moving elements
bool isMovingElements() const
check if there are moving elements
bool beginMoveSingleElementDemandMode()
begin move single element in Demand mode
void moveSingleElement(const bool mouseLeftButtonPressed)
move single element in Network AND Demand mode
bool beginMoveSingleElementNetworkMode()
begin move single element in Network mode
bool beginMoveNetworkElementShape()
begin move network elementshape
void finishMoveSingleElement()
finish moving single elements in Network AND Demand mode
void updateNetworkCheckableButtons()
update network checkable buttons
MFXCheckableButton * trafficLightButton
checkable button for edit mode traffic light
MFXCheckableButton * moveNetworkElementsButton
checkable button for edit mode "move network elements"
MFXCheckableButton * additionalButton
checkable button for edit mode additional
MFXCheckableButton * crossingButton
checkable button for edit mode crossing
MFXCheckableButton * createEdgeButton
checkable button for edit mode create edge
MFXCheckableButton * prohibitionButton
checkable button for edit mode prohibition
void buildNetworkCheckableButtons()
build checkable buttons
MFXCheckableButton * shapeButton
checkable button for edit mode shape
MFXCheckableButton * connectionButton
checkable button for edit mode connection
MFXCheckableButton * TAZButton
checkable button for edit mode TAZ
void disableNetworkCheckableButtons()
hide all options menu checks
MFXCheckableButton * wireButton
checkable button for edit mode wires
MFXCheckableButton * decalButton
checkable button for edit mode decals
struct used to group all variables related to view options in supermode Network
MFXCheckableButton * menuCheckSelectEdges
checkable button to select only edges
MFXCheckableButton * menuCheckChainEdges
checkable button to the endpoint for a created edge should be set as the new source
MFXCheckableButton * menuCheckShowDemandElements
checkable button to show Demand Elements
MFXCheckableButton * menuCheckMoveElevation
checkable button to apply movement to elevation
MFXCheckableButton * menuCheckShowTAZElements
checkable button to show TAZ elements
MFXCheckableButton * menuCheckAutoOppositeEdge
check checkable to create auto create opposite edge
MFXCheckableButton * menuCheckDrawSpreadVehicles
checkable button to draw vehicles in begin position or spread in lane
MFXCheckableButton * menuCheckShowConnections
checkable button to show connections
MFXCheckableButton * menuCheckHideConnections
checkable button to hide connections in connect mode
MFXCheckableButton * menuCheckToggleDrawJunctionShape
checkable button to show junction shapes
MFXCheckableButton * menuCheckToggleGrid
checkable button to show grid button
bool selectEdges() const
check if select edges checkbox is enabled
MFXCheckableButton * menuCheckShowJunctionBubble
checkable button to show connection as bubble in "Move" mode.
MFXCheckableButton * menuCheckWarnAboutMerge
checkable button to we should warn about merging junctions
void hideNetworkViewOptionsMenuChecks()
hide all options menu checks
MFXCheckableButton * menuCheckShowAdditionalSubElements
checkable button to show additional sub-elements
void buildNetworkViewOptionsMenuChecks()
build menu checks
MFXCheckableButton * menuCheckChangeAllPhases
checkable button to set change all phases
MFXCheckableButton * menuCheckExtendSelection
checkable button to extend to edge nodes
struct used to group all variables related with save elements
void buildSaveElementsButtons()
build save buttons
void finishRectangleSelection()
finish rectangle selection
void drawRectangleSelection(const RGBColor &color) const
draw rectangle selection
void beginRectangleSelection()
begin rectangle selection
bool selectingUsingRectangle
whether we have started rectangle-selection
void moveRectangleSelection()
move rectangle selection
bool startDrawing
whether we have started rectangle-selection
void processRectangleSelection()
process rectangle Selection
std::vector< GNEEdge * > processEdgeRectangleSelection()
process rectangle Selection (only limited to Edges)
struct used to group all variables related with testing
void drawTestingElements(GUIMainWindow *mainWindow)
draw testing element
struct used to group all variables related with time format
void buildTimeFormatButtons()
build time format buttons
static const RGBColor TLSConnectionColor
connection color between E1/junctions and TLS
RGBColor selectionColor
basic selection color
static const double junctionBubbleRadius
junction bubble radius
double getExaggeration(const GUIVisualizationSettings &s, const GUIGlObject *o, double factor=20) const
return the drawing size including exaggeration and constantSize values