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.org/sumo
3 // Copyright (C) 2001-2019 German Aerospace Center (DLR) and others.
4 // This program and the accompanying materials
5 // are made available under the terms of the Eclipse Public License v2.0
6 // which accompanies this distribution, and is available at
7 // http://www.eclipse.org/legal/epl-v20.html
8 // SPDX-License-Identifier: EPL-2.0
9 /****************************************************************************/
16 // A view on the network being edited (adapted from GUIViewTraffic)
17 /****************************************************************************/
18 
19 
20 // ===========================================================================
21 // included modules
22 // ===========================================================================
23 
52 #include <utils/gui/div/GLHelper.h>
61 
62 #include "GNENet.h"
63 #include "GNEUndoList.h"
64 #include "GNEViewNet.h"
65 #include "GNEViewParent.h"
66 #include "GNEApplicationWindow.h"
67 
68 
69 // ===========================================================================
70 // FOX callback mapping
71 // ===========================================================================
72 
73 FXDEFMAP(GNEViewNet) GNEViewNetMap[] = {
74  // Super Modes
77  // Modes
78  FXMAPFUNC(SEL_COMMAND, MID_HOTKEY_E_EDGEMODE, GNEViewNet::onCmdSetMode),
79  FXMAPFUNC(SEL_COMMAND, MID_HOTKEY_M_MOVEMODE, GNEViewNet::onCmdSetMode),
80  FXMAPFUNC(SEL_COMMAND, MID_HOTKEY_D_DELETEMODE, GNEViewNet::onCmdSetMode),
81  FXMAPFUNC(SEL_COMMAND, MID_HOTKEY_I_INSPECTMODE, GNEViewNet::onCmdSetMode),
82  FXMAPFUNC(SEL_COMMAND, MID_HOTKEY_S_SELECTMODE, GNEViewNet::onCmdSetMode),
87  FXMAPFUNC(SEL_COMMAND, MID_HOTKEY_Z_TAZMODE, GNEViewNet::onCmdSetMode),
89  FXMAPFUNC(SEL_COMMAND, MID_HOTKEY_V_VEHICLEMODE, GNEViewNet::onCmdSetMode),
91  // Common view options
93  // Network view options
105  // Demand view options
110  // Select elements
111  FXMAPFUNC(SEL_COMMAND, MID_ADDSELECT, GNEViewNet::onCmdAddSelected),
112  FXMAPFUNC(SEL_COMMAND, MID_REMOVESELECT, GNEViewNet::onCmdRemoveSelected),
113  // Junctions
121  // Connections
123  // Crossings
125  // Edges
126  FXMAPFUNC(SEL_COMMAND, MID_GNE_EDGE_SPLIT, GNEViewNet::onCmdSplitEdge),
128  FXMAPFUNC(SEL_COMMAND, MID_GNE_EDGE_REVERSE, GNEViewNet::onCmdReverseEdge),
133  FXMAPFUNC(SEL_COMMAND, MID_GNE_EDGE_SMOOTH, GNEViewNet::onCmdSmoothEdges),
136  // Lanes
144  FXMAPFUNC(SEL_COMMAND, MID_GNE_LANE_ADD_BIKE, GNEViewNet::onCmdLaneOperation),
145  FXMAPFUNC(SEL_COMMAND, MID_GNE_LANE_ADD_BUS, GNEViewNet::onCmdLaneOperation),
151  // Additionals
153  // Polygons
155  FXMAPFUNC(SEL_COMMAND, MID_GNE_POLYGON_CLOSE, GNEViewNet::onCmdClosePolygon),
156  FXMAPFUNC(SEL_COMMAND, MID_GNE_POLYGON_OPEN, GNEViewNet::onCmdOpenPolygon),
159  // POIs
160  FXMAPFUNC(SEL_COMMAND, MID_GNE_POI_TRANSFORM, GNEViewNet::onCmdTransformPOI),
161 };
162 
163 // Object implementation
164 FXIMPLEMENT(GNEViewNet, GUISUMOAbstractView, GNEViewNetMap, ARRAYNUMBER(GNEViewNetMap))
165 
166 // ===========================================================================
167 // member method definitions
168 // ===========================================================================
169 
170 GNEViewNet::GNEViewNet(FXComposite* tmpParent, FXComposite* actualParent, GUIMainWindow& app,
171  GNEViewParent* viewParent, GNENet* net, GNEUndoList* undoList,
172  FXGLVisual* glVis, FXGLCanvas* share) :
173  GUISUMOAbstractView(tmpParent, app, viewParent, net->getVisualisationSpeedUp(), glVis, share),
174  myEditModes(this),
175  myTestingMode(this),
176  myCommonCheckableButtons(this),
177  myNetworkCheckableButtons(this),
178  myDemandCheckableButtons(this),
179  myCommonViewOptions(this),
180  myNetworkViewOptions(this),
181  myDemandViewOptions(this),
182  myMoveSingleElementValues(this),
183  myMoveMultipleElementValues(this),
184  myVehicleOptions(this),
185  myVehicleTypeOptions(this),
186  mySelectingArea(this),
187  myEditShapes(this),
188  myViewParent(viewParent),
189  myNet(net),
190  myCurrentFrame(nullptr),
191  myUndoList(undoList) {
192  // view must be the final member of actualParent
193  reparent(actualParent);
194  // Build edit modes
195  buildEditModeControls();
196  // Mark undo list
197  myUndoList->mark();
198  // set this viewNet in Net
199  myNet->setViewNet(this);
200 
201  // set drag delay
202  ((GUIDanielPerspectiveChanger*)myChanger)->setDragDelay(100000000); // 100 milliseconds
203 
204  // Reset textures
206 
207  // init testing mode
208  myTestingMode.initTestingMode();
209 }
210 
211 
213 
214 
215 void
217 
218 
219 void
221  // build coloring tools
222  {
223  for (auto it_names : gSchemeStorage.getNames()) {
224  cw.getColoringSchemesCombo()->appendItem(it_names.c_str());
225  if (it_names == myVisualizationSettings->name) {
226  cw.getColoringSchemesCombo()->setCurrentItem(cw.getColoringSchemesCombo()->getNumItems() - 1);
227  }
228  }
229  cw.getColoringSchemesCombo()->setNumVisible(MAX2(5, (int)gSchemeStorage.getNames().size() + 1));
230  }
231  // for junctions
232  new FXButton(cw.getLocatorPopup(),
233  "\tLocate Junction\tLocate a junction within the network.",
235  ICON_ABOVE_TEXT | FRAME_THICK | FRAME_RAISED);
236  // for edges
237  new FXButton(cw.getLocatorPopup(),
238  "\tLocate Street\tLocate a street within the network.",
240  ICON_ABOVE_TEXT | FRAME_THICK | FRAME_RAISED);
241 
242  // for vehicles
243  new FXButton(cw.getLocatorPopup(),
244  "\tLocate Vehicle\tLocate a vehicle within the network.",
246  ICON_ABOVE_TEXT | FRAME_THICK | FRAME_RAISED);
247 
248  // for routes
249  new FXButton(cw.getLocatorPopup(),
250  "\tLocate Route\tLocate a route within the network.",
252  ICON_ABOVE_TEXT | FRAME_THICK | FRAME_RAISED);
253 
254  // for routes
255  new FXButton(cw.getLocatorPopup(),
256  "\tLocate Stop\tLocate a stop within the network.",
258  ICON_ABOVE_TEXT | FRAME_THICK | FRAME_RAISED);
259 
260  // for persons (currently unused)
261  /*
262  new FXButton(cw.getLocatorPopup(),
263  "\tLocate Vehicle\tLocate a person within the network.",
264  GUIIconSubSys::getIcon(ICON_LOCATEPERSON), &v, MID_LOCATEPERSON,
265  ICON_ABOVE_TEXT | FRAME_THICK | FRAME_RAISED);
266  */
267 
268  // for tls
269  new FXButton(cw.getLocatorPopup(),
270  "\tLocate TLS\tLocate a tls within the network.",
272  ICON_ABOVE_TEXT | FRAME_THICK | FRAME_RAISED);
273  // for additional stuff
274  new FXButton(cw.getLocatorPopup(),
275  "\tLocate Additional\tLocate an additional structure within the network.",
277  ICON_ABOVE_TEXT | FRAME_THICK | FRAME_RAISED);
278  // for pois
279  new FXButton(cw.getLocatorPopup(),
280  "\tLocate PoI\tLocate a PoI within the network.",
282  ICON_ABOVE_TEXT | FRAME_THICK | FRAME_RAISED);
283  // for polygons
284  new FXButton(cw.getLocatorPopup(),
285  "\tLocate Polygon\tLocate a Polygon within the network.",
287  ICON_ABOVE_TEXT | FRAME_THICK | FRAME_RAISED);
288 }
289 
290 
291 void
293  // this call is only used for breakpoints (to check when view is updated)
294  GUISUMOAbstractView::update();
295 }
296 
297 
298 std::set<std::pair<std::string, GNEAttributeCarrier*> >
299 GNEViewNet::getAttributeCarriersInBoundary(const Boundary& boundary, bool forceSelectEdges) {
300  // use a SET of pairs to obtain IDs and Pointers to attribute carriers. We need this because certain ACs can be returned many times (example: Edges)
301  // Note: a map cannot be used because there is different ACs with the same ID (example: Additionals)
302  std::set<std::pair<std::string, GNEAttributeCarrier*> > result;
303  // firstm make OpenGL context current prior to performing OpenGL commands
304  if (makeCurrent()) {
305  // obtain GUIGLIds of all objects in the given boundary
306  std::vector<GUIGlID> ids = getObjectsInBoundary(boundary);
307  // finish make OpenGL context current
308  makeNonCurrent();
309  // iterate over GUIGlIDs
310  for (auto i : ids) {
311  // avoid to select Net (i = 0)
312  if (i != 0) {
314  // in the case of a Lane, we need to change the retrieved lane to their the parent if myNetworkViewOptions.mySelectEdges is enabled
315  if ((retrievedAC->getTagProperty().getTag() == SUMO_TAG_LANE) && (myNetworkViewOptions.selectEdges() || forceSelectEdges)) {
316  retrievedAC = &dynamic_cast<GNELane*>(retrievedAC)->getParentEdge();
317  }
318  // make sure that AttributeCarrier can be selected
319  GUIGlObject* glObject = dynamic_cast<GUIGlObject*>(retrievedAC);
320  if (glObject && !myViewParent->getSelectorFrame()->getLockGLObjectTypes()->IsObjectTypeLocked(glObject->getType())) {
321  result.insert(std::make_pair(retrievedAC->getID(), retrievedAC));
322  }
323  }
324  }
325  }
326  return result;
327 }
328 
329 
330 void
332  if (AC->isAttributeCarrierSelected()) {
333  new FXMenuCommand(ret, "Remove From Selected", GUIIconSubSys::getIcon(ICON_FLAG_MINUS), this, MID_REMOVESELECT);
334  } else {
335  new FXMenuCommand(ret, "Add To Selected", GUIIconSubSys::getIcon(ICON_FLAG_PLUS), this, MID_ADDSELECT);
336  }
337  new FXMenuSeparator(ret);
338 }
339 
340 
341 bool
342 GNEViewNet::setColorScheme(const std::string& name) {
343  if (!gSchemeStorage.contains(name)) {
344  return false;
345  }
346  if (myVisualizationChanger != nullptr) {
347  if (myVisualizationChanger->getCurrentScheme() != name) {
349  }
350  }
351  myVisualizationSettings = &gSchemeStorage.get(name.c_str());
352  update();
353  return true;
354 }
355 
356 
357 void
359  // reimplemented from GUISUMOAbstractView due OverlappedInspection
360  ungrab();
361  if (!isEnabled() || !myAmInitialised) {
362  return;
363  }
364  if (makeCurrent()) {
365  // initialise the select mode
366  int id = getObjectUnderCursor();
367  GUIGlObject* o = nullptr;
368  // we need to check if we're inspecting a overlapping element
372  o = dynamic_cast<GUIGlObject*>(myViewParent->getInspectorFrame()->getAttributesEditor()->getEditedACs().front());
373  } else if (id != 0) {
375  } else {
377  }
378  // check if open popup menu can be opened
379  if (o != nullptr) {
380  myPopup = o->getPopUpMenu(*myApp, *this);
381  int x, y;
382  FXuint b;
383  myApp->getCursorPosition(x, y, b);
384  myPopup->setX(x + myApp->getX());
385  myPopup->setY(y + myApp->getY());
386  myPopup->create();
387  myPopup->show();
389  myChanger->onRightBtnRelease(nullptr);
391  setFocus();
392  }
393  makeNonCurrent();
394  }
395 }
396 
397 
400  return myEditModes;
401 }
402 
403 
406  return myCommonViewOptions;
407 }
408 
409 
412  return myNetworkViewOptions;
413 }
414 
415 
418  return myDemandViewOptions;
419 }
420 
421 
424  return myKeyPressed;
425 }
426 
427 
430  return myEditShapes;
431 }
432 
433 
434 void
436  bool hide, double hideThreshold) {
437  assert(!scheme.isFixed());
438  UNUSED_PARAMETER(s);
439  double minValue = std::numeric_limits<double>::infinity();
440  double maxValue = -std::numeric_limits<double>::infinity();
441  // retrieve range
442  if (objectType == GLO_LANE) {
443  // XXX (see #3409) multi-colors are not currently handled. this is a quick hack
444  if (active == 9) {
445  active = 8; // segment height, fall back to start height
446  } else if (active == 11) {
447  active = 10; // segment incline, fall back to total incline
448  }
449  for (GNELane* lane : myNet->retrieveLanes()) {
450  const double val = lane->getColorValue(s, active);
451  minValue = MIN2(minValue, val);
452  maxValue = MAX2(maxValue, val);
453  }
454  } else if (objectType == GLO_JUNCTION) {
455  if (active == 3) {
456  for (GNEJunction* junction : myNet->retrieveJunctions()) {
457  minValue = MIN2(minValue, junction->getPositionInView().z());
458  maxValue = MAX2(maxValue, junction->getPositionInView().z());
459  }
460  }
461  }
462  if (minValue != std::numeric_limits<double>::infinity()) {
463  scheme.clear();
464  // add new thresholds
465  if (hide) {
466  minValue = MAX2(hideThreshold + 1, minValue);
467  scheme.addColor(RGBColor(204, 204, 204), hideThreshold);
468  }
469  double range = maxValue - minValue;
470  scheme.addColor(RGBColor::RED, (minValue));
471  scheme.addColor(RGBColor::ORANGE, (minValue + range * 1 / 6.0));
472  scheme.addColor(RGBColor::YELLOW, (minValue + range * 2 / 6.0));
473  scheme.addColor(RGBColor::GREEN, (minValue + range * 3 / 6.0));
474  scheme.addColor(RGBColor::CYAN, (minValue + range * 4 / 6.0));
475  scheme.addColor(RGBColor::BLUE, (minValue + range * 5 / 6.0));
476  scheme.addColor(RGBColor::MAGENTA, (maxValue));
477  }
478 }
479 
480 
481 void
482 GNEViewNet::setStatusBarText(const std::string& text) {
483  myApp->setStatusBarText(text);
484 }
485 
486 
487 bool
489  return (myNetworkViewOptions.menuCheckExtendSelection->getCheck() != 0);
490 }
491 
492 
493 void
494 GNEViewNet::setSelectionScaling(double selectionScale) {
495  myVisualizationSettings->selectionScale = selectionScale;
496 }
497 
498 
499 bool
501  return (myNetworkViewOptions.menuCheckChangeAllPhases->getCheck() != 0);
502 }
503 
504 
505 bool
508 }
509 
510 
512  myEditModes(this),
513  myTestingMode(this),
517  myCommonViewOptions(this),
518  myNetworkViewOptions(this),
519  myDemandViewOptions(this),
522  myVehicleOptions(this),
523  myVehicleTypeOptions(this),
524  mySelectingArea(this),
525  myEditShapes(this) {
526 }
527 
528 
529 int
530 GNEViewNet::doPaintGL(int mode, const Boundary& bound) {
531  // init view settings
534  }
535  glRenderMode(mode);
536  glMatrixMode(GL_MODELVIEW);
537  glPushMatrix();
538  glDisable(GL_TEXTURE_2D);
539  glDisable(GL_ALPHA_TEST);
540  glEnable(GL_BLEND);
541  glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
542  glEnable(GL_DEPTH_TEST);
543 
544  // visualize rectangular selection
546 
547  // compute lane width
548  double lw = m2p(SUMO_const_laneWidth);
549  // draw decals (if not in grabbing mode)
551  drawDecals();
552  // depending of the visualizationSettings, enable or disable check box show grid
554  myCommonViewOptions.menuCheckShowGrid->setCheck(true);
555  paintGLGrid();
556  } else {
557  myCommonViewOptions.menuCheckShowGrid->setCheck(false);
558  }
560  }
561  // draw temporal elements
565  // draw testing elements
567  // draw temporal trip/flow route
569  // draw temporal person plan route
572  // draw temporal non consecutive edge
574  }
575  // check menu checks of supermode demand
577  // enable or disable menuCheckShowAllPersonPlans depending of there is a locked person
580  } else {
582  }
583  // check if menuCheckLockPerson must be enabled or disabled
584  if (myDemandViewOptions.menuCheckLockPerson->getCheck() == FALSE) {
585  // check if we're in inspector mode and we're inspecting exactly one element
587  // obtain tag property
589  // enable menu check lock person if is either a person, a person plan or a person stop
590  if (tagProperty.isPerson() || tagProperty.isPersonPlan() || tagProperty.isPersonStop()) {
592  } else {
594  }
595  } else {
597  }
598  }
599  }
600  // draw elements
601  glLineWidth(1);
602  glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
603  const float minB[2] = { (float)bound.xmin(), (float)bound.ymin() };
604  const float maxB[2] = { (float)bound.xmax(), (float)bound.ymax() };
606  glEnable(GL_POLYGON_OFFSET_FILL);
607  glEnable(GL_POLYGON_OFFSET_LINE);
608  // obtain objects included in minB and maxB
609  int hits2 = myGrid->Search(minB, maxB, *myVisualizationSettings);
610  // pop draw matrix
611  glPopMatrix();
612  return hits2;
613 }
614 
615 
616 long
617 GNEViewNet::onLeftBtnPress(FXObject*, FXSelector, void* eventData) {
618  // set focus in view net
619  setFocus();
620  // update keyPressed
621  myKeyPressed.update(eventData);
622  // interpret object under cursor
623  if (makeCurrent()) {
624  // fill objects under cursor
626  // process left button press function depending of supermode
630  processLeftButtonPressDemand(eventData);
631  }
632  makeNonCurrent();
633  }
634  // update cursor
635  updateCursor();
636  // update view
637  update();
638  return 1;
639 }
640 
641 
642 long
643 GNEViewNet::onLeftBtnRelease(FXObject* obj, FXSelector sel, void* eventData) {
644  // process parent function
645  GUISUMOAbstractView::onLeftBtnRelease(obj, sel, eventData);
646  // first update keyPressed
647  myKeyPressed.update(eventData);
648  // update cursor
649  updateCursor();
650  // process left button release function depending of supermode
655  }
656  // update view
657  update();
658  return 1;
659 }
660 
661 
662 long
663 GNEViewNet::onRightBtnPress(FXObject* obj, FXSelector sel, void* eventData) {
664  // update keyPressed
665  myKeyPressed.update(eventData);
666  // update cursor
667  updateCursor();
669  // disable right button press during drawing polygon
670  return 1;
671  } else {
672  return GUISUMOAbstractView::onRightBtnPress(obj, sel, eventData);
673  }
674 }
675 
676 
677 long
678 GNEViewNet::onRightBtnRelease(FXObject* obj, FXSelector sel, void* eventData) {
679  // update keyPressed
680  myKeyPressed.update(eventData);
681  // update cursor
682  updateCursor();
683  // disable right button release during drawing polygon
685  return 1;
686  } else {
687  return GUISUMOAbstractView::onRightBtnRelease(obj, sel, eventData);
688  }
689 }
690 
691 
692 long
693 GNEViewNet::onMouseMove(FXObject* obj, FXSelector sel, void* eventData) {
694  // process mouse move in GUISUMOAbstractView
695  GUISUMOAbstractView::onMouseMove(obj, sel, eventData);
696  // update keyPressed
697  myKeyPressed.update(eventData);
698  // update cursor
699  updateCursor();
700  // process mouse move function depending of supermode
705  }
706  return 1;
707 }
708 
709 
710 long
711 GNEViewNet::onKeyPress(FXObject* o, FXSelector sel, void* eventData) {
712  // update keyPressed
713  myKeyPressed.update(eventData);
714  // update cursor
715  updateCursor();
716  // change "delete last created point" depending of shift key
719  update();
722  update();
723  }
724  return GUISUMOAbstractView::onKeyPress(o, sel, eventData);
725 }
726 
727 
728 long
729 GNEViewNet::onKeyRelease(FXObject* o, FXSelector sel, void* eventData) {
730  // update keyPressed
731  myKeyPressed.update(eventData);
732  // update cursor
733  updateCursor();
734  // change "delete last created point" depending of shift key
737  update();
738  }
739  // check if selecting using rectangle has to be disabled
742  update();
743  }
744  return GUISUMOAbstractView::onKeyRelease(o, sel, eventData);
745 }
746 
747 
748 void
749 GNEViewNet::abortOperation(bool clearSelection) {
750  // steal focus from any text fields and place it over view net
751  setFocus();
752  // check what supermode is enabled
754  // abort operation depending of current mode
756  // abort edge creation in create edge frame
760  // check if current selection has to be cleaned
761  if (clearSelection) {
763  }
765  // abort changes in Connector Frame
767  } else if (myEditModes.networkEditMode == GNE_NMODE_TLS) {
768  myViewParent->getTLSEditorFrame()->onCmdCancel(nullptr, 0, nullptr);
772  // abort current drawing
774  } else if (myEditModes.networkEditMode == GNE_NMODE_TAZ) {
776  // abort current drawing
778  } else if (myViewParent->getTAZFrame()->getTAZCurrentModul()->getTAZ() != nullptr) {
779  // finish current editing TAZ
781  }
783  myViewParent->getProhibitionFrame()->onCmdCancel(nullptr, 0, nullptr);
785  // abort select lanes
787  }
789  // abort operation depending of current mode
792  // check if current selection has to be cleaned
793  if (clearSelection) {
795  }
804  }
805  }
806  // abort undo list
807  myUndoList->p_abort();
808 }
809 
810 
811 void
814  setStatusBarText("Cannot delete in this mode");
815  } else {
816  // delete elements depending of current supermode
818  myUndoList->p_begin("delete network selection");
826  myUndoList->p_end();
827  } else {
828  myUndoList->p_begin("delete demand selection");
830  myUndoList->p_end();
831  }
832  // update view
833  update();
834  }
835 }
836 
837 
838 void
840  // check what supermode is enabled
842  // abort operation depending of current mode
844  // Accept changes in Connector Frame
846  } else if (myEditModes.networkEditMode == GNE_NMODE_TLS) {
847  myViewParent->getTLSEditorFrame()->onCmdOK(nullptr, 0, nullptr);
848  } else if ((myEditModes.networkEditMode == GNE_NMODE_MOVE) && (myEditShapes.editedShapePoly != nullptr)) {
852  // stop current drawing
854  } else {
855  // start drawing
857  }
860  } else if (myEditModes.networkEditMode == GNE_NMODE_TAZ) {
862  // stop current drawing
864  } else if (myViewParent->getTAZFrame()->getTAZCurrentModul()->getTAZ() == nullptr) {
865  // start drawing
868  // save pending changes
870  }
873  // stop select lanes to create additional
875  }
876  }
878  // abort operation depending of current mode
887  }
888  }
889 }
890 
891 
892 void
894  // Currently only used in Demand mode
896  // abort operation depending of current mode
905  }
906  }
907 }
908 
909 void
911  // if there is a visible frame, set focus over it. In other case, set focus over ViewNet
912  if (myCurrentFrame != nullptr) {
914  } else {
915  setFocus();
916  }
917 }
918 
919 
922  return myViewParent;
923 }
924 
925 
926 GNENet*
928  return myNet;
929 }
930 
931 
934  return myUndoList;
935 }
936 
937 
938 const GNEAttributeCarrier*
940  return myDottedAC;
941 }
942 
943 
944 void
946  myDottedAC = AC;
947 }
948 
949 
950 bool
953 }
954 
955 
958  GNEJunction* junction = nullptr;
959  if (makeCurrent()) {
963  if (pointed) {
964  switch (pointed->getType()) {
965  case GLO_JUNCTION:
966  junction = (GNEJunction*)pointed;
967  break;
968  default:
969  break;
970  }
971  }
972  }
973  return junction;
974 }
975 
976 
979  GNEConnection* connection = nullptr;
980  if (makeCurrent()) {
984  if (pointed) {
985  switch (pointed->getType()) {
986  case GLO_CONNECTION:
987  connection = (GNEConnection*)pointed;
988  break;
989  default:
990  break;
991  }
992  }
993  }
994  return connection;
995 }
996 
997 
1000  GNECrossing* crossing = nullptr;
1001  if (makeCurrent()) {
1005  if (pointed) {
1006  switch (pointed->getType()) {
1007  case GLO_CROSSING:
1008  crossing = (GNECrossing*)pointed;
1009  break;
1010  default:
1011  break;
1012  }
1013  }
1014  }
1015  return crossing;
1016 }
1017 
1018 GNEEdge*
1020  GNEEdge* edge = nullptr;
1021  if (makeCurrent()) {
1025  if (pointed) {
1026  switch (pointed->getType()) {
1027  case GLO_EDGE:
1028  edge = (GNEEdge*)pointed;
1029  break;
1030  case GLO_LANE:
1031  edge = &(((GNELane*)pointed)->getParentEdge());
1032  break;
1033  default:
1034  break;
1035  }
1036  }
1037  }
1038  return edge;
1039 }
1040 
1041 
1042 GNELane*
1044  GNELane* lane = nullptr;
1045  if (makeCurrent()) {
1049  if (pointed) {
1050  if (pointed->getType() == GLO_LANE) {
1051  lane = (GNELane*)pointed;
1052  }
1053  }
1054  }
1055  return lane;
1056 }
1057 
1058 
1061  if (makeCurrent()) {
1065  if (pointed) {
1066  return dynamic_cast<GNEAdditional*>(pointed);
1067  }
1068  }
1069  return nullptr;
1070 }
1071 
1072 
1073 GNEPoly*
1075  if (makeCurrent()) {
1079  if (pointed) {
1080  return dynamic_cast<GNEPoly*>(pointed);
1081  }
1082  }
1083  return nullptr;
1084 }
1085 
1086 
1087 GNEPOI*
1089  if (makeCurrent()) {
1093  if (pointed) {
1094  return dynamic_cast<GNEPOI*>(pointed);
1095  }
1096  }
1097  return nullptr;
1098 }
1099 
1100 long
1101 GNEViewNet::onCmdSetSupermode(FXObject*, FXSelector sel, void*) {
1102  // check what network mode will be set
1103  switch (FXSELID(sel)) {
1106  break;
1109  break;
1110  default:
1111  break;
1112  }
1113  return 1;
1114 }
1115 
1116 long
1117 GNEViewNet::onCmdSetMode(FXObject*, FXSelector sel, void*) {
1119  // check what network mode will be set
1120  switch (FXSELID(sel)) {
1123  break;
1126  break;
1129  break;
1130  case MID_HOTKEY_M_MOVEMODE:
1132  break;
1133  case MID_HOTKEY_E_EDGEMODE:
1135  break;
1138  break;
1141  break;
1144  break;
1147  break;
1148  case MID_HOTKEY_Z_TAZMODE:
1150  break;
1153  break;
1156  break;
1157  default:
1158  break;
1159  }
1160  } else {
1161  // check what demand mode will be set
1162  switch (FXSELID(sel)) {
1165  break;
1168  break;
1171  break;
1172  case MID_HOTKEY_M_MOVEMODE:
1174  break;
1177  break;
1180  break;
1183  break;
1186  break;
1189  break;
1192  break;
1195  break;
1196  default:
1197  break;
1198  }
1199  }
1200  return 1;
1201 }
1202 
1203 
1204 long
1205 GNEViewNet::onCmdSplitEdge(FXObject*, FXSelector, void*) {
1206  GNEEdge* edge = getEdgeAtPopupPosition();
1207  if (edge != nullptr) {
1209  }
1210  return 1;
1211 }
1212 
1213 
1214 long
1215 GNEViewNet::onCmdSplitEdgeBidi(FXObject*, FXSelector, void*) {
1216  GNEEdge* edge = getEdgeAtPopupPosition();
1217  if (edge != nullptr) {
1218  // obtain reverse edge
1219  GNEEdge* reverseEdge = edge->getOppositeEdge();
1220  // check that reverse edge works
1221  if (reverseEdge != nullptr) {
1222  myNet->splitEdgesBidi(edge, reverseEdge, edge->getSplitPos(getPopupPosition()), myUndoList);
1223  }
1224  }
1225  return 1;
1226 }
1227 
1228 
1229 long
1230 GNEViewNet::onCmdReverseEdge(FXObject*, FXSelector, void*) {
1231  GNEEdge* edge = getEdgeAtPopupPosition();
1232  if (edge != nullptr) {
1233  if (edge->isAttributeCarrierSelected()) {
1234  myUndoList->p_begin("Reverse selected " + toString(SUMO_TAG_EDGE) + "s");
1235  std::vector<GNEEdge*> edges = myNet->retrieveEdges(true);
1236  for (auto it : edges) {
1238  }
1239  myUndoList->p_end();
1240  } else {
1241  myUndoList->p_begin("Reverse " + toString(SUMO_TAG_EDGE));
1242  myNet->reverseEdge(edge, myUndoList);
1243  myUndoList->p_end();
1244  }
1245  }
1246  return 1;
1247 }
1248 
1249 
1250 long
1251 GNEViewNet::onCmdAddReversedEdge(FXObject*, FXSelector, void*) {
1252  GNEEdge* edge = getEdgeAtPopupPosition();
1253  if (edge != nullptr) {
1254  if (edge->isAttributeCarrierSelected()) {
1255  myUndoList->p_begin("Add Reverse edge for selected " + toString(SUMO_TAG_EDGE) + "s");
1256  std::vector<GNEEdge*> edges = myNet->retrieveEdges(true);
1257  for (auto it : edges) {
1259  }
1260  myUndoList->p_end();
1261  } else {
1262  myUndoList->p_begin("Add reverse " + toString(SUMO_TAG_EDGE));
1264  myUndoList->p_end();
1265  }
1266  }
1267  return 1;
1268 }
1269 
1270 
1271 long
1272 GNEViewNet::onCmdEditEdgeEndpoint(FXObject*, FXSelector, void*) {
1273  GNEEdge* edge = getEdgeAtPopupPosition();
1274  if (edge != nullptr) {
1275  // snap to active grid the Popup position
1277  }
1278  return 1;
1279 }
1280 
1281 
1282 long
1283 GNEViewNet::onCmdResetEdgeEndpoint(FXObject*, FXSelector, void*) {
1284  GNEEdge* edge = getEdgeAtPopupPosition();
1285  if (edge != nullptr) {
1287  }
1288  return 1;
1289 }
1290 
1291 
1292 long
1293 GNEViewNet::onCmdStraightenEdges(FXObject*, FXSelector, void*) {
1294  GNEEdge* edge = getEdgeAtPopupPosition();
1295  if (edge != nullptr) {
1296  if (edge->isAttributeCarrierSelected()) {
1297  myUndoList->p_begin("straighten selected " + toString(SUMO_TAG_EDGE) + "s");
1298  std::vector<GNEEdge*> edges = myNet->retrieveEdges(true);
1299  for (auto it : edges) {
1300  it->setAttribute(SUMO_ATTR_SHAPE, "", myUndoList);
1301  }
1302  myUndoList->p_end();
1303  } else {
1304 
1305  myUndoList->p_begin("straighten " + toString(SUMO_TAG_EDGE));
1307  myUndoList->p_end();
1308  }
1309  }
1310  return 1;
1311 }
1312 
1313 
1314 long
1315 GNEViewNet::onCmdSmoothEdges(FXObject*, FXSelector, void*) {
1316  GNEEdge* edge = getEdgeAtPopupPosition();
1317  if (edge != nullptr) {
1318  if (edge->isAttributeCarrierSelected()) {
1319  myUndoList->p_begin("straighten elevation of selected " + toString(SUMO_TAG_EDGE) + "s");
1320  std::vector<GNEEdge*> edges = myNet->retrieveEdges(true);
1321  for (auto it : edges) {
1322  it->smooth(myUndoList);
1323  }
1324  myUndoList->p_end();
1325  } else {
1326  myUndoList->p_begin("straighten edge elevation");
1327  edge->smooth(myUndoList);
1328  myUndoList->p_end();
1329  }
1330  }
1331  return 1;
1332 }
1333 
1334 
1335 long
1336 GNEViewNet::onCmdStraightenEdgesElevation(FXObject*, FXSelector, void*) {
1337  GNEEdge* edge = getEdgeAtPopupPosition();
1338  if (edge != nullptr) {
1339  if (edge->isAttributeCarrierSelected()) {
1340  myUndoList->p_begin("straighten elevation of selected " + toString(SUMO_TAG_EDGE) + "s");
1341  std::vector<GNEEdge*> edges = myNet->retrieveEdges(true);
1342  for (auto it : edges) {
1343  it->straightenElevation(myUndoList);
1344  }
1345  myUndoList->p_end();
1346  } else {
1347  myUndoList->p_begin("straighten edge elevation");
1349  myUndoList->p_end();
1350  }
1351  }
1352  return 1;
1353 }
1354 
1355 
1356 long
1357 GNEViewNet::onCmdSmoothEdgesElevation(FXObject*, FXSelector, void*) {
1358  GNEEdge* edge = getEdgeAtPopupPosition();
1359  if (edge != nullptr) {
1360  if (edge->isAttributeCarrierSelected()) {
1361  myUndoList->p_begin("smooth elevation of selected " + toString(SUMO_TAG_EDGE) + "s");
1362  std::vector<GNEEdge*> edges = myNet->retrieveEdges(true);
1363  for (auto it : edges) {
1364  it->smoothElevation(myUndoList);
1365  }
1366  myUndoList->p_end();
1367  } else {
1368  myUndoList->p_begin("smooth edge elevation");
1369  edge->smoothElevation(myUndoList);
1370  myUndoList->p_end();
1371  }
1372  }
1373  return 1;
1374 }
1375 
1376 
1377 long
1378 GNEViewNet::onCmdSimplifyShape(FXObject*, FXSelector, void*) {
1379  if (myEditShapes.editedShapePoly != nullptr) {
1381  update();
1382  } else {
1383  GNEPoly* polygonUnderMouse = getPolygonAtPopupPosition();
1384  if (polygonUnderMouse) {
1385  polygonUnderMouse->simplifyShape();
1386  }
1387  }
1388  return 1;
1389 }
1390 
1391 
1392 long
1393 GNEViewNet::onCmdDeleteGeometryPoint(FXObject*, FXSelector, void*) {
1394  if (myEditShapes.editedShapePoly != nullptr) {
1396  update();
1397  } else {
1398  GNEPoly* polygonUnderMouse = getPolygonAtPopupPosition();
1399  if (polygonUnderMouse) {
1400  polygonUnderMouse->deleteGeometryPoint(getPopupPosition());
1401  }
1402  }
1403  return 1;
1404 }
1405 
1406 
1407 long
1408 GNEViewNet::onCmdClosePolygon(FXObject*, FXSelector, void*) {
1409  if (myEditShapes.editedShapePoly != nullptr) {
1411  update();
1412  } else {
1413  GNEPoly* polygonUnderMouse = getPolygonAtPopupPosition();
1414  if (polygonUnderMouse) {
1415  polygonUnderMouse->closePolygon();
1416  }
1417  }
1418  return 1;
1419 }
1420 
1421 
1422 long
1423 GNEViewNet::onCmdOpenPolygon(FXObject*, FXSelector, void*) {
1424  if (myEditShapes.editedShapePoly != nullptr) {
1426  update();
1427  } else {
1428  GNEPoly* polygonUnderMouse = getPolygonAtPopupPosition();
1429  if (polygonUnderMouse) {
1430  polygonUnderMouse->openPolygon();
1431  }
1432  }
1433  return 1;
1434 }
1435 
1436 
1437 long
1438 GNEViewNet::onCmdSetFirstGeometryPoint(FXObject*, FXSelector, void*) {
1439  if (myEditShapes.editedShapePoly != nullptr) {
1441  update();
1442  } else {
1443  GNEPoly* polygonUnderMouse = getPolygonAtPopupPosition();
1444  if (polygonUnderMouse) {
1445  polygonUnderMouse->changeFirstGeometryPoint(polygonUnderMouse->getVertexIndex(getPopupPosition(), false, false));
1446  }
1447  }
1448  return 1;
1449 }
1450 
1451 
1452 long
1453 GNEViewNet::onCmdTransformPOI(FXObject*, FXSelector, void*) {
1454  // obtain POI at popup position
1456  if (POI) {
1457  // check what type of POI will be transformed
1458  if (POI->getTagProperty().getTag() == SUMO_TAG_POI) {
1459  // obtain lanes around POI boundary
1460  std::vector<GUIGlID> GLIDs = getObjectsInBoundary(POI->getCenteringBoundary());
1461  std::vector<GNELane*> lanes;
1462  for (auto i : GLIDs) {
1464  if (lane) {
1465  lanes.push_back(lane);
1466  }
1467  }
1468  if (lanes.empty()) {
1469  WRITE_WARNING("No lanes around " + toString(SUMO_TAG_POI) + " to attach it");
1470  } else {
1471  // obtain nearest lane to POI
1472  GNELane* nearestLane = lanes.front();
1473  double minorPosOverLane = nearestLane->getGeometry().shape.nearest_offset_to_point2D(POI->getPositionInView());
1474  double minorLateralOffset = nearestLane->getGeometry().shape.positionAtOffset(minorPosOverLane).distanceTo(POI->getPositionInView());
1475  for (auto i : lanes) {
1476  double posOverLane = i->getGeometry().shape.nearest_offset_to_point2D(POI->getPositionInView());
1477  double lateralOffset = i->getGeometry().shape.positionAtOffset(posOverLane).distanceTo(POI->getPositionInView());
1478  if (lateralOffset < minorLateralOffset) {
1479  minorPosOverLane = posOverLane;
1480  minorLateralOffset = lateralOffset;
1481  nearestLane = i;
1482  }
1483  }
1484  // obtain values of POI
1485  std::string id = POI->getID();
1486  std::string type = POI->getShapeType();
1487  RGBColor color = POI->getShapeColor();
1488  Position pos = (*POI);
1489  double layer = POI->getShapeLayer();
1490  double angle = POI->getShapeNaviDegree();
1491  std::string imgFile = POI->getShapeImgFile();
1492  bool relativePath = POI->getShapeRelativePath();
1493  double POIWidth = POI->getWidth(); // double width -> C4458
1494  double POIHeight = POI->getHeight(); // double height -> C4458
1495  // remove POI
1496  myUndoList->p_begin("attach POI into " + toString(SUMO_TAG_LANE));
1497  myNet->deleteShape(POI, myUndoList);
1498  // add POILane
1499  myNet->addPOI(id, type, color, pos, false, nearestLane->getID(), minorPosOverLane, 0, layer, angle, imgFile, relativePath, POIWidth, POIHeight);
1500  myUndoList->p_end();
1501  }
1502  } else {
1503  // obtain values of POILane
1504  std::string id = POI->getID();
1505  std::string type = POI->getShapeType();
1506  RGBColor color = POI->getShapeColor();
1507  Position pos = (*POI);
1508  double layer = POI->getShapeLayer();
1509  double angle = POI->getShapeNaviDegree();
1510  std::string imgFile = POI->getShapeImgFile();
1511  bool relativePath = POI->getShapeRelativePath();
1512  double POIWidth = POI->getWidth(); // double width -> C4458
1513  double POIWeight = POI->getHeight(); // double height -> C4458
1514  // remove POI
1515  myUndoList->p_begin("release POI from " + toString(SUMO_TAG_LANE));
1516  myNet->deleteShape(POI, myUndoList);
1517  // add POI
1518  myNet->addPOI(id, type, color, pos, false, "", 0, 0, layer, angle, imgFile, relativePath, POIWidth, POIWeight);
1519  myUndoList->p_end();
1520  }
1521  // update view after transform
1522  update();
1523  }
1524  return 1;
1525 }
1526 
1527 
1528 long
1529 GNEViewNet::onCmdDuplicateLane(FXObject*, FXSelector, void*) {
1530  GNELane* lane = getLaneAtPopupPosition();
1531  if (lane != nullptr) {
1532  // when duplicating an unselected lane, keep all connections as they
1533  // are, otherwise recompute them
1534  if (lane->isAttributeCarrierSelected()) {
1535  myUndoList->p_begin("duplicate selected " + toString(SUMO_TAG_LANE) + "s");
1536  std::vector<GNELane*> lanes = myNet->retrieveLanes(true);
1537  for (auto it : lanes) {
1538  myNet->duplicateLane(it, myUndoList, true);
1539  }
1540  myUndoList->p_end();
1541  } else {
1542  myUndoList->p_begin("duplicate " + toString(SUMO_TAG_LANE));
1543  myNet->duplicateLane(lane, myUndoList, false);
1544  myUndoList->p_end();
1545  }
1546  }
1547  return 1;
1548 }
1549 
1550 
1551 long
1552 GNEViewNet::onCmdResetLaneCustomShape(FXObject*, FXSelector, void*) {
1553  GNELane* lane = getLaneAtPopupPosition();
1554  if (lane != nullptr) {
1555  // when duplicating an unselected lane, keep all connections as they
1556  // are, otherwise recompute them
1557  if (lane->isAttributeCarrierSelected()) {
1558  myUndoList->p_begin("reset custom lane shapes");
1559  std::vector<GNELane*> lanes = myNet->retrieveLanes(true);
1560  for (auto it : lanes) {
1561  it->setAttribute(SUMO_ATTR_CUSTOMSHAPE, "", myUndoList);
1562  }
1563  myUndoList->p_end();
1564  } else {
1565  myUndoList->p_begin("reset custom lane shape");
1567  myUndoList->p_end();
1568  }
1569  }
1570  return 1;
1571 }
1572 
1573 
1574 long
1575 GNEViewNet::onCmdLaneOperation(FXObject*, FXSelector sel, void*) {
1576  // check lane operation
1577  switch (FXSELID(sel)) {
1579  return restrictLane(SVC_PEDESTRIAN);
1581  return restrictLane(SVC_BICYCLE);
1583  return restrictLane(SVC_BUS);
1585  return restrictLane(SVC_IGNORING);
1588  case MID_GNE_LANE_ADD_BIKE:
1590  case MID_GNE_LANE_ADD_BUS:
1591  return addRestrictedLane(SVC_BUS);
1599  return removeRestrictedLane(SVC_BUS);
1602  default:
1603  return 0;
1604  break;
1605  }
1606 }
1607 
1608 
1609 long
1610 GNEViewNet::onCmdOpenAdditionalDialog(FXObject*, FXSelector, void*) {
1611  // retrieve additional under cursor
1613  // check if additional can open dialog
1614  if (addtional && addtional->getTagProperty().hasDialog()) {
1615  addtional->openAdditionalDialog();
1616  }
1617  return 1;
1618 }
1619 
1620 
1621 bool
1623  GNELane* lane = getLaneAtPopupPosition();
1624  if (lane != nullptr) {
1625  // Get selected lanes
1626  std::vector<GNELane*> lanes = myNet->retrieveLanes(true); ;
1627  // Declare map of edges and lanes
1628  std::map<GNEEdge*, GNELane*> mapOfEdgesAndLanes;
1629  // Iterate over selected lanes
1630  for (auto i : lanes) {
1631  mapOfEdgesAndLanes[myNet->retrieveEdge(i->getParentEdge().getID())] = i;
1632  }
1633  // Throw warning dialog if there hare multiple lanes selected in the same edge
1634  if (mapOfEdgesAndLanes.size() != lanes.size()) {
1635  FXMessageBox::information(getApp(), MBOX_OK,
1636  "Multiple lane in the same edge selected", "%s",
1637  ("There are selected lanes that belong to the same edge.\n Only one lane per edge will be restricted for " + toString(vclass) + ".").c_str());
1638  }
1639  // If we handeln a set of lanes
1640  if (mapOfEdgesAndLanes.size() > 0) {
1641  // declare counter for number of Sidewalks
1642  int counter = 0;
1643  // iterate over selected lanes
1644  for (auto i : mapOfEdgesAndLanes) {
1645  if (i.first->hasRestrictedLane(vclass)) {
1646  counter++;
1647  }
1648  }
1649  // if all edges parent own a Sidewalk, stop function
1650  if (counter == (int)mapOfEdgesAndLanes.size()) {
1651  FXMessageBox::information(getApp(), MBOX_OK,
1652  ("Set vclass for " + toString(vclass) + " to selected lanes").c_str(), "%s",
1653  ("All lanes own already another lane in the same edge with a restriction for " + toString(vclass)).c_str());
1654  return 0;
1655  } else {
1656  WRITE_DEBUG("Opening FXMessageBox 'restrict lanes'");
1657  // Ask confirmation to user
1658  FXuint answer = FXMessageBox::question(getApp(), MBOX_YES_NO,
1659  ("Set vclass for " + toString(vclass) + " to selected lanes").c_str(), "%s",
1660  (toString(mapOfEdgesAndLanes.size() - counter) + " lanes will be restricted for " + toString(vclass) + ". continue?").c_str());
1661  if (answer != 1) { //1:yes, 2:no, 4:esc
1662  // write warning if netedit is running in testing mode
1663  if (answer == 2) {
1664  WRITE_DEBUG("Closed FXMessageBox 'restrict lanes' with 'No'");
1665  } else if (answer == 4) {
1666  WRITE_DEBUG("Closed FXMessageBox 'restrict lanes' with 'ESC'");
1667  }
1668  return 0;
1669  } else {
1670  // write warning if netedit is running in testing mode
1671  WRITE_DEBUG("Closed FXMessageBox 'restrict lanes' with 'Yes'");
1672  }
1673  }
1674  // begin undo operation
1675  myUndoList->p_begin("restrict lanes to " + toString(vclass));
1676  // iterate over selected lanes
1677  for (std::map<GNEEdge*, GNELane*>::iterator i = mapOfEdgesAndLanes.begin(); i != mapOfEdgesAndLanes.end(); i++) {
1678  // Transform lane to Sidewalk
1679  myNet->restrictLane(vclass, i->second, myUndoList);
1680  }
1681  // end undo operation
1682  myUndoList->p_end();
1683  } else {
1684  // If only have a single lane, start undo/redo operation
1685  myUndoList->p_begin("restrict lane to " + toString(vclass));
1686  // Transform lane to Sidewalk
1687  myNet->restrictLane(vclass, lane, myUndoList);
1688  // end undo operation
1689  myUndoList->p_end();
1690  }
1691  }
1692  return 1;
1693 }
1694 
1695 
1696 bool
1698  GNELane* lane = getLaneAtPopupPosition();
1699  if (lane != nullptr) {
1700  // Get selected edges
1701  std::vector<GNEEdge*> edges = myNet->retrieveEdges(true);
1702  // get selected lanes
1703  std::vector<GNELane*> lanes = myNet->retrieveLanes(true);
1704  // Declare set of edges
1705  std::set<GNEEdge*> setOfEdges;
1706  // Fill set of edges with vector of edges
1707  for (auto i : edges) {
1708  setOfEdges.insert(i);
1709  }
1710  // iterate over selected lanes
1711  for (auto it : lanes) {
1712  // Insert pointer to edge into set of edges (To avoid duplicates)
1713  setOfEdges.insert(myNet->retrieveEdge(it->getParentEdge().getID()));
1714  }
1715  // If we handeln a set of edges
1716  if (setOfEdges.size() > 0) {
1717  // declare counter for number of restrictions
1718  int counter = 0;
1719  // iterate over set of edges
1720  for (std::set<GNEEdge*>::iterator it = setOfEdges.begin(); it != setOfEdges.end(); it++) {
1721  // update counter if edge has already a restricted lane of type "vclass"
1722  if ((*it)->hasRestrictedLane(vclass)) {
1723  counter++;
1724  }
1725  }
1726  // if all lanes own a Sidewalk, stop function
1727  if (counter == (int)setOfEdges.size()) {
1728  FXMessageBox::information(getApp(), MBOX_OK,
1729  ("Add vclass for" + toString(vclass) + " to selected lanes").c_str(), "%s",
1730  ("All lanes own already another lane in the same edge with a restriction for " + toString(vclass)).c_str());
1731  return 0;
1732  } else {
1733  WRITE_DEBUG("Opening FXMessageBox 'restrict lanes'");
1734  // Ask confirmation to user
1735  FXuint answer = FXMessageBox::question(getApp(), MBOX_YES_NO,
1736  ("Add vclass for " + toString(vclass) + " to selected lanes").c_str(), "%s",
1737  (toString(setOfEdges.size() - counter) + " restrictions for " + toString(vclass) + " will be added. continue?").c_str());
1738  if (answer != 1) { //1:yes, 2:no, 4:esc
1739  // write warning if netedit is running in testing mode
1740  if (answer == 2) {
1741  WRITE_DEBUG("Closed FXMessageBox 'restrict lanes' with 'No'");
1742  } else if (answer == 4) {
1743  WRITE_DEBUG("Closed FXMessageBox 'restrict lanes' with 'ESC'");
1744  }
1745  return 0;
1746  } else {
1747  // write warning if netedit is running in testing mode
1748  WRITE_DEBUG("Closed FXMessageBox 'restrict lanes' with 'Yes'");
1749  }
1750  }
1751  // begin undo operation
1752  myUndoList->p_begin("Add restrictions for " + toString(vclass));
1753  // iterate over set of edges
1754  for (auto it : setOfEdges) {
1755  // add restricted lane (guess target)
1756  myNet->addRestrictedLane(vclass, *it, -1, myUndoList);
1757  }
1758  // end undo operation
1759  myUndoList->p_end();
1760  } else {
1761  // If only have a single lane, start undo/redo operation
1762  myUndoList->p_begin("Add vclass for " + toString(vclass));
1763  // Add restricted lane
1764  if (vclass == SVC_PEDESTRIAN) {
1765  // always add pedestrian lanes on the right
1766  myNet->addRestrictedLane(vclass, lane->getParentEdge(), 0, myUndoList);
1767  } else if (lane->getParentEdge().getLanes().size() == 1) {
1768  // guess insertion position if there is only 1 lane
1769  myNet->addRestrictedLane(vclass, lane->getParentEdge(), -1, myUndoList);
1770  } else {
1771  myNet->addRestrictedLane(vclass, lane->getParentEdge(), lane->getIndex(), myUndoList);
1772  }
1773  // end undo/redo operation
1774  myUndoList->p_end();
1775  }
1776  }
1777  return 1;
1778 }
1779 
1780 
1781 bool
1783  GNELane* lane = getLaneAtPopupPosition();
1784  if (lane != nullptr) {
1785  // Get selected edges
1786  std::vector<GNEEdge*> edges = myNet->retrieveEdges(true);
1787  // get selected lanes
1788  std::vector<GNELane*> lanes = myNet->retrieveLanes(true);
1789  // Declare set of edges
1790  std::set<GNEEdge*> setOfEdges;
1791  // Fill set of edges with vector of edges
1792  for (auto i : edges) {
1793  setOfEdges.insert(i);
1794  }
1795  // iterate over selected lanes
1796  for (auto it : lanes) {
1797  // Insert pointer to edge into set of edges (To avoid duplicates)
1798  setOfEdges.insert(myNet->retrieveEdge(it->getParentEdge().getID()));
1799  }
1800  // If we handeln a set of edges
1801  if (setOfEdges.size() > 0) {
1802  // declare counter for number of restrictions
1803  int counter = 0;
1804  // iterate over set of edges
1805  for (std::set<GNEEdge*>::iterator it = setOfEdges.begin(); it != setOfEdges.end(); it++) {
1806  // update counter if edge has already a restricted lane of type "vclass"
1807  if ((*it)->hasRestrictedLane(vclass)) {
1808  counter++;
1809  }
1810  }
1811  // if all lanes don't own a Sidewalk, stop function
1812  if (counter == 0) {
1813  FXMessageBox::information(getApp(), MBOX_OK,
1814  ("Remove vclass for " + toString(vclass) + " to selected lanes").c_str(), "%s",
1815  ("Selected lanes and edges haven't a restriction for " + toString(vclass)).c_str());
1816  return 0;
1817  } else {
1818  WRITE_DEBUG("Opening FXMessageBox 'restrict lanes'");
1819  // Ask confirmation to user
1820  FXuint answer = FXMessageBox::question(getApp(), MBOX_YES_NO,
1821  ("Remove vclass for " + toString(vclass) + " to selected lanes").c_str(), "%s",
1822  (toString(counter) + " restrictions for " + toString(vclass) + " will be removed. continue?").c_str());
1823  if (answer != 1) { //1:yes, 2:no, 4:esc
1824  // write warning if netedit is running in testing mode
1825  if (answer == 2) {
1826  WRITE_DEBUG("Closed FXMessageBox 'restrict lanes' with 'No'");
1827  } else if (answer == 4) {
1828  WRITE_DEBUG("Closed FXMessageBox 'restrict lanes' with 'ESC'");
1829  }
1830  return 0;
1831  } else {
1832  // write warning if netedit is running in testing mode
1833  WRITE_DEBUG("Closed FXMessageBox 'restrict lanes' with 'Yes'");
1834  }
1835  }
1836  // begin undo operation
1837  myUndoList->p_begin("Remove restrictions for " + toString(vclass));
1838  // iterate over set of edges
1839  for (std::set<GNEEdge*>::iterator it = setOfEdges.begin(); it != setOfEdges.end(); it++) {
1840  // add Sidewalk
1841  myNet->removeRestrictedLane(vclass, *(*it), myUndoList);
1842  }
1843  // end undo operation
1844  myUndoList->p_end();
1845  } else {
1846  // If only have a single lane, start undo/redo operation
1847  myUndoList->p_begin("Remove vclass for " + toString(vclass));
1848  // Remove Sidewalk
1850  // end undo/redo operation
1851  myUndoList->p_end();
1852  }
1853  }
1854  return 1;
1855 }
1856 
1857 
1858 void
1859 GNEViewNet::processClick(void* eventData) {
1860  FXEvent* evt = (FXEvent*)eventData;
1861  // process click
1862  destroyPopup();
1863  setFocus();
1864  myChanger->onLeftBtnPress(eventData);
1865  grab();
1866  // Check there are double click
1867  if (evt->click_count == 2) {
1868  handle(this, FXSEL(SEL_DOUBLECLICKED, 0), eventData);
1869  }
1870 }
1871 
1872 
1873 void
1875  // declare a flag for cursor move
1876  bool cursorMove = false;
1877  // check if in current mode/supermode cursor move can be shown
1882  cursorMove = true;
1883  }
1888  cursorMove = true;
1889  }
1890  }
1891  // update cursor if control key is pressed
1892  if (myKeyPressed.controlKeyPressed() && cursorMove) {
1893  setDefaultCursor(GUICursorSubSys::getCursor(SUMOCURSOR_MOVE));
1895  } else {
1898  }
1899 }
1900 
1901 
1902 long
1903 GNEViewNet::onCmdEditJunctionShape(FXObject*, FXSelector, void*) {
1904  // Obtain junction under mouse
1906  if (junction) {
1907  if (!OptionsCont::getOptions().getBool("lefthand")) {
1908  // for lefthand networks, the shape is already computed in GNELoadThread::run()
1909  // computing it here does not work because the network needs to be
1910  // mirrored before and after
1911  junction->getNBNode()->computeNodeShape(-1);
1912  } else if (junction->getNBNode()->getShape().size() == 0) {
1913  // recompute the whole network
1915  }
1916  PositionVector nodeShape = junction->getNBNode()->getShape();
1917  nodeShape.closePolygon();
1918  myEditShapes.startEditCustomShape(junction, nodeShape, true);
1919  }
1920  // destroy pop-up and set focus in view net
1921  destroyPopup();
1922  setFocus();
1923  return 1;
1924 }
1925 
1926 
1927 long
1928 GNEViewNet::onCmdResetJunctionShape(FXObject*, FXSelector, void*) {
1929  // Obtain junction under mouse
1931  if (junction) {
1932  // are, otherwise recompute them
1933  if (junction->isAttributeCarrierSelected()) {
1934  myUndoList->p_begin("reset custom junction shapes");
1935  std::vector<GNEJunction*> junctions = myNet->retrieveJunctions(true);
1936  for (auto it : junctions) {
1937  it->setAttribute(SUMO_ATTR_SHAPE, "", myUndoList);
1938  }
1939  myUndoList->p_end();
1940  } else {
1941  myUndoList->p_begin("reset custom junction shape");
1942  junction->setAttribute(SUMO_ATTR_SHAPE, "", myUndoList);
1943  myUndoList->p_end();
1944  }
1945  }
1946  // destroy pop-up and set focus in view net
1947  destroyPopup();
1948  setFocus();
1949  return 1;
1950 }
1951 
1952 
1953 long
1954 GNEViewNet::onCmdReplaceJunction(FXObject*, FXSelector, void*) {
1956  if (junction != nullptr) {
1958  update();
1959  }
1960  // destroy pop-up and set focus in view net
1961  destroyPopup();
1962  setFocus();
1963  return 1;
1964 }
1965 
1966 
1967 long
1968 GNEViewNet::onCmdSplitJunction(FXObject*, FXSelector, void*) {
1970  if (junction != nullptr) {
1971  myNet->splitJunction(junction, false, myUndoList);
1972  update();
1973  }
1974  // destroy pop-up and set focus in view net
1975  destroyPopup();
1976  setFocus();
1977  return 1;
1978 }
1979 
1980 
1981 long
1982 GNEViewNet::onCmdSplitJunctionReconnect(FXObject*, FXSelector, void*) {
1984  if (junction != nullptr) {
1985  myNet->splitJunction(junction, true, myUndoList);
1986  update();
1987  }
1988  // destroy pop-up and set focus in view net
1989  destroyPopup();
1990  setFocus();
1991  return 1;
1992 }
1993 
1994 
1995 long
1996 GNEViewNet::onCmdClearConnections(FXObject*, FXSelector, void*) {
1998  if (junction != nullptr) {
1999  // check if we're handling a selection
2000  if (junction->isAttributeCarrierSelected()) {
2001  std::vector<GNEJunction*> selectedJunction = myNet->retrieveJunctions(true);
2002  myUndoList->p_begin("clear connections of selected junctions");
2003  for (auto i : selectedJunction) {
2005  }
2006  myUndoList->p_end();
2007  } else {
2009  }
2010  update();
2011  }
2012  // destroy pop-up and set focus in view net
2013  destroyPopup();
2014  setFocus();
2015  return 1;
2016 }
2017 
2018 
2019 long
2020 GNEViewNet::onCmdResetConnections(FXObject*, FXSelector, void*) {
2022  if (junction != nullptr) {
2023  // check if we're handling a selection
2024  if (junction->isAttributeCarrierSelected()) {
2025  std::vector<GNEJunction*> selectedJunction = myNet->retrieveJunctions(true);
2026  myUndoList->p_begin("reset connections of selected junctions");
2027  for (auto i : selectedJunction) {
2029  }
2030  myUndoList->p_end();
2031  } else {
2033  }
2034  update();
2035  }
2036  // destroy pop-up and set focus in view net
2037  destroyPopup();
2038  setFocus();
2039  return 1;
2040 }
2041 
2042 
2043 long
2044 GNEViewNet::onCmdEditConnectionShape(FXObject*, FXSelector, void*) {
2045  // Obtain connection under mouse
2047  if (connection) {
2048  myEditShapes.startEditCustomShape(connection, connection->getGeometry().shape, false);
2049  }
2050  // destroy pop-up and update view Net
2051  destroyPopup();
2052  setFocus();
2053  return 1;
2054 }
2055 
2056 
2057 long
2058 GNEViewNet::onCmdEditCrossingShape(FXObject*, FXSelector, void*) {
2059  // Obtain crossing under mouse
2061  if (crossing) {
2062  // due crossings haven two shapes, check what has to be edited
2063  PositionVector shape = crossing->getNBCrossing()->customShape.size() > 0 ? crossing->getNBCrossing()->customShape : crossing->getNBCrossing()->shape;
2064  myEditShapes.startEditCustomShape(crossing, shape, false);
2065  }
2066  // destroy pop-up and update view Net
2067  destroyPopup();
2068  setFocus();
2069  return 1;
2070 }
2071 
2072 
2073 long
2074 GNEViewNet::onCmdToogleShowDemandElements(FXObject*, FXSelector sel, void*) {
2075  // update view to show demand elements
2076  update();
2077  // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
2078  if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_SHOWDEMANDELEMENTS)) {
2080  }
2081  return 1;
2082 }
2083 
2084 
2085 long
2086 GNEViewNet::onCmdToogleSelectEdges(FXObject*, FXSelector sel, void*) {
2087  // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
2088  if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_SELECTEDGES)) {
2090  }
2091  return 1;
2092 }
2093 
2094 
2095 long
2096 GNEViewNet::onCmdToogleShowConnections(FXObject*, FXSelector sel, void*) {
2097  // if show was enabled, init GNEConnections
2098  if (myNetworkViewOptions.menuCheckShowConnections->getCheck() == TRUE) {
2100  }
2101  // change flag "showLane2Lane" in myVisualizationSettings
2103  // Hide/show connections requiere recompute
2104  getNet()->requireRecompute();
2105  // Update viewnNet to show/hide conections
2106  update();
2107  // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
2108  if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_SHOWCONNECTIONS)) {
2110  }
2111  return 1;
2112 }
2113 
2114 
2115 long
2116 GNEViewNet::onCmdToogleHideConnections(FXObject*, FXSelector sel, void*) {
2117  // Update viewnNet to show/hide conections
2118  update();
2119  // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
2120  if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_HIDECONNECTIONS)) {
2122  }
2123  return 1;
2124 }
2125 
2126 
2127 long
2128 GNEViewNet::onCmdToogleExtendSelection(FXObject*, FXSelector sel, void*) {
2129  // Only update view
2130  update();
2131  // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
2132  if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_EXTENDSELECTION)) {
2134  }
2135  return 1;
2136 }
2137 
2138 
2139 long
2140 GNEViewNet::onCmdToogleChangeAllPhases(FXObject*, FXSelector sel, void*) {
2141  // Only update view
2142  update();
2143  // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
2144  if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_CHANGEALLPHASES)) {
2146  }
2147  return 1;
2148 }
2149 
2150 
2151 long
2152 GNEViewNet::onCmdToogleShowGrid(FXObject*, FXSelector sel, void*) {
2153  // show or hidde grid depending of myNetworkViewOptions.menuCheckShowGrid
2154  if (myCommonViewOptions.menuCheckShowGrid->getCheck()) {
2156  } else {
2158  }
2159  // update view to show grid
2160  update();
2161  // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
2162  if (sel == FXSEL(SEL_COMMAND, MID_GNE_COMMONVIEWOPTIONS_SHOWGRID)) {
2164  }
2165  return 1;
2166 }
2167 
2168 
2169 long
2170 GNEViewNet::onCmdToogleWarnAboutMerge(FXObject*, FXSelector sel, void*) {
2171  // Only update view
2172  update();
2173  // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
2174  if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_ASKFORMERGE)) {
2176  }
2177  return 1;
2178 }
2179 
2180 
2181 long
2182 GNEViewNet::onCmdToogleShowJunctionBubbles(FXObject*, FXSelector sel, void*) {
2183  // Only update view
2184  update();
2185  // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
2186  if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_SHOWBUBBLES)) {
2188  }
2189  return 1;
2190 }
2191 
2192 
2193 long
2194 GNEViewNet::onCmdToogleMoveElevation(FXObject*, FXSelector sel, void*) {
2195  // Only update view
2196  update();
2197  // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
2198  if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_MOVEELEVATION)) {
2200  }
2201  return 1;
2202 }
2203 
2204 
2205 long
2206 GNEViewNet::onCmdToogleChainEdges(FXObject*, FXSelector sel, void*) {
2207  // Only update view
2208  update();
2209  // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
2210  if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_CHAINEDGES)) {
2212  }
2213  return 1;
2214 }
2215 
2216 
2217 long
2218 GNEViewNet::onCmdToogleAutoOppositeEdge(FXObject*, FXSelector sel, void*) {
2219  // Only update view
2220  update();
2221  // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
2222  if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_AUTOOPPOSITEEDGES)) {
2224  }
2225  return 1;
2226 }
2227 
2228 
2229 long
2230 GNEViewNet::onCmdToogleHideNonInspecteDemandElements(FXObject*, FXSelector sel, void*) {
2231  // Only update view
2232  update();
2233  // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
2234  if (sel == FXSEL(SEL_COMMAND, MID_GNE_DEMANDVIEWOPTIONS_HIDENONINSPECTED)) {
2236  }
2237  return 1;
2238 }
2239 
2240 
2241 long
2242 GNEViewNet::onCmdToogleHideShapes(FXObject*, FXSelector sel, void*) {
2243  // Only update view
2244  update();
2245  // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
2246  if (sel == FXSEL(SEL_COMMAND, MID_GNE_DEMANDVIEWOPTIONS_HIDESHAPES)) {
2248  }
2249  return 1;
2250 }
2251 
2252 
2253 long
2254 GNEViewNet::onCmdToogleShowAllPersonPlans(FXObject*, FXSelector sel, void*) {
2255  // Only update view
2256  update();
2257  // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
2258  if (sel == FXSEL(SEL_COMMAND, MID_GNE_DEMANDVIEWOPTIONS_SHOWALLPERSONPLANS)) {
2260  }
2261  return 1;
2262 }
2263 
2264 
2265 long
2266 GNEViewNet::onCmdToogleLockPerson(FXObject*, FXSelector sel, void*) {
2267  // lock or unlock current inspected person depending of menuCheckLockPerson value
2268  if (myDemandViewOptions.menuCheckLockPerson->getCheck()) {
2269  // obtan locked person or person plan
2270  const GNEDemandElement* personOrPersonPlan = dynamic_cast<const GNEDemandElement*>(getDottedAC());
2271  if (personOrPersonPlan) {
2272  // lock person depending if casted demand element is either a person or a person plan
2273  if (personOrPersonPlan->getTagProperty().isPerson()) {
2274  myDemandViewOptions.lockPerson(personOrPersonPlan);
2275  // change menuCheckLockPerson text
2276  myDemandViewOptions.menuCheckLockPerson->setText(("unlock " + personOrPersonPlan->getID()).c_str());
2277  } else {
2278  myDemandViewOptions.lockPerson(personOrPersonPlan->getDemandElementParents().front());
2279  // change menuCheckLockPerson text
2280  myDemandViewOptions.menuCheckLockPerson->setText(("unlock " + personOrPersonPlan->getDemandElementParents().front()->getID()).c_str());
2281  }
2282  }
2283  } else {
2284  // unlock current person
2286  // change menuCheckLockPerson text
2287  myDemandViewOptions.menuCheckLockPerson->setText("lock person");
2288  }
2289  // update view
2290  update();
2291  // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
2292  if (sel == FXSEL(SEL_COMMAND, MID_GNE_DEMANDVIEWOPTIONS_LOCKPERSON)) {
2294  }
2295  return 1;
2296 }
2297 
2298 
2299 long
2300 GNEViewNet::onCmdAddSelected(FXObject*, FXSelector, void*) {
2301  // make GL current (To allow take objects in popup position)
2302  if (makeCurrent()) {
2306  // make sure that AC is selected before selecting
2307  if (ACToselect && !ACToselect->isAttributeCarrierSelected()) {
2308  ACToselect->selectAttributeCarrier();
2309  }
2310  // make non current
2311  makeNonCurrent();
2312  }
2313  return 1;
2314 }
2315 
2316 
2317 long
2318 GNEViewNet::onCmdRemoveSelected(FXObject*, FXSelector, void*) {
2319  // make GL current (To allow take objects in popup position)
2320  if (makeCurrent()) {
2324  // make sure that AC is selected before unselecting
2325  if (ACToselect && ACToselect->isAttributeCarrierSelected()) {
2326  ACToselect->unselectAttributeCarrier();
2327  }
2328  // make non current
2329  makeNonCurrent();
2330  }
2331  return 1;
2332 }
2333 
2334 // ===========================================================================
2335 // private
2336 // ===========================================================================
2337 
2338 void
2340  // first build supermode buttons
2342 
2343  // build menu checks for Common checkable buttons
2345 
2346  // build menu checks for Network checkable buttons
2348 
2349  // build menu checks for Demand checkable buttons
2351 
2352  // build menu checks of view options Common
2354 
2355  // build menu checks of view options Network
2357 
2358  // build menu checks of view options Demand
2360 }
2361 
2362 
2363 void
2365  // hide grid
2367  // hide all checkbox of view options Common
2369  // hide all checkbox of view options Network
2371  // hide all checkbox of view options Demand
2373  // disable all common edit modes
2375  // disable all network edit modes
2377  // hide all frames
2379  // In network mode, always show option "show demand elements"
2381  // enable selected controls
2382  switch (myEditModes.networkEditMode) {
2383  // common modes
2384  case GNE_NMODE_INSPECT:
2389  // show view options
2392  // show toolbar grip of view options
2394  break;
2395  case GNE_NMODE_DELETE:
2401  // show view options
2403  // show toolbar grip of view options
2405  break;
2406  case GNE_NMODE_SELECT:
2411  // show view options
2415  // show toolbar grip of view options
2417  break;
2418  // specific modes
2419  case GNE_NMODE_CREATE_EDGE:
2423  // show view options
2425  // show toolbar grip of view options
2427  break;
2428  case GNE_NMODE_MOVE:
2433  // show view options
2435  // show toolbar grip of view options
2437  break;
2438  case GNE_NMODE_CONNECT:
2443  // show view options
2445  // show toolbar grip of view options
2447  break;
2448  case GNE_NMODE_TLS:
2453  // show view options
2455  // show toolbar grip of view options
2457  break;
2458  case GNE_NMODE_ADDITIONAL:
2463  // show view options
2465  // show toolbar grip of view options
2467  break;
2468  case GNE_NMODE_CROSSING:
2473  // show view options
2474  myCommonViewOptions.menuCheckShowGrid->setCheck(false);
2475  // show toolbar grip of view options
2477  break;
2478  case GNE_NMODE_TAZ:
2483  // show view options
2484  myCommonViewOptions.menuCheckShowGrid->setCheck(false);
2485  // show toolbar grip of view options
2487  break;
2488  case GNE_NMODE_POLYGON:
2493  // show view options
2495  // show toolbar grip of view options
2497  break;
2498  case GNE_NMODE_PROHIBITION:
2503  // hide toolbar grip of view options
2505  break;
2506  default:
2507  break;
2508  }
2509  // update common Network buttons
2511  // Update Network buttons
2513  // recalc toolbar
2515  // force repaint because different modes draw different things
2516  onPaint(nullptr, 0, nullptr);
2517  // finally update view
2518  update();
2519 }
2520 
2521 
2522 void
2524  // hide grid
2526  // hide all checkbox of view options Network
2528  // hide all checkbox of view options Demand
2530  // disable all common edit modes
2532  // disable all Demand edit modes
2534  // hide all frames
2536  // enable selected controls
2537  switch (myEditModes.demandEditMode) {
2538  // common modes
2539  case GNE_DMODE_INSPECT:
2544  // show view options
2549  // show toolbar grip of view options
2551  break;
2552  case GNE_DMODE_DELETE:
2557  // show view options
2561  // show toolbar grip of view options
2563  break;
2564  case GNE_DMODE_SELECT:
2569  // show view options
2573  // show toolbar grip of view options
2575  break;
2576  case GNE_DMODE_MOVE:
2578  // show view options
2583  // show toolbar grip of view options
2585  break;
2586  // specific modes
2587  case GNE_DMODE_ROUTE:
2592  // show view options
2596  // show toolbar grip of view options
2598  break;
2599  case GNE_DMODE_VEHICLE:
2604  // show view options
2608  // show toolbar grip of view options
2610  break;
2616  // show view options
2622  break;
2623  case GNE_DMODE_STOP:
2628  // show view options
2632  // show toolbar grip of view options
2634  break;
2635  case GNE_DMODE_PERSONTYPES:
2640  // show view options
2644  // show toolbar grip of view options
2646  break;
2647  case GNE_DMODE_PERSON:
2652  // show view options
2656  // show toolbar grip of view options
2658  break;
2659  case GNE_DMODE_PERSONPLAN:
2664  // show view options
2668  // show toolbar grip of view options
2670  break;
2671  default:
2672  break;
2673  }
2674  // update common Network buttons
2676  // Update Demand buttons
2678  // recalc toolbar
2680  // force repaint because different modes draw different things
2681  onPaint(nullptr, 0, nullptr);
2682  // finally update view
2683  update();
2684 }
2685 
2686 
2687 void
2689  std::vector<GNEJunction*> junctions = myNet->retrieveJunctions(true);
2690  if (junctions.size() > 0) {
2691  std::string plural = junctions.size() == 1 ? ("") : ("s");
2692  myUndoList->p_begin("delete selected " + toString(SUMO_TAG_JUNCTION) + plural);
2693  for (auto i : junctions) {
2695  }
2696  myUndoList->p_end();
2697  }
2698 }
2699 
2700 
2701 void
2703  std::vector<GNELane*> lanes = myNet->retrieveLanes(true);
2704  if (lanes.size() > 0) {
2705  std::string plural = lanes.size() == 1 ? ("") : ("s");
2706  myUndoList->p_begin("delete selected " + toString(SUMO_TAG_LANE) + plural);
2707  for (auto i : lanes) {
2708  // when deleting multiple lanes, recompute connections
2709  myNet->deleteLane(i, myUndoList, true);
2710  }
2711  myUndoList->p_end();
2712  }
2713 }
2714 
2715 
2716 void
2718  std::vector<GNEEdge*> edges = myNet->retrieveEdges(true);
2719  if (edges.size() > 0) {
2720  std::string plural = edges.size() == 1 ? ("") : ("s");
2721  myUndoList->p_begin("delete selected " + toString(SUMO_TAG_EDGE) + plural);
2722  for (auto i : edges) {
2723  // when deleting multiple edges, recompute connections
2724  myNet->deleteEdge(i, myUndoList, true);
2725  }
2726  myUndoList->p_end();
2727  }
2728 }
2729 
2730 
2731 void
2733  std::vector<GNEAdditional*> additionals = myNet->retrieveAdditionals(true);
2734  if (additionals.size() > 0) {
2735  std::string plural = additionals.size() == 1 ? ("") : ("s");
2736  myUndoList->p_begin("delete selected additional" + plural);
2737  for (auto i : additionals) {
2738  // due there are additionals that are removed when their parent is removed, we need to check if yet exists before removing
2739  if (myNet->retrieveAdditional(i->getTagProperty().getTag(), i->getID(), false) != nullptr) {
2741  }
2742  }
2743  myUndoList->p_end();
2744  }
2745 }
2746 
2747 
2748 void
2750  std::vector<GNEDemandElement*> demandElements = myNet->retrieveDemandElements(true);
2751  if (demandElements.size() > 0) {
2752  std::string plural = demandElements.size() == 1 ? ("") : ("s");
2753  myUndoList->p_begin("delete selected demand elements" + plural);
2754  for (auto i : demandElements) {
2755  // due there are demand elements that are removed when their parent is removed, we need to check if yet exists before removing
2756  if (myNet->retrieveDemandElement(i->getTagProperty().getTag(), i->getID(), false) != nullptr) {
2758  }
2759  }
2760  myUndoList->p_end();
2761  }
2762 }
2763 
2764 
2765 void
2767  // obtain selected crossings
2768  std::vector<GNEJunction*> junctions = myNet->retrieveJunctions();
2769  std::vector<GNECrossing*> crossings;
2770  for (auto i : junctions) {
2771  for (auto j : i->getGNECrossings()) {
2772  if (j->isAttributeCarrierSelected()) {
2773  crossings.push_back(j);
2774  }
2775  }
2776  }
2777  // remove selected crossings
2778  if (crossings.size() > 0) {
2779  std::string plural = crossings.size() == 1 ? ("") : ("s");
2780  myUndoList->p_begin("delete selected " + toString(SUMO_TAG_CROSSING) + "s");
2781  for (auto i : crossings) {
2782  if (myNet->retrieveCrossing(i->getID(), false)) {
2784  }
2785  }
2786  myUndoList->p_end();
2787  }
2788 }
2789 
2790 
2791 void
2793  // obtain selected connections
2794  std::vector<GNEEdge*> edges = myNet->retrieveEdges();
2795  std::vector<GNEConnection*> connections;
2796  for (auto i : edges) {
2797  for (auto j : i->getGNEConnections()) {
2798  if (j->isAttributeCarrierSelected()) {
2799  connections.push_back(j);
2800  }
2801  }
2802  }
2803  // remove selected connections
2804  if (connections.size() > 0) {
2805  std::string plural = connections.size() == 1 ? ("") : ("s");
2806  myUndoList->p_begin("delete selected " + toString(SUMO_TAG_CONNECTION) + plural);
2807  for (auto i : connections) {
2809  }
2810  myUndoList->p_end();
2811  }
2812 }
2813 
2814 
2815 void
2817  // obtain selected shapes
2818  std::vector<GNEShape*> selectedShapes = myNet->retrieveShapes(true);
2819  // remove it
2820  if (selectedShapes.size() > 0) {
2821  std::string plural = selectedShapes.size() == 1 ? ("") : ("s");
2822  myUndoList->p_begin("delete selected shape" + plural);
2823  for (auto i : selectedShapes) {
2825  }
2826  myUndoList->p_end();
2827  }
2828 }
2829 
2830 
2831 bool
2833  const Position& newPos = moved->getNBNode()->getPosition();
2834  GNEJunction* mergeTarget = nullptr;
2835  // try to find another junction to merge with
2836  if (makeCurrent()) {
2837  Boundary selection;
2838  selection.add(newPos);
2839  selection.grow(0.1);
2840  const std::vector<GUIGlID> ids = getObjectsInBoundary(selection);
2841  GUIGlObject* object = nullptr;
2842  for (auto it_ids : ids) {
2843  if (it_ids == 0) {
2844  continue;
2845  }
2847  if (!object) {
2848  throw ProcessError("Unkown object in selection (id=" + toString(it_ids) + ").");
2849  }
2850  if ((object->getType() == GLO_JUNCTION) && (it_ids != moved->getGlID())) {
2851  mergeTarget = dynamic_cast<GNEJunction*>(object);
2852  }
2854  }
2855  }
2856  if (mergeTarget) {
2857  // optionally ask for confirmation
2859  WRITE_DEBUG("Opening FXMessageBox 'merge junctions'");
2860  // open question box
2861  FXuint answer = FXMessageBox::question(this, MBOX_YES_NO,
2862  "Confirm Junction Merger", "%s",
2863  ("Do you wish to merge junctions '" + moved->getMicrosimID() +
2864  "' and '" + mergeTarget->getMicrosimID() + "'?\n" +
2865  "('" + moved->getMicrosimID() +
2866  "' will be eliminated and its roads added to '" +
2867  mergeTarget->getMicrosimID() + "')").c_str());
2868  if (answer != 1) { //1:yes, 2:no, 4:esc
2869  // write warning if netedit is running in testing mode
2870  if (answer == 2) {
2871  WRITE_DEBUG("Closed FXMessageBox 'merge junctions' with 'No'");
2872  } else if (answer == 4) {
2873  WRITE_DEBUG("Closed FXMessageBox 'merge junctions' with 'ESC'");
2874  }
2875  return false;
2876  } else {
2877  // write warning if netedit is running in testing mode
2878  WRITE_DEBUG("Closed FXMessageBox 'merge junctions' with 'Yes'");
2879  }
2880  }
2881  // restore previous position of junction moved
2882  moved->moveGeometry(oldPos, Position(0, 0));
2883  // finish geometry moving
2884  moved->endGeometryMoving();
2885  // merge moved and targed junctions
2886  myNet->mergeJunctions(moved, mergeTarget, myUndoList);
2887  return true;
2888  } else {
2889  return false;
2890  }
2891 }
2892 
2893 
2894 void
2896  switch (myEditModes.networkEditMode) {
2897  case GNE_NMODE_INSPECT:
2898  myViewParent->getInspectorFrame()->update();
2899  break;
2900  default:
2901  break;
2902  }
2903  // update view
2904  update();
2905 }
2906 
2907 // ---------------------------------------------------------------------------
2908 // Private methods
2909 // ---------------------------------------------------------------------------
2910 
2911 void
2914  // draw first point
2916  // Push draw matrix
2917  glPushMatrix();
2918  // obtain first clicked point
2919  const Position& firstLanePoint = myViewParent->getAdditionalFrame()->getConsecutiveLaneSelector()->getSelectedLanes().front().first->getGeometry().shape.positionAtOffset(
2921  // must draw on top of other connections
2922  glTranslated(firstLanePoint.x(), firstLanePoint.y(), GLO_JUNCTION + 0.3);
2924  // draw first point
2926  GLHelper::drawText("S", Position(), .1, 1.3, RGBColor::CYAN);
2927  // pop draw matrix
2928  glPopMatrix();
2929  }
2930  // draw connections between lanes
2932  // iterate over all current selected lanes
2933  for (int i = 0; i < (int)myViewParent->getAdditionalFrame()->getConsecutiveLaneSelector()->getSelectedLanes().size() - 1; i++) {
2934  // declare position vector for shape
2935  PositionVector shape;
2936  // declare vectors for shape rotation and lenghts
2937  std::vector<double> shapeRotations, shapeLengths;
2938  // obtain GNELanes
2941  // Push draw matrix
2942  glPushMatrix();
2943  // must draw on top of other connections
2944  glTranslated(0, 0, GLO_JUNCTION + 0.2);
2945  // obtain connection shape
2946  shape = from->getParentEdge().getNBEdge()->getConnection(from->getIndex(), to->getParentEdge().getNBEdge(), to->getIndex()).shape;
2947  // set special color
2949  // Obtain lengths and shape rotations
2950  int segments = (int) shape.size() - 1;
2951  if (segments >= 0) {
2952  shapeRotations.reserve(segments);
2953  shapeLengths.reserve(segments);
2954  for (int j = 0; j < segments; j++) {
2955  const Position& f = shape[j];
2956  const Position& s = shape[j + 1];
2957  shapeLengths.push_back(f.distanceTo2D(s));
2958  shapeRotations.push_back((double) atan2((s.x() - f.x()), (f.y() - s.y())) * (double) 180.0 / (double)M_PI);
2959  }
2960  }
2961  // draw a list of lines
2962  GLHelper::drawBoxLines(shape, shapeRotations, shapeLengths, 0.2);
2963  // pop draw matrix
2964  glPopMatrix();
2965  }
2966  // draw last point
2967  glPushMatrix();
2968  // obtain last clicked point
2969  const Position& lastLanePoint = myViewParent->getAdditionalFrame()->getConsecutiveLaneSelector()->getSelectedLanes().back().first->getGeometry().shape.positionAtOffset(
2971  // must draw on top of other connections
2972  glTranslated(lastLanePoint.x(), lastLanePoint.y(), GLO_JUNCTION + 0.3);
2974  // draw last point
2975  GLHelper::drawFilledCircle((double) 1.3, 8);
2976  GLHelper::drawText("E", Position(), .1, 1.3, RGBColor::CYAN);
2977  // pop draw matrix
2978  glPopMatrix();
2979  }
2980 
2981  }
2982 }
2983 
2984 
2985 void
2987  PositionVector temporalShape;
2988  bool deleteLastCreatedPoint = false;
2989  // obtain temporal shape and delete last created point flag
2995  deleteLastCreatedPoint = myViewParent->getTAZFrame()->getDrawingShapeModul()->getDeleteLastCreatedPoint();
2996  }
2997  // check if we're in drawing mode
2998  if (temporalShape.size() > 0) {
2999  // draw blue line with the current drawed shape
3000  glPushMatrix();
3001  glLineWidth(2);
3002  glTranslated(0, 0, GLO_MAX);
3004  GLHelper::drawLine(temporalShape);
3005  glPopMatrix();
3006  // draw red line from the last point of shape to the current mouse position
3007  glPushMatrix();
3008  glLineWidth(2);
3009  glTranslated(0, 0, GLO_MAX);
3010  // draw last line depending if shift key (delete last created point) is pressed
3011  if (deleteLastCreatedPoint) {
3013  } else {
3015  }
3017  glPopMatrix();
3018  }
3019 }
3020 
3021 
3022 void
3024  // decide what to do based on mode
3025  switch (myEditModes.networkEditMode) {
3026  case GNE_NMODE_INSPECT: {
3027  // process left click in Inspector Frame
3029  // process click
3030  processClick(eventData);
3031  break;
3032  }
3033  case GNE_NMODE_DELETE: {
3034  // check that we have clicked over an non-demand element
3036  // change the selected attribute carrier if myNetworkViewOptions.mySelectEdges is enabled and clicked element is a getLaneFront()
3039  }
3040  // check if we are deleting a selection or an single attribute carrier
3042  // before delete al selected attribute carriers, check if we clicked over a geometry point
3047  } else {
3049  }
3050  } else {
3052  }
3053  } else {
3054  // process click
3055  processClick(eventData);
3056  }
3057  break;
3058  }
3059  case GNE_NMODE_SELECT:
3060  // check if a rect for selecting is being created
3061  if (myKeyPressed.shiftKeyPressed()) {
3062  // begin rectangle selection
3064  } else {
3065  // first check that under cursor there is an attribute carrier, isn't a demand element and is selectable
3067  // change the selected attribute carrier if myNetworkViewOptions.mySelectEdges is enabled and clicked element is a getLaneFront()
3070  }
3071  // Check if this GLobject type is locked
3073  // toogle netElement selection
3076  } else {
3078  }
3079  }
3080  }
3081  // process click
3082  processClick(eventData);
3083  }
3084  break;
3085  case GNE_NMODE_CREATE_EDGE: {
3086  // make sure that Control key isn't pressed
3088  // process left click in create edge frame Frame
3090  myNetworkViewOptions.menuCheckAutoOppositeEdge->getCheck() == TRUE,
3091  myNetworkViewOptions.menuCheckChainEdges->getCheck() == TRUE);
3092  }
3093  // process click
3094  processClick(eventData);
3095  break;
3096  }
3097  case GNE_NMODE_MOVE: {
3098  // allways swap lane to edges in movement mode
3101  }
3102  // check that AC under cursor isn't a demand element
3104  // check if we're moving a set of selected items
3106  // move selected ACs
3108  // update view
3109  update();
3111  // process click if there isn't movable elements (to move camera using drag an drop)
3112  processClick(eventData);
3113  }
3114  } else {
3115  // process click if there isn't movable elements (to move camera using drag an drop)
3116  processClick(eventData);
3117  }
3118  break;
3119  }
3120  case GNE_NMODE_CONNECT: {
3122  // Handle laneclick (shift key may pass connections, Control key allow conflicts)
3124  update();
3125  }
3126  // process click
3127  processClick(eventData);
3128  break;
3129  }
3130  case GNE_NMODE_TLS: {
3133  update();
3134  }
3135  // process click
3136  processClick(eventData);
3137  break;
3138  }
3139  case GNE_NMODE_ADDITIONAL: {
3140  // avoid create additionals if control key is pressed
3143  // check if we need to start select lanes
3145  // select getLaneFront() to create an additional with consecutive lanes
3147  } else if (myObjectsUnderCursor.getLaneFront()) {
3149  }
3151  // update view to show the new additional
3152  update();
3153  }
3154  }
3155  // process click
3156  processClick(eventData);
3157  break;
3158  }
3159  case GNE_NMODE_CROSSING: {
3160  // swap lanes to edges in crossingsMode
3163  }
3164  // call function addCrossing from crossing frame
3166  // process click
3167  processClick(eventData);
3168  break;
3169  }
3170  case GNE_NMODE_TAZ: {
3171  // avoid create TAZs if control key is pressed
3173  // swap laness to edges in TAZ Mode
3176  }
3177  // check if we want to create a rect for selecting edges
3179  // begin rectangle selection
3181  } else {
3182  // check if process click was scuesfully
3184  // view net must be always update
3185  update();
3186  }
3187  // process click
3188  processClick(eventData);
3189  }
3190  } else {
3191  // process click
3192  processClick(eventData);
3193  }
3194  break;
3195  }
3196  case GNE_NMODE_POLYGON: {
3197  // avoid create shapes if control key is pressed
3201  // view net must be always update
3202  update();
3203  // process click depending of the result of "process click"
3205  // process click
3206  processClick(eventData);
3207  }
3208  }
3209  } else {
3210  // process click
3211  processClick(eventData);
3212  }
3213  break;
3214  }
3215  case GNE_NMODE_PROHIBITION: {
3217  // shift key may pass connections, Control key allow conflicts.
3219  update();
3220  }
3221  // process click
3222  processClick(eventData);
3223  break;
3224  }
3225  default: {
3226  // process click
3227  processClick(eventData);
3228  }
3229  }
3230 }
3231 
3232 
3233 void
3235  // check moved items
3239  // check if we're creating a rectangle selection or we want only to select a lane
3241  // check if we're selecting all type of elements o we only want a set of edges for TAZ
3244  } else if (myEditModes.networkEditMode == GNE_NMODE_TAZ) {
3245  // process edge selection
3247  }
3248  } else if (myKeyPressed.shiftKeyPressed()) {
3249  // obtain objects under cursor
3250  if (makeCurrent()) {
3251  // update objects under cursor again
3253  makeNonCurrent();
3254  }
3255  // check if there is a lane in objects under cursor
3257  // if we clicked over an lane with shift key pressed, select or unselect it
3260  } else {
3262  }
3263  }
3264  }
3265  // finish selection
3267  } else {
3268  // finish moving of single elements
3270  }
3271 }
3272 
3273 
3274 void
3276  // change "delete last created point" depending if during movement shift key is pressed
3279  }
3280  // check what type of additional is moved
3282  // move entire selection
3285  // update selection corner of selecting area
3287  } else {
3288  // move single elements
3290  }
3291 }
3292 
3293 
3294 void
3296  // decide what to do based on mode
3297  switch (myEditModes.demandEditMode) {
3298  case GNE_DMODE_INSPECT: {
3299  // process left click in Inspector Frame
3301  // process click
3302  processClick(eventData);
3303  break;
3304  }
3305  case GNE_DMODE_DELETE: {
3306  // check that we have clicked over an demand element
3308  // check if we are deleting a selection or an single attribute carrier
3311  } else {
3313  }
3314  } else {
3315  // process click
3316  processClick(eventData);
3317  }
3318  break;
3319  }
3320  case GNE_DMODE_SELECT:
3321  // check if a rect for selecting is being created
3322  if (myKeyPressed.shiftKeyPressed()) {
3323  // begin rectangle selection
3325  } else {
3326  // check if a rect for selecting is being created
3327  if (myKeyPressed.shiftKeyPressed()) {
3328  // begin rectangle selection
3330  } else {
3331  // first check that under cursor there is an attribute carrier, is demand element and is selectable
3333  // Check if this GLobject type is locked
3335  // toogle netElement selection
3338  } else {
3340  }
3341  }
3342  }
3343  // process click
3344  processClick(eventData);
3345  }
3346  }
3347  break;
3348  case GNE_DMODE_MOVE: {
3349  // check that AC under cursor is a demand element
3352  // check if we're moving a set of selected items
3354  // move selected ACs
3356  // update view
3357  update();
3359  // process click if there isn't movable elements (to move camera using drag an drop)
3360  processClick(eventData);
3361  }
3362  } else {
3363  // process click if there isn't movable elements (to move camera using drag an drop)
3364  processClick(eventData);
3365  }
3366  break;
3367  }
3368  case GNE_DMODE_ROUTE: {
3369  // check if we clicked over a lane and Control key isn't pressed
3371  // Handle edge click
3373  }
3374  // process click
3375  processClick(eventData);
3376  break;
3377  }
3378  case GNE_DMODE_VEHICLE: {
3379  // make sure that Control key isn't pressed
3381  // Handle click
3383  }
3384  // process click
3385  processClick(eventData);
3386  break;
3387  }
3388  case GNE_DMODE_STOP: {
3389  // make sure that Control key isn't pressed
3391  // Handle click
3393  }
3394  // process click
3395  processClick(eventData);
3396  break;
3397  }
3398  case GNE_DMODE_PERSON: {
3399  // make sure that Control key isn't pressed
3401  // Handle click
3403  }
3404  // process click
3405  processClick(eventData);
3406  break;
3407  }
3408  case GNE_DMODE_PERSONPLAN: {
3409  // make sure that Control key isn't pressed
3411  // Handle click
3413  }
3414  // process click
3415  processClick(eventData);
3416  break;
3417  }
3418  default: {
3419  // process click
3420  processClick(eventData);
3421  }
3422  }
3423 }
3424 
3425 
3426 void
3428  // check moved items
3432  // check if we're creating a rectangle selection or we want only to select a lane
3435  }
3436  // finish selection
3438  } else {
3439  // finish moving of single elements
3441  }
3442 }
3443 
3444 
3445 void
3448  // update selection corner of selecting area
3450  } else {
3451  // move single elements
3453  }
3454 }
3455 
3456 /****************************************************************************/
Locate junction - button.
Definition: GUIAppEnum.h:307
DeleteOptions * getDeleteOptions() const
get delete options
GNEJunction * splitEdge(GNEEdge *edge, const Position &pos, GNEUndoList *undoList, GNEJunction *newJunction=0)
split edge at position by inserting a new junction
Definition: GNENet.cpp:752
void processMoveMouseDemand()
process move mouse function in Supermode Demand
remove inner geometry
Definition: GUIAppEnum.h:815
long onCmdResetEdgeEndpoint(FXObject *, FXSelector, void *)
change geometry endpoint
create edges in chain mode
Definition: GUIAppEnum.h:596
GNEViewParent * myViewParent
view parent
Definition: GNEViewNet.h:423
virtual void openAdditionalDialog()
open Additional Dialog
void paintGLGrid()
paints a grid
bool addRestrictedLane(SUMOVehicleClass vclass, GNEEdge &edge, int index, GNEUndoList *undoList)
add restricted lane to edge
Definition: GNENet.cpp:702
std::vector< GNEJunction * > retrieveJunctions(bool onlySelected=false)
return all junctions
Definition: GNENet.cpp:1212
bool isPersonStop() const
return true if tag correspond to a person stop element
hotkey for mode editing TLS AND Vehicle Types
Definition: GUIAppEnum.h:64
GNETAZFrame * getTAZFrame() const
get frame for GNE_NMODE_TAZ
long onCmdResetJunctionShape(FXObject *, FXSelector, void *)
reset junction shape
a tl-logic
void update(void *eventData)
update status of KeyPressed
static const RGBColor BLUE
Definition: RGBColor.h:192
void removeLastInsertedElement()
remove last added element (either a BusStop or an edge)
FXDEFMAP(GNEViewNet) GNEViewNetMap[]
double ymin() const
Returns minimum y-coordinate.
Definition: Boundary.cpp:131
void show()
show prohibition frame
std::vector< GNELane * > retrieveLanes(bool onlySelected=false)
return all lanes
Definition: GNENet.cpp:1164
GNEInspectorFrame * getInspectorFrame() const
get frame for GNE_NMODE_INSPECT
void openPolygon(bool allowUndo=true)
open polygon
Definition: GNEPoly.cpp:471
std::set< std::pair< std::string, GNEAttributeCarrier * > > getAttributeCarriersInBoundary(const Boundary &boundary, bool forceSelectEdges=false)
get AttributeCarriers in Boundary
Definition: GNEViewNet.cpp:299
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
Mode for editing crossing.
double xmax() const
Returns maximum x-coordinate.
Definition: Boundary.cpp:125
void show()
show Frame
GUICompleteSchemeStorage gSchemeStorage
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.
hot key <F4> set demand mode in NETEDIT
Definition: GUIAppEnum.h:164
GNEViewNetHelper::ObjectsUnderCursor myObjectsUnderCursor
variable use to save all pointers to objects under cursor after a click
Definition: GNEViewNet.h:368
GNEViewNetHelper::TestingMode myTestingMode
variable used to save variables related with testing mode
Definition: GNEViewNet.h:358
GNETAZ * getTAZ() const
get current TAZ
GNEEdge * retrieveEdge(const std::string &id, bool failHard=true)
get edge by id
Definition: GNENet.cpp:1020
double scale
information about a lane&#39;s width (temporary, used for a single view)
Position getPositionInView() const
Returns position of additional in view.
Definition: GNEPOI.cpp:153
long onCmdSplitJunctionReconnect(FXObject *, FXSelector, void *)
split junction into multiple junctions and reconnect them
ConnectionModifications * getConnectionModifications() const
get pointer to ConnectionModifications modul
Locate route - button.
Definition: GUIAppEnum.h:313
MFXCheckableButton * personTypeButton
chekable button for edit mode create person type
void abortOperation(bool clearSelection=true)
abort current edition operation
Definition: GNEViewNet.cpp:749
void deleteSelectedJunctions()
delete all currently selected junctions
PositionVector shape
The shape of the netElement element.
Definition: GNENetElement.h:57
move elevation instead of x,y
Definition: GUIAppEnum.h:594
void hotkeyBackSpace()
function called when user press BACKSPACE key
void hotkeyEsc()
function called when user press ESC key
default cursor
Definition: GUICursors.h:36
whether a given shape is user-defined
bool setColorScheme(const std::string &name)
set color scheme
Definition: GNEViewNet.cpp:342
void moveRectangleSelection()
move rectangle selection
GNEFrameModuls::EdgePathCreator * getEdgePathCreator() const
get EdgePathCreator modul
long onCmdToogleHideNonInspecteDemandElements(FXObject *, FXSelector, void *)
toogle hide non inspected demand elements
const RGBColor & getSelectedLaneColor() const
get selected lane color
static FXCursor * getCursor(GUICursor which)
returns a cursor previously defined in the enum GUICursor
bool restrictLane(SUMOVehicleClass vclass)
restrict lane
void smoothElevation(GNEUndoList *undoList)
smooth elevation with regard to adjoining edges
Definition: GNEEdge.cpp:1989
GNEViewNetHelper::EditModes myEditModes
variable used to save variables related with edit moves modes
Definition: GNEViewNet.h:355
static void drawBoxLines(const PositionVector &geom, const std::vector< double > &rots, const std::vector< double > &lengths, double width, int cornerDetail=0, double offset=0)
Draws thick lines.
Definition: GLHelper.cpp:182
void processLeftButtonReleaseDemand()
process left button release function in Supermode Demand
const std::string & getShapeImgFile() const
Returns the imgFile of the Shape.
Definition: Shape.h:104
long onCmdToogleHideShapes(FXObject *, FXSelector, void *)
toogle hide shapes in super mode demand
GUIGlObjectType
long onCmdDuplicateLane(FXObject *, FXSelector, void *)
duplicate selected lane
MFXCheckableButton * connectionButton
chekable button for edit mode connection
void hotkeyBackSpace()
handle backspace keypress
Definition: GNEViewNet.cpp:893
begin/end of the description of a junction
long onRightBtnPress(FXObject *, FXSelector, void *)
called when user press mouse&#39;s right button
Definition: GNEViewNet.cpp:663
Mode for editing TAZ.
begin/end of the description of a single lane
bool myAmInitialised
Internal information whether doInit() was called.
void finishEdgePathCreation()
finish edge path creation
smooth geometry
Definition: GUIAppEnum.h:817
SUMOVehicleClass
Definition of vehicle classes to differ between different lane usage and authority types...
class used to group all variables related with key pressed after certain events
long onMouseMove(FXObject *, FXSelector, void *)
called when user moves mouse
Definition: GNEViewNet.cpp:693
void update() const
Mark the entire GNEViewNet to be repainted later.
Definition: GNEViewNet.cpp:292
bool controlKeyPressed() const
check if CONTROL key was pressed during click
void removeAttributeCarrier(const GNEViewNetHelper::ObjectsUnderCursor &objectsUnderCursor, bool ignoreOptions=false)
remove attribute carrier (element)
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:1937
long onCmdToogleChainEdges(FXObject *, FXSelector, void *)
toogle chain edges
GNEViewNet()
FOX needs this.
Definition: GNEViewNet.cpp:511
GNEViewNetHelper::NetworkViewOptions myNetworkViewOptions
variable used to save variables related with view options in Network Supermode
Definition: GNEViewNet.h:391
std::vector< GUIGlID > getObjectsInBoundary(Boundary bound)
returns the ids of all objects in the given boundary
bool addAdditional(const GNEViewNetHelper::ObjectsUnderCursor &objectsUnderCursor)
add additional element
long onCmdAddSelected(FXObject *, FXSelector, void *)
select AC under cursor
FXMenuCheck * menuCheckShowAllPersonPlans
show all person plans
move cursor
Definition: GUICursors.h:39
long onCmdToogleMoveElevation(FXObject *, FXSelector, void *)
toogle move elevation
SUMORTree * myGrid
The visualization speed-up.
AddShapeResult processClick(const Position &clickedPosition, const GNEViewNetHelper::ObjectsUnderCursor &objectsUnderCursor)
process click over Viewnet
void setSupermode(Supermode supermode)
set Network edit mode
const std::vector< std::string > & getNames() const
Returns a list of stored settings names.
void hotkeyFocusFrame()
handle focus frame keypress
Definition: GNEViewNet.cpp:910
struct used to group all variables related to view options in supermode Network
AddShapeResult
enum with all possible values after try to create an shape using frame
edit junction shape
Definition: GUIAppEnum.h:866
bool isDrawing() const
return true if currently a shape is drawed
void hideDemandViewOptionsMenuChecks()
hide all options menu checks
MFXCheckableButton * createEdgeButton
chekable button for edit mode create edge
bool isDemandElement() const
return true if tag correspond to a demand element
double distanceTo2D(const Position &p2) const
returns the euclidean distance in the x-y-plane
Definition: Position.h:244
void lockPerson(const GNEDemandElement *person)
lock person
Locate stop - button.
Definition: GUIAppEnum.h:315
void straightenElevation(GNEUndoList *undoList)
interpolate z values linear between junctions
Definition: GNEEdge.cpp:1894
void show()
show Frame
virtual long onMouseMove(FXObject *, FXSelector, void *)
Locate addtional structure - button.
Definition: GUIAppEnum.h:321
bool getDeleteLastCreatedPoint()
get flag delete last created point
long onCmdToogleChangeAllPhases(FXObject *, FXSelector, void *)
toogle change all phases
const GNEDemandElement * getLockedPerson() const
get locked person
GNEVehicleTypeFrame * getVehicleTypeFrame() const
get frame for GNE_DMODE_VEHICLETYPE
void deleteDemandElement(GNEDemandElement *demandElement, GNEUndoList *undoList)
remove demand element
Definition: GNENet.cpp:638
bool isPersonPlan() const
return true if tag correspond to a person plan
Definition: GNEPOI.h:45
hotkey for mode editing connection prohibitions AND person types
Definition: GUIAppEnum.h:68
void show()
show delete frame
GNEAttributeCarrier * retrieveAttributeCarrier(const GUIGlID id, bool failHard=true)
get a single attribute carrier based on a GLID
Definition: GNENet.cpp:1285
void drawTemporalRoute() const
draw temporal route
connectio between two lanes
Stores the information about how to visualize structures.
void moveSingleElement()
move single element in Network AND Demand mode
long onCmdSplitEdge(FXObject *, FXSelector, void *)
split edge at cursor position
edit junction shape
Definition: GUIAppEnum.h:847
a connection
void setChecked(bool val)
check or uncheck this MFXCheckableButton
long onCmdToogleSelectEdges(FXObject *, FXSelector, void *)
toogle select edges
vehicle is a bicycle
void show()
show Frame
void finishMoveSelection()
finish moving selection
const double SUMO_const_laneWidth
Definition: StdDefs.h:50
reverse an edge
Definition: GUIAppEnum.h:827
split an edge
Definition: GUIAppEnum.h:823
GNEViewParent * getViewParent() const
get the net object
Definition: GNEViewNet.cpp:921
GNEFrameModuls::DrawingShape * getDrawingShapeModul() const
get drawing mode modul
double y() const
Returns the y-position.
Definition: Position.h:62
GNEPersonFrame * getPersonFrame() const
get frame for GNE_DMODE_PERSON
interpolate z values linear between junctions
Definition: GUIAppEnum.h:819
struct with the attribute Properties
GUIMainWindow * myApp
The application.
split an edge
Definition: GUIAppEnum.h:825
FXMenuCheck * menuCheckChangeAllPhases
menu check to set change all phases
void finishRectangleSelection()
finish rectangle selection
MFXCheckableButton * personButton
chekable button for edit mode create persons
Mode for editing connection prohibitions.
void updateNetworkCheckableButtons()
update network checkable buttons
static void resetTextures()
Reset textures.
void drawTemporalRoute() const
draw temporal route
smooth elevation with regard to adjoining edges
Definition: GUIAppEnum.h:821
long onCmdOpenPolygon(FXObject *, FXSelector, void *)
open closed polygon
MFXCheckableButton * trafficLightButton
chekable button for edit mode traffic light
hotkey for mode deleting things
Definition: GUIAppEnum.h:50
void abortEdgeCreation()
abort current edge creation
GNEStopFrame * getStopFrame() const
get frame for GNE_DMODE_STOP
double x() const
Returns the x-position.
Definition: Position.h:57
mode for selecting network elements
bool isShown() const
return true if modul is shown
GNEFrameModuls::EdgePathCreator * getEdgePathCreator() const
get EdgePathCreator modul
GNEPoly * editedShapePoly
polygon used for edit shapes
void reverseEdge(GNEEdge *edge, GNEUndoList *undoList)
reverse edge
Definition: GNENet.cpp:838
GNEAdditional * getAdditionalAtPopupPosition()
try to retrieve a additional at popup position
void processClick(const Position &clickedPosition, GNEViewNetHelper::ObjectsUnderCursor &objectsUnderCursor, bool oppositeEdge, bool chainEdge)
handle processClick and set the relative colouring
void smooth(GNEUndoList *undoList)
make geometry smooth
Definition: GNEEdge.cpp:1977
static void drawText(const std::string &text, const Position &pos, const double layer, const double size, const RGBColor &col=RGBColor::BLACK, const double angle=0, int align=0, double width=-1)
Definition: GLHelper.cpp:668
bool selectEdges() const
check if select edges checkbox is enabled
void deleteShape(GNEShape *shape, GNEUndoList *undoList)
remove shape
Definition: GNENet.cpp:616
hotkey for mode editing crossing AND routes
Definition: GUIAppEnum.h:62
void processMoveMouseNetwork()
process move mouse function in Supermode Network
static const RGBColor ORANGE
Definition: RGBColor.h:196
mode for moving demand elements
T MAX2(T a, T b)
Definition: StdDefs.h:80
void deleteConnection(GNEConnection *connection, GNEUndoList *undoList)
remove connection
Definition: GNENet.cpp:584
transform lane to bikelane
Definition: GUIAppEnum.h:905
std::vector< GNEEdge * > processEdgeRectangleSelection()
process rectangle Selection (only limited to Edges)
void resetJunctionConnections(GNEJunction *junction, GNEUndoList *undoList)
reset junction&#39;s connections
Definition: GNENet.cpp:2033
TAZCurrent * getTAZCurrentModul() const
get Current TAZ modul
FXMenuCheck * menuCheckWarnAboutMerge
menu check to we should warn about merging junctions
A NBNetBuilder extended by visualisation and editing capabilities.
Definition: GNENet.h:78
This lane is powered by an underlying GNEEdge and basically knows how to draw itself.
Definition: GNELane.h:46
PositionVector shape
The crossing&#39;s shape.
Definition: NBNode.h:140
void editJunction(GNEJunction *junction)
edits the traffic light for the given junction
long onCmdToogleShowConnections(FXObject *, FXSelector, void *)
toogle show connections
bool stopConsecutiveLaneSelector()
stop selection of consecutive lanes
turn junction into multiple junctions and reconnect them heuristically
Definition: GUIAppEnum.h:845
void p_begin(const std::string &description)
Begin undo command sub-group. This begins a new group of commands that are treated as a single comman...
Definition: GNEUndoList.cpp:73
long onCmdToogleLockPerson(FXObject *, FXSelector, void *)
toogle lock person in super mode demand
long onCmdStraightenEdgesElevation(FXObject *, FXSelector, void *)
interpolate z values linear between junctions
virtual long onKeyRelease(FXObject *o, FXSelector sel, void *data)
mode for selecting demand elements
void buildNetworkViewOptionsMenuChecks()
build menu checks
long onKeyPress(FXObject *o, FXSelector sel, void *data)
called when user press a key
Definition: GNEViewNet.cpp:711
begin/end of the description of a Point of interest
hotkey for mode editing additionals AND stops
Definition: GUIAppEnum.h:46
void processEdgeSelection(const std::vector< GNEEdge *> &edges)
process selection of edges in view net
int getVertexIndex(Position pos, bool createIfNoExist, bool snapToGrid)
return index of a vertex of shape, or of a new vertex if position is over an shape&#39;s edge ...
Definition: GNEEdge.cpp:313
GNEAttributeCarrier * getAttributeCarrierFront() const
get front attribute carrier (or a pointer to nullptr if there isn&#39;t)
long onCmdEditConnectionShape(FXObject *, FXSelector, void *)
edit connection shape
GNEProhibitionFrame * getProhibitionFrame() const
get frame for GNE_NMODE_PROHIBITION
double getHeight() const
Returns the image height of the POI.
Remove from selected items - Menu Etry.
Definition: GUIAppEnum.h:397
GNEPersonTypeFrame * getPersonTypeFrame() const
get frame for GNE_DMODE_PERSONTYPE
GUIDialog_ViewSettings * myVisualizationChanger
Visualization changer.
long onCmdRemoveSelected(FXObject *, FXSelector, void *)
unselect AC under cursor
void beginMoveSelection(GNEAttributeCarrier *originAC)
begin move selection
void show()
show delete frame
FXMenuBar * modeOptions
The application menu bar for mode options (show connections, select edges...)
long onCmdResetConnections(FXObject *, FXSelector, void *)
reset junction connections
const std::vector< std::pair< GNELane *, double > > & getSelectedLanes() const
get current selected lanes
void updateControls()
update control contents after undo/redo or recompute
static void drawFilledCircle(double width, int steps=8)
Draws a filled circle around (0,0)
Definition: GLHelper.cpp:348
Transform POI to POILane, and viceversa.
Definition: GUIAppEnum.h:891
turn junction into geometry node
Definition: GUIAppEnum.h:841
void deleteSelectedShapes()
delete all currently selected shapes
FXMenuCheck * menuCheckShowGrid
menu check to show grid button
close opened polygon
Definition: GUIAppEnum.h:877
#define UNUSED_PARAMETER(x)
Definition: StdDefs.h:32
GNEPolygonFrame * getPolygonFrame() const
get frame for GNE_NMODE_POLYGON
void editEndpoint(Position pos, GNEUndoList *undoList)
makes pos the new geometry endpoint at the appropriate end, or remove current existent endpoint ...
Definition: GNEEdge.cpp:645
A class that stores a 2D geometrical boundary.
Definition: Boundary.h:42
long onCmdSetMode(FXObject *, FXSelector sel, void *)
called when user press a mode button (Network or demand)
virtual void selectAttributeCarrier(bool changeFlag=true)=0
void hideNetworkViewOptionsMenuChecks()
hide all options menu checks
bool isChangesPending() const
return true if there is changes to save
void closePolygon(bool allowUndo=true)
close polygon
Definition: GNEPoly.cpp:493
GNEViewNetHelper::SelectingArea mySelectingArea
variable used to save variables related with selecting areas
Definition: GNEViewNet.h:417
void disableNetworkCheckableButtons()
hide all options menu checks
MFXCheckableButton * deleteButton
chekable button for edit mode delete
FXMenuBar * modes
The application menu bar (for select, inspect...)
#define WRITE_WARNING(msg)
Definition: MsgHandler.h:239
mode for editing tls
A single child window which contains a view of the simulation area.
Definition: GNEViewParent.h:72
bool mergeJunctions(GNEJunction *moved, const Position &oldPos)
try to merge moved junction with another junction in that spot return true if merging did take place ...
void updateDemandCheckableButtons()
update Demand checkable buttons
Mode for editing stops.
mode for moving network elements
DemandEditMode demandEditMode
the current Demand edit mode
GNETLSEditorFrame * getTLSEditorFrame() const
get frame for GNE_NMODE_TLS
static OptionsCont & getOptions()
Retrieves the options.
Definition: OptionsCont.cpp:58
const std::string & getShapeType() const
Returns the (abstract) type of the Shape.
Definition: Shape.h:76
void show()
show Frame
GNEViewNetHelper::KeyPressed myKeyPressed
variable used to save key status after certain events
Definition: GNEViewNet.h:365
MFXCheckableButton * crossingButton
chekable button for edit mode crossing
OverlappedInspection * getOverlappedInspection() const
get OverlappedInspection modul
bool beginMoveSingleElementNetworkMode()
begin move single element in Network mode
const GNEViewNetHelper::CommonViewOptions & getCommonViewOptions() const
get Common view options
Definition: GNEViewNet.cpp:405
GNEPOI * getPOIFront() const
get front POI (or a pointer to nullptr if there isn&#39;t)
void hideCommonViewOptionsMenuChecks()
hide all options menu checks
MFXCheckableButton * routeButton
chekable button for edit mode create routes
bool changeAllPhases() const
change all phases
Definition: GNEViewNet.cpp:500
void handleEdgeClick(GNEEdge *clickedEdge)
handle edge click
GNEViewNetHelper::MoveMultipleElementValues myMoveMultipleElementValues
variable used to save variables related with movement of multiple elements
Definition: GNEViewNet.h:403
void buildDemandViewOptionsMenuChecks()
build menu checks
bool restrictLane(SUMOVehicleClass vclass, GNELane *lane, GNEUndoList *undoList)
transform lane to restricted lane
Definition: GNENet.cpp:672
void drawRectangleSelection(const RGBColor &color) const
draw rectangle selection
MFXCheckableButton * shapeButton
chekable button for edit mode shape
void updateNetworkModeSpecificControls()
updates Network mode specific controls
GNEAdditionalFrame * getAdditionalFrame() const
get frame for GNE_NMODE_ADDITIONAL
GNEAdditional * retrieveAdditional(SumoXMLTag type, const std::string &id, bool hardFail=true) const
Returns the named additional.
Definition: GNENet.cpp:2133
Mode for editing vehicles.
NBEdge * getNBEdge() const
returns the internal NBEdge
Definition: GNEEdge.cpp:625
int getCircleResolution() const
function to calculate circle resolution for all circles drawn in drawGL(...) functions ...
void setNetworkEditMode(NetworkEditMode networkMode, bool force=false)
set Network edit mode
FXMenuCheck * menuCheckShowDemandElements
menu check to show Demand Elements
long onCmdToogleShowAllPersonPlans(FXObject *, FXSelector, void *)
toogle show all person plans in super mode demand
void stopEditCustomShape()
edit edit shape
void buildEditModeControls()
create edit mode buttons and elements
FXMenuCheck * menuCheckHideConnections
menu check to hide connections in connect mode
GNEViewNetHelper::DemandCheckableButtons myDemandCheckableButtons
variable used to save checkable buttons for Supermode Demand
Definition: GNEViewNet.h:381
GUIGlID getObjectAtPosition(Position pos)
returns the id of the object at position using GL_SELECT
remove bikelane
Definition: GUIAppEnum.h:921
GNEUndoList * getUndoList() const
get the undoList object
Definition: GNEViewNet.cpp:933
int getIndex() const
returns the index of the lane
Definition: GNELane.cpp:733
void processLeftButtonReleaseNetwork()
process left button release function in Supermode Network
mode for inspecting network elements
void buildCommonViewOptionsMenuChecks()
build menu checks
long onLeftBtnPress(FXObject *, FXSelector, void *)
Definition: GNEViewNet.cpp:617
long onRightBtnRelease(FXObject *, FXSelector, void *)
called when user releases mouse&#39;s right button
Definition: GNEViewNet.cpp:678
long onCmdSimplifyShape(FXObject *, FXSelector, void *)
simply shape of current polygon
Mode for editing additionals.
static const RGBColor GREEN
Definition: RGBColor.h:191
void computeNodeShape(double mismatchThreshold)
Compute the junction shape for this node.
Definition: NBNode.cpp:991
bool getShapeRelativePath() const
Returns the relativePath of the Shape.
Definition: Shape.h:111
Locate polygons - button.
Definition: GUIAppEnum.h:325
FXMenuCheck * menuCheckMoveElevation
menu check to apply movement to elevation
hotkey for mode connecting lanes
Definition: GUIAppEnum.h:48
bool showLockIcon() const
check if lock icon should be visible
Definition: GNEViewNet.cpp:951
virtual long onPaint(FXObject *, FXSelector, void *)
GNEAdditionalFrame::SelectorLaneParents * getConsecutiveLaneSelector() const
getConsecutive Lane Selector
int addColor(const T &color, const double threshold, const std::string &name="")
LockGLObjectTypes * getLockGLObjectTypes() const
get selected items Modul
FXMenuCheck * menuCheckAutoOppositeEdge
menu check to create auto create opposite edge
add bikelane
Definition: GUIAppEnum.h:913
Mode for editing vehicle types.
GUIGlObjectType getType() const
Returns the type of the object as coded in GUIGlObjectType.
GNEFrameModuls::DrawingShape * getDrawingShapeModul() const
get drawing mode editor
std::string name
The name of this setting.
void deleteSelectedConnections()
delete all currently selected connections
bool removeRestrictedLane(SUMOVehicleClass vclass, GNEEdge &edge, GNEUndoList *undoList)
remove restricted lane
Definition: GNENet.cpp:738
FXMenuCheck * menuCheckHideNonInspectedDemandElements
Hide non inspected demand elements.
void setCurrentScheme(const std::string &)
Sets the named scheme as the current.
std::vector< GNEDemandElement * > retrieveDemandElements(bool onlySelected=false) const
return all demand elements
Definition: GNENet.cpp:2278
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
Definition: ToString.h:48
virtual void setStatusBarText(const std::string &)
Definition: GUIMainWindow.h:77
void deleteSelectedCrossings()
delete all currently selected crossings
SumoXMLTag getTag() const
get Tag vinculated with this attribute Property
MFXCheckableButton * vehicleButton
chekable button for edit mode create vehicles
void deleteAdditional(GNEAdditional *additional, GNEUndoList *undoList)
remove additional
Definition: GNENet.cpp:625
static void setColor(const RGBColor &c)
Sets the gl-color to this value.
Definition: GLHelper.cpp:616
long onCmdCancel(FXObject *, FXSelector, void *)
Called when the user presses the Cancel-button.
This object is responsible for drawing a shape and for supplying a a popup menu. Messages are routete...
Definition: GNECrossing.h:45
GNEEdge & getParentEdge()
Returns underlying parent edge.
Definition: GNELane.cpp:1292
void processClick(void *eventData)
Auxiliar function used by onLeftBtnPress(...)
void handleProhibitionClick(const GNEViewNetHelper::ObjectsUnderCursor &objectsUnderCursor)
handle prohibitions and set the relative colouring
virtual long onKeyPress(FXObject *o, FXSelector sel, void *data)
keyboard functions
~GNEViewNet()
destructor
Definition: GNEViewNet.cpp:212
void buildDemandCheckableButtons()
build checkable buttons
GNEEdge * getEdgeAtPopupPosition()
try to retrieve an edge at popup position
void deleteLane(GNELane *lane, GNEUndoList *undoList, bool recomputeConnections)
removes lane
Definition: GNENet.cpp:546
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
Definition: GNELane.cpp:815
void updateCommonCheckableButtons()
update Common checkable buttons
GNEJunction * getJunctionFront() const
get front junction (or a pointer to nullptr if there isn&#39;t)
bool startDrawing
whether we have started rectangle-selection
transform lane to busLane
Definition: GUIAppEnum.h:907
GNEDemandElement * retrieveDemandElement(SumoXMLTag type, const std::string &id, bool hardFail=true) const
Returns the named demand element.
Definition: GNENet.cpp:2266
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:39
void p_end()
End undo command sub-group. If the sub-group is still empty, it will be deleted; otherwise, the sub-group will be added as a new command into parent group. A matching begin() must have been called previously.
Definition: GNEUndoList.cpp:80
RGBColor selectionColor
basic selection color
bool processDemandSupermodeClick(const Position &clickedPosition, GNEViewNetHelper::ObjectsUnderCursor &objectsUnderCursor)
process click over Viewnet in Supermode Demand
FXMenuCheck * menuCheckChainEdges
menu check to the endpoint for a created edge should be set as the new source
GNEPOI * getPOIAtPopupPosition()
try to retrieve a POILane at popup position
A list of positions.
Supermode currentSupermode
the current supermode
long onCmdReplaceJunction(FXObject *, FXSelector, void *)
replace node by geometry
long onCmdClearConnections(FXObject *, FXSelector, void *)
clear junction connections
void abortPersonPlanCreation()
abort person plan creation
GNEFrameAttributesModuls::AttributesEditor * getAttributesEditor() const
get AttributesEditor
virtual GUIGLObjectPopupMenu * getPopUpMenu(GUIMainWindow &app, GUISUMOAbstractView &parent)=0
Returns an own popup-menu.
FXMenuCheck * menuCheckSelectEdges
menu check to select only edges
void drawTemporalDrawShape() const
draw temporal polygon shape in Polygon Mode
GNEEdge * getOppositeEdge() const
get opposite edge
Definition: GNEEdge.cpp:511
long onCmdToogleHideConnections(FXObject *, FXSelector, void *)
toogle hide connections
void buildSuperModeButtons()
build checkable buttons
bool isPerson() const
return true if tag correspond to a person element
static GUIGlObjectStorage gIDStorage
A single static instance of this class.
const RGBColor & getShapeColor() const
Returns the color of the Shape.
Definition: Shape.h:83
Boundary getCenteringBoundary() const
Returns the boundary to which the view shall be centered in order to show the object.
Definition: GNEPOI.cpp:159
long onCmdToogleAutoOppositeEdge(FXObject *, FXSelector, void *)
toogle autoOpposite edge
mode for creating new edges
reset junction shape
Definition: GUIAppEnum.h:849
virtual bool isAttributeCarrierSelected() const =0
check if attribute carrier is selected
void drawTemporalRoute() const
draw temporal route
ToolbarsGrip & getToolbarsGrip()
get ToolbarsGrip
bool processNetworkSupermodeClick(const Position &clickedPosition, GNEViewNetHelper::ObjectsUnderCursor &objectsUnderCursor)
process click over Viewnet in Supermode Network
bool addPOI(const std::string &id, const std::string &type, const RGBColor &color, const Position &pos, bool geo, const std::string &lane, double posOverLane, double posLat, double layer, double angle, const std::string &imgFile, bool relativePath, double width, double height, bool ignorePruning=false)
Builds a POI using the given values and adds it to the container.
Definition: GNENet.cpp:241
GUIVisualizationSettings & get(const std::string &name)
Returns the named scheme.
GNEApplicationWindow * getGNEAppWindows() const
get GNE Application Windows
GNEVehicleFrame * getVehicleFrame() const
get frame for GNE_DMODE_VEHICLE
long onCmdSaveChanges(FXObject *, FXSelector, void *)
Locate vehicle - button.
Definition: GUIAppEnum.h:311
bool showJunctionAsBubbles() const
return true if junction must be showed as bubbles
Definition: GNEViewNet.cpp:506
bool isMovingSelection() const
check if currently there is element being moved
long onCmdCancelModifications(FXObject *, FXSelector, void *)
Called when the user presses the Cancel-button discards any connection modifications.
const std::vector< GNELane * > & getLanes() const
returns a reference to the lane vector
Definition: GNEEdge.cpp:840
bool removeRestrictedLane(SUMOVehicleClass vclass)
remove restricted lane
void setDottedAC(const GNEAttributeCarrier *AC)
set attributeCarrier under cursor
Definition: GNEViewNet.cpp:945
long onCmdSplitEdgeBidi(FXObject *, FXSelector, void *)
split edge at cursor position
bool autoSelectNodes()
whether to autoselect nodes or to lanes
Definition: GNEViewNet.cpp:488
Mode for editing Polygons.
static const RGBColor MAGENTA
Definition: RGBColor.h:195
T MIN2(T a, T b)
Definition: StdDefs.h:74
double xmin() const
Returns minimum x-coordinate.
Definition: Boundary.cpp:119
hotkey for mode moving element
Definition: GUIAppEnum.h:56
void initGNEConnections()
initialize GNEConnections
Definition: GNENet.cpp:3024
GNELane * getLaneFront() const
get front lane (or a pointer to nullptr if there isn&#39;t)
virtual bool onRightBtnRelease(void *data)
called when user releases right button
turn junction into multiple junctions
Definition: GUIAppEnum.h:843
void updateObjectUnderCursor(const std::vector< GUIGlObject *> &GUIGlObjects, GNEPoly *editedPolyShape)
update objects under cursor (Called only in onLeftBtnPress(...) function)
void updateCursor()
update cursor after every click/key press/release
PersonPlanCreator * getPersonPlanCreator() const
get PersonPlanCreator modul
edge: the shape in xml-definition
void openObjectDialog()
Definition: GNEViewNet.cpp:358
GNEEdge * getEdgeFront() const
get front edge (or a pointer to nullptr if there isn&#39;t)
void createCrossingHotkey()
create crossing (used when user press ENTER key in Crossing mode)
GNESelectorFrame * getSelectorFrame() const
get frame for GNE_NMODE_SELECT
Boundary & grow(double by)
extends the boundary by the given amount
Definition: Boundary.cpp:301
Locate edge - button.
Definition: GUIAppEnum.h:309
const GNEViewNetHelper::KeyPressed & getKeyPressed() const
get Key Pressed modul
Definition: GNEViewNet.cpp:423
GNEPersonPlanFrame * getPersonPlanFrame() const
get frame for GNE_DMODE_PERSONFRAME
virtual const std::string & getMicrosimID() const
Returns the id of the object as known to microsim.
void deleteCrossing(GNECrossing *crossing, GNEUndoList *undoList)
remove crossing
Definition: GNENet.cpp:599
long onCmdSetSupermode(FXObject *, FXSelector sel, void *)
const std::string getID() const
function to support debugging
remove busLane
Definition: GUIAppEnum.h:923
show junctions as bubbles
Definition: GUIAppEnum.h:592
void deleteGeometryPoint(const Position &pos, bool allowUndo=true)
delete the geometry point closest to the given pos
Definition: GNEPoly.cpp:406
const NetElementGeometry & getGeometry() const
static void drawLine(const Position &beg, double rot, double visLength)
Draws a thin line.
Definition: GLHelper.cpp:274
void show()
show Frame
mode for deleting network elements
#define WRITE_DEBUG(msg)
Definition: MsgHandler.h:246
void focusUpperElement()
focus upper element of frame
Definition: GNEFrame.cpp:102
hide non-inspected demand element
Definition: GUIAppEnum.h:600
long onCmdEditEdgeEndpoint(FXObject *, FXSelector, void *)
change geometry endpoint
std::vector< GNEShape * > retrieveShapes(SumoXMLTag shapeTag, bool onlySelected=false)
return shape by type shapes
Definition: GNENet.cpp:1225
long onCmdCancel(FXObject *, FXSelector, void *)
Called when the user presses the Cancel-button discards any prohibition modifications.
GNECreateEdgeFrame * getCreateEdgeFrame() const
get frame for GNE_NMODE_CREATEEDGE
FXMenuCheck * menuCheckExtendSelection
menu check to extend to edge nodes
void p_abort()
reverts and discards ALL active command groups
Definition: GNEUndoList.cpp:94
GUIPerspectiveChanger * myChanger
The perspective changer.
long onCmdResetLaneCustomShape(FXObject *, FXSelector, void *)
reset custom shapes of selected lanes
hotkey for mode inspecting object attributes
Definition: GUIAppEnum.h:54
bool myUseToolTips
use tool tips
GNEConnection * getConnectionAtPopupPosition()
try to retrieve a connection at popup position
Definition: GNEViewNet.cpp:978
long onCmdToogleShowGrid(FXObject *, FXSelector, void *)
toogle show grid
virtual void onLeftBtnPress(void *data)
mouse functions
GUIGLObjectPopupMenu * myPopup
The current popup-menu.
ask before merging junctions
Definition: GUIAppEnum.h:590
void selectAttributeCarrier(bool changeFlag=true)
select attribute carrier using GUIGlobalSelection
double getShapeLayer() const
Returns the layer of the Shape.
Definition: Shape.h:90
void show()
show Frame
void destroyPopup()
destoys the popup
double getWidth() const
Returns the image width of the POI.
const GNEViewNetHelper::NetworkViewOptions & getNetworkViewOptions() const
get network view options
Definition: GNEViewNet.cpp:411
const PositionVector & getTemporalShape() const
get Temporal shape
void doInit()
called after some features are already initialized
Definition: GNEViewNet.cpp:216
add busLane
Definition: GUIAppEnum.h:915
begin/end of the description of an edge
void startDrawing()
start drawing
long onCmdSplitJunction(FXObject *, FXSelector, void *)
split junction into multiple junctions
void unselectAttributeCarrier(bool changeFlag=true)
unselect attribute carrier using GUIGlobalSelection
bool overlappedInspectionShown() const
check if overlappedInspection modul is shown
void setSelectionScaling(double selectionScale)
set selection scaling
Definition: GNEViewNet.cpp:494
void processLeftButtonPressDemand(void *eventData)
process left button press function in Supermode Demand
const PositionVector & getShape() const
retrieve the junction shape
Definition: NBNode.cpp:2143
long onCmdClosePolygon(FXObject *, FXSelector, void *)
close opened polygon
Mode for editing routes.
void removeLastAddedElement()
remove last added element
transform lane to sidewalk
Definition: GUIAppEnum.h:903
void replaceJunctionByGeometry(GNEJunction *junction, GNEUndoList *undoList)
replace the selected junction by geometry node(s) and merge the edges
Definition: GNENet.cpp:1891
A road/street connecting two junctions (netedit-version)
Definition: GNEEdge.h:50
bool shiftKeyPressed() const
check if SHIFT key was pressed during click
void duplicateLane(GNELane *lane, GNEUndoList *undoList, bool recomputeConnections)
duplicates lane
Definition: GNENet.cpp:656
GNEViewNetHelper::CommonCheckableButtons myCommonCheckableButtons
variable used to save checkable buttons for common supermodes
Definition: GNEViewNet.h:375
long onKeyRelease(FXObject *o, FXSelector sel, void *data)
called when user release a key
Definition: GNEViewNet.cpp:729
FXbool makeCurrent()
A reimplementation due to some internal reasons.
const std::vector< GNEDemandElement * > & getDemandElementParents() const
return vector of demand elements that have as Parent this edge (For example, Calibrators) ...
void startEditCustomShape(GNENetElement *element, const PositionVector &shape, bool fill)
start edit custom shape
long onCmdToogleShowJunctionBubbles(FXObject *, FXSelector, void *)
toogle show junction bubbles
void setTAZ(GNETAZ *editedTAZ)
set current TAZ
void beginRectangleSelection()
begin rectangle selection
Connection getConnection(int fromLane, const NBEdge *to, int toLane) const
Returns the specified connection This method goes through "myConnections" and returns the specified o...
Definition: NBEdge.cpp:1141
virtual long onLeftBtnRelease(FXObject *, FXSelector, void *)
vehicle is a bus
Mode for editing person plan.
GNEJunction * getJunctionAtPopupPosition()
try to retrieve a junction at popup position
Definition: GNEViewNet.cpp:957
change default geometry endpoints
Definition: GUIAppEnum.h:811
void handleLaneClick(const GNEViewNetHelper::ObjectsUnderCursor &objectsUnderCursor)
either sets the current lane or toggles the connection of the
long onCmdSmoothEdgesElevation(FXObject *, FXSelector, void *)
smooth elevation with regard to adjoining edges
GNECrossing * retrieveCrossing(const std::string &id, bool failHard=true) const
get Crossing by id
Definition: GNENet.cpp:1115
hotkey for mode adding edges
Definition: GUIAppEnum.h:52
static const RGBColor YELLOW
Definition: RGBColor.h:193
void disableCommonCheckableButtons()
hide all options menu checks
struct used to group all variables related with edit shapes of NetElements
bool checkSavedPosition(const Position &clickedPosition) const
check if given position is near to saved position
static const RGBColor RED
named colors
Definition: RGBColor.h:190
reset junction&#39;s connections
Definition: GUIAppEnum.h:839
long onCmdSaveModifications(FXObject *, FXSelector, void *)
Called when the user presses the OK-Button saves any connection modifications.
double selectionScale
the current selection scaling in NETEDIT (temporary)
double m2p(double meter) const
meter-to-pixels conversion method
void buildSelectionACPopupEntry(GUIGLObjectPopupMenu *ret, GNEAttributeCarrier *AC)
Builds an entry which allows to (de)select the object.
Definition: GNEViewNet.cpp:331
virtual void show()
show Frame
Definition: GNEFrame.cpp:108
Locate TLS - button.
Definition: GUIAppEnum.h:319
static const RGBColor CYAN
Definition: RGBColor.h:194
Set a vertex of polygon as first verte.
Definition: GUIAppEnum.h:881
GUIGlObject * getNetObject() const
Returns the network object.
bool beginMoveSingleElementDemandMode()
begin move single element in Demand mode
void deleteEdge(GNEEdge *edge, GNEUndoList *undoList, bool recomputeConnections)
removes edge
Definition: GNENet.cpp:429
bool addSelectedLane(GNELane *lane, const Position &clickedPosition)
return true if lane can be selected as consecutive lane
GUIVisualizationSettings * myVisualizationSettings
visualization settings
hotkey for mode create vehicles
Definition: GUIAppEnum.h:66
MFXCheckableButton * TAZButton
chekable button for edit mode TAZ
void simplifyShape(bool allowUndo=true)
replace the current shape with a rectangle
Definition: GNEPoly.cpp:557
long onCmdDeleteGeometryPoint(FXObject *, FXSelector, void *)
delete the closes geometry point
void show()
show Frame
std::vector< GNEEdge * > retrieveEdges(bool onlySelected=false)
return all edges
Definition: GNENet.cpp:1151
GNEViewNetHelper::NetworkCheckableButtons myNetworkCheckableButtons
variable used to save checkable buttons for Supermode Network
Definition: GNEViewNet.h:378
PositionVector customShape
optional customShape for this crossing
Definition: NBNode.h:154
#define M_PI
Definition: odrSpiral.cpp:40
Position myPopupPosition
The current popup-menu position.
FXMenuCheck * menuCheckShowConnections
menu check to show connections
An Element which don&#39;t belongs to GNENet but has influency in the simulation.
Definition: GNEAdditional.h:47
std::vector< GNEAdditional * > retrieveAdditionals(bool onlySelected=false) const
return all additionals
Definition: GNENet.cpp:2145
GNEConnectorFrame * getConnectorFrame() const
get frame for GNE_NMODE_CONNECT
const GNEViewNetHelper::DemandViewOptions & getDemandViewOptions() const
get demand view options
Definition: GNEViewNet.cpp:417
MFXCheckableButton * vehicleTypeButton
chekable button for edit mode create vehicle type
void clearCurrentSelection() const
clear current selection with possibility of undo/redo
bool addPerson(const GNEViewNetHelper::ObjectsUnderCursor &objectsUnderCursor)
add vehicle element
const GNEAttributeCarrier * getDottedAC() const
get AttributeCarrier under cursor
Definition: GNEViewNet.cpp:939
bool contains(const std::string &name) const
Returns the information whether a setting with the given name is stored.
void show()
show Frame
FXMenuCheck * menuCheckShowJunctionBubble
menu check to show connection as buuble in "Move" mode.
add reverse edge
Definition: GUIAppEnum.h:829
MFXCheckableButton * additionalButton
chekable button for edit mode additional
bool deleteOnlyGeometryPoints() const
check if only delete geometry points checkbox is enabled
GNEViewNetHelper::CommonViewOptions myCommonViewOptions
variable used to save variables related with common view options
Definition: GNEViewNet.h:388
GNEViewNetHelper::VehicleTypeOptions myVehicleTypeOptions
variable used to save variables related with vehicle type options
Definition: GNEViewNet.h:413
long onCmdOK(FXObject *, FXSelector, void *)
long onCmdReverseEdge(FXObject *, FXSelector, void *)
reverse edge
simplify polygon geometry
Definition: GUIAppEnum.h:875
MFXCheckableButton * moveButton
chekable button for edit mode move
Demanding mode (Routes, Vehicles etc..)
MFXCheckableButton * stopButton
chekable button for edit mode create stops
GNEViewNetHelper::EditShapes myEditShapes
struct for grouping all variables related with edit shapes
Definition: GNEViewNet.h:420
int doPaintGL(int mode, const Boundary &bound)
do paintGL
Definition: GNEViewNet.cpp:530
void moveGeometry(const Position &oldPos, const Position &offset)
change the position of the element geometry without saving in undoList
hotkey for mode selecting objects
Definition: GUIAppEnum.h:60
long onCmdOpenAdditionalDialog(FXObject *, FXSelector, void *)
open additional dialog
The popup menu of a globject.
an edge
TAZSaveChanges * getTAZSaveChangesModul() const
get TAZ Save Changes modul
void updateDemandModeSpecificControls()
updates Demand mode specific controls
GNEViewNetHelper::VehicleOptions myVehicleOptions
variable used to save variables related with vehicle options
Definition: GNEViewNet.h:410
MFXCheckableButton * personPlanButton
chekable button for edit mode create person plans
open additional dialog (used in netedit)
Definition: GUIAppEnum.h:379
duplicate a lane
Definition: GUIAppEnum.h:899
reset default geometry endpoints
Definition: GUIAppEnum.h:813
GNECrossingFrame * getCrossingFrame() const
get frame for GNE_NMODE_CROSSING
bool addStop(const GNEViewNetHelper::ObjectsUnderCursor &objectsUnderCursor, bool shiftPressed)
add Stop element
bool addPersonPlan(const GNEViewNetHelper::ObjectsUnderCursor &objectsUnderCursor)
add vehicle element
void deleteSelectedAdditionals()
delete all currently selected additionals
void clearJunctionConnections(GNEJunction *junction, GNEUndoList *undoList)
clear junction&#39;s connections
Definition: GNENet.cpp:2021
void computeAndUpdate(OptionsCont &oc, bool volatileOptions)
recompute the network and update lane geometries
Definition: GNENet.cpp:3037
crossing between edges for pedestrians
bool IsObjectTypeLocked(const GUIGlObjectType type) const
check if an object is locked
bool addVehicle(const GNEViewNetHelper::ObjectsUnderCursor &objectsUnderCursor)
add vehicle element
void deleteJunction(GNEJunction *junction, GNEUndoList *undoList)
removes junction and all incident edges
Definition: GNENet.cpp:384
std::string getCurrentScheme() const
Returns the name of the currently chosen scheme.
GNECrossing * getCrossingAtPopupPosition()
try to retrieve a crossing at popup position
Definition: GNEViewNet.cpp:999
bool showGrid
Information whether a grid shall be shown.
mode for inspecting demand elements
long onCmdSmoothEdges(FXObject *, FXSelector, void *)
smooth geometry
void drawTestingElements(GUIMainWindow *mainWindow)
draw testing element
void drawDecals()
Draws the stored decals.
FXComboBox * getColoringSchemesCombo()
return combobox with the current coloring schemes (standard, fastest standard, real world...
GNEDeleteFrame * getDeleteFrame() const
get frame for GNE_NMODE_DELETE
void show()
show inspector frame
struct used to group all variables related with Supermodes
void processRectangleSelection()
process rectangle Selection
GNENet * getNet() const
get the net object
Definition: GNEViewNet.cpp:927
GNEViewNetHelper::MoveSingleElementValues myMoveSingleElementValues
Definition: GNEViewNet.h:400
const Position & getPosition() const
Definition: NBNode.h:251
hotkey for mode creating polygons
Definition: GUIAppEnum.h:58
mode for connecting lanes
Mode for editing person types.
GNEConnection * getConnectionFront() const
get front connection (or a pointer to nullptr if there isn&#39;t)
GUIGlID getGlID() const
Returns the numerical id of the object.
void swapLane2Edge()
swap lane to edge
long onCmdToogleShowDemandElements(FXObject *, FXSelector, void *)
long onCmdEditCrossingShape(FXObject *, FXSelector, void *)
edit crossing shape
GNEEdge * addReversedEdge(GNEEdge *edge, GNEUndoList *undoList)
add reversed edge
Definition: GNENet.cpp:851
void setStatusBarText(const std::string &text)
set staturBar text
Definition: GNEViewNet.cpp:482
bool isSelectingLanes() const
return true if modul is selecting lane
bool showLane2Lane
Information whether lane-to-lane arrows shall be drawn.
void finishMoveSingleElement()
finish moving single elements in Network AND Demand mode
double distanceTo(const Position &p2) const
returns the euclidean distance in 3 dimension
Definition: Position.h:234
hotkey for mode editing TAZ
Definition: GUIAppEnum.h:70
void abortDrawing()
abort drawing
void hideAllFrames()
hide all frames
const TagProperties & getTagProperty() const
get Tag Property assigned to this object
NetworkEditMode networkEditMode
the current Network edit mode
void startConsecutiveLaneSelector(GNELane *lane, const Position &clickedPosition)
start selection of consecutive lanes
Position getPositionInformation() const
Returns the cursor&#39;s x/y position within the network.
GUIVisualizationColorSettings colorSettings
color settings
void buildViewToolBars(GUIGlChildWindow &)
builds the view toolbars
Definition: GNEViewNet.cpp:220
edit junction shape
Definition: GUIAppEnum.h:857
virtual void unselectAttributeCarrier(bool changeFlag=true)=0
unselect attribute carrier using GUIGlobalSelection
FXMenuCheck * menuCheckHideShapes
Hide shapes (Polygons and POIs)
automatically create opposite edge
Definition: GUIAppEnum.h:598
NBNode::Crossing * getNBCrossing() const
get referente to NBode::Crossing
Definition: GNECrossing.cpp:94
const GNEAttributeCarrier * myDottedAC
current AttributeCarrier that is drawn using with a dotted contour note: it&#39;s constant because is edi...
Definition: GNEViewNet.h:437
open closed polygon
Definition: GUIAppEnum.h:879
empty max
void buildColorRainbow(const GUIVisualizationSettings &s, GUIColorScheme &scheme, int active, GUIGlObjectType objectType, bool hide=false, double hideThreshold=0.)
recalibrate color scheme according to the current value range
Definition: GNEViewNet.cpp:435
void unblockObject(GUIGlID id)
Marks an object as unblocked.
GNEPoly * getPolyFront() const
get front Poly (or a pointer to nullptr if there isn&#39;t)
long onCmdLaneOperation(FXObject *, FXSelector sel, void *)
add/remove/restrict lane
struct used to group all variables related to view options in all supermodes
void abortEdgePathCreation()
abort edge path creation
long onCmdStraightenEdges(FXObject *, FXSelector, void *)
makes selected edges straight
GNEViewNetHelper::DemandViewOptions myDemandViewOptions
variable used to save variables related with view options in Demand Supermode
Definition: GNEViewNet.h:394
GNERouteFrame * getRouteFrame() const
get frame for GNE_DMODE_ROUTE
virtual long onRightBtnPress(FXObject *, FXSelector, void *)
long onCmdSetFirstGeometryPoint(FXObject *, FXSelector, void *)
set as first geometry point the closes geometry point
void add(double x, double y, double z=0)
Makes the boundary include the given coordinate.
Definition: Boundary.cpp:79
std::vector< GUIGlObject * > getGUIGlObjectsUnderCursor()
returns the GUIGlObject under the cursor using GL_SELECT (including overlapped objects) ...
Add to selected items - menu entry.
Definition: GUIAppEnum.h:395
MFXCheckableButton * prohibitionButton
checkable button for edit mode polygon
GUIGlID getObjectUnderCursor()
returns the id of the front object under the cursor using GL_SELECT
GUIGlObjectType getGlTypeFront() const
get front GUI GL object type (or a pointer to nullptr if there isn&#39;t)
GNELane * getLaneAtPopupPosition()
try to retrieve a lane at popup position
void mergeJunctions(GNEJunction *moved, GNEJunction *target, GNEUndoList *undoList)
merge the given junctions edges between the given junctions will be deleted
Definition: GNENet.cpp:886
void drawLaneCandidates() const
draw functions
Locate poi - button.
Definition: GUIAppEnum.h:323
bool drawForSelecting
whether drawing is performed for the purpose of selecting objects
mode for deleting demand elements
const GNEViewNetHelper::EditModes & getEditModes() const
get edit modes
Definition: GNEViewNet.cpp:399
double ymax() const
Returns maximum y-coordinate.
Definition: Boundary.cpp:137
long onCmdTransformPOI(FXObject *, FXSelector, void *)
Transform POI to POILane, and viceversa.
void hotkeyDel()
handle del keypress
Definition: GNEViewNet.cpp:812
long onCmdAddReversedEdge(FXObject *, FXSelector, void *)
add reversed edge
GUIGlObject * getObjectBlocking(GUIGlID id)
Returns the object from the container locking it.
bool forceDrawForSelecting
flag to force draw to selecting (see drawForSelecting)
void disableDemandCheckableButtons()
hide all options menu checks
bool hasDialog() const
return true if tag correspond to an element that can be edited using a dialog
void saveEditedShape()
save edited shape
double nearest_offset_to_point2D(const Position &p, bool perpendicular=true) const
return the nearest offest to point 2D
Network mode (Edges, junctions, etc..)
hot key <F3> set network mode in NETEDIT
Definition: GUIAppEnum.h:162
void closePolygon()
ensures that the last position equals the first
NBNode * getNBNode() const
Return net build node.
void finishPersonPlanCreation()
finish person plan creation
const std::vector< GNEAttributeCarrier * > & getEditedACs() const
get current edited ACs
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
Definition: GNEEdge.cpp:940
C++ TraCI client API implementation.
void processLeftButtonPressNetwork(void *eventData)
mouse process functions
Position positionAtOffset(double pos, double lateralOffset=0) const
Returns the position at the given length.
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:119
GNENet * myNet
Pointer to current net. (We are not responsible for deletion)
Definition: GNEViewNet.h:426
void hotkeyEnter()
handle enter keypress
Definition: GNEViewNet.cpp:839
bool selectingUsingRectangle
whether we have started rectangle-selection
void resetEndpoint(const Position &pos, GNEUndoList *undoList)
restores the endpoint to the junction position at the appropriate end
Definition: GNEEdge.cpp:689
void deleteSelectedLanes()
delete all currently selected lanes
void addCrossing(const GNEViewNetHelper::ObjectsUnderCursor &objectsUnderCursor)
add Crossing element
long onCmdToogleWarnAboutMerge(FXObject *, FXSelector, void *)
toogle warn for merge
Mode for editing person.
long onCmdEditJunctionShape(FXObject *, FXSelector, void *)
edit junction shape
void changeFirstGeometryPoint(int oldIndex, bool allowUndo=true)
change first geometry point
Definition: GNEPoly.cpp:515
static FXIcon * getIcon(GUIIcon which)
returns a icon previously defined in the enum GUIIcon
long onLeftBtnRelease(FXObject *, FXSelector, void *)
called when user releases mouse&#39;s left button
Definition: GNEViewNet.cpp:643
void setDeleteLastCreatedPoint(bool value)
enable or disable delete last created point
MFXCheckableButton * inspectButton
chekable button for edit mode inspect
Position getSplitPos(const Position &clickPos)
Definition: GNEEdge.cpp:631
void buildCommonCheckableButtons()
build checkable buttons
const GNEViewNetHelper::EditShapes & getEditShapes() const
get Edit Shape modul
Definition: GNEViewNet.cpp:429
void abortConsecutiveLaneSelector()
abort selection of consecutive lanes
vehicles ignoring classes
void splitEdgesBidi(GNEEdge *edge, GNEEdge *oppositeEdge, const Position &pos, GNEUndoList *undoList)
split all edges at position by inserting one new junction
Definition: GNENet.cpp:826
void requireRecompute()
inform the net about the need for recomputation
Definition: GNENet.cpp:1520
void setDemandEditMode(DemandEditMode demandMode, bool force=false)
set Demand edit mode
void deleteSelectedDemandElements()
delete all currently selected demand elements
bool isAttributeCarrierSelected() const
check if attribute carrier is selected
struct used to group all variables related to view options in supermode Demand
void buildNetworkCheckableButtons()
build checkable buttons
void hotkeyEnter()
function called when user press ENTER key
long onCmdToogleExtendSelection(FXObject *, FXSelector, void *)
toogle extend selection
double getShapeNaviDegree() const
Returns the angle of the Shape in navigational degrees.
Definition: Shape.h:97
transform lane to greenVerge
Definition: GUIAppEnum.h:909
void deleteSelectedEdges()
delete all currently selected edges
int getVertexIndex(Position pos, bool createIfNoExist, bool snapToGrid)
return index of a vertex of shape, or of a new vertex if position is over an shape&#39;s edge ...
Definition: GNEPoly.cpp:385
clear junction&#39;s connections
Definition: GUIAppEnum.h:837
GNEUndoList * myUndoList
a reference to the undolist maintained in the application
Definition: GNEViewNet.h:432
virtual long onRightBtnRelease(FXObject *, FXSelector, void *)
An Element which don&#39;t belongs to GNENet but has influency in the simulation.
bool addRestrictedLane(SUMOVehicleClass vclass)
add restricted lane
void stopDrawing()
stop drawing and check if shape can be created
FXPopup * getLocatorPopup()
@ brief return a pointer to locator popup
void endGeometryMoving(bool extendToNeighbors=true)
begin movement (used when user click over edge to start a movement, to avoid problems with problems w...
const Position & getPopupPosition() const
get position of current popup
FXMenuCheck * menuCheckLockPerson
Lock Person.
GNEFrame * myCurrentFrame
the current frame
Definition: GNEViewNet.h:429
MFXCheckableButton * selectButton
chekable button for edit mode select
a junction
void removeSelectedAttributeCarriers()
remove selected attribute carriers (element)
GNEPoly * getPolygonAtPopupPosition()
try to retrieve a polygon at popup position
bool processClick(const Position &clickedPosition, const GNEViewNetHelper::ObjectsUnderCursor &objectsUnderCursor)
process click over Viewnet