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-2020 German Aerospace Center (DLR) and others.
4 // This program and the accompanying materials are made available under the
5 // terms of the Eclipse Public License 2.0 which is available at
6 // https://www.eclipse.org/legal/epl-2.0/
7 // This Source Code may also be made available under the following Secondary
8 // Licenses when the conditions for such availability set forth in the Eclipse
9 // Public License 2.0 are satisfied: GNU General Public License, version 2
10 // or later which is available at
11 // https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html
12 // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later
13 /****************************************************************************/
19 // A view on the network being edited (adapted from GUIViewTraffic)
20 /****************************************************************************/
21 #include <netbuild/NBEdgeCont.h>
50 #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
78  // Modes
80  FXMAPFUNC(SEL_COMMAND, MID_HOTKEY_M_MODES_MOVE, GNEViewNet::onCmdSetMode),
81  FXMAPFUNC(SEL_COMMAND, MID_HOTKEY_D_MODES_DELETE, GNEViewNet::onCmdSetMode),
83  FXMAPFUNC(SEL_COMMAND, MID_HOTKEY_S_MODES_SELECT, GNEViewNet::onCmdSetMode),
92  // Network view options
106  // Demand view options
113  // Data view options
117  // Select elements
118  FXMAPFUNC(SEL_COMMAND, MID_ADDSELECT, GNEViewNet::onCmdAddSelected),
119  FXMAPFUNC(SEL_COMMAND, MID_REMOVESELECT, GNEViewNet::onCmdRemoveSelected),
120  // Junctions
130  // Connections
132  // Crossings
134  // Edges
135  FXMAPFUNC(SEL_COMMAND, MID_GNE_EDGE_SPLIT, GNEViewNet::onCmdSplitEdge),
137  FXMAPFUNC(SEL_COMMAND, MID_GNE_EDGE_REVERSE, GNEViewNet::onCmdReverseEdge),
142  FXMAPFUNC(SEL_COMMAND, MID_GNE_EDGE_SMOOTH, GNEViewNet::onCmdSmoothEdges),
146  // Lanes
154  FXMAPFUNC(SEL_COMMAND, MID_GNE_LANE_ADD_BIKE, GNEViewNet::onCmdLaneOperation),
155  FXMAPFUNC(SEL_COMMAND, MID_GNE_LANE_ADD_BUS, GNEViewNet::onCmdLaneOperation),
161  FXMAPFUNC(SEL_COMMAND, MID_REACHABILITY, GNEViewNet::onCmdLaneReachability),
162  // Additionals
164  // Polygons
166  FXMAPFUNC(SEL_COMMAND, MID_GNE_POLYGON_CLOSE, GNEViewNet::onCmdClosePolygon),
167  FXMAPFUNC(SEL_COMMAND, MID_GNE_POLYGON_OPEN, GNEViewNet::onCmdOpenPolygon),
170  // POIs
171  FXMAPFUNC(SEL_COMMAND, MID_GNE_POI_TRANSFORM, GNEViewNet::onCmdTransformPOI),
172  // IntervalBar
179 };
180 
181 // Object implementation
182 FXIMPLEMENT(GNEViewNet, GUISUMOAbstractView, GNEViewNetMap, ARRAYNUMBER(GNEViewNetMap))
183 
184 // ===========================================================================
185 // member method definitions
186 // ===========================================================================
187 
188 GNEViewNet::GNEViewNet(FXComposite* tmpParent, FXComposite* actualParent, GUIMainWindow& app,
189  GNEViewParent* viewParent, GNENet* net, GNEUndoList* undoList,
190  FXGLVisual* glVis, FXGLCanvas* share) :
191  GUISUMOAbstractView(tmpParent, app, viewParent, net->getGrid(), glVis, share),
192  myEditModes(this),
193  myTestingMode(this),
194  myObjectsUnderCursor(this),
195  myCommonCheckableButtons(this),
196  myNetworkCheckableButtons(this),
197  myDemandCheckableButtons(this),
198  myDataCheckableButtons(this),
199  myNetworkViewOptions(this),
200  myDemandViewOptions(this),
201  myDataViewOptions(this),
202  myIntervalBar(this),
203  myMoveSingleElementValues(this),
204  myMoveMultipleElementValues(this),
205  myVehicleOptions(this),
206  myVehicleTypeOptions(this),
207  mySaveElements(this),
208  mySelectingArea(this),
209  myEditNetworkElementShapes(this),
210  myViewParent(viewParent),
211  myNet(net),
212  myCurrentFrame(nullptr),
213  myUndoList(undoList),
214  myFrontAttributeCarrier(nullptr) {
215  // view must be the final member of actualParent
216  reparent(actualParent);
217  // Build edit modes
218  buildEditModeControls();
219  // Mark undo list
220  myUndoList->mark();
221  // set this net in Net
222  myNet->setViewNet(this);
223  // set drag delay
224  ((GUIDanielPerspectiveChanger*)myChanger)->setDragDelay(100000000); // 100 milliseconds
225  // Reset textures
227  // init testing mode
228  myTestingMode.initTestingMode();
229 }
230 
231 
233 
234 
235 void
237 
238 
239 void
241  // build coloring tools
242  {
243  for (auto it_names : gSchemeStorage.getNames()) {
244  v->getColoringSchemesCombo()->appendItem(it_names.c_str());
245  if (it_names == myVisualizationSettings->name) {
246  v->getColoringSchemesCombo()->setCurrentItem(v->getColoringSchemesCombo()->getNumItems() - 1);
247  }
248  }
249  v->getColoringSchemesCombo()->setNumVisible(MAX2(5, (int)gSchemeStorage.getNames().size() + 1));
250  }
251  // for junctions
252  new FXButton(v->getLocatorPopup(),
253  "\tLocate Junctions\tLocate a junction within the network. (Shift+J)",
255  ICON_ABOVE_TEXT | FRAME_THICK | FRAME_RAISED);
256  // for edges
257  new FXButton(v->getLocatorPopup(),
258  "\tLocate Edges\tLocate an edge within the network. (Shift+E)",
260  ICON_ABOVE_TEXT | FRAME_THICK | FRAME_RAISED);
261 
262  // for vehicles
263  new FXButton(v->getLocatorPopup(),
264  "\tLocate Vehicles\tLocate a vehicle within the network. (Shift+V)",
266  ICON_ABOVE_TEXT | FRAME_THICK | FRAME_RAISED);
267 
268  // for person
269  new FXButton(v->getLocatorPopup(),
270  "\tLocate Persons\tLocate a person within the network. (Shift+P)",
272  ICON_ABOVE_TEXT | FRAME_THICK | FRAME_RAISED);
273 
274  // for routes
275  new FXButton(v->getLocatorPopup(),
276  "\tLocate Route\tLocate a route within the network. (Shift+R)",
278  ICON_ABOVE_TEXT | FRAME_THICK | FRAME_RAISED);
279 
280  // for routes
281  new FXButton(v->getLocatorPopup(),
282  "\tLocate Stops\tLocate a stop within the network. (Shift+S)",
284  ICON_ABOVE_TEXT | FRAME_THICK | FRAME_RAISED);
285 
286  // for persons (currently unused)
287  /*
288  new FXButton(v->getLocatorPopup(),
289  "\tLocate Vehicle\tLocate a person within the network.",
290  GUIIconSubSys::getIcon(GUIIcon::LOCATEPERSON), &v, MID_LOCATEPERSON,
291  ICON_ABOVE_TEXT | FRAME_THICK | FRAME_RAISED);
292  */
293 
294  // for tls
295  new FXButton(v->getLocatorPopup(),
296  "\tLocate TLS\tLocate a tls within the network. (Shift+T)",
298  ICON_ABOVE_TEXT | FRAME_THICK | FRAME_RAISED);
299  // for additional stuff
300  new FXButton(v->getLocatorPopup(),
301  "\tLocate Additional\tLocate an additional structure within the network. (Shift+A)",
303  ICON_ABOVE_TEXT | FRAME_THICK | FRAME_RAISED);
304  // for pois
305  new FXButton(v->getLocatorPopup(),
306  "\tLocate PoI\tLocate a PoI within the network. (Shift+O)",
308  ICON_ABOVE_TEXT | FRAME_THICK | FRAME_RAISED);
309  // for polygons
310  new FXButton(v->getLocatorPopup(),
311  "\tLocate Polygon\tLocate a Polygon within the network. (Shift+L)",
313  ICON_ABOVE_TEXT | FRAME_THICK | FRAME_RAISED);
314 }
315 
316 
317 void
319  // this call is only used for breakpoints (to check when view is updated)
320  GUISUMOAbstractView::update();
321 }
322 
323 
324 void
327 }
328 
329 
330 std::set<std::pair<std::string, GNEAttributeCarrier*> >
331 GNEViewNet::getAttributeCarriersInBoundary(const Boundary& boundary, bool forceSelectEdges) {
332  // 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)
333  // Note: a map cannot be used because there is different ACs with the same ID (example: Additionals)
334  std::set<std::pair<std::string, GNEAttributeCarrier*> > result;
335  // firstm make OpenGL context current prior to performing OpenGL commands
336  if (makeCurrent()) {
337  // obtain GUIGLIds of all objects in the given boundary (disabling drawForRectangleSelection)
338  std::vector<GUIGlID> GLIds = getObjectsInBoundary(boundary, false);
339  // finish make OpenGL context current
340  makeNonCurrent();
341  // iterate over GUIGlIDs
342  for (const auto& GLId : GLIds) {
343  // avoid to select Net (i = 0)
344  if (GLId != 0) {
345  GNEAttributeCarrier* retrievedAC = myNet->retrieveAttributeCarrier(GLId);
346  // in the case of a Lane, we need to change the retrieved lane to their the parent if myNetworkViewOptions.mySelectEdges is enabled
347  if ((retrievedAC->getTagProperty().getTag() == SUMO_TAG_LANE) && (myNetworkViewOptions.selectEdges() || forceSelectEdges)) {
348  retrievedAC = dynamic_cast<GNELane*>(retrievedAC)->getParentEdge();
349  }
350  // make sure that AttributeCarrier can be selected
352  result.insert(std::make_pair(retrievedAC->getID(), retrievedAC));
353  }
354  }
355  }
356  }
357  return result;
358 }
359 
360 
363  return myObjectsUnderCursor;
364 }
365 
366 
367 void
369  if (AC->isAttributeCarrierSelected()) {
371  } else {
373  }
374  new FXMenuSeparator(ret);
375 }
376 
377 
378 bool
379 GNEViewNet::setColorScheme(const std::string& name) {
380  if (!gSchemeStorage.contains(name)) {
381  return false;
382  }
383  if (myVisualizationChanger != nullptr) {
384  if (myVisualizationChanger->getCurrentScheme() != name) {
386  }
387  }
388  myVisualizationSettings = &gSchemeStorage.get(name.c_str());
389  updateViewNet();
390  return true;
391 }
392 
393 
394 void
396  // reimplemented from GUISUMOAbstractView due OverlappedInspection
397  ungrab();
398  // make network current
399  if (isEnabled() && myAmInitialised && makeCurrent()) {
400  // fill objects under cursor
402  // get GUIGLObject front
404  // we need to check if we're inspecting a overlapping element
407  myInspectedAttributeCarriers.size() > 0) {
408  GlObject = dynamic_cast<GUIGlObject*>(myInspectedAttributeCarriers.front());
409  }
410  // if GlObject is null, use net
411  if (GlObject == nullptr) {
412  GlObject = myNet;
413  }
414  // check if open popup menu can be opened
415  if (GlObject != nullptr) {
416  // get popup menu
417  myPopup = GlObject->getPopUpMenu(*myApp, *this);
418  // create popup
419  int x, y;
420  FXuint b;
421  myApp->getCursorPosition(x, y, b);
422  myPopup->setX(x + myApp->getX());
423  myPopup->setY(y + myApp->getY());
424  myPopup->create();
425  myPopup->show();
427  // call onRightBtnRelease
428  myChanger->onRightBtnRelease(nullptr);
429  // set focus in viewNet
430  setFocus();
431  }
432  // make network non current
433  makeNonCurrent();
434  }
435 }
436 
437 
438 void
440  // first check if we have to save gui settings in a file (only used for testing purposes)
442  if (oc.getString("gui-testing.setting-output").size() > 0) {
443  try {
444  // open output device
445  OutputDevice& output = OutputDevice::getDevice(oc.getString("gui-testing.setting-output"));
446  // save view settings
448  myVisualizationSettings->save(output);
449  // save viewport (zoom, X, Y and Z)
450  output.openTag(SUMO_TAG_VIEWPORT);
455  output.closeTag();
456  output.closeTag();
457  // close output device
458  output.close();
459  } catch (...) {
460  WRITE_ERROR("GUI-Settings cannot be saved in " + oc.getString("gui-testing.setting-output"));
461  }
462  }
463 }
464 
465 
468  return myEditModes;
469 }
470 
471 
474  return myTestingMode;
475 }
476 
477 
480  return myNetworkViewOptions;
481 }
482 
483 
486  return myDemandViewOptions;
487 }
488 
489 
492  return myDataViewOptions;
493 }
494 
495 
499 }
500 
501 
505 }
506 
507 
508 void
510  bool hide, double hideThreshold) {
511  assert(!scheme.isFixed());
512  UNUSED_PARAMETER(s);
513  double minValue = std::numeric_limits<double>::infinity();
514  double maxValue = -std::numeric_limits<double>::infinity();
515  // retrieve range
516  if (objectType == GLO_LANE) {
517  // XXX (see #3409) multi-colors are not currently handled. this is a quick hack
518  if (active == 9) {
519  active = 8; // segment height, fall back to start height
520  } else if (active == 11) {
521  active = 10; // segment incline, fall back to total incline
522  }
523  for (GNELane* lane : myNet->retrieveLanes()) {
524  const double val = lane->getColorValue(s, active);
525  if (val == s.MISSING_DATA) {
526  continue;
527  }
528  minValue = MIN2(minValue, val);
529  maxValue = MAX2(maxValue, val);
530  }
531  } else if (objectType == GLO_JUNCTION) {
532  if (active == 3) {
533  for (GNEJunction* junction : myNet->retrieveJunctions()) {
534  minValue = MIN2(minValue, junction->getPositionInView().z());
535  maxValue = MAX2(maxValue, junction->getPositionInView().z());
536  }
537  }
538  }
540  scheme.clear();
541  // add threshold for every distinct value
542  std::set<SVCPermissions> codes;
543  for (GNELane* lane : myNet->retrieveLanes()) {
544  codes.insert(lane->getParentEdge()->getNBEdge()->getPermissions(lane->getIndex()));
545  }
546  int step = MAX2(1, 360 / (int)codes.size());
547  int hue = 0;
548  for (SVCPermissions p : codes) {
549  scheme.addColor(RGBColor::fromHSV(hue, 1, 1), p);
550  hue = (hue + step) % 360;
551  }
552  return;
553  }
554  if (minValue != std::numeric_limits<double>::infinity()) {
555  scheme.clear();
556  // add new thresholds
557  if (hide) {
558  const double rawRange = maxValue - minValue;
559  minValue = MAX2(hideThreshold + MIN2(1.0, rawRange / 100.0), minValue);
560  scheme.addColor(RGBColor(204, 204, 204), hideThreshold);
561  }
562  double range = maxValue - minValue;
563  scheme.addColor(RGBColor::RED, (minValue));
564  scheme.addColor(RGBColor::ORANGE, (minValue + range * 1 / 6.0));
565  scheme.addColor(RGBColor::YELLOW, (minValue + range * 2 / 6.0));
566  scheme.addColor(RGBColor::GREEN, (minValue + range * 3 / 6.0));
567  scheme.addColor(RGBColor::CYAN, (minValue + range * 4 / 6.0));
568  scheme.addColor(RGBColor::BLUE, (minValue + range * 5 / 6.0));
569  scheme.addColor(RGBColor::MAGENTA, (maxValue));
570  }
571 }
572 
573 
574 void
575 GNEViewNet::setStatusBarText(const std::string& text) {
576  myApp->setStatusBarText(text);
577 }
578 
579 
580 bool
583 }
584 
585 
586 void
587 GNEViewNet::setSelectorFrameScale(double selectionScale) {
589 }
590 
591 
592 bool
595 }
596 
597 
598 bool
601 }
602 
603 
604 bool
605 GNEViewNet::mergeJunctions(GNEJunction* movedJunction, GNEJunction* targetJunction) {
606  if (movedJunction && targetJunction && (movedJunction != targetJunction)) {
607  // optionally ask for confirmation
609  WRITE_DEBUG("Opening FXMessageBox 'merge junctions'");
610  // open question box
611  FXuint answer = FXMessageBox::question(this, MBOX_YES_NO,
612  "Confirm Junction Merger", "%s",
613  ("Do you wish to merge junctions '" + movedJunction->getMicrosimID() +
614  "' and '" + targetJunction->getMicrosimID() + "'?\n" +
615  "('" + movedJunction->getMicrosimID() +
616  "' will be eliminated and its roads added to '" +
617  targetJunction->getMicrosimID() + "')").c_str());
618  if (answer != 1) { //1:yes, 2:no, 4:esc
619  // write warning if netedit is running in testing mode
620  if (answer == 2) {
621  WRITE_DEBUG("Closed FXMessageBox 'merge junctions' with 'No'");
622  } else if (answer == 4) {
623  WRITE_DEBUG("Closed FXMessageBox 'merge junctions' with 'ESC'");
624  }
625  return false;
626  } else {
627  // write warning if netedit is running in testing mode
628  WRITE_DEBUG("Closed FXMessageBox 'merge junctions' with 'Yes'");
629  }
630  }
631  // merge moved and targed junctions
632  myNet->mergeJunctions(movedJunction, targetJunction, myUndoList);
633  return true;
634  } else {
635  return false;
636  }
637 }
638 
639 
641  myEditModes(this),
642  myTestingMode(this),
643  myObjectsUnderCursor(this),
644  myCommonCheckableButtons(this),
645  myNetworkCheckableButtons(this),
646  myDemandCheckableButtons(this),
647  myDataCheckableButtons(this),
648  myNetworkViewOptions(this),
649  myDemandViewOptions(this),
650  myDataViewOptions(this),
651  myIntervalBar(this),
652  myMoveSingleElementValues(this),
653  myMoveMultipleElementValues(this),
654  myVehicleOptions(this),
655  myVehicleTypeOptions(this),
656  mySaveElements(this),
657  mySelectingArea(this),
658  myEditNetworkElementShapes(this),
659  myViewParent(nullptr),
660  myNet(nullptr),
661  myCurrentFrame(nullptr),
662  myUndoList(nullptr),
663  myFrontAttributeCarrier(nullptr) {
664 }
665 
666 
667 std::vector<std::string>
668 GNEViewNet::getEdgeLaneParamKeys(bool edgeKeys) const {
669  std::set<std::string> keys;
670  for (const NBEdge* e : myNet->getEdgeCont().getAllEdges()) {
671  if (edgeKeys) {
672  for (const auto& item : e->getParametersMap()) {
673  keys.insert(item.first);
674  }
675  for (const auto& con : e->getConnections()) {
676  for (const auto& item : con.getParametersMap()) {
677  keys.insert(item.first);
678  }
679  }
680  } else {
681  for (const auto& lane : e->getLanes()) {
682  int i = 0;
683  for (const auto& item : lane.getParametersMap()) {
684  keys.insert(item.first);
685  }
686  for (const auto& con : e->getConnectionsFromLane(i)) {
687  for (const auto& item : con.getParametersMap()) {
688  keys.insert(item.first);
689  }
690  }
691  i++;
692  }
693  }
694  }
695  return std::vector<std::string>(keys.begin(), keys.end());
696 }
697 
698 
699 std::vector<std::string>
701  std::set<std::string> keys;
702  /*
703  for (const auto &edge : myNet->getAttributeCarriers()->getEdges()) {
704  GNEGenericData* genericData = edge.second->getCurrentGenericDataElement();
705  if (genericData != nullptr) {
706  for (const auto &parameter : genericData->getParametersMap()) {
707  keys.insert(parameter.first);
708  }
709  }
710  }
711  */
712  return std::vector<std::string>(keys.begin(), keys.end());
713 }
714 
715 
716 int
717 GNEViewNet::doPaintGL(int mode, const Boundary& bound) {
718  // init view settings
721  }
724  }
725  // set lefthand and laneIcons
728 
729  glRenderMode(mode);
730  glMatrixMode(GL_MODELVIEW);
731  glPushMatrix();
732  glDisable(GL_TEXTURE_2D);
733  glDisable(GL_ALPHA_TEST);
734  glEnable(GL_BLEND);
735  glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
736  glEnable(GL_DEPTH_TEST);
737 
738  // visualize rectangular selection
740 
741  // compute lane width
742  double lw = m2p(SUMO_const_laneWidth);
743  // draw decals (if not in grabbing mode)
745  drawDecals();
746  // depending of the visualizationSettings, enable or disable check box show grid
748  // change show grid
751  // change to true
754  // update show grid buttons
757  }
758  // draw grid only in network and demand mode
760  paintGLGrid();
761  }
762  } else {
763  // change show grid
766  // change to false
769  // update show grid buttons
772  }
773  }
774  // update show connections
776  }
777  // draw temporal junction
779  // draw temporal elements
783  // draw testing elements
785  // draw temporal E2 multilane detectors
787  // draw temporal trip/flow route
789  // draw temporal person plan route
792  // draw temporal route
794  // draw temporal edgeRelPath
796  }
797  // check menu checks of supermode demand
799  // enable or disable menuCheckShowAllPersonPlans depending of there is a locked person
802  } else {
804  }
805  // check if menuCheckLockPerson must be enabled or disabled
807  // check if we're in inspector mode and we're inspecting exactly one element
809  // obtain tag property
810  const GNETagProperties& tagProperty = myInspectedAttributeCarriers.front()->getTagProperty();
811  // enable menu check lock person if is either a person, a person plan or a person stop
812  if (tagProperty.isPerson() || tagProperty.isPersonPlan() || tagProperty.isPersonStop()) {
814  } else {
816  }
817  } else {
819  }
820  }
821  }
822  // draw elements
823  glLineWidth(1);
824  glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
825  const float minB[2] = { (float)bound.xmin(), (float)bound.ymin() };
826  const float maxB[2] = { (float)bound.xmax(), (float)bound.ymax() };
828  glEnable(GL_POLYGON_OFFSET_FILL);
829  glEnable(GL_POLYGON_OFFSET_LINE);
830  // obtain objects included in minB and maxB
831  int hits2 = myGrid->Search(minB, maxB, *myVisualizationSettings);
832  // pop draw matrix
833  glPopMatrix();
834  return hits2;
835 }
836 
837 
838 long
839 GNEViewNet::onLeftBtnPress(FXObject*, FXSelector, void* eventData) {
840  // set focus in view net
841  setFocus();
842  // update MouseButtonKeyPressed
843  myMouseButtonKeyPressed.update(eventData);
844  // interpret object under cursor
845  if (makeCurrent()) {
846  // fill objects under cursor
848  // process left button press function depending of supermode
851  } else if (myEditModes.isCurrentSupermodeDemand()) {
852  processLeftButtonPressDemand(eventData);
853  } else if (myEditModes.isCurrentSupermodeData()) {
854  processLeftButtonPressData(eventData);
855  }
856  makeNonCurrent();
857  }
858  // update cursor
859  updateCursor();
860  // update view
861  updateViewNet();
862  return 1;
863 }
864 
865 
866 long
867 GNEViewNet::onLeftBtnRelease(FXObject* obj, FXSelector sel, void* eventData) {
868  // process parent function
869  GUISUMOAbstractView::onLeftBtnRelease(obj, sel, eventData);
870  // update MouseButtonKeyPressed
871  myMouseButtonKeyPressed.update(eventData);
872  // interpret object under cursor
873  if (makeCurrent()) {
874  // fill objects under cursor
876  // process left button release function depending of supermode
879  } else if (myEditModes.isCurrentSupermodeDemand()) {
881  } else if (myEditModes.isCurrentSupermodeData()) {
883  }
884  makeNonCurrent();
885  }
886  // update cursor
887  updateCursor();
888  // update view
889  updateViewNet();
890  return 1;
891 }
892 
893 
894 long
895 GNEViewNet::onRightBtnPress(FXObject* obj, FXSelector sel, void* eventData) {
896  // update MouseButtonKeyPressed
897  myMouseButtonKeyPressed.update(eventData);
898  // update cursor
899  updateCursor();
901  // disable right button press during drawing polygon
902  return 1;
903  } else {
904  return GUISUMOAbstractView::onRightBtnPress(obj, sel, eventData);
905  }
906 }
907 
908 
909 long
910 GNEViewNet::onRightBtnRelease(FXObject* obj, FXSelector sel, void* eventData) {
911  // update MouseButtonKeyPressed
912  myMouseButtonKeyPressed.update(eventData);
913  // update cursor
914  updateCursor();
915  // disable right button release during drawing polygon
917  return 1;
918  } else {
919  return GUISUMOAbstractView::onRightBtnRelease(obj, sel, eventData);
920  }
921 }
922 
923 
924 long
925 GNEViewNet::onMouseMove(FXObject* obj, FXSelector sel, void* eventData) {
926  // process mouse move in GUISUMOAbstractView
927  GUISUMOAbstractView::onMouseMove(obj, sel, eventData);
928  // update MouseButtonKeyPressed
929  myMouseButtonKeyPressed.update(eventData);
930  // update cursor
931  updateCursor();
932  // process mouse move function depending of supermode
935  } else if (myEditModes.isCurrentSupermodeDemand()) {
937  } else if (myEditModes.isCurrentSupermodeData()) {
939  }
940  // update view
941  updateViewNet();
942  return 1;
943 }
944 
945 
946 long
947 GNEViewNet::onKeyPress(FXObject* o, FXSelector sel, void* eventData) {
948  // update MouseButtonKeyPressed
949  myMouseButtonKeyPressed.update(eventData);
950  // update cursor
951  updateCursor();
952  // continue depending of current edit mode
954  // update viewNet (for temporal junction)
955  updateViewNet();
957  // change "delete last created point" depending of shift key
959  updateViewNet();
961  // change "delete last created point" depending of shift key
963  updateViewNet();
964  }
965  return GUISUMOAbstractView::onKeyPress(o, sel, eventData);
966 }
967 
968 
969 long
970 GNEViewNet::onKeyRelease(FXObject* o, FXSelector sel, void* eventData) {
971  // update MouseButtonKeyPressed
972  myMouseButtonKeyPressed.update(eventData);
973  // update cursor
974  updateCursor();
975  // continue depending of current edit mode
977  // update viewNet (for temporal junction)
978  updateViewNet();
980  // change "delete last created point" depending of shift key
982  updateViewNet();
984  // change "delete last created point" depending of shift key
986  updateViewNet();
987  }
988  // check if selecting using rectangle has to be disabled
991  updateViewNet();
992  }
993  return GUISUMOAbstractView::onKeyRelease(o, sel, eventData);
994 }
995 
996 
997 void
998 GNEViewNet::abortOperation(bool clearSelection) {
999  // steal focus from any text fields and place it over view net
1000  setFocus();
1001  // check what supermode is enabled
1003  // abort operation depending of current mode
1005  // abort edge creation in create edge frame
1009  // check if current selection has to be cleaned
1010  if (clearSelection) {
1012  }
1014  // abort changes in Connector Frame
1017  myViewParent->getTLSEditorFrame()->onCmdCancel(nullptr, 0, nullptr);
1021  // abort current drawing
1025  // abort current drawing
1027  } else if (myViewParent->getTAZFrame()->getTAZCurrentModul()->getTAZ() != nullptr) {
1028  // finish current editing TAZ
1030  }
1032  myViewParent->getProhibitionFrame()->onCmdCancel(nullptr, 0, nullptr);
1034  // abort select lanes
1036  // abort path
1038  }
1039  } else if (myEditModes.isCurrentSupermodeDemand()) {
1040  // abort operation depending of current mode
1043  // check if current selection has to be cleaned
1044  if (clearSelection) {
1046  }
1055  }
1056  } else if (myEditModes.isCurrentSupermodeData()) {
1057  // abort operation depending of current mode
1060  // check if current selection has to be cleaned
1061  if (clearSelection) {
1063  }
1068  }
1069  }
1070  // abort undo list
1071  myUndoList->p_abort();
1072  // update view
1073  updateViewNet();
1074 }
1075 
1076 
1077 void
1079  // delete elements depending of current supermode
1082  setStatusBarText("Cannot delete in this mode");
1083  } else {
1084  myUndoList->p_begin("delete network selection");
1093  myUndoList->p_end();
1094  }
1095  } else if (myEditModes.isCurrentSupermodeDemand()) {
1096  myUndoList->p_begin("delete demand selection");
1098  myUndoList->p_end();
1099  } else if (myEditModes.isCurrentSupermodeData()) {
1100  myUndoList->p_begin("delete data selection");
1102  myUndoList->p_end();
1103  }
1104  // update view
1105  updateViewNet();
1106 }
1107 
1108 
1109 void
1111  // check what supermode is enabled
1113  // abort operation depending of current mode
1115  // Accept changes in Connector Frame
1118  myViewParent->getTLSEditorFrame()->onCmdOK(nullptr, 0, nullptr);
1123  // stop current drawing
1125  } else {
1126  // start drawing
1128  }
1133  // stop current drawing
1135  } else if (myViewParent->getTAZFrame()->getTAZCurrentModul()->getTAZ() == nullptr) {
1136  // start drawing
1139  // save pending changes
1141  }
1144  // stop select lanes to create additional
1146  }
1147  // create E2
1149  }
1150  } else if (myEditModes.isCurrentSupermodeDemand()) {
1159  }
1160  } else if (myEditModes.isCurrentSupermodeData()) {
1163  }
1164  }
1165 }
1166 
1167 
1168 void
1170  // check what supermode is enabled
1174  }
1175  } else if (myEditModes.isCurrentSupermodeDemand()) {
1184  }
1185  } else if (myEditModes.isCurrentSupermodeData()) {
1188  }
1189  }
1190 }
1191 
1192 void
1194  // if there is a visible frame, set focus over it. In other case, set focus over ViewNet
1195  if (myCurrentFrame != nullptr) {
1197  } else {
1198  setFocus();
1199  }
1200 }
1201 
1202 
1205  return myViewParent;
1206 }
1207 
1208 
1209 GNENet*
1211  return myNet;
1212 }
1213 
1214 
1215 GNEUndoList*
1217  return myUndoList;
1218 }
1219 
1220 
1223  return myIntervalBar;
1224 }
1225 
1226 
1227 const std::vector<GNEAttributeCarrier*>&
1230 }
1231 
1232 
1233 void
1234 GNEViewNet::setInspectedAttributeCarriers(const std::vector<GNEAttributeCarrier*> ACs) {
1236 }
1237 
1238 
1239 bool
1241  if (myInspectedAttributeCarriers.empty()) {
1242  return false;
1243  } else {
1244  // search AC in myInspectedAttributeCarriers
1245  const auto it = std::find(myInspectedAttributeCarriers.begin(), myInspectedAttributeCarriers.end(), AC);
1246  if (it == myInspectedAttributeCarriers.end()) {
1247  return false;
1248  } else {
1249  return true;
1250  }
1251  }
1252 }
1253 
1254 
1255 void
1257  // search AC in myInspectedAttributeCarriers
1258  const auto it = std::find(myInspectedAttributeCarriers.begin(), myInspectedAttributeCarriers.end(), AC);
1259  if (it != myInspectedAttributeCarriers.end()) {
1260  myInspectedAttributeCarriers.erase(it);
1262  }
1263 }
1264 
1265 
1266 const GNEAttributeCarrier*
1268  return myFrontAttributeCarrier;
1269 }
1270 
1271 
1272 void
1275  // update view
1276  updateViewNet();
1277 }
1278 
1279 
1280 void
1282  if (myFrontAttributeCarrier == AC) {
1283  glTranslated(0, 0, GLO_DOTTEDCONTOUR_FRONT + extraOffset);
1284  } else {
1285  glTranslated(0, 0, objectType + extraOffset);
1286  }
1287 }
1288 
1289 
1290 bool
1295 }
1296 
1297 
1298 GNEJunction*
1300  GNEJunction* junction = nullptr;
1301  if (makeCurrent()) {
1305  if (pointed) {
1306  switch (pointed->getType()) {
1307  case GLO_JUNCTION:
1308  junction = (GNEJunction*)pointed;
1309  break;
1310  default:
1311  break;
1312  }
1313  }
1314  }
1315  return junction;
1316 }
1317 
1318 
1321  GNEConnection* connection = nullptr;
1322  if (makeCurrent()) {
1326  if (pointed) {
1327  switch (pointed->getType()) {
1328  case GLO_CONNECTION:
1329  connection = (GNEConnection*)pointed;
1330  break;
1331  default:
1332  break;
1333  }
1334  }
1335  }
1336  return connection;
1337 }
1338 
1339 
1340 GNECrossing*
1342  GNECrossing* crossing = nullptr;
1343  if (makeCurrent()) {
1347  if (pointed) {
1348  switch (pointed->getType()) {
1349  case GLO_CROSSING:
1350  crossing = (GNECrossing*)pointed;
1351  break;
1352  default:
1353  break;
1354  }
1355  }
1356  }
1357  return crossing;
1358 }
1359 
1360 GNEEdge*
1362  GNEEdge* edge = nullptr;
1363  if (makeCurrent()) {
1367  if (pointed) {
1368  switch (pointed->getType()) {
1369  case GLO_EDGE:
1370  edge = (GNEEdge*)pointed;
1371  break;
1372  case GLO_LANE:
1373  edge = (((GNELane*)pointed)->getParentEdge());
1374  break;
1375  default:
1376  break;
1377  }
1378  }
1379  }
1380  return edge;
1381 }
1382 
1383 
1384 GNELane*
1386  GNELane* lane = nullptr;
1387  if (makeCurrent()) {
1391  if (pointed) {
1392  if (pointed->getType() == GLO_LANE) {
1393  lane = (GNELane*)pointed;
1394  }
1395  }
1396  }
1397  return lane;
1398 }
1399 
1400 
1403  if (makeCurrent()) {
1407  if (pointed) {
1408  return dynamic_cast<GNEAdditional*>(pointed);
1409  }
1410  }
1411  return nullptr;
1412 }
1413 
1414 
1415 GNEPoly*
1417  if (makeCurrent()) {
1421  if (pointed) {
1422  return dynamic_cast<GNEPoly*>(pointed);
1423  }
1424  }
1425  return nullptr;
1426 }
1427 
1428 
1429 GNEPOI*
1431  if (makeCurrent()) {
1435  if (pointed) {
1436  return dynamic_cast<GNEPOI*>(pointed);
1437  }
1438  }
1439  return nullptr;
1440 }
1441 
1442 long
1443 GNEViewNet::onCmdSetSupermode(FXObject*, FXSelector sel, void*) {
1444  // check what network mode will be set
1445  switch (FXSELID(sel)) {
1448  break;
1451  break;
1454  break;
1455  default:
1456  break;
1457  }
1458  return 1;
1459 }
1460 
1461 long
1462 GNEViewNet::onCmdSetMode(FXObject*, FXSelector sel, void*) {
1464  // check what network mode will be set
1465  switch (FXSELID(sel)) {
1468  break;
1471  break;
1474  break;
1477  break;
1480  break;
1483  break;
1486  break;
1489  break;
1492  break;
1495  break;
1498  break;
1501  break;
1502  default:
1503  break;
1504  }
1505  } else if (myEditModes.isCurrentSupermodeDemand()) {
1506  // check what demand mode will be set
1507  switch (FXSELID(sel)) {
1510  break;
1513  break;
1516  break;
1519  break;
1522  break;
1525  break;
1528  break;
1531  break;
1534  break;
1537  break;
1540  break;
1541  default:
1542  break;
1543  }
1544  } else if (myEditModes.isCurrentSupermodeData()) {
1545  // check what demand mode will be set
1546  switch (FXSELID(sel)) {
1549  break;
1552  break;
1555  break;
1558  break;
1561  break;
1564  break;
1565  }
1566  }
1567  return 1;
1568 }
1569 
1570 
1571 long
1572 GNEViewNet::onCmdSplitEdge(FXObject*, FXSelector, void*) {
1573  GNEEdge* edge = getEdgeAtPopupPosition();
1574  if (edge != nullptr) {
1576  }
1577  return 1;
1578 }
1579 
1580 
1581 long
1582 GNEViewNet::onCmdSplitEdgeBidi(FXObject*, FXSelector, void*) {
1583  GNEEdge* edge = getEdgeAtPopupPosition();
1584  if (edge != nullptr) {
1585  // obtain reverse edge
1586  GNEEdge* reverseEdge = edge->getOppositeEdge();
1587  // check that reverse edge works
1588  if (reverseEdge != nullptr) {
1589  myNet->splitEdgesBidi(edge, reverseEdge, edge->getSplitPos(getPopupPosition()), myUndoList);
1590  }
1591  }
1592  return 1;
1593 }
1594 
1595 
1596 long
1597 GNEViewNet::onCmdReverseEdge(FXObject*, FXSelector, void*) {
1598  GNEEdge* edge = getEdgeAtPopupPosition();
1599  if (edge != nullptr) {
1600  if (edge->isAttributeCarrierSelected()) {
1601  myUndoList->p_begin("Reverse selected " + toString(SUMO_TAG_EDGE) + "s");
1602  std::vector<GNEEdge*> edges = myNet->retrieveEdges(true);
1603  for (auto it : edges) {
1605  }
1606  myUndoList->p_end();
1607  } else {
1608  myUndoList->p_begin("Reverse " + toString(SUMO_TAG_EDGE));
1609  myNet->reverseEdge(edge, myUndoList);
1610  myUndoList->p_end();
1611  }
1612  }
1613  return 1;
1614 }
1615 
1616 
1617 long
1618 GNEViewNet::onCmdAddReversedEdge(FXObject*, FXSelector, void*) {
1619  GNEEdge* edge = getEdgeAtPopupPosition();
1620  if (edge != nullptr) {
1621  if (edge->isAttributeCarrierSelected()) {
1622  myUndoList->p_begin("Add Reverse edge for selected " + toString(SUMO_TAG_EDGE) + "s");
1623  std::vector<GNEEdge*> edges = myNet->retrieveEdges(true);
1624  for (auto it : edges) {
1626  }
1627  myUndoList->p_end();
1628  } else {
1629  myUndoList->p_begin("Add reverse " + toString(SUMO_TAG_EDGE));
1631  myUndoList->p_end();
1632  }
1633  }
1634  return 1;
1635 }
1636 
1637 
1638 long
1639 GNEViewNet::onCmdEditEdgeEndpoint(FXObject*, FXSelector, void*) {
1640  GNEEdge* edge = getEdgeAtPopupPosition();
1641  if (edge != nullptr) {
1642  // snap to active grid the Popup position
1644  }
1645  return 1;
1646 }
1647 
1648 
1649 long
1650 GNEViewNet::onCmdResetEdgeEndpoint(FXObject*, FXSelector, void*) {
1651  GNEEdge* edge = getEdgeAtPopupPosition();
1652  if (edge != nullptr) {
1653  // check if edge is selected
1654  if (edge->isAttributeCarrierSelected()) {
1655  // get all selected edges
1656  const auto selectedEdges = myNet->retrieveEdges(true);
1657  // begin operation
1658  myUndoList->p_begin("reset geometry points");
1659  // iterate over selected edges
1660  for (const auto& selectedEdge : selectedEdges) {
1661  // reset both end points
1662  selectedEdge->resetBothEndpoint(myUndoList);
1663  }
1664  // end operation
1665  myUndoList->p_end();
1666  } else {
1668  }
1669  }
1670  return 1;
1671 }
1672 
1673 
1674 long
1675 GNEViewNet::onCmdStraightenEdges(FXObject*, FXSelector, void*) {
1676  GNEEdge* edge = getEdgeAtPopupPosition();
1677  if (edge != nullptr) {
1678  if (edge->isAttributeCarrierSelected()) {
1679  myUndoList->p_begin("straighten selected " + toString(SUMO_TAG_EDGE) + "s");
1680  std::vector<GNEEdge*> edges = myNet->retrieveEdges(true);
1681  for (auto it : edges) {
1682  it->setAttribute(SUMO_ATTR_SHAPE, "", myUndoList);
1683  }
1684  myUndoList->p_end();
1685  } else {
1686 
1687  myUndoList->p_begin("straighten " + toString(SUMO_TAG_EDGE));
1689  myUndoList->p_end();
1690  }
1691  }
1692  return 1;
1693 }
1694 
1695 
1696 long
1697 GNEViewNet::onCmdSmoothEdges(FXObject*, FXSelector, void*) {
1698  GNEEdge* edge = getEdgeAtPopupPosition();
1699  if (edge != nullptr) {
1700  if (edge->isAttributeCarrierSelected()) {
1701  myUndoList->p_begin("straighten elevation of selected " + toString(SUMO_TAG_EDGE) + "s");
1702  std::vector<GNEEdge*> edges = myNet->retrieveEdges(true);
1703  for (auto it : edges) {
1704  it->smooth(myUndoList);
1705  }
1706  myUndoList->p_end();
1707  } else {
1708  myUndoList->p_begin("straighten edge elevation");
1709  edge->smooth(myUndoList);
1710  myUndoList->p_end();
1711  }
1712  }
1713  return 1;
1714 }
1715 
1716 
1717 long
1718 GNEViewNet::onCmdStraightenEdgesElevation(FXObject*, FXSelector, void*) {
1719  GNEEdge* edge = getEdgeAtPopupPosition();
1720  if (edge != nullptr) {
1721  if (edge->isAttributeCarrierSelected()) {
1722  myUndoList->p_begin("straighten elevation of selected " + toString(SUMO_TAG_EDGE) + "s");
1723  std::vector<GNEEdge*> edges = myNet->retrieveEdges(true);
1724  for (auto it : edges) {
1725  it->straightenElevation(myUndoList);
1726  }
1727  myUndoList->p_end();
1728  } else {
1729  myUndoList->p_begin("straighten edge elevation");
1731  myUndoList->p_end();
1732  }
1733  }
1734  return 1;
1735 }
1736 
1737 
1738 long
1739 GNEViewNet::onCmdSmoothEdgesElevation(FXObject*, FXSelector, void*) {
1740  GNEEdge* edge = getEdgeAtPopupPosition();
1741  if (edge != nullptr) {
1742  if (edge->isAttributeCarrierSelected()) {
1743  myUndoList->p_begin("smooth elevation of selected " + toString(SUMO_TAG_EDGE) + "s");
1744  std::vector<GNEEdge*> edges = myNet->retrieveEdges(true);
1745  for (auto it : edges) {
1746  it->smoothElevation(myUndoList);
1747  }
1748  myUndoList->p_end();
1749  } else {
1750  myUndoList->p_begin("smooth edge elevation");
1751  edge->smoothElevation(myUndoList);
1752  myUndoList->p_end();
1753  }
1754  }
1755  return 1;
1756 }
1757 
1758 
1759 long
1760 GNEViewNet::onCmdResetLength(FXObject*, FXSelector, void*) {
1761  GNEEdge* edge = getEdgeAtPopupPosition();
1762  if (edge != nullptr) {
1763  if (edge->isAttributeCarrierSelected()) {
1764  myUndoList->p_begin("reset edge lengthss");
1765  std::vector<GNEEdge*> edges = myNet->retrieveEdges(true);
1766  for (auto it : edges) {
1767  it->setAttribute(SUMO_ATTR_LENGTH, "-1", myUndoList);
1768  }
1769  myUndoList->p_end();
1770  } else {
1772  }
1773  }
1774  return 1;
1775 }
1776 
1777 
1778 long
1779 GNEViewNet::onCmdSimplifyShape(FXObject*, FXSelector, void*) {
1780  GNEPoly* polygonUnderMouse = getPolygonAtPopupPosition();
1781  if (polygonUnderMouse) {
1782  polygonUnderMouse->simplifyShape();
1783  }
1784  updateViewNet();
1785  return 1;
1786 }
1787 
1788 
1789 long
1790 GNEViewNet::onCmdDeleteGeometryPoint(FXObject*, FXSelector, void*) {
1791  GNEPoly* polygonUnderMouse = getPolygonAtPopupPosition();
1792  if (polygonUnderMouse) {
1793  polygonUnderMouse->deleteGeometryPoint(getPopupPosition());
1794  }
1795  updateViewNet();
1796  return 1;
1797 }
1798 
1799 
1800 long
1801 GNEViewNet::onCmdClosePolygon(FXObject*, FXSelector, void*) {
1802  GNEPoly* polygonUnderMouse = getPolygonAtPopupPosition();
1803  if (polygonUnderMouse) {
1804  polygonUnderMouse->closePolygon();
1805  updateViewNet();
1806  }
1807  return 1;
1808 }
1809 
1810 
1811 long
1812 GNEViewNet::onCmdOpenPolygon(FXObject*, FXSelector, void*) {
1813  GNEPoly* polygonUnderMouse = getPolygonAtPopupPosition();
1814  if (polygonUnderMouse) {
1815  polygonUnderMouse->openPolygon();
1816  updateViewNet();
1817  }
1818  return 1;
1819 }
1820 
1821 
1822 long
1823 GNEViewNet::onCmdSetFirstGeometryPoint(FXObject*, FXSelector, void*) {
1824  GNEPoly* polygonUnderMouse = getPolygonAtPopupPosition();
1825  if (polygonUnderMouse) {
1826  polygonUnderMouse->changeFirstGeometryPoint(polygonUnderMouse->getVertexIndex(getPopupPosition(), false));
1827  updateViewNet();
1828  }
1829 
1830  return 1;
1831 }
1832 
1833 
1834 long
1835 GNEViewNet::onCmdTransformPOI(FXObject*, FXSelector, void*) {
1836  // obtain POI at popup position
1838  if (POI) {
1839  // check what type of POI will be transformed
1840  if (POI->getTagProperty().getTag() == SUMO_TAG_POI) {
1841  // obtain lanes around POI boundary
1842  std::vector<GUIGlID> GLIDs = getObjectsInBoundary(POI->getCenteringBoundary(), false);
1843  std::vector<GNELane*> lanes;
1844  for (auto i : GLIDs) {
1846  if (lane) {
1847  lanes.push_back(lane);
1848  }
1849  }
1850  if (lanes.empty()) {
1851  WRITE_WARNING("No lanes around " + toString(SUMO_TAG_POI) + " to attach it");
1852  } else {
1853  // obtain nearest lane to POI
1854  GNELane* nearestLane = lanes.front();
1855  double minorPosOverLane = nearestLane->getLaneShape().nearest_offset_to_point2D(POI->getPositionInView());
1856  double minorLateralOffset = nearestLane->getLaneShape().positionAtOffset(minorPosOverLane).distanceTo(POI->getPositionInView());
1857  for (auto i : lanes) {
1858  double posOverLane = i->getLaneShape().nearest_offset_to_point2D(POI->getPositionInView());
1859  double lateralOffset = i->getLaneShape().positionAtOffset(posOverLane).distanceTo(POI->getPositionInView());
1860  if (lateralOffset < minorLateralOffset) {
1861  minorPosOverLane = posOverLane;
1862  minorLateralOffset = lateralOffset;
1863  nearestLane = i;
1864  }
1865  }
1866  // obtain values of POI
1867  std::string id = POI->getID();
1868  std::string type = POI->getShapeType();
1869  RGBColor color = POI->getShapeColor();
1870  Position pos = (*POI);
1871  double layer = POI->getShapeLayer();
1872  double angle = POI->getShapeNaviDegree();
1873  std::string imgFile = POI->getShapeImgFile();
1874  bool relativePath = POI->getShapeRelativePath();
1875  double POIWidth = POI->getWidth(); // double width -> C4458
1876  double POIHeight = POI->getHeight(); // double height -> C4458
1877  // remove POI
1878  myUndoList->p_begin("attach POI into " + toString(SUMO_TAG_LANE));
1880  // add POILane
1881  myNet->getAttributeCarriers()->addPOI(id, type, color, pos, false, nearestLane->getID(), minorPosOverLane, 0, layer, angle, imgFile, relativePath, POIWidth, POIHeight);
1882  myUndoList->p_end();
1883  }
1884  } else {
1885  // obtain values of POILane
1886  std::string id = POI->getID();
1887  std::string type = POI->getShapeType();
1888  RGBColor color = POI->getShapeColor();
1889  Position pos = (*POI);
1890  double layer = POI->getShapeLayer();
1891  double angle = POI->getShapeNaviDegree();
1892  std::string imgFile = POI->getShapeImgFile();
1893  bool relativePath = POI->getShapeRelativePath();
1894  double POIWidth = POI->getWidth(); // double width -> C4458
1895  double POIWeight = POI->getHeight(); // double height -> C4458
1896  // remove POI
1897  myUndoList->p_begin("release POI from " + toString(SUMO_TAG_LANE));
1899  // add POI
1900  myNet->getAttributeCarriers()->addPOI(id, type, color, pos, false, "", 0, 0, layer, angle, imgFile, relativePath, POIWidth, POIWeight);
1901  myUndoList->p_end();
1902  }
1903  // update view after transform
1904  updateViewNet();
1905  }
1906  return 1;
1907 }
1908 
1909 
1910 long
1911 GNEViewNet::onCmdDuplicateLane(FXObject*, FXSelector, void*) {
1912  GNELane* lane = getLaneAtPopupPosition();
1913  if (lane != nullptr) {
1914  // when duplicating an unselected lane, keep all connections as they
1915  // are, otherwise recompute them
1916  if (lane->isAttributeCarrierSelected()) {
1917  myUndoList->p_begin("duplicate selected " + toString(SUMO_TAG_LANE) + "s");
1918  std::vector<GNELane*> lanes = myNet->retrieveLanes(true);
1919  for (auto it : lanes) {
1920  myNet->duplicateLane(it, myUndoList, true);
1921  }
1922  myUndoList->p_end();
1923  } else {
1924  myUndoList->p_begin("duplicate " + toString(SUMO_TAG_LANE));
1925  myNet->duplicateLane(lane, myUndoList, false);
1926  myUndoList->p_end();
1927  }
1928  }
1929  return 1;
1930 }
1931 
1932 
1933 long
1934 GNEViewNet::onCmdResetLaneCustomShape(FXObject*, FXSelector, void*) {
1935  GNELane* lane = getLaneAtPopupPosition();
1936  if (lane != nullptr) {
1937  // when duplicating an unselected lane, keep all connections as they
1938  // are, otherwise recompute them
1939  if (lane->isAttributeCarrierSelected()) {
1940  myUndoList->p_begin("reset custom lane shapes");
1941  std::vector<GNELane*> lanes = myNet->retrieveLanes(true);
1942  for (auto it : lanes) {
1943  it->setAttribute(SUMO_ATTR_CUSTOMSHAPE, "", myUndoList);
1944  }
1945  myUndoList->p_end();
1946  } else {
1947  myUndoList->p_begin("reset custom lane shape");
1949  myUndoList->p_end();
1950  }
1951  }
1952  return 1;
1953 }
1954 
1955 
1956 long
1957 GNEViewNet::onCmdLaneOperation(FXObject*, FXSelector sel, void*) {
1958  // check lane operation
1959  switch (FXSELID(sel)) {
1961  return restrictLane(SVC_PEDESTRIAN);
1963  return restrictLane(SVC_BICYCLE);
1965  return restrictLane(SVC_BUS);
1967  return restrictLane(SVC_IGNORING);
1970  case MID_GNE_LANE_ADD_BIKE:
1972  case MID_GNE_LANE_ADD_BUS:
1973  return addRestrictedLane(SVC_BUS);
1981  return removeRestrictedLane(SVC_BUS);
1984  default:
1985  return 0;
1986  break;
1987  }
1988 }
1989 
1990 
1991 long
1992 GNEViewNet::onCmdLaneReachability(FXObject* menu, FXSelector, void*) {
1993  GNELane* clickedLane = getLaneAtPopupPosition();
1994  if (clickedLane != nullptr) {
1995  // obtain vClass
1996  const SUMOVehicleClass vClass = SumoVehicleClassStrings.get(dynamic_cast<FXMenuCommand*>(menu)->getText().text());
1997  // calculate reachability
1998  myNet->getPathCalculator()->calculateReachability(vClass, clickedLane->getParentEdge());
1999  // select all lanes with reachablility greather than 0
2000  myUndoList->p_begin("select lane reachability");
2001  for (const auto& edge : myNet->getAttributeCarriers()->getEdges()) {
2002  for (const auto& lane : edge.second->getLanes()) {
2003  if (lane->getReachability() >= 0) {
2004  lane->setAttribute(GNE_ATTR_SELECTED, "true", myUndoList);
2005  }
2006  }
2007  }
2008  myUndoList->p_end();
2009  }
2010  // update viewNet
2011  updateViewNet();
2012  return 1;
2013 }
2014 
2015 
2016 long
2017 GNEViewNet::onCmdOpenAdditionalDialog(FXObject*, FXSelector, void*) {
2018  // retrieve additional under cursor
2020  // check if additional can open dialog
2021  if (addtional && addtional->getTagProperty().hasDialog()) {
2022  addtional->openAdditionalDialog();
2023  }
2024  return 1;
2025 }
2026 
2027 
2028 bool
2030  GNELane* lane = getLaneAtPopupPosition();
2031  if (lane != nullptr) {
2032  // Get selected lanes
2033  std::vector<GNELane*> lanes = myNet->retrieveLanes(true); ;
2034  // Declare map of edges and lanes
2035  std::map<GNEEdge*, GNELane*> mapOfEdgesAndLanes;
2036  // Iterate over selected lanes
2037  for (auto i : lanes) {
2038  mapOfEdgesAndLanes[myNet->retrieveEdge(i->getParentEdge()->getID())] = i;
2039  }
2040  // Throw warning dialog if there hare multiple lanes selected in the same edge
2041  if (mapOfEdgesAndLanes.size() != lanes.size()) {
2042  FXMessageBox::information(getApp(), MBOX_OK,
2043  "Multiple lane in the same edge selected", "%s",
2044  ("There are selected lanes that belong to the same edge.\n Only one lane per edge will be restricted for " + toString(vclass) + ".").c_str());
2045  }
2046  // If we handeln a set of lanes
2047  if (mapOfEdgesAndLanes.size() > 0) {
2048  // declare counter for number of Sidewalks
2049  int counter = 0;
2050  // iterate over selected lanes
2051  for (auto i : mapOfEdgesAndLanes) {
2052  if (i.first->hasRestrictedLane(vclass)) {
2053  counter++;
2054  }
2055  }
2056  // if all edges parent own a Sidewalk, stop function
2057  if (counter == (int)mapOfEdgesAndLanes.size()) {
2058  FXMessageBox::information(getApp(), MBOX_OK,
2059  ("Set vclass for " + toString(vclass) + " to selected lanes").c_str(), "%s",
2060  ("All lanes own already another lane in the same edge with a restriction for " + toString(vclass)).c_str());
2061  return 0;
2062  } else {
2063  WRITE_DEBUG("Opening FXMessageBox 'restrict lanes'");
2064  // Ask confirmation to user
2065  FXuint answer = FXMessageBox::question(getApp(), MBOX_YES_NO,
2066  ("Set vclass for " + toString(vclass) + " to selected lanes").c_str(), "%s",
2067  (toString(mapOfEdgesAndLanes.size() - counter) + " lanes will be restricted for " + toString(vclass) + ". continue?").c_str());
2068  if (answer != 1) { //1:yes, 2:no, 4:esc
2069  // write warning if netedit is running in testing mode
2070  if (answer == 2) {
2071  WRITE_DEBUG("Closed FXMessageBox 'restrict lanes' with 'No'");
2072  } else if (answer == 4) {
2073  WRITE_DEBUG("Closed FXMessageBox 'restrict lanes' with 'ESC'");
2074  }
2075  return 0;
2076  } else {
2077  // write warning if netedit is running in testing mode
2078  WRITE_DEBUG("Closed FXMessageBox 'restrict lanes' with 'Yes'");
2079  }
2080  }
2081  // begin undo operation
2082  myUndoList->p_begin("restrict lanes to " + toString(vclass));
2083  // iterate over selected lanes
2084  for (std::map<GNEEdge*, GNELane*>::iterator i = mapOfEdgesAndLanes.begin(); i != mapOfEdgesAndLanes.end(); i++) {
2085  // Transform lane to Sidewalk
2086  myNet->restrictLane(vclass, i->second, myUndoList);
2087  }
2088  // end undo operation
2089  myUndoList->p_end();
2090  } else {
2091  // If only have a single lane, start undo/redo operation
2092  myUndoList->p_begin("restrict lane to " + toString(vclass));
2093  // Transform lane to Sidewalk
2094  myNet->restrictLane(vclass, lane, myUndoList);
2095  // end undo operation
2096  myUndoList->p_end();
2097  }
2098  }
2099  return 1;
2100 }
2101 
2102 
2103 bool
2105  GNELane* lane = getLaneAtPopupPosition();
2106  if (lane != nullptr) {
2107  // Get selected edges
2108  std::vector<GNEEdge*> edges = myNet->retrieveEdges(true);
2109  // get selected lanes
2110  std::vector<GNELane*> lanes = myNet->retrieveLanes(true);
2111  // Declare set of edges
2112  std::set<GNEEdge*> setOfEdges;
2113  // Fill set of edges with vector of edges
2114  for (auto i : edges) {
2115  setOfEdges.insert(i);
2116  }
2117  // iterate over selected lanes
2118  for (auto it : lanes) {
2119  // Insert pointer to edge into set of edges (To avoid duplicates)
2120  setOfEdges.insert(myNet->retrieveEdge(it->getParentEdge()->getID()));
2121  }
2122  // If we handeln a set of edges
2123  if (setOfEdges.size() > 0) {
2124  // declare counter for number of restrictions
2125  int counter = 0;
2126  // iterate over set of edges
2127  for (std::set<GNEEdge*>::iterator it = setOfEdges.begin(); it != setOfEdges.end(); it++) {
2128  // update counter if edge has already a restricted lane of type "vclass"
2129  if ((*it)->hasRestrictedLane(vclass)) {
2130  counter++;
2131  }
2132  }
2133  // if all lanes own a Sidewalk, stop function
2134  if (counter == (int)setOfEdges.size()) {
2135  FXMessageBox::information(getApp(), MBOX_OK,
2136  ("Add vclass for" + toString(vclass) + " to selected lanes").c_str(), "%s",
2137  ("All lanes own already another lane in the same edge with a restriction for " + toString(vclass)).c_str());
2138  return 0;
2139  } else {
2140  WRITE_DEBUG("Opening FXMessageBox 'restrict lanes'");
2141  // Ask confirmation to user
2142  FXuint answer = FXMessageBox::question(getApp(), MBOX_YES_NO,
2143  ("Add vclass for " + toString(vclass) + " to selected lanes").c_str(), "%s",
2144  (toString(setOfEdges.size() - counter) + " restrictions for " + toString(vclass) + " will be added. continue?").c_str());
2145  if (answer != 1) { //1:yes, 2:no, 4:esc
2146  // write warning if netedit is running in testing mode
2147  if (answer == 2) {
2148  WRITE_DEBUG("Closed FXMessageBox 'restrict lanes' with 'No'");
2149  } else if (answer == 4) {
2150  WRITE_DEBUG("Closed FXMessageBox 'restrict lanes' with 'ESC'");
2151  }
2152  return 0;
2153  } else {
2154  // write warning if netedit is running in testing mode
2155  WRITE_DEBUG("Closed FXMessageBox 'restrict lanes' with 'Yes'");
2156  }
2157  }
2158  // begin undo operation
2159  myUndoList->p_begin("Add restrictions for " + toString(vclass));
2160  // iterate over set of edges
2161  for (const auto& edge : setOfEdges) {
2162  // add restricted lane (guess target)
2163  myNet->addRestrictedLane(vclass, edge, -1, myUndoList);
2164  }
2165  // end undo operation
2166  myUndoList->p_end();
2167  } else {
2168  // If only have a single lane, start undo/redo operation
2169  myUndoList->p_begin("Add vclass for " + toString(vclass));
2170  // Add restricted lane
2171  if (vclass == SVC_PEDESTRIAN) {
2172  // always add pedestrian lanes on the right
2173  myNet->addRestrictedLane(vclass, lane->getParentEdge(), 0, myUndoList);
2174  } else if (lane->getParentEdge()->getLanes().size() == 1) {
2175  // guess insertion position if there is only 1 lane
2176  myNet->addRestrictedLane(vclass, lane->getParentEdge(), -1, myUndoList);
2177  } else {
2178  myNet->addRestrictedLane(vclass, lane->getParentEdge(), lane->getIndex(), myUndoList);
2179  }
2180  // end undo/redo operation
2181  myUndoList->p_end();
2182  }
2183  }
2184  return 1;
2185 }
2186 
2187 
2188 bool
2190  GNELane* lane = getLaneAtPopupPosition();
2191  if (lane != nullptr) {
2192  // Get selected edges
2193  std::vector<GNEEdge*> edges = myNet->retrieveEdges(true);
2194  // get selected lanes
2195  std::vector<GNELane*> lanes = myNet->retrieveLanes(true);
2196  // Declare set of edges
2197  std::set<GNEEdge*> setOfEdges;
2198  // Fill set of edges with vector of edges
2199  for (auto i : edges) {
2200  setOfEdges.insert(i);
2201  }
2202  // iterate over selected lanes
2203  for (auto it : lanes) {
2204  // Insert pointer to edge into set of edges (To avoid duplicates)
2205  setOfEdges.insert(myNet->retrieveEdge(it->getParentEdge()->getID()));
2206  }
2207  // If we handeln a set of edges
2208  if (setOfEdges.size() > 0) {
2209  // declare counter for number of restrictions
2210  int counter = 0;
2211  // iterate over set of edges
2212  for (std::set<GNEEdge*>::iterator it = setOfEdges.begin(); it != setOfEdges.end(); it++) {
2213  // update counter if edge has already a restricted lane of type "vclass"
2214  if ((*it)->hasRestrictedLane(vclass)) {
2215  counter++;
2216  }
2217  }
2218  // if all lanes don't own a Sidewalk, stop function
2219  if (counter == 0) {
2220  FXMessageBox::information(getApp(), MBOX_OK,
2221  ("Remove vclass for " + toString(vclass) + " to selected lanes").c_str(), "%s",
2222  ("Selected lanes and edges haven't a restriction for " + toString(vclass)).c_str());
2223  return 0;
2224  } else {
2225  WRITE_DEBUG("Opening FXMessageBox 'restrict lanes'");
2226  // Ask confirmation to user
2227  FXuint answer = FXMessageBox::question(getApp(), MBOX_YES_NO,
2228  ("Remove vclass for " + toString(vclass) + " to selected lanes").c_str(), "%s",
2229  (toString(counter) + " restrictions for " + toString(vclass) + " will be removed. continue?").c_str());
2230  if (answer != 1) { //1:yes, 2:no, 4:esc
2231  // write warning if netedit is running in testing mode
2232  if (answer == 2) {
2233  WRITE_DEBUG("Closed FXMessageBox 'restrict lanes' with 'No'");
2234  } else if (answer == 4) {
2235  WRITE_DEBUG("Closed FXMessageBox 'restrict lanes' with 'ESC'");
2236  }
2237  return 0;
2238  } else {
2239  // write warning if netedit is running in testing mode
2240  WRITE_DEBUG("Closed FXMessageBox 'restrict lanes' with 'Yes'");
2241  }
2242  }
2243  // begin undo operation
2244  myUndoList->p_begin("Remove restrictions for " + toString(vclass));
2245  // iterate over set of edges
2246  for (const auto& edge : setOfEdges) {
2247  // add Sidewalk
2248  myNet->removeRestrictedLane(vclass, edge, myUndoList);
2249  }
2250  // end undo operation
2251  myUndoList->p_end();
2252  } else {
2253  // If only have a single lane, start undo/redo operation
2254  myUndoList->p_begin("Remove vclass for " + toString(vclass));
2255  // Remove Sidewalk
2257  // end undo/redo operation
2258  myUndoList->p_end();
2259  }
2260  }
2261  return 1;
2262 }
2263 
2264 
2265 void
2266 GNEViewNet::processClick(void* eventData) {
2267  FXEvent* evt = (FXEvent*)eventData;
2268  // process click
2269  destroyPopup();
2270  setFocus();
2271  myChanger->onLeftBtnPress(eventData);
2272  grab();
2273  // Check there are double click
2274  if (evt->click_count == 2) {
2275  handle(this, FXSEL(SEL_DOUBLECLICKED, 0), eventData);
2276  }
2277 }
2278 
2279 
2280 void
2282  // declare a flag for cursor move
2283  bool cursorMove = false;
2284  // check if in current mode/supermode cursor move can be shown
2290  cursorMove = true;
2291  }
2292  } else if (myEditModes.isCurrentSupermodeDemand()) {
2296  cursorMove = true;
2297  }
2298  } else if (myEditModes.isCurrentSupermodeData()) {
2300  cursorMove = true;
2301  }
2302  }
2303  // update cursor if control key is pressed
2304  if (myMouseButtonKeyPressed.controlKeyPressed() && cursorMove) {
2305  setDefaultCursor(GUICursorSubSys::getCursor(SUMOCURSOR_MOVE));
2307  } else {
2310  }
2311 }
2312 
2313 
2314 long
2315 GNEViewNet::onCmdEditJunctionShape(FXObject*, FXSelector, void*) {
2316  // Obtain junction under mouse
2318  if (junction) {
2319  // check if network has to be updated
2320  if (junction->getNBNode()->getShape().size() == 0) {
2321  // recompute the whole network
2323  }
2324  // start edit custom shape
2326  }
2327  // destroy pop-up and set focus in view net
2328  destroyPopup();
2329  setFocus();
2330  return 1;
2331 }
2332 
2333 
2334 long
2335 GNEViewNet::onCmdResetJunctionShape(FXObject*, FXSelector, void*) {
2336  // Obtain junction under mouse
2338  if (junction) {
2339  // are, otherwise recompute them
2340  if (junction->isAttributeCarrierSelected()) {
2341  myUndoList->p_begin("reset custom junction shapes");
2342  std::vector<GNEJunction*> junctions = myNet->retrieveJunctions(true);
2343  for (auto it : junctions) {
2344  it->setAttribute(SUMO_ATTR_SHAPE, "", myUndoList);
2345  }
2346  myUndoList->p_end();
2347  } else {
2348  myUndoList->p_begin("reset custom junction shape");
2349  junction->setAttribute(SUMO_ATTR_SHAPE, "", myUndoList);
2350  myUndoList->p_end();
2351  }
2352  }
2353  // destroy pop-up and set focus in view net
2354  destroyPopup();
2355  setFocus();
2356  return 1;
2357 }
2358 
2359 
2360 long
2361 GNEViewNet::onCmdReplaceJunction(FXObject*, FXSelector, void*) {
2363  if (junction != nullptr) {
2365  updateViewNet();
2366  }
2367  // destroy pop-up and set focus in view net
2368  destroyPopup();
2369  setFocus();
2370  return 1;
2371 }
2372 
2373 
2374 long
2375 GNEViewNet::onCmdSplitJunction(FXObject*, FXSelector, void*) {
2377  if (junction != nullptr) {
2378  myNet->splitJunction(junction, false, myUndoList);
2379  updateViewNet();
2380  }
2381  // destroy pop-up and set focus in view net
2382  destroyPopup();
2383  setFocus();
2384  return 1;
2385 }
2386 
2387 
2388 long
2389 GNEViewNet::onCmdSplitJunctionReconnect(FXObject*, FXSelector, void*) {
2391  if (junction != nullptr) {
2392  myNet->splitJunction(junction, true, myUndoList);
2393  updateViewNet();
2394  }
2395  // destroy pop-up and set focus in view net
2396  destroyPopup();
2397  setFocus();
2398  return 1;
2399 }
2400 
2401 long
2402 GNEViewNet::onCmdSelectRoundabout(FXObject*, FXSelector, void*) {
2404  if (junction != nullptr) {
2405  myNet->selectRoundabout(junction, myUndoList);
2406  updateViewNet();
2407  }
2408  // destroy pop-up and set focus in view net
2409  destroyPopup();
2410  setFocus();
2411  return 1;
2412 }
2413 
2414 long
2415 GNEViewNet::onCmdConvertRoundabout(FXObject*, FXSelector, void*) {
2417  if (junction != nullptr) {
2418  myNet->createRoundabout(junction, myUndoList);
2419  updateViewNet();
2420  }
2421  // destroy pop-up and set focus in view net
2422  destroyPopup();
2423  setFocus();
2424  return 1;
2425 }
2426 
2427 
2428 long
2429 GNEViewNet::onCmdClearConnections(FXObject*, FXSelector, void*) {
2431  if (junction != nullptr) {
2432  // make sure we do not inspect the connection will it is being deleted
2433  if ((myInspectedAttributeCarriers.size() > 0) && (myInspectedAttributeCarriers.front()->getTagProperty().getTag() == SUMO_TAG_CONNECTION)) {
2435  }
2436  // make sure that connections isn't the front attribute
2438  myFrontAttributeCarrier = nullptr;
2439  }
2440  // check if we're handling a selection
2441  if (junction->isAttributeCarrierSelected()) {
2442  std::vector<GNEJunction*> selectedJunction = myNet->retrieveJunctions(true);
2443  myUndoList->p_begin("clear connections of selected junctions");
2444  for (auto i : selectedJunction) {
2446  }
2447  myUndoList->p_end();
2448  } else {
2450  }
2451  updateViewNet();
2452  }
2453  // destroy pop-up and set focus in view net
2454  destroyPopup();
2455  setFocus();
2456  return 1;
2457 }
2458 
2459 
2460 long
2461 GNEViewNet::onCmdResetConnections(FXObject*, FXSelector, void*) {
2463  if (junction != nullptr) {
2464  // make sure we do not inspect the connection will it is being deleted
2465  if ((myInspectedAttributeCarriers.size() > 0) && myInspectedAttributeCarriers.front()->getTagProperty().getTag() == SUMO_TAG_CONNECTION) {
2467  }
2468  // make sure that connections isn't the front attribute
2470  myFrontAttributeCarrier = nullptr;
2471  }
2472  // check if we're handling a selection
2473  if (junction->isAttributeCarrierSelected()) {
2474  std::vector<GNEJunction*> selectedJunction = myNet->retrieveJunctions(true);
2475  myUndoList->p_begin("reset connections of selected junctions");
2476  for (auto i : selectedJunction) {
2478  }
2479  myUndoList->p_end();
2480  } else {
2482  }
2483  updateViewNet();
2484  }
2485  // destroy pop-up and set focus in view net
2486  destroyPopup();
2487  setFocus();
2488  return 1;
2489 }
2490 
2491 
2492 long
2493 GNEViewNet::onCmdEditConnectionShape(FXObject*, FXSelector, void*) {
2494  // Obtain connection under mouse
2496  if (connection) {
2498  }
2499  // destroy pop-up and update view Net
2500  destroyPopup();
2501  setFocus();
2502  return 1;
2503 }
2504 
2505 
2506 long
2507 GNEViewNet::onCmdEditCrossingShape(FXObject*, FXSelector, void*) {
2508  // Obtain crossing under mouse
2510  if (crossing) {
2511  // due crossings haven two shapes, check what has to be edited
2512  PositionVector shape = crossing->getNBCrossing()->customShape.size() > 0 ? crossing->getNBCrossing()->customShape : crossing->getNBCrossing()->shape;
2513  // check if network has to be updated
2514  if (crossing->getParentJunction()->getNBNode()->getShape().size() == 0) {
2515  // recompute the whole network
2517  }
2518  // start edit custom shape
2520  }
2521  // destroy pop-up and update view Net
2522  destroyPopup();
2523  setFocus();
2524  return 1;
2525 }
2526 
2527 
2528 long
2529 GNEViewNet::onCmdToogleSelectEdges(FXObject*, FXSelector sel, void*) {
2530  // Toogle menuCheckSelectEdges
2533  } else {
2535  }
2537  // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
2538  if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_SELECTEDGES)) {
2540  }
2541  return 1;
2542 }
2543 
2544 
2545 long
2546 GNEViewNet::onCmdToogleShowConnections(FXObject*, FXSelector sel, void*) {
2547  // Toogle menuCheckShowConnections
2550  } else {
2552  }
2554  // if show was enabled, init GNEConnections
2557  }
2558  // change flag "showLane2Lane" in myVisualizationSettings
2560  // Hide/show connections require recompute
2561  getNet()->requireRecompute();
2562  // Update viewnNet to show/hide conections
2563  updateViewNet();
2564  // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
2565  if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_SHOWCONNECTIONS)) {
2567  }
2568  return 1;
2569 }
2570 
2571 
2572 long
2573 GNEViewNet::onCmdToogleHideConnections(FXObject*, FXSelector sel, void*) {
2574  // Toogle menuCheckHideConnections
2577  } else {
2579  }
2581  // Update viewnNet to show/hide conections
2582  updateViewNet();
2583  // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
2584  if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_HIDECONNECTIONS)) {
2586  }
2587  return 1;
2588 }
2589 
2590 
2591 long
2592 GNEViewNet::onCmdToogleExtendSelection(FXObject*, FXSelector sel, void*) {
2593  // Toogle menuCheckExtendSelection
2596  } else {
2598  }
2600  // Only update view
2601  updateViewNet();
2602  // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
2603  if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_EXTENDSELECTION)) {
2605  }
2606  return 1;
2607 }
2608 
2609 
2610 long
2611 GNEViewNet::onCmdToogleChangeAllPhases(FXObject*, FXSelector sel, void*) {
2612  // Toogle menuCheckChangeAllPhases
2615  } else {
2617  }
2619  // Only update view
2620  updateViewNet();
2621  // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
2622  if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_CHANGEALLPHASES)) {
2624  }
2625  return 1;
2626 }
2627 
2628 
2629 long
2630 GNEViewNet::onCmdToogleShowGrid(FXObject*, FXSelector sel, void*) {
2631  // show or hidde grid depending of myNetworkViewOptions.menuCheckShowGrid
2636  } else {
2640  }
2643  // update view to show grid
2644  updateViewNet();
2645  // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
2646  if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_SHOWGRID)) {
2648  } else if (sel == FXSEL(SEL_COMMAND, MID_GNE_DEMANDVIEWOPTIONS_SHOWGRID)) {
2650  }
2651  return 1;
2652 }
2653 
2654 
2655 long
2656 GNEViewNet::onCmdToogleDrawSpreadVehicles(FXObject*, FXSelector sel, void*) {
2657  // Toogle menuCheckShowDemandElements
2662  } else {
2665  }
2668  // compute vehicle geometry
2669  for (const auto& vehicle : myNet->getAttributeCarriers()->getDemandElements().at(SUMO_TAG_VEHICLE)) {
2670  vehicle.second->updateGeometry();
2671  }
2672  for (const auto& routeFlow : myNet->getAttributeCarriers()->getDemandElements().at(GNE_TAG_FLOW_ROUTE)) {
2673  routeFlow.second->updateGeometry();
2674  }
2675  for (const auto& trip : myNet->getAttributeCarriers()->getDemandElements().at(SUMO_TAG_TRIP)) {
2676  trip.second->updateGeometry();
2677  }
2678  for (const auto& flow : myNet->getAttributeCarriers()->getDemandElements().at(SUMO_TAG_FLOW)) {
2679  flow.second->updateGeometry();
2680  }
2681  // update view to show new vehicles positions
2682  updateViewNet();
2683  // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
2684  if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_DRAWSPREADVEHICLES)) {
2686  } else if (sel == FXSEL(SEL_COMMAND, MID_GNE_DEMANDVIEWOPTIONS_DRAWSPREADVEHICLES)) {
2688  }
2689  return 1;
2690 }
2691 
2692 
2693 long
2694 GNEViewNet::onCmdToogleWarnAboutMerge(FXObject*, FXSelector sel, void*) {
2695  // Toogle menuCheckWarnAboutMerge
2698  } else {
2700  }
2702  // Only update view
2703  updateViewNet();
2704  // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
2705  if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_ASKFORMERGE)) {
2707  }
2708  return 1;
2709 }
2710 
2711 
2712 long
2713 GNEViewNet::onCmdToogleShowJunctionBubbles(FXObject*, FXSelector sel, void*) {
2714  // Toogle menuCheckShowJunctionBubble
2717  } else {
2719  }
2721  // Only update view
2722  updateViewNet();
2723  // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
2724  if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_SHOWBUBBLES)) {
2726  }
2727  return 1;
2728 }
2729 
2730 
2731 long
2732 GNEViewNet::onCmdToogleMoveElevation(FXObject*, FXSelector sel, void*) {
2733  // Toogle menuCheckMoveElevation
2736  } else {
2738  }
2740  // Only update view
2741  updateViewNet();
2742  // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
2743  if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_MOVEELEVATION)) {
2745  }
2746  return 1;
2747 }
2748 
2749 
2750 long
2751 GNEViewNet::onCmdToogleChainEdges(FXObject*, FXSelector sel, void*) {
2752  // Toogle menuCheckMoveElevation
2755  } else {
2757  }
2759  // Only update view
2760  updateViewNet();
2761  // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
2762  if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_CHAINEDGES)) {
2764  }
2765  return 1;
2766 }
2767 
2768 
2769 long
2770 GNEViewNet::onCmdToogleAutoOppositeEdge(FXObject*, FXSelector sel, void*) {
2771  // Toogle menuCheckAutoOppositeEdge
2774  } else {
2776  }
2778  // Only update view
2779  updateViewNet();
2780  // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
2781  if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_AUTOOPPOSITEEDGES)) {
2783  }
2784  return 1;
2785 }
2786 
2787 
2788 long
2789 GNEViewNet::onCmdToogleHideNonInspecteDemandElements(FXObject*, FXSelector sel, void*) {
2790  // Toogle menuCheckHideNonInspectedDemandElements
2793  } else {
2795  }
2797  // Only update view
2798  updateViewNet();
2799  // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
2800  if (sel == FXSEL(SEL_COMMAND, MID_GNE_DEMANDVIEWOPTIONS_HIDENONINSPECTED)) {
2802  }
2803  return 1;
2804 }
2805 
2806 
2807 long
2808 GNEViewNet::onCmdToogleHideShapes(FXObject*, FXSelector sel, void*) {
2809  // Toogle menuCheckHideShapes
2812  } else {
2814  }
2816  // Only update view
2817  updateViewNet();
2818  // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
2819  if (sel == FXSEL(SEL_COMMAND, MID_GNE_DEMANDVIEWOPTIONS_HIDESHAPES)) {
2821  }
2822  return 1;
2823 }
2824 
2825 
2826 long
2827 GNEViewNet::onCmdToogleShowAllPersonPlans(FXObject*, FXSelector sel, void*) {
2828  // Toogle menuCheckShowAllPersonPlans
2831  } else {
2833  }
2835  // Only update view
2836  updateViewNet();
2837  // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
2838  if (sel == FXSEL(SEL_COMMAND, MID_GNE_DEMANDVIEWOPTIONS_SHOWALLPERSONPLANS)) {
2840  }
2841  return 1;
2842 }
2843 
2844 
2845 long
2846 GNEViewNet::onCmdToogleLockPerson(FXObject*, FXSelector sel, void*) {
2847  // Toogle menuCheckLockPerson
2850  } else {
2852  }
2854  // lock or unlock current inspected person depending of menuCheckLockPerson value
2856  // obtan locked person or person plan
2857  const GNEDemandElement* personOrPersonPlan = dynamic_cast<const GNEDemandElement*>(myInspectedAttributeCarriers.front());
2858  if (personOrPersonPlan) {
2859  // lock person depending if casted demand element is either a person or a person plan
2860  if (personOrPersonPlan->getTagProperty().isPerson()) {
2861  myDemandViewOptions.lockPerson(personOrPersonPlan);
2862  // change menuCheckLockPerson text
2863  myDemandViewOptions.menuCheckLockPerson->setText(("unlock " + personOrPersonPlan->getID()).c_str());
2864  } else {
2865  myDemandViewOptions.lockPerson(personOrPersonPlan->getParentDemandElements().front());
2866  // change menuCheckLockPerson text
2867  myDemandViewOptions.menuCheckLockPerson->setText(("unlock " + personOrPersonPlan->getParentDemandElements().front()->getID()).c_str());
2868  }
2869  }
2870  } else {
2871  // unlock current person
2873  // change menuCheckLockPerson text
2874  myDemandViewOptions.menuCheckLockPerson->setText("lock person");
2875  }
2876  // update view
2877  updateViewNet();
2878  // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
2879  if (sel == FXSEL(SEL_COMMAND, MID_GNE_DEMANDVIEWOPTIONS_LOCKPERSON)) {
2881  }
2882  return 1;
2883 }
2884 
2885 
2886 long
2887 GNEViewNet::onCmdToogleShowAdditionals(FXObject*, FXSelector sel, void*) {
2888  // Toogle menuCheckShowAdditionals
2891  } else {
2893  }
2895  // Only update view
2896  updateViewNet();
2897  // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
2898  if (sel == FXSEL(SEL_COMMAND, MID_GNE_DATAVIEWOPTIONS_SHOWADDITIONALS)) {
2900  }
2901  return 1;
2902 }
2903 
2904 
2905 long
2906 GNEViewNet::onCmdToogleShowShapes(FXObject*, FXSelector sel, void*) {
2907  // Toogle menuCheckShowShapes
2910  } else {
2912  }
2914  // Only update view
2915  updateViewNet();
2916  // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
2917  if (sel == FXSEL(SEL_COMMAND, MID_GNE_DATAVIEWOPTIONS_SHOWSHAPES)) {
2919  }
2920  return 1;
2921 }
2922 
2923 
2924 long
2925 GNEViewNet::onCmdToogleShowDemandElements(FXObject*, FXSelector sel, void*) {
2926  // Toogle menuCheckShowDemandElements
2929  } else {
2931  }
2933  // compute demand elements
2935  // update view to show demand elements
2936  updateViewNet();
2937  // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
2938  if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_SHOWDEMANDELEMENTS)) {
2940  } else if (sel == FXSEL(SEL_COMMAND, MID_GNE_DATAVIEWOPTIONS_SHOWDEMANDELEMENTS)) {
2942  }
2943  return 1;
2944 }
2945 
2946 
2947 long
2948 GNEViewNet::onCmdIntervalBarGenericDataType(FXObject*, FXSelector, void*) {
2950  return 1;
2951 }
2952 
2953 
2954 long
2955 GNEViewNet::onCmdIntervalBarDataSet(FXObject*, FXSelector, void*) {
2957  return 1;
2958 }
2959 
2960 
2961 long
2962 GNEViewNet::onCmdIntervalBarLimit(FXObject*, FXSelector, void*) {
2964  return 1;
2965 }
2966 
2967 
2968 long
2969 GNEViewNet::onCmdIntervalBarSetBegin(FXObject*, FXSelector, void*) {
2971  return 1;
2972 }
2973 
2974 
2975 long
2976 GNEViewNet::onCmdIntervalBarSetEnd(FXObject*, FXSelector, void*) {
2978  return 1;
2979 }
2980 
2981 
2982 long
2983 GNEViewNet::onCmdIntervalBarSetAttribute(FXObject*, FXSelector, void*) {
2985  return 1;
2986 }
2987 
2988 
2989 long
2990 GNEViewNet::onCmdAddSelected(FXObject*, FXSelector, void*) {
2991  // make GL current (To allow take objects in popup position)
2992  if (makeCurrent()) {
2996  // make sure that AC is selected before selecting
2997  if (ACToselect && !ACToselect->isAttributeCarrierSelected()) {
2998  ACToselect->selectAttributeCarrier();
2999  }
3000  // make non current
3001  makeNonCurrent();
3002  }
3003  return 1;
3004 }
3005 
3006 
3007 long
3008 GNEViewNet::onCmdRemoveSelected(FXObject*, FXSelector, void*) {
3009  // make GL current (To allow take objects in popup position)
3010  if (makeCurrent()) {
3014  // make sure that AC is selected before unselecting
3015  if (ACToselect && ACToselect->isAttributeCarrierSelected()) {
3016  ACToselect->unselectAttributeCarrier();
3017  }
3018  // make non current
3019  makeNonCurrent();
3020  }
3021  return 1;
3022 }
3023 
3024 // ===========================================================================
3025 // private
3026 // ===========================================================================
3027 
3028 void
3030  // first build supermode buttons
3032 
3033  // build save buttons
3035 
3036  // build menu checks for Common checkable buttons
3038 
3039  // build menu checks for Network checkable buttons
3041 
3042  // build menu checks for Demand checkable buttons
3044 
3045  // build menu checks of view options Data
3047 
3048  // Create Vertical separator
3050 
3051  // build menu checks of view options Network
3053 
3054  // build menu checks of view options Demand
3056 
3057  // build menu checks of view options Data
3059 
3060  // build interval bar
3062 }
3063 
3064 
3065 void
3067  // hide all checkbox of view options Network
3069  // hide all checkbox of view options Demand
3071  // hide all checkbox of view options Data
3073  // disable all common edit modes
3075  // disable all network edit modes
3077  // disable all network edit modes
3079  // hide interval bar
3081  // hide all frames
3083  // In network mode, always show option "show grid", "draw spread vehicles" and "show demand elements"
3087  // enable selected controls
3088  switch (myEditModes.networkEditMode) {
3089  // common modes
3095  // show view options
3098  break;
3105  // show view options
3107  break;
3113  // show view options
3117  break;
3118  // specific modes
3124  // show view options
3127  break;
3133  // show view options
3138  break;
3144  // show view options
3146  break;
3152  // show view options
3154  break;
3160  break;
3166  break;
3172  break;
3178  break;
3184  break;
3185  default:
3186  break;
3187  }
3188  // update common Network buttons
3190  // Update Network buttons
3192  // recalc toolbar
3195  // force repaint because different modes draw different things
3196  onPaint(nullptr, 0, nullptr);
3197  // finally update view
3198  updateViewNet();
3199 }
3200 
3201 
3202 void
3204  // hide all checkbox of view options Network
3206  // hide all checkbox of view options Demand
3208  // hide all checkbox of view options Data
3210  // disable all common edit modes
3212  // disable all Demand edit modes
3214  // disable all network edit modes
3216  // hide interval bar
3218  // hide all frames
3220  // always show "hide shapes", "show grid" and "draw spread vehicles"
3224  // enable selected controls
3225  switch (myEditModes.demandEditMode) {
3226  // common modes
3231  // set checkable button
3233  // show view options
3237  break;
3242  // set checkable button
3244  // show view options
3247  break;
3252  // set checkable button
3254  // show view options
3257  break;
3262  // set checkable button
3264  // show view options
3267  break;
3268  // specific modes
3273  // set checkable button
3275  // show view options
3278  break;
3283  // set checkable button
3285  // show view options
3288  break;
3293  // set checkable button
3295  // show view options
3298  break;
3303  // set checkable button
3305  // show view options
3308  break;
3313  // set checkable button
3315  // show view options
3318  break;
3323  // set checkable button
3325  // show view options
3328  break;
3333  // set checkable button
3335  // show view options
3338  break;
3339  default:
3340  break;
3341  }
3342  // update common Network buttons
3344  // Update Demand buttons
3346  // recalc toolbar
3349  // force repaint because different modes draw different things
3350  onPaint(nullptr, 0, nullptr);
3351  // finally update view
3352  updateViewNet();
3353 }
3354 
3355 
3356 void
3358  // hide all checkbox of view options Network
3360  // hide all checkbox of view options Demand
3362  // hide all checkbox of view options Data
3364  // disable all common edit modes
3366  // disable all Data edit modes
3368  // show interval bar
3370  // hide all frames
3372  // In data mode, always show option "show demand elements" and "hide shapes"
3376  // enable selected controls
3377  switch (myEditModes.dataEditMode) {
3378  // common modes
3383  // set checkable button
3385  // enable IntervalBar
3387  break;
3392  // set checkable button
3394  // enable IntervalBar
3396  break;
3401  // set checkable button
3403  // enable IntervalBar
3405  break;
3410  // set checkable button
3412  // disable IntervalBar
3414  break;
3419  // set checkable button
3421  // disable IntervalBar
3423  break;
3428  // set checkable button
3430  // disable IntervalBar
3432  break;
3433  default:
3434  break;
3435  }
3436  // update common Network buttons
3438  // Update Data buttons
3440  // recalc toolbar
3443  // force repaint because different modes draw different things
3444  onPaint(nullptr, 0, nullptr);
3445  // finally update view
3446  updateViewNet();
3447 }
3448 
3449 void
3451  std::vector<GNEJunction*> junctions = myNet->retrieveJunctions(true);
3452  if (junctions.size() > 0) {
3453  std::string plural = junctions.size() == 1 ? ("") : ("s");
3454  myUndoList->p_begin("delete selected " + toString(SUMO_TAG_JUNCTION) + plural);
3455  for (auto i : junctions) {
3457  }
3458  myUndoList->p_end();
3459  }
3460 }
3461 
3462 
3463 void
3465  std::vector<GNELane*> lanes = myNet->retrieveLanes(true);
3466  if (lanes.size() > 0) {
3467  std::string plural = lanes.size() == 1 ? ("") : ("s");
3468  myUndoList->p_begin("delete selected " + toString(SUMO_TAG_LANE) + plural);
3469  for (auto i : lanes) {
3470  // when deleting multiple lanes, recompute connections
3471  myNet->deleteLane(i, myUndoList, true);
3472  }
3473  myUndoList->p_end();
3474  }
3475 }
3476 
3477 
3478 void
3480  std::vector<GNEEdge*> edges = myNet->retrieveEdges(true);
3481  if (edges.size() > 0) {
3482  std::string plural = edges.size() == 1 ? ("") : ("s");
3483  myUndoList->p_begin("delete selected " + toString(SUMO_TAG_EDGE) + plural);
3484  for (auto i : edges) {
3485  // when deleting multiple edges, recompute connections
3486  myNet->deleteEdge(i, myUndoList, true);
3487  }
3488  myUndoList->p_end();
3489  }
3490 }
3491 
3492 
3493 void
3495  const std::vector<GNEAdditional*> selectedAdditionals = myNet->retrieveAdditionals(true);
3496  if (selectedAdditionals.size() > 0) {
3497  std::string plural = selectedAdditionals.size() == 1 ? ("") : ("s");
3498  myUndoList->p_begin("delete selected additional" + plural);
3499  // do it in two phases: In the first phase remove slaves...
3500  for (const auto& selectedAdditional : selectedAdditionals) {
3501  if (selectedAdditional->getTagProperty().isSlave()) {
3502  myNet->deleteAdditional(selectedAdditional, myUndoList);
3503  }
3504  }
3505  // ... and in the second remove rest
3506  for (const auto& selectedAdditional : selectedAdditionals) {
3507  if (!selectedAdditional->getTagProperty().isSlave()) {
3508  myNet->deleteAdditional(selectedAdditional, myUndoList);
3509  }
3510  }
3511  myUndoList->p_end();
3512  }
3513 }
3514 
3515 
3516 void
3518  std::vector<GNEDemandElement*> demandElements = myNet->retrieveDemandElements(true);
3519  if (demandElements.size() > 0) {
3520  std::string plural = demandElements.size() == 1 ? ("") : ("s");
3521  myUndoList->p_begin("delete selected demand elements" + plural);
3522  // declare vector for persons
3523  std::vector<GNEDemandElement*> persons;
3524  for (const auto& demandElement : demandElements) {
3525  // check if element is a personplan
3526  if (demandElement->getTagProperty().isPersonPlan()) {
3527  persons.push_back(demandElement->getParentDemandElements().front());
3528  }
3529  // due there are demand elements that are removed when their parent is removed, we need to check if yet exists before removing
3530  if (myNet->retrieveDemandElement(demandElement->getTagProperty().getTag(), demandElement->getID(), false) != nullptr) {
3531  myNet->deleteDemandElement(demandElement, myUndoList);
3532  }
3533  }
3534  // check if we have to remove empty persons
3535  for (const auto& person : persons) {
3536  // due person could be removed previously, check if exist
3537  if (person->getChildDemandElements().empty() && myNet->retrieveDemandElement(person->getTagProperty().getTag(), person->getID(), false) != nullptr) {
3539  }
3540  }
3541  myUndoList->p_end();
3542  }
3543 }
3544 
3545 
3546 void
3548  std::vector<GNEGenericData*> genericDatas = myNet->retrieveGenericDatas(true);
3549  if (genericDatas.size() > 0) {
3550  std::string plural = genericDatas.size() == 1 ? ("") : ("s");
3551  myUndoList->p_begin("delete selected generic data" + plural);
3552  // iterate over generic datas
3553  for (const auto& genericData : genericDatas) {
3554  myNet->deleteGenericData(genericData, myUndoList);
3555  }
3556  myUndoList->p_end();
3557  }
3558 }
3559 
3560 
3561 void
3563  // obtain selected crossings
3564  std::vector<GNEJunction*> junctions = myNet->retrieveJunctions();
3565  std::vector<GNECrossing*> crossings;
3566  for (auto i : junctions) {
3567  for (auto j : i->getGNECrossings()) {
3568  if (j->isAttributeCarrierSelected()) {
3569  crossings.push_back(j);
3570  }
3571  }
3572  }
3573  // remove selected crossings
3574  if (crossings.size() > 0) {
3575  std::string plural = crossings.size() == 1 ? ("") : ("s");
3576  myUndoList->p_begin("delete selected " + toString(SUMO_TAG_CROSSING) + "s");
3577  for (auto i : crossings) {
3578  if (myNet->retrieveCrossing(i->getID(), false)) {
3580  }
3581  }
3582  myUndoList->p_end();
3583  }
3584 }
3585 
3586 
3587 void
3589  // obtain selected connections
3590  std::vector<GNEEdge*> edges = myNet->retrieveEdges();
3591  std::vector<GNEConnection*> connections;
3592  for (auto i : edges) {
3593  for (auto j : i->getGNEConnections()) {
3594  if (j->isAttributeCarrierSelected()) {
3595  connections.push_back(j);
3596  }
3597  }
3598  }
3599  // remove selected connections
3600  if (connections.size() > 0) {
3601  std::string plural = connections.size() == 1 ? ("") : ("s");
3602  myUndoList->p_begin("delete selected " + toString(SUMO_TAG_CONNECTION) + plural);
3603  for (auto i : connections) {
3605  }
3606  myUndoList->p_end();
3607  }
3608 }
3609 
3610 
3611 void
3613  // obtain selected shapes
3614  std::vector<GNEShape*> selectedShapes = myNet->retrieveShapes(true);
3615  // remove it
3616  if (selectedShapes.size() > 0) {
3617  std::string plural = selectedShapes.size() == 1 ? ("") : ("s");
3618  myUndoList->p_begin("delete selected shape" + plural);
3619  for (auto i : selectedShapes) {
3621  }
3622  myUndoList->p_end();
3623  }
3624 }
3625 
3626 
3627 void
3629  // obtain selected TAZ Elements
3630  std::vector<GNETAZElement*> selectedTAZElements = myNet->retrieveTAZElements(true);
3631  // remove it
3632  if (selectedTAZElements.size() > 0) {
3633  std::string plural = selectedTAZElements.size() == 1 ? ("") : ("s");
3634  myUndoList->p_begin("delete selected TAZ" + plural);
3635  for (auto i : selectedTAZElements) {
3637  }
3638  myUndoList->p_end();
3639  }
3640 }
3641 
3642 
3643 void
3645  switch (myEditModes.networkEditMode) {
3647  myViewParent->getInspectorFrame()->update();
3648  break;
3649  default:
3650  break;
3651  }
3652  // update view
3653  updateViewNet();
3654 }
3655 
3656 // ---------------------------------------------------------------------------
3657 // Private methods
3658 // ---------------------------------------------------------------------------
3659 
3660 void
3663  // draw first point
3665  // Push draw matrix
3666  glPushMatrix();
3667  // obtain first clicked point
3668  const Position& firstLanePoint = myViewParent->getAdditionalFrame()->getConsecutiveLaneSelector()->getSelectedLanes().front().first->getLaneShape().positionAtOffset(
3670  // must draw on top of other connections
3671  glTranslated(firstLanePoint.x(), firstLanePoint.y(), GLO_JUNCTION + 0.3);
3673  // draw first point
3675  GLHelper::drawText("S", Position(), .1, 1.3, RGBColor::CYAN);
3676  // pop draw matrix
3677  glPopMatrix();
3678  }
3679  // draw connections between lanes
3681  // iterate over all current selected lanes
3682  for (int i = 0; i < (int)myViewParent->getAdditionalFrame()->getConsecutiveLaneSelector()->getSelectedLanes().size() - 1; i++) {
3683  // declare position vector for shape
3684  PositionVector shape;
3685  // declare vectors for shape rotation and lengths
3686  std::vector<double> shapeRotations, shapeLengths;
3687  // obtain GNELanes
3690  // Push draw matrix
3691  glPushMatrix();
3692  // must draw on top of other connections
3693  glTranslated(0, 0, GLO_JUNCTION + 0.2);
3694  // obtain connection shape
3695  shape = from->getParentEdge()->getNBEdge()->getConnection(from->getIndex(), to->getParentEdge()->getNBEdge(), to->getIndex()).shape;
3696  // set special color
3698  // Obtain lengths and shape rotations
3699  int segments = (int) shape.size() - 1;
3700  if (segments >= 0) {
3701  shapeRotations.reserve(segments);
3702  shapeLengths.reserve(segments);
3703  for (int j = 0; j < segments; j++) {
3704  shapeLengths.push_back(GNEGeometry::calculateLength(shape[j], shape[j + 1]));
3705  shapeRotations.push_back(GNEGeometry::calculateRotation(shape[j], shape[j + 1]));
3706  }
3707  }
3708  // draw a list of lines
3709  GLHelper::drawBoxLines(shape, shapeRotations, shapeLengths, 0.2);
3710  // pop draw matrix
3711  glPopMatrix();
3712  }
3713  // draw last point
3714  glPushMatrix();
3715  // obtain last clicked point
3716  const Position& lastLanePoint = myViewParent->getAdditionalFrame()->getConsecutiveLaneSelector()->getSelectedLanes().back().first->getLaneShape().positionAtOffset(
3718  // must draw on top of other connections
3719  glTranslated(lastLanePoint.x(), lastLanePoint.y(), GLO_JUNCTION + 0.3);
3721  // draw last point
3722  GLHelper::drawFilledCircle((double) 1.3, 8);
3723  GLHelper::drawText("E", Position(), .1, 1.3, RGBColor::CYAN);
3724  // pop draw matrix
3725  glPopMatrix();
3726  }
3727 
3728  }
3729 }
3730 
3731 
3732 void
3734  PositionVector temporalShape;
3735  bool deleteLastCreatedPoint = false;
3736  // obtain temporal shape and delete last created point flag
3742  deleteLastCreatedPoint = myViewParent->getTAZFrame()->getDrawingShapeModul()->getDeleteLastCreatedPoint();
3743  }
3744  // check if we're in drawing mode
3745  if (temporalShape.size() > 0) {
3746  // draw blue line with the current drawed shape
3747  glPushMatrix();
3748  glLineWidth(2);
3749  glTranslated(0, 0, GLO_TEMPORALSHAPE);
3751  GLHelper::drawLine(temporalShape);
3752  glPopMatrix();
3753  // draw red line from the last point of shape to the current mouse position
3754  glPushMatrix();
3755  glLineWidth(2);
3756  glTranslated(0, 0, GLO_TEMPORALSHAPE);
3757  // draw last line depending if shift key (delete last created point) is pressed
3758  if (deleteLastCreatedPoint) {
3760  } else {
3762  }
3764  glPopMatrix();
3765  }
3766 }
3767 
3768 
3769 void
3771  // first check if we're in correct mode
3776  // get mouse position
3777  const Position mousePosition = snapToActiveGrid(getPositionInformation());
3778  // get buble color
3780  // change alpha
3781  bubbleColor.setAlpha(200);
3782  // push layer matrix
3783  glPushMatrix();
3784  // translate to temporal shape layer
3785  glTranslated(0, 0, GLO_TEMPORALSHAPE);
3786  // push junction matrix
3787  glPushMatrix();
3788  // move matrix junction center
3789  glTranslated(mousePosition.x(), mousePosition.y(), 0.1);
3790  // set color
3791  GLHelper::setColor(bubbleColor);
3792  // draw filled circle
3794  // pop junction matrix
3795  glPopMatrix();
3796  // draw temporal edge
3798  // set temporal edge color
3799  RGBColor temporalEdgeColor = RGBColor::BLACK;
3800  temporalEdgeColor.setAlpha(200);
3801  // declare temporal edge geometry
3802  GNEGeometry::Geometry temporalEdgeGeometery;
3803  // calculate geometry between source junction and mouse position
3804  PositionVector temporalEdge = {mousePosition, myViewParent->getCreateEdgeFrame()->getJunctionSource()->getPositionInView()};
3805  // move temporal edge 2 side
3806  temporalEdge.move2side(-1);
3807  // update geometry
3808  temporalEdgeGeometery.updateGeometry(temporalEdge);
3809  // push temporal edge matrix
3810  glPushMatrix();
3811  // set color
3812  GLHelper::setColor(temporalEdgeColor);
3813  // draw temporal edge
3814  GNEGeometry::drawGeometry(this, temporalEdgeGeometery, 0.75);
3815  // check if we have to draw opposite edge
3817  // move temporal edge to opposite edge
3818  temporalEdge.move2side(2);
3819  // update geometry
3820  temporalEdgeGeometery.updateGeometry(temporalEdge);
3821  // draw temporal edge
3822  GNEGeometry::drawGeometry(this, temporalEdgeGeometery, 0.75);
3823  }
3824  // pop temporal edge matrix
3825  glPopMatrix();
3826  }
3827  // pop layer matrix
3828  glPopMatrix();
3829  }
3830 }
3831 
3832 
3833 void
3835  // decide what to do based on mode
3836  switch (myEditModes.networkEditMode) {
3838  // first swap lane to edges if mySelectEdges is enabled and shift key isn't pressed
3841  }
3842  // process left click in Inspector Frame
3844  // process click
3845  processClick(eventData);
3846  break;
3847  }
3849  // first swap lane to edges if mySelectEdges is enabled and shift key isn't pressed
3852  }
3853  // check that we have clicked over network element element
3859  // now check if we want only delete geometry points
3861  // only remove geometry point
3864  // remove all selected attribute carriers
3866  } else {
3867  // remove attribute carrier under cursor
3869  }
3870  } else {
3871  // process click
3872  processClick(eventData);
3873  }
3874  break;
3875  }
3877  // first swap lane to edges if mySelectEdges is enabled and shift key isn't pressed
3880  }
3881  // avoid to select if control key is pressed
3883  // check if a rect for selecting is being created
3885  // begin rectangle selection
3887  } else {
3888  // first check that under cursor there is an attribute carrier, isn't a demand element and is selectable
3890  // Check if this GLobject type is locked
3892  // toogle networkElement selection
3895  } else {
3897  }
3898  }
3899  }
3900  // process click
3901  processClick(eventData);
3902  }
3903  } else {
3904  // process click
3905  processClick(eventData);
3906  }
3907  break;
3909  // check what buttons are pressed
3911  // get edge under cursor
3913  if (edge) {
3914  // obtain reverse edge
3915  GNEEdge* reverseEdge = edge->getOppositeEdge();
3916  // check if we're split one or both edges
3919  } else if (reverseEdge) {
3920  myNet->splitEdgesBidi(edge, reverseEdge, edge->getSplitPos(getPositionInformation()), myUndoList);
3921  } else {
3923  }
3924  }
3926  // check if we have to update objects under snapped cursor
3929  } else {
3931  }
3932  // process left click in create edge frame Frame
3937  }
3938  // process click
3939  processClick(eventData);
3940  break;
3941  }
3943  // first swap lane to edges if mySelectEdges is enabled and shift key isn't pressed
3946  }
3947  // check if we're editing a shape
3949  // check if we're removing a geometry point
3951  // remove geometry point
3954  }
3956  // process click if there isn't movable elements (to move camera using drag an drop)
3957  processClick(eventData);
3958  }
3959  } else {
3960  // allways swap lane to edges in movement mode
3962  // check that AC under cursor isn't a demand element
3964  // check if we're moving a set of selected items
3966  // move selected ACs
3968  // update view
3969  updateViewNet();
3971  // process click if there isn't movable elements (to move camera using drag an drop)
3972  processClick(eventData);
3973  }
3974  } else {
3975  // process click if there isn't movable elements (to move camera using drag an drop)
3976  processClick(eventData);
3977  }
3978  }
3979  break;
3980  }
3982  // check if we're clicked over a lane
3984  // Handle laneclick (shift key may pass connections, Control key allow conflicts)
3986  updateViewNet();
3987  }
3988  // process click
3989  processClick(eventData);
3990  break;
3991  }
3994  // edit TLS in TLSEditor frame
3996  updateViewNet();
3997  }
3998  // process click
3999  processClick(eventData);
4000  break;
4001  }
4003  // avoid create additionals if control key is pressed
4006  // check if we need to start select lanes
4008  // select getLaneFront() to create an additional with consecutive lanes
4010  } else if (myObjectsUnderCursor.getLaneFront()) {
4012  }
4014  // update view to show the new additional
4015  updateViewNet();
4016  }
4017  }
4018  // process click
4019  processClick(eventData);
4020  break;
4021  }
4023  // swap lanes to edges in crossingsMode
4025  // call function addCrossing from crossing frame
4027  // process click
4028  processClick(eventData);
4029  break;
4030  }
4032  // swap lanes to edges in TAZ Mode
4034  // avoid create TAZs if control key is pressed
4036  // check if we want to create a rect for selecting edges
4038  // begin rectangle selection
4040  } else {
4041  // check if process click was scuesfully
4043  // view net must be always update
4044  updateViewNet();
4045  }
4046  // process click
4047  processClick(eventData);
4048  }
4049  } else {
4050  // process click
4051  processClick(eventData);
4052  }
4053  break;
4054  }
4056  // avoid create shapes if control key is pressed
4060  // view net must be always update
4061  updateViewNet();
4062  // process click depending of the result of "process click"
4064  // process click
4065  processClick(eventData);
4066  }
4067  }
4068  } else {
4069  // process click
4070  processClick(eventData);
4071  }
4072  break;
4073  }
4076  // shift key may pass connections, Control key allow conflicts.
4078  updateViewNet();
4079  }
4080  // process click
4081  processClick(eventData);
4082  break;
4083  }
4084  default: {
4085  // process click
4086  processClick(eventData);
4087  }
4088  }
4089 }
4090 
4091 
4092 void
4094  // check moved items
4098  // check if we're creating a rectangle selection or we want only to select a lane
4100  // check if we're selecting all type of elements o we only want a set of edges for TAZ
4104  // process edge selection
4106  }
4108  // obtain objects under cursor
4109  if (makeCurrent()) {
4110  // update objects under cursor again
4112  makeNonCurrent();
4113  }
4114  // check if there is a lane in objects under cursor
4116  // if we clicked over an lane with shift key pressed, select or unselect it
4119  } else {
4121  }
4122  }
4123  }
4124  // finish selection
4126  } else {
4127  // finish moving of single elements
4129  }
4130 }
4131 
4132 
4133 void
4134 GNEViewNet::processMoveMouseNetwork(const bool mouseLeftButtonPressed) {
4135  // change "delete last created point" depending if during movement shift key is pressed
4140  }
4141  // check what type of additional is moved
4143  // move entire selection
4144  myMoveMultipleElementValues.moveSelection(mouseLeftButtonPressed);
4146  // update selection corner of selecting area
4148  } else {
4149  // move single elements
4150  myMoveSingleElementValues.moveSingleElement(mouseLeftButtonPressed);
4151  }
4152 }
4153 
4154 
4155 void
4157  // decide what to do based on mode
4158  switch (myEditModes.demandEditMode) {
4160  // process left click in Inspector Frame
4162  // process click
4163  processClick(eventData);
4164  break;
4165  }
4167  // check that we have clicked over an demand element
4169  // check if we are deleting a selection or an single attribute carrier
4172  } else {
4174  }
4175  } else {
4176  // process click
4177  processClick(eventData);
4178  }
4179  break;
4180  }
4182  // avoid to select if control key is pressed
4184  // check if a rect for selecting is being created
4186  // begin rectangle selection
4188  } else {
4189  // first check that under cursor there is an attribute carrier, is demand element and is selectable
4191  // Check if this GLobject type is locked
4193  // toogle networkElement selection
4196  } else {
4198  }
4199  }
4200  }
4201  // process click
4202  processClick(eventData);
4203  }
4204  } else {
4205  // process click
4206  processClick(eventData);
4207  }
4208  break;
4210  // check that AC under cursor is a demand element
4213  // check if we're moving a set of selected items
4215  // move selected ACs
4217  // update view
4218  updateViewNet();
4220  // process click if there isn't movable elements (to move camera using drag an drop)
4221  processClick(eventData);
4222  }
4223  } else {
4224  // process click if there isn't movable elements (to move camera using drag an drop)
4225  processClick(eventData);
4226  }
4227  break;
4228  }
4230  // check if we clicked over a lane
4232  // Handle edge click
4234  }
4235  // process click
4236  processClick(eventData);
4237  break;
4238  }
4240  // Handle click
4242  // process click
4243  processClick(eventData);
4244  break;
4245  }
4247  // Handle click
4249  // process click
4250  processClick(eventData);
4251  break;
4252  }
4254  // Handle click
4256  // process click
4257  processClick(eventData);
4258  break;
4259  }
4261  // Handle person plan click
4263  // process click
4264  processClick(eventData);
4265  break;
4266  }
4267  default: {
4268  // process click
4269  processClick(eventData);
4270  }
4271  }
4272 }
4273 
4274 
4275 void
4277  // check moved items
4281  // check if we're creating a rectangle selection or we want only to select a lane
4284  }
4285  // finish selection
4287  } else {
4288  // finish moving of single elements
4290  }
4291 }
4292 
4293 
4294 void
4295 GNEViewNet::processMoveMouseDemand(const bool mouseLeftButtonPressed) {
4297  // update selection corner of selecting area
4299  } else {
4300  // move single elements
4301  myMoveSingleElementValues.moveSingleElement(mouseLeftButtonPressed);
4302  }
4303 }
4304 
4305 
4306 void
4308  // decide what to do based on mode
4309  switch (myEditModes.dataEditMode) {
4311  // process left click in Inspector Frame
4313  // process click
4314  processClick(eventData);
4315  break;
4316  }
4318  // check that we have clicked over an data element
4320  // check if we are deleting a selection or an single attribute carrier
4323  } else {
4325  }
4326  } else {
4327  // process click
4328  processClick(eventData);
4329  }
4330  break;
4331  }
4333  // avoid to select if control key is pressed
4335  // check if a rect for selecting is being created
4337  // begin rectangle selection
4339  } else {
4340  // first check that under cursor there is an attribute carrier, is data element and is selectable
4342  // Check if this GLobject type is locked
4344  // toogle networkElement selection
4347  } else {
4349  }
4350  }
4351  }
4352  // process click
4353  processClick(eventData);
4354  }
4355  } else {
4356  // process click
4357  processClick(eventData);
4358  }
4359  break;
4361  // avoid create edgeData if control key is pressed
4364  // update view to show the new edge data
4365  updateViewNet();
4366  }
4367  }
4368  // process click
4369  processClick(eventData);
4370  break;
4372  // avoid create edgeData if control key is pressed
4375  // update view to show the new edge data
4376  updateViewNet();
4377  }
4378  }
4379  // process click
4380  processClick(eventData);
4381  break;
4383  // avoid create TAZData if control key is pressed
4386  // update view to show the new TAZ data
4387  updateViewNet();
4388  }
4389  }
4390  // process click
4391  processClick(eventData);
4392  break;
4393  default: {
4394  // process click
4395  processClick(eventData);
4396  }
4397  }
4398 }
4399 
4400 
4401 void
4403  // check moved items
4407  // check if we're creating a rectangle selection or we want only to select a lane
4410  }
4411  // finish selection
4413  } else {
4414  // finish moving of single elements
4416  }
4417 }
4418 
4419 
4420 void
4421 GNEViewNet::processMoveMouseData(const bool mouseLeftButtonPressed) {
4423  // update selection corner of selecting area
4425  } else {
4426  // move single elements
4427  myMoveSingleElementValues.moveSingleElement(mouseLeftButtonPressed);
4428  }
4429 }
4430 
4431 
4432 /****************************************************************************/
4433 
FXDEFMAP(GNEViewNet) GNEViewNetMap[]
@ DATA_EDGERELDATA
mode for create edgeRelData elements
@ DATA_SELECT
mode for selecting data elements
@ DATA_TAZRELDATA
mode for create TAZRelData elements
@ DATA_INSPECT
mode for inspecting data elements
@ DATA_EDGEDATA
mode for create edgeData elements
@ DATA_DELETE
mode for deleting data elements
@ NETWORK
Network mode (Edges, junctions, etc..)
@ DATA
Data mode (edgeData, LaneData etc..)
@ DEMAND
Demand mode (Routes, Vehicles etc..)
@ NETWORK_DELETE
mode for deleting network elements
@ NETWORK_MOVE
mode for moving network elements
@ NETWORK_ADDITIONAL
Mode for editing additionals.
@ NETWORK_TAZ
Mode for editing TAZ.
@ NETWORK_CREATE_EDGE
mode for creating new edges
@ NETWORK_TLS
mode for editing tls
@ NETWORK_CROSSING
Mode for editing crossing.
@ NETWORK_POLYGON
Mode for editing Polygons.
@ NETWORK_SELECT
mode for selecting network elements
@ NETWORK_INSPECT
mode for inspecting network elements
@ NETWORK_PROHIBITION
Mode for editing connection prohibitions.
@ NETWORK_CONNECT
mode for connecting lanes
@ DEMAND_PERSONPLAN
Mode for editing person plan.
@ DEMAND_INSPECT
mode for inspecting demand elements
@ DEMAND_DELETE
mode for deleting demand elements
@ DEMAND_VEHICLETYPES
Mode for editing vehicle types.
@ DEMAND_PERSONTYPES
Mode for editing person types.
@ DEMAND_PERSON
Mode for editing person.
@ DEMAND_SELECT
mode for selecting demand elements
@ DEMAND_ROUTE
Mode for editing routes.
@ DEMAND_VEHICLE
Mode for editing vehicles.
@ DEMAND_MOVE
mode for moving demand elements
@ DEMAND_STOP
Mode for editing stops.
@ MID_GNE_NETWORKVIEWOPTIONS_AUTOOPPOSITEEDGES
automatically create opposite edge
Definition: GUIAppEnum.h:656
@ MID_HOTKEY_F3_SUPERMODE_DEMAND
select demand supermode in NETEDIT
Definition: GUIAppEnum.h:181
@ MID_GNE_DEMANDVIEWOPTIONS_SHOWALLPERSONPLANS
show all person plans
Definition: GUIAppEnum.h:672
@ MID_GNE_LANE_TRANSFORM_BIKE
transform lane to bikelane
Definition: GUIAppEnum.h:1053
@ MID_GNE_EDGE_REVERSE
reverse an edge
Definition: GUIAppEnum.h:969
@ MID_GNE_LANE_ADD_GREENVERGE
add greenVerge
Definition: GUIAppEnum.h:1065
@ MID_LOCATEPERSON
Locate person - button.
Definition: GUIAppEnum.h:349
@ MID_GNE_NETWORKVIEWOPTIONS_SHOWGRID
show grid
Definition: GUIAppEnum.h:632
@ MID_ADDSELECT
Add to selected items - menu entry.
Definition: GUIAppEnum.h:427
@ MID_GNE_LANE_ADD_BUS
add busLane
Definition: GUIAppEnum.h:1063
@ MID_HOTKEY_T_MODES_TLS_VTYPE
hotkey for mode editing TLS AND Vehicle Types
Definition: GUIAppEnum.h:61
@ MID_GNE_NETWORKVIEWOPTIONS_DRAWSPREADVEHICLES
Draw vehicles in begin position or spread in lane.
Definition: GUIAppEnum.h:634
@ MID_GNE_NETWORKVIEWOPTIONS_MOVEELEVATION
move elevation instead of x,y
Definition: GUIAppEnum.h:652
@ MID_HOTKEY_S_MODES_SELECT
hotkey for mode selecting objects
Definition: GUIAppEnum.h:57
@ MID_LOCATEJUNCTION
Locate junction - button.
Definition: GUIAppEnum.h:339
@ MID_GNE_NETWORKVIEWOPTIONS_HIDECONNECTIONS
hide connections
Definition: GUIAppEnum.h:642
@ MID_GNE_NETWORKVIEWOPTIONS_SHOWCONNECTIONS
show connections
Definition: GUIAppEnum.h:640
@ MID_GNE_INTERVALBAR_BEGIN
begin changed in InterbalBar
Definition: GUIAppEnum.h:700
@ MID_GNE_DEMANDVIEWOPTIONS_LOCKPERSON
lock person
Definition: GUIAppEnum.h:674
@ MID_HOTKEY_V_MODES_VEHICLE
hotkey for mode create vehicles
Definition: GUIAppEnum.h:63
@ MID_HOTKEY_E_MODES_EDGE_EDGEDATA
hotkey for mode adding edges AND edgeDatas
Definition: GUIAppEnum.h:49
@ MID_LOCATEPOLY
Locate polygons - button.
Definition: GUIAppEnum.h:359
@ MID_GNE_JUNCTION_CLEAR_CONNECTIONS
clear junction's connections
Definition: GUIAppEnum.h:981
@ MID_GNE_JUNCTION_SELECT_ROUNDABOUT
select all roundabout nodes and edges of the current roundabout
Definition: GUIAppEnum.h:995
@ MID_GNE_INTERVALBAR_ATTRIBUTE
attribute changed in InterbalBar
Definition: GUIAppEnum.h:704
@ MID_GNE_JUNCTION_RESET_SHAPE
reset junction shape
Definition: GUIAppEnum.h:993
@ MID_GNE_NETWORKVIEWOPTIONS_ASKFORMERGE
ask before merging junctions
Definition: GUIAppEnum.h:648
@ MID_GNE_JUNCTION_RESET_CONNECTIONS
reset junction's connections
Definition: GUIAppEnum.h:983
@ MID_GNE_DEMANDVIEWOPTIONS_SHOWGRID
show grid
Definition: GUIAppEnum.h:664
@ MID_GNE_JUNCTION_SPLIT
turn junction into multiple junctions
Definition: GUIAppEnum.h:987
@ MID_HOTKEY_W_MODES_PROHIBITION_PERSONTYPE
hotkey for mode editing connection prohibitions AND person types
Definition: GUIAppEnum.h:65
@ MID_GNE_EDGE_STRAIGHTEN_ELEVATION
interpolate z values linear between junctions
Definition: GUIAppEnum.h:961
@ MID_GNE_NETWORKVIEWOPTIONS_CHAINEDGES
create edges in chain mode
Definition: GUIAppEnum.h:654
@ MID_HOTKEY_R_MODES_CROSSING_ROUTE_EDGERELDATA
hotkey for mode editing crossing, routes and edge rel datas
Definition: GUIAppEnum.h:59
@ MID_GNE_DATAVIEWOPTIONS_SHOWDEMANDELEMENTS
show demand elements
Definition: GUIAppEnum.h:686
@ MID_GNE_POLYGON_CLOSE
close opened polygon
Definition: GUIAppEnum.h:1025
@ MID_GNE_EDGE_SMOOTH
smooth geometry
Definition: GUIAppEnum.h:959
@ MID_HOTKEY_I_MODES_INSPECT
hotkey for mode inspecting object attributes
Definition: GUIAppEnum.h:51
@ MID_LOCATEADD
Locate addtional structure - button.
Definition: GUIAppEnum.h:355
@ MID_LOCATEPOI
Locate poi - button.
Definition: GUIAppEnum.h:357
@ MID_GNE_LANE_RESET_CUSTOMSHAPE
remove greenVerge
Definition: GUIAppEnum.h:1049
@ MID_GNE_EDGE_STRAIGHTEN
remove inner geometry
Definition: GUIAppEnum.h:957
@ MID_GNE_DEMANDVIEWOPTIONS_HIDESHAPES
hide shapes
Definition: GUIAppEnum.h:670
@ MID_HOTKEY_P_MODES_POLYGON_PERSON
hotkey for mode creating polygons
Definition: GUIAppEnum.h:55
@ MID_GNE_LANE_TRANSFORM_BUS
transform lane to busLane
Definition: GUIAppEnum.h:1055
@ MID_GNE_POLYGON_SET_FIRST_POINT
Set a vertex of polygon as first verte.
Definition: GUIAppEnum.h:1029
@ MID_GNE_LANE_DUPLICATE
duplicate a lane
Definition: GUIAppEnum.h:1047
@ MID_GNE_DATAVIEWOPTIONS_SHOWADDITIONALS
show additionals
Definition: GUIAppEnum.h:682
@ MID_GNE_NETWORKVIEWOPTIONS_SHOWBUBBLES
show junctions as bubbles
Definition: GUIAppEnum.h:650
@ MID_GNE_INTERVALBAR_END
end changed in InterbalBar
Definition: GUIAppEnum.h:702
@ MID_HOTKEY_Z_MODES_TAZ_TAZREL
hotkey for mode editing TAZ and TAZRel
Definition: GUIAppEnum.h:67
@ MID_HOTKEY_M_MODES_MOVE
hotkey for mode moving element
Definition: GUIAppEnum.h:53
@ MID_GNE_NETWORKVIEWOPTIONS_EXTENDSELECTION
extend selection
Definition: GUIAppEnum.h:644
@ MID_GNE_LANE_REMOVE_GREENVERGE
remove greenVerge
Definition: GUIAppEnum.h:1073
@ MID_GNE_EDGE_SPLIT_BIDI
split an edge
Definition: GUIAppEnum.h:967
@ MID_GNE_JUNCTION_REPLACE
turn junction into geometry node
Definition: GUIAppEnum.h:985
@ MID_HOTKEY_F4_SUPERMODE_DATA
select data supermode in NETEDIT
Definition: GUIAppEnum.h:183
@ MID_LOCATESTOP
Locate stop - button.
Definition: GUIAppEnum.h:347
@ MID_GNE_LANE_REMOVE_BIKE
remove bikelane
Definition: GUIAppEnum.h:1069
@ MID_GNE_POI_TRANSFORM
Transform POI to POILane, and viceversa.
Definition: GUIAppEnum.h:1039
@ MID_GNE_JUNCTION_CONVERT_ROUNDABOUT
convert junction to roundabout
Definition: GUIAppEnum.h:997
@ MID_REACHABILITY
show reachability from a given lane
Definition: GUIAppEnum.h:471
@ MID_GNE_EDGE_RESET_LENGTH
reset custom lengths
Definition: GUIAppEnum.h:973
@ MID_GNE_LANE_REMOVE_BUS
remove busLane
Definition: GUIAppEnum.h:1071
@ MID_HOTKEY_A_MODES_ADDITIONAL_STOP
hotkey for mode editing additionals AND stops
Definition: GUIAppEnum.h:43
@ MID_GNE_NETWORKVIEWOPTIONS_SHOWDEMANDELEMENTS
show demand elements
Definition: GUIAppEnum.h:636
@ MID_GNE_JUNCTION_SPLIT_RECONNECT
turn junction into multiple junctions and reconnect them heuristically
Definition: GUIAppEnum.h:989
@ MID_OPEN_ADDITIONAL_DIALOG
open additional dialog (used in netedit)
Definition: GUIAppEnum.h:411
@ MID_GNE_DEMANDVIEWOPTIONS_HIDENONINSPECTED
hide non-inspected demand element
Definition: GUIAppEnum.h:668
@ MID_HOTKEY_C_MODES_CONNECT_PERSONPLAN
hotkey for mode connecting lanes
Definition: GUIAppEnum.h:45
@ MID_GNE_JUNCTION_EDIT_SHAPE
edit junction shape
Definition: GUIAppEnum.h:991
@ MID_GNE_LANE_REMOVE_SIDEWALK
remove sidewalk
Definition: GUIAppEnum.h:1067
@ MID_GNE_EDGE_RESET_ENDPOINT
reset default geometry endpoints
Definition: GUIAppEnum.h:955
@ MID_GNE_INTERVALBAR_GENERICDATATYPE
generic data selected
Definition: GUIAppEnum.h:694
@ MID_LOCATEEDGE
Locate edge - button.
Definition: GUIAppEnum.h:341
@ MID_GNE_EDGE_SMOOTH_ELEVATION
smooth elevation with regard to adjoining edges
Definition: GUIAppEnum.h:963
@ MID_GNE_NETWORKVIEWOPTIONS_CHANGEALLPHASES
change all phases
Definition: GUIAppEnum.h:646
@ MID_GNE_DATAVIEWOPTIONS_SHOWSHAPES
show shapes
Definition: GUIAppEnum.h:684
@ MID_GNE_EDGE_ADD_REVERSE
add reverse edge
Definition: GUIAppEnum.h:971
@ MID_LOCATEVEHICLE
Locate vehicle - button.
Definition: GUIAppEnum.h:343
@ MID_LOCATETLS
Locate TLS - button.
Definition: GUIAppEnum.h:353
@ MID_GNE_DEMANDVIEWOPTIONS_DRAWSPREADVEHICLES
Draw vehicles in begin position or spread in lane.
Definition: GUIAppEnum.h:666
@ MID_GNE_LANE_ADD_SIDEWALK
add sidewalk
Definition: GUIAppEnum.h:1059
@ MID_GNE_CONNECTION_EDIT_SHAPE
edit junction shape
Definition: GUIAppEnum.h:1005
@ MID_GNE_INTERVALBAR_DATASET
data set selected
Definition: GUIAppEnum.h:696
@ MID_GNE_LANE_TRANSFORM_SIDEWALK
transform lane to sidewalk
Definition: GUIAppEnum.h:1051
@ MID_GNE_LANE_ADD_BIKE
add bikelane
Definition: GUIAppEnum.h:1061
@ MID_HOTKEY_F2_SUPERMODE_NETWORK
select network supermode in NETEDIT
Definition: GUIAppEnum.h:179
@ MID_HOTKEY_D_MODES_DELETE
hotkey for mode deleting things
Definition: GUIAppEnum.h:47
@ MID_GNE_NETWORKVIEWOPTIONS_SELECTEDGES
select edges
Definition: GUIAppEnum.h:638
@ MID_GNE_EDGE_SPLIT
split an edge
Definition: GUIAppEnum.h:965
@ MID_GNE_LANE_TRANSFORM_GREENVERGE
transform lane to greenVerge
Definition: GUIAppEnum.h:1057
@ MID_GNE_INTERVALBAR_LIMITED
enable/disable show data elements by interval
Definition: GUIAppEnum.h:698
@ MID_GNE_EDGE_EDIT_ENDPOINT
change default geometry endpoints
Definition: GUIAppEnum.h:953
@ MID_LOCATEROUTE
Locate route - button.
Definition: GUIAppEnum.h:345
@ MID_GNE_POLYGON_DELETE_GEOMETRY_POINT
delete geometry point
Definition: GUIAppEnum.h:1031
@ MID_GNE_CROSSING_EDIT_SHAPE
edit junction shape
Definition: GUIAppEnum.h:1014
@ MID_GNE_POLYGON_OPEN
open closed polygon
Definition: GUIAppEnum.h:1027
@ MID_GNE_POLYGON_SIMPLIFY_SHAPE
simplify polygon geometry
Definition: GUIAppEnum.h:1023
@ MID_REMOVESELECT
Remove from selected items - Menu Etry.
Definition: GUIAppEnum.h:429
GUICompleteSchemeStorage gSchemeStorage
@ SUMOCURSOR_MOVE
move cursor
Definition: GUICursors.h:36
@ SUMOCURSOR_DEFAULT
default cursor
Definition: GUICursors.h:33
#define GUIDesignVerticalSeparator
vertical separator
Definition: GUIDesigns.h:365
GUIGlObjectType
@ GLO_TEMPORALSHAPE
temporal shape (used in NETEDIT)
@ GLO_DOTTEDCONTOUR_FRONT
dotted contour front element (used in NETEDIT)
@ GLO_JUNCTION
a junction
@ GLO_LANE
a lane
@ GLO_CONNECTION
a connection
@ GLO_EDGE
an edge
@ GLO_CROSSING
a tl-logic
@ LOCATEVEHICLE
@ LOCATEPERSON
@ LOCATEJUNCTION
#define WRITE_DEBUG(msg)
Definition: MsgHandler.h:286
#define WRITE_ERROR(msg)
Definition: MsgHandler.h:284
#define WRITE_WARNING(msg)
Definition: MsgHandler.h:276
StringBijection< SUMOVehicleClass > SumoVehicleClassStrings(sumoVehicleClassStringInitializer, SVC_CUSTOM2, false)
SUMOVehicleClass
Definition of vehicle classes to differ between different lane usage and authority types.
@ SVC_IGNORING
vehicles ignoring classes
@ SVC_BICYCLE
vehicle is a bicycle
@ SVC_BUS
vehicle is a bus
@ SVC_PEDESTRIAN
pedestrian
int SVCPermissions
bitset where each bit declares whether a certain SVC may use this edge/lane
@ SUMO_TAG_POI
begin/end of the description of a Point of interest
@ SUMO_TAG_VEHICLE
description of a vehicle
@ GNE_TAG_FLOW_ROUTE
a flow definition using a route instead of a from-to edges route (used in NETEDIT)
@ SUMO_TAG_FLOW
a flow definitio nusing a from-to edges instead of a route (used by router)
@ SUMO_TAG_CONNECTION
connectio between two lanes
@ SUMO_TAG_JUNCTION
begin/end of the description of a junction
@ SUMO_TAG_CROSSING
crossing between edges for pedestrians
@ SUMO_TAG_LANE
begin/end of the description of a single lane
@ SUMO_TAG_VIEWSETTINGS
@ SUMO_TAG_VIEWPORT
@ SUMO_TAG_TRIP
a single trip definition (used by router)
@ SUMO_TAG_EDGE
begin/end of the description of an edge
@ SUMO_ATTR_Y
@ SUMO_ATTR_X
@ GNE_ATTR_SELECTED
element is selected
@ SUMO_ATTR_CUSTOMSHAPE
whether a given shape is user-defined
@ SUMO_ATTR_ZOOM
@ SUMO_ATTR_SHAPE
edge: the shape in xml-definition
@ SUMO_ATTR_ANGLE
@ SUMO_ATTR_LENGTH
const double SUMO_const_laneWidth
Definition: StdDefs.h:47
#define UNUSED_PARAMETER(x)
Definition: StdDefs.h:29
T MIN2(T a, T b)
Definition: StdDefs.h:73
T MAX2(T a, T b)
Definition: StdDefs.h:79
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
Definition: ToString.h:44
A class that stores a 2D geometrical boundary.
Definition: Boundary.h:39
double ymin() const
Returns minimum y-coordinate.
Definition: Boundary.cpp:129
double xmin() const
Returns minimum x-coordinate.
Definition: Boundary.cpp:117
double ymax() const
Returns maximum y-coordinate.
Definition: Boundary.cpp:135
double xmax() const
Returns maximum x-coordinate.
Definition: Boundary.cpp:123
static void drawLine(const Position &beg, double rot, double visLength)
Draws a thin line.
Definition: GLHelper.cpp:273
static void setColor(const RGBColor &c)
Sets the gl-color to this value.
Definition: GLHelper.cpp:446
static void drawFilledCircle(double width, int steps=8)
Draws a filled circle around (0,0)
Definition: GLHelper.cpp:347
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:181
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, const int align=0, double width=-1)
Definition: GLHelper.cpp:498
void drawTemporalE2Multilane(const GUIVisualizationSettings &s) const
draw temporal E2Multilane
bool isSelectingLanes() const
return true if modul is selecting lane
const std::vector< std::pair< GNELane *, double > > & getSelectedLanes() const
get current selected lanes
bool isShown() const
return true if modul is shown
bool stopConsecutiveLaneSelector()
stop selection of consecutive lanes
void startConsecutiveLaneSelector(GNELane *lane, const Position &clickedPosition)
start selection of consecutive lanes
bool addSelectedLane(GNELane *lane, const Position &clickedPosition)
return true if lane can be selected as consecutive lane
void abortConsecutiveLaneSelector()
abort selection of consecutive lanes
GNEAdditionalFrame::SelectorParentLanes * getConsecutiveLaneSelector() const
get consecutive Lane Selector
GNEAdditionalFrame::E2MultilaneLaneSelector * getE2MultilaneLaneSelector() const
getConsecutive Lane Selector
bool addAdditional(const GNEViewNetHelper::ObjectsUnderCursor &objectsUnderCursor)
add additional element
An Element which don't belongs to GNENet but has influency in the simulation.
Definition: GNEAdditional.h:47
virtual void openAdditionalDialog()
open Additional Dialog
GNEApplicationWindowHelper::ToolbarsGrip & getToolbarsGrip()
get ToolbarsGrip
bool isAttributeCarrierSelected() const
check if attribute carrier is selected
virtual const std::string & getID() const =0
return ID of object
virtual GUIGlObject * getGUIGlObject()=0
get GUIGlObject associated with this AttributeCarrier
const GNETagProperties & getTagProperty() const
get Tag Property assigned to this object
void unselectAttributeCarrier(const bool changeFlag=true)
unselect attribute carrier using GUIGlobalSelection
void selectAttributeCarrier(const bool changeFlag=true)
select attribute carrier using GUIGlobalSelection
long onCmdSaveModifications(FXObject *, FXSelector, void *)
Called when the user presses the OK-Button saves any connection modifications.
long onCmdCancelModifications(FXObject *, FXSelector, void *)
Called when the user presses the Cancel-button discards any connection modifications.
ConnectionModifications * getConnectionModifications() const
get pointer to ConnectionModifications modul
void handleLaneClick(const GNEViewNetHelper::ObjectsUnderCursor &objectsUnderCursor)
either sets the current lane or toggles the connection of the
void processClick(const Position &clickedPosition, const GNEViewNetHelper::ObjectsUnderCursor &objectsUnderCursor, const bool oppositeEdge, const bool chainEdge)
handle processClick and set the relative colouring
void abortEdgeCreation()
abort current edge creation
void show()
show create edge frame
void updateObjectsUnderSnappedCursor(const std::vector< GUIGlObject * > &GUIGlObjects)
update objects under snapped cursor
const GNEJunction * getJunctionSource() const
get junction source for new edge
void addCrossing(const GNEViewNetHelper::ObjectsUnderCursor &objectsUnderCursor)
add Crossing element
void createCrossingHotkey()
create crossing (used when user press ENTER key in Crossing mode)
This object is responsible for drawing a shape and for supplying a a popup menu. Messages are routete...
Definition: GNECrossing.h:41
GNEJunction * getParentJunction() const
get parent Junction
NBNode::Crossing * getNBCrossing() const
get referente to NBode::Crossing
bool deleteOnlyGeometryPoints() const
check if only delete geometry points checkbox is enabled
DeleteOptions * getDeleteOptions() const
get delete options
void removeSelectedAttributeCarriers()
remove selected attribute carriers (element)
void removeAttributeCarrier(const GNEViewNetHelper::ObjectsUnderCursor &objectsUnderCursor, bool ignoreOptions=false)
remove attribute carrier (element)
void removeGeometryPoint(const GNEViewNetHelper::ObjectsUnderCursor &objectsUnderCursor)
remove geometry point
void show()
show delete frame
An Element which don't belongs to GNENet but has influency in the simulation.
const std::string & getID() const
get ID
bool addEdgeData(const GNEViewNetHelper::ObjectsUnderCursor &objectsUnderCursor, const GNEViewNetHelper::MouseButtonKeyPressed &mouseButtonKeyPressed)
add additional element
A road/street connecting two junctions (netedit-version)
Definition: GNEEdge.h:49
GNEEdge * getOppositeEdge() const
get opposite edge
Definition: GNEEdge.cpp:350
void smooth(GNEUndoList *undoList)
make geometry smooth
Definition: GNEEdge.cpp:1817
NBEdge * getNBEdge() const
returns the internal NBEdge
Definition: GNEEdge.cpp:399
void smoothElevation(GNEUndoList *undoList)
smooth elevation with regard to adjoining edges
Definition: GNEEdge.cpp:1829
const std::vector< GNELane * > & getLanes() const
returns a reference to the lane vector
Definition: GNEEdge.cpp:723
void editEndpoint(Position pos, GNEUndoList *undoList)
makes pos the new geometry endpoint at the appropriate end, or remove current existent endpoint
Definition: GNEEdge.cpp:419
Position getSplitPos(const Position &clickPos)
Definition: GNEEdge.cpp:405
void straightenElevation(GNEUndoList *undoList)
interpolate z values linear between junctions
Definition: GNEEdge.cpp:1734
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
Definition: GNEEdge.cpp:825
void resetEndpoint(const Position &pos, GNEUndoList *undoList)
restores the endpoint to the junction position at the appropriate end
Definition: GNEEdge.cpp:465
bool addEdgeRelationData(const GNEViewNetHelper::ObjectsUnderCursor &objectsUnderCursor, const GNEViewNetHelper::MouseButtonKeyPressed &mouseButtonKeyPressed)
add additional element
void focusUpperElement()
focus upper element of frame
Definition: GNEFrame.cpp:102
virtual void show()
show Frame
Definition: GNEFrame.cpp:108
void startDrawing()
start drawing
bool getDeleteLastCreatedPoint()
get flag delete last created point
void stopDrawing()
stop drawing and check if shape can be created
void setDeleteLastCreatedPoint(bool value)
enable or disable delete last created point
const PositionVector & getTemporalShape() const
get Temporal shape
void abortDrawing()
abort drawing
bool isDrawing() const
return true if currently a shape is drawed
bool checkSavedPosition(const Position &clickedPosition) const
check if given position is near to saved position
bool overlappedInspectionShown() const
check if overlappedInspection modul is shown
void drawTemporalRoute(const GUIVisualizationSettings &s) const
draw temporal route
void removeLastElement()
remove path element
void abortPathCreation()
abort path creation
GNEFrameModuls::PathCreator * getPathCreator() const
get PathCreator modul
class for NETEDIT geometries over lanes
Definition: GNEGeometry.h:76
void updateGeometry(const PositionVector &shape, double startPos=-1, double endPos=-1, const Position &extraFirstPosition=Position::INVALID, const Position &extraLastPosition=Position::INVALID)
update geometry shape
Definition: GNEGeometry.cpp:81
const std::vector< GNEDemandElement * > & getParentDemandElements() const
get parent demand elements
void clearInspectedAC()
Clear all current inspected ACs.
bool processDataSupermodeClick(const Position &clickedPosition, GNEViewNetHelper::ObjectsUnderCursor &objectsUnderCursor)
process click over Viewnet in Supermode Data
void show()
show inspector frame
bool processNetworkSupermodeClick(const Position &clickedPosition, GNEViewNetHelper::ObjectsUnderCursor &objectsUnderCursor)
process click over Viewnet in Supermode Network
void inspectMultisection(const std::vector< GNEAttributeCarrier * > &ACs)
Inspect the given multi-selection.
GNEFrameModuls::OverlappedInspection * getOverlappedInspection() const
get OverlappedInspection modul
bool processDemandSupermodeClick(const Position &clickedPosition, GNEViewNetHelper::ObjectsUnderCursor &objectsUnderCursor)
process click over Viewnet in Supermode Demand
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
Position getPositionInView() const
Returns position of hierarchical element in view.
NBNode * getNBNode() const
Return net build node.
This lane is powered by an underlying GNEEdge and basically knows how to draw itself.
Definition: GNELane.h:45
const PositionVector & getLaneShape() const
Definition: GNELane.cpp:117
int getIndex() const
returns the index of the lane
Definition: GNELane.cpp:733
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
Definition: GNELane.cpp:825
GNEEdge * getParentEdge() const
get arent edge
Definition: GNELane.cpp:111
virtual void removeGeometryPoint(const Position clickedPosition, GNEUndoList *undoList)=0
remove geometry point in the clicked position
void show()
show prohibition frame
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.
const std::map< std::string, GNEEdge * > & getEdges() const
map with the ID and pointer to edges of net
const std::map< SumoXMLTag, std::map< std::string, GNEDemandElement * > > & getDemandElements() const
void calculateReachability(const SUMOVehicleClass vClass, GNEEdge *originEdge)
calculate reachability for given edge
A NBNetBuilder extended by visualisation and editing capabilities.
Definition: GNENet.h:40
void deleteEdge(GNEEdge *edge, GNEUndoList *undoList, bool recomputeConnections)
removes edge
Definition: GNENet.cpp:316
GNECrossing * retrieveCrossing(const std::string &id, bool failHard=true) const
get Crossing by id
Definition: GNENet.cpp:1213
void deleteLane(GNELane *lane, GNEUndoList *undoList, bool recomputeConnections)
removes lane
Definition: GNENet.cpp:450
void deleteCrossing(GNECrossing *crossing, GNEUndoList *undoList)
remove crossing
Definition: GNENet.cpp:509
void deleteAdditional(GNEAdditional *additional, GNEUndoList *undoList)
remove additional
Definition: GNENet.cpp:527
void reverseEdge(GNEEdge *edge, GNEUndoList *undoList)
reverse edge
Definition: GNENet.cpp:873
GNEEdge * addReversedEdge(GNEEdge *edge, GNEUndoList *undoList)
add reversed edge
Definition: GNENet.cpp:886
void deleteTAZElement(GNETAZElement *TAZElement, GNEUndoList *undoList)
remove TAZElement
Definition: GNENet.cpp:557
std::vector< GNEGenericData * > retrieveGenericDatas(bool onlySelected=false) const
return all generic datas
Definition: GNENet.cpp:2614
bool restrictLane(SUMOVehicleClass vclass, GNELane *lane, GNEUndoList *undoList)
transform lane to restricted lane
Definition: GNENet.cpp:676
GNEEdge * retrieveEdge(const std::string &id, bool failHard=true) const
get edge by id
Definition: GNENet.cpp:1141
std::vector< GNELane * > retrieveLanes(bool onlySelected=false)
return all lanes
Definition: GNENet.cpp:1322
GNEJunction * splitEdge(GNEEdge *edge, const Position &pos, GNEUndoList *undoList, GNEJunction *newJunction=0)
split edge at position by inserting a new junction
Definition: GNENet.cpp:756
GNEAttributeCarrier * retrieveAttributeCarrier(const GUIGlID id, bool failHard=true) const
get a single attribute carrier based on a GLID
Definition: GNENet.cpp:1435
std::vector< GNEAdditional * > retrieveAdditionals(bool onlySelected=false) const
return all additionals
Definition: GNENet.cpp:2328
void deleteDemandElement(GNEDemandElement *demandElement, GNEUndoList *undoList)
remove demand element
Definition: GNENet.cpp:578
void duplicateLane(GNELane *lane, GNEUndoList *undoList, bool recomputeConnections)
duplicates lane
Definition: GNENet.cpp:660
void computeAndUpdate(OptionsCont &oc, bool volatileOptions)
recompute the network and update lane geometries
Definition: GNENet.cpp:3221
void deleteConnection(GNEConnection *connection, GNEUndoList *undoList)
remove connection
Definition: GNENet.cpp:494
std::vector< GNEDemandElement * > retrieveDemandElements(bool onlySelected=false) const
return all demand elements
Definition: GNENet.cpp:2447
void resetJunctionConnections(GNEJunction *junction, GNEUndoList *undoList)
reset junction's connections
Definition: GNENet.cpp:2225
void deleteGenericData(GNEGenericData *genericData, GNEUndoList *undoList)
remove generic data
Definition: GNENet.cpp:630
GNENetHelper::PathCalculator * getPathCalculator()
obtain instance of PathCalculator
Definition: GNENet.cpp:136
GNENetHelper::AttributeCarriers * getAttributeCarriers() const
retrieve all attribute carriers of Net
Definition: GNENet.cpp:130
std::vector< GNEJunction * > retrieveJunctions(bool onlySelected=false)
return all junctions
Definition: GNENet.cpp:1370
void splitEdgesBidi(GNEEdge *edge, GNEEdge *oppositeEdge, const Position &pos, GNEUndoList *undoList)
split all edges at position by inserting one new junction
Definition: GNENet.cpp:861
void deleteShape(GNEShape *shape, GNEUndoList *undoList)
remove shape
Definition: GNENet.cpp:548
bool removeRestrictedLane(SUMOVehicleClass vclass, GNEEdge *edge, GNEUndoList *undoList)
remove restricted lane
Definition: GNENet.cpp:742
void mergeJunctions(GNEJunction *moved, GNEJunction *target, GNEUndoList *undoList)
merge the given junctions edges between the given junctions will be deleted
Definition: GNENet.cpp:921
bool addRestrictedLane(SUMOVehicleClass vclass, GNEEdge *edge, int index, GNEUndoList *undoList)
add restricted lane to edge
Definition: GNENet.cpp:706
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:2129
void selectRoundabout(GNEJunction *junction, GNEUndoList *undoList)
select all roundabout edges and junctions for the current roundabout
Definition: GNENet.cpp:954
std::vector< GNEShape * > retrieveShapes(SumoXMLTag shapeTag, bool onlySelected=false)
return shape by type shapes
Definition: GNENet.cpp:1383
void replaceJunctionByGeometry(GNEJunction *junction, GNEUndoList *undoList)
replace the selected junction by geometry node(s) and merge the edges
Definition: GNENet.cpp:2079
std::vector< GNEEdge * > retrieveEdges(bool onlySelected=false)
return all edges
Definition: GNENet.cpp:1249
void createRoundabout(GNEJunction *junction, GNEUndoList *undoList)
transform the given junction into a roundabout
Definition: GNENet.cpp:973
void requireRecompute()
inform the net about the need for recomputation
Definition: GNENet.cpp:1709
void initGNEConnections()
initialize GNEConnections
Definition: GNENet.cpp:3208
void deleteJunction(GNEJunction *junction, GNEUndoList *undoList)
removes junction and all incident edges
Definition: GNENet.cpp:275
NBEdgeCont & getEdgeCont()
returns the NBEdgeCont of the underlying netbuilder
Definition: GNENet.cpp:2288
std::vector< GNETAZElement * > retrieveTAZElements(bool onlySelected=false) const
return all TAZElements
Definition: GNENet.cpp:3013
GNEDemandElement * retrieveDemandElement(SumoXMLTag type, const std::string &id, bool hardFail=true) const
Returns the named demand element.
Definition: GNENet.cpp:2435
void clearJunctionConnections(GNEJunction *junction, GNEUndoList *undoList)
clear junction's connections
Definition: GNENet.cpp:2213
void computeDemandElements(GNEApplicationWindow *window)
compute demand elements param[in] window The window to inform about delay
Definition: GNENet.cpp:1659
const std::string & getID() const
get ID
Definition: GNEPOI.h:41
bool addPerson(const GNEViewNetHelper::ObjectsUnderCursor &objectsUnderCursor, const GNEViewNetHelper::MouseButtonKeyPressed &mouseButtonKeyPressed)
add vehicle element
void show()
show Frame
GNEFrameModuls::PathCreator * getPathCreator() const
get PathCreator modul
bool addPersonPlanElement(const GNEViewNetHelper::ObjectsUnderCursor &objectsUnderCursor, const GNEViewNetHelper::MouseButtonKeyPressed &mouseButtonKeyPressed)
add person plan element
GNEFrameModuls::PathCreator * getPathCreator() const
get path creator modul
void show()
show Frame
int getVertexIndex(Position pos, bool snapToGrid)
return index of a vertex of shape, or of a new vertex if position is over an shape's edge
Definition: GNEPoly.cpp:332
void closePolygon(bool allowUndo=true)
close polygon
Definition: GNEPoly.cpp:416
void changeFirstGeometryPoint(int oldIndex, bool allowUndo=true)
change first geometry point
Definition: GNEPoly.cpp:437
void deleteGeometryPoint(const Position &pos, bool allowUndo=true)
delete the geometry point closest to the given pos
Definition: GNEPoly.cpp:348
void simplifyShape(bool allowUndo=true)
replace the current shape with a rectangle
Definition: GNEPoly.cpp:477
void openPolygon(bool allowUndo=true)
open polygon
Definition: GNEPoly.cpp:395
void show()
show Frame
GNEFrameModuls::DrawingShape * getDrawingShapeModul() const
get drawing mode editor
AddShape
enum with all possible values after try to create an shape using frame
GNEPolygonFrame::AddShape processClick(const Position &clickedPosition, const GNEViewNetHelper::ObjectsUnderCursor &objectsUnderCursor)
process click over Viewnet
void handleProhibitionClick(const GNEViewNetHelper::ObjectsUnderCursor &objectsUnderCursor)
handle prohibitions and set the relative colouring
long onCmdCancel(FXObject *, FXSelector, void *)
Called when the user presses the Cancel-button discards any prohibition modifications.
void show()
show prohibition frame
void show()
show delete frame
GNEFrameModuls::PathCreator * getPathCreator() const
get path creator modul
bool addEdgeRoute(GNEEdge *clickedEdge, const GNEViewNetHelper::MouseButtonKeyPressed &mouseButtonKeyPressed)
add route edge
bool IsObjectTypeLocked(const GUIGlObjectType type) const
check if an object is locked
LockGLObjectTypes * getLockGLObjectTypes() const
get selected items Modul
void show()
show Frame
void clearCurrentSelection() const
clear current selection with possibility of undo/redo
void show()
show Frame
bool addStop(const GNEViewNetHelper::ObjectsUnderCursor &objectsUnderCursor, const GNEViewNetHelper::MouseButtonKeyPressed &mouseButtonKeyPressed)
add Stop element
void setTAZ(GNETAZ *editedTAZ)
set current TAZ
GNETAZ * getTAZ() const
get current TAZ
bool isChangesPending() const
return true if there is changes to save
long onCmdSaveChanges(FXObject *, FXSelector, void *)
bool processClick(const Position &clickedPosition, const GNEViewNetHelper::ObjectsUnderCursor &objectsUnderCursor)
process click over Viewnet
GNEFrameModuls::DrawingShape * getDrawingShapeModul() const
get drawing mode modul
TAZCurrent * getTAZCurrentModul() const
get Current TAZ modul
void processEdgeSelection(const std::vector< GNEEdge * > &edges)
process selection of edges in view net
TAZSaveChanges * getTAZSaveChangesModul() const
get TAZ Save Changes modul
bool addTAZRelationData(const GNEViewNetHelper::ObjectsUnderCursor &objectsUnderCursor, const GNEViewNetHelper::MouseButtonKeyPressed &mouseButtonKeyPressed)
add additional element
void clearTAZSelection()
clear TAZ selection
long onCmdOK(FXObject *, FXSelector, void *)
long onCmdCancel(FXObject *, FXSelector, void *)
Called when the user presses the Cancel-button.
void editTLS(const Position &clickedPosition, const GNEViewNetHelper::ObjectsUnderCursor &objectsUnderCursor)
edits the traffic light for the given clicked junction
void show()
show inspector frame
bool isShape() const
return true if tag correspond to a shape
bool isPersonStop() const
return true if tag correspond to a person stop element
bool isTAZElement() const
return true if tag correspond to a TAZ element
bool isPersonPlan() const
return true if tag correspond to a person plan
bool isNetworkElement() const
return true if tag correspond to a network element
bool isDataElement() const
return true if tag correspond to a data element
bool isSelectable() const
return true if tag correspond to a selectable element
SumoXMLTag getTag() const
get Tag vinculated with this attribute Property
bool hasDialog() const
return true if tag correspond to an element that can be edited using a dialog
bool isDemandElement() const
return true if tag correspond to a demand element
bool isAdditionalElement() const
return true if tag correspond to an additional element
bool isPerson() const
return true if tag correspond to a person element
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:71
void p_end()
End undo command sub-group. If the sub-group is still empty, it will be deleted; otherwise,...
Definition: GNEUndoList.cpp:78
void p_abort()
reverts and discards ALL active command groups
GNEFrameModuls::PathCreator * getPathCreator() const
get PathCreator modul
void show()
show Frame
bool addVehicle(const GNEViewNetHelper::ObjectsUnderCursor &objectsUnderCursor, const GNEViewNetHelper::MouseButtonKeyPressed &mouseButtonKeyPressed)
add vehicle element
class used to group all variables related to interval bar
void hideIntervalBar()
hide all options menu checks
void setGenericDataType()
set generic data type
void showIntervalBar()
show interval option bar
void disableIntervalBar()
disable interval bar
void buildIntervalBarElements()
build interval bar elements
void enableIntervalBar()
enable interval bar
void setInterval()
update limit by interval
class used to group all variables related with objects under cursor after a click over view
void updateObjectUnderCursor(const std::vector< GUIGlObject * > &GUIGlObjects)
update objects under cursor (Called only in onLeftBtnPress(...) function)
GNENetworkElement * getNetworkElementFront() const
get front network element or a pointer to nullptr
GNEAttributeCarrier * getAttributeCarrierFront() const
get front attribute carrier or a pointer to nullptr
GNELane * getLaneFront() const
get front lane or a pointer to nullptr
GUIGlObjectType getGlTypeFront() const
get front GUI GL object type or a pointer to nullptr
GNEJunction * getJunctionFront() const
get front junction or a pointer to nullptr
GNEEdge * getEdgeFront() const
get front edge or a pointer to nullptr
GUIGlObject * getGUIGlObjectFront() const
get front attribute carrier or a pointer to nullptr
GNEConnection * getConnectionFront() const
get front connection or a pointer to nullptr
GNEPOI * getPOIFront() const
get front POI or a pointer to nullptr
GNEViewNetHelper::EditNetworkElementShapes myEditNetworkElementShapes
struct for grouping all variables related with edit shapes
Definition: GNEViewNet.h:511
long onCmdClosePolygon(FXObject *, FXSelector, void *)
close opened polygon
long onCmdEditCrossingShape(FXObject *, FXSelector, void *)
edit crossing shape
void processMoveMouseNetwork(const bool mouseLeftButtonPressed)
process move mouse function in Supermode Network
const GNEViewNetHelper::DataViewOptions & getDataViewOptions() const
get data view options
Definition: GNEViewNet.cpp:491
GNENet * getNet() const
get the net object
long onCmdSetFirstGeometryPoint(FXObject *, FXSelector, void *)
set as first geometry point the closes geometry point
GNEViewNetHelper::CommonCheckableButtons myCommonCheckableButtons
variable used to save checkable buttons for common supermodes
Definition: GNEViewNet.h:457
long onMouseMove(FXObject *, FXSelector, void *)
called when user moves mouse
Definition: GNEViewNet.cpp:925
const GNEAttributeCarrier * getFrontAttributeCarrier() const
get front attributeCarrier
void hotkeyBackSpace()
handle backspace keypress
const GNEViewNetHelper::EditModes & getEditModes() const
get edit modes
Definition: GNEViewNet.cpp:467
long onCmdAddSelected(FXObject *, FXSelector, void *)
select AC under cursor
const GNEViewNetHelper::EditNetworkElementShapes & getEditNetworkElementShapes() const
get Edit Shape modul
Definition: GNEViewNet.cpp:503
GNECrossing * getCrossingAtPopupPosition()
try to retrieve a crossing at popup position
void buildViewToolBars(GUIGlChildWindow *v)
builds the view toolbars
Definition: GNEViewNet.cpp:240
void updateNetworkModeSpecificControls()
updates Network mode specific controls
long onCmdSmoothEdges(FXObject *, FXSelector, void *)
smooth geometry
long onCmdStraightenEdges(FXObject *, FXSelector, void *)
makes selected edges straight
const GNEViewNetHelper::MouseButtonKeyPressed & getMouseButtonKeyPressed() const
get Key Pressed modul
Definition: GNEViewNet.cpp:497
void updateCursor()
update cursor after every click/key press/release
void updateDataModeSpecificControls()
updates Data mode specific controls
GNEEdge * getEdgeAtPopupPosition()
try to retrieve an edge at popup position
long onCmdToogleShowJunctionBubbles(FXObject *, FXSelector, void *)
toogle show junction bubbles
GNEViewNetHelper::EditModes myEditModes
variable used to save variables related with edit moves modes
Definition: GNEViewNet.h:437
long onCmdReplaceJunction(FXObject *, FXSelector, void *)
replace node by geometry
long onCmdSplitJunction(FXObject *, FXSelector, void *)
split junction into multiple junctions
long onCmdToogleChangeAllPhases(FXObject *, FXSelector, void *)
toogle change all phases
long onCmdClearConnections(FXObject *, FXSelector, void *)
clear junction connections
void abortOperation(bool clearSelection=true)
abort current edition operation
Definition: GNEViewNet.cpp:998
void deleteSelectedGenericDatas()
delete all currently selected generic data elements
void deleteSelectedConnections()
delete all currently selected connections
GNEViewNetHelper::TestingMode myTestingMode
variable used to save variables related with testing mode
Definition: GNEViewNet.h:440
GNEPOI * getPOIAtPopupPosition()
try to retrieve a POILane at popup position
GNEViewNetHelper::SelectingArea mySelectingArea
variable used to save variables related with selecting areas
Definition: GNEViewNet.h:508
long onCmdLaneReachability(FXObject *, FXSelector sel, void *)
show lane reachability
long onCmdToogleWarnAboutMerge(FXObject *, FXSelector, void *)
toogle warn for merge
GNEViewNetHelper::NetworkCheckableButtons myNetworkCheckableButtons
variable used to save checkable buttons for Supermode Network
Definition: GNEViewNet.h:460
bool removeRestrictedLane(SUMOVehicleClass vclass)
remove restricted lane
std::vector< std::string > getEdgeDataAttrs() const
return list of loaded edgeData attributes
Definition: GNEViewNet.cpp:700
long onCmdToogleLockPerson(FXObject *, FXSelector, void *)
toogle lock person in super mode demand
void processClick(void *eventData)
Auxiliar function used by onLeftBtnPress(...)
GNEViewNetHelper::MoveSingleElementValues myMoveSingleElementValues
Definition: GNEViewNet.h:488
long onCmdSimplifyShape(FXObject *, FXSelector, void *)
simply shape of current polygon
void drawLaneCandidates() const
draw functions
GNELane * getLaneAtPopupPosition()
try to retrieve a lane at popup position
GNEViewNetHelper::MouseButtonKeyPressed myMouseButtonKeyPressed
variable used to save key status after certain events
Definition: GNEViewNet.h:447
GNEViewNetHelper::IntervalBar myIntervalBar
variable used to save IntervalBar
Definition: GNEViewNet.h:483
GNEViewParent * myViewParent
view parent
Definition: GNEViewNet.h:514
bool showJunctionAsBubbles() const
return true if junction must be showed as bubbles
Definition: GNEViewNet.cpp:599
long onCmdToogleShowAllPersonPlans(FXObject *, FXSelector, void *)
toogle show all person plans in super mode demand
bool changeAllPhases() const
change all phases
Definition: GNEViewNet.cpp:593
long onCmdEditJunctionShape(FXObject *, FXSelector, void *)
edit junction shape
long onCmdToogleShowAdditionals(FXObject *, FXSelector, void *)
toogle show additionals in super mode data
bool setColorScheme(const std::string &name)
set color scheme
Definition: GNEViewNet.cpp:379
int doPaintGL(int mode, const Boundary &bound)
do paintGL
Definition: GNEViewNet.cpp:717
long onCmdOpenAdditionalDialog(FXObject *, FXSelector, void *)
open additional dialog
const GNEViewNetHelper::NetworkViewOptions & getNetworkViewOptions() const
get network view options
Definition: GNEViewNet.cpp:479
void hotkeyFocusFrame()
handle focus frame keypress
GNEViewNetHelper::DemandViewOptions myDemandViewOptions
variable used to save variables related with view options in supermode Demand
Definition: GNEViewNet.h:476
std::vector< std::string > getEdgeLaneParamKeys(bool edgeKeys) const
return list of available edge parameters
Definition: GNEViewNet.cpp:668
long onCmdLaneOperation(FXObject *, FXSelector sel, void *)
add/remove/restrict lane
void processMoveMouseData(const bool mouseLeftButtonPressed)
process move mouse function in Supermode Data
GNEFrame * myCurrentFrame
the current frame
Definition: GNEViewNet.h:520
bool autoSelectNodes()
whether to autoselect nodes or to lanes
Definition: GNEViewNet.cpp:581
GNEUndoList * myUndoList
a reference to the undolist maintained in the application
Definition: GNEViewNet.h:523
GNEViewNetHelper::NetworkViewOptions myNetworkViewOptions
variable used to save variables related with view options in supermode Network
Definition: GNEViewNet.h:473
void doInit()
called after some features are already initialized
Definition: GNEViewNet.cpp:236
void buildEditModeControls()
create edit mode buttons and elements
GNEViewNetHelper::DataCheckableButtons myDataCheckableButtons
variable used to save checkable buttons for Supermode Data
Definition: GNEViewNet.h:466
void processLeftButtonPressDemand(void *eventData)
process left button press function in Supermode Demand
void deleteSelectedShapes()
delete all currently selected shapes
GNEViewNetHelper::IntervalBar & getIntervalBar()
get interval bar
long onCmdToogleSelectEdges(FXObject *, FXSelector, void *)
toogle select edges
GNEViewParent * getViewParent() const
get the net object
long onCmdToogleHideShapes(FXObject *, FXSelector, void *)
toogle hide shapes in super mode demand
long onCmdAddReversedEdge(FXObject *, FXSelector, void *)
add reversed edge
void deleteSelectedAdditionals()
delete all currently selected additionals
void processLeftButtonReleaseNetwork()
process left button release function in Supermode Network
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:509
long onCmdToogleChainEdges(FXObject *, FXSelector, void *)
toogle chain edges
long onCmdIntervalBarGenericDataType(FXObject *, FXSelector, void *)
change generic data type in interval bar
long onCmdConvertRoundabout(FXObject *, FXSelector, void *)
convert junction to roundabout
long onRightBtnPress(FXObject *, FXSelector, void *)
called when user press mouse's right button
Definition: GNEViewNet.cpp:895
long onCmdOpenPolygon(FXObject *, FXSelector, void *)
open closed polygon
long onCmdIntervalBarDataSet(FXObject *, FXSelector, void *)
change data set in interval bar
void processLeftButtonReleaseDemand()
process left button release function in Supermode Demand
const GNEViewNetHelper::TestingMode & getTestingMode() const
get testing mode
Definition: GNEViewNet.cpp:473
GNEUndoList * getUndoList() const
get the undoList object
void processLeftButtonPressData(void *eventData)
process left button press function in Supermode Data
long onCmdTransformPOI(FXObject *, FXSelector, void *)
Transform POI to POILane, and viceversa.
void saveVisualizationSettings() const
Definition: GNEViewNet.cpp:439
GNEViewNetHelper::SaveElements mySaveElements
variable used to save elements
Definition: GNEViewNet.h:505
void deleteSelectedCrossings()
delete all currently selected crossings
long onCmdToogleHideNonInspecteDemandElements(FXObject *, FXSelector, void *)
toogle hide non inspected demand elements
long onCmdIntervalBarSetEnd(FXObject *, FXSelector, void *)
change end in interval bar
long onCmdIntervalBarSetAttribute(FXObject *, FXSelector, void *)
change attribute in interval bar
void drawTemporalDrawShape() const
draw temporal polygon shape in Polygon Mode
void removeFromAttributeCarrierInspected(const GNEAttributeCarrier *AC)
remove given AC of list of inspected Attribute Carriers
long onCmdSplitEdgeBidi(FXObject *, FXSelector, void *)
split edge at cursor position
GNEJunction * getJunctionAtPopupPosition()
try to retrieve a junction at popup position
long onCmdSetSupermode(FXObject *, FXSelector sel, void *)
long onCmdToogleExtendSelection(FXObject *, FXSelector, void *)
toogle extend selection
const GNEAttributeCarrier * myFrontAttributeCarrier
front attribute carrier
Definition: GNEViewNet.h:529
GNEViewNetHelper::DemandCheckableButtons myDemandCheckableButtons
variable used to save checkable buttons for Supermode Demand
Definition: GNEViewNet.h:463
long onCmdSetMode(FXObject *, FXSelector sel, void *)
called when user press a mode button (Network or demand)
long onCmdResetEdgeEndpoint(FXObject *, FXSelector, void *)
change geometry endpoint
long onCmdIntervalBarSetBegin(FXObject *, FXSelector, void *)
change begin in interval bar
long onCmdResetLength(FXObject *, FXSelector, void *)
reset custom edge lengths
void deleteSelectedJunctions()
delete all currently selected junctions
long onCmdToogleAutoOppositeEdge(FXObject *, FXSelector, void *)
toogle autoOpposite edge
long onLeftBtnRelease(FXObject *, FXSelector, void *)
called when user releases mouse's left button
Definition: GNEViewNet.cpp:867
long onCmdRemoveSelected(FXObject *, FXSelector, void *)
unselect AC under cursor
long onCmdDeleteGeometryPoint(FXObject *, FXSelector, void *)
delete the closes geometry point
long onCmdDuplicateLane(FXObject *, FXSelector, void *)
duplicate selected lane
std::vector< GNEAttributeCarrier * > myInspectedAttributeCarriers
current inspected attribute carrier
Definition: GNEViewNet.h:526
void processLeftButtonPressNetwork(void *eventData)
mouse process functions
void hotkeyEnter()
handle enter keypress
GNEConnection * getConnectionAtPopupPosition()
try to retrieve a connection at popup position
void forceSupermodeNetwork()
set supermode Network (used after load/create new network)
Definition: GNEViewNet.cpp:325
const std::vector< GNEAttributeCarrier * > & getInspectedAttributeCarriers() const
get inspected attribute carriers
long onKeyPress(FXObject *o, FXSelector sel, void *data)
called when user press a key
Definition: GNEViewNet.cpp:947
bool addRestrictedLane(SUMOVehicleClass vclass)
add restricted lane
long onCmdSplitEdge(FXObject *, FXSelector, void *)
split edge at cursor position
long onCmdToogleShowShapes(FXObject *, FXSelector, void *)
toogle show shapes in super mode data
long onCmdToogleShowGrid(FXObject *, FXSelector, void *)
toogle show grid
bool mergeJunctions(GNEJunction *movedJunction, GNEJunction *targetJunction)
try to merge moved junction with another junction in that spot return true if merging did take place
Definition: GNEViewNet.cpp:605
long onCmdStraightenEdgesElevation(FXObject *, FXSelector, void *)
interpolate z values linear between junctions
void updateControls()
update control contents after undo/redo or recompute
~GNEViewNet()
destructor
Definition: GNEViewNet.cpp:232
long onCmdSplitJunctionReconnect(FXObject *, FXSelector, void *)
split junction into multiple junctions and reconnect them
void buildSelectionACPopupEntry(GUIGLObjectPopupMenu *ret, GNEAttributeCarrier *AC)
Builds an entry which allows to (de)select the object.
Definition: GNEViewNet.cpp:368
void hotkeyDel()
handle del keypress
long onCmdToogleDrawSpreadVehicles(FXObject *, FXSelector, void *)
toogle draw vehicles in begin position or spread in lane
bool isAttributeCarrierInspected(const GNEAttributeCarrier *AC) const
check if attribute carrier is being inspected
GNEViewNet()
FOX needs this.
Definition: GNEViewNet.cpp:640
long onCmdSmoothEdgesElevation(FXObject *, FXSelector, void *)
smooth elevation with regard to adjoining edges
long onCmdResetJunctionShape(FXObject *, FXSelector, void *)
reset junction shape
void deleteSelectedEdges()
delete all currently selected edges
long onRightBtnRelease(FXObject *, FXSelector, void *)
called when user releases mouse's right button
Definition: GNEViewNet.cpp:910
long onCmdToogleMoveElevation(FXObject *, FXSelector, void *)
toogle move elevation
long onCmdReverseEdge(FXObject *, FXSelector, void *)
reverse edge
void processLeftButtonReleaseData()
process left button release function in Supermode Data
GNENet * myNet
Pointer to current net. (We are not responsible for deletion)
Definition: GNEViewNet.h:517
GNEPoly * getPolygonAtPopupPosition()
try to retrieve a polygon at popup position
GNEViewNetHelper::DataViewOptions myDataViewOptions
variable used to save variables related with view options in supermode Data
Definition: GNEViewNet.h:479
void drawTranslateFrontAttributeCarrier(const GNEAttributeCarrier *AC, GUIGlObjectType objectType, const double extraOffset=0)
draw front attributeCarrier
long onCmdEditEdgeEndpoint(FXObject *, FXSelector, void *)
change geometry endpoint
const GNEViewNetHelper::DemandViewOptions & getDemandViewOptions() const
get demand view options
Definition: GNEViewNet.cpp:485
const GNEViewNetHelper::ObjectsUnderCursor & getObjectsUnderCursor() const
get objects under cursor
Definition: GNEViewNet.cpp:362
GNEViewNetHelper::MoveMultipleElementValues myMoveMultipleElementValues
variable used to save variables related with movement of multiple elements
Definition: GNEViewNet.h:491
void updateViewNet() const
Mark the entire GNEViewNet to be repainted later.
Definition: GNEViewNet.cpp:318
GNEViewNetHelper::ObjectsUnderCursor myObjectsUnderCursor
variable use to save all pointers to objects under cursor after a click
Definition: GNEViewNet.h:450
bool restrictLane(SUMOVehicleClass vclass)
restrict lane
long onCmdToogleShowDemandElements(FXObject *, FXSelector, void *)
toogle show demand elements
std::set< std::pair< std::string, GNEAttributeCarrier * > > getAttributeCarriersInBoundary(const Boundary &boundary, bool forceSelectEdges=false)
get AttributeCarriers in Boundary
Definition: GNEViewNet.cpp:331
long onKeyRelease(FXObject *o, FXSelector sel, void *data)
called when user release a key
Definition: GNEViewNet.cpp:970
long onCmdResetConnections(FXObject *, FXSelector, void *)
reset junction connections
void setInspectedAttributeCarriers(const std::vector< GNEAttributeCarrier * > ACs)
set inspected attributeCarrier
long onCmdResetLaneCustomShape(FXObject *, FXSelector, void *)
reset custom shapes of selected lanes
void setStatusBarText(const std::string &text)
set staturBar text
Definition: GNEViewNet.cpp:575
void processMoveMouseDemand(const bool mouseLeftButtonPressed)
process move mouse function in Supermode Demand
void setSelectorFrameScale(double selectionScale)
set selection scaling (in GNESelectorFrame)
Definition: GNEViewNet.cpp:587
void setFrontAttributeCarrier(const GNEAttributeCarrier *AC)
set front attributeCarrier
long onCmdEditConnectionShape(FXObject *, FXSelector, void *)
edit connection shape
void updateDemandModeSpecificControls()
updates Demand mode specific controls
void openObjectDialog()
open object dialog
Definition: GNEViewNet.cpp:395
GNEAdditional * getAdditionalAtPopupPosition()
try to retrieve a additional at popup position
bool showLockIcon() const
check if lock icon should be visible
void drawTemporalJunction() const
draw temporal junction in create edge mode
long onCmdToogleShowConnections(FXObject *, FXSelector, void *)
toogle show connections
long onCmdSelectRoundabout(FXObject *, FXSelector, void *)
select all roundabout nodes and edges
long onLeftBtnPress(FXObject *, FXSelector, void *)
Definition: GNEViewNet.cpp:839
long onCmdToogleHideConnections(FXObject *, FXSelector, void *)
toogle hide connections
void deleteSelectedTAZElements()
delete all currently selected TAZ Elements
void deleteSelectedLanes()
delete all currently selected lanes
long onCmdIntervalBarLimit(FXObject *, FXSelector, void *)
change limit interval in interval bar
void deleteSelectedDemandElements()
delete all currently selected demand elements
A single child window which contains a view of the simulation area.
Definition: GNEViewParent.h:81
GNECrossingFrame * getCrossingFrame() const
get frame for NETWORK_CROSSING
GNEConnectorFrame * getConnectorFrame() const
get frame for NETWORK_CONNECT
GNEStopFrame * getStopFrame() const
get frame for DEMAND_STOP
GNEProhibitionFrame * getProhibitionFrame() const
get frame for NETWORK_PROHIBITION
GNEPersonPlanFrame * getPersonPlanFrame() const
get frame for DEMAND_PERSONFRAME
GNEPolygonFrame * getPolygonFrame() const
get frame for NETWORK_POLYGON
GNETAZRelDataFrame * getTAZRelDataFrame() const
get frame for DATA_TAZRELDATA
GNEMoveFrame * getMoveFrame() const
get frame for move elements
GNESelectorFrame * getSelectorFrame() const
get frame for select elements
GNEEdgeDataFrame * getEdgeDataFrame() const
get frame for DATA_EDGEDATA
GNEDeleteFrame * getDeleteFrame() const
get frame for delete elements
GNEVehicleFrame * getVehicleFrame() const
get frame for DEMAND_VEHICLE
void hideAllFrames()
hide all frames
GNETAZFrame * getTAZFrame() const
get frame for NETWORK_TAZ
GNETLSEditorFrame * getTLSEditorFrame() const
get frame for NETWORK_TLS
GNEApplicationWindow * getGNEAppWindows() const
get GNE Application Windows
GNEAdditionalFrame * getAdditionalFrame() const
get frame for NETWORK_ADDITIONAL
GNEPersonFrame * getPersonFrame() const
get frame for DEMAND_PERSON
GNEInspectorFrame * getInspectorFrame() const
get frame for inspect elements
GNEVehicleTypeFrame * getVehicleTypeFrame() const
get frame for DEMAND_VEHICLETYPE
GNEEdgeRelDataFrame * getEdgeRelDataFrame() const
get frame for DATA_EDGERELDATA
GNEPersonTypeFrame * getPersonTypeFrame() const
get frame for DEMAND_PERSONTYPE
GNECreateEdgeFrame * getCreateEdgeFrame() const
get frame for NETWORK_CREATEEDGE
GNERouteFrame * getRouteFrame() const
get frame for DEMAND_ROUTE
bool contains(const std::string &name) const
Returns the information whether a setting with the given name is stored.
GUIVisualizationSettings & get(const std::string &name)
Returns the named scheme.
const std::vector< std::string > & getNames() const
Returns a list of stored settings names.
static FXCursor * getCursor(GUICursor which)
returns a cursor previously defined in the enum GUICursor
static FXMenuCommand * buildFXMenuCommand(FXComposite *p, const std::string &text, FXIcon *icon, FXObject *tgt, FXSelector sel)
build menu command
Definition: GUIDesigns.cpp:40
std::string getCurrentScheme() const
Returns the name of the currently chosen scheme.
void setCurrentScheme(const std::string &)
Sets the named scheme as the current.
The popup menu of a globject.
FXComboBox * getColoringSchemesCombo()
return combobox with the current coloring schemes (standard, fastest standard, real world....
FXPopup * getLocatorPopup()
@ brief return a pointer to locator popup
virtual const std::string & getMicrosimID() const
Returns the id of the object as known to microsim.
GUIGlObjectType getType() const
Returns the type of the object as coded in GUIGlObjectType.
virtual GUIGLObjectPopupMenu * getPopUpMenu(GUIMainWindow &app, GUISUMOAbstractView &parent)=0
Returns an own popup-menu.
void unblockObject(GUIGlID id)
Marks an object as unblocked.
static GUIGlObjectStorage gIDStorage
A single static instance of this class.
GUIGlObject * getObjectBlocking(GUIGlID id)
Returns the object from the container locking it.
static FXIcon * getIcon(const GUIIcon which)
returns a icon previously defined in the enum GUIIcon
virtual void setStatusBarText(const std::string &)
get status bar text (can be implemented in children)
Definition: GUIMainWindow.h:96
virtual double getRotation() const =0
Returns the rotation of the canvas stored in this changer.
virtual double getZoom() const =0
Returns the zoom factor computed stored in this changer.
virtual void onLeftBtnPress(void *data)
mouse functions
virtual double getXPos() const =0
Returns the x-offset of the field to show stored in this changer.
virtual double getYPos() const =0
Returns the y-offset of the field to show stored in this changer.
virtual bool onRightBtnRelease(void *data)
called when user releases right button
const T getColor(const double value) const
const std::string & getName() const
int addColor(const T &color, const double threshold, const std::string &name="")
void paintGLGrid()
paints a grid
bool myAmInitialised
Internal information whether doInit() was called.
Position snapToActiveGrid(const Position &pos, bool snapXY=true) const
Returns a position that is mapped to the closest grid point if the grid is active.
virtual long onLeftBtnRelease(FXObject *, FXSelector, void *)
std::vector< GUIGlObject * > getGUIGlObjectsUnderCursor()
returns the GUIGlObject under the cursor using GL_SELECT (including overlapped objects)
const SUMORTree * myGrid
The visualization speed-up.
GUIDialog_ViewSettings * myVisualizationChanger
Visualization changer.
std::vector< GUIGlID > getObjectsInBoundary(Boundary bound, bool singlePosition)
returns the ids of all objects in the given boundary
FXbool makeCurrent()
A reimplementation due to some internal reasons.
virtual long onMouseMove(FXObject *, FXSelector, void *)
Position myPopupPosition
The current popup-menu position.
GUIMainWindow * myApp
The application.
const Position & getPopupPosition() const
get position of current popup
double m2p(double meter) const
meter-to-pixels conversion method
GUIVisualizationSettings * myVisualizationSettings
visualization settings
void destroyPopup()
destoys the popup
virtual long onKeyPress(FXObject *o, FXSelector sel, void *data)
keyboard functions
Position getPositionInformation() const
Returns the cursor's x/y position within the network.
GUIGlID getObjectAtPosition(Position pos)
returns the id of the object at position using GL_SELECT
std::vector< GUIGlObject * > getGUIGlObjectsUnderSnappedCursor()
returns the GUIGlObject under the gripped cursor using GL_SELECT (including overlapped objects)
virtual long onKeyRelease(FXObject *o, FXSelector sel, void *data)
void drawDecals()
Draws the stored decals.
virtual long onRightBtnRelease(FXObject *, FXSelector, void *)
GUIPerspectiveChanger * myChanger
The perspective changer.
GUIGLObjectPopupMenu * myPopup
The current popup-menu.
virtual long onPaint(FXObject *, FXSelector, void *)
virtual long onRightBtnPress(FXObject *, FXSelector, void *)
static void resetTextures()
Reset textures.
Stores the information about how to visualize structures.
bool drawForRectangleSelection
whether drawing is performed for the purpose of selecting objects using a rectangle
std::string name
The name of this setting.
bool disableLaneIcons
whether drawing is performed in left-hand networks
bool drawForPositionSelection
whether drawing is performed for the purpose of selecting objects with a single click
GUIVisualizationCandidateColorSettings candidateColorSettings
candidate color settings
bool lefthand
whether drawing is performed in left-hand networks
bool showLane2Lane
Information whether lane-to-lane arrows shall be drawn.
GUIVisualizationColorSettings colorSettings
color settings
bool showGrid
Information whether a grid shall be shown.
void save(OutputDevice &dev) const
Writes the settings into an output device.
double scale
information about a lane's width (temporary, used for a single view)
bool forceDrawForRectangleSelection
flag to force draw for rectangle selection (see drawForRectangleSelection)
bool forceDrawForPositionSelection
flag to force draw for position selection (see drawForPositionSelection)
int getCircleResolution() const
function to calculate circle resolution for all circles drawn in drawGL(...) functions
double selectorFrameScale
the current selection scaling in NETEDIT (set in SelectorFrame)
GUIColorer junctionColorer
The junction colorer.
static const std::string SCHEME_NAME_PERMISSION_CODE
GUIVisualizationNeteditSizeSettings neteditSizeSettings
netedit size settings
bool amChecked() const
check if this MFXCheckableButton is checked
void setChecked(bool val)
check or uncheck this MFXCheckableButton
EdgeVector getAllEdges() const
return all edges
The representation of a single edge during network building.
Definition: NBEdge.h:91
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:1166
PositionVector customShape
optional customShape for this crossing
Definition: NBNode.h:152
PositionVector shape
The crossing's shape.
Definition: NBNode.h:138
const PositionVector & getShape() const
retrieve the junction shape
Definition: NBNode.cpp:2285
A storage for options typed value containers)
Definition: OptionsCont.h:89
std::string getString(const std::string &name) const
Returns the string-value of the named option (only for Option_String)
bool getBool(const std::string &name) const
Returns the boolean-value of the named option (only for Option_Bool)
static OptionsCont & getOptions()
Retrieves the options.
Definition: OptionsCont.cpp:58
Static storage of an output device and its base (abstract) implementation.
Definition: OutputDevice.h:60
void close()
Closes the device and removes it from the dictionary.
OutputDevice & openTag(const std::string &xmlElement)
Opens an XML tag.
OutputDevice & writeAttr(const SumoXMLAttr attr, const T &val)
writes a named attribute
Definition: OutputDevice.h:239
bool closeTag(const std::string &comment="")
Closes the most recently opened tag and optionally adds a comment.
static OutputDevice & getDevice(const std::string &name)
Returns the described OutputDevice.
C++ TraCI client API implementation.
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:36
double distanceTo(const Position &p2) const
returns the euclidean distance in 3 dimension
Definition: Position.h:231
double distanceSquaredTo(const Position &p2) const
returns the square of the distance to another position
Definition: Position.h:236
double x() const
Returns the x-position.
Definition: Position.h:54
double y() const
Returns the y-position.
Definition: Position.h:59
A list of positions.
Position positionAtOffset(double pos, double lateralOffset=0) const
Returns the position at the given length.
double nearest_offset_to_point2D(const Position &p, bool perpendicular=true) const
return the nearest offest to point 2D
void move2side(double amount, double maxExtension=100)
move position vector to side using certain ammount
void setAlpha(unsigned char alpha)
Sets a new alpha value.
Definition: RGBColor.h:88
static const RGBColor BLUE
Definition: RGBColor.h:182
static const RGBColor YELLOW
Definition: RGBColor.h:183
static const RGBColor ORANGE
Definition: RGBColor.h:186
static const RGBColor CYAN
Definition: RGBColor.h:184
static const RGBColor GREEN
Definition: RGBColor.h:181
static RGBColor fromHSV(double h, double s, double v)
Converts the given hsv-triplet to rgb, inspired by http://alvyray.com/Papers/CG/hsv2rgb....
Definition: RGBColor.cpp:300
static const RGBColor BLACK
Definition: RGBColor.h:188
static const RGBColor MAGENTA
Definition: RGBColor.h:185
static const RGBColor RED
named colors
Definition: RGBColor.h:180
virtual int Search(const float a_min[2], const float a_max[2], const GUIVisualizationSettings &c) const
Find all within search rectangle.
Definition: SUMORTree.h:116
FXMenuBar * modes
The application menu bar (for select, inspect...)
static double calculateRotation(const Position &first, const Position &second)
return angle between two points (used in geometric calculations)
static void drawGeometry(const GNEViewNet *viewNet, const Geometry &geometry, const double width)
draw geometry
static double calculateLength(const Position &first, const Position &second)
return length between two points (used in geometric calculations)
void buildCommonCheckableButtons()
build checkable buttons
void updateCommonCheckableButtons()
update Common checkable buttons
void disableCommonCheckableButtons()
hide all options menu checks
MFXCheckableButton * selectButton
chekable button for edit mode select
MFXCheckableButton * inspectButton
chekable button for edit mode inspect
MFXCheckableButton * deleteButton
chekable button for edit mode delete
void disableDataCheckableButtons()
hide all options menu checks
void buildDataCheckableButtons()
build checkable buttons
void updateDataCheckableButtons()
update Data checkable buttons
MFXCheckableButton * edgeDataButton
chekable button for edit mode "edgeData"
MFXCheckableButton * edgeRelDataButton
chekable button for edit mode "edgeRelData"
MFXCheckableButton * TAZRelDataButton
chekable button for edit mode "TAZRelData"
struct used to group all variables related to view options in supermode Data
void hideDataViewOptionsMenuChecks()
hide all options menu checks
MFXCheckableButton * menuCheckShowAdditionals
menu check to show Additionals
MFXCheckableButton * menuCheckShowShapes
menu check to show Shapes
void buildDataViewOptionsMenuChecks()
build menu checks
MFXCheckableButton * menuCheckShowDemandElements
menu check to show Demand Elements
MFXCheckableButton * vehicleTypeButton
chekable button for edit mode create vehicle type
MFXCheckableButton * moveDemandElementsButton
chekable button for edit mode "move demand elements"
MFXCheckableButton * personTypeButton
chekable button for edit mode create person type
void buildDemandCheckableButtons()
build checkable buttons
MFXCheckableButton * vehicleButton
chekable button for edit mode create vehicles
MFXCheckableButton * routeButton
chekable button for edit mode create routes
MFXCheckableButton * stopButton
chekable button for edit mode create stops
MFXCheckableButton * personPlanButton
chekable button for edit mode create person plans
MFXCheckableButton * personButton
chekable button for edit mode create persons
void updateDemandCheckableButtons()
update Demand checkable buttons
void disableDemandCheckableButtons()
hide all options menu checks
struct used to group all variables related to view options in supermode Demand
void lockPerson(const GNEDemandElement *person)
lock person
void buildDemandViewOptionsMenuChecks()
build menu checks
const GNEDemandElement * getLockedPerson() const
get locked person
MFXCheckableButton * menuCheckDrawSpreadVehicles
menu check to draw vehicles in begin position or spread in lane
MFXCheckableButton * menuCheckShowGrid
menu check to show grid button
void hideDemandViewOptionsMenuChecks()
hide all options menu checks
MFXCheckableButton * menuCheckShowAllPersonPlans
show all person plans
MFXCheckableButton * menuCheckHideNonInspectedDemandElements
Hide non inspected demand elements.
MFXCheckableButton * menuCheckHideShapes
Hide shapes (Polygons and POIs)
MFXCheckableButton * menuCheckLockPerson
Lock Person.
struct used to group all variables related with Supermodes
DataEditMode dataEditMode
the current Data edit mode
void buildSuperModeButtons()
build checkable buttons
DemandEditMode demandEditMode
the current Demand edit mode
NetworkEditMode networkEditMode
the current Network edit mode
bool isCurrentSupermodeDemand() const
@check if current supermode is Demand
void setDemandEditMode(DemandEditMode demandMode, const bool force=false)
set Demand edit mode
bool isCurrentSupermodeData() const
@check if current supermode is Data
bool isCurrentSupermodeNetwork() const
@check if current supermode is Network
void setSupermode(Supermode supermode, const bool force)
set supermode
void setNetworkEditMode(NetworkEditMode networkMode, const bool force=false)
set Network edit mode
void setDataEditMode(DataEditMode dataMode, const bool force=false)
set Data edit mode
struct used to group all variables related with edit shapes of NetworkElements
GNENetworkElement * getEditedNetworkElement() const
pointer to edited network element
void startEditCustomShape(GNENetworkElement *element)
start edit custom shape
class used to group all variables related with mouse buttons and key pressed after certain events
bool shiftKeyPressed() const
check if SHIFT is pressed during current event
bool altKeyPressed() const
check if ALT is pressed during current event
void update(void *eventData)
update status of MouseButtonKeyPressed during current event
bool controlKeyPressed() const
check if CONTROL is pressed during current event
bool mouseLeftButtonPressed() const
check if mouse left button is pressed during current event
void moveSelection(const bool mouseLeftButtonPressed)
move selection
bool isMovingSelection() const
check if currently there is element being moved
void finishMoveSelection()
finish moving selection
void finishMoveSingleElement()
finish moving single elements in Network AND Demand mode
void moveSingleElement(const bool mouseLeftButtonPressed)
move single element in Network AND Demand mode
bool beginMoveSingleElementNetworkMode()
begin move single element in Network mode
bool beginMoveNetworkElementShape()
begin move network elementshape
bool beginMoveSingleElementDemandMode()
begin move single element in Demand mode
void updateNetworkCheckableButtons()
update network checkable buttons
MFXCheckableButton * trafficLightButton
chekable button for edit mode traffic light
MFXCheckableButton * moveNetworkElementsButton
chekable button for edit mode "move network elements"
MFXCheckableButton * additionalButton
chekable button for edit mode additional
MFXCheckableButton * crossingButton
chekable button for edit mode crossing
MFXCheckableButton * createEdgeButton
chekable button for edit mode create edge
MFXCheckableButton * prohibitionButton
checkable button for edit mode polygon
void buildNetworkCheckableButtons()
build checkable buttons
MFXCheckableButton * shapeButton
chekable button for edit mode shape
MFXCheckableButton * connectionButton
chekable button for edit mode connection
MFXCheckableButton * TAZButton
chekable button for edit mode TAZ
void disableNetworkCheckableButtons()
hide all options menu checks
struct used to group all variables related to view options in supermode Network
MFXCheckableButton * menuCheckSelectEdges
checkable button to select only edges
MFXCheckableButton * menuCheckChainEdges
checkable button to the endpoint for a created edge should be set as the new source
MFXCheckableButton * menuCheckShowDemandElements
checkable button to show Demand Elements
MFXCheckableButton * menuCheckMoveElevation
checkable button to apply movement to elevation
MFXCheckableButton * menuCheckAutoOppositeEdge
check checkable to create auto create opposite edge
MFXCheckableButton * menuCheckDrawSpreadVehicles
checkable button to draw vehicles in begin position or spread in lane
MFXCheckableButton * menuCheckShowConnections
checkable button to show connections
MFXCheckableButton * menuCheckHideConnections
checkable button to hide connections in connect mode
bool selectEdges() const
check if select edges checkbox is enabled
MFXCheckableButton * menuCheckShowJunctionBubble
checkable button to show connection as buuble in "Move" mode.
MFXCheckableButton * menuCheckWarnAboutMerge
checkable button to we should warn about merging junctions
void hideNetworkViewOptionsMenuChecks()
hide all options menu checks
void buildNetworkViewOptionsMenuChecks()
build menu checks
MFXCheckableButton * menuCheckShowGrid
checkable button to show grid button
MFXCheckableButton * menuCheckChangeAllPhases
checkable button to set change all phases
MFXCheckableButton * menuCheckExtendSelection
checkable button to extend to edge nodes
void buildSaveElementsButtons()
build save buttons
void finishRectangleSelection()
finish rectangle selection
void drawRectangleSelection(const RGBColor &color) const
draw rectangle selection
void beginRectangleSelection()
begin rectangle selection
bool selectingUsingRectangle
whether we have started rectangle-selection
void moveRectangleSelection()
move rectangle selection
bool startDrawing
whether we have started rectangle-selection
void processRectangleSelection()
process rectangle Selection
std::vector< GNEEdge * > processEdgeRectangleSelection()
process rectangle Selection (only limited to Edges)
struct used to group all variables related with testing
void drawTestingElements(GUIMainWindow *mainWindow)
draw testing element
static const RGBColor possible
color for possible candidate element
RGBColor selectionColor
basic selection color
static const double junctionBubbleRadius
junction buuble radius
PositionVector shape
shape of Connection
Definition: NBEdge.h:254