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  // edit custom shapes
226  // POIs
227  FXMAPFUNC(SEL_COMMAND, MID_GNE_POI_TRANSFORM, GNEViewNet::onCmdTransformPOI),
228  // Demand elements
229  FXMAPFUNC(SEL_COMMAND, MID_GNE_REVERSE, GNEViewNet::onCmdReverse),
230  FXMAPFUNC(SEL_COMMAND, MID_GNE_ADDREVERSE, GNEViewNet::onCmdAddReverse),
231  // Geometry Points
234  // toolbar views
235  FXMAPFUNC(SEL_COMMAND, MID_GNE_VIEW_DEFAULT, GNEViewNet::onCmdSetNeteditView),
237  // IntervalBar
244 };
245 
246 // Object implementation
247 FXIMPLEMENT(GNEViewNet, GUISUMOAbstractView, GNEViewNetMap, ARRAYNUMBER(GNEViewNetMap))
248 
249 
250 // ===========================================================================
251 // member method definitions
252 // ===========================================================================
253 GNEViewNet::GNEViewNet(FXComposite* tmpParent, FXComposite* actualParent, GUIMainWindow& app,
254  GNEViewParent* viewParent, GNENet* net, GNEUndoList* undoList,
255  FXGLVisual* glVis, FXGLCanvas* share) :
256  GUISUMOAbstractView(tmpParent, app, viewParent, net->getGrid(), glVis, share),
257  myViewObjectsSelector(this),
258  myEditModes(this),
259  myTestingMode(this),
260  myCommonCheckableButtons(this),
261  myNetworkCheckableButtons(this),
262  myDemandCheckableButtons(this),
263  myDataCheckableButtons(this),
264  myNetworkViewOptions(this),
265  myDemandViewOptions(this),
266  myDataViewOptions(this),
267  myIntervalBar(this),
268  myMoveSingleElement(this),
269  myMoveMultipleElements(this),
270  myVehicleOptions(this),
271  myVehicleTypeOptions(this),
272  mySaveElements(this),
273  myTimeFormat(this),
274  mySelectingArea(this),
275  myEditNetworkElementShapes(this),
276  myLockManager(this),
277  myViewParent(viewParent),
278  myNet(net),
279  myUndoList(undoList) {
280  // view must be the final member of actualParent
281  reparent(actualParent);
282  // Build edit modes
283  buildEditModeControls();
284  // set this net in Net
285  myNet->setViewNet(this);
286  // set drag delay
287  ((GUIDanielPerspectiveChanger*)myChanger)->setDragDelay(100000000); // 100 milliseconds
288  // Reset textures
290  // init testing mode
291  myTestingMode.initTestingMode();
292  // update grid flags
293  myNetworkViewOptions.menuCheckToggleGrid->setChecked(myVisualizationSettings->showGrid);
294  myDemandViewOptions.menuCheckToggleGrid->setChecked(myVisualizationSettings->showGrid);
295  // update junction shape flags
296  const bool hide = !myVisualizationSettings->drawJunctionShape;
297  myNetworkViewOptions.menuCheckToggleDrawJunctionShape->setChecked(hide);
298  myDemandViewOptions.menuCheckToggleDrawJunctionShape->setChecked(hide);
299  myDataViewOptions.menuCheckToggleDrawJunctionShape->setChecked(hide);
300 }
301 
302 
304 
305 
306 void
308  if (myNet && makeCurrent()) {
309  // declare boundary
310  const Boundary maxBoundary(1000000000.0, 1000000000.0, -1000000000.0, -1000000000.0);
311  // get all objects in boundary
312  const std::vector<GUIGlID> GLIDs = getObjectsInBoundary(maxBoundary);
313  // finish make OpenGL context current
314  makeNonCurrent();
315  // declare set
316  std::set<GNEAttributeCarrier*> ACs;
317  // iterate over GUIGlIDs
318  for (const auto& GLId : GLIDs) {
320  // Make sure that object exists
321  if (AC && AC->getTagProperty().isPlacedInRTree()) {
322  ACs.insert(AC);
323  }
324  }
325  // interate over ACs
326  for (const auto& AC : ACs) {
327  // remove object and insert again with exaggeration
328  myNet->getGrid().removeAdditionalGLObject(AC->getGUIGlObject());
329  myNet->getGrid().addAdditionalGLObject(AC->getGUIGlObject(), AC->getGUIGlObject()->getExaggeration(*myVisualizationSettings));
330  }
331  }
332 }
333 
334 
335 void
337 
338 
339 GUIGlID
343  } else {
344  return 0;
345  }
346 }
347 
348 
349 void
351  // build coloring tools
352  {
353  for (auto it_names : gSchemeStorage.getNames()) {
354  v->getColoringSchemesCombo()->appendIconItem(it_names.c_str());
355  if (it_names == myVisualizationSettings->name) {
357  }
358  }
359  }
360  // for junctions
362  std::string("\t") + TL("Locate Junctions") + std::string("\t") + TL("Locate a junction within the network. (Shift+J)"),
364  // for edges
366  std::string("\t") + TL("Locate Edges") + std::string("\t") + TL("Locate an edge within the network. (Shift+E)"),
368  // for walkingAreas
370  std::string("\t") + TL("Locate WalkingAreas") + std::string("\t") + TL("Locate a walkingArea within the network. (Shift+W)"),
372  // for vehicles
374  std::string("\t") + TL("Locate Vehicles") + std::string("\t") + TL("Locate a vehicle within the network. (Shift+V)"),
376  // for person
378  std::string("\t") + TL("Locate Persons") + std::string("\t") + TL("Locate a person within the network. (Shift+P)"),
380  // for container
382  std::string("\t") + TL("Locate Containers") + std::string("\t") + TL("Locate a container within the network. (Shift+C)"),
384  // for routes
386  std::string("\t") + TL("Locate Route") + std::string("\t") + TL("Locate a route within the network. (Shift+R)"),
388  // for routes
390  std::string("\t") + TL("Locate Stops") + std::string("\t") + TL("Locate a stop within the network. (Shift+S)"),
392  // for persons (currently unused)
393  /*
394  new MFXButtonTooltip(v->getLocatorPopup(),
395  std::string("\t") + TL("Locate Vehicle\tLocate a person within the network.",
396  GUIIconSubSys::getIcon(GUIIcon::LOCATEPERSON), &v, MID_LOCATEPERSON,
397  GUIDesignButtonPopup);
398  */
399  // for tls
401  std::string("\t") + TL("Locate TLS") + std::string("\t") + TL("Locate a tls within the network. (Shift+T)"),
403  // for additional stuff
405  std::string("\t") + TL("Locate Additional") + std::string("\t") + TL("Locate an additional structure within the network. (Shift+A)"),
407  // for pois
409  std::string("\t") + TL("Locate PoI") + std::string("\t") + TL("Locate a PoI within the network. (Shift+O)"),
411  // for polygons
413  std::string("\t") + TL("Locate Polygon") + std::string("\t") + TL("Locate a Polygon within the network. (Shift+L)"),
415 }
416 
417 
418 void
420  // this call is only used for breakpoints (to check when view is updated)
421  GUISUMOAbstractView::update();
422 }
423 
424 
425 void
428 }
429 
430 
431 void
433  if (myEditModes.isJuPedSimView()) {
434  // hide data button (and adjust width)
435  myEditModes.dataButton->hide();
436  // check network modes
437  switch (myEditModes.networkEditMode) {
444  break;
445  default:
446  break;
447  }
448  // check demand modes
449  switch (myEditModes.demandEditMode) {
456  break;
457  default:
458  break;
459  }
460  // go to network mode if we're in data mode
463  } else {
464  // refresh current supermode
466  }
467  } else {
468  // show data button
469  myEditModes.dataButton->show();
470  // refresh current supermode
472  }
473 }
474 
475 
478  return myViewObjectsSelector;
479 }
480 
481 
482 void
484  // clear post drawing elements
486  // set selection boundary in gObjectsInPosition
488  // push matrix
490  // enable draw for object under cursor
492  // draw all GL elements within the small boundary
493  drawGLElements(boundary);
494  // restore draw for object under cursor
496  // pop matrix
498  // check if update front element
501  }
502  // after draw elements, update objects under cursor
504 }
505 
506 
507 void
509  // clear post drawing elements
511  // set selection position in gObjectsInPosition
513  // create an small boundary
514  Boundary positionBoundary;
515  positionBoundary.add(pos);
516  positionBoundary.grow(POSITION_EPS);
517  // push matrix
519  // enable draw for object under cursor
521  // draw all GL elements within the small boundary
522  drawGLElements(positionBoundary);
523  // check if filter edges that have the mouse over their geometry points
526  }
527  // restore draw for object under cursor
529  // pop matrix
531  // check if update front element
534  }
535  // after draw elements, update objects under cursor
537 }
538 
539 
542  return myMoveSingleElement;
543 }
544 
545 
548  return myMoveMultipleElements;
549 }
550 
551 
552 void
554  if (AC->isAttributeCarrierSelected()) {
556  } else {
558  }
559  new FXMenuSeparator(ret);
560 }
561 
562 
563 bool
564 GNEViewNet::setColorScheme(const std::string& name) {
565  if (!gSchemeStorage.contains(name)) {
566  return false;
567  }
568  if (myGUIDialogViewSettings != nullptr) {
569  if (myGUIDialogViewSettings->getCurrentScheme() != name) {
571  }
572  }
573  myVisualizationSettings = &gSchemeStorage.get(name.c_str());
574  updateViewNet();
575  return true;
576 }
577 
578 
579 void
580 GNEViewNet::openObjectDialogAtCursor(const FXEvent* /*ev*/) {
581  // reimplemented from GUISUMOAbstractView due GNEOverlappedInspection
582  ungrab();
583  // make network current
584  if (isEnabled() && myAmInitialised) {
585  // check if we're cliking while alt button is pressed
587  // set clicked popup position
589  // create cursor popup dialog for mark front element
591  // open popup dialog
592  openPopupDialog();
593  } else if (myViewObjectsSelector.getGLObjects().empty()) {
595  } else {
596  // declare filtered objects
597  std::vector<GUIGlObject*> filteredGLObjects;
598  // get GUIGLObject front
599  GUIGlObject* overlappedElement = nullptr;
600  // we need to check if we're inspecting a overlapping element
603  myInspectedAttributeCarriers.size() > 0) {
604  overlappedElement = myInspectedAttributeCarriers.front()->getGUIGlObject();
605  filteredGLObjects.push_back(overlappedElement);
606  }
607  bool connections = false;
608  bool TLS = false;
609  // fill filtered objects
610  if ((myViewObjectsSelector.getGLObjects().size() == 1) && (myViewObjectsSelector.getGLObjects().back()->getType() == GLO_EDGE)) {
611  // special case for edge geometry points (because edges uses the lane pop ups)
612  filteredGLObjects.push_back(myViewObjectsSelector.getGLObjects().back());
613  } else {
614  for (const auto& glObject : myViewObjectsSelector.getGLObjects()) {
615  // always avoid edges
616  if (glObject->getType() == GLO_EDGE) {
617  continue;
618  }
619  if (glObject->getType() == GLO_CONNECTION) {
620  connections = true;
621  }
622  if (glObject->getType() == GLO_TLLOGIC) {
623  TLS = true;
624  }
625  filteredGLObjects.push_back(glObject);
626  }
627  auto it = filteredGLObjects.begin();
628  if (connections) {
629  // filter junctions if there are connections
630  while (it != filteredGLObjects.end()) {
631  if ((*it)->getType() == GLO_JUNCTION) {
632  it = filteredGLObjects.erase(it);
633  } else {
634  it++;
635  }
636  }
637  } else if (TLS) {
638  // filter all elements except TLLogic
639  while (it != filteredGLObjects.end()) {
640  if ((*it)->getType() != GLO_TLLOGIC) {
641  it = filteredGLObjects.erase(it);
642  } else {
643  it++;
644  }
645  }
646  }
647  }
648  // remove duplicated elements using an unordered set
649  auto itDuplicated = filteredGLObjects.begin();
650  std::unordered_set<GUIGlObject*> unorderedSet;
651  for (auto itElement = filteredGLObjects.begin(); itElement != filteredGLObjects.end(); itElement++) {
652  if (unorderedSet.insert(*itElement).second) {
653  *itDuplicated++ = *itElement;
654  }
655  }
656  filteredGLObjects.erase(itDuplicated, filteredGLObjects.end());
657  // open object dialog
658  openObjectDialog(filteredGLObjects);
659  }
660  }
661 }
662 
663 
664 void
665 GNEViewNet::openDeleteDialogAtCursor(const std::vector<GUIGlObject*>& GLObjects) {
666  if (myPopup) {
667  destroyPopup();
668  }
669  // set clicked popup position
671  // create cursor popup dialog for delete element
673  myCreatedPopup = true;
674  // open popup dialog
675  openPopupDialog();
676 }
677 
678 
679 void
680 GNEViewNet::openSelectDialogAtCursor(const std::vector<GUIGlObject*>& GLObjects) {
681  if (myPopup) {
682  destroyPopup();
683  }
684  // set clicked popup position
686  // create cursor popup dialog for select element
688  myCreatedPopup = true;
689  // open popup dialog
690  openPopupDialog();
691 }
692 
693 
694 void
696  // first check if we have to save gui settings in a file (only used for testing purposes)
697  const auto& neteditOptions = OptionsCont::getOptions();
698  if (neteditOptions.getString("gui-testing.setting-output").size() > 0) {
699  try {
700  // open output device
701  OutputDevice& output = OutputDevice::getDevice(neteditOptions.getString("gui-testing.setting-output"));
702  // save view settings
704  myVisualizationSettings->save(output);
705  // save viewport (zoom, X, Y and Z)
706  output.openTag(SUMO_TAG_VIEWPORT);
711  output.closeTag();
712  output.closeTag();
713  // close output device
714  output.close();
715  } catch (...) {
716  WRITE_ERROR(TL("GUI-Settings cannot be saved in ") + neteditOptions.getString("gui-testing.setting-output"));
717  }
718  }
719 }
720 
721 
724  return myEditModes;
725 }
726 
727 
730  return myTestingMode;
731 }
732 
733 
736  return myNetworkViewOptions;
737 }
738 
739 
742  return myDemandViewOptions;
743 }
744 
745 
748  return myDataViewOptions;
749 }
750 
751 
755 }
756 
757 
761 }
762 
763 
764 void
767  assert(!scheme.isFixed());
768  double minValue = std::numeric_limits<double>::infinity();
769  double maxValue = -std::numeric_limits<double>::infinity();
770  // retrieve range
771  bool hasMissingData = false;
772  if (objectType == GLO_LANE) {
773  // XXX (see #3409) multi-colors are not currently handled. this is a quick hack
774  if (active == 9) {
775  active = 8; // segment height, fall back to start height
776  } else if (active == 11) {
777  active = 10; // segment incline, fall back to total incline
778  }
779  for (const auto& lane : myNet->getAttributeCarriers()->getLanes()) {
780  const double val = lane.second->getColorValue(s, active);
781  if (val == s.MISSING_DATA) {
782  hasMissingData = true;
783  continue;
784  }
785  minValue = MIN2(minValue, val);
786  maxValue = MAX2(maxValue, val);
787  }
788  } else if (objectType == GLO_JUNCTION) {
789  if (active == 3) {
790  for (const auto& junction : myNet->getAttributeCarriers()->getJunctions()) {
791  minValue = MIN2(minValue, junction.second->getPositionInView().z());
792  maxValue = MAX2(maxValue, junction.second->getPositionInView().z());
793  }
794  }
795  } else if (objectType == GLO_TAZRELDATA) {
796  if (active == 4) {
797  for (const auto& genericData : myNet->getAttributeCarriers()->getGenericDatas().at(SUMO_TAG_TAZREL)) {
798  const double value = genericData.second->getColorValue(s, active);
799  if (value == s.MISSING_DATA) {
800  continue;
801  }
802  minValue = MIN2(minValue, value);
803  maxValue = MAX2(maxValue, value);
804  }
805  }
806  }
808  scheme.clear();
809  // add threshold for every distinct value
810  std::set<SVCPermissions> codes;
811  for (const auto& lane : myNet->getAttributeCarriers()->getLanes()) {
812  codes.insert(lane.second->getParentEdge()->getNBEdge()->getPermissions(lane.second->getIndex()));
813  }
814  int step = MAX2(1, 360 / (int)codes.size());
815  int hue = 0;
816  for (SVCPermissions p : codes) {
817  scheme.addColor(RGBColor::fromHSV(hue, 1, 1), (double)p);
818  hue = (hue + step) % 360;
819  }
820  return;
821  }
822  buildMinMaxRainbow(s, scheme, rs, minValue, maxValue, hasMissingData);
823 }
824 
825 
826 void
827 GNEViewNet::setStatusBarText(const std::string& text) {
828  myApp->setStatusBarText(text);
829 }
830 
831 
832 void
835 }
836 
837 
838 bool
841  return false;
842  } else {
844  }
845 }
846 
847 
848 void
849 GNEViewNet::setSelectorFrameScale(double selectionScale) {
851 }
852 
853 
854 bool
857 }
858 
859 
860 bool
863 }
864 
865 
866 bool
868  // first check if there are junctions to merging
869  if (gViewObjectsHandler.getMergingJunctions().size() > 1) {
870  // get junctions (this call is neccesary because merging junctions are constants)
871  auto movedJunction = myNet->getAttributeCarriers()->retrieveJunction(gViewObjectsHandler.getMergingJunctions().at(0)->getID());
872  auto targetJunction = myNet->getAttributeCarriers()->retrieveJunction(gViewObjectsHandler.getMergingJunctions().at(1)->getID());
873  if (askMergeJunctions(movedJunction, targetJunction)) {
874  // merge moved and targed junctions
875  myNet->mergeJunctions(movedJunction, targetJunction, myUndoList);
876  return true;
877  }
878  }
879  return false;
880 }
881 
882 
883 bool
884 GNEViewNet::askMergeJunctions(const GNEJunction* movedJunction, const GNEJunction* targetJunction) {
885  // optionally ask for confirmation
887  WRITE_DEBUG("Opening FXMessageBox 'merge junctions'");
888  // open question box
889  const std::string header = TL("Confirm Junction Merger");
890  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()));
891  const FXuint answer = FXMessageBox::question(this, MBOX_YES_NO, header.c_str(), "%s", body.c_str());
892  if (answer != 1) { //1:yes, 2:no, 4:esc
893  // write warning if netedit is running in testing mode
894  if (answer == 2) {
895  WRITE_DEBUG("Closed FXMessageBox 'merge junctions' with 'No'");
896  } else if (answer == 4) {
897  WRITE_DEBUG("Closed FXMessageBox 'merge junctions' with 'ESC'");
898  }
899  return false;
900  } else {
901  // write warning if netedit is running in testing mode
902  WRITE_DEBUG("Closed FXMessageBox 'merge junctions' with 'Yes'");
903  }
904  }
905  return true;
906 }
907 
908 
909 bool
910 GNEViewNet::aksChangeSupermode(const std::string& operation, Supermode expectedSupermode) {
911  // first check if ignore option is enabled
912  if (OptionsCont::getOptions().getBool("ignore-supermode-question")) {
913  return true;
914  }
915  std::string body;
916  if (expectedSupermode == Supermode::NETWORK) {
917  body = (operation + TL(" requires switch to network mode. Continue?"));
918  } else if (expectedSupermode == Supermode::DEMAND) {
919  body = (operation + TL(" requires switch to demand mode. Continue?"));
920  } else if (expectedSupermode == Supermode::DATA) {
921  body = (operation + TL(" requires switch to data mode. Continue?"));
922  } else {
923  throw ProcessError("invalid expected supermode");
924  }
925  // open question box
926  const auto answer = FXMessageBox::question(myApp, MBOX_YES_NO, TL("Confirm switch mode"), "%s", body.c_str());
927  // restore focus to view net
928  setFocus();
929  // return answer
930  if (answer == MBOX_CLICKED_YES) {
931  myEditModes.setSupermode(expectedSupermode, true);
932  return true;
933  } else {
934  return false;
935  }
936 }
937 
938 
939 bool
941  // separate conditions for code legibly
943  const bool selectingDetectors = myViewParent->getTLSEditorFrame()->getTLSAttributes()->isSetDetectorsToggleButtonEnabled();
944  return (TLSMode && selectingDetectors);
945 }
946 
947 
948 bool
950  // separate conditions for code legibly
952  const bool selectingJunctions = myViewParent->getTLSEditorFrame()->getTLSJunction()->isJoiningJunctions();
953  return (TLSMode && selectingJunctions);
954 }
955 
956 
959  return mySaveElements;
960 }
961 
962 
965  return myTimeFormat;
966 }
967 
968 
969 bool
971  // Get selected lanes
972  const auto selectedLanes = myNet->getAttributeCarriers()->getSelectedLanes();
973  // Declare map of edges and lanes
974  std::map<GNEEdge*, GNELane*> mapOfEdgesAndLanes;
975  // Iterate over selected lanes
976  for (const auto& selectedLane : selectedLanes) {
977  mapOfEdgesAndLanes[myNet->getAttributeCarriers()->retrieveEdge(selectedLane->getParentEdge()->getID())] = selectedLane;
978  }
979  // Throw warning dialog if there hare multiple lanes selected in the same edge
980  if (mapOfEdgesAndLanes.size() != selectedLanes.size()) {
981  const std::string header = TL("Multiple lane in the same edge selected");
982  const std::string bodyA = TL("There are selected lanes that belong to the same edge.");
983  const std::string bodyB = TLF("Only one lane per edge will be restricted to %.", toString(vclass));
984  FXMessageBox::information(getApp(), MBOX_OK, header.c_str(), "%s", (bodyA + std::string("\n") + bodyB).c_str());
985  }
986  // If we handeln a set of lanes
987  if (mapOfEdgesAndLanes.size() > 0) {
988  // declare counter for number of Sidewalks
989  int counter = 0;
990  // iterate over selected lanes
991  for (const auto& edgeLane : mapOfEdgesAndLanes) {
992  if (edgeLane.first->hasRestrictedLane(vclass)) {
993  counter++;
994  }
995  }
996  // if all edges parent own a Sidewalk, stop function
997  if (counter == (int)mapOfEdgesAndLanes.size()) {
998  const std::string header = TLF("Set vclass to % for selected lanes", toString(vclass));
999  const std::string body = TL("All lanes own already another lane in the same edge with a restriction for ");
1000  FXMessageBox::information(getApp(), MBOX_OK, header.c_str(), "%s", (body + toString(vclass) + ".").c_str());
1001  return 0;
1002  } else {
1003  WRITE_DEBUG("Opening FXMessageBox 'restrict lanes'");
1004  // Ask confirmation to user
1005  const std::string header = TLF("Set vclass to % for selected lanes", toString(vclass));
1006  const std::string body = TLF("% lanes will be restricted to %. Continue?", toString(mapOfEdgesAndLanes.size() - counter), toString(vclass));
1007  FXuint answer = FXMessageBox::question(getApp(), MBOX_YES_NO, header.c_str(), "%s", body.c_str());
1008  if (answer != 1) { //1:yes, 2:no, 4:esc
1009  // write warning if netedit is running in testing mode
1010  if (answer == 2) {
1011  WRITE_DEBUG("Closed FXMessageBox 'restrict lanes' with 'No'");
1012  } else if (answer == 4) {
1013  WRITE_DEBUG("Closed FXMessageBox 'restrict lanes' with 'ESC'");
1014  }
1015  return 0;
1016  } else {
1017  // write warning if netedit is running in testing mode
1018  WRITE_DEBUG("Closed FXMessageBox 'restrict lanes' with 'Yes'");
1019  }
1020  }
1021  // begin undo operation
1022  myUndoList->begin(lane, "restrict lanes to " + toString(vclass));
1023  // iterate over selected lanes
1024  for (const auto& edgeLane : mapOfEdgesAndLanes) {
1025  // Transform lane to Sidewalk
1026  myNet->restrictLane(vclass, edgeLane.second, myUndoList);
1027  }
1028  // end undo operation
1029  myUndoList->end();
1030  } else {
1031  // If only have a single lane, start undo/redo operation
1032  myUndoList->begin(lane, TL("restrict lane to ") + toString(vclass));
1033  // Transform lane to Sidewalk
1034  myNet->restrictLane(vclass, lane, myUndoList);
1035  // end undo operation
1036  myUndoList->end();
1037  }
1038  return 1;
1039 }
1040 
1041 
1042 bool
1043 GNEViewNet::addRestrictedLane(GNELane* lane, SUMOVehicleClass vclass, const bool insertAtFront) {
1044  // Get selected edges
1045  const auto selectedEdges = myNet->getAttributeCarriers()->getSelectedEdges();
1046  // get selected lanes
1047  const auto selectedLanes = myNet->getAttributeCarriers()->getSelectedLanes();
1048  // Declare set of edges
1049  std::set<GNEEdge*> setOfEdges;
1050  // Fill set of edges with vector of edges
1051  for (const auto& edge : selectedEdges) {
1052  setOfEdges.insert(edge);
1053  }
1054  // iterate over selected lanes
1055  for (const auto& selectedLane : selectedLanes) {
1056  // Insert pointer to edge into set of edges (To avoid duplicates)
1057  setOfEdges.insert(myNet->getAttributeCarriers()->retrieveEdge(selectedLane->getParentEdge()->getID()));
1058  }
1059  // If we handeln a set of edges
1061  // declare counter for number of restrictions
1062  int counter = 0;
1063  // iterate over set of edges
1064  for (const auto& edge : setOfEdges) {
1065  // update counter if edge has already a restricted lane of type "vclass"
1066  if (edge->hasRestrictedLane(vclass)) {
1067  counter++;
1068  }
1069  }
1070  // if all lanes own a Sidewalk, stop function
1071  if (counter == (int)setOfEdges.size()) {
1072  const std::string header = TLF("Add vclass % to selected lanes", toString(vclass));
1073  const std::string body = TLF("All lanes own already another lane in the same edge with a restriction to %.", toString(vclass));
1074  FXMessageBox::information(getApp(), MBOX_OK, header.c_str(), "%s", body.c_str());
1075  return 0;
1076  } else {
1077  WRITE_DEBUG("Opening FXMessageBox 'restrict lanes'");
1078  // Ask confirmation to user
1079  const std::string header = TLF("Add vclass % to selected lanes", toString(vclass));
1080  const std::string body = TLF("% restrictions to % will be added. Continue?", toString(setOfEdges.size() - counter), toString(vclass));
1081  FXuint answer = FXMessageBox::question(getApp(), MBOX_YES_NO, header.c_str(), "%s", body.c_str());
1082  if (answer != 1) { //1:yes, 2:no, 4:esc
1083  // write warning if netedit is running in testing mode
1084  if (answer == 2) {
1085  WRITE_DEBUG("Closed FXMessageBox 'restrict lanes' with 'No'");
1086  } else if (answer == 4) {
1087  WRITE_DEBUG("Closed FXMessageBox 'restrict lanes' with 'ESC'");
1088  }
1089  return 0;
1090  } else {
1091  // write warning if netedit is running in testing mode
1092  WRITE_DEBUG("Closed FXMessageBox 'restrict lanes' with 'Yes'");
1093  }
1094  }
1095  // begin undo operation
1096  myUndoList->begin(lane, TL("add restrictions for ") + toString(vclass));
1097  // iterate over set of edges
1098  for (const auto& edge : setOfEdges) {
1099  // add restricted lane (guess target)
1100  myNet->addRestrictedLane(vclass, edge, -1, myUndoList);
1101  }
1102  // end undo operation
1103  myUndoList->end();
1104  } else {
1105  // If only have a single lane, start undo/redo operation
1106  myUndoList->begin(lane, TL("add vclass for ") + toString(vclass));
1107  // Add restricted lane
1108  if (vclass == SVC_PEDESTRIAN) {
1109  // always add pedestrian lanes on the right
1110  myNet->addRestrictedLane(vclass, lane->getParentEdge(), 0, myUndoList);
1111  } else if (vclass == SVC_IGNORING) {
1112  if (insertAtFront) {
1113  myNet->addGreenVergeLane(lane->getParentEdge(), lane->getIndex() + 1, myUndoList);
1114  } else {
1116  }
1117  } else if (lane->getParentEdge()->getLanes().size() == 1) {
1118  // guess insertion position if there is only 1 lane
1119  myNet->addRestrictedLane(vclass, lane->getParentEdge(), -1, myUndoList);
1120  } else {
1121  myNet->addRestrictedLane(vclass, lane->getParentEdge(), lane->getIndex(), myUndoList);
1122  }
1123  // end undo/redo operation
1124  myUndoList->end();
1125  }
1126  return 1;
1127 }
1128 
1129 
1130 bool
1132  // Get selected edges
1133  const auto selectedEdges = myNet->getAttributeCarriers()->getSelectedEdges();
1134  // get selected lanes
1135  const auto selectedLanes = myNet->getAttributeCarriers()->getSelectedLanes();
1136  // Declare set of edges
1137  std::set<GNEEdge*> setOfEdges;
1138  // Fill set of edges with vector of edges
1139  for (const auto& edge : selectedEdges) {
1140  setOfEdges.insert(edge);
1141  }
1142  // iterate over selected lanes
1143  for (const auto& selectedLane : selectedLanes) {
1144  // Insert pointer to edge into set of edges (To avoid duplicates)
1145  setOfEdges.insert(myNet->getAttributeCarriers()->retrieveEdge(selectedLane->getParentEdge()->getID()));
1146  }
1147  // If we handeln a set of edges
1148  if (setOfEdges.size() > 0) {
1149  // declare counter for number of restrictions
1150  int counter = 0;
1151  // iterate over set of edges
1152  for (const auto& edge : setOfEdges) {
1153  // update counter if edge has already a restricted lane of type "vclass"
1154  if (edge->hasRestrictedLane(vclass)) {
1155  counter++;
1156  }
1157  }
1158  // if all lanes don't own a Sidewalk, stop function
1159  if (counter == 0) {
1160  const std::string header = TLF("Remove vclass % from selected lanes", toString(vclass));
1161  const std::string body = TLF("The selected lanes and edges don't have a restriction to %.", toString(vclass));
1162  FXMessageBox::information(getApp(), MBOX_OK, header.c_str(), "%s", body.c_str());
1163  return 0;
1164  } else {
1165  WRITE_DEBUG("Opening FXMessageBox 'restrict lanes'");
1166  // Ask confirmation to user
1167  const std::string header = TLF("Remove vclass % from selected lanes", toString(vclass));
1168  const std::string body = TLF("% restrictions to % will be removed. Continue?", toString(setOfEdges.size() - counter), toString(vclass));
1169  FXuint answer = FXMessageBox::question(getApp(), MBOX_YES_NO, header.c_str(), "%s", body.c_str());
1170  if (answer != 1) { //1:yes, 2:no, 4:esc
1171  // write warning if netedit is running in testing mode
1172  if (answer == 2) {
1173  WRITE_DEBUG("Closed FXMessageBox 'restrict lanes' with 'No'");
1174  } else if (answer == 4) {
1175  WRITE_DEBUG("Closed FXMessageBox 'restrict lanes' with 'ESC'");
1176  }
1177  return 0;
1178  } else {
1179  // write warning if netedit is running in testing mode
1180  WRITE_DEBUG("Closed FXMessageBox 'restrict lanes' with 'Yes'");
1181  }
1182  }
1183  // begin undo operation
1184  myUndoList->begin(lane, "Remove restrictions for " + toString(vclass));
1185  // iterate over set of edges
1186  for (const auto& edge : setOfEdges) {
1187  // add Sidewalk
1188  myNet->removeRestrictedLane(vclass, edge, myUndoList);
1189  }
1190  // end undo operation
1191  myUndoList->end();
1192  } else {
1193  // If only have a single lane, start undo/redo operation
1194  myUndoList->begin(lane, TL("Remove vclass for ") + toString(vclass));
1195  // Remove Sidewalk
1197  // end undo/redo operation
1198  myUndoList->end();
1199  }
1200  return 1;
1201 }
1202 
1203 
1205  myViewObjectsSelector(this),
1206  myEditModes(this),
1207  myTestingMode(this),
1208  myCommonCheckableButtons(this),
1209  myNetworkCheckableButtons(this),
1210  myDemandCheckableButtons(this),
1211  myDataCheckableButtons(this),
1212  myNetworkViewOptions(this),
1213  myDemandViewOptions(this),
1214  myDataViewOptions(this),
1215  myIntervalBar(this),
1216  myMoveSingleElement(this),
1217  myMoveMultipleElements(this),
1218  myVehicleOptions(this),
1219  myVehicleTypeOptions(this),
1220  mySaveElements(this),
1221  myTimeFormat(this),
1222  mySelectingArea(this),
1223  myEditNetworkElementShapes(this),
1224  myLockManager(this) {
1225 }
1226 
1227 
1228 std::vector<std::string>
1229 GNEViewNet::getEdgeLaneParamKeys(bool edgeKeys) const {
1230  std::set<std::string> keys;
1231  for (const NBEdge* e : myNet->getEdgeCont().getAllEdges()) {
1232  if (edgeKeys) {
1233  for (const auto& item : e->getParametersMap()) {
1234  keys.insert(item.first);
1235  }
1236  for (const auto& con : e->getConnections()) {
1237  for (const auto& item : con.getParametersMap()) {
1238  keys.insert(item.first);
1239  }
1240  }
1241  } else {
1242  for (const auto& lane : e->getLanes()) {
1243  int i = 0;
1244  for (const auto& item : lane.getParametersMap()) {
1245  keys.insert(item.first);
1246  }
1247  for (const auto& con : e->getConnectionsFromLane(i)) {
1248  for (const auto& item : con.getParametersMap()) {
1249  keys.insert(item.first);
1250  }
1251  }
1252  i++;
1253  }
1254  }
1255  }
1256  return std::vector<std::string>(keys.begin(), keys.end());
1257 }
1258 
1259 
1260 std::vector<std::string>
1262  std::set<std::string> keys;
1263  for (const auto& genericData : myNet->getAttributeCarriers()->getGenericDatas().at(GNE_TAG_EDGEREL_SINGLE)) {
1264  for (const auto& parameter : genericData.second->getACParametersMap()) {
1265  keys.insert(parameter.first);
1266  }
1267  }
1268  return std::vector<std::string>(keys.begin(), keys.end());
1269 }
1270 
1271 
1272 std::vector<std::string>
1274  std::set<std::string> keys;
1275  for (const auto& genericData : myNet->getAttributeCarriers()->getGenericDatas().at(SUMO_TAG_TAZREL)) {
1276  for (const auto& parameter : genericData.second->getACParametersMap()) {
1277  keys.insert(parameter.first);
1278  }
1279  }
1280  for (const auto& genericData : myNet->getAttributeCarriers()->getGenericDatas().at(SUMO_TAG_EDGEREL)) {
1281  for (const auto& parameter : genericData.second->getACParametersMap()) {
1282  keys.insert(parameter.first);
1283  }
1284  }
1285  return std::vector<std::string>(keys.begin(), keys.end());
1286 }
1287 
1288 
1289 bool
1293  return true;
1294  } else {
1295  return false;
1296  }
1297 }
1298 
1299 
1300 int
1302  return myDrawingToggle;
1303 }
1304 
1305 
1306 int
1307 GNEViewNet::doPaintGL(int mode, const Boundary& bound) {
1308  // set lefthand and laneIcons
1311  // first step: update objects under cursor
1313  // set render modes
1314  glRenderMode(mode);
1315  glMatrixMode(GL_MODELVIEW);
1317  glDisable(GL_TEXTURE_2D);
1318  glDisable(GL_ALPHA_TEST);
1319  glEnable(GL_BLEND);
1320  glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
1321  glEnable(GL_DEPTH_TEST);
1322  // visualize rectangular selection
1324  // draw certain elements only if we aren't in rectangle selection mode
1326  // draw decals
1327  drawDecals();
1328  // draw grid (and update grid button)
1329  drawGrid();
1330  // update show connections
1332  // draw temporal junction
1334  // draw temporal drawing shape
1336  // draw testing elements
1338  // draw temporal E2 multilane detectors
1340  // draw temporal overhead wires
1342  // draw temporal trip/flow route
1344  // draw temporal person plan route
1347  // draw temporal container plan route
1350  // draw temporal route
1352  // draw temporal edgeRelPath
1354  }
1355  // check menu checks of supermode demand
1357  // enable or disable menuCheckShowAllPersonPlans depending of there is a locked person
1360  } else {
1362  }
1363  }
1364  // clear pathDraw
1366  // draw network (boundary
1368  // draw all GL elements
1369  int hits = drawGLElements(bound);
1370  // draw temporal split junction
1372  // draw temporal roundabout
1374  // draw temporal lines between E1 detectors and junctions in TLS Mode
1376  // draw temporal lines between junctions in TLS Mode
1378  // draw netedit attributes references
1380  // draw test circle
1381  drawTestsCircle();
1382  // pop draw matrix
1384  // update interval bar
1386  // check if recopute boundaries (Deactivated, continue after 1.14 release)
1387  /*
1388  if (gObjectsInPosition.recomputeBoundaries != GLO_NETWORK) {
1389  myNet->getGrid().updateBoundaries(gObjectsInPosition.recomputeBoundaries);
1390  }
1391  */
1392  return hits;
1393 }
1394 
1395 
1396 long
1397 GNEViewNet::onLeftBtnPress(FXObject*, FXSelector, void* eventData) {
1398  // set focus in view net
1399  setFocus();
1400  // update MouseButtonKeyPressed
1401  myMouseButtonKeyPressed.update(eventData);
1402  // process left button press function depending of supermode
1404  processLeftButtonPressNetwork(eventData);
1405  } else if (myEditModes.isCurrentSupermodeDemand()) {
1406  processLeftButtonPressDemand(eventData);
1407  } else if (myEditModes.isCurrentSupermodeData()) {
1408  processLeftButtonPressData(eventData);
1409  }
1410  // update cursor
1411  updateCursor();
1412  // update view
1413  updateViewNet();
1414  return 1;
1415 }
1416 
1417 
1418 long
1419 GNEViewNet::onLeftBtnRelease(FXObject* obj, FXSelector sel, void* eventData) {
1420  // avoid closing Popup dialog in Linux
1421  if (myCreatedPopup) {
1422  myCreatedPopup = false;
1423  return 1;
1424  }
1425  // process parent function
1426  GUISUMOAbstractView::onLeftBtnRelease(obj, sel, eventData);
1427  // update MouseButtonKeyPressed
1428  myMouseButtonKeyPressed.update(eventData);
1429  // process left button release function depending of supermode
1432  } else if (myEditModes.isCurrentSupermodeDemand()) {
1434  } else if (myEditModes.isCurrentSupermodeData()) {
1436  }
1437  // update cursor
1438  updateCursor();
1439  // update view
1440  updateViewNet();
1441  return 1;
1442 }
1443 
1444 
1445 long
1446 GNEViewNet::onMiddleBtnPress(FXObject* obj, FXSelector sel, void* eventData) {
1447  // process parent function
1448  GUISUMOAbstractView::onMiddleBtnPress(obj, sel, eventData);
1449  // update cursor
1450  updateCursor();
1451  // update view
1452  updateViewNet();
1453  return 1;
1454 }
1455 
1456 
1457 long
1458 GNEViewNet::onMiddleBtnRelease(FXObject* obj, FXSelector sel, void* eventData) {
1459  // process parent function
1460  GUISUMOAbstractView::onMiddleBtnRelease(obj, sel, eventData);
1461  // update cursor
1462  updateCursor();
1463  // update view
1464  updateViewNet();
1465  return 1;
1466 }
1467 
1468 
1469 long
1470 GNEViewNet::onRightBtnPress(FXObject* obj, FXSelector sel, void* eventData) {
1471  // update MouseButtonKeyPressed
1472  myMouseButtonKeyPressed.update(eventData);
1473  // update cursor
1474  updateCursor();
1476  // disable right button press during drawing polygon
1477  return 1;
1478  } else {
1479  return GUISUMOAbstractView::onRightBtnPress(obj, sel, eventData);
1480  }
1481 }
1482 
1483 
1484 long
1485 GNEViewNet::onRightBtnRelease(FXObject* obj, FXSelector sel, void* eventData) {
1486  // update MouseButtonKeyPressed
1487  myMouseButtonKeyPressed.update(eventData);
1488  // update cursor
1489  updateCursor();
1490  // disable right button release during drawing polygon
1492  return 1;
1493  } else {
1494  return GUISUMOAbstractView::onRightBtnRelease(obj, sel, eventData);
1495  }
1496 }
1497 
1498 
1499 long
1500 GNEViewNet::onMouseMove(FXObject* obj, FXSelector sel, void* eventData) {
1501  // process mouse move in GUISUMOAbstractView
1502  GUISUMOAbstractView::onMouseMove(obj, sel, eventData);
1503  // update MouseButtonKeyPressed
1504  myMouseButtonKeyPressed.update(eventData);
1505  // update cursor
1506  updateCursor();
1507  // process mouse move function depending of supermode
1510  } else if (myEditModes.isCurrentSupermodeDemand()) {
1512  } else if (myEditModes.isCurrentSupermodeData()) {
1514  }
1515  // update view
1516  updateViewNet();
1517  return 1;
1518 }
1519 
1520 
1521 long
1522 GNEViewNet::onKeyPress(FXObject* o, FXSelector sel, void* eventData) {
1523  // update MouseButtonKeyPressed
1524  myMouseButtonKeyPressed.update(eventData);
1525  // update cursor
1526  updateCursor();
1527  // continue depending of current edit mode
1529  // update viewNet (for temporal junction)
1530  updateViewNet();
1532  // change "delete last created point" depending of shift key
1534  updateViewNet();
1536  // change "delete last created point" depending of shift key
1538  updateViewNet();
1540  updateViewNet();
1541  }
1542  return GUISUMOAbstractView::onKeyPress(o, sel, eventData);
1543 }
1544 
1545 
1546 long
1547 GNEViewNet::onKeyRelease(FXObject* o, FXSelector sel, void* eventData) {
1548  // update MouseButtonKeyPressed
1549  myMouseButtonKeyPressed.update(eventData);
1550  // update cursor
1551  updateCursor();
1552  // continue depending of current edit mode
1554  // update viewNet (for temporal junction)
1555  updateViewNet();
1557  // change "delete last created point" depending of shift key
1559  updateViewNet();
1561  // change "delete last created point" depending of shift key
1563  updateViewNet();
1565  updateViewNet();
1566  }
1567  // check if selecting using rectangle has to be disabled
1570  updateViewNet();
1571  }
1572  return GUISUMOAbstractView::onKeyRelease(o, sel, eventData);
1573 }
1574 
1575 
1576 void
1577 GNEViewNet::abortOperation(bool clearSelection) {
1578  // steal focus from any text fields and place it over view net
1579  setFocus();
1580  // check what supermode is enabled
1582  // abort operation depending of current mode
1584  // abort edge creation in create edge frame
1588  // check if current selection has to be cleaned
1589  if (clearSelection) {
1591  }
1593  // abort changes in Connector Frame
1596  // continue depending of current TLS frame state
1600  myViewParent->getTLSEditorFrame()->getTLSJunction()->onCmdCancelJoin(nullptr, 0, nullptr);
1601  } else {
1603  }
1609  // abort current drawing
1613  // abort current drawing
1615  } else if (myViewParent->getTAZFrame()->getCurrentTAZModule()->getTAZ() != nullptr) {
1616  // finish current editing TAZ
1618  }
1620  myViewParent->getProhibitionFrame()->getSelectionModul()->onCmdCancel(nullptr, 0, nullptr);
1622  // abort both network elements selections
1625  // abort path
1628  // abort path
1630  }
1631  } else if (myEditModes.isCurrentSupermodeDemand()) {
1632  // abort operation depending of current mode
1635  // check if current selection has to be cleaned
1636  if (clearSelection) {
1638  }
1651  }
1652  } else if (myEditModes.isCurrentSupermodeData()) {
1653  // abort operation depending of current mode
1656  // check if current selection has to be cleaned
1657  if (clearSelection) {
1659  }
1664  }
1665  }
1666  // abort undo list
1668  // update view
1669  updateViewNet();
1670 }
1671 
1672 
1673 void
1675  // delete elements depending of current supermode
1678  setStatusBarText(TL("Cannot delete in this mode"));
1680  // delete inspected elements
1681  myUndoList->begin(GUIIcon::MODEDELETE, TL("delete network inspected elements"));
1683  myUndoList->end();
1684  } else {
1685  // get selected ACs
1686  const auto selectedACs = myNet->getAttributeCarriers()->getSelectedAttributeCarriers(false);
1687  // delete selected elements
1688  if (selectedACs.size() > 0) {
1689  myUndoList->begin(GUIIcon::MODEDELETE, TL("delete network selection"));
1690  deleteNetworkAttributeCarriers(selectedACs);
1691  myUndoList->end();
1692  }
1693  }
1694  } else if (myEditModes.isCurrentSupermodeDemand()) {
1696  // delete inspected elements
1697  myUndoList->begin(GUIIcon::MODEDELETE, TL("delete demand inspected elements"));
1699  myUndoList->end();
1700  } else {
1701  // get selected ACs
1702  const auto selectedACs = myNet->getAttributeCarriers()->getSelectedAttributeCarriers(false);
1703  // delete selected elements
1704  if (selectedACs.size() > 0) {
1705  myUndoList->begin(GUIIcon::MODEDELETE, TL("delete demand selection"));
1706  deleteDemandAttributeCarriers(selectedACs);
1707  myUndoList->end();
1708  }
1709  }
1710  } else if (myEditModes.isCurrentSupermodeData()) {
1712  // delete inspected elements
1713  myUndoList->begin(GUIIcon::MODEDELETE, TL("delete data inspected elements"));
1715  myUndoList->end();
1716  } else {
1717  // get selected ACs
1718  const auto selectedACs = myNet->getAttributeCarriers()->getSelectedAttributeCarriers(false);
1719  // delete selected elements
1720  if (selectedACs.size() > 0) {
1721  myUndoList->begin(GUIIcon::MODEDELETE, TL("delete data selection"));
1722  deleteDataAttributeCarriers(selectedACs);
1723  myUndoList->end();
1724  }
1725  }
1726  }
1727  // update view
1728  updateViewNet();
1729 }
1730 
1731 
1732 void
1734  // check what supermode is enabled
1736  // abort operation depending of current mode
1738  // Accept changes in Connector Frame
1741  // continue depending of current TLS frame state
1745  myViewParent->getTLSEditorFrame()->getTLSJunction()->onCmdAcceptJoin(nullptr, 0, nullptr);
1748  }
1753  // stop current drawing
1755  } else {
1756  // start drawing
1758  }
1763  // stop current drawing
1765  } else if (myViewParent->getTAZFrame()->getCurrentTAZModule()->getTAZ() == nullptr) {
1766  // start drawing
1769  // save pending changes
1771  }
1773  // create path element
1776  // create path element
1778  }
1779  } else if (myEditModes.isCurrentSupermodeDemand()) {
1783  myViewParent->getVehicleFrame()->getPathCreator()->onCmdCreatePath(nullptr, 0, nullptr);
1785  myViewParent->getPersonFrame()->getPlanCreator()->onCmdCreatePath(nullptr, 0, nullptr);
1787  myViewParent->getPersonPlanFrame()->getPlanCreator()->onCmdCreatePath(nullptr, 0, nullptr);
1789  myViewParent->getContainerFrame()->getPlanCreator()->onCmdCreatePath(nullptr, 0, nullptr);
1792  }
1793  } else if (myEditModes.isCurrentSupermodeData()) {
1798  }
1799  }
1800 }
1801 
1802 
1803 void
1805  // check what supermode is enabled
1809  }
1810  } else if (myEditModes.isCurrentSupermodeDemand()) {
1823  }
1824  } else if (myEditModes.isCurrentSupermodeData()) {
1827  }
1828  }
1829 }
1830 
1831 void
1833  // if there is a visible frame, set focus over it. In other case, set focus over ViewNet
1834  if (myCurrentFrame != nullptr) {
1836  } else {
1837  setFocus();
1838  }
1839 }
1840 
1841 
1844  return myViewParent;
1845 }
1846 
1847 
1848 GNENet*
1850  return myNet;
1851 }
1852 
1853 
1854 GNEUndoList*
1856  return myUndoList;
1857 }
1858 
1859 
1862  return myIntervalBar;
1863 }
1864 
1865 
1866 const std::vector<GNEAttributeCarrier*>&
1869 }
1870 
1871 
1874  return myLockManager;
1875 }
1876 
1877 
1878 void
1879 GNEViewNet::setInspectedAttributeCarriers(const std::vector<GNEAttributeCarrier*> ACs) {
1881 }
1882 
1883 
1884 bool
1886  if (myInspectedAttributeCarriers.empty()) {
1887  return false;
1888  } else {
1889  // search AC in myInspectedAttributeCarriers
1890  const auto it = std::find(myInspectedAttributeCarriers.begin(), myInspectedAttributeCarriers.end(), AC);
1891  if (it == myInspectedAttributeCarriers.end()) {
1892  return false;
1893  } else {
1894  return true;
1895  }
1896  }
1897 }
1898 
1899 
1900 void
1902  // search AC in myInspectedAttributeCarriers
1903  const auto it = std::find(myInspectedAttributeCarriers.begin(), myInspectedAttributeCarriers.end(), AC);
1904  if (it != myInspectedAttributeCarriers.end()) {
1905  myInspectedAttributeCarriers.erase(it);
1907  }
1908 }
1909 
1910 
1911 const GNEAttributeCarrier*
1913  return myFrontAttributeCarrier;
1914 }
1915 
1916 
1917 const GUIGlObject*
1921  } else {
1922  return nullptr;
1923  }
1924 }
1925 
1926 
1927 void
1930  update();
1931 }
1932 
1933 
1934 void
1935 GNEViewNet::drawTranslateFrontAttributeCarrier(const GNEAttributeCarrier* AC, double typeOrLayer, const double extraOffset) {
1936  if (myFrontAttributeCarrier == AC) {
1937  glTranslated(0, 0, GLO_FRONTELEMENT + extraOffset);
1938  } else {
1939  glTranslated(0, 0, typeOrLayer + extraOffset);
1940  }
1941 }
1942 
1943 
1944 bool
1947 }
1948 
1949 
1950 bool
1951 GNEViewNet::checkOverLockedElement(const GUIGlObject* GLObject, const bool isSelected) const {
1952  // check if elemet is blocked
1953  if (myLockManager.isObjectLocked(GLObject->getType(), isSelected)) {
1954  return false;
1955  }
1956  // get front GLObject
1957  const auto glObjectFront = myViewObjectsSelector.getGUIGlObjectFront();
1958  // check if element is under cursor
1959  if (glObjectFront) {
1960  if (glObjectFront == GLObject) {
1961  return true;
1962  } else if (glObjectFront->getType() == GLObject->getType()) {
1963  for (const auto& glObjectUnderCursor : myViewObjectsSelector.getGLObjects()) {
1964  if (glObjectUnderCursor == GLObject) {
1965  return true;
1966  }
1967  }
1968  }
1969  }
1970  return false;
1971 }
1972 
1973 
1976  return myLastCreatedRoute;
1977 }
1978 
1979 
1980 void
1982  myLastCreatedRoute = lastCreatedRoute;
1983 }
1984 
1985 
1986 GNEJunction*
1988  // get first object that can be found in their container
1989  for (const auto& glObjectLayer : gViewObjectsHandler.getSelectedObjects()) {
1990  for (const auto& glObject : glObjectLayer.second) {
1991  auto junction = myNet->getAttributeCarriers()->retrieveJunction(glObject.object->getMicrosimID(), false);
1992  if (junction) {
1993  return junction;
1994  }
1995  }
1996  }
1997  return nullptr;
1998 }
1999 
2000 
2003  // get first object that can be found in their container
2004  for (const auto& glObjectLayer : gViewObjectsHandler.getSelectedObjects()) {
2005  for (const auto& glObject : glObjectLayer.second) {
2006  auto connection = myNet->getAttributeCarriers()->retrieveConnection(glObject.object, false);
2007  if (connection) {
2008  return connection;
2009  }
2010  }
2011  }
2012  return nullptr;
2013 }
2014 
2015 
2016 GNECrossing*
2018  // get first object that can be found in their container
2019  for (const auto& glObjectLayer : gViewObjectsHandler.getSelectedObjects()) {
2020  for (const auto& glObject : glObjectLayer.second) {
2021  auto crossing = myNet->getAttributeCarriers()->retrieveCrossing(glObject.object, false);
2022  if (crossing) {
2023  return crossing;
2024  }
2025  }
2026  }
2027  return nullptr;
2028 }
2029 
2030 
2033  // get first object that can be found in their container
2034  for (const auto& glObjectLayer : gViewObjectsHandler.getSelectedObjects()) {
2035  for (const auto& glObject : glObjectLayer.second) {
2036  auto walkingArea = myNet->getAttributeCarriers()->retrieveWalkingArea(glObject.object, false);
2037  if (walkingArea) {
2038  return walkingArea;
2039  }
2040  }
2041  }
2042  return nullptr;
2043 }
2044 
2045 
2046 GNEEdge*
2048  // get first object that can be found in their container
2049  for (const auto& glObjectLayer : gViewObjectsHandler.getSelectedObjects()) {
2050  for (const auto& glObject : glObjectLayer.second) {
2051  auto edge = myNet->getAttributeCarriers()->retrieveEdge(glObject.object->getMicrosimID(), false);
2052  if (edge) {
2053  return edge;
2054  }
2055  }
2056  }
2057  return nullptr;
2058 }
2059 
2060 
2061 GNELane*
2063  // get first object that can be found in their container
2064  for (const auto& glObjectLayer : gViewObjectsHandler.getSelectedObjects()) {
2065  for (const auto& glObject : glObjectLayer.second) {
2066  auto lane = myNet->getAttributeCarriers()->retrieveLane(glObject.object, false);
2067  if (lane) {
2068  return lane;
2069  }
2070  }
2071  }
2072  return nullptr;
2073 }
2074 
2075 
2078  // get first object that can be found in their container
2079  for (const auto& glObjectLayer : gViewObjectsHandler.getSelectedObjects()) {
2080  for (const auto& glObject : glObjectLayer.second) {
2081  auto additionalElement = myNet->getAttributeCarriers()->retrieveAdditional(glObject.object, false);
2082  if (additionalElement) {
2083  return additionalElement;
2084  }
2085  }
2086  }
2087  return nullptr;
2088 }
2089 
2090 
2093  // get first object that can be found in their container
2094  for (const auto& glObjectLayer : gViewObjectsHandler.getSelectedObjects()) {
2095  for (const auto& glObject : glObjectLayer.second) {
2096  auto demandElement = myNet->getAttributeCarriers()->retrieveDemandElement(glObject.object, false);
2097  if (demandElement) {
2098  return demandElement;
2099  }
2100  }
2101  }
2102  return nullptr;
2103 }
2104 
2105 
2106 GNEPoly*
2108  // get first object that can be parsed to poly element
2109  for (const auto& glObjectLayer : gViewObjectsHandler.getSelectedObjects()) {
2110  for (const auto& glObject : glObjectLayer.second) {
2111  auto polygon = dynamic_cast<GNEPoly*>(myNet->getAttributeCarriers()->retrieveAdditional(glObject.object, false));
2112  if (polygon) {
2113  return polygon;
2114  }
2115  }
2116  }
2117  return nullptr;
2118 }
2119 
2120 
2121 GNEPOI*
2123  // get first object that can be parsed to POI element
2124  for (const auto& glObjectLayer : gViewObjectsHandler.getSelectedObjects()) {
2125  for (const auto& glObject : glObjectLayer.second) {
2126  auto POI = dynamic_cast<GNEPOI*>(myNet->getAttributeCarriers()->retrieveAdditional(glObject.object, false));
2127  if (POI) {
2128  return POI;
2129  }
2130  }
2131  }
2132  return nullptr;
2133 }
2134 
2135 
2136 GNETAZ*
2138  // get first object that can be parsed to TAZ element
2139  for (const auto& glObjectLayer : gViewObjectsHandler.getSelectedObjects()) {
2140  for (const auto& glObject : glObjectLayer.second) {
2141  auto TAZ = dynamic_cast<GNETAZ*>(myNet->getAttributeCarriers()->retrieveAdditional(glObject.object, false));
2142  if (TAZ) {
2143  return TAZ;
2144  }
2145  }
2146  }
2147  return nullptr;
2148 }
2149 
2150 
2153  // get first object that can be parsed to TAZ element
2154  for (const auto& glObjectLayer : gViewObjectsHandler.getSelectedObjects()) {
2155  for (const auto& glObject : glObjectLayer.second) {
2156  if (glObject.object->getType() == GLO_JUNCTION) {
2157  auto junction = myNet->getAttributeCarriers()->retrieveJunction(glObject.object->getMicrosimID());
2158  if (junction->isShapeEdited()) {
2159  return junction;
2160  }
2161  } else if (glObject.object->getType() == GLO_CROSSING) {
2162  auto crossing = myNet->getAttributeCarriers()->retrieveCrossing(glObject.object);
2163  if (crossing->isShapeEdited()) {
2164  return crossing;
2165  }
2166  } else if (glObject.object->getType() == GLO_CONNECTION) {
2167  auto connection = myNet->getAttributeCarriers()->retrieveConnection(glObject.object);
2168  if (connection->isShapeEdited()) {
2169  return connection;
2170  }
2171  }
2172  }
2173  }
2174  return nullptr;
2175 }
2176 
2177 
2178 long
2179 GNEViewNet::onCmdSetSupermode(FXObject*, FXSelector sel, void*) {
2180  // check what network mode will be set
2181  switch (FXSELID(sel)) {
2183  if (myEditModes.networkButton->shown()) {
2185  }
2186  break;
2188  if (myEditModes.demandButton->shown()) {
2190  }
2191  break;
2193  if (myEditModes.dataButton->shown()) {
2195  }
2196  break;
2197  default:
2198  break;
2199  }
2200  return 1;
2201 }
2202 
2203 
2204 long
2205 GNEViewNet::onCmdSetMode(FXObject*, FXSelector sel, void*) {
2206  // first filter modes depending of view
2207  if (myEditModes.isJuPedSimView()) {
2208  // network
2210  switch (FXSELID(sel)) {
2211  // common
2215  // infrastructure
2220  // shapes
2223  break;
2224  default:
2225  return 0;
2226  }
2227  }
2228  // demand
2230  switch (FXSELID(sel)) {
2231  // common
2235  // persons
2238  // routes
2241  // types
2244  break;
2245  default:
2246  return 0;
2247  }
2248  }
2249  // data
2251  // all modes disabled
2252  return 0;
2253  }
2254  }
2255  // continue depending of supermode
2257  // check what network mode will be set
2258  switch (FXSELID(sel)) {
2261  break;
2264  break;
2267  break;
2270  break;
2273  break;
2276  break;
2279  break;
2282  break;
2285  break;
2288  break;
2291  break;
2294  break;
2297  break;
2300  break;
2301  default:
2302  break;
2303  }
2304  } else if (myEditModes.isCurrentSupermodeDemand()) {
2305  // check what demand mode will be set
2306  switch (FXSELID(sel)) {
2309  break;
2312  break;
2315  break;
2318  break;
2321  break;
2324  break;
2327  break;
2330  break;
2333  break;
2336  break;
2339  break;
2342  break;
2345  break;
2348  break;
2349  default:
2350  break;
2351  }
2352  } else if (myEditModes.isCurrentSupermodeData()) {
2353  // check what demand mode will be set
2354  switch (FXSELID(sel)) {
2357  break;
2360  break;
2363  break;
2366  break;
2369  break;
2372  break;
2375  break;
2376  default:
2377  break;
2378  }
2379  }
2380  return 1;
2381 }
2382 
2383 
2384 long
2385 GNEViewNet::onCmdSplitEdge(FXObject*, FXSelector, void*) {
2386  GNEEdge* edge = getEdgeAtPopupPosition();
2387  if (edge != nullptr) {
2389  }
2390  return 1;
2391 }
2392 
2393 
2394 long
2395 GNEViewNet::onCmdSplitEdgeBidi(FXObject*, FXSelector, void*) {
2396  GNEEdge* edge = getEdgeAtPopupPosition();
2397  if (edge != nullptr) {
2398  // obtain reverse edge
2399  const auto oppositeEdges = edge->getOppositeEdges();
2400  // check that reverse edge works
2401  if (oppositeEdges.size() > 0) {
2402  for (const auto& oppositeEdge : oppositeEdges) {
2403  // get reverse inner geometry
2404  const auto reverseGeometry = oppositeEdge->getNBEdge()->getInnerGeometry().reverse();
2405  if (reverseGeometry == edge->getNBEdge()->getInnerGeometry()) {
2406  myNet->splitEdgesBidi(edge, oppositeEdge, edge->getSplitPos(getPopupPosition()), myUndoList);
2407  return 1;
2408  }
2409  }
2410  }
2411  }
2412  return 1;
2413 }
2414 
2415 
2416 long
2417 GNEViewNet::onCmdReverseEdge(FXObject*, FXSelector, void*) {
2418  GNEEdge* edge = getEdgeAtPopupPosition();
2419  if (edge != nullptr) {
2420  if (edge->isAttributeCarrierSelected()) {
2421  myUndoList->begin(edge, TL("Reverse selected edges"));
2422  const auto selectedEdges = myNet->getAttributeCarriers()->getSelectedEdges();
2423  for (const auto& selectedEdge : selectedEdges) {
2424  myNet->reverseEdge(selectedEdge, myUndoList);
2425  }
2426  myUndoList->end();
2427  } else {
2428  myUndoList->begin(edge, TL("Reverse edge"));
2429  myNet->reverseEdge(edge, myUndoList);
2430  myUndoList->end();
2431  }
2432  }
2433  return 1;
2434 }
2435 
2436 
2437 long
2438 GNEViewNet::onCmdAddReversedEdge(FXObject*, FXSelector, void*) {
2439  GNEEdge* edge = getEdgeAtPopupPosition();
2440  if (edge != nullptr) {
2441  if (edge->isAttributeCarrierSelected()) {
2442  myUndoList->begin(edge, TL("Add Reverse edge for selected edges"));
2443  const auto selectedEdges = myNet->getAttributeCarriers()->getSelectedEdges();
2444  for (const auto& selectedEdge : selectedEdges) {
2445  myNet->addReversedEdge(selectedEdge, false, myUndoList);
2446  }
2447  myUndoList->end();
2448  } else {
2449  myUndoList->begin(edge, TL("Add reverse edge"));
2450  myNet->addReversedEdge(edge, false, myUndoList);
2451  myUndoList->end();
2452  }
2453  }
2454  return 1;
2455 }
2456 
2457 
2458 long
2459 GNEViewNet::onCmdAddReversedEdgeDisconnected(FXObject*, FXSelector, void*) {
2460  GNEEdge* edge = getEdgeAtPopupPosition();
2461  if (edge != nullptr) {
2462  if (edge->isAttributeCarrierSelected()) {
2463  myUndoList->begin(edge, TL("Add Reverse disconnected edge for selected edges"));
2464  const auto selectedEdges = myNet->getAttributeCarriers()->getSelectedEdges();
2465  for (const auto& selectedEdge : selectedEdges) {
2466  myNet->addReversedEdge(selectedEdge, true, myUndoList);
2467  }
2468  myUndoList->end();
2469  } else {
2470  myUndoList->begin(edge, TL("Add reverse disconnected edge"));
2471  myNet->addReversedEdge(edge, true, myUndoList);
2472  myUndoList->end();
2473  }
2474  }
2475  return 1;
2476 }
2477 
2478 
2479 long
2480 GNEViewNet::onCmdEditEdgeEndpoint(FXObject*, FXSelector, void*) {
2481  GNEEdge* edge = getEdgeAtPopupPosition();
2482  if (edge != nullptr) {
2483  // snap to active grid the Popup position
2485  }
2486  return 1;
2487 }
2488 
2489 
2490 long
2491 GNEViewNet::onCmdResetEdgeEndpoint(FXObject*, FXSelector, void*) {
2492  GNEEdge* edge = getEdgeAtPopupPosition();
2493  if (edge != nullptr) {
2494  // check if edge is selected
2495  if (edge->isAttributeCarrierSelected()) {
2496  // get all selected edges
2497  const auto selectedEdges = myNet->getAttributeCarriers()->getSelectedEdges();
2498  // begin operation
2499  myUndoList->begin(edge, TL("reset geometry points"));
2500  // iterate over selected edges
2501  for (const auto& selectedEdge : selectedEdges) {
2502  // reset both end points
2503  selectedEdge->resetBothEndpoint(myUndoList);
2504  }
2505  // end operation
2506  myUndoList->end();
2507  } else {
2509  }
2510  }
2511  return 1;
2512 }
2513 
2514 
2515 long
2516 GNEViewNet::onCmdStraightenEdges(FXObject*, FXSelector, void*) {
2517  GNEEdge* edge = getEdgeAtPopupPosition();
2518  if (edge != nullptr) {
2519  if (edge->isAttributeCarrierSelected()) {
2520  myUndoList->begin(edge, TL("straighten selected edges"));
2521  const auto selectedEdges = myNet->getAttributeCarriers()->getSelectedEdges();
2522  for (const auto& selectedEdge : selectedEdges) {
2523  selectedEdge->setAttribute(SUMO_ATTR_SHAPE, "", myUndoList);
2524  }
2525  myUndoList->end();
2526  } else {
2527 
2528  myUndoList->begin(edge, TL("straighten edge"));
2530  myUndoList->end();
2531  }
2532  }
2533  return 1;
2534 }
2535 
2536 
2537 long
2538 GNEViewNet::onCmdSmoothEdges(FXObject*, FXSelector, void*) {
2539  GNEEdge* edge = getEdgeAtPopupPosition();
2540  if (edge != nullptr) {
2541  if (edge->isAttributeCarrierSelected()) {
2542  myUndoList->begin(edge, TL("smooth selected edges"));
2543  const auto selectedEdges = myNet->getAttributeCarriers()->getSelectedEdges();
2544  for (const auto& selectedEdge : selectedEdges) {
2545  selectedEdge->smooth(myUndoList);
2546  }
2547  myUndoList->end();
2548  } else {
2549  myUndoList->begin(edge, TL("smooth edge"));
2550  edge->smooth(myUndoList);
2551  myUndoList->end();
2552  }
2553  }
2554  return 1;
2555 }
2556 
2557 
2558 long
2559 GNEViewNet::onCmdStraightenEdgesElevation(FXObject*, FXSelector, void*) {
2560  GNEEdge* edge = getEdgeAtPopupPosition();
2561  if (edge != nullptr) {
2562  if (edge->isAttributeCarrierSelected()) {
2563  myUndoList->begin(edge, TL("straighten elevation of selected edges"));
2564  const auto selectedEdges = myNet->getAttributeCarriers()->getSelectedEdges();
2565  for (const auto& selectedEdge : selectedEdges) {
2566  selectedEdge->straightenElevation(myUndoList);
2567  }
2568  myUndoList->end();
2569  } else {
2570  myUndoList->begin(edge, TL("straighten edge elevation"));
2572  myUndoList->end();
2573  }
2574  }
2575  return 1;
2576 }
2577 
2578 
2579 long
2580 GNEViewNet::onCmdSmoothEdgesElevation(FXObject*, FXSelector, void*) {
2581  GNEEdge* edge = getEdgeAtPopupPosition();
2582  if (edge != nullptr) {
2583  if (edge->isAttributeCarrierSelected()) {
2584  myUndoList->begin(edge, TL("smooth elevation of selected edges"));
2585  const auto selectedEdges = myNet->getAttributeCarriers()->getSelectedEdges();
2586  for (const auto& selectedEdge : selectedEdges) {
2587  selectedEdge->smoothElevation(myUndoList);
2588  }
2589  myUndoList->end();
2590  } else {
2591  myUndoList->begin(edge, TL("smooth edge elevation"));
2592  edge->smoothElevation(myUndoList);
2593  myUndoList->end();
2594  }
2595  }
2596  return 1;
2597 }
2598 
2599 
2600 long
2601 GNEViewNet::onCmdResetLength(FXObject*, FXSelector, void*) {
2602  GNEEdge* edge = getEdgeAtPopupPosition();
2603  if (edge != nullptr) {
2604  if (edge->isAttributeCarrierSelected()) {
2605  myUndoList->begin(edge, TL("reset edge lengths"));
2606  const auto selectedEdges = myNet->getAttributeCarriers()->getSelectedEdges();
2607  for (const auto& selectedEdge : selectedEdges) {
2608  selectedEdge->setAttribute(SUMO_ATTR_LENGTH, "-1", myUndoList);
2609  }
2610  myUndoList->end();
2611  } else {
2613  }
2614  }
2615  return 1;
2616 }
2617 
2618 
2619 long
2620 GNEViewNet::onCmdEdgeUseAsTemplate(FXObject*, FXSelector, void*) {
2621  GNEEdge* edge = getEdgeAtPopupPosition();
2622  if (edge != nullptr) {
2624  }
2625  return 1;
2626 }
2627 
2628 
2629 long
2630 GNEViewNet::onCmdEgeApplyTemplate(FXObject*, FXSelector, void*) {
2631  GNEEdge* edgeAtPosition = getEdgeAtPopupPosition();
2632  if ((edgeAtPosition != nullptr) && myViewParent->getInspectorFrame()->getTemplateEditor()->getEdgeTemplate()) {
2633  // begin copy template
2634  myUndoList->begin(edgeAtPosition, TL("copy edge template"));
2635  if (edgeAtPosition->isAttributeCarrierSelected()) {
2636  // copy template in all selected edges
2637  for (const auto& edge : myNet->getAttributeCarriers()->getEdges()) {
2638  if (edge.second->isAttributeCarrierSelected()) {
2639  edge.second->copyTemplate(myViewParent->getInspectorFrame()->getTemplateEditor()->getEdgeTemplate(), myUndoList);
2640  }
2641  }
2642  } else {
2643  // copy template
2645  }
2646  // end copy template
2647  myUndoList->end();
2648  // update view (to see visual changes)
2649  updateViewNet();
2650  }
2651  return 1;
2652 }
2653 
2654 
2655 long
2656 GNEViewNet::onCmdSimplifyShape(FXObject*, FXSelector, void*) {
2657  // get polygon under mouse
2658  GNEPoly* polygonUnderMouse = getPolygonAtPopupPosition();
2659  // check polygon
2660  if (polygonUnderMouse) {
2661  // check if shape is selected
2662  if (polygonUnderMouse->isAttributeCarrierSelected()) {
2663  // begin undo-list
2664  myNet->getViewNet()->getUndoList()->begin(polygonUnderMouse, TL("simplify shapes"));
2665  // get shapes
2666  const auto selectedShapes = myNet->getAttributeCarriers()->getSelectedShapes();
2667  // iterate over shapes
2668  for (const auto& selectedShape : selectedShapes) {
2669  // check if shape is a poly
2670  if ((selectedShape->getTagProperty().getTag() == SUMO_TAG_POLY) ||
2671  (selectedShape->getTagProperty().getTag() == GNE_TAG_JPS_WALKABLEAREA) ||
2672  (selectedShape->getTagProperty().getTag() == GNE_TAG_JPS_OBSTACLE)) {
2673  // simplify shape
2674  dynamic_cast<GNEPoly*>(selectedShape)->simplifyShape();
2675  }
2676  }
2677  // end undo-list
2678  myNet->getViewNet()->getUndoList()->end();
2679  } else {
2680  polygonUnderMouse->simplifyShape();
2681  }
2682  }
2683  updateViewNet();
2684  return 1;
2685 }
2686 
2687 
2688 long
2689 GNEViewNet::onCmdDeleteGeometryPoint(FXObject*, FXSelector, void*) {
2690  GNEPoly* polygonUnderMouse = getPolygonAtPopupPosition();
2691  if (polygonUnderMouse) {
2692  polygonUnderMouse->deleteGeometryPoint(getPopupPosition());
2693  }
2694  updateViewNet();
2695  return 1;
2696 }
2697 
2698 
2699 long
2700 GNEViewNet::onCmdClosePolygon(FXObject*, FXSelector, void*) {
2701  // get polygon under mouse
2702  GNEPoly* polygonUnderMouse = getPolygonAtPopupPosition();
2703  // check polygon
2704  if (polygonUnderMouse) {
2705  // check if shape is selected
2706  if (polygonUnderMouse->isAttributeCarrierSelected()) {
2707  // begin undo-list
2708  myNet->getViewNet()->getUndoList()->begin(polygonUnderMouse, TL("close polygon shapes"));
2709  // get selectedshapes
2710  const auto selectedShapes = myNet->getAttributeCarriers()->getSelectedShapes();
2711  // iterate over shapes
2712  for (const auto& selectedShape : selectedShapes) {
2713  // check if shape is a poly
2714  if ((selectedShape->getTagProperty().getTag() == SUMO_TAG_POLY) ||
2715  (selectedShape->getTagProperty().getTag() == GNE_TAG_JPS_WALKABLEAREA) ||
2716  (selectedShape->getTagProperty().getTag() == GNE_TAG_JPS_OBSTACLE)) {
2717  // close polygon
2718  dynamic_cast<GNEPoly*>(selectedShape)->closePolygon();
2719  }
2720  }
2721  // end undo-list
2722  myNet->getViewNet()->getUndoList()->end();
2723  } else {
2724  polygonUnderMouse->closePolygon();
2725  }
2726  }
2727  updateViewNet();
2728  return 1;
2729 }
2730 
2731 
2732 long
2733 GNEViewNet::onCmdOpenPolygon(FXObject*, FXSelector, void*) {
2734  // get polygon under mouse
2735  GNEPoly* polygonUnderMouse = getPolygonAtPopupPosition();
2736  // check polygon
2737  if (polygonUnderMouse) {
2738  // check if shape is selected
2739  if (polygonUnderMouse->isAttributeCarrierSelected()) {
2740  // begin undo-list
2741  myNet->getViewNet()->getUndoList()->begin(polygonUnderMouse, TL("open polygon shapes"));
2742  // get shapes
2743  const auto selectedShapes = myNet->getAttributeCarriers()->getSelectedShapes();
2744  // iterate over shapes
2745  for (const auto& selectedShape : selectedShapes) {
2746  // check if shape is a poly
2747  if ((selectedShape->getTagProperty().getTag() == SUMO_TAG_POLY) ||
2748  (selectedShape->getTagProperty().getTag() == GNE_TAG_JPS_WALKABLEAREA) ||
2749  (selectedShape->getTagProperty().getTag() == GNE_TAG_JPS_OBSTACLE)) {
2750  // open polygon
2751  dynamic_cast<GNEPoly*>(selectedShape)->openPolygon();
2752  }
2753  }
2754  // end undo-list
2755  myNet->getViewNet()->getUndoList()->end();
2756  } else {
2757  polygonUnderMouse->openPolygon();
2758  }
2759  }
2760  updateViewNet();
2761  return 1;
2762 }
2763 
2764 
2765 long
2766 GNEViewNet::onCmdSelectPolygonElements(FXObject*, FXSelector, void*) {
2767  // get polygon under mouse
2768  GNEPoly* polygonUnderMouse = getPolygonAtPopupPosition();
2769  // check polygon
2770  if (polygonUnderMouse) {
2771  // get ACs in boundary
2772  updateObjectsInBoundary(polygonUnderMouse->getShape().getBoxBoundary());
2773  // declare filtered ACs
2774  std::vector<GNEAttributeCarrier*> filteredACs;
2775  // iterate over obtained GUIGlIDs
2776  for (const auto& AC : myViewObjectsSelector.getAttributeCarriers()) {
2777  if (AC->getTagProperty().getTag() == SUMO_TAG_EDGE) {
2778  if (checkSelectEdges() && myNet->getAttributeCarriers()->isNetworkElementAroundShape(AC, polygonUnderMouse->getShape())) {
2779  filteredACs.push_back(AC);
2780  }
2781  } else if (AC->getTagProperty().getTag() == SUMO_TAG_LANE) {
2782  if (!checkSelectEdges() && myNet->getAttributeCarriers()->isNetworkElementAroundShape(AC, polygonUnderMouse->getShape())) {
2783  filteredACs.push_back(AC);
2784  }
2785  } else if ((AC != polygonUnderMouse) && myNet->getAttributeCarriers()->isNetworkElementAroundShape(AC, polygonUnderMouse->getShape())) {
2786  filteredACs.push_back(AC);
2787  }
2788  }
2789  // continue if there are ACs
2790  if (filteredACs.size() > 0) {
2791  // begin undo-list
2792  myNet->getViewNet()->getUndoList()->begin(GUIIcon::MODESELECT, TL("select within polygon boundary"));
2793  // iterate over shapes
2794  for (const auto& AC : filteredACs) {
2795  AC->setAttribute(GNE_ATTR_SELECTED, "true", myUndoList);
2796  }
2797  // end undo-list
2798  myNet->getViewNet()->getUndoList()->end();
2799  }
2800  }
2801  updateViewNet();
2802  return 1;
2803 }
2804 
2805 
2806 long
2807 GNEViewNet::onCmdSetFirstGeometryPoint(FXObject*, FXSelector, void*) {
2808  GNEPoly* polygonUnderMouse = getPolygonAtPopupPosition();
2809  if (polygonUnderMouse) {
2810  polygonUnderMouse->changeFirstGeometryPoint(polygonUnderMouse->getVertexIndex(getPopupPosition(), false));
2811  updateViewNet();
2812  }
2813 
2814  return 1;
2815 }
2816 
2817 
2818 long
2819 GNEViewNet::onCmdSimplifyShapeEdited(FXObject*, FXSelector, void*) {
2820  auto undoList = myNet->getViewNet()->getUndoList();
2821  // get shape edited under mouse
2823  if (shapeEdited) {
2824  // simplify edited shape using undo-redo
2825  undoList->begin(shapeEdited, TL("simplify edited shape"));
2826  shapeEdited->simplifyShapeEdited(undoList);
2827  undoList->end();
2828  }
2829  return 1;
2830 }
2831 
2832 
2833 long
2834 GNEViewNet::onCmdStraightenShapeEdited(FXObject*, FXSelector, void*) {
2835  auto undoList = myNet->getViewNet()->getUndoList();
2836  // get shape edited under mouse
2838  if (shapeEdited) {
2839  // simplify edited shape using undo-redo
2840  undoList->begin(shapeEdited, TL("straigthen edited shape"));
2841  shapeEdited->straigthenShapeEdited(undoList);
2842  undoList->end();
2843  }
2844  return 1;
2845 }
2846 
2847 
2848 long
2849 GNEViewNet::onCmdCloseShapeEdited(FXObject*, FXSelector, void*) {
2850  auto undoList = myNet->getViewNet()->getUndoList();
2851  // get shape edited under mouse
2853  if (shapeEdited) {
2854  // close edited shape using undo-redo
2855  undoList->begin(shapeEdited, TL("simplify edited shape"));
2856  shapeEdited->closeShapeEdited(undoList);
2857  undoList->end();
2858  }
2859  return 1;
2860 }
2861 
2862 
2863 long
2864 GNEViewNet::onCmdOpenShapeEdited(FXObject*, FXSelector, void*) {
2865  auto undoList = myNet->getViewNet()->getUndoList();
2866  // get shape edited under mouse
2868  if (shapeEdited) {
2869  // open edited shape using undo-redo
2870  undoList->begin(shapeEdited, TL("simplify edited shape"));
2871  shapeEdited->openShapeEdited(undoList);
2872  undoList->end();
2873  }
2874  return 1;
2875 }
2876 
2877 
2878 long
2880  auto undoList = myNet->getViewNet()->getUndoList();
2881  // get shape edited under mouse
2883  if (shapeEdited) {
2884  // get geometry point index under cursor
2885  const auto geometryPointIndex = shapeEdited->getGeometryPointUnderCursorShapeEdited();
2886  // set first geometry point in edited shape using undo-redo
2887  undoList->begin(shapeEdited, TL("simplify edited shape"));
2888  shapeEdited->setFirstGeometryPointShapeEdited(geometryPointIndex, undoList);
2889  undoList->end();
2890  }
2891  return 1;
2892 }
2893 
2894 
2895 long
2897  auto undoList = myNet->getViewNet()->getUndoList();
2898  // get shape edited under mouse
2900  if (shapeEdited) {
2901  // get geometry point index under cursor
2902  const auto geometryPointIndex = shapeEdited->getGeometryPointUnderCursorShapeEdited();
2903  // delete geometry point edited shape using undo-redo
2904  undoList->begin(shapeEdited, TL("simplify edited shape"));
2905  shapeEdited->deleteGeometryPointShapeEdited(geometryPointIndex, undoList);
2906  undoList->end();
2907  }
2908  return 1;
2909 }
2910 
2911 
2912 long
2913 GNEViewNet::onCmdResetShapeEdited(FXObject*, FXSelector, void*) {
2914  auto undoList = myNet->getViewNet()->getUndoList();
2915  // get shape edited under mouse
2917  if (shapeEdited) {
2918  // simplify edited shape using undo-redo
2919  undoList->begin(shapeEdited, TL("simplify edited shape"));
2920  shapeEdited->resetShapeEdited(undoList);
2921  undoList->end();
2922  }
2923  return 1;
2924 }
2925 
2926 
2927 long
2928 GNEViewNet::onCmdFinishShapeEdited(FXObject*, FXSelector, void*) {
2929  // the same behavior as when we press enter
2930  hotkeyEnter();
2931  return 1;
2932 }
2933 
2934 
2935 long
2936 GNEViewNet::onCmdTransformPOI(FXObject*, FXSelector, void*) {
2937  // declare additional handler
2938  GNEAdditionalHandler additionalHanlder(myNet, true, false);
2939  // obtain POI at popup position
2941  if (POI) {
2942  // check what type of POI will be transformed
2943  if (POI->getTagProperty().getTag() == SUMO_TAG_POI) {
2944  // obtain lanes around POI boundary
2945  std::vector<GUIGlID> GLIDs = getObjectsInBoundary(POI->getCenteringBoundary());
2946  std::vector<GNELane*> lanes;
2947  for (const auto& GLID : GLIDs) {
2948  GNELane* lane = dynamic_cast<GNELane*>(GUIGlObjectStorage::gIDStorage.getObjectBlocking(GLID));
2949  if (lane) {
2950  lanes.push_back(lane);
2951  }
2952  }
2953  if (lanes.empty()) {
2954  WRITE_WARNINGF(TL("No lanes around % to attach it"), toString(SUMO_TAG_POI));
2955  } else {
2956  // obtain nearest lane to POI
2957  GNELane* nearestLane = lanes.front();
2958  double minorPosOverLane = nearestLane->getLaneShape().nearest_offset_to_point2D(POI->getPositionInView());
2959  double minorLateralOffset = nearestLane->getLaneShape().positionAtOffset(minorPosOverLane).distanceTo(POI->getPositionInView());
2960  for (const auto& lane : lanes) {
2961  double posOverLane = lane->getLaneShape().nearest_offset_to_point2D(POI->getPositionInView());
2962  double lateralOffset = lane->getLaneShape().positionAtOffset(posOverLane).distanceTo(POI->getPositionInView());
2963  if (lateralOffset < minorLateralOffset) {
2964  minorPosOverLane = posOverLane;
2965  minorLateralOffset = lateralOffset;
2966  nearestLane = lane;
2967  }
2968  }
2969  // get sumo base object of POI (And all common attributes)
2970  CommonXMLStructure::SumoBaseObject* POIBaseObject = POI->getSumoBaseObject();
2971  // add specific attributes
2972  POIBaseObject->addStringAttribute(SUMO_ATTR_LANE, nearestLane->getID());
2973  POIBaseObject->addDoubleAttribute(SUMO_ATTR_POSITION, minorPosOverLane);
2974  POIBaseObject->addBoolAttribute(SUMO_ATTR_FRIENDLY_POS, POI->getFriendlyPos());
2975  POIBaseObject->addDoubleAttribute(SUMO_ATTR_POSITION_LAT, 0);
2976  // remove POI
2977  myUndoList->begin(POI, TL("attach POI into lane"));
2979  // add new POI use route handler
2980  additionalHanlder.parseSumoBaseObject(POIBaseObject);
2981  myUndoList->end();
2982  }
2983  } else {
2984  // get sumo base object of POI (And all common attributes)
2985  CommonXMLStructure::SumoBaseObject* POIBaseObject = POI->getSumoBaseObject();
2986  // add specific attributes
2987  POIBaseObject->addDoubleAttribute(SUMO_ATTR_X, POI->x());
2988  POIBaseObject->addDoubleAttribute(SUMO_ATTR_Y, POI->y());
2989  // remove POI
2990  myUndoList->begin(POI, TL("release POI from lane"));
2992  // add new POI use route handler
2993  additionalHanlder.parseSumoBaseObject(POIBaseObject);
2994  myUndoList->end();
2995  }
2996  // update view after transform
2997  updateViewNet();
2998  }
2999  return 1;
3000 }
3001 
3002 
3003 long
3004 GNEViewNet::onCmdReverse(FXObject*, FXSelector, void*) {
3005  // obtain demand element at popup position
3007  if (demandElement) {
3008  // begin undo list
3009  myUndoList->begin(demandElement, TLF("reverse % '%'", demandElement->getTagStr(), demandElement->getID()));
3010  GNERouteHandler::reverse(demandElement);
3011  myUndoList->end();
3012  }
3013  return 1;
3014 }
3015 
3016 
3017 long
3018 GNEViewNet::onCmdAddReverse(FXObject*, FXSelector, void*) {
3019  // obtain demand element at popup position
3021  if (demandElement) {
3022  // begin undo list
3023  myUndoList->begin(demandElement, TLF("add reverse '%'", demandElement->getTagStr()));
3024  GNERouteHandler::addReverse(demandElement);
3025  myUndoList->end();
3026  }
3027  return 1;
3028 }
3029 
3030 
3031 long
3032 GNEViewNet::onCmdSetCustomGeometryPoint(FXObject*, FXSelector, void*) {
3033  // get element at popup position
3034  GNELane* lane = getLaneAtPopupPosition();
3037  // check element
3038  if (lane != nullptr) {
3039  // make a copy of edge geometry
3040  PositionVector edgeGeometry = lane->getParentEdge()->getNBEdge()->getGeometry();
3041  // get index position
3042  const int index = edgeGeometry.indexOfClosest(getPositionInformation(), true);
3043  // get new position
3044  Position newPosition = edgeGeometry[index];
3045  // edit using modal GNEGeometryPointDialog
3046  GNEGeometryPointDialog(this, &newPosition); // NOSONAR, constructor returns after dialog has been closed
3047  // now check position
3048  if (newPosition != edgeGeometry[index]) {
3049  // update new position
3050  edgeGeometry[index] = newPosition;
3051  // begin undo list
3052  myUndoList->begin(lane->getParentEdge(), TL("change edge Geometry Point position"));
3053  // continue depending of index
3054  if (index == 0) {
3055  // change shape start
3057  } else if (index == ((int)edgeGeometry.size() - 1)) {
3058  // change shape end
3060  } else {
3061  // remove front and back geometry points
3062  edgeGeometry.pop_front();
3063  edgeGeometry.pop_back();
3064  // change shape
3066  }
3067  // end undo list
3068  myUndoList->end();
3069  }
3070  } else if (poly != nullptr) {
3071  // make a copy of polygon geometry
3072  PositionVector polygonGeometry = poly->getShape();
3073  // get index position
3074  const int index = polygonGeometry.indexOfClosest(getPositionInformation(), true);
3075  // get new position
3076  Position newPosition = polygonGeometry[index];
3077  // edit using modal GNEGeometryPointDialog
3078  GNEGeometryPointDialog(this, &newPosition); // NOSONAR, constructor returns after dialog has been closed
3079  // now check position
3080  if (newPosition != polygonGeometry[index]) {
3081  // update new position
3082  polygonGeometry[index] = newPosition;
3083  // begin undo list
3084  myUndoList->begin(poly, TL("change polygon Geometry Point position"));
3085  // change shape
3087  // end undo list
3088  myUndoList->end();
3089  }
3090  } else if (TAZ != nullptr) {
3091  // make a copy of TAZ geometry
3092  PositionVector TAZGeometry = TAZ->getAdditionalGeometry().getShape();
3093  // get index position
3094  const int index = TAZGeometry.indexOfClosest(getPositionInformation(), true);
3095  // get new position
3096  Position newPosition = TAZGeometry[index];
3097  // edit using modal GNEGeometryPointDialog
3098  GNEGeometryPointDialog(this, &newPosition); // NOSONAR, constructor returns after dialog has been closed
3099  // now check position
3100  if (newPosition != TAZGeometry[index]) {
3101  // update new position
3102  TAZGeometry[index] = newPosition;
3103  // begin undo list
3104  myUndoList->begin(TAZ, TL("change TAZ Geometry Point position"));
3105  // change shape
3107  // end undo list
3108  myUndoList->end();
3109  }
3110  }
3111  return 1;
3112 }
3113 
3114 
3115 long
3116 GNEViewNet::onCmdResetEndPoints(FXObject*, FXSelector, void*) {
3117  // get lane at popup position
3118  GNELane* laneAtPopupPosition = getLaneAtPopupPosition();
3119  // check element
3120  if (laneAtPopupPosition != nullptr) {
3121  // get parent edge
3122  GNEEdge* edge = laneAtPopupPosition->getParentEdge();
3123  // check if edge is selected
3124  if (edge->isAttributeCarrierSelected()) {
3125  // get selected edges
3126  const auto selectedEdges = myNet->getAttributeCarriers()->getSelectedEdges();
3127  // begin undo list
3128  myUndoList->begin(edge, TL("reset end points of selected edges"));
3129  // iterate over edges
3130  for (const auto& selectedEdge : selectedEdges) {
3131  // reset both end points
3132  selectedEdge->setAttribute(GNE_ATTR_SHAPE_START, "", myUndoList);
3133  selectedEdge->setAttribute(GNE_ATTR_SHAPE_END, "", myUndoList);
3134  }
3135  // end undo list
3136  myUndoList->end();
3137  } else {
3138  // begin undo list
3139  myUndoList->begin(edge, TL("reset end points of edge '") + edge->getID());
3140  // reset both end points
3143  // end undo list
3144  myUndoList->end();
3145  }
3146  }
3147  return 1;
3148 }
3149 
3150 
3151 long
3152 GNEViewNet::onCmdDuplicateLane(FXObject*, FXSelector, void*) {
3153  GNELane* laneAtPopupPosition = getLaneAtPopupPosition();
3154  if (laneAtPopupPosition != nullptr) {
3155  // when duplicating an unselected lane, keep all connections as they
3156  // are, otherwise recompute them
3157  if (laneAtPopupPosition->isAttributeCarrierSelected()) {
3158  myUndoList->begin(laneAtPopupPosition, TL("duplicate selected lanes"));
3159  const auto selectedLanes = myNet->getAttributeCarriers()->getSelectedLanes();
3160  for (const auto& lane : selectedLanes) {
3161  myNet->duplicateLane(lane, myUndoList, true);
3162  }
3163  myUndoList->end();
3164  } else {
3165  myUndoList->begin(laneAtPopupPosition, TL("duplicate lane"));
3166  myNet->duplicateLane(laneAtPopupPosition, myUndoList, false);
3167  myUndoList->end();
3168  }
3169  }
3170  return 1;
3171 }
3172 
3173 
3174 long
3175 GNEViewNet::onCmdEditLaneShape(FXObject*, FXSelector, void*) {
3176  // Obtain lane under mouse
3177  GNELane* lane = getLaneAtPopupPosition();
3178  if (lane) {
3180  }
3181  // destroy pop-up and update view Net
3182  destroyPopup();
3183  setFocus();
3184  return 1;
3185 }
3186 
3187 
3188 long
3189 GNEViewNet::onCmdResetLaneCustomShape(FXObject*, FXSelector, void*) {
3190  GNELane* laneAtPopupPosition = getLaneAtPopupPosition();
3191  if (laneAtPopupPosition != nullptr) {
3192  // when duplicating an unselected lane, keep all connections as they
3193  // are, otherwise recompute them
3194  if (laneAtPopupPosition->isAttributeCarrierSelected()) {
3195  myUndoList->begin(laneAtPopupPosition, TL("reset custom lane shapes"));
3196  const auto selectedLanes = myNet->getAttributeCarriers()->getSelectedLanes();
3197  for (const auto& lane : selectedLanes) {
3198  lane->setAttribute(SUMO_ATTR_CUSTOMSHAPE, "", myUndoList);
3199  }
3200  myUndoList->end();
3201  } else {
3202  myUndoList->begin(laneAtPopupPosition, TL("reset custom lane shape"));
3203  laneAtPopupPosition->setAttribute(SUMO_ATTR_CUSTOMSHAPE, "", myUndoList);
3204  myUndoList->end();
3205  }
3206  }
3207  return 1;
3208 }
3209 
3210 
3211 long
3212 GNEViewNet::onCmdResetOppositeLane(FXObject*, FXSelector, void*) {
3213  GNELane* laneAtPopupPosition = getLaneAtPopupPosition();
3214  if (laneAtPopupPosition != nullptr) {
3215  // when duplicating an unselected lane, keep all connections as they
3216  // are, otherwise recompute them
3217  if (laneAtPopupPosition->isAttributeCarrierSelected()) {
3218  myUndoList->begin(laneAtPopupPosition, TL("reset opposite lanes"));
3219  const auto selectedLanes = myNet->getAttributeCarriers()->getSelectedLanes();
3220  for (const auto& lane : selectedLanes) {
3221  lane->setAttribute(GNE_ATTR_OPPOSITE, "", myUndoList);
3222  }
3223  myUndoList->end();
3224  } else {
3225  myUndoList->begin(laneAtPopupPosition, TL("reset opposite lane"));
3226  laneAtPopupPosition->setAttribute(GNE_ATTR_OPPOSITE, "", myUndoList);
3227  myUndoList->end();
3228  }
3229  }
3230  return 1;
3231 }
3232 
3233 
3234 long
3235 GNEViewNet::onCmdLaneOperation(FXObject*, FXSelector sel, void*) {
3236  GNELane* laneAtPopupPosition = getLaneAtPopupPosition();
3237  if (laneAtPopupPosition) {
3238  // check lane operation
3239  switch (FXSELID(sel)) {
3241  return restrictLane(laneAtPopupPosition, SVC_PEDESTRIAN);
3243  return restrictLane(laneAtPopupPosition, SVC_BICYCLE);
3245  return restrictLane(laneAtPopupPosition, SVC_BUS);
3247  return restrictLane(laneAtPopupPosition, SVC_IGNORING);
3249  return addRestrictedLane(laneAtPopupPosition, SVC_PEDESTRIAN, false);
3250  case MID_GNE_LANE_ADD_BIKE:
3251  return addRestrictedLane(laneAtPopupPosition, SVC_BICYCLE, false);
3252  case MID_GNE_LANE_ADD_BUS:
3253  return addRestrictedLane(laneAtPopupPosition, SVC_BUS, false);
3255  return addRestrictedLane(laneAtPopupPosition, SVC_IGNORING, true);
3257  return addRestrictedLane(laneAtPopupPosition, SVC_IGNORING, false);
3259  return removeRestrictedLane(laneAtPopupPosition, SVC_PEDESTRIAN);
3261  return removeRestrictedLane(laneAtPopupPosition, SVC_BICYCLE);
3263  return removeRestrictedLane(laneAtPopupPosition, SVC_BUS);
3265  return removeRestrictedLane(laneAtPopupPosition, SVC_IGNORING);
3266  default:
3267  return 0;
3268  }
3269  } else {
3270  return 0;
3271  }
3272 }
3273 
3274 
3275 long
3276 GNEViewNet::onCmdLaneReachability(FXObject* menu, FXSelector, void*) {
3277  GNELane* laneAtPopupPosition = getLaneAtPopupPosition();
3278  if (laneAtPopupPosition != nullptr) {
3279  // obtain vClass
3280  const SUMOVehicleClass vClass = SumoVehicleClassStrings.get(dynamic_cast<FXMenuCommand*>(menu)->getText().text());
3281  // calculate reachability
3282  myNet->getPathManager()->getPathCalculator()->calculateReachability(vClass, laneAtPopupPosition->getParentEdge());
3283  // select all lanes with reachability greater than 0
3284  myUndoList->begin(laneAtPopupPosition, TL("select lane reachability"));
3285  for (const auto& edge : myNet->getAttributeCarriers()->getEdges()) {
3286  for (const auto& lane : edge.second->getLanes()) {
3287  if (lane->getReachability() >= 0) {
3288  lane->setAttribute(GNE_ATTR_SELECTED, "true", myUndoList);
3289  }
3290  }
3291  }
3292  myUndoList->end();
3293  }
3294  // update viewNet
3295  updateViewNet();
3296  return 1;
3297 }
3298 
3299 
3300 long
3301 GNEViewNet::onCmdOpenAdditionalDialog(FXObject*, FXSelector, void*) {
3302  // retrieve additional under cursor
3304  // check if additional can open dialog
3305  if (addtional && addtional->getTagProperty().hasDialog()) {
3306  addtional->openAdditionalDialog();
3307  }
3308  return 1;
3309 }
3310 
3311 
3312 void
3313 GNEViewNet::processClick(void* eventData) {
3314  FXEvent* evt = (FXEvent*)eventData;
3315  // process click
3316  destroyPopup();
3317  setFocus();
3318  myChanger->onLeftBtnPress(eventData);
3319  grab();
3320  // Check there are double click
3321  if (evt->click_count == 2) {
3322  handle(this, FXSEL(SEL_DOUBLECLICKED, 0), eventData);
3323  }
3324 }
3325 
3326 
3327 void
3329  // first check if we're panning
3330  if (myPanning) {
3331  // move view
3334  } else {
3335  // declare flags
3336  bool cursorMoveView = false;
3337  bool cursorInspect = false;
3338  bool cursorSelect = false;
3339  bool cursorMoveElement = false;
3340  bool cursorDelete = false;
3341  // continue depending of supermode
3343  // move view
3349  cursorMoveView = true;
3350  }
3351  // specific mode
3353  cursorInspect = true;
3355  cursorSelect = true;
3357  cursorMoveElement = true;
3359  cursorDelete = true;
3360  }
3361  } else if (myEditModes.isCurrentSupermodeDemand()) {
3362  // move view
3366  cursorMoveView = true;
3367  }
3368  // specific mode
3370  cursorInspect = true;
3372  cursorSelect = true;
3374  cursorMoveElement = true;
3376  cursorDelete = true;
3377  }
3378  } else if (myEditModes.isCurrentSupermodeData()) {
3379  // move view
3381  cursorMoveView = true;
3382  }
3383  // specific mode
3385  cursorInspect = true;
3387  cursorSelect = true;
3389  cursorDelete = true;
3390  }
3391  }
3392  // set cursor
3393  if (myMouseButtonKeyPressed.controlKeyPressed() && cursorMoveView) {
3394  // move view cursor if control key is pressed
3397  } else if (cursorInspect) {
3398  // special case for inspect lanes
3400  // inspect lane cursor
3403  } else {
3404  // inspect cursor
3407  }
3408  } else if (cursorSelect) {
3409  // special case for select lanes
3411  // select lane cursor
3414  } else {
3415  // select cursor
3416  setDefaultCursor(GUICursorSubSys::getCursor(GUICursor::SELECT));
3418  }
3419  } else if (cursorMoveElement) {
3420  // move cursor
3423  } else if (cursorDelete) {
3424  // delete cursor
3427  } else {
3428  // default cursor
3431  }
3432  }
3433 }
3434 
3435 
3436 int
3438  // udpdate drawing toggle
3439  if (myDrawingToggle > 10000) {
3440  myDrawingToggle = 0;
3441  } else {
3442  myDrawingToggle++;
3443  }
3444  // set default scale
3446  // calculate boundary extremes
3447  const float minB[2] = { (float)bound.xmin(), (float)bound.ymin() };
3448  const float maxB[2] = { (float)bound.xmax(), (float)bound.ymax() };
3449  // reset gl line to 1
3450  glLineWidth(1);
3451  // set drawing modes
3452  glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
3453  glEnable(GL_POLYGON_OFFSET_FILL);
3454  glEnable(GL_POLYGON_OFFSET_LINE);
3455  // draw all elements between minB and maxB, obtain objects included in minB and maxB
3456  return myGrid->Search(minB, maxB, *myVisualizationSettings);
3457 }
3458 
3459 
3460 void
3462  // depending of the visualizationSettings, enable or disable check box show grid
3464  // change show grid
3467  // change to true
3470  // update show grid buttons
3473  }
3474  // draw grid only in network and demand mode
3476  paintGLGrid();
3477  }
3478  } else {
3479  // change show grid
3482  // change to false
3485  // update show grid buttons
3488  }
3489  }
3490 }
3491 
3492 
3493 long
3494 GNEViewNet::onCmdResetEdgeEndPoints(FXObject*, FXSelector, void*) {
3495  // Obtain junction under mouse
3497  if (junction) {
3498  myUndoList->begin(GUIIcon::EDGE, TL("reset edge endpoints"));
3499  // are, otherwise recompute them
3500  if (junction->isAttributeCarrierSelected()) {
3501  const auto selectedJunctions = myNet->getAttributeCarriers()->getSelectedJunctions();
3502  for (const auto& selectedJunction : selectedJunctions) {
3503  // reset shape end from incoming edges
3504  for (const auto& incomingEdge : selectedJunction->getGNEIncomingEdges()) {
3505  incomingEdge->setAttribute(GNE_ATTR_SHAPE_END, "", myUndoList);
3506  }
3507  // reset shape start from outgoing edges
3508  for (const auto& outgoingEdge : selectedJunction->getGNEOutgoingEdges()) {
3509  outgoingEdge->setAttribute(GNE_ATTR_SHAPE_START, "", myUndoList);
3510  }
3511  }
3512  } else {
3513  // reset shape end from incoming edges
3514  for (const auto& incomingEdge : junction->getGNEIncomingEdges()) {
3515  incomingEdge->setAttribute(GNE_ATTR_SHAPE_END, "", myUndoList);
3516  }
3517  // reset shape start from outgoing edges
3518  for (const auto& outgoingEdge : junction->getGNEOutgoingEdges()) {
3519  outgoingEdge->setAttribute(GNE_ATTR_SHAPE_START, "", myUndoList);
3520  }
3521  }
3522  myUndoList->end();
3523  }
3524  // destroy pop-up and set focus in view net
3525  destroyPopup();
3526  setFocus();
3527  return 1;
3528 }
3529 
3530 
3531 long
3532 GNEViewNet::onCmdEditJunctionShape(FXObject*, FXSelector, void*) {
3533  // Obtain junction under mouse
3535  if (junction) {
3536  // check if network has to be updated
3537  if (junction->getNBNode()->getShape().size() == 0) {
3538  // recompute the whole network
3540  }
3541  // if grid is enabled, show warning
3543  WRITE_WARNING(TL("Grid is still active, press ctrl+g to deactivate"));
3544  }
3545  // start edit custom shape
3547  }
3548  // destroy pop-up and set focus in view net
3549  destroyPopup();
3550  setFocus();
3551  return 1;
3552 }
3553 
3554 
3555 long
3556 GNEViewNet::onCmdResetJunctionShape(FXObject*, FXSelector, void*) {
3557  // Obtain junction under mouse
3559  if (junction) {
3560  // are, otherwise recompute them
3561  if (junction->isAttributeCarrierSelected()) {
3562  myUndoList->begin(junction, TL("reset custom junction shapes"));
3563  const auto selectedJunctions = myNet->getAttributeCarriers()->getSelectedJunctions();
3564  for (const auto& selectedJunction : selectedJunctions) {
3565  selectedJunction->setAttribute(SUMO_ATTR_SHAPE, "", myUndoList);
3566  }
3567  myUndoList->end();
3568  } else {
3569  myUndoList->begin(junction, TL("reset custom junction shape"));
3570  junction->setAttribute(SUMO_ATTR_SHAPE, "", myUndoList);
3571  myUndoList->end();
3572  }
3573  }
3574  // destroy pop-up and set focus in view net
3575  destroyPopup();
3576  setFocus();
3577  return 1;
3578 }
3579 
3580 
3581 long
3582 GNEViewNet::onCmdReplaceJunction(FXObject*, FXSelector, void*) {
3584  if (junction != nullptr) {
3586  updateViewNet();
3587  }
3588  // destroy pop-up and set focus in view net
3589  destroyPopup();
3590  setFocus();
3591  return 1;
3592 }
3593 
3594 
3595 long
3596 GNEViewNet::onCmdSplitJunction(FXObject*, FXSelector, void*) {
3598  if (junction != nullptr) {
3599  myNet->splitJunction(junction, false, myUndoList);
3600  updateViewNet();
3601  }
3602  // destroy pop-up and set focus in view net
3603  destroyPopup();
3604  setFocus();
3605  return 1;
3606 }
3607 
3608 
3609 long
3610 GNEViewNet::onCmdSplitJunctionReconnect(FXObject*, FXSelector, void*) {
3612  if (junction != nullptr) {
3613  myNet->splitJunction(junction, true, myUndoList);
3614  updateViewNet();
3615  }
3616  // destroy pop-up and set focus in view net
3617  destroyPopup();
3618  setFocus();
3619  return 1;
3620 }
3621 
3622 long
3623 GNEViewNet::onCmdSelectRoundabout(FXObject*, FXSelector, void*) {
3625  if (junction != nullptr) {
3626  myNet->selectRoundabout(junction, myUndoList);
3627  updateViewNet();
3628  }
3629  // destroy pop-up and set focus in view net
3630  destroyPopup();
3631  setFocus();
3632  return 1;
3633 }
3634 
3635 long
3636 GNEViewNet::onCmdConvertRoundabout(FXObject*, FXSelector, void*) {
3638  if (junction != nullptr) {
3639  myNet->createRoundabout(junction, myUndoList);
3640  updateViewNet();
3641  }
3642  // destroy pop-up and set focus in view net
3643  destroyPopup();
3644  setFocus();
3645  return 1;
3646 }
3647 
3648 
3649 long
3650 GNEViewNet::onEnterConvertRoundabout(FXObject*, FXSelector, void*) {
3651  myDrawPreviewRoundabout = true;
3652  update();
3653  return 1;
3654 }
3655 
3656 
3657 long
3658 GNEViewNet::onLeaveConvertRoundabout(FXObject*, FXSelector, void*) {
3659  myDrawPreviewRoundabout = false;
3660  update();
3661  return 1;
3662 }
3663 
3664 
3665 long
3666 GNEViewNet::onCmdClearConnections(FXObject*, FXSelector, void*) {
3668  if (junction != nullptr) {
3669  // make sure we do not inspect the connection will it is being deleted
3670  if ((myInspectedAttributeCarriers.size() > 0) && (myInspectedAttributeCarriers.front()->getTagProperty().getTag() == SUMO_TAG_CONNECTION)) {
3672  }
3673  // make sure that connections isn't the front attribute
3675  myFrontAttributeCarrier = nullptr;
3676  }
3677  // check if we're handling a selection
3678  if (junction->isAttributeCarrierSelected()) {
3679  const auto selectedJunctions = myNet->getAttributeCarriers()->getSelectedJunctions();
3680  myUndoList->begin(GUIIcon::CONNECTION, TL("clear connections of selected junctions"));
3681  for (const auto& selectedJunction : selectedJunctions) {
3682  myNet->clearJunctionConnections(selectedJunction, myUndoList);
3683  }
3684  myUndoList->end();
3685  } else {
3687  }
3688  updateViewNet();
3689  }
3690  // destroy pop-up and set focus in view net
3691  destroyPopup();
3692  setFocus();
3693  return 1;
3694 }
3695 
3696 
3697 long
3698 GNEViewNet::onCmdResetConnections(FXObject*, FXSelector, void*) {
3700  if (junction != nullptr) {
3701  // make sure we do not inspect the connection will it is being deleted
3702  if ((myInspectedAttributeCarriers.size() > 0) && myInspectedAttributeCarriers.front()->getTagProperty().getTag() == SUMO_TAG_CONNECTION) {
3704  }
3705  // make sure that connections isn't the front attribute
3707  myFrontAttributeCarrier = nullptr;
3708  }
3709  // check if we're handling a selection
3710  if (junction->isAttributeCarrierSelected()) {
3711  const auto selectedJunctions = myNet->getAttributeCarriers()->getSelectedJunctions();
3712  myUndoList->begin(GUIIcon::CONNECTION, TL("reset connections of selected junctions"));
3713  for (const auto& selectedJunction : selectedJunctions) {
3714  myNet->resetJunctionConnections(selectedJunction, myUndoList);
3715  }
3716  myUndoList->end();
3717  } else {
3719  }
3720  updateViewNet();
3721  }
3722  // destroy pop-up and set focus in view net
3723  destroyPopup();
3724  setFocus();
3725  return 1;
3726 }
3727 
3728 
3729 long
3730 GNEViewNet::onCmdAddTLS(FXObject*, FXSelector, void*) {
3732  if (junction != nullptr) {
3733  // check if we're adding TLS in multiple junctions
3734  if (junction->isAttributeCarrierSelected()) {
3735  const auto selectedJunctions = myNet->getAttributeCarriers()->getSelectedJunctions();
3736  myNet->getViewNet()->getUndoList()->begin(GUIIcon::MODETLS, TL("add TLS in multiple junctions"));
3737  for (const auto& selectedJunction : selectedJunctions) {
3738  selectedJunction->setAttribute(SUMO_ATTR_TYPE, "traffic_light", myUndoList);
3739  }
3740  myNet->getViewNet()->getUndoList()->end();
3741  } else {
3742  // change junction type
3743  junction->setAttribute(SUMO_ATTR_TYPE, "traffic_light", myUndoList);
3744  // change to TLS Mode
3746  // set junction in TLS mode
3748  }
3749  }
3750  // destroy pop-up and set focus in view net
3751  destroyPopup();
3752  setFocus();
3753  return 1;
3754 }
3755 
3756 
3757 long
3758 GNEViewNet::onCmdAddJoinTLS(FXObject*, FXSelector, void*) {
3760  if (junction != nullptr) {
3761  // check if we're adding TLS in multiple junctions
3762  if (junction->isAttributeCarrierSelected()) {
3763  myNet->getViewNet()->getUndoList()->begin(GUIIcon::MODETLS, TL("add TLS in multiple junctions"));
3764  }
3765  // change junction type
3766  junction->setAttribute(SUMO_ATTR_TYPE, "traffic_light", myUndoList);
3767  // if TLS was sucesfully created, apply the same TLID to other selected junctions
3768  if (junction->getAttribute(SUMO_ATTR_TLID).size() > 0) {
3769  const auto selectedJunctions = myNet->getAttributeCarriers()->getSelectedJunctions();
3770  // iterate over all selected junctions
3771  for (const auto& selectedJunction : selectedJunctions) {
3772  // check that doesn't have a TL
3773  if (selectedJunction->getNBNode()->getControllingTLS().empty()) {
3774  selectedJunction->setAttribute(SUMO_ATTR_TYPE, "traffic_light", myUndoList);
3775  selectedJunction->setAttribute(SUMO_ATTR_TLID, junction->getAttribute(SUMO_ATTR_TLID), myUndoList);
3776  }
3777  }
3778  }
3779  // rename traffic light
3780  if (junction->getNBNode()->getControllingTLS().size() > 0) {
3781  const auto TLSDef = (*junction->getNBNode()->getControllingTLS().begin());
3782  if (!myNet->getTLLogicCont().exist(TLSDef->getID() + "_joined")) {
3783  myUndoList->add(new GNEChange_TLS(junction, TLSDef, TLSDef->getID() + "_joined"), true);
3784  }
3785  }
3786  // end undoList
3787  if (junction->isAttributeCarrierSelected()) {
3788  myNet->getViewNet()->getUndoList()->end();
3789  }
3790  // change to TLS Mode
3792  // set junction in TLS mode
3794  }
3795  // destroy pop-up and set focus in view net
3796  destroyPopup();
3797  setFocus();
3798  return 1;
3799 }
3800 
3801 long
3802 GNEViewNet::onCmdEditConnectionShape(FXObject*, FXSelector, void*) {
3803  // Obtain connection under mouse
3805  if (connection) {
3807  }
3808  // if grid is enabled, show warning
3810  WRITE_WARNING(TL("Grid is still active, press ctrl+g to deactivate"));
3811  }
3812  // destroy pop-up and update view Net
3813  destroyPopup();
3814  setFocus();
3815  return 1;
3816 }
3817 
3818 
3819 long
3820 GNEViewNet::onCmdSmoothConnectionShape(FXObject*, FXSelector, void*) {
3821  // Obtain connection under mouse
3823  if (connection) {
3824  connection->smootShape();
3825  }
3826  // destroy pop-up and update view Net
3827  destroyPopup();
3828  setFocus();
3829  return 1;
3830 }
3831 
3832 
3833 long
3834 GNEViewNet::onCmdEditCrossingShape(FXObject*, FXSelector, void*) {
3835  // Obtain crossing under mouse
3837  if (crossing) {
3838  // check if network has to be updated
3839  if (crossing->getParentJunction()->getNBNode()->getShape().size() == 0) {
3840  // recompute the whole network
3842  }
3843  // if grid is enabled, show warning
3845  WRITE_WARNING(TL("Grid is still active, press ctrl+g to deactivate"));
3846  }
3847  // start edit custom shape
3849  }
3850  // destroy pop-up and update view Net
3851  destroyPopup();
3852  setFocus();
3853  return 1;
3854 }
3855 
3856 
3857 long
3858 GNEViewNet::onCmdEditWalkingAreaShape(FXObject*, FXSelector, void*) {
3859  // Obtain walkingArea under mouse
3861  if (walkingArea) {
3862  // check if network has to be updated
3863  if (walkingArea->getParentJunction()->getNBNode()->getShape().size() == 0) {
3864  // recompute the whole network
3866  // if grid is enabled, show warning
3868  WRITE_WARNING(TL("Grid is still active, press ctrl+g to deactivate"));
3869  }
3870  }
3871  // start edit custom shape
3873  }
3874  // destroy pop-up and update view Net
3875  destroyPopup();
3876  setFocus();
3877  return 1;
3878 }
3879 
3880 
3881 long
3882 GNEViewNet::onCmdToggleSelectEdges(FXObject*, FXSelector sel, void*) {
3883  // Toggle menuCheckSelectEdges
3886  } else {
3888  }
3890  // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
3891  if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_SELECTEDGES)) {
3893  }
3894  return 1;
3895 }
3896 
3897 
3898 long
3899 GNEViewNet::onCmdToggleShowConnections(FXObject*, FXSelector sel, void*) {
3900  // Toggle menuCheckShowConnections
3903  } else {
3905  }
3907  // if show was enabled, init GNEConnections
3910  }
3911  // change flag "showLane2Lane" in myVisualizationSettings
3913  // Hide/show connections require recompute
3914  getNet()->requireRecompute();
3915  // Update viewNet to show/hide connections
3916  updateViewNet();
3917  // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
3918  if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_SHOWCONNECTIONS)) {
3920  }
3921  return 1;
3922 }
3923 
3924 
3925 long
3926 GNEViewNet::onCmdToggleHideConnections(FXObject*, FXSelector sel, void*) {
3927  // Toggle menuCheckHideConnections
3930  } else {
3932  }
3934  // Update viewNet to show/hide connections
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_HIDECONNECTIONS)) {
3939  }
3940  return 1;
3941 }
3942 
3943 
3944 long
3945 GNEViewNet::onCmdToggleShowAdditionalSubElements(FXObject*, FXSelector sel, void*) {
3946  // Toggle menuCheckShowAdditionalSubElements
3949  } else {
3951  }
3953  // Update viewNet to show/hide sub elements
3954  updateViewNet();
3955  // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
3956  if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_SHOWSUBADDITIONALS)) {
3958  }
3959  return 1;
3960 }
3961 
3962 
3963 long
3964 GNEViewNet::onCmdToggleShowTAZElements(FXObject*, FXSelector sel, void*) {
3965  // Toggle menuCheckShowAdditionalSubElements
3968  } else {
3970  }
3972  // Update viewNet to show/hide TAZ elements
3973  updateViewNet();
3974  // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
3975  if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_SHOWTAZELEMENTS)) {
3977  }
3978  return 1;
3979 }
3980 
3981 
3982 long
3983 GNEViewNet::onCmdToggleExtendSelection(FXObject*, FXSelector sel, void*) {
3984  // Toggle menuCheckExtendSelection
3987  } else {
3989  }
3991  // Only update view
3992  updateViewNet();
3993  // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
3994  if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_EXTENDSELECTION)) {
3996  }
3997  return 1;
3998 }
3999 
4000 
4001 long
4002 GNEViewNet::onCmdToggleChangeAllPhases(FXObject*, FXSelector sel, void*) {
4003  // Toggle menuCheckChangeAllPhases
4006  } else {
4008  }
4010  // Only update view
4011  updateViewNet();
4012  // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4013  if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_CHANGEALLPHASES)) {
4015  }
4016  return 1;
4017 }
4018 
4019 
4020 long
4021 GNEViewNet::onCmdToggleShowGrid(FXObject*, FXSelector sel, void*) {
4022  // show or hide grid depending of myNetworkViewOptions.menuCheckToggleGrid
4027  } else {
4031  }
4034  // update view to show grid
4035  updateViewNet();
4036  // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4037  if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_TOGGLEGRID)) {
4039  } else if (sel == FXSEL(SEL_COMMAND, MID_GNE_DEMANDVIEWOPTIONS_SHOWGRID)) {
4041  }
4042  return 1;
4043 }
4044 
4045 
4046 long
4047 GNEViewNet::onCmdToggleDrawJunctionShape(FXObject*, FXSelector sel, void*) {
4048  // toggle state
4050  // gui button has 'hide' semantics
4051  const bool hide = !myVisualizationSettings->drawJunctionShape;
4055 
4059  // update view to show DrawJunctionShape
4060  updateViewNet();
4061  // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4062  if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_TOGGLEDRAWJUNCTIONSHAPE)) {
4064  } else if (sel == FXSEL(SEL_COMMAND, MID_GNE_DEMANDVIEWOPTIONS_TOGGLEDRAWJUNCTIONSHAPE)) {
4066  } else if (sel == FXSEL(SEL_COMMAND, MID_GNE_DATAVIEWOPTIONS_TOGGLEDRAWJUNCTIONSHAPE)) {
4068  }
4069  return 1;
4070 }
4071 
4072 long
4073 GNEViewNet::onCmdToggleDrawSpreadVehicles(FXObject*, FXSelector sel, void*) {
4074  // Toggle menuCheckShowDemandElements
4079  } else {
4082  }
4085  // declare edge set
4086  std::set<GNEEdge*> edgesToUpdate;
4087  // compute vehicle geometry
4088  for (const auto& vehicle : myNet->getAttributeCarriers()->getDemandElements().at(SUMO_TAG_VEHICLE)) {
4089  if (vehicle.second->getParentEdges().size() > 0) {
4090  edgesToUpdate.insert(vehicle.second->getParentEdges().front());
4091  } else if (vehicle.second->getChildDemandElements().size() > 0 && (vehicle.second->getChildDemandElements().front()->getTagProperty().getTag() == GNE_TAG_ROUTE_EMBEDDED)) {
4092  edgesToUpdate.insert(vehicle.second->getChildDemandElements().front()->getParentEdges().front());
4093  }
4094  }
4095  for (const auto& routeFlow : myNet->getAttributeCarriers()->getDemandElements().at(GNE_TAG_FLOW_ROUTE)) {
4096  if (routeFlow.second->getParentEdges().size() > 0) {
4097  edgesToUpdate.insert(routeFlow.second->getParentEdges().front());
4098  } else if (routeFlow.second->getChildDemandElements().size() > 0 && (routeFlow.second->getChildDemandElements().front()->getTagProperty().getTag() == GNE_TAG_ROUTE_EMBEDDED)) {
4099  edgesToUpdate.insert(routeFlow.second->getChildDemandElements().front()->getParentEdges().front());
4100  }
4101  }
4102  for (const auto& trip : myNet->getAttributeCarriers()->getDemandElements().at(SUMO_TAG_TRIP)) {
4103  if (trip.second->getParentEdges().size() > 0) {
4104  edgesToUpdate.insert(trip.second->getParentEdges().front());
4105  }
4106  }
4107  for (const auto& flow : myNet->getAttributeCarriers()->getDemandElements().at(SUMO_TAG_FLOW)) {
4108  if (flow.second->getParentEdges().size() > 0) {
4109  edgesToUpdate.insert(flow.second->getParentEdges().front());
4110  }
4111  }
4112  // update spread geometries of all edges
4113  for (const auto& edge : edgesToUpdate) {
4114  edge->updateVehicleSpreadGeometries();
4115  }
4116  // update view to show new vehicles positions
4117  updateViewNet();
4118  // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4119  if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_DRAWSPREADVEHICLES)) {
4121  } else if (sel == FXSEL(SEL_COMMAND, MID_GNE_DEMANDVIEWOPTIONS_DRAWSPREADVEHICLES)) {
4123  }
4124  return 1;
4125 }
4126 
4127 
4128 long
4129 GNEViewNet::onCmdToggleWarnAboutMerge(FXObject*, FXSelector sel, void*) {
4130  // Toggle menuCheckWarnAboutMerge
4133  } else {
4135  }
4137  // Only update view
4138  updateViewNet();
4139  // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4140  if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_ASKFORMERGE)) {
4142  }
4143  return 1;
4144 }
4145 
4146 
4147 long
4148 GNEViewNet::onCmdToggleShowJunctionBubbles(FXObject*, FXSelector sel, void*) {
4149  // Toggle menuCheckShowJunctionBubble
4152  } else {
4154  }
4156  // Only update view
4157  updateViewNet();
4158  // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4159  if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_SHOWBUBBLES)) {
4161  }
4162  return 1;
4163 }
4164 
4165 
4166 long
4167 GNEViewNet::onCmdToggleMoveElevation(FXObject*, FXSelector sel, void*) {
4168  // Toggle menuCheckMoveElevation
4171  } else {
4173  }
4175  // Only update view
4176  updateViewNet();
4177  // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4178  if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_MOVEELEVATION)) {
4180  }
4181  return 1;
4182 }
4183 
4184 
4185 long
4186 GNEViewNet::onCmdToggleChainEdges(FXObject*, FXSelector sel, void*) {
4187  // Toggle menuCheckMoveElevation
4190  } else {
4192  }
4194  // Only update view
4195  updateViewNet();
4196  // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4197  if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_CHAINEDGES)) {
4199  }
4200  return 1;
4201 }
4202 
4203 
4204 long
4205 GNEViewNet::onCmdToggleAutoOppositeEdge(FXObject*, FXSelector sel, void*) {
4206  // Toggle menuCheckAutoOppositeEdge
4209  } else {
4211  }
4213  // Only update view
4214  updateViewNet();
4215  // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4216  if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_AUTOOPPOSITEEDGES)) {
4218  }
4219  return 1;
4220 }
4221 
4222 
4223 long
4224 GNEViewNet::onCmdToggleHideNonInspecteDemandElements(FXObject*, FXSelector sel, void*) {
4225  // Toggle menuCheckHideNonInspectedDemandElements
4228  } else {
4230  }
4232  // Only update view
4233  updateViewNet();
4234  // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4235  if (sel == FXSEL(SEL_COMMAND, MID_GNE_DEMANDVIEWOPTIONS_HIDENONINSPECTED)) {
4237  }
4238  return 1;
4239 }
4240 
4241 
4242 long
4243 GNEViewNet::onCmdToggleShowOverlappedRoutes(FXObject*, FXSelector sel, void*) {
4244  // Toggle menuCheckShowOverlappedRoutes
4247  } else {
4249  }
4251  // Only update view
4252  updateViewNet();
4253  // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4254  if (sel == FXSEL(SEL_COMMAND, MID_GNE_DEMANDVIEWOPTIONS_SHOWOVERLAPPEDROUTES)) {
4256  }
4257  return 1;
4258 }
4259 
4260 
4261 long
4262 GNEViewNet::onCmdToggleHideShapes(FXObject*, FXSelector sel, void*) {
4263  // Toggle menuCheckHideShapes
4266  } else {
4268  }
4270  // Only update view
4271  updateViewNet();
4272  // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4273  if (sel == FXSEL(SEL_COMMAND, MID_GNE_DEMANDVIEWOPTIONS_HIDESHAPES)) {
4275  }
4276  return 1;
4277 }
4278 
4279 
4280 long
4281 GNEViewNet::onCmdToggleShowTrips(FXObject*, FXSelector sel, void*) {
4282  // Toggle menuCheckHideShapes
4285  } else {
4287  }
4289  // Only update view
4290  updateViewNet();
4291  // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4292  if (sel == FXSEL(SEL_COMMAND, MID_GNE_DEMANDVIEWOPTIONS_SHOWTRIPS)) {
4294  }
4295  return 1;
4296 }
4297 
4298 
4299 long
4300 GNEViewNet::onCmdToggleShowAllPersonPlans(FXObject*, FXSelector sel, void*) {
4301  // Toggle menuCheckShowAllPersonPlans
4304  } else {
4306  }
4308  // Only update view
4309  updateViewNet();
4310  // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4311  if (sel == FXSEL(SEL_COMMAND, MID_GNE_DEMANDVIEWOPTIONS_SHOWALLPERSONPLANS)) {
4313  }
4314  return 1;
4315 }
4316 
4317 
4318 long
4319 GNEViewNet::onCmdToggleLockPerson(FXObject*, FXSelector sel, void*) {
4320  // Toggle menuCheckLockPerson
4323  } else if ((myInspectedAttributeCarriers.size() > 0) && myInspectedAttributeCarriers.front()->getTagProperty().isPerson()) {
4325  }
4327  // lock or unlock current inspected person depending of menuCheckLockPerson value
4329  // obtain locked person or person plan
4330  const GNEDemandElement* personOrPersonPlan = dynamic_cast<const GNEDemandElement*>(myInspectedAttributeCarriers.front());
4331  if (personOrPersonPlan) {
4332  // lock person depending if casted demand element is either a person or a person plan
4333  if (personOrPersonPlan->getTagProperty().isPerson()) {
4334  myDemandViewOptions.lockPerson(personOrPersonPlan);
4335  } else {
4336  myDemandViewOptions.lockPerson(personOrPersonPlan->getParentDemandElements().front());
4337  }
4338  }
4339  } else {
4340  // unlock current person
4342  }
4343  // update view
4344  updateViewNet();
4345  // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4346  if (sel == FXSEL(SEL_COMMAND, MID_GNE_DEMANDVIEWOPTIONS_LOCKPERSON)) {
4348  }
4349  return 1;
4350 }
4351 
4352 
4353 long
4354 GNEViewNet::onCmdToggleShowAllContainerPlans(FXObject*, FXSelector sel, void*) {
4355  // Toggle menuCheckShowAllContainerPlans
4358  } else {
4360  }
4362  // Only update view
4363  updateViewNet();
4364  // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4365  if (sel == FXSEL(SEL_COMMAND, MID_GNE_DEMANDVIEWOPTIONS_SHOWALLCONTAINERPLANS)) {
4367  }
4368  return 1;
4369 }
4370 
4371 
4372 long
4373 GNEViewNet::onCmdToggleLockContainer(FXObject*, FXSelector sel, void*) {
4374  // Toggle menuCheckLockContainer
4377  } else if ((myInspectedAttributeCarriers.size() > 0) && myInspectedAttributeCarriers.front()->getTagProperty().isContainer()) {
4379  }
4381  // lock or unlock current inspected container depending of menuCheckLockContainer value
4383  // obtain locked container or container plan
4384  const GNEDemandElement* containerOrContainerPlan = dynamic_cast<const GNEDemandElement*>(myInspectedAttributeCarriers.front());
4385  if (containerOrContainerPlan) {
4386  // lock container depending if casted demand element is either a container or a container plan
4387  if (containerOrContainerPlan->getTagProperty().isContainer()) {
4388  myDemandViewOptions.lockContainer(containerOrContainerPlan);
4389  } else {
4390  myDemandViewOptions.lockContainer(containerOrContainerPlan->getParentDemandElements().front());
4391  }
4392  }
4393  } else {
4394  // unlock current container
4396  }
4397  // update view
4398  updateViewNet();
4399  // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4400  if (sel == FXSEL(SEL_COMMAND, MID_GNE_DEMANDVIEWOPTIONS_LOCKCONTAINER)) {
4402  }
4403  return 1;
4404 }
4405 
4406 
4407 long
4408 GNEViewNet::onCmdToggleShowAdditionals(FXObject*, FXSelector sel, void*) {
4409  // Toggle menuCheckShowAdditionals
4412  } else {
4414  }
4416  // Only update view
4417  updateViewNet();
4418  // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4419  if (sel == FXSEL(SEL_COMMAND, MID_GNE_DATAVIEWOPTIONS_SHOWADDITIONALS)) {
4421  }
4422  return 1;
4423 }
4424 
4425 
4426 long
4427 GNEViewNet::onCmdToggleShowShapes(FXObject*, FXSelector sel, void*) {
4428  // Toggle menuCheckShowShapes
4431  } else {
4433  }
4435  // Only update view
4436  updateViewNet();
4437  // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4438  if (sel == FXSEL(SEL_COMMAND, MID_GNE_DATAVIEWOPTIONS_SHOWSHAPES)) {
4440  }
4441  return 1;
4442 }
4443 
4444 
4445 long
4446 GNEViewNet::onCmdToggleShowDemandElementsNetwork(FXObject*, FXSelector sel, void*) {
4447  // Toggle menuCheckShowDemandElements
4450  } else {
4452  }
4454  // compute demand elements
4456  // update view to show demand elements
4457  updateViewNet();
4458  // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4459  if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_SHOWDEMANDELEMENTS)) {
4461  }
4462  return 1;
4463 }
4464 
4465 
4466 long
4467 GNEViewNet::onCmdToggleShowDemandElementsData(FXObject*, FXSelector sel, void*) {
4468  // Toggle menuCheckShowDemandElements
4471  } else {
4473  }
4475  // compute demand elements
4477  // update view to show demand elements
4478  updateViewNet();
4479  // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4480  if (sel == FXSEL(SEL_COMMAND, MID_GNE_DATAVIEWOPTIONS_SHOWDEMANDELEMENTS)) {
4482  }
4483  return 1;
4484 }
4485 
4486 
4487 long
4488 GNEViewNet::onCmdToggleTAZRelDrawing(FXObject*, FXSelector sel, void*) {
4489  // Toggle menuCheckShowDemandElements
4492  } else {
4494  }
4496  // update view to show demand elements
4497  updateViewNet();
4498  // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4499  if (sel == FXSEL(SEL_COMMAND, MID_GNE_DATAVIEWOPTIONS_TAZRELDRAWING)) {
4501  }
4502  return 1;
4503 }
4504 
4505 
4506 long
4507 GNEViewNet::onCmdToggleTAZDrawFill(FXObject*, FXSelector sel, void*) {
4508  // Toggle menuCheckShowDemandElements
4511  } else {
4513  }
4515  // update view to show demand elements
4516  updateViewNet();
4517  // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4518  if (sel == FXSEL(SEL_COMMAND, MID_GNE_DATAVIEWOPTIONS_TAZDRAWFILL)) {
4520  }
4521  return 1;
4522 }
4523 
4524 
4525 long
4526 GNEViewNet::onCmdToggleTAZRelOnlyFrom(FXObject*, FXSelector sel, void*) {
4527  // Toggle menuCheckShowDemandElements
4530  } else {
4532  }
4534  // update view to show demand elements
4535  updateViewNet();
4536  // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4537  if (sel == FXSEL(SEL_COMMAND, MID_GNE_DATAVIEWOPTIONS_TAZRELONLYFROM)) {
4539  }
4540  return 1;
4541 }
4542 
4543 
4544 long
4545 GNEViewNet::onCmdToggleTAZRelOnlyTo(FXObject*, FXSelector sel, void*) {
4546  // Toggle menuCheckShowDemandElements
4549  } else {
4551  }
4553  // update view to show demand elements
4554  updateViewNet();
4555  // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4556  if (sel == FXSEL(SEL_COMMAND, MID_GNE_DATAVIEWOPTIONS_TAZRELONLYTO)) {
4558  }
4559  return 1;
4560 }
4561 
4562 
4563 long
4564 GNEViewNet::onCmdIntervalBarGenericDataType(FXObject*, FXSelector, void*) {
4566  return 1;
4567 }
4568 
4569 
4570 long
4571 GNEViewNet::onCmdIntervalBarDataSet(FXObject*, FXSelector, void*) {
4573  return 1;
4574 }
4575 
4576 
4577 long
4578 GNEViewNet::onCmdIntervalBarLimit(FXObject*, FXSelector, void*) {
4580  return 1;
4581 }
4582 
4583 
4584 long
4585 GNEViewNet::onCmdIntervalBarSetBegin(FXObject*, FXSelector, void*) {
4587  return 1;
4588 }
4589 
4590 
4591 long
4592 GNEViewNet::onCmdIntervalBarSetEnd(FXObject*, FXSelector, void*) {
4594  return 1;
4595 }
4596 
4597 
4598 long
4599 GNEViewNet::onCmdIntervalBarSetParameter(FXObject*, FXSelector, void*) {
4601  return 1;
4602 }
4603 
4604 
4605 long
4606 GNEViewNet::onCmdAddSelected(FXObject*, FXSelector, void*) {
4607  // only select if AC under cursor isn't previously selected
4609  if (AC && !AC->isAttributeCarrierSelected()) {
4610  AC->selectAttributeCarrier();
4611  }
4612  return 1;
4613 }
4614 
4615 
4616 long
4617 GNEViewNet::onCmdRemoveSelected(FXObject*, FXSelector, void*) {
4618  // only unselect if AC under cursor isn't previously selected
4620  if (AC && AC->isAttributeCarrierSelected()) {
4622  }
4623  return 1;
4624 }
4625 
4626 
4627 long
4628 GNEViewNet::onCmdAddEdgeSelected(FXObject*, FXSelector, void*) {
4629  // only select if edge under cursor isn't previously selected
4630  auto edge = myViewObjectsSelector.getEdgeFront();
4631  if (edge && !edge->isAttributeCarrierSelected()) {
4632  edge->selectAttributeCarrier();
4633  }
4634  return 1;
4635 }
4636 
4637 
4638 long
4639 GNEViewNet::onCmdRemoveEdgeSelected(FXObject*, FXSelector, void*) {
4640  // only unselect if edge under cursor isn't previously selected
4641  auto edge = myViewObjectsSelector.getEdgeFront();
4642  if (edge && edge->isAttributeCarrierSelected()) {
4643  edge->unselectAttributeCarrier();
4644  }
4645  return 1;
4646 }
4647 
4648 
4649 long
4650 GNEViewNet::onCmdSetNeteditView(FXObject*, FXSelector sel, void*) {
4651  myEditModes.setView(FXSELID(sel));
4652  update();
4653  return 1;
4654 }
4655 
4656 // ===========================================================================
4657 // private
4658 // ===========================================================================
4659 
4660 void
4662  // build supermode buttons
4664 
4665  // build save elements buttons
4667 
4668  // build time switch buttons
4670 
4671  // build menu checks for Common checkable buttons
4673 
4674  // build menu checks for Network checkable buttons
4676 
4677  // build menu checks for Demand checkable buttons
4679 
4680  // build menu checks of view options Data
4682 
4683  // Create Vertical separator
4685  // XXX for some reason the vertical groove is not visible. adding more spacing to emphasize the separation
4688 
4689  // build menu checks of view options Network
4691 
4692  // build menu checks of view options Demand
4694 
4695  // build menu checks of view options Data
4697 
4698  // build interval bar
4700 }
4701 
4702 
4703 void
4705  // get menu checks
4707  // hide all checkbox of view options Network
4709  // hide all checkbox of view options Demand
4711  // hide all checkbox of view options Data
4713  // disable all common edit modes
4715  // disable all network edit modes
4717  // disable all network edit modes
4719  // hide interval bar
4721  // hide all frames
4723  // hide all menuchecks
4727  // In network mode, always show option "show grid", "draw spread vehicles" and "show demand elements"
4732  menuChecks.menuCheckToggleGrid->show();
4733  menuChecks.menuCheckToggleDrawJunctionShape->show();
4734  menuChecks.menuCheckDrawSpreadVehicles->show();
4735  menuChecks.menuCheckShowDemandElements->show();
4736  // show separator
4737  menuChecks.separator->show();
4738  // enable selected controls
4739  switch (myEditModes.networkEditMode) {
4740  // common modes
4746  // show view options
4751  // show menu checks
4752  menuChecks.menuCheckSelectEdges->show();
4753  menuChecks.menuCheckShowConnections->show();
4754  menuChecks.menuCheckShowAdditionalSubElements->show();
4755  menuChecks.menuCheckShowTAZElements->show();
4756  // update lock menu bar
4758  // show
4759  break;
4768  // show view options
4771  menuChecks.menuCheckShowAdditionalSubElements->show();
4772  menuChecks.menuCheckShowTAZElements->show();
4773  // show menu checks
4774  menuChecks.menuCheckSelectEdges->show();
4775  menuChecks.menuCheckShowConnections->show();
4776  break;
4782  // show view options
4788  // show menu checks
4789  menuChecks.menuCheckSelectEdges->show();
4790  menuChecks.menuCheckShowConnections->show();
4791  menuChecks.menuCheckExtendSelection->show();
4792  menuChecks.menuCheckShowAdditionalSubElements->show();
4793  menuChecks.menuCheckShowTAZElements->show();
4794  break;
4795  // specific modes
4801  // show view options
4804  // show menu checks
4805  menuChecks.menuCheckChainEdges->show();
4806  menuChecks.menuCheckAutoOppositeEdge->show();
4807  break;
4813  // show view options
4817  // show menu checks
4818  menuChecks.menuCheckWarnAboutMerge->show();
4819  menuChecks.menuCheckShowJunctionBubble->show();
4820  menuChecks.menuCheckMoveElevation->show();
4821  break;
4827  break;
4833  // show view options
4835  // show menu checks
4836  menuChecks.menuCheckChangeAllPhases->show();
4837  break;
4843  // show view options
4845  // show menu checks
4846  menuChecks.menuCheckShowAdditionalSubElements->show();
4847  break;
4853  break;
4859  break;
4865  break;
4871  break;
4877  break;
4883  break;
4884  default:
4885  break;
4886  }
4887  // update menuChecks shorcuts
4888  menuChecks.updateShortcuts();
4889  // update common Network buttons
4891  // Update Network buttons
4893  // recalc toolbar
4896  // force repaint because different modes draw different things
4897  onPaint(nullptr, 0, nullptr);
4898  // finally update view
4899  updateViewNet();
4900 }
4901 
4902 
4903 void
4905  // get menu checks
4907  // hide all checkbox of view options Network
4909  // hide all checkbox of view options Demand
4911  // hide all checkbox of view options Data
4913  // disable all common edit modes
4915  // disable all Demand edit modes
4917  // disable all network edit modes
4919  // hide interval bar
4921  // hide all frames
4923  // hide all menuchecks
4927  // always show "hide shapes", "show grid", "draw spread vehicles", "show overlapped routes" and show/lock persons and containers
4938  menuChecks.menuCheckToggleGrid->show();
4939  menuChecks.menuCheckToggleDrawJunctionShape->show();
4940  menuChecks.menuCheckDrawSpreadVehicles->show();
4941  menuChecks.menuCheckHideShapes->show();
4942  menuChecks.menuCheckShowAllTrips->show();
4943  menuChecks.menuCheckShowAllPersonPlans->show();
4944  menuChecks.menuCheckLockPerson->show();
4945  menuChecks.menuCheckShowAllContainerPlans->show();
4946  menuChecks.menuCheckLockContainer->show();
4947  menuChecks.menuCheckShowOverlappedRoutes->show();
4948  // show separator
4949  menuChecks.separator->show();
4950  // enable selected controls
4951  switch (myEditModes.demandEditMode) {
4952  // common modes
4957  // set checkable button
4959  // show view options
4961  // show menu checks
4962  menuChecks.menuCheckHideNonInspectedDemandElements->show();
4963  break;
4968  // set checkable button
4970  break;
4975  // set checkable button
4977  break;
4982  // set checkable button
4984  break;
4985  // specific modes
4990  // set checkable button
4992  break;
4997  // set checkable button
4999  break;
5004  // set checkable button
5006  break;
5011  // set checkable button
5013  break;
5018  // set checkable button
5020  break;
5025  // set checkable button
5027  break;
5032  // set checkable button
5034  break;
5039  // set checkable button
5041  break;
5046  // set checkable button
5048  break;
5053  // set checkable button
5055  break;
5056  default:
5057  break;
5058  }
5059  // update menuChecks shorcuts
5060  menuChecks.updateShortcuts();
5061  // update common Network buttons
5063  // Update Demand buttons
5065  // recalc toolbar
5068  // force repaint because different modes draw different things
5069  onPaint(nullptr, 0, nullptr);
5070  // finally update view
5071  updateViewNet();
5072 }
5073 
5074 
5075 void
5077  // get menu checks
5079  // hide all checkbox of view options Network
5081  // hide all checkbox of view options Demand
5083  // hide all checkbox of view options Data
5085  // disable all common edit modes
5087  // disable all Data edit modes
5089  // show interval bar
5091  // hide all frames
5093  // hide all menuchecks
5097  // In data mode, always show options for show elements
5102  menuChecks.menuCheckToggleDrawJunctionShape->show();
5103  menuChecks.menuCheckShowAdditionals->show();
5104  menuChecks.menuCheckShowShapes->show();
5105  menuChecks.menuCheckShowDemandElements->show();
5106  // show separator
5107  menuChecks.separator->show();
5108  // enable selected controls
5109  switch (myEditModes.dataEditMode) {
5110  // common modes
5115  // set checkable button
5117  // show view option
5122  // show menu check
5123  menuChecks.menuCheckToggleTAZRelDrawing->show();
5124  menuChecks.menuCheckToggleTAZDrawFill->show();
5125  menuChecks.menuCheckToggleTAZRelOnlyFrom->show();
5126  menuChecks.menuCheckToggleTAZRelOnlyTo->show();
5127  break;
5132  // set checkable button
5134  // show toggle TAZRel drawing view option
5138  // show toggle TAZRel drawing menu check
5139  menuChecks.menuCheckToggleTAZRelDrawing->show();
5140  menuChecks.menuCheckToggleTAZRelOnlyFrom->show();
5141  menuChecks.menuCheckToggleTAZRelOnlyTo->show();
5142  break;
5147  // set checkable button
5149  // show toggle TAZRel drawing view option
5153  // show toggle TAZRel drawing menu check
5154  menuChecks.menuCheckToggleTAZRelDrawing->show();
5155  menuChecks.menuCheckToggleTAZRelOnlyFrom->show();
5156  menuChecks.menuCheckToggleTAZRelOnlyTo->show();
5157  break;
5162  // set checkable button
5164  break;
5169  // set checkable button
5171  break;
5176  // set checkable button
5178  // show view option
5183  // show menu check
5184  menuChecks.menuCheckToggleTAZRelDrawing->show();
5185  menuChecks.menuCheckToggleTAZDrawFill->show();
5186  menuChecks.menuCheckToggleTAZRelOnlyFrom->show();
5187  menuChecks.menuCheckToggleTAZRelOnlyTo->show();
5188  break;
5193  // set checkable button
5195  break;
5196  default:
5197  break;
5198  }
5199  // update menuChecks shorcuts
5200  menuChecks.updateShortcuts();
5201  // update common Network buttons
5203  // Update Data buttons
5205  // recalc toolbar
5208  // force repaint because different modes draw different things
5209  onPaint(nullptr, 0, nullptr);
5210  // finally update view
5211  updateViewNet();
5212 }
5213 
5214 
5215 void
5216 GNEViewNet::deleteNetworkAttributeCarriers(const std::vector<GNEAttributeCarrier*> ACs) {
5217  // iterate over ACs and delete it
5218  for (const auto& AC : ACs) {
5219  if (AC->getTagProperty().getTag() == SUMO_TAG_JUNCTION) {
5220  // get junction (note: could be already removed if is a child, then hardfail=false)
5221  GNEJunction* junction = myNet->getAttributeCarriers()->retrieveJunction(AC->getID(), false);
5222  // if exist, remove it
5223  if (junction) {
5224  myNet->deleteJunction(junction, myUndoList);
5225  }
5226  } else if (AC->getTagProperty().getTag() == SUMO_TAG_CROSSING) {
5227  // get crossing (note: could be already removed if is a child, then hardfail=false)
5228  GNECrossing* crossing = myNet->getAttributeCarriers()->retrieveCrossing(AC->getGUIGlObject(), false);
5229  // if exist, remove it
5230  if (crossing) {
5231  myNet->deleteCrossing(crossing, myUndoList);
5232  }
5233  } else if (AC->getTagProperty().getTag() == SUMO_TAG_EDGE) {
5234  // get edge (note: could be already removed if is a child, then hardfail=false)
5235  GNEEdge* edge = myNet->getAttributeCarriers()->retrieveEdge(AC->getID(), false);
5236  // if exist, remove it
5237  if (edge) {
5238  myNet->deleteEdge(edge, myUndoList, false);
5239  }
5240  } else if (AC->getTagProperty().getTag() == SUMO_TAG_LANE) {
5241  // get lane (note: could be already removed if is a child, then hardfail=false)
5242  GNELane* lane = myNet->getAttributeCarriers()->retrieveLane(AC->getGUIGlObject(), false);
5243  // if exist, remove it
5244  if (lane) {
5245  myNet->deleteLane(lane, myUndoList, false);
5246  }
5247  } else if (AC->getTagProperty().getTag() == SUMO_TAG_CONNECTION) {
5248  // get connection (note: could be already removed if is a child, then hardfail=false)
5249  GNEConnection* connection = myNet->getAttributeCarriers()->retrieveConnection(AC->getGUIGlObject(), false);
5250  // if exist, remove it
5251  if (connection) {
5252  myNet->deleteConnection(connection, myUndoList);
5253  }
5254  } else if (AC->getTagProperty().isAdditionalElement()) {
5255  // get additional Element (note: could be already removed if is a child, then hardfail=false)
5256  GNEAdditional* additionalElement = myNet->getAttributeCarriers()->retrieveAdditional(AC->getGUIGlObject(), false);
5257  // if exist, remove it
5258  if (additionalElement) {
5259  myNet->deleteAdditional(additionalElement, myUndoList);
5260  }
5261  }
5262  }
5263 }
5264 
5265 
5266 void
5267 GNEViewNet::deleteDemandAttributeCarriers(const std::vector<GNEAttributeCarrier*> ACs) {
5268  // iterate over ACs and delete it
5269  for (const auto& AC : ACs) {
5270  // get demand Element (note: could be already removed if is a child, then hardfail=false)
5271  GNEDemandElement* demandElement = myNet->getAttributeCarriers()->retrieveDemandElement(AC->getGUIGlObject(), false);
5272  // if exist, remove it
5273  if (demandElement) {
5274  myNet->deleteDemandElement(demandElement, myUndoList);
5275  }
5276  }
5277 }
5278 
5279 
5280 void
5281 GNEViewNet::deleteDataAttributeCarriers(const std::vector<GNEAttributeCarrier*> ACs) {
5282  // iterate over ACs and delete it
5283  for (const auto& AC : ACs) {
5284  if (AC->getTagProperty().getTag() == SUMO_TAG_DATASET) {
5285  // get data set (note: could be already removed if is a child, then hardfail=false)
5286  GNEDataSet* dataSet = myNet->getAttributeCarriers()->retrieveDataSet(AC->getID(), false);
5287  // if exist, remove it
5288  if (dataSet) {
5289  myNet->deleteDataSet(dataSet, myUndoList);
5290  }
5291  } else if (AC->getTagProperty().getTag() == SUMO_TAG_DATAINTERVAL) {
5292  // get data interval (note: could be already removed if is a child, then hardfail=false)
5293  GNEDataInterval* dataInterval = myNet->getAttributeCarriers()->retrieveDataInterval(AC, false);
5294  // if exist, remove it
5295  if (dataInterval) {
5296  myNet->deleteDataInterval(dataInterval, myUndoList);
5297  }
5298  } else {
5299  // get generic data (note: could be already removed if is a child, then hardfail=false)
5300  GNEGenericData* genericData = myNet->getAttributeCarriers()->retrieveGenericData(AC->getGUIGlObject(), false);
5301  // if exist, remove it
5302  if (genericData) {
5303  myNet->deleteGenericData(genericData, myUndoList);
5304  }
5305  }
5306  }
5307 }
5308 
5309 
5310 void
5313  switch (myEditModes.networkEditMode) {
5315  myViewParent->getInspectorFrame()->update();
5316  break;
5317  default:
5318  break;
5319  }
5320  }
5322  switch (myEditModes.demandEditMode) {
5324  myViewParent->getInspectorFrame()->update();
5325  break;
5328  break;
5331  break;
5334  break;
5337  break;
5340  break;
5343  break;
5346  break;
5349  break;
5352  break;
5353  default:
5354  break;
5355  }
5356  }
5358  switch (myEditModes.dataEditMode) {
5360  myViewParent->getInspectorFrame()->update();
5361  break;
5362  default:
5363  break;
5364  }
5365  // update data interval
5367  }
5368  // update view
5369  updateViewNet();
5370 }
5371 
5372 // ---------------------------------------------------------------------------
5373 // Private methods
5374 // ---------------------------------------------------------------------------
5375 
5376 void
5378  PositionVector temporalShape;
5379  bool deleteLastCreatedPoint = false;
5380  // obtain temporal shape and delete last created point flag
5386  deleteLastCreatedPoint = myViewParent->getTAZFrame()->getDrawingShapeModule()->getDeleteLastCreatedPoint();
5387  }
5388  // check if we're in drawing mode
5389  if (temporalShape.size() > 0) {
5390  // draw blue line with the current drawed shape
5392  glLineWidth(2);
5393  glTranslated(0, 0, GLO_TEMPORALSHAPE);
5395  GLHelper::drawLine(temporalShape);
5397  // draw red line from the last point of shape to the current mouse position
5399  glLineWidth(2);
5400  glTranslated(0, 0, GLO_TEMPORALSHAPE);
5401  // draw last line depending if shift key (delete last created point) is pressed
5402  if (deleteLastCreatedPoint) {
5404  } else {
5406  }
5409  }
5410 }
5411 
5412 
5413 void
5415  // first check if we're in correct mode
5420  // get mouse position
5421  const Position mousePosition = snapToActiveGrid(getPositionInformation());
5422  // get junction exaggeration
5423  const double junctionExaggeration = myVisualizationSettings->junctionSize.getExaggeration(*myVisualizationSettings, nullptr, 4);
5424  // get bubble color
5426  // change alpha
5427  bubbleColor.setAlpha(200);
5428  // push layer matrix
5430  // translate to temporal shape layer
5431  glTranslated(0, 0, GLO_TEMPORALSHAPE);
5432  // push junction matrix
5434  // move matrix junction center
5435  glTranslated(mousePosition.x(), mousePosition.y(), 0.1);
5436  // set color
5437  GLHelper::setColor(bubbleColor);
5438  // draw outline circle
5439  const double circleWidth = myVisualizationSettings->neteditSizeSettings.junctionBubbleRadius * junctionExaggeration;
5440  GLHelper::drawOutlineCircle(circleWidth, circleWidth * 0.75, 32);
5441  // pop junction matrix
5443  // draw temporal edge
5445  // set temporal edge color
5446  RGBColor temporalEdgeColor = RGBColor::BLACK;
5447  temporalEdgeColor.setAlpha(200);
5448  // declare temporal edge geometry
5449  GUIGeometry temporalEdgeGeometry;
5450  // calculate geometry between source junction and mouse position
5451  PositionVector temporalEdge = {mousePosition, myViewParent->getCreateEdgeFrame()->getJunctionSource()->getPositionInView()};
5452  // move temporal edge 2 side
5453  temporalEdge.move2side(-1);
5454  // update geometry
5455  temporalEdgeGeometry.updateGeometry(temporalEdge);
5456  // push temporal edge matrix
5458  // set color
5459  GLHelper::setColor(temporalEdgeColor);
5460  // draw temporal edge
5462  // check if we have to draw opposite edge
5464  // move temporal edge to opposite edge
5465  temporalEdge.move2side(2);
5466  // update geometry
5467  temporalEdgeGeometry.updateGeometry(temporalEdge);
5468  // draw temporal edge
5470  }
5471  // pop temporal edge matrix
5473  }
5474  // pop layer matrix
5476  }
5477 }
5478 
5479 
5480 void
5482  // first check if we're in correct mode
5487  (gViewObjectsHandler.markedEdge != nullptr)) {
5488  // calculate split position
5489  const auto lane = gViewObjectsHandler.markedEdge->getLanes().back();
5490  auto shape = lane->getLaneShape();
5491  // move shape to side
5492  shape.move2side(lane->getDrawingConstants()->getDrawingWidth() * -1);
5493  const auto offset = shape.nearest_offset_to_point2D(snapToActiveGrid(getPositionInformation()));
5494  const auto splitPosition = shape.positionAtOffset2D(offset);
5495  // get junction exaggeration
5496  const double junctionExaggeration = myVisualizationSettings->junctionSize.getExaggeration(*myVisualizationSettings, nullptr, 4);
5497  // get bubble color
5499  // push layer matrix
5501  // translate to temporal shape layer
5502  glTranslated(0, 0, GLO_TEMPORALSHAPE);
5503  // push junction matrix
5505  // move matrix junction center
5506  glTranslated(splitPosition.x(), splitPosition.y(), 0.1);
5507  // set color
5508  GLHelper::setColor(bubbleColor);
5509  // draw outline circle
5510  const double circleWidth = myVisualizationSettings->neteditSizeSettings.junctionBubbleRadius * junctionExaggeration;
5511  GLHelper::drawOutlineCircle(circleWidth, circleWidth * 0.75, 32);
5512  // draw filled circle
5513  GLHelper::drawFilledCircle(0.5, 32);
5514  // pop junction matrix
5516  // pop layer matrix
5518  }
5519 }
5520 
5521 
5522 void
5524  // check conditions
5525  if ((myCurrentObjectsDialog.size() > 0) && (myCurrentObjectsDialog.front()->getType() == GLO_JUNCTION) && myDrawPreviewRoundabout) {
5526  // get junction
5527  const auto junction = myNet->getAttributeCarriers()->retrieveJunction(myCurrentObjectsDialog.front()->getMicrosimID());
5528  // push layer matrix
5530  // translate to temporal shape layer
5531  glTranslated(0, 0, GLO_TEMPORALSHAPE);
5532  // push junction matrix
5534  // move matrix junction center
5535  glTranslated(junction->getNBNode()->getPosition().x(), junction->getNBNode()->getPosition().y(), 0.1);
5536  // set color
5538  // draw outline circle
5539  const double circleWidth = (junction->getNBNode()->getRadius() < 0) ? 4.0 : junction->getNBNode()->getRadius();
5540  GLHelper::drawOutlineCircle(circleWidth * 1.30, circleWidth, 32);
5541  // pop junction matrix
5543  // pop layer matrix
5545  }
5546 }
5547 
5548 
5549 void
5551  // check conditions
5553  // get junction
5554  const auto junctionPos = myViewParent->getTLSEditorFrame()->getTLSJunction()->getCurrentJunction()->getNBNode()->getPosition();
5555  // push layer matrix
5557  // translate to TLLogic
5558  glTranslated(0, 0, GLO_TEMPORALSHAPE);
5559  // iterate over all E1 detectors
5560  for (const auto& E1ID : myViewParent->getTLSEditorFrame()->getTLSAttributes()->getE1Detectors()) {
5561  // first check if E1 exists
5562  const auto E1 = myNet->getAttributeCarriers()->retrieveAdditional(SUMO_TAG_INDUCTION_LOOP, E1ID.second, false);
5563  if (E1) {
5564  // push line matrix
5566  // draw line between junction and E1
5567  GUIGeometry::drawChildLine(*myVisualizationSettings, junctionPos, E1->getPositionInView(),
5569  // pop line matrix
5571  }
5572  }
5573  // pop layer matrix
5575  }
5576 }
5577 
5578 
5579 void
5581  // check conditions
5583  // get junction
5584  const auto junctionPos = myViewParent->getTLSEditorFrame()->getTLSJunction()->getCurrentJunction()->getNBNode()->getPosition();
5585  // push layer matrix
5587  // translate to TLLogic
5588  glTranslated(0, 0, GLO_TEMPORALSHAPE);
5589  // iterate over all Junction detectors
5590  for (const auto& selectedJunctionID : myViewParent->getTLSEditorFrame()->getTLSJunction()->getSelectedJunctionIDs()) {
5591  // get junction
5592  const auto selectedJunction = myNet->getAttributeCarriers()->retrieveJunction(selectedJunctionID);
5593  // push line matrix
5595  // draw line between junction and Junction
5596  GUIGeometry::drawChildLine(*myVisualizationSettings, junctionPos, selectedJunction->getPositionInView(),
5598  // pop line matrix
5600  }
5601  // pop layer matrix
5603  }
5604 }
5605 
5606 
5607 void
5611  }
5612 }
5613 
5614 
5615 void
5618  // get mouse position
5619  const Position mousePosition = snapToActiveGrid(getPositionInformation());
5620  // push layer matrix
5622  // translate to test layer, but under magenta square
5623  glTranslated(mousePosition.x(), mousePosition.y(), GLO_TESTELEMENT - 1);
5624  // set color
5626  // draw circle
5628  // pop layer matrix
5630  }
5631 }
5632 
5633 
5634 void
5636  // reset moving selected edge
5638  // decide what to do based on mode
5639  switch (myEditModes.networkEditMode) {
5641  // first swap lane to edges if mySelectEdges is enabled and shift key isn't pressed
5642  if (checkSelectEdges()) {
5644  } else {
5646  }
5647  // now filter locked elements
5649  // check if we're selecting a new parent for the current inspected element
5652  } else {
5653  // process left click in Inspector Frame
5655  }
5656  // process click
5657  processClick(eventData);
5658  break;
5659  }
5661  // first swap lane to edges if mySelectEdges is enabled and shift key isn't pressed
5662  if (checkSelectEdges()) {
5664  } else {
5666  }
5667  // now filter locked elements forcing excluding walkingAreas
5669  // continue depending of AC
5671  // now check if we want only delete geometry points
5673  // only remove geometry point
5676  // remove all selected attribute carriers
5679  }
5680  } else {
5681  // remove attribute carrier under cursor
5683  }
5684  } else {
5685  // process click
5686  processClick(eventData);
5687  }
5688  break;
5689  }
5691  // first swap lane to edges if mySelectEdges is enabled and shift key isn't pressed
5692  if (checkSelectEdges()) {
5694  } else {
5696  }
5697  // now filter locked elements
5699  // avoid to select if control key is pressed
5701  // check if a rect for selecting is being created
5703  // begin rectangle selection
5706  // process click
5707  processClick(eventData);
5708  }
5709  } else {
5710  // process click
5711  processClick(eventData);
5712  }
5713  break;
5715  // check what buttons are pressed
5717  // get edge under cursor
5719  if (edge) {
5720  // obtain reverse edge
5721  const auto oppositeEdges = edge->getOppositeEdges();
5722  // check if we're split one or both edges
5725  } else if (oppositeEdges.size() > 0) {
5726  myNet->splitEdgesBidi(edge, oppositeEdges.front(), edge->getSplitPos(getPositionInformation()), myUndoList);
5727  } else {
5729  }
5730  }
5732  // process left click in create edge frame Frame
5737  }
5738  // process click
5739  processClick(eventData);
5740  break;
5741  }
5743  // editing lane shapes in move mode isn't finished, then always filter lanes
5745  // filter locked elements
5747  // check if we're editing a shape
5749  // check if we're removing a geometry point
5751  // remove geometry point
5754  }
5756  // process click if there isn't movable elements (to move camera using drag an drop)
5757  processClick(eventData);
5758  }
5759  } else {
5760  // get AC under cursor
5762  // check that AC is an network or additional element
5763  if (AC && (AC->getTagProperty().isNetworkElement() || AC->getTagProperty().isAdditionalElement())) {
5764  // check if we're moving a set of selected items
5765  if (AC->isAttributeCarrierSelected()) {
5766  // move selected ACs
5768  // update view
5769  updateViewNet();
5771  // process click if there isn't movable elements (to move camera using drag an drop)
5772  processClick(eventData);
5773  }
5774  } else {
5775  // process click if there isn't movable elements (to move camera using drag an drop)
5776  processClick(eventData);
5777  }
5778  }
5779  break;
5780  }
5782  // check if we're clicked over a non locked lane
5784  // Handle laneclick (shift key may pass connections, Control key allow conflicts)
5786  updateViewNet();
5787  }
5788  // process click
5789  processClick(eventData);
5790  break;
5791  }
5794  // edit TLS in TLSEditor frame
5796  updateViewNet();
5797  }
5798  // process click
5799  processClick(eventData);
5800  break;
5801  }
5803  // avoid create additionals if control key is pressed
5806  WRITE_WARNING(TL("Shift + click to create two additionals in the same position"));
5808  // save last mouse position
5810  // update view to show the new additional
5811  updateViewNet();
5812  }
5813  }
5814  // process click
5815  processClick(eventData);
5816  break;
5817  }
5819  // call function addCrossing from crossing frame
5821  // process click
5822  processClick(eventData);
5823  break;
5824  }
5826  // avoid create TAZs if control key is pressed
5828  // check if we want to create a rect for selecting edges
5830  // begin rectangle selection
5832  } else {
5833  // check if process click was successfully
5835  // view net must be always update
5836  updateViewNet();
5837  }
5838  // process click
5839  processClick(eventData);
5840  }
5841  } else {
5842  // process click
5843  processClick(eventData);
5844  }
5845  break;
5846  }
5848  // avoid create shapes if control key is pressed
5851  // declare processClick flag
5852  bool updateTemporalShape = false;
5853  // process click
5855  // view net must be always update
5856  updateViewNet();
5857  // process click depending of the result of "process click"
5858  if (!updateTemporalShape) {
5859  // process click
5860  processClick(eventData);
5861  }
5862  }
5863  } else {
5864  // process click
5865  processClick(eventData);
5866  }
5867  break;
5868  }
5871  // shift key may pass connections, Control key allow conflicts.
5873  updateViewNet();
5874  }
5875  // process click
5876  processClick(eventData);
5877  break;
5878  }
5880  // avoid create wires if control key is pressed
5883  // update view to show the new wire
5884  updateViewNet();
5885  }
5886  // process click
5887  processClick(eventData);
5888  break;
5889  }
5891  // process click
5892  processClick(eventData);
5893  break;
5894  }
5895  default: {
5896  // process click
5897  processClick(eventData);
5898  }
5899  }
5900 }
5901 
5902 
5903 void
5905  // check moved items
5909  // check if we're creating a rectangle selection or we want only to select a lane
5911  // check if we're selecting all type of elements o we only want a set of edges for TAZ
5915  // process edge selection
5917  }
5919  // check if there is a lane in objects under cursor
5921  // if we clicked over an lane with shift key pressed, select or unselect it
5924  } else {
5926  }
5927  }
5928  }
5929  // finish selection
5931  } else {
5932  // finish moving of single elements
5934  }
5935 }
5936 
5937 
5938 void
5939 GNEViewNet::processMoveMouseNetwork(const bool mouseLeftButtonPressed) {
5940  // change "delete last created point" depending if during movement shift key is pressed
5945  }
5946  // check what type of additional is moved
5948  // move entire selection
5949  myMoveMultipleElements.moveSelection(mouseLeftButtonPressed);
5951  // update selection corner of selecting area
5953  } else {
5954  // move single elements
5955  myMoveSingleElement.moveSingleElement(mouseLeftButtonPressed);
5956  }
5957 }
5958 
5959 
5960 void
5962  // filter shapes (because POIs and polygons doesn't interact in demand mode)
5964  // decide what to do based on mode
5965  switch (myEditModes.demandEditMode) {
5967  // filter locked elements
5969  // process left click in Inspector Frame
5971  // process click
5972  processClick(eventData);
5973  break;
5974  }
5976  // filter locked elements
5978  // get front AC
5979  const auto frontAC = myViewObjectsSelector.getAttributeCarrierFront();
5980  // check conditions
5981  if (frontAC) {
5982  // check if we are deleting a selection or an single attribute carrier
5983  if (frontAC->isAttributeCarrierSelected()) {
5985  } else {
5987  }
5988  } else {
5989  // process click
5990  processClick(eventData);
5991  }
5992  break;
5993  }
5995  // filter locked elements
5997  // avoid to select if control key is pressed
5999  // check if a rect for selecting is being created
6001  // begin rectangle selection
6004  // process click
6005  processClick(eventData);
6006  }
6007  } else {
6008  // process click
6009  processClick(eventData);
6010  }
6011  break;
6013  // filter locked elements
6015  // get front AC
6016  const auto frontAC = myViewObjectsSelector.getAttributeCarrierFront();
6017  // check that AC under cursor is a demand element
6018  if (frontAC) {
6019  // check if we're moving a set of selected items
6020  if (frontAC->isAttributeCarrierSelected()) {
6021  // move selected ACs
6023  // update view
6024  updateViewNet();
6026  // process click if there isn't movable elements (to move camera using drag an drop)
6027  processClick(eventData);
6028  }
6029  } else {
6030  // process click if there isn't movable elements (to move camera using drag an drop)
6031  processClick(eventData);
6032  }
6033  break;
6034  }
6036  // check if we clicked over a lane
6038  // Handle edge click
6040  }
6041  // process click
6042  processClick(eventData);
6043  break;
6044  }
6046  // filter additionals (except TAZs) and demands (except routes)
6049  // Handle click
6051  // process click
6052  processClick(eventData);
6053  break;
6054  }
6056  // filter additionals (except stoppingPlaces) and demands
6059  // Handle click
6061  WRITE_WARNING(TL("Control + click to create two stop in the same position"));
6063  // save last mouse position
6065  // update view to show the new additional
6066  updateViewNet();
6067  }
6068  // process click
6069  processClick(eventData);
6070  break;
6071  }
6073  // filter additionals (except stoppingPlaces and TAZs)
6075  // special case if we're creating person over walk routes
6078  } else {
6080  }
6081  // Handle click
6083  // process click
6084  processClick(eventData);
6085  break;
6086  }
6088  // filter additionals (except stoppingPlaces and TAZs)
6090  // special case if we're creating person over walk routes
6093  } else {
6095  }
6096  // Handle person plan click
6098  // process click
6099  processClick(eventData);
6100  break;
6101  }
6103  // filter additionals (except stoppingPlaces and TAZs) and demands
6106  // Handle click
6108  // process click
6109  processClick(eventData);
6110  break;
6111  }
6113  // filter additionals (except stoppingPlaces and TAZs) and demands
6116  // Handle container plan click
6118  // process click
6119  processClick(eventData);
6120  break;
6121  }
6122  default: {
6123  // process click
6124  processClick(eventData);
6125  }
6126  }
6127 }
6128 
6129 
6130 void
6132  // check moved items
6136  // check if we're creating a rectangle selection or we want only to select a lane
6139  }
6140  // finish selection
6142  } else {
6143  // finish moving of single elements
6145  }
6146 }
6147 
6148 
6149 void
6150 GNEViewNet::processMoveMouseDemand(const bool mouseLeftButtonPressed) {
6152  // update selection corner of selecting area
6154  } else {
6155  // move single elements
6156  myMoveSingleElement.moveSingleElement(mouseLeftButtonPressed);
6157  }
6158 }
6159 
6160 
6161 void
6163  // get AC
6165  // decide what to do based on mode
6166  switch (myEditModes.dataEditMode) {
6168  // filter locked elements
6170  // process left click in Inspector Frame
6171  if (AC && AC->getTagProperty().getTag() == SUMO_TAG_TAZ) {
6173  } else {
6175  }
6176  // process click
6177  processClick(eventData);
6178  break;
6179  }
6181  // check conditions
6182  if (AC) {
6183  // check if we are deleting a selection or an single attribute carrier
6184  if (AC->isAttributeCarrierSelected()) {
6185  if (!AC->getGUIGlObject()->isGLObjectLocked()) {
6187  }
6188  } else {
6190  }
6191  } else {
6192  // process click
6193  processClick(eventData);
6194  }
6195  break;
6196  }
6198  // filter locked elements
6200  // avoid to select if control key is pressed
6202  // check if a rect for selecting is being created
6204  // begin rectangle selection
6207  // process click
6208  processClick(eventData);
6209  }
6210  } else {
6211  // process click
6212  processClick(eventData);
6213  }
6214  break;
6216  // avoid create edgeData if control key is pressed
6219  // update view to show the new edge data
6220  updateViewNet();
6221  }
6222  }
6223  // process click
6224  processClick(eventData);
6225  break;
6227  // avoid create edgeData if control key is pressed
6230  // update view to show the new edge data
6231  updateViewNet();
6232  }
6233  }
6234  // process click
6235  processClick(eventData);
6236  break;
6238  // avoid create TAZData if control key is pressed
6241  // update view to show the new TAZ data
6242  updateViewNet();
6243  }
6244  }
6245  // process click
6246  processClick(eventData);
6247  break;
6249  // avoid create TAZData if control key is pressed
6251  //
6252  }
6253  // process click
6254  processClick(eventData);
6255  break;
6256  default: {
6257  // process click
6258  processClick(eventData);
6259  }
6260  }
6261 }
6262 
6263 
6264 void
6266  // check moved items
6270  // check if we're creating a rectangle selection or we want only to select a lane
6273  }
6274  // finish selection
6276  } else {
6277  // finish moving of single elements
6279  }
6280 }
6281 
6282 
6283 void
6284 GNEViewNet::processMoveMouseData(const bool mouseLeftButtonPressed) {
6286  // update selection corner of selecting area
6288  } else {
6289  // move single elements
6290  myMoveSingleElement.moveSingleElement(mouseLeftButtonPressed);
6291  }
6292 }
6293 
6294 
6295 /****************************************************************************/
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:843
@ MID_GNE_ADDSELECT_EDGE
Add edge to selected items - menu entry.
Definition: GUIAppEnum.h:845
@ 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:1346
@ MID_GNE_DEMANDVIEWOPTIONS_SHOWALLPERSONPLANS
show all person plans
Definition: GUIAppEnum.h:875
@ MID_HOTKEY_SHIFT_S_LOCATESTOP
Locate stop - button.
Definition: GUIAppEnum.h:188
@ MID_GNE_LANE_TRANSFORM_BIKE
transform lane to bikelane
Definition: GUIAppEnum.h:1354
@ MID_GNE_DATAVIEWOPTIONS_TAZRELDRAWING
toggle TAZRel drawing
Definition: GUIAppEnum.h:899
@ MID_GNE_EDGE_REVERSE
reverse an edge
Definition: GUIAppEnum.h:1234
@ MID_GNE_JUNCTION_ADDTLS
Add TLS into junction.
Definition: GUIAppEnum.h:1272
@ MID_ADDSELECT
Add to selected items - menu entry.
Definition: GUIAppEnum.h:485
@ 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:1364
@ MID_GNE_NETWORKVIEWOPTIONS_DRAWSPREADVEHICLES
Draw vehicles in begin position or spread in lane.
Definition: GUIAppEnum.h:817
@ MID_GNE_JUNCTION_RESET_EDGE_ENDPOINTS
reset edge endpoints
Definition: GUIAppEnum.h:1266
@ MID_GNE_NETWORKVIEWOPTIONS_MOVEELEVATION
move elevation instead of x,y
Definition: GUIAppEnum.h:839
@ MID_GNE_NETWORKVIEWOPTIONS_HIDECONNECTIONS
hide connections
Definition: GUIAppEnum.h:825
@ MID_GNE_REMOVESELECT_EDGE
Remove edge from selected items - Menu Entry.
Definition: GUIAppEnum.h:847
@ MID_GNE_NETWORKVIEWOPTIONS_SHOWCONNECTIONS
show connections
Definition: GUIAppEnum.h:823
@ MID_GNE_INTERVALBAR_BEGIN
begin changed in InterbalBar
Definition: GUIAppEnum.h:919
@ MID_GNE_DATAVIEWOPTIONS_TAZRELONLYTO
toggle draw TAZRel only to
Definition: GUIAppEnum.h:905
@ MID_GNE_ADDREVERSE
add reverse element
Definition: GUIAppEnum.h:1412
@ MID_GNE_CONNECTION_SMOOTH_SHAPE
@ brief smooth connection shape
Definition: GUIAppEnum.h:1284
@ MID_GNE_DATAVIEWOPTIONS_TOGGLEDRAWJUNCTIONSHAPE
toggle draw junction shape
Definition: GUIAppEnum.h:891
@ MID_GNE_NETWORKVIEWOPTIONS_SHOWTAZELEMENTS
show TAZ elements
Definition: GUIAppEnum.h:829
@ MID_GNE_DEMANDVIEWOPTIONS_LOCKPERSON
lock person
Definition: GUIAppEnum.h:877
@ 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:865
@ MID_GNE_JUNCTION_CLEAR_CONNECTIONS
clear junction's connections
Definition: GUIAppEnum.h:1252
@ 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:1268
@ MID_GNE_JUNCTION_RESET_SHAPE
reset junction shape
Definition: GUIAppEnum.h:1264
@ MID_GNE_NETWORKVIEWOPTIONS_ASKFORMERGE
ask before merging junctions
Definition: GUIAppEnum.h:835
@ MID_GNE_JUNCTION_RESET_CONNECTIONS
reset junction's connections
Definition: GUIAppEnum.h:1254
@ MID_GNE_DEMANDVIEWOPTIONS_SHOWGRID
show grid
Definition: GUIAppEnum.h:863
@ MID_GNE_JUNCTION_SPLIT
turn junction into multiple junctions
Definition: GUIAppEnum.h:1258
@ MID_GNE_EDGE_STRAIGHTEN_ELEVATION
interpolate z values linear between junctions
Definition: GUIAppEnum.h:1226
@ 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:841
@ MID_GNE_DATAVIEWOPTIONS_SHOWDEMANDELEMENTS
show demand elements
Definition: GUIAppEnum.h:897
@ MID_GNE_POLYGON_CLOSE
close opened polygon
Definition: GUIAppEnum.h:1298
@ MID_GNE_EDGE_SMOOTH
smooth geometry
Definition: GUIAppEnum.h:1224
@ 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:1348
@ MID_GNE_EDGE_STRAIGHTEN
remove inner geometry
Definition: GUIAppEnum.h:1222
@ MID_GNE_DEMANDVIEWOPTIONS_HIDESHAPES
hide shapes
Definition: GUIAppEnum.h:871
@ MID_GNE_LANE_TRANSFORM_BUS
transform lane to busLane
Definition: GUIAppEnum.h:1356
@ MID_GNE_POLYGON_SET_FIRST_POINT
Set a vertex of polygon as first vertex.
Definition: GUIAppEnum.h:1302
@ MID_GNE_SHAPEEDITED_DELETE_GEOMETRY_POINT
delete geometry point in shape edited
Definition: GUIAppEnum.h:1324
@ MID_HOTKEY_SHIFT_A_LOCATEADDITIONAL
Locate additional structure - button.
Definition: GUIAppEnum.h:172
@ MID_GNE_LANE_DUPLICATE
duplicate a lane
Definition: GUIAppEnum.h:1344
@ MID_GNE_DATAVIEWOPTIONS_SHOWADDITIONALS
show additionals
Definition: GUIAppEnum.h:893
@ MID_HOTKEY_SHIFT_R_LOCATEROUTE
Locate route - button.
Definition: GUIAppEnum.h:186
@ MID_GNE_NETWORKVIEWOPTIONS_SHOWBUBBLES
show junctions as bubbles
Definition: GUIAppEnum.h:837
@ MID_GNE_LANE_ADD_GREENVERGE_FRONT
add greenVerge front of current lane
Definition: GUIAppEnum.h:1366
@ MID_GNE_INTERVALBAR_END
end changed in InterbalBar
Definition: GUIAppEnum.h:921
@ MID_HOTKEY_SHIFT_W_LOCATEWALKINGAREA
Locate edge - button.
Definition: GUIAppEnum.h:194
@ MID_GNE_NETWORKVIEWOPTIONS_EXTENDSELECTION
extend selection
Definition: GUIAppEnum.h:831
@ MID_GNE_LANE_REMOVE_GREENVERGE
remove greenVerge
Definition: GUIAppEnum.h:1376
@ 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:1238
@ MID_GNE_EDGE_SPLIT_BIDI
split an edge
Definition: GUIAppEnum.h:1232
@ MID_GNE_NETWORKVIEWOPTIONS_SHOWSUBADDITIONALS
show sub-additionals
Definition: GUIAppEnum.h:827
@ MID_GNE_JUNCTION_REPLACE
turn junction into geometry node
Definition: GUIAppEnum.h:1256
@ MID_HOTKEY_SHIFT_C_LOCATECONTAINER
Locate container - button.
Definition: GUIAppEnum.h:174
@ MID_GNE_DEMANDVIEWOPTIONS_SHOWALLCONTAINERPLANS
show all container plans
Definition: GUIAppEnum.h:879
@ MID_HOTKEY_SHIFT_V_LOCATEVEHICLE
Locate vehicle - button.
Definition: GUIAppEnum.h:192
@ MID_GNE_VIEW_DEFAULT
set default view
Definition: GUIAppEnum.h:783
@ 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:1372
@ MID_GNE_SHAPEEDITED_RESET
reset shape
Definition: GUIAppEnum.h:1326
@ MID_HOTKEY_SHIFT_E_LOCATEEDGE
Locate edge - button.
Definition: GUIAppEnum.h:176
@ MID_GNE_VIEW_JUPEDSIM
set juPedSim view
Definition: GUIAppEnum.h:785
@ MID_GNE_SHAPEEDITED_STRAIGHTEN
straighten shape edited geometry
Definition: GUIAppEnum.h:1316
@ MID_GNE_POI_TRANSFORM
Transform POI to POILane, and viceversa.
Definition: GUIAppEnum.h:1336
@ MID_GNE_LANE_RESET_OPPOSITELANE
reset opposite lane
Definition: GUIAppEnum.h:1350
@ MID_GNE_INTERVALBAR_PARAMETER
parameter changed in InterbalBar
Definition: GUIAppEnum.h:923
@ 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:1270
@ MID_GNE_DATAVIEWOPTIONS_TAZDRAWFILL
toggle draw TAZ fill
Definition: GUIAppEnum.h:901
@ MID_REACHABILITY
show reachability from a given lane
Definition: GUIAppEnum.h:531
@ 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:1240
@ 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:1374
@ MID_GNE_NETWORKVIEWOPTIONS_SHOWDEMANDELEMENTS
show demand elements
Definition: GUIAppEnum.h:819
@ MID_HOTKEY_SHIFT_J_LOCATEJUNCTION
Locate junction - button.
Definition: GUIAppEnum.h:178
@ MID_GNE_POLYGON_SELECT
select elements within polygon boundary
Definition: GUIAppEnum.h:1306
@ MID_GNE_JUNCTION_SPLIT_RECONNECT
turn junction into multiple junctions and reconnect them heuristically
Definition: GUIAppEnum.h:1260
@ MID_GNE_REVERSE
reverse current element
Definition: GUIAppEnum.h:1410
@ MID_OPEN_ADDITIONAL_DIALOG
open additional dialog (used in netedit)
Definition: GUIAppEnum.h:469
@ MID_GNE_WALKINGAREA_EDIT_SHAPE
edit crossing shape
Definition: GUIAppEnum.h:1288
@ MID_GNE_DEMANDVIEWOPTIONS_HIDENONINSPECTED
hide non-inspected demand element
Definition: GUIAppEnum.h:869
@ MID_GNE_JUNCTION_EDIT_SHAPE
edit junction shape
Definition: GUIAppEnum.h:1262
@ MID_GNE_LANE_REMOVE_SIDEWALK
remove sidewalk
Definition: GUIAppEnum.h:1370
@ MID_GNE_SHAPEEDITED_OPEN
open closed shape edited
Definition: GUIAppEnum.h:1320
@ MID_GNE_EDGE_RESET_ENDPOINT
reset default geometry endpoints
Definition: GUIAppEnum.h:1220
@ MID_GNE_INTERVALBAR_GENERICDATATYPE
generic data selected
Definition: GUIAppEnum.h:913
@ MID_GNE_LANE_ADD_GREENVERGE_BACK
add greenVerge back of current lane
Definition: GUIAppEnum.h:1368
@ MID_GNE_EDGE_SMOOTH_ELEVATION
smooth elevation with regard to adjoining edges
Definition: GUIAppEnum.h:1228
@ MID_GNE_NETWORKVIEWOPTIONS_CHANGEALLPHASES
change all phases
Definition: GUIAppEnum.h:833
@ MID_GNE_DATAVIEWOPTIONS_SHOWSHAPES
show shapes
Definition: GUIAppEnum.h:895
@ 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:903
@ MID_GNE_EDGE_ADD_REVERSE
add reverse edge
Definition: GUIAppEnum.h:1236
@ MID_GNE_EDGE_APPLYTEMPLATE
apply template
Definition: GUIAppEnum.h:1244
@ MID_GNE_EDGE_USEASTEMPLATE
use edge as tempalte
Definition: GUIAppEnum.h:1242
@ MID_GNE_NETWORKVIEWOPTIONS_TOGGLEDRAWJUNCTIONSHAPE
toggle draw junction shape
Definition: GUIAppEnum.h:815
@ MID_GNE_SHAPEEDITED_SIMPLIFY
simplify shape edited geometry
Definition: GUIAppEnum.h:1314
@ MID_GNE_DEMANDVIEWOPTIONS_DRAWSPREADVEHICLES
Draw vehicles in begin position or spread in lane.
Definition: GUIAppEnum.h:867
@ MID_GNE_LANE_ADD_SIDEWALK
add sidewalk
Definition: GUIAppEnum.h:1360
@ MID_GNE_DEMANDVIEWOPTIONS_SHOWOVERLAPPEDROUTES
show overlapped routes
Definition: GUIAppEnum.h:883
@ MID_GNE_SHAPEEDITED_FINISH
finish editing shape edited
Definition: GUIAppEnum.h:1328
@ MID_GNE_RESET_GEOMETRYPOINT
reset geometry point
Definition: GUIAppEnum.h:1025
@ MID_GNE_CONNECTION_EDIT_SHAPE
edit connection shape
Definition: GUIAppEnum.h:1282
@ MID_GNE_SHAPEEDITED_CLOSE
close opened shape edited
Definition: GUIAppEnum.h:1318
@ MID_GNE_INTERVALBAR_DATASET
data set selected
Definition: GUIAppEnum.h:915
@ MID_HOTKEY_SHIFT_T_LOCATETLS
Locate TLS - button.
Definition: GUIAppEnum.h:190
@ MID_GNE_LANE_TRANSFORM_SIDEWALK
transform lane to sidewalk
Definition: GUIAppEnum.h:1352
@ MID_GNE_SHAPEEDITED_SET_FIRST_POINT
Set a vertex of shape edited as first vertex.
Definition: GUIAppEnum.h:1322
@ MID_GNE_LANE_ADD_BIKE
add bikelane
Definition: GUIAppEnum.h:1362
@ 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:881
@ MID_GNE_NETWORKVIEWOPTIONS_SELECTEDGES
select edges
Definition: GUIAppEnum.h:821
@ MID_GNE_EDGE_SPLIT
split an edge
Definition: GUIAppEnum.h:1230
@ MID_GNE_LANE_TRANSFORM_GREENVERGE
transform lane to greenVerge
Definition: GUIAppEnum.h:1358
@ MID_GNE_CUSTOM_GEOMETRYPOINT
set custom geometry point
Definition: GUIAppEnum.h:1023
@ MID_GNE_DEMANDVIEWOPTIONS_SHOWTRIPS
show all trips
Definition: GUIAppEnum.h:873
@ MID_GNE_NETWORKVIEWOPTIONS_TOGGLEGRID
show grid
Definition: GUIAppEnum.h:813
@ MID_GNE_INTERVALBAR_LIMITED
enable/disable show data elements by interval
Definition: GUIAppEnum.h:917
@ MID_GNE_EDGE_EDIT_ENDPOINT
change default geometry endpoints
Definition: GUIAppEnum.h:1218
@ MID_GNE_POLYGON_DELETE_GEOMETRY_POINT
delete geometry point
Definition: GUIAppEnum.h:1304
@ 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:1274
@ MID_GNE_CROSSING_EDIT_SHAPE
edit crossing shape
Definition: GUIAppEnum.h:1286
@ MID_GNE_POLYGON_OPEN
open closed polygon
Definition: GUIAppEnum.h:1300
@ MID_GNE_POLYGON_SIMPLIFY_SHAPE
simplify polygon geometry
Definition: GUIAppEnum.h:1296
@ MID_REMOVESELECT
Remove from selected items - Menu Entry.
Definition: GUIAppEnum.h:487
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
@ GLO_CROSSING
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:2409
NBEdge * getNBEdge() const
returns the internal NBEdge
Definition: GNEEdge.cpp:753
void smoothElevation(GNEUndoList *undoList)
smooth elevation with regard to adjoining edges
Definition: GNEEdge.cpp:2421
const std::vector< GNELane * > & getLanes() const
returns a reference to the lane vector
Definition: GNEEdge.cpp:1090
std::vector< GNEEdge * > getOppositeEdges() const
get opposite edges
Definition: GNEEdge.cpp:694
void copyTemplate(const GNEEdgeTemplate *edgeTemplate, GNEUndoList *undoList)
copy edge attributes from edgetemplate
Definition: GNEEdge.cpp:1027
void editEndpoint(Position pos, GNEUndoList *undoList)
makes pos the new geometry endpoint at the appropriate end, or remove current existent endpoint
Definition: GNEEdge.cpp:775
Position getSplitPos(const Position &clickPos)
Definition: GNEEdge.cpp:759
void straightenElevation(GNEUndoList *undoList)
interpolate z values linear between junctions
Definition: GNEEdge.cpp:2326
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
Definition: GNEEdge.cpp:1223
void resetEndpoint(const Position &pos, GNEUndoList *undoList)
restores the endpoint to the junction position at the appropriate end
Definition: GNEEdge.cpp:827
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:615
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
Definition: GNELane.cpp:746
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
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.
std::vector< GNELane * > getSelectedLanes() const
get selected lanes
const std::map< std::string, GNEEdge * > & getEdges() const
map with the ID and pointer to edges of net
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
const std::map< std::string, GNEJunction * > & getJunctions() const
get junctions
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:415
void deleteLane(GNELane *lane, GNEUndoList *undoList, bool recomputeConnections)
removes lane
Definition: GNENet.cpp:581
void deleteCrossing(GNECrossing *crossing, GNEUndoList *undoList)
remove crossing
Definition: GNENet.cpp:636
SUMORTree & getGrid()
Returns the RTree used for visualisation speed-up.
Definition: GNENet.cpp:148
void deleteAdditional(GNEAdditional *additional, GNEUndoList *undoList)
remove additional
Definition: GNENet.cpp:654
void computeAndUpdate(OptionsCont &neteditOptions, bool volatileOptions)
recompute the network and update lane geometries
Definition: GNENet.cpp:2873
void reverseEdge(GNEEdge *edge, GNEUndoList *undoList)
reverse edge
Definition: GNENet.cpp:1047
NBTrafficLightLogicCont & getTLLogicCont()
returns the tllcont of the underlying netbuilder
Definition: GNENet.cpp:2142
bool restrictLane(SUMOVehicleClass vclass, GNELane *lane, GNEUndoList *undoList)
transform lane to restricted lane
Definition: GNENet.cpp:786
void deleteDemandElement(GNEDemandElement *demandElement, GNEUndoList *undoList)
remove demand element
Definition: GNENet.cpp:675
void duplicateLane(GNELane *lane, GNEUndoList *undoList, bool recomputeConnections)
duplicates lane
Definition: GNENet.cpp:770
void deleteDataInterval(GNEDataInterval *dataInterval, GNEUndoList *undoList)
remove data interval
Definition: GNENet.cpp:718
void deleteConnection(GNEConnection *connection, GNEUndoList *undoList)
remove connection
Definition: GNENet.cpp:621
void resetJunctionConnections(GNEJunction *junction, GNEUndoList *undoList)
reset junction's connections
Definition: GNENet.cpp:2066
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
Definition: GNENet.cpp:182
void deleteGenericData(GNEGenericData *genericData, GNEUndoList *undoList)
remove generic data
Definition: GNENet.cpp:731
std::pair< GNEJunction *, GNEEdge * > splitEdge(GNEEdge *edge, const Position &pos, GNEUndoList *undoList, GNEJunction *newJunction=0)
split edge at position by inserting a new junction
Definition: GNENet.cpp:906
GNENetHelper::AttributeCarriers * getAttributeCarriers() const
get all attribute carriers used in this net
Definition: GNENet.cpp:123
GNEEdge * addReversedEdge(GNEEdge *edge, const bool disconnected, GNEUndoList *undoList)
add reversed edge
Definition: GNENet.cpp:1060
void splitEdgesBidi(GNEEdge *edge, GNEEdge *oppositeEdge, const Position &pos, GNEUndoList *undoList)
split all edges at position by inserting one new junction
Definition: GNENet.cpp:1023
bool removeRestrictedLane(SUMOVehicleClass vclass, GNEEdge *edge, GNEUndoList *undoList)
remove restricted lane
Definition: GNENet.cpp:892
void mergeJunctions(GNEJunction *moved, GNEJunction *target, GNEUndoList *undoList)
merge the given junctions edges between the given junctions will be deleted
Definition: GNENet.cpp:1098
bool addRestrictedLane(SUMOVehicleClass vclass, GNEEdge *edge, int index, GNEUndoList *undoList)
add restricted lane to edge
Definition: GNENet.cpp:839
bool addGreenVergeLane(GNEEdge *edge, int index, GNEUndoList *undoList)
add restricted lane to edge
Definition: GNENet.cpp:875
void deleteDataSet(GNEDataSet *dataSet, GNEUndoList *undoList)
remove data set
Definition: GNENet.cpp:705
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:1970
void selectRoundabout(GNEJunction *junction, GNEUndoList *undoList)
select all roundabout edges and junctions for the current roundabout
Definition: GNENet.cpp:1131
void replaceJunctionByGeometry(GNEJunction *junction, GNEUndoList *undoList)
replace the selected junction by geometry node(s) and merge the edges
Definition: GNENet.cpp:1916
GNEPathManager * getPathManager()
get path manager
Definition: GNENet.cpp:135
void createRoundabout(GNEJunction *junction, GNEUndoList *undoList)
transform the given junction into a roundabout
Definition: GNENet.cpp:1150
void requireRecompute()
inform the net about the need for recomputation
Definition: GNENet.cpp:1522
void initGNEConnections()
initialize GNEConnections
Definition: GNENet.cpp:2860
void deleteJunction(GNEJunction *junction, GNEUndoList *undoList)
removes junction and all incident edges
Definition: GNENet.cpp:370
NBEdgeCont & getEdgeCont()
returns the NBEdgeCont of the underlying netbuilder
Definition: GNENet.cpp:2148
GNEViewNet * getViewNet() const
get view net
Definition: GNENet.cpp:2136
void clearJunctionConnections(GNEJunction *junction, GNEUndoList *undoList)
clear junction's connections
Definition: GNENet.cpp:2054
void computeDemandElements(GNEApplicationWindow *window)
compute demand elements param[in] window The window to inform about delay
Definition: GNENet.cpp:1471
void drawLaneReference(const GNELane *lane) const
draw lane reference
void closeShapeEdited(GNEUndoList *undoList)
close shape edited
void setFirstGeometryPointShapeEdited(const int index, GNEUndoList *undoList)
set first geometry point shape edited
void openShapeEdited(GNEUndoList *undoList)
open shape edited
int getGeometryPointUnderCursorShapeEdited() const
get index geometry point under cursor of shape edited
void simplifyShapeEdited(GNEUndoList *undoList)
simplify shape edited
void straigthenShapeEdited(GNEUndoList *undoList)
straigthen shape edited
void deleteGeometryPointShapeEdited(const int index, GNEUndoList *undoList)
delete geometry point shape edited
void resetShapeEdited(GNEUndoList *undoList)
reset shape edited
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
GNEPlanSelector * getPlanSelector() const
get personPlan selector
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
GNEPlanSelector * getPlanSelector() const
get personPlan selector
void removeLastElement()
remove path element
long onCmdCreatePath(FXObject *, FXSelector, void *)
void abortPathCreation()
abort path creation
void drawTemporalRoute(const GUIVisualizationSettings &s) const
draw temporal route
const GNETagProperties & getCurrentPlanTagProperties() const
get current plan tag properties
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:350
void closePolygon(bool allowUndo=true)
close polygon
Definition: GNEPoly.cpp:429
void changeFirstGeometryPoint(int oldIndex, bool allowUndo=true)
change first geometry point
Definition: GNEPoly.cpp:450
void deleteGeometryPoint(const Position &pos, bool allowUndo=true)
delete the geometry point closest to the given pos
Definition: GNEPoly.cpp:366
void simplifyShape(bool allowUndo=true)
replace the current shape with a rectangle
Definition: GNEPoly.cpp:490
void openPolygon(bool allowUndo=true)
open polygon
Definition: GNEPoly.cpp:408
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 planRoute() const
return true if tag correspond to a plan placed over route
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
void filterDemandElements(const bool includeRoutes)
filter (remove) demand elements
void filterAdditionals(const bool includeStoppigPlaces, const bool includeTAZs)
filter (remove) additionals
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
void filterShapes()
filter (remove) polys and POIs
GNEViewNetHelper::EditNetworkElementShapes myEditNetworkElementShapes
struct for grouping all variables related with edit shapes
Definition: GNEViewNet.h:737
long onCmdToggleShowDemandElementsNetwork(FXObject *, FXSelector, void *)
toggle show demand elements (network)
long onCmdClosePolygon(FXObject *, FXSelector, void *)
close opened polygon
bool isCurrentlyMovingElements() const
check if an element is being moved
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:747
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:675
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:761
const GNEViewNetHelper::EditModes & getEditModes() const
get edit modes
Definition: GNEViewNet.cpp:723
long onCmdAddSelected(FXObject *, FXSelector, void *)
select AC under cursor
const GNEViewNetHelper::EditNetworkElementShapes & getEditNetworkElementShapes() const
get Edit Shape module
Definition: GNEViewNet.cpp:759
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:350
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:753
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:656
long onCmdReplaceJunction(FXObject *, FXSelector, void *)
replace node by geometry
bool restrictLane(GNELane *lane, SUMOVehicleClass vclass)
restrict lane
Definition: GNEViewNet.cpp:970
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:508
GNEViewNetHelper::TestingMode myTestingMode
variable used to save variables related with testing mode
Definition: GNEViewNet.h:659
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:734
GNENetworkElement * getShapeEditedAtPopupPosition()
try to retreive a edited shape at popup position
const GNEViewNetHelper::MoveSingleElementModul & getMoveSingleElementValues() const
get move single element values
Definition: GNEViewNet.cpp:541
long onCmdToggleShowConnections(FXObject *, FXSelector, void *)
toggle show connections
void updateObjectsInBoundary(const Boundary &boundary)
get objects in the given boundary
Definition: GNEViewNet.cpp:483
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:678
long onCmdCloseShapeEdited(FXObject *, FXSelector, void *)
close opened shape edited
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:770
void openSelectDialogAtCursor(const std::vector< GUIGlObject * > &GLObjects)
open select dialog at cursor
Definition: GNEViewNet.cpp:680
long onCmdSimplifyShapeEdited(FXObject *, FXSelector, void *)
void openObjectDialogAtCursor(const FXEvent *ev)
open object dialog
Definition: GNEViewNet.cpp:580
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:758
GNEViewNetHelper::MouseButtonKeyPressed myMouseButtonKeyPressed
variable used to save key status after certain events
Definition: GNEViewNet.h:667
void recalculateBoundaries()
recalculate boundaries
Definition: GNEViewNet.cpp:307
GNEViewNetHelper::IntervalBar myIntervalBar
variable used to save IntervalBar
Definition: GNEViewNet.h:703
GNEViewParent * myViewParent
view parent
Definition: GNEViewNet.h:743
bool showJunctionAsBubbles() const
return true if junction must be showed as bubbles
Definition: GNEViewNet.cpp:861
bool changeAllPhases() const
change all phases
Definition: GNEViewNet.cpp:855
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:564
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:735
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:695
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:749
bool autoSelectNodes()
whether to autoselect nodes or to lanes
Definition: GNEViewNet.cpp:839
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:752
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:692
void doInit()
called after some features are already initialized
Definition: GNEViewNet.cpp:336
long onCmdResetEdgeEndPoints(FXObject *, FXSelector, void *)
edit junction shape
void buildEditModeControls()
create edit mode buttons and elements
GNEViewNetHelper::MoveSingleElementModul myMoveSingleElement
modul used for moving single element
Definition: GNEViewNet.h:709
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:684
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:731
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 onCmdStraightenShapeEdited(FXObject *, FXSelector, void *)
straight shape edited
long onCmdAddReversedEdge(FXObject *, FXSelector, void *)
add reversed edge
void processLeftButtonReleaseNetwork()
process left button release function in Supermode Network
long onCmdDeleteGeometryPointShapeEdited(FXObject *, FXSelector, void *)
delete the closes geometry point in shape edited
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:958
void processLeftButtonReleaseDemand()
process left button release function in Supermode Demand
void resetLastClickedPosition()
reset last clicked position
Definition: GNEViewNet.cpp:833
const GNEViewNetHelper::TestingMode & getTestingMode() const
get testing mode
Definition: GNEViewNet.cpp:729
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:695
GNEViewNetHelper::SaveElements mySaveElements
variable used for grouping all variables related with salve elements
Definition: GNEViewNet.h:728
const GNEViewNetHelper::MoveMultipleElementModul & getMoveMultipleElementValues() const
get move multiple element values
Definition: GNEViewNet.cpp:547
GNEViewNetHelper::LockManager myLockManager
lock manager
Definition: GNEViewNet.h:740
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:477
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:340
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:681
const GUIGlObject * getFrontGLObject() const
get front glObject
bool checkMergeJunctions()
try to merge moved junction with another junction in that spot return true if merging did take place
Definition: GNEViewNet.cpp:867
bool aksChangeSupermode(const std::string &operation, Supermode expectedSupermode)
ask about change supermode
Definition: GNEViewNet.cpp:910
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
bool askMergeJunctions(const GNEJunction *movedJunction, const GNEJunction *targetJunction)
ask merge junctions
Definition: GNEViewNet.cpp:884
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:767
long onCmdSelectPolygonElements(FXObject *, FXSelector, void *)
select elements within polygon boundary
long onCmdSetFirstGeometryPointShapeEdited(FXObject *, FXSelector, void *)
set first geometry point in shape edited
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:755
void processLeftButtonPressNetwork(void *eventData)
mouse process functions
void hotkeyEnter()
handle enter keypress
GNEConnection * getConnectionAtPopupPosition()
try to retrieve a connection at popup position
long onCmdOpenShapeEdited(FXObject *, FXSelector, void *)
open closed shape edited
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
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:303
GNEViewNetHelper::MoveMultipleElementModul myMoveMultipleElements
modul used for moving multiple elements
Definition: GNEViewNet.h:712
long onCmdSplitJunctionReconnect(FXObject *, FXSelector, void *)
split junction into multiple junctions and reconnect them
long onCmdFinishShapeEdited(FXObject *, FXSelector, void *)
finish shape edited
void buildSelectionACPopupEntry(GUIGLObjectPopupMenu *ret, GNEAttributeCarrier *AC)
Builds an entry which allows to (de)select the object.
Definition: GNEViewNet.cpp:553
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:764
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:940
bool selectingJunctionsTLSMode() const
check if we're selecting junctions in TLS mode
Definition: GNEViewNet.cpp:949
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 onCmdResetShapeEdited(FXObject *, FXSelector, void *)
reset shape edited
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:765
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:964
GNENet * myNet
Pointer to current net. (We are not responsible for deletion)
Definition: GNEViewNet.h:746
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:698
int myDrawingToggle
drawin toggle (used in drawGLElements to avoid draw elements twice)
Definition: GNEViewNet.h:773
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:741
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:419
long onCmdToggleHideConnections(FXObject *, FXSelector, void *)
toggle hide connections
void openDeleteDialogAtCursor(const std::vector< GUIGlObject * > &GLObjects)
open delete dialog at cursor
Definition: GNEViewNet.cpp:665
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:827
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:849
void viewUpdated()
called when view is updated
Definition: GNEViewNet.cpp:432
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:426
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:650
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)
const std::vector< const GNEJunction * > & getMergingJunctions() const
get merging junctions
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:584
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:2614
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:322
double distanceTo(const Position &p2) const
returns the euclidean distance in 3 dimensions
Definition: Position.h:266
double distanceSquaredTo(const Position &p2) const
returns the square of the distance to another position
Definition: Position.h:271
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:162
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
bool isCurrentlyMovingMultipleElements() const
check if there are moving elements
void finishMoveSelection()
finish moving selection
bool isMovingSelection() const
check if currently there is element being moved
void resetMovingSelectedEdge()
reset flag for moving edge
struct used to group all variables related with movement of single elements
bool beginMoveSingleElementDemandMode()
begin move single element in Demand mode
void moveSingleElement(const bool mouseLeftButtonPressed)
move single element in Network AND Demand mode
bool isCurrentlyMovingSingleElement() const
check if there are moving elements
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