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-2022 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>
57 #include <utils/gui/div/GLHelper.h>
67 
68 #include "GNENet.h"
69 #include "GNEUndoList.h"
70 #include "GNEViewNet.h"
71 #include "GNEViewParent.h"
72 #include "GNEApplicationWindow.h"
73 
74 
75 // ===========================================================================
76 // FOX callback mapping
77 // ===========================================================================
78 
79 FXDEFMAP(GNEViewNet) GNEViewNetMap[] = {
80  // Super Modes
84  // Modes
89  FXMAPFUNC(SEL_COMMAND, MID_HOTKEY_D_MODES_DELETE, GNEViewNet::onCmdSetMode),
92  FXMAPFUNC(SEL_COMMAND, MID_HOTKEY_M_MODES_MOVE, GNEViewNet::onCmdSetMode),
95  FXMAPFUNC(SEL_COMMAND, MID_HOTKEY_S_MODES_SELECT, GNEViewNet::onCmdSetMode),
100  // Network view options
115  // Demand view options
126  // Data view options
134  // Select elements
135  FXMAPFUNC(SEL_COMMAND, MID_ADDSELECT, GNEViewNet::onCmdAddSelected),
136  FXMAPFUNC(SEL_COMMAND, MID_REMOVESELECT, GNEViewNet::onCmdRemoveSelected),
139  // Junctions
149  // Connections
151  // Crossings
153  // Edges
154  FXMAPFUNC(SEL_COMMAND, MID_GNE_EDGE_SPLIT, GNEViewNet::onCmdSplitEdge),
156  FXMAPFUNC(SEL_COMMAND, MID_GNE_EDGE_REVERSE, GNEViewNet::onCmdReverseEdge),
161  FXMAPFUNC(SEL_COMMAND, MID_GNE_EDGE_SMOOTH, GNEViewNet::onCmdSmoothEdges),
165  // Lanes
175  FXMAPFUNC(SEL_COMMAND, MID_GNE_LANE_ADD_BIKE, GNEViewNet::onCmdLaneOperation),
176  FXMAPFUNC(SEL_COMMAND, MID_GNE_LANE_ADD_BUS, GNEViewNet::onCmdLaneOperation),
183  FXMAPFUNC(SEL_COMMAND, MID_REACHABILITY, GNEViewNet::onCmdLaneReachability),
184  // Additionals
186  // Polygons
188  FXMAPFUNC(SEL_COMMAND, MID_GNE_POLYGON_CLOSE, GNEViewNet::onCmdClosePolygon),
189  FXMAPFUNC(SEL_COMMAND, MID_GNE_POLYGON_OPEN, GNEViewNet::onCmdOpenPolygon),
193  // POIs
194  FXMAPFUNC(SEL_COMMAND, MID_GNE_POI_TRANSFORM, GNEViewNet::onCmdTransformPOI),
195  // Geometry Points
198  // IntervalBar
205 };
206 
207 // Object implementation
208 FXIMPLEMENT(GNEViewNet, GUISUMOAbstractView, GNEViewNetMap, ARRAYNUMBER(GNEViewNetMap))
209 
210 // ===========================================================================
211 // member method definitions
212 // ===========================================================================
213 
214 GNEViewNet::GNEViewNet(FXComposite* tmpParent, FXComposite* actualParent, GUIMainWindow& app,
215  GNEViewParent* viewParent, GNENet* net, const bool newNet, GNEUndoList* undoList,
216  FXGLVisual* glVis, FXGLCanvas* share) :
217  GUISUMOAbstractView(tmpParent, app, viewParent, net->getGrid(), glVis, share),
218  myEditModes(this, newNet),
219  myTestingMode(this),
220  myObjectsUnderCursor(this),
221  myCommonCheckableButtons(this),
222  myNetworkCheckableButtons(this),
223  myDemandCheckableButtons(this),
224  myDataCheckableButtons(this),
225  myNetworkViewOptions(this),
226  myDemandViewOptions(this),
227  myDataViewOptions(this),
228  myIntervalBar(this),
229  myMoveSingleElementValues(this),
230  myMoveMultipleElementValues(this),
231  myVehicleOptions(this),
232  myVehicleTypeOptions(this),
233  mySaveElements(this),
234  mySelectingArea(this),
235  myEditNetworkElementShapes(this),
236  myLockManager(this),
237  myViewParent(viewParent),
238  myNet(net),
239  myCurrentFrame(nullptr),
240  myUndoList(undoList),
241  myFrontAttributeCarrier(nullptr) {
242  // view must be the final member of actualParent
243  reparent(actualParent);
244  // Build edit modes
245  buildEditModeControls();
246  // set this net in Net
247  myNet->setViewNet(this);
248  // set drag delay
249  ((GUIDanielPerspectiveChanger*)myChanger)->setDragDelay(100000000); // 100 milliseconds
250  // Reset textures
252  // init testing mode
253  myTestingMode.initTestingMode();
254 }
255 
256 
258 
259 
260 void
262  if (myNet && makeCurrent()) {
263  // declare boundary
264  const Boundary maxBoundary(1000000000.0, 1000000000.0, -1000000000.0, -1000000000.0);
265  // get all objects in boundary
266  const std::vector<GUIGlID> GLIDs = getObjectsInBoundary(maxBoundary, false);
267  // finish make OpenGL context current
268  makeNonCurrent();
269  // declare set
270  std::set<GNEAttributeCarrier*> ACs;
271  // iterate over GUIGlIDs
272  for (const auto& GLId : GLIDs) {
274  // Make sure that object exists
275  if (AC && AC->getTagProperty().isPlacedInRTree()) {
276  ACs.insert(AC);
277  }
278  }
279  // interate over ACs
280  for (const auto& AC : ACs) {
281  // remove object and insert again with exaggeration
282  myNet->getGrid().removeAdditionalGLObject(AC->getGUIGlObject());
283  myNet->getGrid().addAdditionalGLObject(AC->getGUIGlObject(), AC->getGUIGlObject()->getExaggeration(*myVisualizationSettings));
284  }
285  }
286 }
287 
288 
289 void
291 
292 
293 void
295  // build coloring tools
296  {
297  for (auto it_names : gSchemeStorage.getNames()) {
298  v->getColoringSchemesCombo()->appendItem(it_names.c_str());
299  if (it_names == myVisualizationSettings->name) {
300  v->getColoringSchemesCombo()->setCurrentItem(v->getColoringSchemesCombo()->getNumItems() - 1);
301  }
302  }
303  v->getColoringSchemesCombo()->setNumVisible(MAX2(5, (int)gSchemeStorage.getNames().size() + 1));
304  }
305  // for junctions
306  new FXButton(v->getLocatorPopup(),
307  "\tLocate Junctions\tLocate a junction within the network. (Shift+J)",
309  ICON_ABOVE_TEXT | FRAME_THICK | FRAME_RAISED);
310  // for edges
311  new FXButton(v->getLocatorPopup(),
312  "\tLocate Edges\tLocate an edge within the network. (Shift+E)",
314  ICON_ABOVE_TEXT | FRAME_THICK | FRAME_RAISED);
315 
316  // for vehicles
317  new FXButton(v->getLocatorPopup(),
318  "\tLocate Vehicles\tLocate a vehicle within the network. (Shift+V)",
320  ICON_ABOVE_TEXT | FRAME_THICK | FRAME_RAISED);
321 
322  // for person
323  new FXButton(v->getLocatorPopup(),
324  "\tLocate Persons\tLocate a person within the network. (Shift+P)",
326  ICON_ABOVE_TEXT | FRAME_THICK | FRAME_RAISED);
327 
328  // for routes
329  new FXButton(v->getLocatorPopup(),
330  "\tLocate Route\tLocate a route within the network. (Shift+R)",
332  ICON_ABOVE_TEXT | FRAME_THICK | FRAME_RAISED);
333 
334  // for routes
335  new FXButton(v->getLocatorPopup(),
336  "\tLocate Stops\tLocate a stop within the network. (Shift+S)",
338  ICON_ABOVE_TEXT | FRAME_THICK | FRAME_RAISED);
339 
340  // for persons (currently unused)
341  /*
342  new FXButton(v->getLocatorPopup(),
343  "\tLocate Vehicle\tLocate a person within the network.",
344  GUIIconSubSys::getIcon(GUIIcon::LOCATEPERSON), &v, MID_LOCATEPERSON,
345  ICON_ABOVE_TEXT | FRAME_THICK | FRAME_RAISED);
346  */
347 
348  // for tls
349  new FXButton(v->getLocatorPopup(),
350  "\tLocate TLS\tLocate a tls within the network. (Shift+T)",
352  ICON_ABOVE_TEXT | FRAME_THICK | FRAME_RAISED);
353  // for additional stuff
354  new FXButton(v->getLocatorPopup(),
355  "\tLocate Additional\tLocate an additional structure within the network. (Shift+A)",
357  ICON_ABOVE_TEXT | FRAME_THICK | FRAME_RAISED);
358  // for pois
359  new FXButton(v->getLocatorPopup(),
360  "\tLocate PoI\tLocate a PoI within the network. (Shift+O)",
362  ICON_ABOVE_TEXT | FRAME_THICK | FRAME_RAISED);
363  // for polygons
364  new FXButton(v->getLocatorPopup(),
365  "\tLocate Polygon\tLocate a Polygon within the network. (Shift+L)",
367  ICON_ABOVE_TEXT | FRAME_THICK | FRAME_RAISED);
368 }
369 
370 
371 void
373  // this call is only used for breakpoints (to check when view is updated)
374  GUISUMOAbstractView::update();
375 }
376 
377 
378 void
381 }
382 
383 
384 std::set<std::pair<std::string, GNEAttributeCarrier*> >
385 GNEViewNet::getAttributeCarriersInBoundary(const Boundary& boundary, bool forceSelectEdges) {
386  // 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)
387  // Note: a map cannot be used because there is different ACs with the same ID (example: Additionals)
388  std::set<std::pair<std::string, GNEAttributeCarrier*> > result;
389  // firstm make OpenGL context current prior to performing OpenGL commands
390  if (makeCurrent()) {
391  // obtain GUIGLIds of all objects in the given boundary (disabling drawForRectangleSelection)
392  std::vector<GUIGlID> GLIds = getObjectsInBoundary(boundary, false);
393  // finish make OpenGL context current
394  makeNonCurrent();
395  // iterate over GUIGlIDs
396  for (const auto& GLId : GLIds) {
397  // avoid to select Net (i = 0)
398  if (GLId != 0) {
400  // in the case of a Lane, we need to change the retrieved lane to their the parent if myNetworkViewOptions.mySelectEdges is enabled
401  if ((retrievedAC->getTagProperty().getTag() == SUMO_TAG_LANE) && (myNetworkViewOptions.selectEdges() || forceSelectEdges)) {
402  retrievedAC = myNet->getAttributeCarriers()->retrieveEdge(retrievedAC->getAttribute(GNE_ATTR_PARENT));
403  } else if ((retrievedAC->getTagProperty().getTag() == SUMO_TAG_EDGE) && !(myNetworkViewOptions.selectEdges() || forceSelectEdges)) {
404  // just ignore this AC
405  retrievedAC = nullptr;
406  }
407  // make sure that AttributeCarrier can be selected
408  if (retrievedAC && retrievedAC->getTagProperty().isSelectable() &&
409  !myLockManager.isObjectLocked(retrievedAC->getGUIGlObject()->getType(), retrievedAC->isAttributeCarrierSelected())) {
410  result.insert(std::make_pair(retrievedAC->getID(), retrievedAC));
411  }
412  }
413  }
414  }
415  return result;
416 }
417 
418 
421  return myObjectsUnderCursor;
422 }
423 
424 
428 }
429 
430 
431 void
433  if (AC->isAttributeCarrierSelected()) {
435  } else {
437  }
438  new FXMenuSeparator(ret);
439 }
440 
441 
442 bool
443 GNEViewNet::setColorScheme(const std::string& name) {
444  if (!gSchemeStorage.contains(name)) {
445  return false;
446  }
447  if (myVisualizationChanger != nullptr) {
448  if (myVisualizationChanger->getCurrentScheme() != name) {
450  }
451  }
452  myVisualizationSettings = &gSchemeStorage.get(name.c_str());
453  updateViewNet();
454  return true;
455 }
456 
457 
458 void
460  // reimplemented from GUISUMOAbstractView due OverlappedInspection
461  ungrab();
462  // make network current
463  if (isEnabled() && myAmInitialised && makeCurrent()) {
464  // fill objects under cursor
466  // get GUIGLObject front
468  // we need to check if we're inspecting a overlapping element
471  myInspectedAttributeCarriers.size() > 0) {
472  o = dynamic_cast<GUIGlObject*>(myInspectedAttributeCarriers.front());
473  }
474  // if GlObject is null, use net
475  if (o == nullptr) {
476  o = myNet;
477  }
478  openObjectDialog(o);
479  makeNonCurrent();
480  }
481 }
482 
483 
484 void
486  // first check if we have to save gui settings in a file (only used for testing purposes)
488  if (oc.getString("gui-testing.setting-output").size() > 0) {
489  try {
490  // open output device
491  OutputDevice& output = OutputDevice::getDevice(oc.getString("gui-testing.setting-output"));
492  // save view settings
494  myVisualizationSettings->save(output);
495  // save viewport (zoom, X, Y and Z)
496  output.openTag(SUMO_TAG_VIEWPORT);
501  output.closeTag();
502  output.closeTag();
503  // close output device
504  output.close();
505  } catch (...) {
506  WRITE_ERROR("GUI-Settings cannot be saved in " + oc.getString("gui-testing.setting-output"));
507  }
508  }
509 }
510 
511 
514  return myEditModes;
515 }
516 
517 
520  return myTestingMode;
521 }
522 
523 
526  return myNetworkViewOptions;
527 }
528 
529 
532  return myDemandViewOptions;
533 }
534 
535 
538  return myDataViewOptions;
539 }
540 
541 
545 }
546 
547 
551 }
552 
553 
554 void
556  bool hide, double hideThreshold) {
557  assert(!scheme.isFixed());
558  UNUSED_PARAMETER(s);
559  double minValue = std::numeric_limits<double>::infinity();
560  double maxValue = -std::numeric_limits<double>::infinity();
561  // retrieve range
562  if (objectType == GLO_LANE) {
563  // XXX (see #3409) multi-colors are not currently handled. this is a quick hack
564  if (active == 9) {
565  active = 8; // segment height, fall back to start height
566  } else if (active == 11) {
567  active = 10; // segment incline, fall back to total incline
568  }
569  for (const auto& lane : myNet->getAttributeCarriers()->getLanes()) {
570  const double val = lane->getColorValue(s, active);
571  if (val == s.MISSING_DATA) {
572  continue;
573  }
574  minValue = MIN2(minValue, val);
575  maxValue = MAX2(maxValue, val);
576  }
577  } else if (objectType == GLO_JUNCTION) {
578  if (active == 3) {
579  for (const auto& junction : myNet->getAttributeCarriers()->getJunctions()) {
580  minValue = MIN2(minValue, junction.second->getPositionInView().z());
581  maxValue = MAX2(maxValue, junction.second->getPositionInView().z());
582  }
583  }
584  } else if (objectType == GLO_TAZRELDATA) {
585  if (active == 4) {
586  for (const auto& genericData : myNet->getAttributeCarriers()->getGenericDatas().at(SUMO_TAG_TAZREL)) {
587  const double value = genericData->getColorValue(s, active);
588  minValue = MIN2(minValue, value);
589  maxValue = MAX2(maxValue, value);
590  }
591  }
592  }
594  scheme.clear();
595  // add threshold for every distinct value
596  std::set<SVCPermissions> codes;
597  for (const auto& lane : myNet->getAttributeCarriers()->getLanes()) {
598  codes.insert(lane->getParentEdge()->getNBEdge()->getPermissions(lane->getIndex()));
599  }
600  int step = MAX2(1, 360 / (int)codes.size());
601  int hue = 0;
602  for (SVCPermissions p : codes) {
603  scheme.addColor(RGBColor::fromHSV(hue, 1, 1), p);
604  hue = (hue + step) % 360;
605  }
606  return;
607  }
608  if (minValue != std::numeric_limits<double>::infinity()) {
609  scheme.clear();
610  // add new thresholds
611  if (hide) {
612  const double rawRange = maxValue - minValue;
613  minValue = MAX2(hideThreshold + MIN2(1.0, rawRange / 100.0), minValue);
614  scheme.addColor(RGBColor(204, 204, 204), hideThreshold);
615  }
616  double range = maxValue - minValue;
617  scheme.addColor(RGBColor::RED, (minValue));
618  scheme.addColor(RGBColor::ORANGE, (minValue + range * 1 / 6.0));
619  scheme.addColor(RGBColor::YELLOW, (minValue + range * 2 / 6.0));
620  scheme.addColor(RGBColor::GREEN, (minValue + range * 3 / 6.0));
621  scheme.addColor(RGBColor::CYAN, (minValue + range * 4 / 6.0));
622  scheme.addColor(RGBColor::BLUE, (minValue + range * 5 / 6.0));
623  scheme.addColor(RGBColor::MAGENTA, (maxValue));
624  }
625 }
626 
627 
628 void
629 GNEViewNet::setStatusBarText(const std::string& text) {
630  myApp->setStatusBarText(text);
631 }
632 
633 
634 bool
637 }
638 
639 
640 void
641 GNEViewNet::setSelectorFrameScale(double selectionScale) {
643 }
644 
645 
646 bool
649 }
650 
651 
652 bool
655 }
656 
657 
658 bool
659 GNEViewNet::mergeJunctions(GNEJunction* movedJunction, GNEJunction* targetJunction) {
660  if (movedJunction && targetJunction &&
661  !movedJunction->isAttributeCarrierSelected() && !targetJunction->isAttributeCarrierSelected() &&
662  (movedJunction != targetJunction)) {
663  // optionally ask for confirmation
665  WRITE_DEBUG("Opening FXMessageBox 'merge junctions'");
666  // open question box
667  FXuint answer = FXMessageBox::question(this, MBOX_YES_NO,
668  "Confirm Junction Merger", "%s",
669  ("Do you wish to merge junctions '" + movedJunction->getMicrosimID() +
670  "' and '" + targetJunction->getMicrosimID() + "'?\n" +
671  "('" + movedJunction->getMicrosimID() +
672  "' will be eliminated and its roads added to '" +
673  targetJunction->getMicrosimID() + "')").c_str());
674  if (answer != 1) { //1:yes, 2:no, 4:esc
675  // write warning if netedit is running in testing mode
676  if (answer == 2) {
677  WRITE_DEBUG("Closed FXMessageBox 'merge junctions' with 'No'");
678  } else if (answer == 4) {
679  WRITE_DEBUG("Closed FXMessageBox 'merge junctions' with 'ESC'");
680  }
681  return false;
682  } else {
683  // write warning if netedit is running in testing mode
684  WRITE_DEBUG("Closed FXMessageBox 'merge junctions' with 'Yes'");
685  }
686  }
687  // merge moved and targed junctions
688  myNet->mergeJunctions(movedJunction, targetJunction, myUndoList);
689  return true;
690  } else {
691  return false;
692  }
693 }
694 
695 
696 bool
697 GNEViewNet::aksChangeSupermode(const std::string& operation, Supermode expectedSupermode) {
698  std::string supermode;
699  if (expectedSupermode == Supermode::NETWORK) {
700  supermode = "network";
701  } else if (expectedSupermode == Supermode::DEMAND) {
702  supermode = "demand";
703  } else if (expectedSupermode == Supermode::DATA) {
704  supermode = "data";
705  } else {
706  throw ProcessError("invalid expecte supermode");
707  }
708  // open question box
709  const auto answer = FXMessageBox::question(myApp, MBOX_YES_NO,
710  "Confirm change supermode", "%s",
711  (operation + " require to change to " + supermode + " mode. Continue?").c_str());
712  // restore focus to view net
713  setFocus();
714  // return answer
715  if (answer == MBOX_CLICKED_YES) {
716  myEditModes.setSupermode(expectedSupermode, true);
717  return true;
718  } else {
719  return false;
720  }
721 }
722 
723 
725  myEditModes(this, false),
726  myTestingMode(this),
727  myObjectsUnderCursor(this),
728  myCommonCheckableButtons(this),
729  myNetworkCheckableButtons(this),
730  myDemandCheckableButtons(this),
731  myDataCheckableButtons(this),
732  myNetworkViewOptions(this),
733  myDemandViewOptions(this),
734  myDataViewOptions(this),
735  myIntervalBar(this),
736  myMoveSingleElementValues(this),
737  myMoveMultipleElementValues(this),
738  myVehicleOptions(this),
739  myVehicleTypeOptions(this),
740  mySaveElements(this),
741  mySelectingArea(this),
742  myEditNetworkElementShapes(this),
743  myLockManager(this),
744  myViewParent(nullptr),
745  myNet(nullptr),
746  myCurrentFrame(nullptr),
747  myUndoList(nullptr),
748  myFrontAttributeCarrier(nullptr) {
749 }
750 
751 
752 std::vector<std::string>
753 GNEViewNet::getEdgeLaneParamKeys(bool edgeKeys) const {
754  std::set<std::string> keys;
755  for (const NBEdge* e : myNet->getEdgeCont().getAllEdges()) {
756  if (edgeKeys) {
757  for (const auto& item : e->getParametersMap()) {
758  keys.insert(item.first);
759  }
760  for (const auto& con : e->getConnections()) {
761  for (const auto& item : con.getParametersMap()) {
762  keys.insert(item.first);
763  }
764  }
765  } else {
766  for (const auto& lane : e->getLanes()) {
767  int i = 0;
768  for (const auto& item : lane.getParametersMap()) {
769  keys.insert(item.first);
770  }
771  for (const auto& con : e->getConnectionsFromLane(i)) {
772  for (const auto& item : con.getParametersMap()) {
773  keys.insert(item.first);
774  }
775  }
776  i++;
777  }
778  }
779  }
780  return std::vector<std::string>(keys.begin(), keys.end());
781 }
782 
783 
784 std::vector<std::string>
786  std::set<std::string> keys;
787  for (const auto& genericData : myNet->getAttributeCarriers()->getGenericDatas().at(SUMO_TAG_MEANDATA_EDGE)) {
788  for (const auto& parameter : genericData->getACParametersMap()) {
789  keys.insert(parameter.first);
790  }
791  }
792  return std::vector<std::string>(keys.begin(), keys.end());
793 }
794 
795 
796 std::vector<std::string>
798  std::set<std::string> keys;
799  for (const auto& genericData : myNet->getAttributeCarriers()->getGenericDatas().at(SUMO_TAG_TAZREL)) {
800  for (const auto& parameter : genericData->getACParametersMap()) {
801  keys.insert(parameter.first);
802  }
803  }
804  for (const auto& genericData : myNet->getAttributeCarriers()->getGenericDatas().at(SUMO_TAG_EDGEREL)) {
805  for (const auto& parameter : genericData->getACParametersMap()) {
806  keys.insert(parameter.first);
807  }
808  }
809  return std::vector<std::string>(keys.begin(), keys.end());
810 }
811 
812 int
813 GNEViewNet::doPaintGL(int mode, const Boundary& bound) {
814  // init view settings
817  }
820  }
821  // set lefthand and laneIcons
824 
825  glRenderMode(mode);
826  glMatrixMode(GL_MODELVIEW);
828  glDisable(GL_TEXTURE_2D);
829  glDisable(GL_ALPHA_TEST);
830  glEnable(GL_BLEND);
831  glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
832  glEnable(GL_DEPTH_TEST);
833 
834  // visualize rectangular selection
836 
837  // compute lane width
838  double lw = m2p(SUMO_const_laneWidth);
839  // draw decals (if not in grabbing mode)
841  drawDecals();
842  // depending of the visualizationSettings, enable or disable check box show grid
844  // change show grid
847  // change to true
850  // update show grid buttons
853  }
854  // draw grid only in network and demand mode
856  paintGLGrid();
857  }
858  } else {
859  // change show grid
862  // change to false
865  // update show grid buttons
868  }
869  }
870  // update show connections
872  }
873  // draw temporal junction
875  // draw temporal elements
879  // draw testing elements
881  // draw temporal E2 multilane detectors
883  // draw temporal trip/flow route
885  // draw temporal person plan route
888  // draw temporal route
890  // draw temporal edgeRelPath
892  }
893  // check menu checks of supermode demand
895  // enable or disable menuCheckShowAllPersonPlans depending of there is a locked person
898  } else {
900  }
901  }
902  // clear pathDraw
904  // draw elements
905  glLineWidth(1);
906  glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
907  const float minB[2] = { (float)bound.xmin(), (float)bound.ymin() };
908  const float maxB[2] = { (float)bound.xmax(), (float)bound.ymax() };
910  glEnable(GL_POLYGON_OFFSET_FILL);
911  glEnable(GL_POLYGON_OFFSET_LINE);
912  // obtain objects included in minB and maxB
913  int hits2 = myGrid->Search(minB, maxB, *myVisualizationSettings);
914  // force draw inspected and front elements (due parent/child lines)
917  // iterate over all inspected ACs
918  for (const auto& inspectedAC : myInspectedAttributeCarriers) {
919  // check that inspected AC has an associated GUIGLObject
920  if (inspectedAC->getTagProperty().isAdditionalElement() && inspectedAC->getGUIGlObject()) {
921  inspectedAC->getGUIGlObject()->drawGL(*myVisualizationSettings);
922  }
923  }
924  // draw front element
927  }
928  }
929  // pop draw matrix
931  return hits2;
932 }
933 
934 
935 long
936 GNEViewNet::onLeftBtnPress(FXObject*, FXSelector, void* eventData) {
937  // set focus in view net
938  setFocus();
939  // update MouseButtonKeyPressed
940  myMouseButtonKeyPressed.update(eventData);
941  // interpret object under cursor
942  if (makeCurrent()) {
943  // fill objects under cursor
945  // process left button press function depending of supermode
948  } else if (myEditModes.isCurrentSupermodeDemand()) {
949  processLeftButtonPressDemand(eventData);
950  } else if (myEditModes.isCurrentSupermodeData()) {
951  processLeftButtonPressData(eventData);
952  }
953  makeNonCurrent();
954  }
955  // update cursor
956  updateCursor();
957  // update view
958  updateViewNet();
959  return 1;
960 }
961 
962 
963 long
964 GNEViewNet::onLeftBtnRelease(FXObject* obj, FXSelector sel, void* eventData) {
965  // process parent function
966  GUISUMOAbstractView::onLeftBtnRelease(obj, sel, eventData);
967  // update MouseButtonKeyPressed
968  myMouseButtonKeyPressed.update(eventData);
969  // interpret object under cursor
970  if (makeCurrent()) {
971  // fill objects under cursor
973  // process left button release function depending of supermode
976  } else if (myEditModes.isCurrentSupermodeDemand()) {
978  } else if (myEditModes.isCurrentSupermodeData()) {
980  }
981  makeNonCurrent();
982  }
983  // update cursor
984  updateCursor();
985  // update view
986  updateViewNet();
987  return 1;
988 }
989 
990 
991 long
992 GNEViewNet::onRightBtnPress(FXObject* obj, FXSelector sel, void* eventData) {
993  // update MouseButtonKeyPressed
994  myMouseButtonKeyPressed.update(eventData);
995  // update cursor
996  updateCursor();
998  // disable right button press during drawing polygon
999  return 1;
1000  } else {
1001  return GUISUMOAbstractView::onRightBtnPress(obj, sel, eventData);
1002  }
1003 }
1004 
1005 
1006 long
1007 GNEViewNet::onRightBtnRelease(FXObject* obj, FXSelector sel, void* eventData) {
1008  // update MouseButtonKeyPressed
1009  myMouseButtonKeyPressed.update(eventData);
1010  // update cursor
1011  updateCursor();
1012  // disable right button release during drawing polygon
1014  return 1;
1015  } else {
1016  return GUISUMOAbstractView::onRightBtnRelease(obj, sel, eventData);
1017  }
1018 }
1019 
1020 
1021 long
1022 GNEViewNet::onMouseMove(FXObject* obj, FXSelector sel, void* eventData) {
1023  // process mouse move in GUISUMOAbstractView
1024  GUISUMOAbstractView::onMouseMove(obj, sel, eventData);
1025  // update MouseButtonKeyPressed
1026  myMouseButtonKeyPressed.update(eventData);
1027  // update cursor
1028  updateCursor();
1029  // process mouse move function depending of supermode
1032  } else if (myEditModes.isCurrentSupermodeDemand()) {
1034  } else if (myEditModes.isCurrentSupermodeData()) {
1036  }
1037  // update view
1038  updateViewNet();
1039  return 1;
1040 }
1041 
1042 
1043 long
1044 GNEViewNet::onKeyPress(FXObject* o, FXSelector sel, void* eventData) {
1045  // update MouseButtonKeyPressed
1046  myMouseButtonKeyPressed.update(eventData);
1047  // update cursor
1048  updateCursor();
1049  // continue depending of current edit mode
1051  // update viewNet (for temporal junction)
1052  updateViewNet();
1054  // change "delete last created point" depending of shift key
1056  updateViewNet();
1058  // change "delete last created point" depending of shift key
1060  updateViewNet();
1062  updateViewNet();
1063  }
1064  return GUISUMOAbstractView::onKeyPress(o, sel, eventData);
1065 }
1066 
1067 
1068 long
1069 GNEViewNet::onKeyRelease(FXObject* o, FXSelector sel, void* eventData) {
1070  // update MouseButtonKeyPressed
1071  myMouseButtonKeyPressed.update(eventData);
1072  // update cursor
1073  updateCursor();
1074  // continue depending of current edit mode
1076  // update viewNet (for temporal junction)
1077  updateViewNet();
1079  // change "delete last created point" depending of shift key
1081  updateViewNet();
1083  // change "delete last created point" depending of shift key
1085  updateViewNet();
1087  updateViewNet();
1088  }
1089  // check if selecting using rectangle has to be disabled
1092  updateViewNet();
1093  }
1094  return GUISUMOAbstractView::onKeyRelease(o, sel, eventData);
1095 }
1096 
1097 
1098 void
1099 GNEViewNet::abortOperation(bool clearSelection) {
1100  // steal focus from any text fields and place it over view net
1101  setFocus();
1102  // check what supermode is enabled
1104  // abort operation depending of current mode
1106  // abort edge creation in create edge frame
1110  // check if current selection has to be cleaned
1111  if (clearSelection) {
1113  }
1115  // abort changes in Connector Frame
1118  myViewParent->getTLSEditorFrame()->onCmdCancel(nullptr, 0, nullptr);
1122  // abort current drawing
1126  // abort current drawing
1128  } else if (myViewParent->getTAZFrame()->getCurrentTAZModule()->getTAZ() != nullptr) {
1129  // finish current editing TAZ
1131  }
1133  myViewParent->getProhibitionFrame()->onCmdCancel(nullptr, 0, nullptr);
1135  // abort select lanes
1137  // abort path
1139  }
1140  } else if (myEditModes.isCurrentSupermodeDemand()) {
1141  // abort operation depending of current mode
1144  // check if current selection has to be cleaned
1145  if (clearSelection) {
1147  }
1160  }
1161  } else if (myEditModes.isCurrentSupermodeData()) {
1162  // abort operation depending of current mode
1165  // check if current selection has to be cleaned
1166  if (clearSelection) {
1168  }
1173  }
1174  }
1175  // abort undo list
1177  // update view
1178  updateViewNet();
1179 }
1180 
1181 
1182 void
1184  // delete elements depending of current supermode
1187  setStatusBarText("Cannot delete in this mode");
1189  // delete inspected elements
1190  myUndoList->begin(GUIIcon::MODEDELETE, "delete network inspected elements");
1192  myUndoList->end();
1193  } else {
1194  // get selected ACs
1195  const auto selectedACs = myNet->getAttributeCarriers()->getSelectedAttributeCarriers(false);
1196  // delete selected elements
1197  if (selectedACs.size() > 0) {
1198  myUndoList->begin(GUIIcon::MODEDELETE, "delete network selection");
1199  deleteNetworkAttributeCarriers(selectedACs);
1200  myUndoList->end();
1201  }
1202  }
1203  } else if (myEditModes.isCurrentSupermodeDemand()) {
1205  // delete inspected elements
1206  myUndoList->begin(GUIIcon::MODEDELETE, "delete demand inspected elements");
1208  myUndoList->end();
1209  } else {
1210  // get selected ACs
1211  const auto selectedACs = myNet->getAttributeCarriers()->getSelectedAttributeCarriers(false);
1212  // delete selected elements
1213  if (selectedACs.size() > 0) {
1214  myUndoList->begin(GUIIcon::MODEDELETE, "delete demand selection");
1215  deleteDemandAttributeCarriers(selectedACs);
1216  myUndoList->end();
1217  }
1218  }
1219  } else if (myEditModes.isCurrentSupermodeData()) {
1221  // delete inspected elements
1222  myUndoList->begin(GUIIcon::MODEDELETE, "delete data inspected elements");
1224  myUndoList->end();
1225  } else {
1226  // get selected ACs
1227  const auto selectedACs = myNet->getAttributeCarriers()->getSelectedAttributeCarriers(false);
1228  // delete selected elements
1229  if (selectedACs.size() > 0) {
1230  myUndoList->begin(GUIIcon::MODEDELETE, "delete data selection");
1231  deleteDataAttributeCarriers(selectedACs);
1232  myUndoList->end();
1233  }
1234  }
1235  }
1236  // update view
1237  updateViewNet();
1238 }
1239 
1240 
1241 void
1243  // check what supermode is enabled
1245  // abort operation depending of current mode
1247  // Accept changes in Connector Frame
1250  myViewParent->getTLSEditorFrame()->onCmdOK(nullptr, 0, nullptr);
1255  // stop current drawing
1257  } else {
1258  // start drawing
1260  }
1265  // stop current drawing
1267  } else if (myViewParent->getTAZFrame()->getCurrentTAZModule()->getTAZ() == nullptr) {
1268  // start drawing
1271  // save pending changes
1273  }
1276  // stop select lanes to create additional
1278  }
1279  // create E2
1281  }
1282  } else if (myEditModes.isCurrentSupermodeDemand()) {
1295  }
1296  } else if (myEditModes.isCurrentSupermodeData()) {
1301  }
1302  }
1303 }
1304 
1305 
1306 void
1308  // check what supermode is enabled
1312  }
1313  } else if (myEditModes.isCurrentSupermodeDemand()) {
1326  }
1327  } else if (myEditModes.isCurrentSupermodeData()) {
1330  }
1331  }
1332 }
1333 
1334 void
1336  // if there is a visible frame, set focus over it. In other case, set focus over ViewNet
1337  if (myCurrentFrame != nullptr) {
1339  } else {
1340  setFocus();
1341  }
1342 }
1343 
1344 
1347  return myViewParent;
1348 }
1349 
1350 
1351 GNENet*
1353  return myNet;
1354 }
1355 
1356 
1357 GNEUndoList*
1359  return myUndoList;
1360 }
1361 
1362 
1365  return myIntervalBar;
1366 }
1367 
1368 
1369 const std::vector<GNEAttributeCarrier*>&
1372 }
1373 
1374 
1377  return myLockManager;
1378 }
1379 
1380 
1381 void
1382 GNEViewNet::setInspectedAttributeCarriers(const std::vector<GNEAttributeCarrier*> ACs) {
1384 }
1385 
1386 
1387 bool
1389  if (myInspectedAttributeCarriers.empty()) {
1390  return false;
1391  } else {
1392  // search AC in myInspectedAttributeCarriers
1393  const auto it = std::find(myInspectedAttributeCarriers.begin(), myInspectedAttributeCarriers.end(), AC);
1394  if (it == myInspectedAttributeCarriers.end()) {
1395  return false;
1396  } else {
1397  return true;
1398  }
1399  }
1400 }
1401 
1402 
1403 void
1405  // search AC in myInspectedAttributeCarriers
1406  const auto it = std::find(myInspectedAttributeCarriers.begin(), myInspectedAttributeCarriers.end(), AC);
1407  if (it != myInspectedAttributeCarriers.end()) {
1408  myInspectedAttributeCarriers.erase(it);
1410  }
1411 }
1412 
1413 
1414 const GNEAttributeCarrier*
1416  return myFrontAttributeCarrier;
1417 }
1418 
1419 
1420 void
1423  // update view
1424  updateViewNet();
1425 }
1426 
1427 
1428 void
1429 GNEViewNet::drawTranslateFrontAttributeCarrier(const GNEAttributeCarrier* AC, double typeOrLayer, const double extraOffset) {
1430  if (myFrontAttributeCarrier == AC) {
1431  glTranslated(0, 0, GLO_DOTTEDCONTOUR_FRONT + extraOffset);
1432  } else {
1433  glTranslated(0, 0, typeOrLayer + extraOffset);
1434  }
1435 }
1436 
1437 
1438 GNEJunction*
1440  GNEJunction* junction = nullptr;
1441  if (makeCurrent()) {
1445  if (pointed) {
1446  switch (pointed->getType()) {
1447  case GLO_JUNCTION:
1448  junction = (GNEJunction*)pointed;
1449  break;
1450  default:
1451  break;
1452  }
1453  }
1454  }
1455  return junction;
1456 }
1457 
1458 
1461  GNEConnection* connection = nullptr;
1462  if (makeCurrent()) {
1466  if (pointed) {
1467  switch (pointed->getType()) {
1468  case GLO_CONNECTION:
1469  connection = (GNEConnection*)pointed;
1470  break;
1471  default:
1472  break;
1473  }
1474  }
1475  }
1476  return connection;
1477 }
1478 
1479 
1480 GNECrossing*
1482  GNECrossing* crossing = nullptr;
1483  if (makeCurrent()) {
1487  if (pointed) {
1488  switch (pointed->getType()) {
1489  case GLO_CROSSING:
1490  crossing = (GNECrossing*)pointed;
1491  break;
1492  default:
1493  break;
1494  }
1495  }
1496  }
1497  return crossing;
1498 }
1499 
1500 GNEEdge*
1502  GNEEdge* edge = nullptr;
1503  if (makeCurrent()) {
1507  if (pointed) {
1508  switch (pointed->getType()) {
1509  case GLO_EDGE:
1510  edge = (GNEEdge*)pointed;
1511  break;
1512  case GLO_LANE:
1513  edge = (((GNELane*)pointed)->getParentEdge());
1514  break;
1515  default:
1516  break;
1517  }
1518  }
1519  }
1520  return edge;
1521 }
1522 
1523 
1524 GNELane*
1526  GNELane* lane = nullptr;
1527  if (makeCurrent()) {
1531  if (pointed) {
1532  if (pointed->getType() == GLO_LANE) {
1533  lane = (GNELane*)pointed;
1534  }
1535  }
1536  }
1537  return lane;
1538 }
1539 
1540 
1543  if (makeCurrent()) {
1547  if (pointed) {
1548  return dynamic_cast<GNEAdditional*>(pointed);
1549  }
1550  }
1551  return nullptr;
1552 }
1553 
1554 
1555 GNEPoly*
1557  if (makeCurrent()) {
1561  if (pointed) {
1562  return dynamic_cast<GNEPoly*>(pointed);
1563  }
1564  }
1565  return nullptr;
1566 }
1567 
1568 
1569 GNEPOI*
1571  if (makeCurrent()) {
1575  if (pointed) {
1576  return dynamic_cast<GNEPOI*>(pointed);
1577  }
1578  }
1579  return nullptr;
1580 }
1581 
1582 
1583 GNETAZ*
1585  if (makeCurrent()) {
1589  if (pointed) {
1590  return dynamic_cast<GNETAZ*>(pointed);
1591  }
1592  }
1593  return nullptr;
1594 }
1595 
1596 
1597 long
1598 GNEViewNet::onCmdSetSupermode(FXObject*, FXSelector sel, void*) {
1599  // check what network mode will be set
1600  switch (FXSELID(sel)) {
1603  break;
1606  break;
1609  break;
1610  default:
1611  break;
1612  }
1613  return 1;
1614 }
1615 
1616 long
1617 GNEViewNet::onCmdSetMode(FXObject*, FXSelector sel, void*) {
1619  // check what network mode will be set
1620  switch (FXSELID(sel)) {
1623  break;
1626  break;
1629  break;
1632  break;
1635  break;
1638  break;
1641  break;
1644  break;
1647  break;
1650  break;
1653  break;
1656  break;
1657  default:
1658  break;
1659  }
1660  } else if (myEditModes.isCurrentSupermodeDemand()) {
1661  // check what demand mode will be set
1662  switch (FXSELID(sel)) {
1665  break;
1668  break;
1671  break;
1674  break;
1677  break;
1680  break;
1683  break;
1686  break;
1689  break;
1692  break;
1695  break;
1698  break;
1699  default:
1700  break;
1701  }
1702  } else if (myEditModes.isCurrentSupermodeData()) {
1703  // check what demand mode will be set
1704  switch (FXSELID(sel)) {
1707  break;
1710  break;
1713  break;
1716  break;
1719  break;
1722  break;
1723  }
1724  }
1725  return 1;
1726 }
1727 
1728 
1729 long
1730 GNEViewNet::onCmdSplitEdge(FXObject*, FXSelector, void*) {
1731  GNEEdge* edge = getEdgeAtPopupPosition();
1732  if (edge != nullptr) {
1734  }
1735  return 1;
1736 }
1737 
1738 
1739 long
1740 GNEViewNet::onCmdSplitEdgeBidi(FXObject*, FXSelector, void*) {
1741  GNEEdge* edge = getEdgeAtPopupPosition();
1742  if (edge != nullptr) {
1743  // obtain reverse edge
1744  GNEEdge* reverseEdge = edge->getOppositeEdge();
1745  // check that reverse edge works
1746  if (reverseEdge != nullptr) {
1747  myNet->splitEdgesBidi(edge, reverseEdge, edge->getSplitPos(getPopupPosition()), myUndoList);
1748  }
1749  }
1750  return 1;
1751 }
1752 
1753 
1754 long
1755 GNEViewNet::onCmdReverseEdge(FXObject*, FXSelector, void*) {
1756  GNEEdge* edge = getEdgeAtPopupPosition();
1757  if (edge != nullptr) {
1758  if (edge->isAttributeCarrierSelected()) {
1759  myUndoList->begin(GUIIcon::EDGE, "Reverse selected " + toString(SUMO_TAG_EDGE) + "s");
1760  const auto selectedEdges = myNet->getAttributeCarriers()->getSelectedEdges();
1761  for (const auto& selectedEdge : selectedEdges) {
1762  myNet->reverseEdge(selectedEdge, myUndoList);
1763  }
1764  myUndoList->end();
1765  } else {
1767  myNet->reverseEdge(edge, myUndoList);
1768  myUndoList->end();
1769  }
1770  }
1771  return 1;
1772 }
1773 
1774 
1775 long
1776 GNEViewNet::onCmdAddReversedEdge(FXObject*, FXSelector, void*) {
1777  GNEEdge* edge = getEdgeAtPopupPosition();
1778  if (edge != nullptr) {
1779  if (edge->isAttributeCarrierSelected()) {
1780  myUndoList->begin(GUIIcon::EDGE, "Add Reverse edge for selected " + toString(SUMO_TAG_EDGE) + "s");
1781  const auto selectedEdges = myNet->getAttributeCarriers()->getSelectedEdges();
1782  for (const auto& selectedEdge : selectedEdges) {
1783  myNet->addReversedEdge(selectedEdge, myUndoList);
1784  }
1785  myUndoList->end();
1786  } else {
1787  myUndoList->begin(GUIIcon::EDGE, "Add reverse " + toString(SUMO_TAG_EDGE));
1789  myUndoList->end();
1790  }
1791  }
1792  return 1;
1793 }
1794 
1795 
1796 long
1797 GNEViewNet::onCmdEditEdgeEndpoint(FXObject*, FXSelector, void*) {
1798  GNEEdge* edge = getEdgeAtPopupPosition();
1799  if (edge != nullptr) {
1800  // snap to active grid the Popup position
1802  }
1803  return 1;
1804 }
1805 
1806 
1807 long
1808 GNEViewNet::onCmdResetEdgeEndpoint(FXObject*, FXSelector, void*) {
1809  GNEEdge* edge = getEdgeAtPopupPosition();
1810  if (edge != nullptr) {
1811  // check if edge is selected
1812  if (edge->isAttributeCarrierSelected()) {
1813  // get all selected edges
1814  const auto selectedEdges = myNet->getAttributeCarriers()->getSelectedEdges();
1815  // begin operation
1816  myUndoList->begin(GUIIcon::EDGE, "reset geometry points");
1817  // iterate over selected edges
1818  for (const auto& selectedEdge : selectedEdges) {
1819  // reset both end points
1820  selectedEdge->resetBothEndpoint(myUndoList);
1821  }
1822  // end operation
1823  myUndoList->end();
1824  } else {
1826  }
1827  }
1828  return 1;
1829 }
1830 
1831 
1832 long
1833 GNEViewNet::onCmdStraightenEdges(FXObject*, FXSelector, void*) {
1834  GNEEdge* edge = getEdgeAtPopupPosition();
1835  if (edge != nullptr) {
1836  if (edge->isAttributeCarrierSelected()) {
1837  myUndoList->begin(GUIIcon::EDGE, "straighten selected " + toString(SUMO_TAG_EDGE) + "s");
1838  const auto selectedEdges = myNet->getAttributeCarriers()->getSelectedEdges();
1839  for (const auto& selectedEdge : selectedEdges) {
1840  selectedEdge->setAttribute(SUMO_ATTR_SHAPE, "", myUndoList);
1841  }
1842  myUndoList->end();
1843  } else {
1844 
1845  myUndoList->begin(GUIIcon::EDGE, "straighten " + toString(SUMO_TAG_EDGE));
1847  myUndoList->end();
1848  }
1849  }
1850  return 1;
1851 }
1852 
1853 
1854 long
1855 GNEViewNet::onCmdSmoothEdges(FXObject*, FXSelector, void*) {
1856  GNEEdge* edge = getEdgeAtPopupPosition();
1857  if (edge != nullptr) {
1858  if (edge->isAttributeCarrierSelected()) {
1859  myUndoList->begin(GUIIcon::EDGE, "straighten elevation of selected " + toString(SUMO_TAG_EDGE) + "s");
1860  const auto selectedEdges = myNet->getAttributeCarriers()->getSelectedEdges();
1861  for (const auto& selectedEdge : selectedEdges) {
1862  selectedEdge->smooth(myUndoList);
1863  }
1864  myUndoList->end();
1865  } else {
1866  myUndoList->begin(GUIIcon::EDGE, "straighten edge elevation");
1867  edge->smooth(myUndoList);
1868  myUndoList->end();
1869  }
1870  }
1871  return 1;
1872 }
1873 
1874 
1875 long
1876 GNEViewNet::onCmdStraightenEdgesElevation(FXObject*, FXSelector, void*) {
1877  GNEEdge* edge = getEdgeAtPopupPosition();
1878  if (edge != nullptr) {
1879  if (edge->isAttributeCarrierSelected()) {
1880  myUndoList->begin(GUIIcon::EDGE, "straighten elevation of selected " + toString(SUMO_TAG_EDGE) + "s");
1881  const auto selectedEdges = myNet->getAttributeCarriers()->getSelectedEdges();
1882  for (const auto& selectedEdge : selectedEdges) {
1883  selectedEdge->straightenElevation(myUndoList);
1884  }
1885  myUndoList->end();
1886  } else {
1887  myUndoList->begin(GUIIcon::EDGE, "straighten edge elevation");
1889  myUndoList->end();
1890  }
1891  }
1892  return 1;
1893 }
1894 
1895 
1896 long
1897 GNEViewNet::onCmdSmoothEdgesElevation(FXObject*, FXSelector, void*) {
1898  GNEEdge* edge = getEdgeAtPopupPosition();
1899  if (edge != nullptr) {
1900  if (edge->isAttributeCarrierSelected()) {
1901  myUndoList->begin(GUIIcon::EDGE, "smooth elevation of selected " + toString(SUMO_TAG_EDGE) + "s");
1902  const auto selectedEdges = myNet->getAttributeCarriers()->getSelectedEdges();
1903  for (const auto& selectedEdge : selectedEdges) {
1904  selectedEdge->smoothElevation(myUndoList);
1905  }
1906  myUndoList->end();
1907  } else {
1908  myUndoList->begin(GUIIcon::EDGE, "smooth edge elevation");
1909  edge->smoothElevation(myUndoList);
1910  myUndoList->end();
1911  }
1912  }
1913  return 1;
1914 }
1915 
1916 
1917 long
1918 GNEViewNet::onCmdResetLength(FXObject*, FXSelector, void*) {
1919  GNEEdge* edge = getEdgeAtPopupPosition();
1920  if (edge != nullptr) {
1921  if (edge->isAttributeCarrierSelected()) {
1922  myUndoList->begin(GUIIcon::EDGE, "reset edge lengths");
1923  const auto selectedEdges = myNet->getAttributeCarriers()->getSelectedEdges();
1924  for (const auto& selectedEdge : selectedEdges) {
1925  selectedEdge->setAttribute(SUMO_ATTR_LENGTH, "-1", myUndoList);
1926  }
1927  myUndoList->end();
1928  } else {
1930  }
1931  }
1932  return 1;
1933 }
1934 
1935 
1936 long
1937 GNEViewNet::onCmdSimplifyShape(FXObject*, FXSelector, void*) {
1938  // get polygon under mouse
1939  GNEPoly* polygonUnderMouse = getPolygonAtPopupPosition();
1940  // check polygon
1941  if (polygonUnderMouse) {
1942  // check if shape is selected
1943  if (polygonUnderMouse->isAttributeCarrierSelected()) {
1944  // begin undo-list
1945  myNet->getViewNet()->getUndoList()->begin(GUIIcon::POLY, "simplify shapes");
1946  // get shapes
1947  const auto selectedShapes = myNet->getAttributeCarriers()->getSelectedShapes();
1948  // iterate over shapes
1949  for (const auto& selectedShape : selectedShapes) {
1950  // check if shape is a poly
1951  if (selectedShape->getTagProperty().getTag() == SUMO_TAG_POLY) {
1952  // simplify shape
1953  dynamic_cast<GNEPoly*>(selectedShape)->simplifyShape();
1954  }
1955  }
1956  // end undo-list
1957  myNet->getViewNet()->getUndoList()->end();
1958  } else {
1959  polygonUnderMouse->simplifyShape();
1960  }
1961  }
1962  updateViewNet();
1963  return 1;
1964 }
1965 
1966 
1967 long
1968 GNEViewNet::onCmdDeleteGeometryPoint(FXObject*, FXSelector, void*) {
1969  GNEPoly* polygonUnderMouse = getPolygonAtPopupPosition();
1970  if (polygonUnderMouse) {
1971  polygonUnderMouse->deleteGeometryPoint(getPopupPosition());
1972  }
1973  updateViewNet();
1974  return 1;
1975 }
1976 
1977 
1978 long
1979 GNEViewNet::onCmdClosePolygon(FXObject*, FXSelector, void*) {
1980  // get polygon under mouse
1981  GNEPoly* polygonUnderMouse = getPolygonAtPopupPosition();
1982  // check polygon
1983  if (polygonUnderMouse) {
1984  // check if shape is selected
1985  if (polygonUnderMouse->isAttributeCarrierSelected()) {
1986  // begin undo-list
1987  myNet->getViewNet()->getUndoList()->begin(GUIIcon::POLY, "close polygon shapes");
1988  // get selectedshapes
1989  const auto selectedShapes = myNet->getAttributeCarriers()->getSelectedShapes();
1990  // iterate over shapes
1991  for (const auto& selectedShape : selectedShapes) {
1992  // check if shape is a poly
1993  if (selectedShape->getTagProperty().getTag() == SUMO_TAG_POLY) {
1994  // close polygon
1995  dynamic_cast<GNEPoly*>(selectedShape)->closePolygon();
1996  }
1997  }
1998  // end undo-list
1999  myNet->getViewNet()->getUndoList()->end();
2000  } else {
2001  polygonUnderMouse->simplifyShape();
2002  }
2003  }
2004  updateViewNet();
2005  return 1;
2006 }
2007 
2008 
2009 long
2010 GNEViewNet::onCmdOpenPolygon(FXObject*, FXSelector, void*) {
2011  // get polygon under mouse
2012  GNEPoly* polygonUnderMouse = getPolygonAtPopupPosition();
2013  // check polygon
2014  if (polygonUnderMouse) {
2015  // check if shape is selected
2016  if (polygonUnderMouse->isAttributeCarrierSelected()) {
2017  // begin undo-list
2018  myNet->getViewNet()->getUndoList()->begin(GUIIcon::POLY, "open polygon shapes");
2019  // get shapes
2020  const auto selectedShapes = myNet->getAttributeCarriers()->getSelectedShapes();
2021  // iterate over shapes
2022  for (const auto& selectedShape : selectedShapes) {
2023  // check if shape is a poly
2024  if (selectedShape->getTagProperty().getTag() == SUMO_TAG_POLY) {
2025  // open polygon
2026  dynamic_cast<GNEPoly*>(selectedShape)->openPolygon();
2027  }
2028  }
2029  // end undo-list
2030  myNet->getViewNet()->getUndoList()->end();
2031  } else {
2032  polygonUnderMouse->openPolygon();
2033  }
2034  }
2035  updateViewNet();
2036  return 1;
2037 }
2038 
2039 
2040 long
2041 GNEViewNet::onCmdSelectPolygonElements(FXObject*, FXSelector, void*) {
2042  // get polygon under mouse
2043  GNEPoly* polygonUnderMouse = getPolygonAtPopupPosition();
2044  // check polygon
2045  if (polygonUnderMouse) {
2046  // get ACs in boundary
2047  const auto ACs = getAttributeCarriersInBoundary(polygonUnderMouse->getShape().getBoxBoundary(), false);
2048  // declare filtered ACs
2049  std::vector<GNEAttributeCarrier*> filteredACs;
2050  // iterate over obtained GUIGlIDs
2051  for (const auto& AC : ACs) {
2052  if (AC.second->getTagProperty().getTag() == SUMO_TAG_EDGE) {
2053  if (myNetworkViewOptions.selectEdges() && myNet->getAttributeCarriers()->isNetworkElementAroundShape(AC.second, polygonUnderMouse->getShape())) {
2054  filteredACs.push_back(AC.second);
2055  }
2056  } else if (AC.second->getTagProperty().getTag() == SUMO_TAG_LANE) {
2057  if (!myNetworkViewOptions.selectEdges() && myNet->getAttributeCarriers()->isNetworkElementAroundShape(AC.second, polygonUnderMouse->getShape())) {
2058  filteredACs.push_back(AC.second);
2059  }
2060  } else if ((AC.second != polygonUnderMouse) && myNet->getAttributeCarriers()->isNetworkElementAroundShape(AC.second, polygonUnderMouse->getShape())) {
2061  filteredACs.push_back(AC.second);
2062  }
2063  }
2064  // continue if there are ACs
2065  if (filteredACs.size() > 0) {
2066  // begin undo-list
2067  myNet->getViewNet()->getUndoList()->begin(GUIIcon::MODESELECT, "select within polygon boundary");
2068  // iterate over shapes
2069  for (const auto& AC : filteredACs) {
2070  AC->setAttribute(GNE_ATTR_SELECTED, "true", myUndoList);
2071  }
2072  // end undo-list
2073  myNet->getViewNet()->getUndoList()->end();
2074  }
2075  }
2076  updateViewNet();
2077  return 1;
2078 }
2079 
2080 
2081 long
2082 GNEViewNet::onCmdSetFirstGeometryPoint(FXObject*, FXSelector, void*) {
2083  GNEPoly* polygonUnderMouse = getPolygonAtPopupPosition();
2084  if (polygonUnderMouse) {
2085  polygonUnderMouse->changeFirstGeometryPoint(polygonUnderMouse->getVertexIndex(getPopupPosition(), false));
2086  updateViewNet();
2087  }
2088 
2089  return 1;
2090 }
2091 
2092 
2093 long
2094 GNEViewNet::onCmdTransformPOI(FXObject*, FXSelector, void*) {
2095  // declare additional handler
2096  GNEAdditionalHandler additionalHanlder(myNet, true);
2097  // obtain POI at popup position
2099  if (POI) {
2100  // check what type of POI will be transformed
2101  if (POI->getTagProperty().getTag() == SUMO_TAG_POI) {
2102  // obtain lanes around POI boundary
2103  std::vector<GUIGlID> GLIDs = getObjectsInBoundary(POI->getCenteringBoundary(), false);
2104  std::vector<GNELane*> lanes;
2105  for (const auto& GLID : GLIDs) {
2106  GNELane* lane = dynamic_cast<GNELane*>(GUIGlObjectStorage::gIDStorage.getObjectBlocking(GLID));
2107  if (lane) {
2108  lanes.push_back(lane);
2109  }
2110  }
2111  if (lanes.empty()) {
2112  WRITE_WARNING("No lanes around " + toString(SUMO_TAG_POI) + " to attach it");
2113  } else {
2114  // obtain nearest lane to POI
2115  GNELane* nearestLane = lanes.front();
2116  double minorPosOverLane = nearestLane->getLaneShape().nearest_offset_to_point2D(POI->getPositionInView());
2117  double minorLateralOffset = nearestLane->getLaneShape().positionAtOffset(minorPosOverLane).distanceTo(POI->getPositionInView());
2118  for (const auto& lane : lanes) {
2119  double posOverLane = lane->getLaneShape().nearest_offset_to_point2D(POI->getPositionInView());
2120  double lateralOffset = lane->getLaneShape().positionAtOffset(posOverLane).distanceTo(POI->getPositionInView());
2121  if (lateralOffset < minorLateralOffset) {
2122  minorPosOverLane = posOverLane;
2123  minorLateralOffset = lateralOffset;
2124  nearestLane = lane;
2125  }
2126  }
2127  // get sumo base object of POI (And all common attributes)
2128  CommonXMLStructure::SumoBaseObject* POIBaseObject = POI->getSumoBaseObject();
2129  // add specific attributes
2130  POIBaseObject->addStringAttribute(SUMO_ATTR_LANE, nearestLane->getID());
2131  POIBaseObject->addDoubleAttribute(SUMO_ATTR_POSITION, minorPosOverLane);
2132  POIBaseObject->addBoolAttribute(SUMO_ATTR_FRIENDLY_POS, POI->getFriendlyPos());
2133  POIBaseObject->addDoubleAttribute(SUMO_ATTR_POSITION_LAT, 0);
2134  // remove POI
2135  myUndoList->begin(GUIIcon::POI, "attach POI into " + toString(SUMO_TAG_LANE));
2137  // add new POI use route handler
2138  additionalHanlder.parseSumoBaseObject(POIBaseObject);
2139  myUndoList->end();
2140  }
2141  } else {
2142  // get sumo base object of POI (And all common attributes)
2143  CommonXMLStructure::SumoBaseObject* POIBaseObject = POI->getSumoBaseObject();
2144  // add specific attributes
2145  POIBaseObject->addDoubleAttribute(SUMO_ATTR_X, POI->x());
2146  POIBaseObject->addDoubleAttribute(SUMO_ATTR_Y, POI->y());
2147  // remove POI
2148  myUndoList->begin(GUIIcon::POI, "release POI from " + toString(SUMO_TAG_LANE));
2150  // add new POI use route handler
2151  additionalHanlder.parseSumoBaseObject(POIBaseObject);
2152  myUndoList->end();
2153  }
2154  // update view after transform
2155  updateViewNet();
2156  }
2157  return 1;
2158 }
2159 
2160 
2161 long
2162 GNEViewNet::onCmdSetCustomGeometryPoint(FXObject*, FXSelector, void*) {
2163  // get element at popup position
2164  GNELane* lane = getLaneAtPopupPosition();
2167  // check element
2168  if (lane != nullptr) {
2169  // make a copy of edge geometry
2170  PositionVector edgeGeometry = lane->getParentEdge()->getNBEdge()->getGeometry();
2171  // get index position
2172  const int index = edgeGeometry.indexOfClosest(getPositionInformation(), true);
2173  // get new position
2174  Position newPosition = edgeGeometry[index];
2175  // edit using GNEGeometryPointDialog
2176  GNEGeometryPointDialog(this, &newPosition);
2177  // now check position
2178  if (newPosition != edgeGeometry[index]) {
2179  // update new position
2180  edgeGeometry[index] = newPosition;
2181  // begin undo list
2182  myUndoList->begin(GUIIcon::EDGE, "change edge Geometry Point position");
2183  // continue depending of index
2184  if (index == 0) {
2185  // change shape start
2187  } else if (index == ((int)edgeGeometry.size() - 1)) {
2188  // change shape end
2190  } else {
2191  // remove front and back geometry points
2192  edgeGeometry.pop_front();
2193  edgeGeometry.pop_back();
2194  // change shape
2196  }
2197  // end undo list
2198  myUndoList->end();
2199  }
2200  } else if (poly != nullptr) {
2201  // make a copy of polygon geometry
2202  PositionVector polygonGeometry = poly->getShape();
2203  // get index position
2204  const int index = polygonGeometry.indexOfClosest(getPositionInformation(), true);
2205  // get new position
2206  Position newPosition = polygonGeometry[index];
2207  // edit using GNEGeometryPointDialog
2208  GNEGeometryPointDialog(this, &newPosition);
2209  // now check position
2210  if (newPosition != polygonGeometry[index]) {
2211  // update new position
2212  polygonGeometry[index] = newPosition;
2213  // begin undo list
2214  myUndoList->begin(GUIIcon::POLY, "change polygon Geometry Point position");
2215  // change shape
2217  // end undo list
2218  myUndoList->end();
2219  }
2220  } else if (TAZ != nullptr) {
2221  // make a copy of TAZ geometry
2222  PositionVector TAZGeometry = TAZ->getTAZElementShape();
2223  // get index position
2224  const int index = TAZGeometry.indexOfClosest(getPositionInformation(), true);
2225  // get new position
2226  Position newPosition = TAZGeometry[index];
2227  // edit using GNEGeometryPointDialog
2228  GNEGeometryPointDialog(this, &newPosition);
2229  // now check position
2230  if (newPosition != TAZGeometry[index]) {
2231  // update new position
2232  TAZGeometry[index] = newPosition;
2233  // begin undo list
2234  myUndoList->begin(GUIIcon::TAZ, "change TAZ Geometry Point position");
2235  // change shape
2237  // end undo list
2238  myUndoList->end();
2239  }
2240  }
2241  return 1;
2242 }
2243 
2244 
2245 long
2246 GNEViewNet::onCmdResetEndPoints(FXObject*, FXSelector, void*) {
2247  // get lane at popup position
2248  GNELane* laneAtPopupPosition = getLaneAtPopupPosition();
2249  // check element
2250  if (laneAtPopupPosition != nullptr) {
2251  // get parent edge
2252  GNEEdge* edge = laneAtPopupPosition->getParentEdge();
2253  // check if edge is selected
2254  if (edge->isAttributeCarrierSelected()) {
2255  // get selected edges
2256  const auto selectedEdges = myNet->getAttributeCarriers()->getSelectedEdges();
2257  // begin undo list
2258  myUndoList->begin(GUIIcon::EDGE, "reset end points of selected edges");
2259  // iterate over edges
2260  for (const auto& selectedEdge : selectedEdges) {
2261  // reset both end points
2262  selectedEdge->setAttribute(GNE_ATTR_SHAPE_START, "", myUndoList);
2263  selectedEdge->setAttribute(GNE_ATTR_SHAPE_END, "", myUndoList);
2264  }
2265  // end undo list
2266  myUndoList->end();
2267  } else {
2268  // begin undo list
2269  myUndoList->begin(GUIIcon::EDGE, "reset end points of " + edge->getID());
2270  // reset both end points
2273  // end undo list
2274  myUndoList->end();
2275  }
2276  }
2277  return 1;
2278 }
2279 
2280 
2281 long
2282 GNEViewNet::onCmdDuplicateLane(FXObject*, FXSelector, void*) {
2283  GNELane* laneAtPopupPosition = getLaneAtPopupPosition();
2284  if (laneAtPopupPosition != nullptr) {
2285  // when duplicating an unselected lane, keep all connections as they
2286  // are, otherwise recompute them
2287  if (laneAtPopupPosition->isAttributeCarrierSelected()) {
2288  myUndoList->begin(GUIIcon::LANE, "duplicate selected " + toString(SUMO_TAG_LANE) + "s");
2289  const auto selectedLanes = myNet->getAttributeCarriers()->getSelectedLanes();
2290  for (const auto& lane : selectedLanes) {
2291  myNet->duplicateLane(lane, myUndoList, true);
2292  }
2293  myUndoList->end();
2294  } else {
2296  myNet->duplicateLane(laneAtPopupPosition, myUndoList, false);
2297  myUndoList->end();
2298  }
2299  }
2300  return 1;
2301 }
2302 
2303 
2304 long
2305 GNEViewNet::onCmdEditLaneShape(FXObject*, FXSelector, void*) {
2306  // Obtain lane under mouse
2307  GNELane* lane = getLaneAtPopupPosition();
2308  if (lane) {
2310  }
2311  // destroy pop-up and update view Net
2312  destroyPopup();
2313  setFocus();
2314  return 1;
2315 }
2316 
2317 
2318 long
2319 GNEViewNet::onCmdResetLaneCustomShape(FXObject*, FXSelector, void*) {
2320  GNELane* laneAtPopupPosition = getLaneAtPopupPosition();
2321  if (laneAtPopupPosition != nullptr) {
2322  // when duplicating an unselected lane, keep all connections as they
2323  // are, otherwise recompute them
2324  if (laneAtPopupPosition->isAttributeCarrierSelected()) {
2325  myUndoList->begin(GUIIcon::LANE, "reset custom lane shapes");
2326  const auto selectedLanes = myNet->getAttributeCarriers()->getSelectedLanes();
2327  for (const auto& lane : selectedLanes) {
2328  lane->setAttribute(SUMO_ATTR_CUSTOMSHAPE, "", myUndoList);
2329  }
2330  myUndoList->end();
2331  } else {
2332  myUndoList->begin(GUIIcon::LANE, "reset custom lane shape");
2333  laneAtPopupPosition->setAttribute(SUMO_ATTR_CUSTOMSHAPE, "", myUndoList);
2334  myUndoList->end();
2335  }
2336  }
2337  return 1;
2338 }
2339 
2340 
2341 long
2342 GNEViewNet::onCmdResetOppositeLane(FXObject*, FXSelector, void*) {
2343  GNELane* laneAtPopupPosition = getLaneAtPopupPosition();
2344  if (laneAtPopupPosition != nullptr) {
2345  // when duplicating an unselected lane, keep all connections as they
2346  // are, otherwise recompute them
2347  if (laneAtPopupPosition->isAttributeCarrierSelected()) {
2348  myUndoList->begin(GUIIcon::LANE, "reset opposite lanes");
2349  const auto selectedLanes = myNet->getAttributeCarriers()->getSelectedLanes();
2350  for (const auto& lane : selectedLanes) {
2351  lane->setAttribute(GNE_ATTR_OPPOSITE, "", myUndoList);
2352  }
2353  myUndoList->end();
2354  } else {
2355  myUndoList->begin(GUIIcon::LANE, "reset opposite lane");
2356  laneAtPopupPosition->setAttribute(GNE_ATTR_OPPOSITE, "", myUndoList);
2357  myUndoList->end();
2358  }
2359  }
2360  return 1;
2361 }
2362 
2363 
2364 long
2365 GNEViewNet::onCmdLaneOperation(FXObject*, FXSelector sel, void*) {
2366  // check lane operation
2367  switch (FXSELID(sel)) {
2369  return restrictLane(SVC_PEDESTRIAN);
2371  return restrictLane(SVC_BICYCLE);
2373  return restrictLane(SVC_BUS);
2375  return restrictLane(SVC_IGNORING);
2377  return addRestrictedLane(SVC_PEDESTRIAN, false);
2378  case MID_GNE_LANE_ADD_BIKE:
2379  return addRestrictedLane(SVC_BICYCLE, false);
2380  case MID_GNE_LANE_ADD_BUS:
2381  return addRestrictedLane(SVC_BUS, false);
2383  return addRestrictedLane(SVC_IGNORING, true);
2385  return addRestrictedLane(SVC_IGNORING, false);
2391  return removeRestrictedLane(SVC_BUS);
2394  default:
2395  return 0;
2396  }
2397 }
2398 
2399 
2400 long
2401 GNEViewNet::onCmdLaneReachability(FXObject* menu, FXSelector, void*) {
2402  GNELane* laneAtPopupPosition = getLaneAtPopupPosition();
2403  if (laneAtPopupPosition != nullptr) {
2404  // obtain vClass
2405  const SUMOVehicleClass vClass = SumoVehicleClassStrings.get(dynamic_cast<FXMenuCommand*>(menu)->getText().text());
2406  // calculate reachability
2407  myNet->getPathManager()->getPathCalculator()->calculateReachability(vClass, laneAtPopupPosition->getParentEdge());
2408  // select all lanes with reachablility greather than 0
2409  myUndoList->begin(GUIIcon::LANE, "select lane reachability");
2410  for (const auto& edge : myNet->getAttributeCarriers()->getEdges()) {
2411  for (const auto& lane : edge.second->getLanes()) {
2412  if (lane->getReachability() >= 0) {
2413  lane->setAttribute(GNE_ATTR_SELECTED, "true", myUndoList);
2414  }
2415  }
2416  }
2417  myUndoList->end();
2418  }
2419  // update viewNet
2420  updateViewNet();
2421  return 1;
2422 }
2423 
2424 
2425 long
2426 GNEViewNet::onCmdOpenAdditionalDialog(FXObject*, FXSelector, void*) {
2427  // retrieve additional under cursor
2429  // check if additional can open dialog
2430  if (addtional && addtional->getTagProperty().hasDialog()) {
2431  addtional->openAdditionalDialog();
2432  }
2433  return 1;
2434 }
2435 
2436 
2437 bool
2439  GNELane* laneAtPopupPosition = getLaneAtPopupPosition();
2440  if (laneAtPopupPosition != nullptr) {
2441  // Get selected lanes
2442  const auto selectedLanes = myNet->getAttributeCarriers()->getSelectedLanes();
2443  // Declare map of edges and lanes
2444  std::map<GNEEdge*, GNELane*> mapOfEdgesAndLanes;
2445  // Iterate over selected lanes
2446  for (const auto& lane : selectedLanes) {
2447  mapOfEdgesAndLanes[myNet->getAttributeCarriers()->retrieveEdge(lane->getParentEdge()->getID())] = lane;
2448  }
2449  // Throw warning dialog if there hare multiple lanes selected in the same edge
2450  if (mapOfEdgesAndLanes.size() != selectedLanes.size()) {
2451  FXMessageBox::information(getApp(), MBOX_OK,
2452  "Multiple lane in the same edge selected", "%s",
2453  ("There are selected lanes that belong to the same edge.\n Only one lane per edge will be restricted for " + toString(vclass) + ".").c_str());
2454  }
2455  // If we handeln a set of lanes
2456  if (mapOfEdgesAndLanes.size() > 0) {
2457  // declare counter for number of Sidewalks
2458  int counter = 0;
2459  // iterate over selected lanes
2460  for (const auto& edgeLane : mapOfEdgesAndLanes) {
2461  if (edgeLane.first->hasRestrictedLane(vclass)) {
2462  counter++;
2463  }
2464  }
2465  // if all edges parent own a Sidewalk, stop function
2466  if (counter == (int)mapOfEdgesAndLanes.size()) {
2467  FXMessageBox::information(getApp(), MBOX_OK,
2468  ("Set vclass for " + toString(vclass) + " to selected lanes").c_str(), "%s",
2469  ("All lanes own already another lane in the same edge with a restriction for " + toString(vclass)).c_str());
2470  return 0;
2471  } else {
2472  WRITE_DEBUG("Opening FXMessageBox 'restrict lanes'");
2473  // Ask confirmation to user
2474  FXuint answer = FXMessageBox::question(getApp(), MBOX_YES_NO,
2475  ("Set vclass for " + toString(vclass) + " to selected lanes").c_str(), "%s",
2476  (toString(mapOfEdgesAndLanes.size() - counter) + " lanes will be restricted for " + toString(vclass) + ". continue?").c_str());
2477  if (answer != 1) { //1:yes, 2:no, 4:esc
2478  // write warning if netedit is running in testing mode
2479  if (answer == 2) {
2480  WRITE_DEBUG("Closed FXMessageBox 'restrict lanes' with 'No'");
2481  } else if (answer == 4) {
2482  WRITE_DEBUG("Closed FXMessageBox 'restrict lanes' with 'ESC'");
2483  }
2484  return 0;
2485  } else {
2486  // write warning if netedit is running in testing mode
2487  WRITE_DEBUG("Closed FXMessageBox 'restrict lanes' with 'Yes'");
2488  }
2489  }
2490  // begin undo operation
2491  myUndoList->begin(GUIIcon::LANE, "restrict lanes to " + toString(vclass));
2492  // iterate over selected lanes
2493  for (const auto& edgeLane : mapOfEdgesAndLanes) {
2494  // Transform lane to Sidewalk
2495  myNet->restrictLane(vclass, edgeLane.second, myUndoList);
2496  }
2497  // end undo operation
2498  myUndoList->end();
2499  } else {
2500  // If only have a single lane, start undo/redo operation
2501  myUndoList->begin(GUIIcon::LANE, "restrict lane to " + toString(vclass));
2502  // Transform lane to Sidewalk
2503  myNet->restrictLane(vclass, laneAtPopupPosition, myUndoList);
2504  // end undo operation
2505  myUndoList->end();
2506  }
2507  }
2508  return 1;
2509 }
2510 
2511 
2512 bool
2513 GNEViewNet::addRestrictedLane(SUMOVehicleClass vclass, const bool insertAtFront) {
2514  GNELane* laneAtPopupPosition = getLaneAtPopupPosition();
2515  if (laneAtPopupPosition != nullptr) {
2516  // Get selected edges
2517  const auto selectedEdges = myNet->getAttributeCarriers()->getSelectedEdges();
2518  // get selected lanes
2519  const auto selectedLanes = myNet->getAttributeCarriers()->getSelectedLanes();
2520  // Declare set of edges
2521  std::set<GNEEdge*> setOfEdges;
2522  // Fill set of edges with vector of edges
2523  for (const auto& edge : selectedEdges) {
2524  setOfEdges.insert(edge);
2525  }
2526  // iterate over selected lanes
2527  for (const auto& lane : selectedLanes) {
2528  // Insert pointer to edge into set of edges (To avoid duplicates)
2529  setOfEdges.insert(myNet->getAttributeCarriers()->retrieveEdge(lane->getParentEdge()->getID()));
2530  }
2531  // If we handeln a set of edges
2532  if (setOfEdges.size() > 0) {
2533  // declare counter for number of restrictions
2534  int counter = 0;
2535  // iterate over set of edges
2536  for (const auto& edge : setOfEdges) {
2537  // update counter if edge has already a restricted lane of type "vclass"
2538  if (edge->hasRestrictedLane(vclass)) {
2539  counter++;
2540  }
2541  }
2542  // if all lanes own a Sidewalk, stop function
2543  if (counter == (int)setOfEdges.size()) {
2544  FXMessageBox::information(getApp(), MBOX_OK,
2545  ("Add vclass for" + toString(vclass) + " to selected lanes").c_str(), "%s",
2546  ("All lanes own already another lane in the same edge with a restriction for " + toString(vclass)).c_str());
2547  return 0;
2548  } else {
2549  WRITE_DEBUG("Opening FXMessageBox 'restrict lanes'");
2550  // Ask confirmation to user
2551  FXuint answer = FXMessageBox::question(getApp(), MBOX_YES_NO,
2552  ("Add vclass for " + toString(vclass) + " to selected lanes").c_str(), "%s",
2553  (toString(setOfEdges.size() - counter) + " restrictions for " + toString(vclass) + " will be added. continue?").c_str());
2554  if (answer != 1) { //1:yes, 2:no, 4:esc
2555  // write warning if netedit is running in testing mode
2556  if (answer == 2) {
2557  WRITE_DEBUG("Closed FXMessageBox 'restrict lanes' with 'No'");
2558  } else if (answer == 4) {
2559  WRITE_DEBUG("Closed FXMessageBox 'restrict lanes' with 'ESC'");
2560  }
2561  return 0;
2562  } else {
2563  // write warning if netedit is running in testing mode
2564  WRITE_DEBUG("Closed FXMessageBox 'restrict lanes' with 'Yes'");
2565  }
2566  }
2567  // begin undo operation
2568  myUndoList->begin(GUIIcon::LANE, "Add restrictions for " + toString(vclass));
2569  // iterate over set of edges
2570  for (const auto& edge : setOfEdges) {
2571  // add restricted lane (guess target)
2572  myNet->addRestrictedLane(vclass, edge, -1, myUndoList);
2573  }
2574  // end undo operation
2575  myUndoList->end();
2576  } else {
2577  // If only have a single lane, start undo/redo operation
2578  myUndoList->begin(GUIIcon::LANE, "Add vclass for " + toString(vclass));
2579  // Add restricted lane
2580  if (vclass == SVC_PEDESTRIAN) {
2581  // always add pedestrian lanes on the right
2582  myNet->addRestrictedLane(vclass, laneAtPopupPosition->getParentEdge(), 0, myUndoList);
2583  } else if (vclass == SVC_IGNORING) {
2584  if (insertAtFront) {
2585  myNet->addGreenVergeLane(laneAtPopupPosition->getParentEdge(), laneAtPopupPosition->getIndex() + 1, myUndoList);
2586  } else {
2587  myNet->addGreenVergeLane(laneAtPopupPosition->getParentEdge(), laneAtPopupPosition->getIndex(), myUndoList);
2588  }
2589  } else if (laneAtPopupPosition->getParentEdge()->getLanes().size() == 1) {
2590  // guess insertion position if there is only 1 lane
2591  myNet->addRestrictedLane(vclass, laneAtPopupPosition->getParentEdge(), -1, myUndoList);
2592  } else {
2593  myNet->addRestrictedLane(vclass, laneAtPopupPosition->getParentEdge(), laneAtPopupPosition->getIndex(), myUndoList);
2594  }
2595  // end undo/redo operation
2596  myUndoList->end();
2597  }
2598  }
2599  return 1;
2600 }
2601 
2602 
2603 bool
2605  GNELane* laneAtPopupPosition = getLaneAtPopupPosition();
2606  if (laneAtPopupPosition != nullptr) {
2607  // Get selected edges
2608  const auto selectedEdges = myNet->getAttributeCarriers()->getSelectedEdges();
2609  // get selected lanes
2610  const auto selectedLanes = myNet->getAttributeCarriers()->getSelectedLanes();
2611  // Declare set of edges
2612  std::set<GNEEdge*> setOfEdges;
2613  // Fill set of edges with vector of edges
2614  for (const auto& edge : selectedEdges) {
2615  setOfEdges.insert(edge);
2616  }
2617  // iterate over selected lanes
2618  for (const auto& lane : selectedLanes) {
2619  // Insert pointer to edge into set of edges (To avoid duplicates)
2620  setOfEdges.insert(myNet->getAttributeCarriers()->retrieveEdge(lane->getParentEdge()->getID()));
2621  }
2622  // If we handeln a set of edges
2623  if (setOfEdges.size() > 0) {
2624  // declare counter for number of restrictions
2625  int counter = 0;
2626  // iterate over set of edges
2627  for (const auto& edge : setOfEdges) {
2628  // update counter if edge has already a restricted lane of type "vclass"
2629  if (edge->hasRestrictedLane(vclass)) {
2630  counter++;
2631  }
2632  }
2633  // if all lanes don't own a Sidewalk, stop function
2634  if (counter == 0) {
2635  FXMessageBox::information(getApp(), MBOX_OK,
2636  ("Remove vclass for " + toString(vclass) + " to selected lanes").c_str(), "%s",
2637  ("Selected lanes and edges haven't a restriction for " + toString(vclass)).c_str());
2638  return 0;
2639  } else {
2640  WRITE_DEBUG("Opening FXMessageBox 'restrict lanes'");
2641  // Ask confirmation to user
2642  FXuint answer = FXMessageBox::question(getApp(), MBOX_YES_NO,
2643  ("Remove vclass for " + toString(vclass) + " to selected lanes").c_str(), "%s",
2644  (toString(counter) + " restrictions for " + toString(vclass) + " will be removed. continue?").c_str());
2645  if (answer != 1) { //1:yes, 2:no, 4:esc
2646  // write warning if netedit is running in testing mode
2647  if (answer == 2) {
2648  WRITE_DEBUG("Closed FXMessageBox 'restrict lanes' with 'No'");
2649  } else if (answer == 4) {
2650  WRITE_DEBUG("Closed FXMessageBox 'restrict lanes' with 'ESC'");
2651  }
2652  return 0;
2653  } else {
2654  // write warning if netedit is running in testing mode
2655  WRITE_DEBUG("Closed FXMessageBox 'restrict lanes' with 'Yes'");
2656  }
2657  }
2658  // begin undo operation
2659  myUndoList->begin(GUIIcon::LANE, "Remove restrictions for " + toString(vclass));
2660  // iterate over set of edges
2661  for (const auto& edge : setOfEdges) {
2662  // add Sidewalk
2663  myNet->removeRestrictedLane(vclass, edge, myUndoList);
2664  }
2665  // end undo operation
2666  myUndoList->end();
2667  } else {
2668  // If only have a single lane, start undo/redo operation
2669  myUndoList->begin(GUIIcon::LANE, "Remove vclass for " + toString(vclass));
2670  // Remove Sidewalk
2671  myNet->removeRestrictedLane(vclass, laneAtPopupPosition->getParentEdge(), myUndoList);
2672  // end undo/redo operation
2673  myUndoList->end();
2674  }
2675  }
2676  return 1;
2677 }
2678 
2679 
2680 void
2681 GNEViewNet::processClick(void* eventData) {
2682  FXEvent* evt = (FXEvent*)eventData;
2683  // process click
2684  destroyPopup();
2685  setFocus();
2686  myChanger->onLeftBtnPress(eventData);
2687  grab();
2688  // Check there are double click
2689  if (evt->click_count == 2) {
2690  handle(this, FXSEL(SEL_DOUBLECLICKED, 0), eventData);
2691  }
2692 }
2693 
2694 
2695 void
2697  // declare flags
2698  bool cursorMoveView = false;
2699  bool cursorInspect = false;
2700  bool cursorSelect = false;
2701  bool cursorMoveElement = false;
2702  bool cursorDelete = false;
2703  // continue depending of supermode
2705  // move view
2711  cursorMoveView = true;
2712  }
2713  // specific mode
2715  cursorInspect = true;
2717  cursorSelect = true;
2719  cursorMoveElement = true;
2721  cursorDelete = true;
2722  }
2723  } else if (myEditModes.isCurrentSupermodeDemand()) {
2724  // move view
2728  cursorMoveView = true;
2729  }
2730  // specific mode
2732  cursorInspect = true;
2734  cursorSelect = true;
2736  cursorMoveElement = true;
2738  cursorDelete = true;
2739  }
2740  } else if (myEditModes.isCurrentSupermodeData()) {
2741  // move view
2743  cursorMoveView = true;
2744  }
2745  // specific mode
2747  cursorInspect = true;
2749  cursorSelect = true;
2751  cursorDelete = true;
2752  }
2753  }
2754  // set cursor
2755  if (myMouseButtonKeyPressed.controlKeyPressed() && cursorMoveView) {
2756  // move view cursor if control key is pressed
2759  } else if (cursorInspect) {
2760  // special case for inspect lanes
2763  // inspect lane cursor
2766  } else {
2767  // inspect cursor
2770  }
2771  } else if (cursorSelect) {
2772  // special case for select lanes
2775  // select lane cursor
2778  } else {
2779  // select cursor
2780  setDefaultCursor(GUICursorSubSys::getCursor(GUICursor::SELECT));
2782  }
2783  } else if (cursorMoveElement) {
2784  // move cursor
2787  } else if (cursorDelete) {
2788  // delete cursor
2791  } else {
2792  // default cursor
2795  }
2796 }
2797 
2798 
2799 long
2800 GNEViewNet::onCmdEditJunctionShape(FXObject*, FXSelector, void*) {
2801  // Obtain junction under mouse
2803  if (junction) {
2804  // check if network has to be updated
2805  if (junction->getNBNode()->getShape().size() == 0) {
2806  // recompute the whole network
2808  }
2809  // start edit custom shape
2811  }
2812  // destroy pop-up and set focus in view net
2813  destroyPopup();
2814  setFocus();
2815  return 1;
2816 }
2817 
2818 
2819 long
2820 GNEViewNet::onCmdResetJunctionShape(FXObject*, FXSelector, void*) {
2821  // Obtain junction under mouse
2823  if (junction) {
2824  // are, otherwise recompute them
2825  if (junction->isAttributeCarrierSelected()) {
2826  myUndoList->begin(GUIIcon::JUNCTION, "reset custom junction shapes");
2827  const auto selectedJunctions = myNet->getAttributeCarriers()->getSelectedJunctions();
2828  for (const auto& selectedJunction : selectedJunctions) {
2829  selectedJunction->setAttribute(SUMO_ATTR_SHAPE, "", myUndoList);
2830  }
2831  myUndoList->end();
2832  } else {
2833  myUndoList->begin(GUIIcon::JUNCTION, "reset custom junction shape");
2834  junction->setAttribute(SUMO_ATTR_SHAPE, "", myUndoList);
2835  myUndoList->end();
2836  }
2837  }
2838  // destroy pop-up and set focus in view net
2839  destroyPopup();
2840  setFocus();
2841  return 1;
2842 }
2843 
2844 
2845 long
2846 GNEViewNet::onCmdReplaceJunction(FXObject*, FXSelector, void*) {
2848  if (junction != nullptr) {
2850  updateViewNet();
2851  }
2852  // destroy pop-up and set focus in view net
2853  destroyPopup();
2854  setFocus();
2855  return 1;
2856 }
2857 
2858 
2859 long
2860 GNEViewNet::onCmdSplitJunction(FXObject*, FXSelector, void*) {
2862  if (junction != nullptr) {
2863  myNet->splitJunction(junction, false, myUndoList);
2864  updateViewNet();
2865  }
2866  // destroy pop-up and set focus in view net
2867  destroyPopup();
2868  setFocus();
2869  return 1;
2870 }
2871 
2872 
2873 long
2874 GNEViewNet::onCmdSplitJunctionReconnect(FXObject*, FXSelector, void*) {
2876  if (junction != nullptr) {
2877  myNet->splitJunction(junction, true, myUndoList);
2878  updateViewNet();
2879  }
2880  // destroy pop-up and set focus in view net
2881  destroyPopup();
2882  setFocus();
2883  return 1;
2884 }
2885 
2886 long
2887 GNEViewNet::onCmdSelectRoundabout(FXObject*, FXSelector, void*) {
2889  if (junction != nullptr) {
2890  myNet->selectRoundabout(junction, myUndoList);
2891  updateViewNet();
2892  }
2893  // destroy pop-up and set focus in view net
2894  destroyPopup();
2895  setFocus();
2896  return 1;
2897 }
2898 
2899 long
2900 GNEViewNet::onCmdConvertRoundabout(FXObject*, FXSelector, void*) {
2902  if (junction != nullptr) {
2903  myNet->createRoundabout(junction, myUndoList);
2904  updateViewNet();
2905  }
2906  // destroy pop-up and set focus in view net
2907  destroyPopup();
2908  setFocus();
2909  return 1;
2910 }
2911 
2912 
2913 long
2914 GNEViewNet::onCmdClearConnections(FXObject*, FXSelector, void*) {
2916  if (junction != nullptr) {
2917  // make sure we do not inspect the connection will it is being deleted
2918  if ((myInspectedAttributeCarriers.size() > 0) && (myInspectedAttributeCarriers.front()->getTagProperty().getTag() == SUMO_TAG_CONNECTION)) {
2920  }
2921  // make sure that connections isn't the front attribute
2923  myFrontAttributeCarrier = nullptr;
2924  }
2925  // check if we're handling a selection
2926  if (junction->isAttributeCarrierSelected()) {
2927  const auto selectedJunctions = myNet->getAttributeCarriers()->getSelectedJunctions();
2928  myUndoList->begin(GUIIcon::CONNECTION, "clear connections of selected junctions");
2929  for (const auto& selectedJunction : selectedJunctions) {
2930  myNet->clearJunctionConnections(selectedJunction, myUndoList);
2931  }
2932  myUndoList->end();
2933  } else {
2935  }
2936  updateViewNet();
2937  }
2938  // destroy pop-up and set focus in view net
2939  destroyPopup();
2940  setFocus();
2941  return 1;
2942 }
2943 
2944 
2945 long
2946 GNEViewNet::onCmdResetConnections(FXObject*, FXSelector, void*) {
2948  if (junction != nullptr) {
2949  // make sure we do not inspect the connection will it is being deleted
2950  if ((myInspectedAttributeCarriers.size() > 0) && myInspectedAttributeCarriers.front()->getTagProperty().getTag() == SUMO_TAG_CONNECTION) {
2952  }
2953  // make sure that connections isn't the front attribute
2955  myFrontAttributeCarrier = nullptr;
2956  }
2957  // check if we're handling a selection
2958  if (junction->isAttributeCarrierSelected()) {
2959  const auto selectedJunctions = myNet->getAttributeCarriers()->getSelectedJunctions();
2960  myUndoList->begin(GUIIcon::CONNECTION, "reset connections of selected junctions");
2961  for (const auto& selectedJunction : selectedJunctions) {
2962  myNet->resetJunctionConnections(selectedJunction, myUndoList);
2963  }
2964  myUndoList->end();
2965  } else {
2967  }
2968  updateViewNet();
2969  }
2970  // destroy pop-up and set focus in view net
2971  destroyPopup();
2972  setFocus();
2973  return 1;
2974 }
2975 
2976 
2977 long
2978 GNEViewNet::onCmdEditConnectionShape(FXObject*, FXSelector, void*) {
2979  // Obtain connection under mouse
2981  if (connection) {
2983  }
2984  // destroy pop-up and update view Net
2985  destroyPopup();
2986  setFocus();
2987  return 1;
2988 }
2989 
2990 
2991 long
2992 GNEViewNet::onCmdEditCrossingShape(FXObject*, FXSelector, void*) {
2993  // Obtain crossing under mouse
2995  if (crossing) {
2996  // due crossings haven two shapes, check what has to be edited
2997  PositionVector shape = crossing->getNBCrossing()->customShape.size() > 0 ? crossing->getNBCrossing()->customShape : crossing->getNBCrossing()->shape;
2998  // check if network has to be updated
2999  if (crossing->getParentJunction()->getNBNode()->getShape().size() == 0) {
3000  // recompute the whole network
3002  }
3003  // start edit custom shape
3005  }
3006  // destroy pop-up and update view Net
3007  destroyPopup();
3008  setFocus();
3009  return 1;
3010 }
3011 
3012 
3013 long
3014 GNEViewNet::onCmdToggleSelectEdges(FXObject*, FXSelector sel, void*) {
3015  // Toggle menuCheckSelectEdges
3018  } else {
3020  }
3022  // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
3023  if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_SELECTEDGES)) {
3025  }
3026  return 1;
3027 }
3028 
3029 
3030 long
3031 GNEViewNet::onCmdToggleShowConnections(FXObject*, FXSelector sel, void*) {
3032  // Toggle menuCheckShowConnections
3035  } else {
3037  }
3039  // if show was enabled, init GNEConnections
3042  }
3043  // change flag "showLane2Lane" in myVisualizationSettings
3045  // Hide/show connections require recompute
3046  getNet()->requireRecompute();
3047  // Update viewnNet to show/hide conections
3048  updateViewNet();
3049  // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
3050  if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_SHOWCONNECTIONS)) {
3052  }
3053  return 1;
3054 }
3055 
3056 
3057 long
3058 GNEViewNet::onCmdToggleHideConnections(FXObject*, FXSelector sel, void*) {
3059  // Toggle menuCheckHideConnections
3062  } else {
3064  }
3066  // Update viewnNet to show/hide conections
3067  updateViewNet();
3068  // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
3069  if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_HIDECONNECTIONS)) {
3071  }
3072  return 1;
3073 }
3074 
3075 
3076 long
3077 GNEViewNet::onCmdToggleShowAdditionalSubElements(FXObject*, FXSelector sel, void*) {
3078  // Toggle menuCheckShowAdditionalSubElements
3081  } else {
3083  }
3085  // Update viewnNet to show/hide sub elements
3086  updateViewNet();
3087  // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
3088  if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_SHOWSUBADDITIONALS)) {
3090  }
3091  return 1;
3092 }
3093 
3094 
3095 long
3096 GNEViewNet::onCmdToggleExtendSelection(FXObject*, FXSelector sel, void*) {
3097  // Toggle menuCheckExtendSelection
3100  } else {
3102  }
3104  // Only update view
3105  updateViewNet();
3106  // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
3107  if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_EXTENDSELECTION)) {
3109  }
3110  return 1;
3111 }
3112 
3113 
3114 long
3115 GNEViewNet::onCmdToggleChangeAllPhases(FXObject*, FXSelector sel, void*) {
3116  // Toggle menuCheckChangeAllPhases
3119  } else {
3121  }
3123  // Only update view
3124  updateViewNet();
3125  // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
3126  if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_CHANGEALLPHASES)) {
3128  }
3129  return 1;
3130 }
3131 
3132 
3133 long
3134 GNEViewNet::onCmdToggleShowGrid(FXObject*, FXSelector sel, void*) {
3135  // show or hidde grid depending of myNetworkViewOptions.menuCheckToggleGrid
3140  } else {
3144  }
3147  // update view to show grid
3148  updateViewNet();
3149  // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
3150  if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_TOGGLEGRID)) {
3152  } else if (sel == FXSEL(SEL_COMMAND, MID_GNE_DEMANDVIEWOPTIONS_SHOWGRID)) {
3154  }
3155  return 1;
3156 }
3157 
3158 
3159 long
3160 GNEViewNet::onCmdToggleDrawSpreadVehicles(FXObject*, FXSelector sel, void*) {
3161  // Toggle menuCheckShowDemandElements
3166  } else {
3169  }
3172  // declare edge set
3173  std::set<GNEEdge*> edgesToUpdate;
3174  // compute vehicle geometry
3175  for (const auto& vehicle : myNet->getAttributeCarriers()->getDemandElements().at(SUMO_TAG_VEHICLE)) {
3176  if (vehicle->getParentEdges().size() > 0) {
3177  edgesToUpdate.insert(vehicle->getParentEdges().front());
3178  } else if (vehicle->getChildDemandElements().size() > 0 && (vehicle->getChildDemandElements().front()->getTagProperty().getTag() == GNE_TAG_ROUTE_EMBEDDED)) {
3179  edgesToUpdate.insert(vehicle->getChildDemandElements().front()->getParentEdges().front());
3180  }
3181  }
3182  for (const auto& routeFlow : myNet->getAttributeCarriers()->getDemandElements().at(GNE_TAG_FLOW_ROUTE)) {
3183  if (routeFlow->getParentEdges().size() > 0) {
3184  edgesToUpdate.insert(routeFlow->getParentEdges().front());
3185  } else if (routeFlow->getChildDemandElements().size() > 0 && (routeFlow->getChildDemandElements().front()->getTagProperty().getTag() == GNE_TAG_ROUTE_EMBEDDED)) {
3186  edgesToUpdate.insert(routeFlow->getChildDemandElements().front()->getParentEdges().front());
3187  }
3188  }
3189  for (const auto& trip : myNet->getAttributeCarriers()->getDemandElements().at(SUMO_TAG_TRIP)) {
3190  if (trip->getParentEdges().size() > 0) {
3191  edgesToUpdate.insert(trip->getParentEdges().front());
3192  }
3193  }
3194  for (const auto& flow : myNet->getAttributeCarriers()->getDemandElements().at(SUMO_TAG_FLOW)) {
3195  if (flow->getParentEdges().size() > 0) {
3196  edgesToUpdate.insert(flow->getParentEdges().front());
3197  }
3198  }
3199  // update spread geometries of all edges
3200  for (const auto& edge : edgesToUpdate) {
3201  edge->updateVehicleSpreadGeometries();
3202  }
3203  // update view to show new vehicles positions
3204  updateViewNet();
3205  // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
3206  if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_DRAWSPREADVEHICLES)) {
3208  } else if (sel == FXSEL(SEL_COMMAND, MID_GNE_DEMANDVIEWOPTIONS_DRAWSPREADVEHICLES)) {
3210  }
3211  return 1;
3212 }
3213 
3214 
3215 long
3216 GNEViewNet::onCmdToggleWarnAboutMerge(FXObject*, FXSelector sel, void*) {
3217  // Toggle menuCheckWarnAboutMerge
3220  } else {
3222  }
3224  // Only update view
3225  updateViewNet();
3226  // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
3227  if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_ASKFORMERGE)) {
3229  }
3230  return 1;
3231 }
3232 
3233 
3234 long
3235 GNEViewNet::onCmdToggleShowJunctionBubbles(FXObject*, FXSelector sel, void*) {
3236  // Toggle menuCheckShowJunctionBubble
3239  } else {
3241  }
3243  // Only update view
3244  updateViewNet();
3245  // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
3246  if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_SHOWBUBBLES)) {
3248  }
3249  return 1;
3250 }
3251 
3252 
3253 long
3254 GNEViewNet::onCmdToggleMoveElevation(FXObject*, FXSelector sel, void*) {
3255  // Toggle menuCheckMoveElevation
3258  } else {
3260  }
3262  // Only update view
3263  updateViewNet();
3264  // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
3265  if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_MOVEELEVATION)) {
3267  }
3268  return 1;
3269 }
3270 
3271 
3272 long
3273 GNEViewNet::onCmdToggleChainEdges(FXObject*, FXSelector sel, void*) {
3274  // Toggle menuCheckMoveElevation
3277  } else {
3279  }
3281  // Only update view
3282  updateViewNet();
3283  // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
3284  if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_CHAINEDGES)) {
3286  }
3287  return 1;
3288 }
3289 
3290 
3291 long
3292 GNEViewNet::onCmdToggleAutoOppositeEdge(FXObject*, FXSelector sel, void*) {
3293  // Toggle menuCheckAutoOppositeEdge
3296  } else {
3298  }
3300  // Only update view
3301  updateViewNet();
3302  // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
3303  if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_AUTOOPPOSITEEDGES)) {
3305  }
3306  return 1;
3307 }
3308 
3309 
3310 long
3311 GNEViewNet::onCmdToggleHideNonInspecteDemandElements(FXObject*, FXSelector sel, void*) {
3312  // Toggle menuCheckHideNonInspectedDemandElements
3315  } else {
3317  }
3319  // Only update view
3320  updateViewNet();
3321  // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
3322  if (sel == FXSEL(SEL_COMMAND, MID_GNE_DEMANDVIEWOPTIONS_HIDENONINSPECTED)) {
3324  }
3325  return 1;
3326 }
3327 
3328 
3329 long
3330 GNEViewNet::onCmdToggleShowOverlappedRoutes(FXObject*, FXSelector sel, void*) {
3331  // Toggle menuCheckShowOverlappedRoutes
3334  } else {
3336  }
3338  // Only update view
3339  updateViewNet();
3340  // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
3341  if (sel == FXSEL(SEL_COMMAND, MID_GNE_DEMANDVIEWOPTIONS_SHOWOVERLAPPEDROUTES)) {
3343  }
3344  return 1;
3345 }
3346 
3347 
3348 long
3349 GNEViewNet::onCmdToggleHideShapes(FXObject*, FXSelector sel, void*) {
3350  // Toggle menuCheckHideShapes
3353  } else {
3355  }
3357  // Only update view
3358  updateViewNet();
3359  // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
3360  if (sel == FXSEL(SEL_COMMAND, MID_GNE_DEMANDVIEWOPTIONS_HIDESHAPES)) {
3362  }
3363  return 1;
3364 }
3365 
3366 
3367 long
3368 GNEViewNet::onCmdToggleShowTrips(FXObject*, FXSelector sel, void*) {
3369  // Toggle menuCheckHideShapes
3372  } else {
3374  }
3376  // Only update view
3377  updateViewNet();
3378  // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
3379  if (sel == FXSEL(SEL_COMMAND, MID_GNE_DEMANDVIEWOPTIONS_SHOWTRIPS)) {
3381  }
3382  return 1;
3383 }
3384 
3385 
3386 long
3387 GNEViewNet::onCmdToggleShowAllPersonPlans(FXObject*, FXSelector sel, void*) {
3388  // Toggle menuCheckShowAllPersonPlans
3391  } else {
3393  }
3395  // Only update view
3396  updateViewNet();
3397  // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
3398  if (sel == FXSEL(SEL_COMMAND, MID_GNE_DEMANDVIEWOPTIONS_SHOWALLPERSONPLANS)) {
3400  }
3401  return 1;
3402 }
3403 
3404 
3405 long
3406 GNEViewNet::onCmdToggleLockPerson(FXObject*, FXSelector sel, void*) {
3407  // Toggle menuCheckLockPerson
3410  } else if ((myInspectedAttributeCarriers.size() > 0) && myInspectedAttributeCarriers.front()->getTagProperty().isPerson()) {
3412  }
3414  // lock or unlock current inspected person depending of menuCheckLockPerson value
3416  // obtan locked person or person plan
3417  const GNEDemandElement* personOrPersonPlan = dynamic_cast<const GNEDemandElement*>(myInspectedAttributeCarriers.front());
3418  if (personOrPersonPlan) {
3419  // lock person depending if casted demand element is either a person or a person plan
3420  if (personOrPersonPlan->getTagProperty().isPerson()) {
3421  myDemandViewOptions.lockPerson(personOrPersonPlan);
3422  } else {
3423  myDemandViewOptions.lockPerson(personOrPersonPlan->getParentDemandElements().front());
3424  }
3425  }
3426  } else {
3427  // unlock current person
3429  }
3430  // update view
3431  updateViewNet();
3432  // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
3433  if (sel == FXSEL(SEL_COMMAND, MID_GNE_DEMANDVIEWOPTIONS_LOCKPERSON)) {
3435  }
3436  return 1;
3437 }
3438 
3439 
3440 long
3441 GNEViewNet::onCmdToggleShowAllContainerPlans(FXObject*, FXSelector sel, void*) {
3442  // Toggle menuCheckShowAllContainerPlans
3445  } else {
3447  }
3449  // Only update view
3450  updateViewNet();
3451  // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
3452  if (sel == FXSEL(SEL_COMMAND, MID_GNE_DEMANDVIEWOPTIONS_SHOWALLCONTAINERPLANS)) {
3454  }
3455  return 1;
3456 }
3457 
3458 
3459 long
3460 GNEViewNet::onCmdToggleLockContainer(FXObject*, FXSelector sel, void*) {
3461  // Toggle menuCheckLockContainer
3464  } else if ((myInspectedAttributeCarriers.size() > 0) && myInspectedAttributeCarriers.front()->getTagProperty().isContainer()) {
3466  }
3468  // lock or unlock current inspected container depending of menuCheckLockContainer value
3470  // obtan locked container or container plan
3471  const GNEDemandElement* containerOrContainerPlan = dynamic_cast<const GNEDemandElement*>(myInspectedAttributeCarriers.front());
3472  if (containerOrContainerPlan) {
3473  // lock container depending if casted demand element is either a container or a container plan
3474  if (containerOrContainerPlan->getTagProperty().isContainer()) {
3475  myDemandViewOptions.lockContainer(containerOrContainerPlan);
3476  } else {
3477  myDemandViewOptions.lockContainer(containerOrContainerPlan->getParentDemandElements().front());
3478  }
3479  }
3480  } else {
3481  // unlock current container
3483  }
3484  // update view
3485  updateViewNet();
3486  // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
3487  if (sel == FXSEL(SEL_COMMAND, MID_GNE_DEMANDVIEWOPTIONS_LOCKCONTAINER)) {
3489  }
3490  return 1;
3491 }
3492 
3493 
3494 long
3495 GNEViewNet::onCmdToggleShowAdditionals(FXObject*, FXSelector sel, void*) {
3496  // Toggle menuCheckShowAdditionals
3499  } else {
3501  }
3503  // Only update view
3504  updateViewNet();
3505  // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
3506  if (sel == FXSEL(SEL_COMMAND, MID_GNE_DATAVIEWOPTIONS_SHOWADDITIONALS)) {
3508  }
3509  return 1;
3510 }
3511 
3512 
3513 long
3514 GNEViewNet::onCmdToggleShowShapes(FXObject*, FXSelector sel, void*) {
3515  // Toggle menuCheckShowShapes
3518  } else {
3520  }
3522  // Only update view
3523  updateViewNet();
3524  // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
3525  if (sel == FXSEL(SEL_COMMAND, MID_GNE_DATAVIEWOPTIONS_SHOWSHAPES)) {
3527  }
3528  return 1;
3529 }
3530 
3531 
3532 long
3533 GNEViewNet::onCmdToggleShowDemandElementsNetwork(FXObject*, FXSelector sel, void*) {
3534  // Toggle menuCheckShowDemandElements
3537  } else {
3539  }
3541  // compute demand elements
3543  // update view to show demand elements
3544  updateViewNet();
3545  // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
3546  if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_SHOWDEMANDELEMENTS)) {
3548  }
3549  return 1;
3550 }
3551 
3552 
3553 long
3554 GNEViewNet::onCmdToggleShowDemandElementsData(FXObject*, FXSelector sel, void*) {
3555  // Toggle menuCheckShowDemandElements
3558  } else {
3560  }
3562  // compute demand elements
3564  // update view to show demand elements
3565  updateViewNet();
3566  // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
3567  if (sel == FXSEL(SEL_COMMAND, MID_GNE_DATAVIEWOPTIONS_SHOWDEMANDELEMENTS)) {
3569  }
3570  return 1;
3571 }
3572 
3573 
3574 long
3575 GNEViewNet::onCmdToggleTAZRelDrawing(FXObject*, FXSelector sel, void*) {
3576  // Toggle menuCheckShowDemandElements
3579  } else {
3581  }
3583  // update view to show demand elements
3584  updateViewNet();
3585  // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
3586  if (sel == FXSEL(SEL_COMMAND, MID_GNE_DATAVIEWOPTIONS_TAZRELDRAWING)) {
3588  }
3589  return 1;
3590 }
3591 
3592 
3593 long
3594 GNEViewNet::onCmdToggleTAZDrawFill(FXObject*, FXSelector sel, void*) {
3595  // Toggle menuCheckShowDemandElements
3598  } else {
3600  }
3602  // update view to show demand elements
3603  updateViewNet();
3604  // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
3605  if (sel == FXSEL(SEL_COMMAND, MID_GNE_DATAVIEWOPTIONS_TAZDRAWFILL)) {
3607  }
3608  return 1;
3609 }
3610 
3611 
3612 long
3613 GNEViewNet::onCmdToggleTAZRelOnlyFrom(FXObject*, FXSelector sel, void*) {
3614  // Toggle menuCheckShowDemandElements
3617  } else {
3619  }
3621  // update view to show demand elements
3622  updateViewNet();
3623  // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
3624  if (sel == FXSEL(SEL_COMMAND, MID_GNE_DATAVIEWOPTIONS_TAZRELONLYFROM)) {
3626  }
3627  return 1;
3628 }
3629 
3630 
3631 long
3632 GNEViewNet::onCmdToggleTAZRelOnlyTo(FXObject*, FXSelector sel, void*) {
3633  // Toggle menuCheckShowDemandElements
3636  } else {
3638  }
3640  // update view to show demand elements
3641  updateViewNet();
3642  // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
3643  if (sel == FXSEL(SEL_COMMAND, MID_GNE_DATAVIEWOPTIONS_TAZRELONLYTO)) {
3645  }
3646  return 1;
3647 }
3648 
3649 
3650 long
3651 GNEViewNet::onCmdIntervalBarGenericDataType(FXObject*, FXSelector, void*) {
3653  return 1;
3654 }
3655 
3656 
3657 long
3658 GNEViewNet::onCmdIntervalBarDataSet(FXObject*, FXSelector, void*) {
3660  return 1;
3661 }
3662 
3663 
3664 long
3665 GNEViewNet::onCmdIntervalBarLimit(FXObject*, FXSelector, void*) {
3667  return 1;
3668 }
3669 
3670 
3671 long
3672 GNEViewNet::onCmdIntervalBarSetBegin(FXObject*, FXSelector, void*) {
3674  return 1;
3675 }
3676 
3677 
3678 long
3679 GNEViewNet::onCmdIntervalBarSetEnd(FXObject*, FXSelector, void*) {
3681  return 1;
3682 }
3683 
3684 
3685 long
3686 GNEViewNet::onCmdIntervalBarSetAttribute(FXObject*, FXSelector, void*) {
3688  return 1;
3689 }
3690 
3691 
3692 long
3693 GNEViewNet::onCmdAddSelected(FXObject*, FXSelector, void*) {
3694  // make GL current (To allow take objects in popup position)
3695  if (makeCurrent()) {
3699  // make sure that AC is selected before selecting
3700  if (ACToselect && !ACToselect->isAttributeCarrierSelected()) {
3701  ACToselect->selectAttributeCarrier();
3702  }
3703  // make non current
3704  makeNonCurrent();
3705  }
3706  return 1;
3707 }
3708 
3709 
3710 long
3711 GNEViewNet::onCmdRemoveSelected(FXObject*, FXSelector, void*) {
3712  // make GL current (To allow take objects in popup position)
3713  if (makeCurrent()) {
3717  // make sure that AC is selected before unselecting
3718  if (ACToselect && ACToselect->isAttributeCarrierSelected()) {
3719  ACToselect->unselectAttributeCarrier();
3720  }
3721  // make non current
3722  makeNonCurrent();
3723  }
3724  return 1;
3725 }
3726 
3727 
3728 long
3729 GNEViewNet::onCmdAddEdgeSelected(FXObject*, FXSelector, void*) {
3730  // make GL current (To allow take objects in popup position)
3731  if (makeCurrent()) {
3733  // get lane
3734  GNELane* lane = dynamic_cast <GNELane*>(GUIGlObjectStorage::gIDStorage.getObjectBlocking(id));
3736  // make sure that AC is selected before selecting
3737  if (lane && !lane->getParentEdge()->isAttributeCarrierSelected()) {
3739  }
3740  // make non current
3741  makeNonCurrent();
3742  }
3743  return 1;
3744 }
3745 
3746 
3747 long
3748 GNEViewNet::onCmdRemoveEdgeSelected(FXObject*, FXSelector, void*) {
3749  // make GL current (To allow take objects in popup position)
3750  if (makeCurrent()) {
3752  // get lane
3753  GNELane* lane = dynamic_cast <GNELane*>(GUIGlObjectStorage::gIDStorage.getObjectBlocking(id));
3755  // make sure that AC is selected before unselecting
3756  if (lane && lane->getParentEdge()->isAttributeCarrierSelected()) {
3758  }
3759  // make non current
3760  makeNonCurrent();
3761  }
3762  return 1;
3763 }
3764 
3765 // ===========================================================================
3766 // private
3767 // ===========================================================================
3768 
3769 void
3771  // first build supermode buttons
3773 
3774  // build save buttons
3776 
3777  // build menu checks for Common checkable buttons
3779 
3780  // build menu checks for Network checkable buttons
3782 
3783  // build menu checks for Demand checkable buttons
3785 
3786  // build menu checks of view options Data
3788 
3789  // Create Vertical separator
3791  // XXX for some reason the vertial groove is not visible. adding more spacing to emphasize the separation
3794 
3795  // build menu checks of view options Network
3797 
3798  // build menu checks of view options Demand
3800 
3801  // build menu checks of view options Data
3803 
3804  // build interval bar
3806 }
3807 
3808 
3809 void
3811  // get menu checks
3813  // hide all checkbox of view options Network
3815  // hide all checkbox of view options Demand
3817  // hide all checkbox of view options Data
3819  // disable all common edit modes
3821  // disable all network edit modes
3823  // disable all network edit modes
3825  // hide interval bar
3827  // hide all frames
3829  // hide all menuchecks
3833  // In network mode, always show option "show grid", "draw spread vehicles" and "show demand elements"
3837  menuChecks.menuCheckToggleGrid->show();
3838  menuChecks.menuCheckDrawSpreadVehicles->show();
3839  menuChecks.menuCheckShowDemandElements->show();
3840  // show separator
3841  menuChecks.separator->show();
3842  // enable selected controls
3843  switch (myEditModes.networkEditMode) {
3844  // common modes
3850  // show view options
3854  // show menu checks
3855  menuChecks.menuCheckSelectEdges->show();
3856  menuChecks.menuCheckShowConnections->show();
3857  menuChecks.menuCheckShowAdditionalSubElements->show();
3858  // update lock menu bar
3860  // show
3861  break;
3869  // show view options
3872  menuChecks.menuCheckShowAdditionalSubElements->show();
3873  // show menu checks
3874  menuChecks.menuCheckSelectEdges->show();
3875  menuChecks.menuCheckShowConnections->show();
3876  break;
3882  // show view options
3887  // show menu checks
3888  menuChecks.menuCheckSelectEdges->show();
3889  menuChecks.menuCheckShowConnections->show();
3890  menuChecks.menuCheckExtendSelection->show();
3891  menuChecks.menuCheckShowAdditionalSubElements->show();
3892  break;
3893  // specific modes
3899  // show view options
3902  // show menu checks
3903  menuChecks.menuCheckChainEdges->show();
3904  menuChecks.menuCheckAutoOppositeEdge->show();
3905  break;
3911  // show view options
3915  // show menu checks
3916  menuChecks.menuCheckWarnAboutMerge->show();
3917  menuChecks.menuCheckShowJunctionBubble->show();
3918  menuChecks.menuCheckMoveElevation->show();
3919  break;
3925  break;
3931  // show view options
3933  // show menu checks
3934  menuChecks.menuCheckChangeAllPhases->show();
3935  break;
3941  // show view options
3943  // show menu checks
3944  menuChecks.menuCheckShowAdditionalSubElements->show();
3945  break;
3951  break;
3957  break;
3963  break;
3969  break;
3970  default:
3971  break;
3972  }
3973  // update common Network buttons
3975  // Update Network buttons
3977  // update alt labels
3978  menuChecks.updateAltLabels();
3979  // recalc toolbar
3982  // force repaint because different modes draw different things
3983  onPaint(nullptr, 0, nullptr);
3984  // finally update view
3985  updateViewNet();
3986 }
3987 
3988 
3989 void
3991  // get menu checks
3992  const auto& menuChecks = myViewParent->getGNEAppWindows()->getEditMenuCommands().demandViewOptions;
3993  // hide all checkbox of view options Network
3995  // hide all checkbox of view options Demand
3997  // hide all checkbox of view options Data
3999  // disable all common edit modes
4001  // disable all Demand edit modes
4003  // disable all network edit modes
4005  // hide interval bar
4007  // hide all frames
4009  // hide all menuchecks
4013  // always show "hide shapes", "show grid", "draw spread vehicles", "show overlapped routes" and show/lock persons and containers
4023  menuChecks.menuCheckToggleGrid->show();
4024  menuChecks.menuCheckDrawSpreadVehicles->show();
4025  menuChecks.menuCheckHideShapes->show();
4026  menuChecks.menuCheckShowAllTrips->show();
4027  menuChecks.menuCheckShowAllPersonPlans->show();
4028  menuChecks.menuCheckLockPerson->show();
4029  menuChecks.menuCheckShowAllContainerPlans->show();
4030  menuChecks.menuCheckLockContainer->show();
4031  menuChecks.menuCheckShowOverlappedRoutes->show();
4032  // show separator
4033  menuChecks.separator->show();
4034  // enable selected controls
4035  switch (myEditModes.demandEditMode) {
4036  // common modes
4041  // set checkable button
4043  // show view options
4045  // show menu checks
4046  menuChecks.menuCheckHideNonInspectedDemandElements->show();
4047  break;
4052  // set checkable button
4054  break;
4059  // set checkable button
4061  break;
4066  // set checkable button
4068  break;
4069  // specific modes
4074  // set checkable button
4076  break;
4081  // set checkable button
4083  break;
4088  // set checkable button
4090  break;
4095  // set checkable button
4097  break;
4102  // set checkable button
4104  break;
4109  // set checkable button
4111  break;
4116  // set checkable button
4118  break;
4123  // set checkable button
4125  break;
4126  default:
4127  break;
4128  }
4129  // update common Network buttons
4131  // Update Demand buttons
4133  // recalc toolbar
4136  // force repaint because different modes draw different things
4137  onPaint(nullptr, 0, nullptr);
4138  // finally update view
4139  updateViewNet();
4140 }
4141 
4142 
4143 void
4145  // get menu checks
4146  const auto& menuChecks = myViewParent->getGNEAppWindows()->getEditMenuCommands().dataViewOptions;
4147  // hide all checkbox of view options Network
4149  // hide all checkbox of view options Demand
4151  // hide all checkbox of view options Data
4153  // disable all common edit modes
4155  // disable all Data edit modes
4157  // show interval bar
4159  // hide all frames
4161  // hide all menuchecks
4165  // In data mode, always show option "show demand elements" and "hide shapes"
4169  menuChecks.menuCheckShowAdditionals->show();
4170  menuChecks.menuCheckShowShapes->show();
4171  menuChecks.menuCheckShowDemandElements->show();
4172  // show separator
4173  menuChecks.separator->show();
4174  // enable selected controls
4175  switch (myEditModes.dataEditMode) {
4176  // common modes
4181  // set checkable button
4183  // show view option
4188  // show menu check
4189  menuChecks.menuCheckToogleTAZRelDrawing->show();
4190  menuChecks.menuCheckToogleTAZDrawFill->show();
4191  menuChecks.menuCheckToogleTAZRelOnlyFrom->show();
4192  menuChecks.menuCheckToogleTAZRelOnlyTo->show();
4193  // enable IntervalBar
4195  break;
4200  // set checkable button
4202  // show toogle TAZRel drawing view option
4204  // show toogle TAZRel drawing menu check
4205  menuChecks.menuCheckToogleTAZRelDrawing->show();
4206  // enable IntervalBar
4208  break;
4213  // set checkable button
4215  // show toogle TAZRel drawing view option
4217  // show toogle TAZRel drawing menu check
4218  menuChecks.menuCheckToogleTAZRelDrawing->show();
4219  // enable IntervalBar
4221  break;
4226  // set checkable button
4228  // disable IntervalBar
4230  break;
4235  // set checkable button
4237  // disable IntervalBar
4239  break;
4244  // set checkable button
4246  // show view option
4249  // show menu check
4250  menuChecks.menuCheckToogleTAZRelDrawing->show();
4251  menuChecks.menuCheckToogleTAZDrawFill->show();
4252  // disable IntervalBar
4254  break;
4255  default:
4256  break;
4257  }
4258  // update common Network buttons
4260  // Update Data buttons
4262  // recalc toolbar
4265  // force repaint because different modes draw different things
4266  onPaint(nullptr, 0, nullptr);
4267  // finally update view
4268  updateViewNet();
4269 }
4270 
4271 
4272 void
4273 GNEViewNet::deleteNetworkAttributeCarriers(const std::vector<GNEAttributeCarrier*> ACs) {
4274  // iterate over ACs and delete it
4275  for (const auto& AC : ACs) {
4276  if (AC->getTagProperty().getTag() == SUMO_TAG_JUNCTION) {
4277  // get junction (note: could be already removed if is a child, then hardfail=false)
4278  GNEJunction* junction = myNet->getAttributeCarriers()->retrieveJunction(AC->getID(), false);
4279  // if exist, remove it
4280  if (junction) {
4281  myNet->deleteJunction(junction, myUndoList);
4282  }
4283  } else if (AC->getTagProperty().getTag() == SUMO_TAG_CROSSING) {
4284  // get crossing (note: could be already removed if is a child, then hardfail=false)
4285  GNECrossing* crossing = myNet->getAttributeCarriers()->retrieveCrossing(AC, false);
4286  // if exist, remove it
4287  if (crossing) {
4288  myNet->deleteCrossing(crossing, myUndoList);
4289  }
4290  } else if (AC->getTagProperty().getTag() == SUMO_TAG_EDGE) {
4291  // get edge (note: could be already removed if is a child, then hardfail=false)
4292  GNEEdge* edge = myNet->getAttributeCarriers()->retrieveEdge(AC->getID(), false);
4293  // if exist, remove it
4294  if (edge) {
4295  myNet->deleteEdge(edge, myUndoList, false);
4296  }
4297  } else if (AC->getTagProperty().getTag() == SUMO_TAG_LANE) {
4298  // get lane (note: could be already removed if is a child, then hardfail=false)
4299  GNELane* lane = myNet->getAttributeCarriers()->retrieveLane(AC, false);
4300  // if exist, remove it
4301  if (lane) {
4302  myNet->deleteLane(lane, myUndoList, false);
4303  }
4304  } else if (AC->getTagProperty().getTag() == SUMO_TAG_CONNECTION) {
4305  // get connection (note: could be already removed if is a child, then hardfail=false)
4306  GNEConnection* connection = myNet->getAttributeCarriers()->retrieveConnection(AC, false);
4307  // if exist, remove it
4308  if (connection) {
4309  myNet->deleteConnection(connection, myUndoList);
4310  }
4311  } else if (AC->getTagProperty().isAdditionalElement()) {
4312  // get additional Element (note: could be already removed if is a child, then hardfail=false)
4313  GNEAdditional* additionalElement = myNet->getAttributeCarriers()->retrieveAdditional(AC, false);
4314  // if exist, remove it
4315  if (additionalElement) {
4316  myNet->deleteAdditional(additionalElement, myUndoList);
4317  }
4318  } else if (AC->getTagProperty().isShape()) {
4319  // get shape Element (note: could be already removed if is a child, then hardfail=false)
4320  GNEShape* shapeElement = myNet->getAttributeCarriers()->retrieveShape(AC, false);
4321  // if exist, remove it
4322  if (shapeElement) {
4323  myNet->deleteShape(shapeElement, myUndoList);
4324  }
4325  } else if (AC->getTagProperty().isTAZElement()) {
4326  // get TAZ Element (note: could be already removed if is a child, then hardfail=false)
4327  GNETAZElement* TAZElement = myNet->getAttributeCarriers()->retrieveTAZElement(AC, false);
4328  // if exist, remove it
4329  if (TAZElement) {
4330  myNet->deleteTAZElement(TAZElement, myUndoList);
4331  }
4332  }
4333  }
4334 }
4335 
4336 
4337 void
4338 GNEViewNet::deleteDemandAttributeCarriers(const std::vector<GNEAttributeCarrier*> ACs) {
4339  // iterate over ACs and delete it
4340  for (const auto& AC : ACs) {
4341  // get demand Element (note: could be already removed if is a child, then hardfail=false)
4342  GNEDemandElement* demandElement = myNet->getAttributeCarriers()->retrieveDemandElement(AC, false);
4343  // if exist, remove it
4344  if (demandElement) {
4345  myNet->deleteDemandElement(demandElement, myUndoList);
4346  }
4347  }
4348 }
4349 
4350 
4351 void
4352 GNEViewNet::deleteDataAttributeCarriers(const std::vector<GNEAttributeCarrier*> ACs) {
4353  // iterate over ACs and delete it
4354  for (const auto& AC : ACs) {
4355  if (AC->getTagProperty().getTag() == SUMO_TAG_DATASET) {
4356  // get data set (note: could be already removed if is a child, then hardfail=false)
4357  GNEDataSet* dataSet = myNet->getAttributeCarriers()->retrieveDataSet(AC, false);
4358  // if exist, remove it
4359  if (dataSet) {
4360  myNet->deleteDataSet(dataSet, myUndoList);
4361  }
4362  } else if (AC->getTagProperty().getTag() == SUMO_TAG_DATAINTERVAL) {
4363  // get data interval (note: could be already removed if is a child, then hardfail=false)
4364  GNEDataInterval* dataInterval = myNet->getAttributeCarriers()->retrieveDataInterval(AC, false);
4365  // if exist, remove it
4366  if (dataInterval) {
4367  myNet->deleteDataInterval(dataInterval, myUndoList);
4368  }
4369  } else {
4370  // get generic data (note: could be already removed if is a child, then hardfail=false)
4371  GNEGenericData* genericData = myNet->getAttributeCarriers()->retrieveGenericData(AC, false);
4372  // if exist, remove it
4373  if (genericData) {
4374  myNet->deleteGenericData(genericData, myUndoList);
4375  }
4376  }
4377  }
4378 }
4379 
4380 
4381 void
4383  switch (myEditModes.networkEditMode) {
4385  myViewParent->getInspectorFrame()->update();
4386  break;
4387  default:
4388  break;
4389  }
4390  // update view
4391  updateViewNet();
4392 }
4393 
4394 // ---------------------------------------------------------------------------
4395 // Private methods
4396 // ---------------------------------------------------------------------------
4397 
4398 void
4401  // draw first point
4403  // Push draw matrix
4405  // obtain first clicked point
4406  const Position& firstLanePoint = myViewParent->getAdditionalFrame()->getConsecutiveLaneSelector()->getSelectedLanes().front().first->getLaneShape().positionAtOffset(
4408  // must draw on top of other connections
4409  glTranslated(firstLanePoint.x(), firstLanePoint.y(), GLO_JUNCTION + 0.3);
4411  // draw first point
4413  GLHelper::drawText("S", Position(), .1, 1.3, RGBColor::CYAN);
4414  // pop draw matrix
4416  }
4417  // draw connections between lanes
4419  // iterate over all current selected lanes
4420  for (int i = 0; i < (int)myViewParent->getAdditionalFrame()->getConsecutiveLaneSelector()->getSelectedLanes().size() - 1; i++) {
4421  // declare position vector for shape
4422  PositionVector shape;
4423  // declare vectors for shape rotation and lengths
4424  std::vector<double> shapeRotations, shapeLengths;
4425  // obtain GNELanes
4428  // Push draw matrix
4430  // must draw on top of other connections
4431  glTranslated(0, 0, GLO_JUNCTION + 0.2);
4432  // obtain connection shape
4433  shape = from->getParentEdge()->getNBEdge()->getConnection(from->getIndex(), to->getParentEdge()->getNBEdge(), to->getIndex()).shape;
4434  // set special color
4436  // Obtain lengths and shape rotations
4437  int segments = (int) shape.size() - 1;
4438  if (segments >= 0) {
4439  shapeRotations.reserve(segments);
4440  shapeLengths.reserve(segments);
4441  for (int j = 0; j < segments; j++) {
4442  shapeLengths.push_back(GUIGeometry::calculateLength(shape[j], shape[j + 1]));
4443  shapeRotations.push_back(GUIGeometry::calculateRotation(shape[j], shape[j + 1]));
4444  }
4445  }
4446  // draw a list of lines
4447  GLHelper::drawBoxLines(shape, shapeRotations, shapeLengths, 0.2);
4448  // pop draw matrix
4450  }
4451  // draw last point
4453  // obtain last clicked point
4454  const Position& lastLanePoint = myViewParent->getAdditionalFrame()->getConsecutiveLaneSelector()->getSelectedLanes().back().first->getLaneShape().positionAtOffset(
4456  // must draw on top of other connections
4457  glTranslated(lastLanePoint.x(), lastLanePoint.y(), GLO_JUNCTION + 0.3);
4459  // draw last point
4460  GLHelper::drawFilledCircle((double) 1.3, 8);
4461  GLHelper::drawText("E", Position(), .1, 1.3, RGBColor::CYAN);
4462  // pop draw matrix
4464  }
4465 
4466  }
4467 }
4468 
4469 
4470 void
4472  PositionVector temporalShape;
4473  bool deleteLastCreatedPoint = false;
4474  // obtain temporal shape and delete last created point flag
4480  deleteLastCreatedPoint = myViewParent->getTAZFrame()->getDrawingShapeModule()->getDeleteLastCreatedPoint();
4481  }
4482  // check if we're in drawing mode
4483  if (temporalShape.size() > 0) {
4484  // draw blue line with the current drawed shape
4486  glLineWidth(2);
4487  glTranslated(0, 0, GLO_TEMPORALSHAPE);
4489  GLHelper::drawLine(temporalShape);
4491  // draw red line from the last point of shape to the current mouse position
4493  glLineWidth(2);
4494  glTranslated(0, 0, GLO_TEMPORALSHAPE);
4495  // draw last line depending if shift key (delete last created point) is pressed
4496  if (deleteLastCreatedPoint) {
4498  } else {
4500  }
4503  }
4504 }
4505 
4506 
4507 void
4509  // first check if we're in correct mode
4514  // get mouse position
4515  const Position mousePosition = snapToActiveGrid(getPositionInformation());
4516  // get junction exaggeration
4517  const double junctionExaggeration = myVisualizationSettings->junctionSize.getExaggeration(*myVisualizationSettings, nullptr, 4);
4518  // get buble color
4520  // change alpha
4521  bubbleColor.setAlpha(200);
4522  // push layer matrix
4524  // translate to temporal shape layer
4525  glTranslated(0, 0, GLO_TEMPORALSHAPE);
4526  // push junction matrix
4528  // move matrix junction center
4529  glTranslated(mousePosition.x(), mousePosition.y(), 0.1);
4530  // set color
4531  GLHelper::setColor(bubbleColor);
4532  // draw filled circle
4533  const double circleWidth = myVisualizationSettings->neteditSizeSettings.junctionBubbleRadius * junctionExaggeration;
4534  GLHelper::drawOutlineCircle(circleWidth, circleWidth * 0.75, myVisualizationSettings->getCircleResolution());
4535  // pop junction matrix
4537  // draw temporal edge
4539  // set temporal edge color
4540  RGBColor temporalEdgeColor = RGBColor::BLACK;
4541  temporalEdgeColor.setAlpha(200);
4542  // declare temporal edge geometry
4543  GUIGeometry temporalEdgeGeometery;
4544  // calculate geometry between source junction and mouse position
4545  PositionVector temporalEdge = {mousePosition, myViewParent->getCreateEdgeFrame()->getJunctionSource()->getPositionInView()};
4546  // move temporal edge 2 side
4547  temporalEdge.move2side(-1);
4548  // update geometry
4549  temporalEdgeGeometery.updateGeometry(temporalEdge);
4550  // push temporal edge matrix
4552  // set color
4553  GLHelper::setColor(temporalEdgeColor);
4554  // draw temporal edge
4556  // check if we have to draw opposite edge
4558  // move temporal edge to opposite edge
4559  temporalEdge.move2side(2);
4560  // update geometry
4561  temporalEdgeGeometery.updateGeometry(temporalEdge);
4562  // draw temporal edge
4564  }
4565  // pop temporal edge matrix
4567  }
4568  // pop layer matrix
4570  }
4571 }
4572 
4573 
4574 void
4576  // reset moving selected edge
4578  // get front AC
4580  // decide what to do based on mode
4581  switch (myEditModes.networkEditMode) {
4583  // first swap lane to edges if mySelectEdges is enabled and shift key isn't pressed
4586  }
4587  // process left click in Inspector Frame
4589  // process click
4590  processClick(eventData);
4591  break;
4592  }
4594  // first swap lane to edges if mySelectEdges is enabled and shift key isn't pressed
4597  // update AC under cursor
4599  }
4600  // check that we have clicked over network element element
4601  if (AC && !myLockManager.isObjectLocked(AC->getGUIGlObject()->getType(), AC->isAttributeCarrierSelected()) &&
4602  (AC->getTagProperty().isNetworkElement() || AC->getTagProperty().isAdditionalElement() ||
4603  AC->getTagProperty().isShape() || AC->getTagProperty().isTAZElement())) {
4604  // now check if we want only delete geometry points
4606  // only remove geometry point
4608  } else if (AC->isAttributeCarrierSelected()) {
4609  // remove all selected attribute carriers
4611  } else {
4612  // remove attribute carrier under cursor
4614  }
4615  } else {
4616  // process click
4617  processClick(eventData);
4618  }
4619  break;
4620  }
4622  // first swap lane to edges if mySelectEdges is enabled and shift key isn't pressed
4625  // update AC under cursor
4627  }
4628  // avoid to select if control key is pressed
4630  // check if a rect for selecting is being created
4632  // begin rectangle selection
4634  } else {
4635  // first check that under cursor there is an attribute carrier, isn't a demand element and is selectable
4636  if (AC && !myLockManager.isObjectLocked(AC->getGUIGlObject()->getType(), AC->isAttributeCarrierSelected()) && !AC->getTagProperty().isDemandElement()) {
4637  // toggle networkElement selection
4638  if (AC->isAttributeCarrierSelected()) {
4639  AC->unselectAttributeCarrier();
4640  } else {
4641  AC->selectAttributeCarrier();
4642  }
4643  }
4644  // update information label
4646  // process click
4647  processClick(eventData);
4648  }
4649  } else {
4650  // process click
4651  processClick(eventData);
4652  }
4653  break;
4655  // check what buttons are pressed
4657  // get edge under cursor
4659  if (edge) {
4660  // obtain reverse edge
4661  GNEEdge* reverseEdge = edge->getOppositeEdge();
4662  // check if we're split one or both edges
4665  } else if (reverseEdge) {
4666  myNet->splitEdgesBidi(edge, reverseEdge, edge->getSplitPos(getPositionInformation()), myUndoList);
4667  } else {
4669  }
4670  }
4672  // check if we have to update objects under snapped cursor
4675  } else {
4677  }
4678  // process left click in create edge frame Frame
4683  }
4684  // process click
4685  processClick(eventData);
4686  break;
4687  }
4689  // first swap lane to edges if mySelectEdges is enabled and shift key isn't pressed
4691  // swap lane to edge (except if we're editing a shape lane)
4694  }
4695  // update AC under cursor
4697  }
4698  // check if we're editing a shape
4700  // check if we're removing a geometry point
4702  // remove geometry point
4705  }
4707  // process click if there isn't movable elements (to move camera using drag an drop)
4708  processClick(eventData);
4709  }
4710  } else {
4711  // allways swap lane to edges in movement mode
4713  // check that AC under cursor isn't a demand element
4714  if (AC && !myLockManager.isObjectLocked(AC->getGUIGlObject()->getType(), AC->isAttributeCarrierSelected()) && !AC->getTagProperty().isDemandElement()) {
4715  // check if we're moving a set of selected items
4716  if (AC->isAttributeCarrierSelected()) {
4717  // move selected ACs
4719  // update view
4720  updateViewNet();
4722  // process click if there isn't movable elements (to move camera using drag an drop)
4723  processClick(eventData);
4724  }
4725  } else {
4726  // process click if there isn't movable elements (to move camera using drag an drop)
4727  processClick(eventData);
4728  }
4729  }
4730  break;
4731  }
4733  // check if we're clicked over a lane
4735  // Handle laneclick (shift key may pass connections, Control key allow conflicts)
4737  updateViewNet();
4738  }
4739  // process click
4740  processClick(eventData);
4741  break;
4742  }
4745  // edit TLS in TLSEditor frame
4747  updateViewNet();
4748  }
4749  // process click
4750  processClick(eventData);
4751  break;
4752  }
4754  // avoid create additionals if control key is pressed
4757  // check if we need to start select lanes
4759  // select getLaneFront() to create an additional with consecutive lanes
4761  } else if (myObjectsUnderCursor.getLaneFront()) {
4763  }
4765  // update view to show the new additional
4766  updateViewNet();
4767  }
4768  }
4769  // process click
4770  processClick(eventData);
4771  break;
4772  }
4774  // swap lanes to edges in crossingsMode
4776  // call function addCrossing from crossing frame
4778  // process click
4779  processClick(eventData);
4780  break;
4781  }
4783  // swap lanes to edges in TAZ Mode
4785  // avoid create TAZs if control key is pressed
4787  // check if we want to create a rect for selecting edges
4789  // begin rectangle selection
4791  } else {
4792  // check if process click was scuesfully
4794  // view net must be always update
4795  updateViewNet();
4796  }
4797  // process click
4798  processClick(eventData);
4799  }
4800  } else {
4801  // process click
4802  processClick(eventData);
4803  }
4804  break;
4805  }
4807  // avoid create shapes if control key is pressed
4810  // declare processClick flag
4811  bool updateTemporalShape = false;
4812  // process click
4814  // view net must be always update
4815  updateViewNet();
4816  // process click depending of the result of "process click"
4817  if (!updateTemporalShape) {
4818  // process click
4819  processClick(eventData);
4820  }
4821  }
4822  } else {
4823  // process click
4824  processClick(eventData);
4825  }
4826  break;
4827  }
4830  // shift key may pass connections, Control key allow conflicts.
4832  updateViewNet();
4833  }
4834  // process click
4835  processClick(eventData);
4836  break;
4837  }
4838  default: {
4839  // process click
4840  processClick(eventData);
4841  }
4842  }
4843 }
4844 
4845 
4846 void
4848  // check moved items
4852  // check if we're creating a rectangle selection or we want only to select a lane
4854  // check if we're selecting all type of elements o we only want a set of edges for TAZ
4858  // process edge selection
4860  }
4862  // obtain objects under cursor
4863  if (makeCurrent()) {
4864  // update objects under cursor again
4866  makeNonCurrent();
4867  }
4868  // check if there is a lane in objects under cursor
4870  // if we clicked over an lane with shift key pressed, select or unselect it
4873  } else {
4875  }
4876  }
4877  }
4878  // finish selection
4880  } else {
4881  // finish moving of single elements
4883  }
4884 }
4885 
4886 
4887 void
4888 GNEViewNet::processMoveMouseNetwork(const bool mouseLeftButtonPressed) {
4889  // change "delete last created point" depending if during movement shift key is pressed
4894  }
4895  // check what type of additional is moved
4897  // move entire selection
4898  myMoveMultipleElementValues.moveSelection(mouseLeftButtonPressed);
4900  // update selection corner of selecting area
4902  } else {
4903  // move single elements
4904  myMoveSingleElementValues.moveSingleElement(mouseLeftButtonPressed);
4905  }
4906 }
4907 
4908 
4909 void
4911  // get front AC
4913  // decide what to do based on mode
4914  switch (myEditModes.demandEditMode) {
4916  // process left click in Inspector Frame
4918  // process click
4919  processClick(eventData);
4920  break;
4921  }
4923  // check conditions
4924  if (AC && !myLockManager.isObjectLocked(AC->getGUIGlObject()->getType(), AC->isAttributeCarrierSelected()) && AC->getTagProperty().isDemandElement()) {
4925  // check if we are deleting a selection or an single attribute carrier
4926  if (AC->isAttributeCarrierSelected()) {
4928  } else {
4930  }
4931  } else {
4932  // process click
4933  processClick(eventData);
4934  }
4935  break;
4936  }
4938  // avoid to select if control key is pressed
4940  // check if a rect for selecting is being created
4942  // begin rectangle selection
4944  } else {
4945  // first check that under cursor there is an attribute carrier, is demand element and is selectable
4946  if (AC && AC->getTagProperty().isDemandElement() && !myLockManager.isObjectLocked(myObjectsUnderCursor.getGlTypeFront(), AC->isAttributeCarrierSelected())) {
4947  // toggle networkElement selection
4948  if (AC->isAttributeCarrierSelected()) {
4949  AC->unselectAttributeCarrier();
4950  } else {
4951  AC->selectAttributeCarrier();
4952  }
4953  }
4954  // update information label
4956  // process click
4957  processClick(eventData);
4958  }
4959  } else {
4960  // process click
4961  processClick(eventData);
4962  }
4963  break;
4965  // check that AC under cursor is a demand element
4966  if (AC && !myLockManager.isObjectLocked(AC->getGUIGlObject()->getType(), AC->isAttributeCarrierSelected()) &&
4967  AC->getTagProperty().isDemandElement()) {
4968  // check if we're moving a set of selected items
4969  if (AC->isAttributeCarrierSelected()) {
4970  // move selected ACs
4972  // update view
4973  updateViewNet();
4975  // process click if there isn't movable elements (to move camera using drag an drop)
4976  processClick(eventData);
4977  }
4978  } else {
4979  // process click if there isn't movable elements (to move camera using drag an drop)
4980  processClick(eventData);
4981  }
4982  break;
4983  }
4985  // check if we clicked over a lane
4987  // Handle edge click
4989  }
4990  // process click
4991  processClick(eventData);
4992  break;
4993  }
4995  // Handle click
4997  // process click
4998  processClick(eventData);
4999  break;
5000  }
5002  // Handle click
5004  // process click
5005  processClick(eventData);
5006  break;
5007  }
5009  // Handle click
5011  // process click
5012  processClick(eventData);
5013  break;
5014  }
5016  // Handle person plan click
5018  // process click
5019  processClick(eventData);
5020  break;
5021  }
5023  // Handle click
5025  // process click
5026  processClick(eventData);
5027  break;
5028  }
5030  // Handle container plan click
5032  // process click
5033  processClick(eventData);
5034  break;
5035  }
5036  default: {
5037  // process click
5038  processClick(eventData);
5039  }
5040  }
5041 }
5042 
5043 
5044 void
5046  // check moved items
5050  // check if we're creating a rectangle selection or we want only to select a lane
5053  }
5054  // finish selection
5056  } else {
5057  // finish moving of single elements
5059  }
5060 }
5061 
5062 
5063 void
5064 GNEViewNet::processMoveMouseDemand(const bool mouseLeftButtonPressed) {
5066  // update selection corner of selecting area
5068  } else {
5069  // move single elements
5070  myMoveSingleElementValues.moveSingleElement(mouseLeftButtonPressed);
5071  }
5072 }
5073 
5074 
5075 void
5077  // get AC
5079  // decide what to do based on mode
5080  switch (myEditModes.dataEditMode) {
5082  // process left click in Inspector Frame
5083  if (AC && AC->getTagProperty().getTag() == SUMO_TAG_TAZ) {
5085  } else {
5087  }
5088  // process click
5089  processClick(eventData);
5090  break;
5091  }
5093  // check conditions
5094  if (AC && !myLockManager.isObjectLocked(AC->getGUIGlObject()->getType(), AC->isAttributeCarrierSelected()) && AC->getTagProperty().isDataElement()) {
5095  // check if we are deleting a selection or an single attribute carrier
5096  if (AC->isAttributeCarrierSelected()) {
5098  } else {
5100  }
5101  } else {
5102  // process click
5103  processClick(eventData);
5104  }
5105  break;
5106  }
5108  // avoid to select if control key is pressed
5110  // check if a rect for selecting is being created
5112  // begin rectangle selection
5114  } else {
5115  // first check that under cursor there is an attribute carrier, is data element and is selectable
5116  if (AC && !myLockManager.isObjectLocked(AC->getGUIGlObject()->getType(), AC->isAttributeCarrierSelected()) && AC->getTagProperty().isDataElement()) {
5117  // toggle networkElement selection
5118  if (AC->isAttributeCarrierSelected()) {
5119  AC->unselectAttributeCarrier();
5120  } else {
5121  AC->selectAttributeCarrier();
5122  }
5123  }
5124  // update information label
5126  // process click
5127  processClick(eventData);
5128  }
5129  } else {
5130  // process click
5131  processClick(eventData);
5132  }
5133  break;
5135  // avoid create edgeData if control key is pressed
5138  // update view to show the new edge data
5139  updateViewNet();
5140  }
5141  }
5142  // process click
5143  processClick(eventData);
5144  break;
5146  // avoid create edgeData if control key is pressed
5149  // update view to show the new edge data
5150  updateViewNet();
5151  }
5152  }
5153  // process click
5154  processClick(eventData);
5155  break;
5157  // avoid create TAZData if control key is pressed
5160  // update view to show the new TAZ data
5161  updateViewNet();
5162  }
5163  }
5164  // process click
5165  processClick(eventData);
5166  break;
5167  default: {
5168  // process click
5169  processClick(eventData);
5170  }
5171  }
5172 }
5173 
5174 
5175 void
5177  // check moved items
5181  // check if we're creating a rectangle selection or we want only to select a lane
5184  }
5185  // finish selection
5187  } else {
5188  // finish moving of single elements
5190  }
5191 }
5192 
5193 
5194 void
5195 GNEViewNet::processMoveMouseData(const bool mouseLeftButtonPressed) {
5197  // update selection corner of selecting area
5199  } else {
5200  // move single elements
5201  myMoveSingleElementValues.moveSingleElement(mouseLeftButtonPressed);
5202  }
5203 }
5204 
5205 
5206 /****************************************************************************/
5207 
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
Supermode
@brie enum for supermodes
@ 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_CONTAINER
Mode for editing container.
@ DEMAND_DELETE
mode for deleting demand elements
@ 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.
@ DEMAND_CONTAINERPLAN
Mode for editing container plan.
@ DEMAND_TYPE
Mode for editing types.
@ MID_GNE_NETWORKVIEWOPTIONS_AUTOOPPOSITEEDGES
automatically create opposite edge
Definition: GUIAppEnum.h:708
@ MID_GNE_ADDSELECT_EDGE
Add edge to selected items - menu entry.
Definition: GUIAppEnum.h:710
@ MID_HOTKEY_F3_SUPERMODE_DEMAND
select demand supermode in NETEDIT
Definition: GUIAppEnum.h:187
@ MID_GNE_LANE_EDIT_SHAPE
edit lane shape
Definition: GUIAppEnum.h:1140
@ MID_GNE_DEMANDVIEWOPTIONS_SHOWALLPERSONPLANS
show all person plans
Definition: GUIAppEnum.h:738
@ MID_GNE_LANE_TRANSFORM_BIKE
transform lane to bikelane
Definition: GUIAppEnum.h:1148
@ MID_GNE_DATAVIEWOPTIONS_TAZRELDRAWING
toogle TAZRel drawing
Definition: GUIAppEnum.h:760
@ MID_GNE_EDGE_REVERSE
reverse an edge
Definition: GUIAppEnum.h:1058
@ MID_LOCATEPERSON
Locate person - button.
Definition: GUIAppEnum.h:359
@ MID_ADDSELECT
Add to selected items - menu entry.
Definition: GUIAppEnum.h:439
@ MID_GNE_LANE_ADD_BUS
add busLane
Definition: GUIAppEnum.h:1158
@ MID_GNE_NETWORKVIEWOPTIONS_DRAWSPREADVEHICLES
Draw vehicles in begin position or spread in lane.
Definition: GUIAppEnum.h:684
@ MID_GNE_NETWORKVIEWOPTIONS_MOVEELEVATION
move elevation instead of x,y
Definition: GUIAppEnum.h:704
@ MID_HOTKEY_S_MODES_SELECT
hotkey for mode selecting objects
Definition: GUIAppEnum.h:61
@ MID_LOCATEJUNCTION
Locate junction - button.
Definition: GUIAppEnum.h:349
@ MID_GNE_NETWORKVIEWOPTIONS_HIDECONNECTIONS
hide connections
Definition: GUIAppEnum.h:692
@ MID_GNE_REMOVESELECT_EDGE
Remove edge from selected items - Menu Etry.
Definition: GUIAppEnum.h:712
@ MID_GNE_NETWORKVIEWOPTIONS_SHOWCONNECTIONS
show connections
Definition: GUIAppEnum.h:690
@ MID_GNE_INTERVALBAR_BEGIN
begin changed in InterbalBar
Definition: GUIAppEnum.h:780
@ MID_GNE_DATAVIEWOPTIONS_TAZRELONLYTO
toogle draz TAZRel only to
Definition: GUIAppEnum.h:766
@ MID_GNE_DEMANDVIEWOPTIONS_LOCKPERSON
lock person
Definition: GUIAppEnum.h:740
@ MID_HOTKEY_V_MODES_VEHICLE
hotkey for mode create vehicles
Definition: GUIAppEnum.h:67
@ 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:369
@ MID_GNE_JUNCTION_CLEAR_CONNECTIONS
clear junction's connections
Definition: GUIAppEnum.h:1070
@ MID_GNE_JUNCTION_SELECT_ROUNDABOUT
select all roundabout nodes and edges of the current roundabout
Definition: GUIAppEnum.h:1084
@ MID_GNE_INTERVALBAR_ATTRIBUTE
attribute changed in InterbalBar
Definition: GUIAppEnum.h:784
@ MID_GNE_JUNCTION_RESET_SHAPE
reset junction shape
Definition: GUIAppEnum.h:1082
@ MID_GNE_NETWORKVIEWOPTIONS_ASKFORMERGE
ask before merging junctions
Definition: GUIAppEnum.h:700
@ MID_GNE_JUNCTION_RESET_CONNECTIONS
reset junction's connections
Definition: GUIAppEnum.h:1072
@ MID_GNE_DEMANDVIEWOPTIONS_SHOWGRID
show grid
Definition: GUIAppEnum.h:728
@ MID_GNE_JUNCTION_SPLIT
turn junction into multiple junctions
Definition: GUIAppEnum.h:1076
@ MID_GNE_EDGE_STRAIGHTEN_ELEVATION
interpolate z values linear between junctions
Definition: GUIAppEnum.h:1050
@ MID_GNE_NETWORKVIEWOPTIONS_CHAINEDGES
create edges in chain mode
Definition: GUIAppEnum.h:706
@ MID_HOTKEY_R_MODES_CROSSING_ROUTE_EDGERELDATA
hotkey for mode editing crossing, routes and edge rel datas
Definition: GUIAppEnum.h:63
@ MID_GNE_DATAVIEWOPTIONS_SHOWDEMANDELEMENTS
show demand elements
Definition: GUIAppEnum.h:758
@ MID_GNE_POLYGON_CLOSE
close opened polygon
Definition: GUIAppEnum.h:1114
@ MID_GNE_EDGE_SMOOTH
smooth geometry
Definition: GUIAppEnum.h:1048
@ MID_HOTKEY_I_MODES_INSPECT
hotkey for mode inspecting object attributes
Definition: GUIAppEnum.h:55
@ MID_LOCATEADD
Locate addtional structure - button.
Definition: GUIAppEnum.h:365
@ MID_LOCATEPOI
Locate poi - button.
Definition: GUIAppEnum.h:367
@ MID_GNE_LANE_RESET_CUSTOMSHAPE
reset custom shape
Definition: GUIAppEnum.h:1142
@ MID_GNE_EDGE_STRAIGHTEN
remove inner geometry
Definition: GUIAppEnum.h:1046
@ MID_GNE_DEMANDVIEWOPTIONS_HIDESHAPES
hide shapes
Definition: GUIAppEnum.h:734
@ MID_HOTKEY_P_MODES_POLYGON_PERSON
hotkey for mode creating polygons
Definition: GUIAppEnum.h:59
@ MID_GNE_LANE_TRANSFORM_BUS
transform lane to busLane
Definition: GUIAppEnum.h:1150
@ MID_GNE_POLYGON_SET_FIRST_POINT
Set a vertex of polygon as first verte.
Definition: GUIAppEnum.h:1118
@ MID_GNE_LANE_DUPLICATE
duplicate a lane
Definition: GUIAppEnum.h:1138
@ MID_GNE_DATAVIEWOPTIONS_SHOWADDITIONALS
show additionals
Definition: GUIAppEnum.h:754
@ MID_GNE_NETWORKVIEWOPTIONS_SHOWBUBBLES
show junctions as bubbles
Definition: GUIAppEnum.h:702
@ MID_GNE_LANE_ADD_GREENVERGE_FRONT
add greenVerge front of current lane
Definition: GUIAppEnum.h:1160
@ MID_GNE_INTERVALBAR_END
end changed in InterbalBar
Definition: GUIAppEnum.h:782
@ MID_HOTKEY_Z_MODES_TAZ_TAZREL
hotkey for mode editing TAZ and TAZRel
Definition: GUIAppEnum.h:71
@ MID_HOTKEY_M_MODES_MOVE
hotkey for mode moving element
Definition: GUIAppEnum.h:57
@ MID_GNE_NETWORKVIEWOPTIONS_EXTENDSELECTION
extend selection
Definition: GUIAppEnum.h:696
@ MID_GNE_LANE_REMOVE_GREENVERGE
remove greenVerge
Definition: GUIAppEnum.h:1170
@ MID_GNE_EDGE_SPLIT_BIDI
split an edge
Definition: GUIAppEnum.h:1056
@ MID_GNE_NETWORKVIEWOPTIONS_SHOWSUBADDITIONALS
show sub-additionals
Definition: GUIAppEnum.h:694
@ MID_GNE_JUNCTION_REPLACE
turn junction into geometry node
Definition: GUIAppEnum.h:1074
@ MID_GNE_DEMANDVIEWOPTIONS_SHOWALLCONTAINERPLANS
show all container plans
Definition: GUIAppEnum.h:742
@ MID_HOTKEY_F4_SUPERMODE_DATA
select data supermode in NETEDIT
Definition: GUIAppEnum.h:189
@ MID_LOCATESTOP
Locate stop - button.
Definition: GUIAppEnum.h:357
@ MID_GNE_LANE_REMOVE_BIKE
remove bikelane
Definition: GUIAppEnum.h:1166
@ MID_HOTKEY_W_MODES_PROHIBITION
hotkey for mode editing connection prohibitions
Definition: GUIAppEnum.h:69
@ MID_GNE_POI_TRANSFORM
Transform POI to POILane, and viceversa.
Definition: GUIAppEnum.h:1130
@ MID_GNE_LANE_RESET_OPPOSITELANE
reset opposite lane
Definition: GUIAppEnum.h:1144
@ MID_GNE_JUNCTION_CONVERT_ROUNDABOUT
convert junction to roundabout
Definition: GUIAppEnum.h:1086
@ MID_GNE_DATAVIEWOPTIONS_TAZDRAWFILL
toogle draz TAZ fill
Definition: GUIAppEnum.h:762
@ MID_REACHABILITY
show reachability from a given lane
Definition: GUIAppEnum.h:485
@ MID_GNE_EDGE_RESET_LENGTH
reset custom lengths
Definition: GUIAppEnum.h:1062
@ MID_GNE_LANE_REMOVE_BUS
remove busLane
Definition: GUIAppEnum.h:1168
@ 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:686
@ MID_GNE_POLYGON_SELECT
select elements within polygon boundary
Definition: GUIAppEnum.h:1122
@ MID_GNE_JUNCTION_SPLIT_RECONNECT
turn junction into multiple junctions and reconnect them heuristically
Definition: GUIAppEnum.h:1078
@ MID_OPEN_ADDITIONAL_DIALOG
open additional dialog (used in netedit)
Definition: GUIAppEnum.h:423
@ MID_HOTKEY_H_MODE_CONTAINERDATA
hotkey for mode containerData
Definition: GUIAppEnum.h:53
@ MID_GNE_DEMANDVIEWOPTIONS_HIDENONINSPECTED
hide non-inspected demand element
Definition: GUIAppEnum.h:732
@ 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:1080
@ MID_GNE_LANE_REMOVE_SIDEWALK
remove sidewalk
Definition: GUIAppEnum.h:1164
@ MID_GNE_EDGE_RESET_ENDPOINT
reset default geometry endpoints
Definition: GUIAppEnum.h:1044
@ MID_GNE_INTERVALBAR_GENERICDATATYPE
generic data selected
Definition: GUIAppEnum.h:774
@ MID_LOCATEEDGE
Locate edge - button.
Definition: GUIAppEnum.h:351
@ MID_GNE_LANE_ADD_GREENVERGE_BACK
add greenVerge back of current laen
Definition: GUIAppEnum.h:1162
@ MID_HOTKEY_G_MODE_CONTAINER
hotkey for mode container
Definition: GUIAppEnum.h:51
@ MID_GNE_EDGE_SMOOTH_ELEVATION
smooth elevation with regard to adjoining edges
Definition: GUIAppEnum.h:1052
@ MID_GNE_NETWORKVIEWOPTIONS_CHANGEALLPHASES
change all phases
Definition: GUIAppEnum.h:698
@ MID_GNE_DATAVIEWOPTIONS_SHOWSHAPES
show shapes
Definition: GUIAppEnum.h:756
@ MID_GNE_DATAVIEWOPTIONS_TAZRELONLYFROM
toogle draz TAZRel only from
Definition: GUIAppEnum.h:764
@ MID_GNE_EDGE_ADD_REVERSE
add reverse edge
Definition: GUIAppEnum.h:1060
@ MID_LOCATEVEHICLE
Locate vehicle - button.
Definition: GUIAppEnum.h:353
@ MID_LOCATETLS
Locate TLS - button.
Definition: GUIAppEnum.h:363
@ MID_GNE_DEMANDVIEWOPTIONS_DRAWSPREADVEHICLES
Draw vehicles in begin position or spread in lane.
Definition: GUIAppEnum.h:730
@ MID_GNE_LANE_ADD_SIDEWALK
add sidewalk
Definition: GUIAppEnum.h:1154
@ MID_GNE_DEMANDVIEWOPTIONS_SHOWOVERLAPPEDROUTES
show overlapped routes
Definition: GUIAppEnum.h:746
@ MID_GNE_RESET_GEOMETRYPOINT
reset geometry point
Definition: GUIAppEnum.h:877
@ MID_GNE_CONNECTION_EDIT_SHAPE
edit junction shape
Definition: GUIAppEnum.h:1094
@ MID_GNE_INTERVALBAR_DATASET
data set selected
Definition: GUIAppEnum.h:776
@ MID_GNE_LANE_TRANSFORM_SIDEWALK
transform lane to sidewalk
Definition: GUIAppEnum.h:1146
@ MID_GNE_LANE_ADD_BIKE
add bikelane
Definition: GUIAppEnum.h:1156
@ MID_HOTKEY_F2_SUPERMODE_NETWORK
select network supermode in NETEDIT
Definition: GUIAppEnum.h:185
@ MID_GNE_DEMANDVIEWOPTIONS_LOCKCONTAINER
lock container
Definition: GUIAppEnum.h:744
@ MID_HOTKEY_D_MODES_DELETE
hotkey for mode deleting things
Definition: GUIAppEnum.h:47
@ MID_HOTKEY_T_MODES_TLS_TYPE
hotkey for mode editing TLS AND types
Definition: GUIAppEnum.h:65
@ MID_GNE_NETWORKVIEWOPTIONS_SELECTEDGES
select edges
Definition: GUIAppEnum.h:688
@ MID_GNE_EDGE_SPLIT
split an edge
Definition: GUIAppEnum.h:1054
@ MID_GNE_LANE_TRANSFORM_GREENVERGE
transform lane to greenVerge
Definition: GUIAppEnum.h:1152
@ MID_GNE_CUSTOM_GEOMETRYPOINT
set custom geometry point
Definition: GUIAppEnum.h:875
@ MID_GNE_DEMANDVIEWOPTIONS_SHOWTRIPS
show all trips
Definition: GUIAppEnum.h:736
@ MID_GNE_NETWORKVIEWOPTIONS_TOGGLEGRID
show grid
Definition: GUIAppEnum.h:682
@ MID_GNE_INTERVALBAR_LIMITED
enable/disable show data elements by interval
Definition: GUIAppEnum.h:778
@ MID_GNE_EDGE_EDIT_ENDPOINT
change default geometry endpoints
Definition: GUIAppEnum.h:1042
@ MID_LOCATEROUTE
Locate route - button.
Definition: GUIAppEnum.h:355
@ MID_GNE_POLYGON_DELETE_GEOMETRY_POINT
delete geometry point
Definition: GUIAppEnum.h:1120
@ MID_GNE_CROSSING_EDIT_SHAPE
edit junction shape
Definition: GUIAppEnum.h:1103
@ MID_GNE_POLYGON_OPEN
open closed polygon
Definition: GUIAppEnum.h:1116
@ MID_GNE_POLYGON_SIMPLIFY_SHAPE
simplify polygon geometry
Definition: GUIAppEnum.h:1112
@ MID_REMOVESELECT
Remove from selected items - Menu Etry.
Definition: GUIAppEnum.h:441
GUICompleteSchemeStorage gSchemeStorage
@ MOVEELEMENT
move element cursor
@ MOVEVIEW
move view cursor
@ SELECT_LANE
select lanecursor
@ DEFAULT
default cursor
@ SELECT
select cursor
@ DELETE_CURSOR
delete cursor
@ INSPECT_LANE
inspect lane cursor
@ INSPECT
inspect cursor
#define GUIDesignVerticalSeparator
vertical separator
Definition: GUIDesigns.h:398
GUIGlObjectType
@ GLO_TAZRELDATA
TAZ relation data.
@ 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:290
#define WRITE_ERROR(msg)
Definition: MsgHandler.h:288
#define WRITE_WARNING(msg)
Definition: MsgHandler.h:280
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_EDGEREL
a relation between two edges
@ SUMO_TAG_DATAINTERVAL
@ SUMO_TAG_TAZ
a traffic assignment zone
@ 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_MEANDATA_EDGE
an edge based mean data detector
@ SUMO_TAG_POLY
begin/end of the description of a polygon
@ SUMO_TAG_LANE
begin/end of the description of a single lane
@ SUMO_TAG_DATASET
@ SUMO_TAG_TAZREL
a relation between two TAZs
@ GNE_TAG_ROUTE_EMBEDDED
embedded route (used in NETEDIT)
@ SUMO_TAG_VIEWSETTINGS
@ SUMO_TAG_VIEWPORT
@ SUMO_TAG_TRIP
a single trip definition (used by router)
@ SUMO_TAG_EDGE
begin/end of the description of an edge
@ SUMO_ATTR_LANE
@ GNE_ATTR_OPPOSITE
neighboring lane, simplified lane attr instead of child element
@ SUMO_ATTR_Y
@ GNE_ATTR_PARENT
parent of an additional element
@ SUMO_ATTR_X
@ GNE_ATTR_SELECTED
element is selected
@ SUMO_ATTR_CUSTOMSHAPE
whether a given shape is user-defined
@ SUMO_ATTR_POSITION_LAT
@ SUMO_ATTR_ZOOM
@ SUMO_ATTR_SHAPE
edge: the shape in xml-definition
@ SUMO_ATTR_ANGLE
@ GNE_ATTR_SHAPE_END
last coordinate of edge shape
@ SUMO_ATTR_FRIENDLY_POS
@ SUMO_ATTR_LENGTH
@ GNE_ATTR_SHAPE_START
first coordinate of edge shape
@ SUMO_ATTR_POSITION
const double SUMO_const_laneWidth
Definition: StdDefs.h:48
#define UNUSED_PARAMETER(x)
Definition: StdDefs.h:30
T MIN2(T a, T b)
Definition: StdDefs.h:74
T MAX2(T a, T b)
Definition: StdDefs.h:80
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
Definition: ToString.h:46
void parseSumoBaseObject(CommonXMLStructure::SumoBaseObject *obj)
parse SumoBaseObject (it's called recursivelly)
A class that stores a 2D geometrical boundary.
Definition: Boundary.h:39
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
void addBoolAttribute(const SumoXMLAttr attr, const bool value)
add bool attribute into current SumoBaseObject node
void addDoubleAttribute(const SumoXMLAttr attr, const double value)
add double attribute into current SumoBaseObject node
void addStringAttribute(const SumoXMLAttr attr, const std::string &value)
static void drawLine(const Position &beg, double rot, double visLength)
Draws a thin line.
Definition: GLHelper.cpp:369
static void setColor(const RGBColor &c)
Sets the gl-color to this value.
Definition: GLHelper.cpp:507
static void drawFilledCircle(double width, int steps=8)
Draws a filled circle around (0,0)
Definition: GLHelper.cpp:431
static void drawOutlineCircle(double width, double iwidth, int steps=8)
Draws an unfilled circle around (0,0)
Definition: GLHelper.cpp:455
static void popMatrix()
pop matrix
Definition: GLHelper.cpp:123
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:277
static void pushMatrix()
push matrix
Definition: GLHelper.cpp:114
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:609
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
Builds additional objects for GNENet (busStops, chargingStations, detectors, etc.....
An Element which don't belongs to GNENet but has influency in the simulation.
Definition: GNEAdditional.h:48
virtual void openAdditionalDialog()
open Additional Dialog
GNEApplicationWindowHelper::EditMenuCommands & getEditMenuCommands()
getEdit Menu Commands (needed for show/hide menu commands)
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 tagProperty associated with this Attribute Carrier
void unselectAttributeCarrier(const bool changeFlag=true)
unselect attribute carrier using GUIGlobalSelection
void selectAttributeCarrier(const bool changeFlag=true)
select attribute carrier using GUIGlobalSelection
virtual std::string getAttribute(SumoXMLAttr key) const =0
the function-object for an editing operation (abstract base)
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 show()
show Frame
bool addContainer(const GNEViewNetHelper::ObjectsUnderCursor &objectsUnderCursor, const GNEViewNetHelper::MouseButtonKeyPressed &mouseButtonKeyPressed)
add vehicle element
GNEFrameModules::PathCreator * getPathCreator() const
get PathCreator modul
GNEFrameModules::PathCreator * getPathCreator() const
get path creator modul
bool addContainerPlanElement(const GNEViewNetHelper::ObjectsUnderCursor &objectsUnderCursor, const GNEViewNetHelper::MouseButtonKeyPressed &mouseButtonKeyPressed)
add container plan element
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:42
GNEJunction * getParentJunction() const
get parent Junction
NBNode::Crossing * getNBCrossing() const
get referente to NBode::Crossing
An Element which don't belongs to GNENet but has influency in the simulation.
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.
bool addEdgeData(const GNEViewNetHelper::ObjectsUnderCursor &objectsUnderCursor, const GNEViewNetHelper::MouseButtonKeyPressed &mouseButtonKeyPressed)
add additional element
A road/street connecting two junctions (netedit-version)
Definition: GNEEdge.h:53
GNEEdge * getOppositeEdge() const
get opposite edge
Definition: GNEEdge.cpp:384
void smooth(GNEUndoList *undoList)
make geometry smooth
Definition: GNEEdge.cpp:2060
NBEdge * getNBEdge() const
returns the internal NBEdge
Definition: GNEEdge.cpp:435
void smoothElevation(GNEUndoList *undoList)
smooth elevation with regard to adjoining edges
Definition: GNEEdge.cpp:2072
const std::vector< GNELane * > & getLanes() const
returns a reference to the lane vector
Definition: GNEEdge.cpp:782
void editEndpoint(Position pos, GNEUndoList *undoList)
makes pos the new geometry endpoint at the appropriate end, or remove current existent endpoint
Definition: GNEEdge.cpp:455
Position getSplitPos(const Position &clickPos)
Definition: GNEEdge.cpp:441
void straightenElevation(GNEUndoList *undoList)
interpolate z values linear between junctions
Definition: GNEEdge.cpp:1977
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
Definition: GNEEdge.cpp:894
void resetEndpoint(const Position &pos, GNEUndoList *undoList)
restores the endpoint to the junction position at the appropriate end
Definition: GNEEdge.cpp:503
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 setDeleteLastCreatedPoint(bool value)
enable or disable delete last created point
void stopDrawing()
stop drawing and check if shape can be created
bool getDeleteLastCreatedPoint()
get flag delete last created point
const PositionVector & getTemporalShape() const
get Temporal shape
bool isDrawing() const
return true if currently a shape is drawed
bool overlappedInspectionShown() const
check if overlappedInspection modul is shown
bool checkSavedPosition(const Position &clickedPosition) const
check if given position is near to saved position
void abortPathCreation()
abort path creation
void removeLastElement()
remove path element
void drawTemporalRoute(const GUIVisualizationSettings &s) const
draw temporal route
GNEFrameModules::PathCreator * getPathCreator() const
get PathCreator modul
An Element which don't belongs to GNENet but has influency in the simulation.
Dialog to edit sequences, parameters, etc.. of Additionals.
const std::vector< GNEDemandElement * > & getParentDemandElements() const
get parent demand elements
void inspectSingleElement(GNEAttributeCarrier *AC)
Inspect a single element.
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
GNEFrameModules::OverlappedInspection * getOverlappedInspection() const
get OverlappedInspection modul
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.
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:46
const PositionVector & getLaneShape() const
get elements shape
Definition: GNELane.cpp:131
int getIndex() const
returns the index of the lane
Definition: GNELane.cpp:797
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
Definition: GNELane.cpp:907
GNEEdge * getParentEdge() const
get arent edge
Definition: GNELane.cpp:113
virtual void removeGeometryPoint(const Position clickedPosition, GNEUndoList *undoList)=0
remove geometry point in the clicked position
void show()
show prohibition frame
GNEAttributeCarrier * retrieveAttributeCarrier(const GUIGlID id, bool hardFail=true) const
get a single attribute carrier based on a GLID
const std::map< SumoXMLTag, std::set< GNEGenericData * > > & getGenericDatas() const
get all generic datas
const std::set< GNELane * > & getLanes() const
get lanes
GNETAZElement * retrieveTAZElement(SumoXMLTag type, const std::string &id, bool hardFail=true) const
Returns the named TAZElement.
GNELane * retrieveLane(const std::string &id, bool hardFail=true, bool checkVolatileChange=false) const
get lane by id
const std::map< SumoXMLTag, std::set< GNEDemandElement * > > & getDemandElements() const
get demand elements
GNEShape * retrieveShape(SumoXMLTag, const std::string &id, bool hardFail=true) const
Returns the named shape.
GNEAdditional * retrieveAdditional(SumoXMLTag type, const std::string &id, bool hardFail=true) const
Returns the named additional.
bool isNetworkElementAroundShape(GNEAttributeCarrier *AC, const PositionVector &shape) const
check if shape of given AC (network element) is around the given shape
GNEJunction * retrieveJunction(const std::string &id, bool hardFail=true) const
get junction by id
GNEDataSet * retrieveDataSet(const std::string &id, bool hardFail=true) const
Returns the named data set.
GNEDataInterval * retrieveDataInterval(GNEAttributeCarrier *AC, bool hardFail=true) const
Returns the data interval.
std::vector< GNELane * > getSelectedLanes() const
get selected lanes
const std::map< std::string, GNEEdge * > & getEdges() const
map with the ID and pointer to edges of net
std::vector< GNEJunction * > getSelectedJunctions() const
return selected junctions
std::vector< GNEShape * > getSelectedShapes()
get selected shapes
GNEEdge * retrieveEdge(const std::string &id, bool hardFail=true) const
get edge by id
std::vector< GNEEdge * > getSelectedEdges() const
return all edges
const std::map< std::string, GNEJunction * > & getJunctions() const
get junctions
GNECrossing * retrieveCrossing(GNEAttributeCarrier *AC, bool hardFail=true) const
get Crossing by AC
GNEDemandElement * retrieveDemandElement(SumoXMLTag type, const std::string &id, bool hardFail=true) const
Returns the named demand element.
GNEGenericData * retrieveGenericData(GNEAttributeCarrier *AC, bool hardFail=true) const
Returns the generic data.
std::vector< GNEAttributeCarrier * > getSelectedAttributeCarriers(const bool ignoreCurrentSupermode)
get all selected attribute carriers (or only relative to current supermode
GNEConnection * retrieveConnection(const std::string &id, bool hardFail=true) const
get Connection by id
A NBNetBuilder extended by visualisation and editing capabilities.
Definition: GNENet.h:42
void deleteEdge(GNEEdge *edge, GNEUndoList *undoList, bool recomputeConnections)
removes edge
Definition: GNENet.cpp:368
void deleteLane(GNELane *lane, GNEUndoList *undoList, bool recomputeConnections)
removes lane
Definition: GNENet.cpp:502
void deleteCrossing(GNECrossing *crossing, GNEUndoList *undoList)
remove crossing
Definition: GNENet.cpp:561
SUMORTree & getGrid()
Returns the RTree used for visualisation speed-up.
Definition: GNENet.cpp:144
void deleteAdditional(GNEAdditional *additional, GNEUndoList *undoList)
remove additional
Definition: GNENet.cpp:579
void reverseEdge(GNEEdge *edge, GNEUndoList *undoList)
reverse edge
Definition: GNENet.cpp:970
GNEEdge * addReversedEdge(GNEEdge *edge, GNEUndoList *undoList)
add reversed edge
Definition: GNENet.cpp:983
void deleteTAZElement(GNETAZElement *TAZElement, GNEUndoList *undoList)
remove TAZElement
Definition: GNENet.cpp:609
bool restrictLane(SUMOVehicleClass vclass, GNELane *lane, GNEUndoList *undoList)
transform lane to restricted lane
Definition: GNENet.cpp:728
GNEJunction * splitEdge(GNEEdge *edge, const Position &pos, GNEUndoList *undoList, GNEJunction *newJunction=0)
split edge at position by inserting a new junction
Definition: GNENet.cpp:830
void deleteDemandElement(GNEDemandElement *demandElement, GNEUndoList *undoList)
remove demand element
Definition: GNENet.cpp:630
void duplicateLane(GNELane *lane, GNEUndoList *undoList, bool recomputeConnections)
duplicates lane
Definition: GNENet.cpp:712
void computeAndUpdate(OptionsCont &oc, bool volatileOptions)
recompute the network and update lane geometries
Definition: GNENet.cpp:2547
void deleteDataInterval(GNEDataInterval *dataInterval, GNEUndoList *undoList)
remove data interval
Definition: GNENet.cpp:669
void deleteConnection(GNEConnection *connection, GNEUndoList *undoList)
remove connection
Definition: GNENet.cpp:546
void resetJunctionConnections(GNEJunction *junction, GNEUndoList *undoList)
reset junction's connections
Definition: GNENet.cpp:1895
void deleteGenericData(GNEGenericData *genericData, GNEUndoList *undoList)
remove generic data
Definition: GNENet.cpp:682
GNENetHelper::AttributeCarriers * getAttributeCarriers() const
get all attribute carriers used in this net
Definition: GNENet.cpp:125
void splitEdgesBidi(GNEEdge *edge, GNEEdge *oppositeEdge, const Position &pos, GNEUndoList *undoList)
split all edges at position by inserting one new junction
Definition: GNENet.cpp:947
void deleteShape(GNEShape *shape, GNEUndoList *undoList)
remove shape
Definition: GNENet.cpp:600
bool removeRestrictedLane(SUMOVehicleClass vclass, GNEEdge *edge, GNEUndoList *undoList)
remove restricted lane
Definition: GNENet.cpp:816
void mergeJunctions(GNEJunction *moved, GNEJunction *target, GNEUndoList *undoList)
merge the given junctions edges between the given junctions will be deleted
Definition: GNENet.cpp:1018
bool addRestrictedLane(SUMOVehicleClass vclass, GNEEdge *edge, int index, GNEUndoList *undoList)
add restricted lane to edge
Definition: GNENet.cpp:763
bool addGreenVergeLane(GNEEdge *edge, int index, GNEUndoList *undoList)
add restricted lane to edge
Definition: GNENet.cpp:799
void deleteDataSet(GNEDataSet *dataSet, GNEUndoList *undoList)
remove data set
Definition: GNENet.cpp:656
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:1799
void selectRoundabout(GNEJunction *junction, GNEUndoList *undoList)
select all roundabout edges and junctions for the current roundabout
Definition: GNENet.cpp:1051
void replaceJunctionByGeometry(GNEJunction *junction, GNEUndoList *undoList)
replace the selected junction by geometry node(s) and merge the edges
Definition: GNENet.cpp:1745
GNEPathManager * getPathManager()
get path manager
Definition: GNENet.cpp:131
void createRoundabout(GNEJunction *junction, GNEUndoList *undoList)
transform the given junction into a roundabout
Definition: GNENet.cpp:1070
void requireRecompute()
inform the net about the need for recomputation
Definition: GNENet.cpp:1341
void initGNEConnections()
initialize GNEConnections
Definition: GNENet.cpp:2534
void deleteJunction(GNEJunction *junction, GNEUndoList *undoList)
removes junction and all incident edges
Definition: GNENet.cpp:327
NBEdgeCont & getEdgeCont()
returns the NBEdgeCont of the underlying netbuilder
Definition: GNENet.cpp:1976
GNEViewNet * getViewNet() const
get view net
Definition: GNENet.cpp:1964
void clearJunctionConnections(GNEJunction *junction, GNEUndoList *undoList)
clear junction's connections
Definition: GNENet.cpp:1883
void computeDemandElements(GNEApplicationWindow *window)
compute demand elements param[in] window The window to inform about delay
Definition: GNENet.cpp:1290
bool isShapeEdited() const
check if shape is being edited
const std::string & getID() const
get ID
Definition: GNEPOI.h:43
void calculateReachability(const SUMOVehicleClass vClass, GNEEdge *originEdge)
calculate reachability for given edge
void clearPathDraw()
clear path draw
PathCalculator * getPathCalculator()
obtain instance of PathCalculator
PathDraw * getPathDraw()
obtain instance of PathDraw
bool addPerson(const GNEViewNetHelper::ObjectsUnderCursor &objectsUnderCursor, const GNEViewNetHelper::MouseButtonKeyPressed &mouseButtonKeyPressed)
add vehicle element
void show()
show Frame
GNEFrameModules::PathCreator * getPathCreator() const
get PathCreator modul
bool addPersonPlanElement(const GNEViewNetHelper::ObjectsUnderCursor &objectsUnderCursor, const GNEViewNetHelper::MouseButtonKeyPressed &mouseButtonKeyPressed)
add person plan element
void show()
show Frame
GNEFrameModules::PathCreator * getPathCreator() const
get path creator modul
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:357
void changeFirstGeometryPoint(int oldIndex, bool allowUndo=true)
change first geometry point
Definition: GNEPoly.cpp:456
void deleteGeometryPoint(const Position &pos, bool allowUndo=true)
delete the geometry point closest to the given pos
Definition: GNEPoly.cpp:373
void simplifyShape(bool allowUndo=true)
replace the current shape with a rectangle
Definition: GNEPoly.cpp:496
void openPolygon(bool allowUndo=true)
open polygon
Definition: GNEPoly.cpp:414
bool processClick(const Position &clickedPosition, const GNEViewNetHelper::ObjectsUnderCursor &objectsUnderCursor, bool &updateTemporalShape)
process click over Viewnet
void show()
show Frame
GNEFrameModules::DrawingShape * getDrawingShapeModule() const
get drawing mode editor
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
GNEFrameModules::PathCreator * getPathCreator() const
get path creator modul
bool addEdgeRoute(GNEEdge *clickedEdge, const GNEViewNetHelper::MouseButtonKeyPressed &mouseButtonKeyPressed)
add route edge
void updateInformationLabel()
update information label
void show()
show Frame
void clearCurrentSelection() const
clear current selection with possibility of undo/redo
SelectionInformation * getSelectionInformation() const
getmodul for selection information
void show()
show Frame
bool addStop(const GNEViewNetHelper::ObjectsUnderCursor &objectsUnderCursor, const GNEViewNetHelper::MouseButtonKeyPressed &mouseButtonKeyPressed)
add Stop element
An Element which don't belongs to GNENet but has influency in the simulation.
Definition: GNETAZElement.h:45
void setTAZ(GNETAZ *editedTAZ)
set current TAZ
GNETAZ * getTAZ() const
get current TAZ
bool isChangesPending() const
return true if there is changes to save
long onCmdSaveChanges(FXObject *, FXSelector, void *)
TAZSaveChanges * getTAZSaveChangesModule() const
get TAZ Save Changes modul
GNEFrameModules::DrawingShape * getDrawingShapeModule() const
get drawing mode modul
bool processClick(const Position &clickedPosition, const GNEViewNetHelper::ObjectsUnderCursor &objectsUnderCursor)
process click over Viewnet
CurrentTAZ * getCurrentTAZModule() const
get Current TAZ modul
void processEdgeSelection(const std::vector< GNEEdge * > &edges)
process selection of edges in view net
Definition: GNETAZ.h:34
bool setTAZ(const GNEViewNetHelper::ObjectsUnderCursor &objectsUnderCursor)
set clicked TAZ
void buildTAZRelationData()
build TAZRelation data
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 isContainer() const
return true if tag correspond to a container element
bool isSelectable() const
return true if tag correspond to a selectable element
bool isPlacedInRTree() const
return true if Tag correspond to an element that has has to be placed in RTREE
SumoXMLTag getTag() const
get Tag vinculated with this attribute Property
bool hasDialog() const
return true if tag correspond to an element that can be edited using a dialog
bool isPerson() const
return true if tag correspond to a person element
void show()
show Frame
void end()
End undo command sub-group. If the sub-group is still empty, it will be deleted; otherwise,...
void begin(GUIIcon icon, const std::string &description)
Begin undo command sub-group with current supermode. This begins a new group of commands that are tre...
void abortAllChangeGroups()
reverts and discards ALL active chained change groups
void changeAttribute(GNEChange_Attribute *change)
special method for change attributes, avoid empty changes, always execute
GNEFrameModules::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
void updateLockMenuBar()
update lock inspect menuBar
bool isObjectLocked(GUIGlObjectType objectType, const bool selected) const
check if given GLObject is locked for inspect, select, delete and move
class used to group all variables related with objects under cursor after a click over view
void 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:581
long onCmdToggleShowDemandElementsNetwork(FXObject *, FXSelector, void *)
toggle show demand elements (network)
long onCmdClosePolygon(FXObject *, FXSelector, void *)
close opened polygon
long onCmdEditCrossingShape(FXObject *, FXSelector, void *)
edit crossing shape
void processMoveMouseNetwork(const bool mouseLeftButtonPressed)
process move mouse function in Supermode Network
const GNEViewNetHelper::DataViewOptions & getDataViewOptions() const
get data view options
Definition: GNEViewNet.cpp:537
GNENet * getNet() const
get the net object
void deleteNetworkAttributeCarriers(const std::vector< GNEAttributeCarrier * > ACs)
delete given network attribute carriers
long onCmdSetFirstGeometryPoint(FXObject *, FXSelector, void *)
set as first geometry point the closes geometry point
GNEViewNetHelper::CommonCheckableButtons myCommonCheckableButtons
variable used to save checkable buttons for common supermodes
Definition: GNEViewNet.h:527
long onMouseMove(FXObject *, FXSelector, void *)
called when user moves mouse
const GNEAttributeCarrier * getFrontAttributeCarrier() const
get front attributeCarrier
void hotkeyBackSpace()
handle backspace keypress
const GNEViewNetHelper::EditModes & getEditModes() const
get edit modes
Definition: GNEViewNet.cpp:513
long onCmdAddSelected(FXObject *, FXSelector, void *)
select AC under cursor
const GNEViewNetHelper::EditNetworkElementShapes & getEditNetworkElementShapes() const
get Edit Shape modul
Definition: GNEViewNet.cpp:549
void setFrontAttributeCarrier(GNEAttributeCarrier *AC)
set front attributeCarrier
GNECrossing * getCrossingAtPopupPosition()
try to retrieve a crossing at popup position
void buildViewToolBars(GUIGlChildWindow *v)
builds the view toolbars
Definition: GNEViewNet.cpp:294
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:543
void updateCursor()
update cursor after every click/key press/release
void updateDataModeSpecificControls()
updates Data mode specific controls
GNEEdge * getEdgeAtPopupPosition()
try to retrieve an edge at popup position
long onCmdToggleShowDemandElementsData(FXObject *, FXSelector, void *)
toggle show demand elements (data)
GNEViewNetHelper::EditModes myEditModes
variable used to save variables related with edit moves modes
Definition: GNEViewNet.h:507
long onCmdReplaceJunction(FXObject *, FXSelector, void *)
replace node by geometry
long onCmdSplitJunction(FXObject *, FXSelector, void *)
split junction into multiple junctions
long onCmdClearConnections(FXObject *, FXSelector, void *)
clear junction connections
void abortOperation(bool clearSelection=true)
abort current edition operation
long onCmdToggleTAZDrawFill(FXObject *, FXSelector, void *)
toggle TAZdrawFill
long onCmdResetEndPoints(FXObject *, FXSelector, void *)
reset edge end points
GNEViewNetHelper::TestingMode myTestingMode
variable used to save variables related with testing mode
Definition: GNEViewNet.h:510
long onCmdToggleWarnAboutMerge(FXObject *, FXSelector, void *)
toggle warn for merge
long onCmdToggleDrawSpreadVehicles(FXObject *, FXSelector, void *)
toggle draw vehicles in begin position or spread in lane
GNEPOI * getPOIAtPopupPosition()
try to retrieve a POILane at popup position
GNEViewNetHelper::SelectingArea mySelectingArea
variable used to save variables related with selecting areas
Definition: GNEViewNet.h:578
long onCmdToggleShowConnections(FXObject *, FXSelector, void *)
toggle show connections
long onCmdLaneReachability(FXObject *, FXSelector sel, void *)
show lane reachability
GNEViewNetHelper::NetworkCheckableButtons myNetworkCheckableButtons
variable used to save checkable buttons for Supermode Network
Definition: GNEViewNet.h:530
bool removeRestrictedLane(SUMOVehicleClass vclass)
remove restricted lane
std::vector< std::string > getEdgeDataAttrs() const
return list of loaded edgeData attributes
Definition: GNEViewNet.cpp:785
void processClick(void *eventData)
Auxiliar function used by onLeftBtnPress(...)
GNEViewNetHelper::MoveSingleElementValues myMoveSingleElementValues
Definition: GNEViewNet.h:558
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
GNEAttributeCarrier * myFrontAttributeCarrier
front attribute carrier
Definition: GNEViewNet.h:602
GNEViewNetHelper::MouseButtonKeyPressed myMouseButtonKeyPressed
variable used to save key status after certain events
Definition: GNEViewNet.h:517
void recalculateBoundaries()
recalculate boundaries
Definition: GNEViewNet.cpp:261
GNEViewNetHelper::IntervalBar myIntervalBar
variable used to save IntervalBar
Definition: GNEViewNet.h:553
GNEViewParent * myViewParent
view parent
Definition: GNEViewNet.h:587
bool showJunctionAsBubbles() const
return true if junction must be showed as bubbles
Definition: GNEViewNet.cpp:653
bool changeAllPhases() const
change all phases
Definition: GNEViewNet.cpp:647
long onCmdEditJunctionShape(FXObject *, FXSelector, void *)
edit junction shape
long onCmdToggleMoveElevation(FXObject *, FXSelector, void *)
toggle move elevation
long onCmdToggleShowAllPersonPlans(FXObject *, FXSelector, void *)
toggle show all person plans in super mode demand
bool setColorScheme(const std::string &name)
set color scheme
Definition: GNEViewNet.cpp:443
int doPaintGL(int mode, const Boundary &bound)
do paintGL
Definition: GNEViewNet.cpp:813
long onCmdOpenAdditionalDialog(FXObject *, FXSelector, void *)
open additional dialog
long onCmdToggleTAZRelOnlyTo(FXObject *, FXSelector, void *)
toggle TAZRez only to
const GNEViewNetHelper::NetworkViewOptions & getNetworkViewOptions() const
get network view options
Definition: GNEViewNet.cpp:525
void hotkeyFocusFrame()
handle focus frame keypress
long onCmdToggleChainEdges(FXObject *, FXSelector, void *)
toggle chain edges
GNEViewNetHelper::DemandViewOptions myDemandViewOptions
variable used to save variables related with view options in supermode Demand
Definition: GNEViewNet.h:546
std::vector< std::string > getEdgeLaneParamKeys(bool edgeKeys) const
return list of available edge parameters
Definition: GNEViewNet.cpp:753
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:593
bool autoSelectNodes()
whether to autoselect nodes or to lanes
Definition: GNEViewNet.cpp:635
long onCmdToggleLockContainer(FXObject *, FXSelector, void *)
toggle lock container in super mode demand
GNEUndoList * myUndoList
a reference to the undolist maintained in the application
Definition: GNEViewNet.h:596
void drawTranslateFrontAttributeCarrier(const GNEAttributeCarrier *AC, double typeOrLayer, const double extraOffset=0)
draw front attributeCarrier
GNEViewNetHelper::NetworkViewOptions myNetworkViewOptions
variable used to save variables related with view options in supermode Network
Definition: GNEViewNet.h:543
void doInit()
called after some features are already initialized
Definition: GNEViewNet.cpp:290
void buildEditModeControls()
create edit mode buttons and elements
GNEViewNetHelper::DataCheckableButtons myDataCheckableButtons
variable used to save checkable buttons for Supermode Data
Definition: GNEViewNet.h:536
long onCmdToggleShowGrid(FXObject *, FXSelector, void *)
toggle show grid
void processLeftButtonPressDemand(void *eventData)
process left button press function in Supermode Demand
GNEViewNetHelper::IntervalBar & getIntervalBar()
get interval bar
long onCmdEditLaneShape(FXObject *, FXSelector, void *)
edit lane shape
long onCmdToggleHideNonInspecteDemandElements(FXObject *, FXSelector, void *)
toggle hide non inspected demand elements
GNEViewParent * getViewParent() const
get the net object
long onCmdAddReversedEdge(FXObject *, FXSelector, void *)
add reversed edge
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:555
long onCmdIntervalBarGenericDataType(FXObject *, FXSelector, void *)
change generic data type in interval bar
long onCmdConvertRoundabout(FXObject *, FXSelector, void *)
convert junction to roundabout
long onCmdRemoveEdgeSelected(FXObject *, FXSelector, void *)
unselect Edge under cursor
long onCmdToggleShowShapes(FXObject *, FXSelector, void *)
toggle show shapes in super mode data
long onRightBtnPress(FXObject *, FXSelector, void *)
called when user press mouse's right button
Definition: GNEViewNet.cpp:992
long onCmdOpenPolygon(FXObject *, FXSelector, void *)
open closed polygon
long onCmdSetCustomGeometryPoint(FXObject *, FXSelector, void *)
set custom geometry point
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:519
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:485
GNEViewNetHelper::SaveElements mySaveElements
variable used to save elements
Definition: GNEViewNet.h:575
GNEViewNetHelper::LockManager myLockManager
lock manager
Definition: GNEViewNet.h:584
long onCmdAddEdgeSelected(FXObject *, FXSelector, void *)
select Edge under cursor
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 onCmdToggleExtendSelection(FXObject *, FXSelector, void *)
toggle extend selection
GNEViewNetHelper::DemandCheckableButtons myDemandCheckableButtons
variable used to save checkable buttons for Supermode Demand
Definition: GNEViewNet.h:533
bool aksChangeSupermode(const std::string &operation, Supermode expectedSupermode)
ask about change supermode
Definition: GNEViewNet.cpp:697
GNETAZ * getTAZAtPopupPosition()
try to retrieve a TAZ at popup position
long onCmdSetMode(FXObject *, FXSelector sel, void *)
called when user press a mode button (Network or demand)
long onCmdResetEdgeEndpoint(FXObject *, FXSelector, void *)
change geometry endpoint
long onCmdIntervalBarSetBegin(FXObject *, FXSelector, void *)
change begin in interval bar
long onCmdResetLength(FXObject *, FXSelector, void *)
reset custom edge lengths
long onCmdSelectPolygonElements(FXObject *, FXSelector, void *)
select elements within polygon boundary
long onLeftBtnRelease(FXObject *, FXSelector, void *)
called when user releases mouse's left button
Definition: GNEViewNet.cpp:964
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:599
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:379
const std::vector< GNEAttributeCarrier * > & getInspectedAttributeCarriers() const
get inspected attribute carriers
long onKeyPress(FXObject *o, FXSelector sel, void *data)
called when user press a key
long onCmdToggleShowOverlappedRoutes(FXObject *, FXSelector, void *)
toggle hide non inspected demand elements
long onCmdToggleAutoOppositeEdge(FXObject *, FXSelector, void *)
toggle autoOpposite edge
long onCmdSplitEdge(FXObject *, FXSelector, void *)
split edge at cursor position
GNEViewNetHelper::LockManager & getLockManager()
get lock manager
void openObjectDialogAtCursor()
open object dialog
Definition: GNEViewNet.cpp:459
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:659
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:257
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:432
void hotkeyDel()
handle del keypress
long onCmdToggleChangeAllPhases(FXObject *, FXSelector, void *)
toggle change all phases
bool isAttributeCarrierInspected(const GNEAttributeCarrier *AC) const
check if attribute carrier is being inspected
GNEViewNet()
FOX needs this.
Definition: GNEViewNet.cpp:724
long onCmdToggleTAZRelDrawing(FXObject *, FXSelector, void *)
toggle TAZRel drawing
long onCmdToggleShowJunctionBubbles(FXObject *, FXSelector, void *)
toggle show junction bubbles
long onCmdToggleShowAdditionalSubElements(FXObject *, FXSelector, void *)
toggle show additional sub-elements
long onCmdSmoothEdgesElevation(FXObject *, FXSelector, void *)
smooth elevation with regard to adjoining edges
long onCmdToggleShowAllContainerPlans(FXObject *, FXSelector, void *)
toggle show all container plans in super mode demand
long onCmdResetJunctionShape(FXObject *, FXSelector, void *)
reset junction shape
long onCmdToggleTAZRelOnlyFrom(FXObject *, FXSelector, void *)
toggle TAZRez only from
long onRightBtnRelease(FXObject *, FXSelector, void *)
called when user releases mouse's right button
long onCmdReverseEdge(FXObject *, FXSelector, void *)
reverse edge
void deleteDataAttributeCarriers(const std::vector< GNEAttributeCarrier * > ACs)
delete data attribute carriers
void processLeftButtonReleaseData()
process left button release function in Supermode Data
long onCmdToggleShowAdditionals(FXObject *, FXSelector, void *)
toggle show additionals in super mode data
long onCmdToggleLockPerson(FXObject *, FXSelector, void *)
toggle lock person in super mode demand
GNENet * myNet
Pointer to current net. (We are not responsible for deletion)
Definition: GNEViewNet.h:590
GNEPoly * getPolygonAtPopupPosition()
try to retrieve a polygon at popup position
long onCmdToggleSelectEdges(FXObject *, FXSelector, void *)
toggle select edges
GNEViewNetHelper::DataViewOptions myDataViewOptions
variable used to save variables related with view options in supermode Data
Definition: GNEViewNet.h:549
long onCmdToggleShowTrips(FXObject *, FXSelector, void *)
toggle show all trips in super mode demand
long onCmdToggleHideShapes(FXObject *, FXSelector, void *)
toggle hide shapes in super mode demand
long onCmdEditEdgeEndpoint(FXObject *, FXSelector, void *)
change geometry endpoint
const GNEViewNetHelper::DemandViewOptions & getDemandViewOptions() const
get demand view options
Definition: GNEViewNet.cpp:531
const GNEViewNetHelper::ObjectsUnderCursor & getObjectsUnderCursor() const
get objects under cursor
Definition: GNEViewNet.cpp:420
GNEViewNetHelper::MoveMultipleElementValues myMoveMultipleElementValues
variable used to save variables related with movement of multiple elements
Definition: GNEViewNet.h:561
void deleteDemandAttributeCarriers(const std::vector< GNEAttributeCarrier * > ACs)
delete given demand attribute carriers
void updateViewNet() const
Mark the entire GNEViewNet to be repainted later.
Definition: GNEViewNet.cpp:372
GNEViewNetHelper::ObjectsUnderCursor myObjectsUnderCursor
variable use to save all pointers to objects under cursor after a click
Definition: GNEViewNet.h:520
long onCmdToggleHideConnections(FXObject *, FXSelector, void *)
toggle hide connections
bool restrictLane(SUMOVehicleClass vclass)
restrict lane
std::set< std::pair< std::string, GNEAttributeCarrier * > > getAttributeCarriersInBoundary(const Boundary &boundary, bool forceSelectEdges=false)
get AttributeCarriers in Boundary
Definition: GNEViewNet.cpp:385
long onKeyRelease(FXObject *o, FXSelector sel, void *data)
called when user release a key
long onCmdResetConnections(FXObject *, FXSelector, void *)
reset junction connections
void setInspectedAttributeCarriers(const std::vector< GNEAttributeCarrier * > ACs)
set inspected attributeCarrier
long onCmdResetLaneCustomShape(FXObject *, FXSelector, void *)
reset custom shapes of selected lanes
void setStatusBarText(const std::string &text)
set staturBar text
Definition: GNEViewNet.cpp:629
void processMoveMouseDemand(const bool mouseLeftButtonPressed)
process move mouse function in Supermode Demand
long onCmdResetOppositeLane(FXObject *, FXSelector, void *)
reset oppositeLane of current lane
void setSelectorFrameScale(double selectionScale)
set selection scaling (in GNESelectorFrame)
Definition: GNEViewNet.cpp:641
long onCmdEditConnectionShape(FXObject *, FXSelector, void *)
edit connection shape
const GNEViewNetHelper::MoveMultipleElementValues & getMoveMultipleElementValues() const
get move multiple element values
Definition: GNEViewNet.cpp:426
bool addRestrictedLane(SUMOVehicleClass vclass, const bool insertAtFront)
add restricted lane
void updateDemandModeSpecificControls()
updates Demand mode specific controls
GNEAdditional * getAdditionalAtPopupPosition()
try to retrieve a additional at popup position
void drawTemporalJunction() const
draw temporal junction in create edge mode
long onCmdSelectRoundabout(FXObject *, FXSelector, void *)
select all roundabout nodes and edges
long onLeftBtnPress(FXObject *, FXSelector, void *)
Definition: GNEViewNet.cpp:936
std::vector< std::string > getRelDataAttrs() const
return list of loaded edgeRelation and tazRelation attributes
Definition: GNEViewNet.cpp:797
long onCmdIntervalBarLimit(FXObject *, FXSelector, void *)
change limit interval in interval bar
A single child window which contains a view of the simulation area.
Definition: GNEViewParent.h:82
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
GNEContainerPlanFrame * getContainerPlanFrame() const
get frame for DEMAND_CONTAINERFRAME
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
GNETypeFrame * getTypeFrame() const
get frame for DEMAND_VEHICLETYPE
GNETAZFrame * getTAZFrame() const
get frame for NETWORK_TAZ
GNETLSEditorFrame * getTLSEditorFrame() const
get frame for NETWORK_TLS
GNEApplicationWindow * getGNEAppWindows() const
get GNE Application Windows
GNEContainerFrame * getContainerFrame() const
get frame for DEMAND_CONTAINER
GNEAdditionalFrame * getAdditionalFrame() const
get frame for NETWORK_ADDITIONAL
GNEPersonFrame * getPersonFrame() const
get frame for DEMAND_PERSON
GNEInspectorFrame * getInspectorFrame() const
get frame for inspect elements
GNEEdgeRelDataFrame * getEdgeRelDataFrame() const
get frame for DATA_EDGERELDATA
GNECreateEdgeFrame * getCreateEdgeFrame() const
get frame for NETWORK_CREATEEDGE
GNERouteFrame * getRouteFrame() const
get frame for DEMAND_ROUTE
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:42
std::string getCurrentScheme() const
Returns the name of the currently chosen scheme.
void setCurrentScheme(const std::string &)
Sets the named scheme as the current.
The popup menu of a globject.
static void drawGeometry(const GUIVisualizationSettings &s, const Position &mousePos, const GUIGeometry &geometry, const double width, double offset=0)
draw geometry
static double calculateRotation(const Position &first, const Position &second)
return angle between two points (used in geometric calculations)
void updateGeometry(const PositionVector &shape)
update entire geometry
Definition: GUIGeometry.cpp:58
static double calculateLength(const Position &first, const Position &second)
return length between two points (used in geometric calculations)
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 void drawGL(const GUIVisualizationSettings &s) const =0
Draws the object.
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:99
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.
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 *)
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.
virtual long onPaint(FXObject *, FXSelector, void *)
virtual long onRightBtnPress(FXObject *, FXSelector, void *)
void openObjectDialog(GUIGlObject *o)
open object dialog for the given object
static void resetTextures()
Reset textures.
Stores the information about how to visualize structures.
GUIVisualizationSizeSettings junctionSize
bool drawForRectangleSelection
whether drawing is performed for the purpose of selecting objects using a rectangle
std::string name
The name of this setting.
bool 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
const PositionVector & getGeometry() const
Returns the geometry of the edge.
Definition: NBEdge.h:752
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:1220
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:2418
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:61
void close()
Closes the device and removes it from the dictionary.
OutputDevice & openTag(const std::string &xmlElement)
Opens an XML tag.
OutputDevice & writeAttr(const SumoXMLAttr attr, const T &val)
writes a named attribute
Definition: OutputDevice.h:248
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.
Definition: GUI.h:31
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:37
double distanceTo(const Position &p2) const
returns the euclidean distance in 3 dimension
Definition: Position.h:242
double distanceSquaredTo(const Position &p2) const
returns the square of the distance to another position
Definition: Position.h:247
double x() const
Returns the x-position.
Definition: Position.h:55
double y() const
Returns the y-position.
Definition: Position.h:60
A list of positions.
Position positionAtOffset(double pos, double lateralOffset=0) const
Returns the position at the given length.
double nearest_offset_to_point2D(const Position &p, bool perpendicular=true) const
return the nearest offest to point 2D
int indexOfClosest(const Position &p, bool twoD=false) const
void move2side(double amount, double maxExtension=100)
move position vector to side using certain ammount
Boundary getBoxBoundary() const
Returns a boundary enclosing this list of lines.
void pop_front()
pop first Position
void setAlpha(unsigned char alpha)
Sets a new alpha value.
Definition: RGBColor.cpp:108
static const RGBColor BLUE
Definition: RGBColor.h:187
static const RGBColor YELLOW
Definition: RGBColor.h:188
static const RGBColor ORANGE
Definition: RGBColor.h:191
static const RGBColor CYAN
Definition: RGBColor.h:189
static const RGBColor GREEN
Definition: RGBColor.h:186
static RGBColor fromHSV(double h, double s, double v)
Converts the given hsv-triplet to rgb, inspired by http://alvyray.com/Papers/CG/hsv2rgb....
Definition: RGBColor.cpp:368
static const RGBColor BLACK
Definition: RGBColor.h:193
static const RGBColor MAGENTA
Definition: RGBColor.h:190
static const RGBColor RED
named colors
Definition: RGBColor.h:185
const PositionVector & getShape() const
Returns whether the shape of the polygon.
Definition: SUMOPolygon.cpp:52
void addAdditionalGLObject(GUIGlObject *o, const double exaggeration=1)
Adds an additional object (detector/shape/trigger) for visualisation.
Definition: SUMORTree.h:124
void removeAdditionalGLObject(GUIGlObject *o, const double exaggeration=1)
Removes an additional object (detector/shape/trigger) from being visualised.
Definition: SUMORTree.h:158
virtual int Search(const float a_min[2], const float a_max[2], const GUIVisualizationSettings &c) const
Find all within search rectangle.
Definition: SUMORTree.h:116
DemandViewOptions demandViewOptions
demand view options
NetworkViewOptions networkViewOptions
network view options
FXMenuBar * modes
The application menu bar (for select, inspect...)
void buildCommonCheckableButtons()
build checkable buttons
void updateCommonCheckableButtons()
update Common checkable buttons
void disableCommonCheckableButtons()
hide all options menu checks
MFXCheckableButton * selectButton
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 * menuCheckToogleTAZRelOnlyTo
menu check to toogle TAZRel only to
MFXCheckableButton * menuCheckShowDemandElements
menu check to show Demand Elements
MFXCheckableButton * menuCheckToogleTAZRelOnlyFrom
menu check to toogle TAZRel only from
MFXCheckableButton * menuCheckToogleTAZDrawFill
menu check to toogle TAZ draw fill
MFXCheckableButton * menuCheckToogleTAZRelDrawing
menu check to toogle TAZ Rel drawing
MFXCheckableButton * containerButton
chekable button for edit mode create containers
MFXCheckableButton * moveDemandElementsButton
chekable button for edit mode "move demand elements"
MFXCheckableButton * typeButton
chekable button for edit mode create type
void buildDemandCheckableButtons()
build checkable buttons
MFXCheckableButton * vehicleButton
chekable button for edit mode create vehicles
MFXCheckableButton * containerPlanButton
chekable button for edit mode create container plans
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
MFXCheckableButton * menuCheckShowAllTrips
show all trips
void lockPerson(const GNEDemandElement *person)
lock person
MFXCheckableButton * menuCheckToggleGrid
menu check to show grid button
void lockContainer(const GNEDemandElement *container)
lock container
void buildDemandViewOptionsMenuChecks()
build menu checks
const GNEDemandElement * getLockedPerson() const
get locked person
MFXCheckableButton * menuCheckDrawSpreadVehicles
menu check to draw vehicles in begin position or spread in lane
MFXCheckableButton * menuCheckShowOverlappedRoutes
show overlapped routes
void hideDemandViewOptionsMenuChecks()
hide all options menu checks
MFXCheckableButton * menuCheckShowAllPersonPlans
show all person plans
MFXCheckableButton * menuCheckShowAllContainerPlans
show all container plans
MFXCheckableButton * menuCheckHideNonInspectedDemandElements
Hide non inspected demand elements.
MFXCheckableButton * menuCheckHideShapes
Hide shapes (Polygons and POIs)
MFXCheckableButton * menuCheckLockPerson
Lock Person.
MFXCheckableButton * menuCheckLockContainer
Lock Container.
struct used to group all variables related with Supermodes
DataEditMode dataEditMode
the current Data edit mode
void buildSuperModeButtons()
build checkable buttons
DemandEditMode demandEditMode
the current Demand edit mode
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
struct used to group all variables related with movement of groups of elements
void moveSelection(const bool mouseLeftButtonPressed)
move selection
bool isMovingSelection() const
check if currently there is element being moved
void finishMoveSelection()
finish moving selection
void resetMovingSelectedEdge()
reset flag for moving edge
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
MFXCheckableButton * menuCheckToggleGrid
checkable button to show grid button
bool selectEdges() const
check if select edges checkbox is enabled
MFXCheckableButton * menuCheckShowJunctionBubble
checkable button to show connection as buuble in "Move" mode.
MFXCheckableButton * menuCheckWarnAboutMerge
checkable button to we should warn about merging junctions
void hideNetworkViewOptionsMenuChecks()
hide all options menu checks
MFXCheckableButton * menuCheckShowAdditionalSubElements
checkable button to show additional sub-elements
void buildNetworkViewOptionsMenuChecks()
build menu checks
MFXCheckableButton * menuCheckChangeAllPhases
checkable button to set change all phases
MFXCheckableButton * menuCheckExtendSelection
checkable button to extend to edge nodes
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
double getExaggeration(const GUIVisualizationSettings &s, const GUIGlObject *o, double factor=20) const
return the drawing size including exaggeration and constantSize values
PositionVector shape
shape of Connection
Definition: NBEdge.h:279