Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
GNEViewNet.cpp
Go to the documentation of this file.
1/****************************************************************************/
2// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo
3// Copyright (C) 2001-2025 German Aerospace Center (DLR) and others.
4// This program and the accompanying materials are made available under the
5// terms of the Eclipse Public License 2.0 which is available at
6// https://www.eclipse.org/legal/epl-2.0/
7// This Source Code may also be made available under the following Secondary
8// Licenses when the conditions for such availability set forth in the Eclipse
9// Public License 2.0 are satisfied: GNU General Public License, version 2
10// or later which is available at
11// https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html
12// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later
13/****************************************************************************/
19// A view on the network being edited (adapted from GUIViewTraffic)
20/****************************************************************************/
21
22#include <netbuild/NBEdgeCont.h>
83
85#include "GNENet.h"
86#include "GNEInternalTest.h"
87#include "GNEUndoList.h"
88#include "GNEViewNet.h"
89#include "GNEViewParent.h"
90
91// ===========================================================================
92// FOX callback mapping
93// ===========================================================================
94
95FXDEFMAP(GNEViewNet) GNEViewNetMap[] = {
96 // Super Modes
100 // Modes
117 // Network view options
134 // Demand view options
146 // Data view options
155 // Select elements
156 FXMAPFUNC(SEL_COMMAND, MID_ADDSELECT, GNEViewNet::onCmdAddSelected),
157 FXMAPFUNC(SEL_COMMAND, MID_REMOVESELECT, GNEViewNet::onCmdRemoveSelected),
160 // Junctions
173 FXMAPFUNC(SEL_COMMAND, MID_GNE_JUNCTION_ADDTLS, GNEViewNet::onCmdAddTLS),
175 // Connections
178 // Crossings
180 // WalkingArea
182 // Edges
183 FXMAPFUNC(SEL_COMMAND, MID_GNE_EDGE_SPLIT, GNEViewNet::onCmdSplitEdge),
185 FXMAPFUNC(SEL_COMMAND, MID_GNE_EDGE_REVERSE, GNEViewNet::onCmdReverseEdge),
191 FXMAPFUNC(SEL_COMMAND, MID_GNE_EDGE_SMOOTH, GNEViewNet::onCmdSmoothEdges),
197 // Lanes
216 // Additionals
218 // Polygons
221 FXMAPFUNC(SEL_COMMAND, MID_GNE_POLYGON_OPEN, GNEViewNet::onCmdOpenPolygon),
226 // edit custom shapes
235 // POIs
237 // Demand elements
238 FXMAPFUNC(SEL_COMMAND, MID_GNE_REVERSE, GNEViewNet::onCmdReverse),
239 FXMAPFUNC(SEL_COMMAND, MID_GNE_ADDREVERSE, GNEViewNet::onCmdAddReverse),
240 // Geometry Points
243 // toolbar views
246 // IntervalBar
253};
254
255// Object implementation
256FXIMPLEMENT(GNEViewNet, GUISUMOAbstractView, GNEViewNetMap, ARRAYNUMBER(GNEViewNetMap))
257
258
259// ===========================================================================
260// member method definitions
261// ===========================================================================
262#ifdef _MSC_VER
263#pragma warning(push)
264#pragma warning(disable: 4355) // mask warning about "this" in initializers
265#endif
266GNEViewNet::GNEViewNet(FXComposite* tmpParent, FXComposite* actualParent, GUIMainWindow& app,
267 GNEViewParent* viewParent, GNENet* net, GNEUndoList* undoList,
268 FXGLVisual* glVis, FXGLCanvas* share) :
269 GUISUMOAbstractView(tmpParent, app, viewParent, net->getGrid(), glVis, share),
270 myViewObjectsSelector(this),
271 myEditModes(this),
272 myTestingMode(this),
273 myCommonCheckableButtons(this),
274 myNetworkCheckableButtons(this),
275 myDemandCheckableButtons(this),
276 myDataCheckableButtons(this),
277 myNetworkViewOptions(this),
278 myDemandViewOptions(this),
279 myDataViewOptions(this),
280 myIntervalBar(this),
281 myMoveSingleElement(this),
282 myMoveMultipleElements(this),
283 myVehicleOptions(this),
284 myVehicleTypeOptions(this),
285 mySaveElements(this),
286 myTimeFormat(this),
287 mySelectingArea(this),
288 myEditNetworkElementShapes(this),
289 myLockManager(this),
290 myViewParent(viewParent),
291 myNet(net),
292 myUndoList(undoList) {
293 // view must be the final member of actualParent
294 reparent(actualParent);
295 // Build edit modes
297 // set this net in Net
298 myNet->setViewNet(this);
299 // create allow VClasses dialog
301 // create fix network elements dialog
303 // create fix demand elements dialog
305 // create fix demand elements dialog
307 // set drag delay
308 ((GUIDanielPerspectiveChanger*)myChanger)->setDragDelay(100000000); // 100 milliseconds
309 // Reset textures
311 // init testing mode
313 // update grid flags
316 // update junction shape flags
317 const bool hide = !myVisualizationSettings->drawJunctionShape;
321}
322#ifdef _MSC_VER
323#pragma warning(pop)
324#endif
325
326
330
331
332void
334 if (myNet && makeCurrent()) {
335 // declare boundary
336 const Boundary maxBoundary(1000000000.0, 1000000000.0, -1000000000.0, -1000000000.0);
337 // get all objects in boundary
338 const std::vector<GUIGlID> GLIDs = getObjectsInBoundary(maxBoundary);
339 // finish make OpenGL context current
340 makeNonCurrent();
341 // declare set
342 std::set<GNEAttributeCarrier*> ACs;
343 // iterate over GUIGlIDs
344 for (const auto& GLId : GLIDs) {
346 // Make sure that object exists
347 if (AC && AC->getTagProperty()->isPlacedInRTree()) {
348 ACs.insert(AC);
349 }
350 }
351 // interate over ACs
352 for (const auto& AC : ACs) {
353 // remove object and insert again with exaggeration
354 myNet->getGrid().removeAdditionalGLObject(AC->getGUIGlObject());
355 myNet->getGrid().addAdditionalGLObject(AC->getGUIGlObject(), AC->getGUIGlObject()->getExaggeration(*myVisualizationSettings));
356 }
357 }
358}
359
360
361void
363
364
369 } else {
370 return 0;
371 }
372}
373
374
375void
377 // build coloring tools
378 {
379 for (auto it_names : gSchemeStorage.getNames()) {
380 v->getColoringSchemesCombo()->appendIconItem(it_names.c_str());
381 if (it_names == myVisualizationSettings->name) {
383 }
384 }
385 }
386 // for junctions
388 std::string("\t") + TL("Locate Junctions") + std::string("\t") + TL("Locate a junction within the network. (Shift+J)"),
390 // for edges
392 std::string("\t") + TL("Locate Edges") + std::string("\t") + TL("Locate an edge within the network. (Shift+E)"),
394 // for walkingAreas
396 std::string("\t") + TL("Locate WalkingAreas") + std::string("\t") + TL("Locate a walkingArea within the network. (Shift+W)"),
398 // for vehicles
400 std::string("\t") + TL("Locate Vehicles") + std::string("\t") + TL("Locate a vehicle within the network. (Shift+V)"),
402 // for person
404 std::string("\t") + TL("Locate Persons") + std::string("\t") + TL("Locate a person within the network. (Shift+P)"),
406 // for container
408 std::string("\t") + TL("Locate Containers") + std::string("\t") + TL("Locate a container within the network. (Shift+C)"),
410 // for routes
412 std::string("\t") + TL("Locate Route") + std::string("\t") + TL("Locate a route within the network. (Shift+R)"),
414 // for routes
416 std::string("\t") + TL("Locate Stops") + std::string("\t") + TL("Locate a stop within the network. (Shift+S)"),
418 // for persons (currently unused)
419 /*
420 new MFXButtonTooltip(v->getLocatorPopup(),
421 std::string("\t") + TL("Locate Vehicle\tLocate a person within the network.",
422 GUIIconSubSys::getIcon(GUIIcon::LOCATEPERSON), &v, MID_LOCATEPERSON,
423 GUIDesignButtonPopup);
424 */
425 // for tls
427 std::string("\t") + TL("Locate TLS") + std::string("\t") + TL("Locate a tls within the network. (Shift+T)"),
429 // for additional stuff
431 std::string("\t") + TL("Locate Additional") + std::string("\t") + TL("Locate an additional structure within the network. (Shift+A)"),
433 // for pois
435 std::string("\t") + TL("Locate PoI") + std::string("\t") + TL("Locate a PoI within the network. (Shift+O)"),
437 // for polygons
439 std::string("\t") + TL("Locate Polygon") + std::string("\t") + TL("Locate a Polygon within the network. (Shift+L)"),
441}
442
443
444void
445GNEViewNet::updateViewNet(const bool ignoreViewUpdater) const {
446 // this call is only used for breakpoints (to check when view is updated)
447 if (ignoreViewUpdater || gViewUpdater.allowUpdate()) {
448 GUISUMOAbstractView::update();
449 }
450}
451
452
453void
457
458
459void
462 // hide data button (and adjust width)
463 myEditModes.dataButton->hide();
464 // check network modes
472 break;
473 default:
474 break;
475 }
476 // check demand modes
477 switch (myEditModes.demandEditMode) {
484 break;
485 default:
486 break;
487 }
488 // go to network mode if we're in data mode
491 } else {
492 // refresh current supermode
494 }
495 } else {
496 // show data button
497 myEditModes.dataButton->show();
498 // refresh current supermode
500 }
501}
502
503
508
509
510void
512 // clear post drawing elements
514 // set selection position in gObjectsInPosition
516 // create an small boundary
517 Boundary positionBoundary;
518 positionBoundary.add(pos);
519 positionBoundary.grow(POSITION_EPS);
520 // push matrix
522 // enable draw for view objects handler (this calculate the contours)
524 // draw all GL elements within the small boundary
525 drawGLElements(positionBoundary);
526 // swap selected objects (needed after selecting)
528 // check if filter edges that have the mouse over their geometry points
531 }
532 // restore draw for view objects handler (this calculate the contours)
534 // pop matrix
536 // check if update front elements
537 for (const auto& AC : myMarkFrontElements.getACs()) {
538 gViewObjectsHandler.updateFrontObject(AC->getGUIGlObject());
539 }
540 // after draw elements, update objects under cursor
542}
543
544
545void
547 if (shape.size() == 1) {
548 // if our shape has only one ponit, use updateObjectsInPosition
549 updateObjectsInPosition(shape.front());
550 } else if (shape.size() > 1) {
551 // triangulate shape
552 const auto triangles = Triangle::triangulate(shape);
553 // clear post drawing elements
555 // push matrix
557 // enable draw for object under cursor and rectangle selection
560 // draw all GL elements within the boundares formed by triangles
561 for (const auto& triangle : triangles) {
563 drawGLElements(triangle.getBoundary());
564 }
565 // restore draw for object under cursor
568 // pop matrix
570 // check if update front elements
571 for (const auto& AC : myMarkFrontElements.getACs()) {
572 gViewObjectsHandler.updateFrontObject(AC->getGUIGlObject());
573 }
574 // after draw elements, update objects under cursor
576 }
577}
578
579
580void
582 // if we're inspecting an element, add it to redraw path elements
583 for (const auto& AC : myInspectedElements.getACs()) {
584 const auto pathElement = dynamic_cast<const GNEPathElement*>(AC);
585 if (pathElement) {
587 }
588 }
589 // enable draw for view objects handler (this calculate the contours)
591 // push matrix
593 // redraw elements in buffer
597 // pop matrix
599 // disable drawForViewObjectsHandler
601}
602
603
608
609
614
615
616bool
617GNEViewNet::setColorScheme(const std::string& name) {
618 if (!gSchemeStorage.contains(name)) {
619 return false;
620 }
621 if (myGUIDialogViewSettings != nullptr) {
624 }
625 }
628 return true;
629}
630
631
632void
634 // reimplemented from GUISUMOAbstractView due GNEOverlappedInspection
635 ungrab();
636 // make network current
637 if (isEnabled() && myAmInitialised) {
638 // check if we're cliking while alt button is pressed
640 // set clicked popup position
642 // create cursor popup dialog for mark front element
644 // open popup dialog
646 } else if (myViewObjectsSelector.getGLObjects().empty()) {
648 } else {
649 // declare filtered objects
650 std::vector<GUIGlObject*> filteredGLObjects;
651 // get GUIGLObject front
652 GUIGlObject* overlappedElement = nullptr;
653 // we need to check if we're inspecting a overlapping element
656 overlappedElement = myInspectedElements.getFirstAC()->getGUIGlObject();
657 filteredGLObjects.push_back(overlappedElement);
658 }
659 bool connections = false;
660 bool TLS = false;
661 // fill filtered objects
662 if ((myViewObjectsSelector.getGLObjects().size() == 1) && (myViewObjectsSelector.getGLObjects().back()->getType() == GLO_EDGE)) {
663 // special case for edge geometry points (because edges uses the lane pop ups)
664 filteredGLObjects.push_back(myViewObjectsSelector.getGLObjects().back());
665 } else {
666 for (const auto& glObject : myViewObjectsSelector.getGLObjects()) {
667 // always avoid edges
668 if (glObject->getType() == GLO_EDGE) {
669 continue;
670 }
671 if (glObject->getType() == GLO_CONNECTION) {
672 connections = true;
673 }
674 if (glObject->getType() == GLO_TLLOGIC) {
675 TLS = true;
676 }
677 filteredGLObjects.push_back(glObject);
678 }
679 auto it = filteredGLObjects.begin();
680 if (connections) {
681 // filter junctions if there are connections
682 while (it != filteredGLObjects.end()) {
683 if ((*it)->getType() == GLO_JUNCTION) {
684 it = filteredGLObjects.erase(it);
685 } else {
686 it++;
687 }
688 }
689 } else if (TLS) {
690 // filter all elements except TLLogic
691 while (it != filteredGLObjects.end()) {
692 if ((*it)->getType() != GLO_TLLOGIC) {
693 it = filteredGLObjects.erase(it);
694 } else {
695 it++;
696 }
697 }
698 }
699 }
700 // remove duplicated elements using an unordered set
701 auto itDuplicated = filteredGLObjects.begin();
702 std::unordered_set<GUIGlObject*> unorderedSet;
703 for (auto itElement = filteredGLObjects.begin(); itElement != filteredGLObjects.end(); itElement++) {
704 if (unorderedSet.insert(*itElement).second) {
705 *itDuplicated++ = *itElement;
706 }
707 }
708 filteredGLObjects.erase(itDuplicated, filteredGLObjects.end());
709 // open object dialog
710 openObjectDialog(filteredGLObjects);
711 }
712 }
713}
714
715
716void
717GNEViewNet::openDeleteDialogAtCursor(const std::vector<GUIGlObject*>& GLObjects) {
718 if (myPopup) {
719 destroyPopup();
720 }
721 // set clicked popup position
723 // create cursor popup dialog for delete element
725 myCreatedPopup = true;
726 // open popup dialog
728}
729
730
731void
732GNEViewNet::openSelectDialogAtCursor(const std::vector<GUIGlObject*>& GLObjects) {
733 if (myPopup) {
734 destroyPopup();
735 }
736 // set clicked popup position
738 // create cursor popup dialog for select element
740 myCreatedPopup = true;
741 // open popup dialog
743}
744
745
746void
748 // first check if we have to save gui settings in a file (only used for testing purposes)
749 const auto& neteditOptions = OptionsCont::getOptions();
750 if (neteditOptions.getString("gui-testing.setting-output").size() > 0) {
751 try {
752 // open output device
753 OutputDevice& output = OutputDevice::getDevice(neteditOptions.getString("gui-testing.setting-output"));
754 // save view settings
757 // save viewport (zoom, X, Y and Z)
763 output.closeTag();
764 output.closeTag();
765 // close output device
766 output.close();
767 } catch (...) {
768 WRITE_ERROR(TL("GUI-Settings cannot be saved in ") + neteditOptions.getString("gui-testing.setting-output"));
769 }
770 }
771}
772
773
776 return myEditModes;
777}
778
779
782 return myTestingMode;
783}
784
785
790
791
796
797
802
803
808
809
814
815
820
821
826
827
832
833
838
839
840void
843 assert(!scheme.isFixed());
844 double minValue = std::numeric_limits<double>::infinity();
845 double maxValue = -std::numeric_limits<double>::infinity();
846 // retrieve range
847 bool hasMissingData = false;
848 if (objectType == GLO_LANE) {
849 // XXX (see #3409) multi-colors are not currently handled. this is a quick hack
850 if (active == 9) {
851 active = 8; // segment height, fall back to start height
852 } else if (active == 11) {
853 active = 10; // segment incline, fall back to total incline
854 }
855 for (const auto& lane : myNet->getAttributeCarriers()->getLanes()) {
856 const double val = lane.second->getColorValue(s, active);
857 if (val == s.MISSING_DATA) {
858 hasMissingData = true;
859 continue;
860 }
861 minValue = MIN2(minValue, val);
862 maxValue = MAX2(maxValue, val);
863 }
864 } else if (objectType == GLO_VEHICLE) {
865 for (const auto& tagMap : myNet->getAttributeCarriers()->getDemandElements()) {
866 for (const auto& objItem : tagMap.second) {
867 const double val = objItem.first->getColorValue(s, active);
868 if (val == s.MISSING_DATA) {
869 hasMissingData = true;
870 continue;
871 }
872 minValue = MIN2(minValue, val);
873 maxValue = MAX2(maxValue, val);
874 }
875 }
876 } else if (objectType == GLO_JUNCTION) {
877 if (active == 3) {
878 for (const auto& junction : myNet->getAttributeCarriers()->getJunctions()) {
879 minValue = MIN2(minValue, junction.second->getPositionInView().z());
880 maxValue = MAX2(maxValue, junction.second->getPositionInView().z());
881 }
882 }
883 } else if (objectType == GLO_TAZRELDATA) {
884 if (active == 4) {
885 for (const auto& genericData : myNet->getAttributeCarriers()->getGenericDatas().at(SUMO_TAG_TAZREL)) {
886 const double value = genericData.second->getColorValue(s, active);
887 if (value == s.MISSING_DATA) {
888 continue;
889 }
890 minValue = MIN2(minValue, value);
891 maxValue = MAX2(maxValue, value);
892 }
893 }
894 }
896 scheme.clear();
897 // add threshold for every distinct value
898 std::set<SVCPermissions> codes;
899 for (const auto& lane : myNet->getAttributeCarriers()->getLanes()) {
900 codes.insert(lane.second->getParentEdge()->getNBEdge()->getPermissions(lane.second->getIndex()));
901 }
902 int step = MAX2(1, 360 / (int)codes.size());
903 int hue = 0;
904 for (SVCPermissions p : codes) {
905 scheme.addColor(RGBColor::fromHSV(hue, 1, 1), (double)p);
906 hue = (hue + step) % 360;
907 }
908 return;
909 }
910 buildMinMaxRainbow(s, scheme, rs, minValue, maxValue, hasMissingData);
911}
912
913
914void
915GNEViewNet::setStatusBarText(const std::string& text) {
916 myApp->setStatusBarText(text);
917}
918
919
920bool
923 return false;
924 } else {
926 }
927}
928
929
930void
931GNEViewNet::setSelectorFrameScale(double selectionScale) {
933}
934
935
936bool
940
941
942bool
947
948
949bool
950GNEViewNet::askMergeJunctions(const GNEJunction* movedJunction, const GNEJunction* targetJunction, bool& alreadyAsked) {
951 if (alreadyAsked) {
952 return false;
954 return true;
955 } else {
956 // open question box
957 const std::string header = TL("Confirm Junction Merger");
958 const std::string body = (TLF("Do you wish to merge junctions '%' and '%'?\n('%' will be eliminated and its roads added to '%')", movedJunction->getMicrosimID(), targetJunction->getMicrosimID(), movedJunction->getMicrosimID(), targetJunction->getMicrosimID()));
959 const FXuint answer = FXMessageBox::question(this, MBOX_YES_NO, header.c_str(), "%s", body.c_str());
960 alreadyAsked = true;
961 if (answer != 1) { //1:yes, 2:no, 4:esc
962 return false;
963 } else {
964 return true;
965 }
966 }
967}
968
969
970bool
971GNEViewNet::aksChangeSupermode(const std::string& operation, Supermode expectedSupermode) {
972 // first check if ignore option is enabled
973 if (OptionsCont::getOptions().getBool("ignore-supermode-question")) {
974 return true;
975 }
976 std::string body;
977 if (expectedSupermode == Supermode::NETWORK) {
978 body = (operation + TL(" requires switch to network mode. Continue?"));
979 } else if (expectedSupermode == Supermode::DEMAND) {
980 body = (operation + TL(" requires switch to demand mode. Continue?"));
981 } else if (expectedSupermode == Supermode::DATA) {
982 body = (operation + TL(" requires switch to data mode. Continue?"));
983 } else {
984 throw ProcessError("invalid expected supermode");
985 }
986 // open question box
987 const auto answer = FXMessageBox::question(myApp, MBOX_YES_NO, TL("Confirm switch mode"), "%s", body.c_str());
988 // restore focus to view net
989 setFocus();
990 // return answer
991 if (answer == MBOX_CLICKED_YES) {
992 myEditModes.setSupermode(expectedSupermode, true);
993 return true;
994 } else {
995 return false;
996 }
997}
998
999
1000bool
1002 // separate conditions for code legibly
1005 return (TLSMode && selectingDetectors);
1006}
1007
1008
1009bool
1011 // separate conditions for code legibly
1013 const bool selectingJunctions = myViewParent->getTLSEditorFrame()->getTLSJunction()->isJoiningJunctions();
1014 return (TLSMode && selectingJunctions);
1015}
1016
1017
1022
1023
1028
1029
1030bool
1032 // Get selected lanes
1033 const auto selectedLanes = myNet->getAttributeCarriers()->getSelectedLanes();
1034 // Declare map of edges and lanes
1035 std::map<GNEEdge*, GNELane*> mapOfEdgesAndLanes;
1036 // Iterate over selected lanes
1037 for (const auto& selectedLane : selectedLanes) {
1038 mapOfEdgesAndLanes[myNet->getAttributeCarriers()->retrieveEdge(selectedLane->getParentEdge()->getID())] = selectedLane;
1039 }
1040 // Throw warning dialog if there hare multiple lanes selected in the same edge
1041 if (mapOfEdgesAndLanes.size() != selectedLanes.size()) {
1042 const std::string header = TL("Multiple lane in the same edge selected");
1043 const std::string bodyA = TL("There are selected lanes that belong to the same edge.");
1044 const std::string bodyB = TLF("Only one lane per edge will be restricted to %.", toString(vclass));
1045 FXMessageBox::information(getApp(), MBOX_OK, header.c_str(), "%s", (bodyA + std::string("\n") + bodyB).c_str());
1046 }
1047 // If we handeln a set of lanes
1048 if (mapOfEdgesAndLanes.size() > 0) {
1049 // declare counter for number of Sidewalks
1050 int counter = 0;
1051 // iterate over selected lanes
1052 for (const auto& edgeLane : mapOfEdgesAndLanes) {
1053 if (edgeLane.first->hasRestrictedLane(vclass)) {
1054 counter++;
1055 }
1056 }
1057 // if all edges parent own a Sidewalk, stop function
1058 if (counter == (int)mapOfEdgesAndLanes.size()) {
1059 const std::string header = TLF("Set vclass to % for selected lanes", toString(vclass));
1060 const std::string body = TL("All lanes own already another lane in the same edge with a restriction for ");
1061 FXMessageBox::information(getApp(), MBOX_OK, header.c_str(), "%s", (body + toString(vclass) + ".").c_str());
1062 return 0;
1063 } else {
1064 // Ask confirmation to user
1065 const std::string header = TLF("Set vclass to % for selected lanes", toString(vclass));
1066 const std::string body = TLF("% lanes will be restricted to %. Continue?", toString(mapOfEdgesAndLanes.size() - counter), toString(vclass));
1067 FXuint answer = FXMessageBox::question(getApp(), MBOX_YES_NO, header.c_str(), "%s", body.c_str());
1068 if (answer != 1) { //1:yes, 2:no, 4:esc
1069 return 0;
1070 }
1071 }
1072 // begin undo operation
1073 myUndoList->begin(lane, "restrict lanes to " + toString(vclass));
1074 // iterate over selected lanes
1075 for (const auto& edgeLane : mapOfEdgesAndLanes) {
1076 // Transform lane to Sidewalk
1077 myNet->restrictLane(vclass, edgeLane.second, myUndoList);
1078 }
1079 // end undo operation
1080 myUndoList->end();
1081 } else {
1082 // If only have a single lane, start undo/redo operation
1083 myUndoList->begin(lane, TL("restrict lane to ") + toString(vclass));
1084 // Transform lane to Sidewalk
1085 myNet->restrictLane(vclass, lane, myUndoList);
1086 // end undo operation
1087 myUndoList->end();
1088 }
1089 return 1;
1090}
1091
1092
1093bool
1094GNEViewNet::addRestrictedLane(GNELane* lane, SUMOVehicleClass vclass, const bool insertAtFront) {
1095 // Get selected edges
1096 const auto selectedEdges = myNet->getAttributeCarriers()->getSelectedEdges();
1097 // get selected lanes
1098 const auto selectedLanes = myNet->getAttributeCarriers()->getSelectedLanes();
1099 // Declare set of edges
1100 std::set<GNEEdge*> setOfEdges;
1101 // Fill set of edges with vector of edges
1102 for (const auto& edge : selectedEdges) {
1103 setOfEdges.insert(edge);
1104 }
1105 // iterate over selected lanes
1106 for (const auto& selectedLane : selectedLanes) {
1107 // Insert pointer to edge into set of edges (To avoid duplicates)
1108 setOfEdges.insert(myNet->getAttributeCarriers()->retrieveEdge(selectedLane->getParentEdge()->getID()));
1109 }
1110 // If we handeln a set of edges
1112 // declare counter for number of restrictions
1113 int counter = 0;
1114 // iterate over set of edges
1115 for (const auto& edge : setOfEdges) {
1116 // update counter if edge has already a restricted lane of type "vclass"
1117 if (edge->hasRestrictedLane(vclass)) {
1118 counter++;
1119 }
1120 }
1121 // if all lanes own a Sidewalk, stop function
1122 if (counter == (int)setOfEdges.size()) {
1123 const std::string header = TLF("Add vclass % to selected lanes", toString(vclass));
1124 const std::string body = TLF("All lanes own already another lane in the same edge with a restriction to %.", toString(vclass));
1125 FXMessageBox::information(getApp(), MBOX_OK, header.c_str(), "%s", body.c_str());
1126 return 0;
1127 } else {
1128 // Ask confirmation to user
1129 const std::string header = TLF("Add vclass % to selected lanes", toString(vclass));
1130 const std::string body = TLF("% restrictions to % will be added. Continue?", toString(setOfEdges.size() - counter), toString(vclass));
1131 FXuint answer = FXMessageBox::question(getApp(), MBOX_YES_NO, header.c_str(), "%s", body.c_str());
1132 if (answer != 1) { //1:yes, 2:no, 4:esc
1133 return 0;
1134 }
1135 }
1136 // begin undo operation
1137 myUndoList->begin(lane, TL("add restrictions for ") + toString(vclass));
1138 // iterate over set of edges
1139 for (const auto& edge : setOfEdges) {
1140 // add restricted lane (guess target)
1141 myNet->addRestrictedLane(vclass, edge, -1, myUndoList);
1142 }
1143 // end undo operation
1144 myUndoList->end();
1145 } else {
1146 // If only have a single lane, start undo/redo operation
1147 myUndoList->begin(lane, TL("add vclass for ") + toString(vclass));
1148 // Add restricted lane
1149 if (vclass == SVC_PEDESTRIAN) {
1150 // always add pedestrian lanes on the right
1151 myNet->addRestrictedLane(vclass, lane->getParentEdge(), 0, myUndoList);
1152 } else if (vclass == SVC_IGNORING) {
1153 if (insertAtFront) {
1155 } else {
1157 }
1158 } else if (lane->getParentEdge()->getChildLanes().size() == 1) {
1159 // guess insertion position if there is only 1 lane
1160 myNet->addRestrictedLane(vclass, lane->getParentEdge(), -1, myUndoList);
1161 } else {
1162 myNet->addRestrictedLane(vclass, lane->getParentEdge(), lane->getIndex(), myUndoList);
1163 }
1164 // end undo/redo operation
1165 myUndoList->end();
1166 }
1167 return 1;
1168}
1169
1170
1171bool
1173 // Get selected edges
1174 const auto selectedEdges = myNet->getAttributeCarriers()->getSelectedEdges();
1175 // get selected lanes
1176 const auto selectedLanes = myNet->getAttributeCarriers()->getSelectedLanes();
1177 // Declare set of edges
1178 std::set<GNEEdge*> setOfEdges;
1179 // Fill set of edges with vector of edges
1180 for (const auto& edge : selectedEdges) {
1181 setOfEdges.insert(edge);
1182 }
1183 // iterate over selected lanes
1184 for (const auto& selectedLane : selectedLanes) {
1185 // Insert pointer to edge into set of edges (To avoid duplicates)
1186 setOfEdges.insert(myNet->getAttributeCarriers()->retrieveEdge(selectedLane->getParentEdge()->getID()));
1187 }
1188 // If we handeln a set of edges
1189 if (setOfEdges.size() > 0) {
1190 // declare counter for number of restrictions
1191 int counter = 0;
1192 // iterate over set of edges
1193 for (const auto& edge : setOfEdges) {
1194 // update counter if edge has already a restricted lane of type "vclass"
1195 if (edge->hasRestrictedLane(vclass)) {
1196 counter++;
1197 }
1198 }
1199 // if all lanes don't own a Sidewalk, stop function
1200 if (counter == 0) {
1201 const std::string header = TLF("Remove vclass % from selected lanes", toString(vclass));
1202 const std::string body = TLF("The selected lanes and edges don't have a restriction to %.", toString(vclass));
1203 FXMessageBox::information(getApp(), MBOX_OK, header.c_str(), "%s", body.c_str());
1204 return 0;
1205 } else {
1206 // Ask confirmation to user
1207 const std::string header = TLF("Remove vclass % from selected lanes", toString(vclass));
1208 const std::string body = TLF("% restrictions to % will be removed. Continue?", toString(setOfEdges.size() - counter), toString(vclass));
1209 FXuint answer = FXMessageBox::question(getApp(), MBOX_YES_NO, header.c_str(), "%s", body.c_str());
1210 if (answer != 1) { //1:yes, 2:no, 4:esc
1211 return 0;
1212 }
1213 }
1214 // begin undo operation
1215 myUndoList->begin(lane, "Remove restrictions for " + toString(vclass));
1216 // iterate over set of edges
1217 for (const auto& edge : setOfEdges) {
1218 // add Sidewalk
1219 myNet->removeRestrictedLane(vclass, edge, myUndoList);
1220 }
1221 // end undo operation
1222 myUndoList->end();
1223 } else {
1224 // If only have a single lane, start undo/redo operation
1225 myUndoList->begin(lane, TL("Remove vclass for ") + toString(vclass));
1226 // Remove Sidewalk
1228 // end undo/redo operation
1229 myUndoList->end();
1230 }
1231 return 1;
1232}
1233
1234
1235#ifdef _MSC_VER
1236#pragma warning(push)
1237#pragma warning(disable: 4355) // mask warning about "this" in initializers
1238#endif
1240 myViewObjectsSelector(this),
1241 myEditModes(this),
1242 myTestingMode(this),
1243 myCommonCheckableButtons(this),
1244 myNetworkCheckableButtons(this),
1245 myDemandCheckableButtons(this),
1246 myDataCheckableButtons(this),
1247 myNetworkViewOptions(this),
1248 myDemandViewOptions(this),
1249 myDataViewOptions(this),
1250 myIntervalBar(this),
1251 myMoveSingleElement(this),
1252 myMoveMultipleElements(this),
1253 myVehicleOptions(this),
1254 myVehicleTypeOptions(this),
1255 mySaveElements(this),
1256 myTimeFormat(this),
1257 mySelectingArea(this),
1258 myEditNetworkElementShapes(this),
1259 myLockManager(this) {
1260}
1261#ifdef _MSC_VER
1262#pragma warning(pop)
1263#endif
1264
1265
1266std::vector<std::string>
1268 std::set<std::string> keys;
1269 for (const NBEdge* e : myNet->getEdgeCont().getAllEdges()) {
1270 if (edgeKeys) {
1271 for (const auto& item : e->getParametersMap()) {
1272 keys.insert(item.first);
1273 }
1274 for (const auto& con : e->getConnections()) {
1275 for (const auto& item : con.getParametersMap()) {
1276 keys.insert(item.first);
1277 }
1278 }
1279 } else {
1280 for (const auto& lane : e->getLanes()) {
1281 int i = 0;
1282 for (const auto& item : lane.getParametersMap()) {
1283 keys.insert(item.first);
1284 }
1285 for (const auto& con : e->getConnectionsFromLane(i)) {
1286 for (const auto& item : con.getParametersMap()) {
1287 keys.insert(item.first);
1288 }
1289 }
1290 i++;
1291 }
1292 }
1293 }
1294 return std::vector<std::string>(keys.begin(), keys.end());
1295}
1296
1297
1298std::vector<std::string>
1300 std::set<std::string> keys;
1301 for (const auto& genericData : myNet->getAttributeCarriers()->getGenericDatas().at(GNE_TAG_EDGEREL_SINGLE)) {
1302 for (const auto& parameter : genericData.second->getACParametersMap()) {
1303 keys.insert(parameter.first);
1304 }
1305 }
1306 return std::vector<std::string>(keys.begin(), keys.end());
1307}
1308
1309
1310std::vector<std::string>
1312 std::set<std::string> keys;
1313 for (const auto& genericData : myNet->getAttributeCarriers()->getGenericDatas().at(SUMO_TAG_TAZREL)) {
1314 for (const auto& parameter : genericData.second->getACParametersMap()) {
1315 keys.insert(parameter.first);
1316 }
1317 }
1318 for (const auto& genericData : myNet->getAttributeCarriers()->getGenericDatas().at(SUMO_TAG_EDGEREL)) {
1319 for (const auto& parameter : genericData.second->getACParametersMap()) {
1320 keys.insert(parameter.first);
1321 }
1322 }
1323 return std::vector<std::string>(keys.begin(), keys.end());
1324}
1325
1326
1327bool
1331 return true;
1332 } else {
1333 return false;
1334 }
1335}
1336
1337
1338int
1342
1343
1344int
1345GNEViewNet::doPaintGL(int mode, const Boundary& drawingBoundary) {
1346 // set lefthand and laneIcons
1349 // first step: update objects under cursor
1351 // second step: redraw contour of path elements (needed if we're inspecting a path element like a route or trip)
1353 // set render modes
1354 glRenderMode(mode);
1355 glMatrixMode(GL_MODELVIEW);
1357 glDisable(GL_TEXTURE_2D);
1358 glDisable(GL_ALPHA_TEST);
1359 glEnable(GL_BLEND);
1360 glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
1361 glEnable(GL_DEPTH_TEST);
1362 // visualize rectangular selection
1364 // draw decals
1365 drawDecals();
1366 // draw grid (and update grid button)
1367 drawGrid();
1368 // update show connections
1370 // draw temporal junction
1372 // draw temporal drawing shape
1374 // draw testing elements
1376 // draw temporal E2 multilane detectors
1378 // draw temporal overhead wires
1380 // draw temporal trip/flow route
1382 // draw temporal person plan route
1385 // draw temporal container plan route
1388 // draw temporal route
1390 // draw temporal edgeRelPath
1392 // check menu checks of supermode demand
1394 // enable or disable menuCheckShowAllPersonPlans depending of there is a locked person
1397 } else {
1399 }
1400 }
1401 // clear pathDraw
1405 // update ignore hide by zoom
1407 // draw network (boundary
1409 // draw all GL elements
1410 int hits = drawGLElements(drawingBoundary);
1411 // after drawing all elements, update list of merged junctions
1413 // draw temporal split junction
1415 // draw temporal roundabout
1417 // draw temporal lines between E1 detectors and junctions in TLS Mode
1419 // draw temporal lines between junctions in TLS Mode
1421 // draw netedit attributes references
1423 // draw test circle
1425 // pop draw matrix
1427 // update interval bar
1429 // check if recopute boundaries (Deactivated, continue after 1.14 release)
1430 /*
1431 if (gObjectsInPosition.recomputeBoundaries != GLO_NETWORK) {
1432 myNet->getGrid().updateBoundaries(gObjectsInPosition.recomputeBoundaries);
1433 }
1434 */
1435 return hits;
1436}
1437
1438
1439long
1440GNEViewNet::onLeftBtnPress(FXObject* obj, FXSelector, void* eventData) {
1441 // check if we're in test mode
1443 // set focus in view net
1444 setFocus();
1445 // update MouseButtonKeyPressed
1447 // process left button press function depending of supermode
1452 } else if (myEditModes.isCurrentSupermodeData()) {
1453 processLeftButtonPressData(eventData);
1454 }
1455 // update cursor
1456 updateCursor();
1457 // update view
1458 updateViewNet();
1459 return 1;
1460 } else {
1461 return 0;
1462 }
1463}
1464
1465
1466long
1467GNEViewNet::onLeftBtnRelease(FXObject* obj, FXSelector sel, void* eventData) {
1468 // check if we're in test mode
1470 // avoid closing Popup dialog in Linux
1471 if (myCreatedPopup) {
1472 myCreatedPopup = false;
1473 return 1;
1474 }
1475 // process parent function
1476 GUISUMOAbstractView::onLeftBtnRelease(obj, sel, eventData);
1477 // update MouseButtonKeyPressed
1479 // process left button release function depending of supermode
1484 } else if (myEditModes.isCurrentSupermodeData()) {
1486 }
1487 // update cursor
1488 updateCursor();
1489 // update view
1490 updateViewNet();
1491 return 1;
1492 } else {
1493 return 0;
1494 }
1495}
1496
1497
1498long
1499GNEViewNet::onMiddleBtnPress(FXObject* obj, FXSelector sel, void* eventData) {
1500 // check if we're in test mode
1502 // process parent function
1503 GUISUMOAbstractView::onMiddleBtnPress(obj, sel, eventData);
1504 // update cursor
1505 updateCursor();
1506 // update view
1507 updateViewNet();
1508 return 1;
1509 } else {
1510 return 0;
1511 }
1512}
1513
1514
1515long
1516GNEViewNet::onMiddleBtnRelease(FXObject* obj, FXSelector sel, void* eventData) {
1517 // check if we're in test mode
1519 // process parent function
1520 GUISUMOAbstractView::onMiddleBtnRelease(obj, sel, eventData);
1521 // update cursor
1522 updateCursor();
1523 // update view
1524 updateViewNet();
1525 return 1;
1526 } else {
1527 return 0;
1528 }
1529}
1530
1531
1532long
1533GNEViewNet::onRightBtnPress(FXObject* obj, FXSelector sel, void* eventData) {
1534 // check if we're in test mode
1536 // update MouseButtonKeyPressed
1538 // update cursor
1539 updateCursor();
1541 // disable right button press during drawing polygon
1542 return 1;
1543 } else {
1544 return GUISUMOAbstractView::onRightBtnPress(obj, sel, eventData);
1545 }
1546 } else {
1547 return 0;
1548 }
1549}
1550
1551
1552long
1553GNEViewNet::onRightBtnRelease(FXObject* obj, FXSelector sel, void* eventData) {
1554 // check if we're in test mode
1556 // update MouseButtonKeyPressed
1558 // update cursor
1559 updateCursor();
1560 // disable right button release during drawing polygon
1562 return 1;
1563 } else {
1564 return GUISUMOAbstractView::onRightBtnRelease(obj, sel, eventData);
1565 }
1566 } else {
1567 return 0;
1568 }
1569}
1570
1571
1572long
1573GNEViewNet::onMouseMove(FXObject* obj, FXSelector sel, void* eventData) {
1574 // check if we're in test mode
1576 // process mouse move in GUISUMOAbstractView
1577 GUISUMOAbstractView::onMouseMove(obj, sel, eventData);
1578 // update MouseButtonKeyPressed
1580 // update cursor
1581 updateCursor();
1582 // process mouse move function depending of supermode
1587 } else if (myEditModes.isCurrentSupermodeData()) {
1589 }
1590 // update view
1591 updateViewNet();
1592 return 1;
1593 } else {
1594 return 0;
1595 }
1596}
1597
1598
1599long
1600GNEViewNet::onKeyPress(FXObject* obj, FXSelector sel, void* eventData) {
1601 // check if we're in test mode
1603 // update MouseButtonKeyPressed
1605 // update cursor
1606 updateCursor();
1607 // continue depending of current edit mode
1609 // update viewNet (for temporal junction)
1610 updateViewNet();
1612 // change "delete last created point" depending of shift key
1615 // change "delete last created point" depending of shift key
1618 updateViewNet();
1619 }
1620 return GUISUMOAbstractView::onKeyPress(obj, sel, eventData);
1621 } else {
1622 return 0;
1623 }
1624}
1625
1626
1627long
1628GNEViewNet::onKeyRelease(FXObject* obj, FXSelector sel, void* eventData) {
1629 // check if we're in test mode
1631 // update MouseButtonKeyPressed
1633 // update cursor
1634 updateCursor();
1635 // continue depending of current edit mode
1637 // update viewNet (for temporal junction)
1638 updateViewNet();
1640 // change "delete last created point" depending of shift key
1643 // change "delete last created point" depending of shift key
1646 updateViewNet();
1647 }
1648 // check if selecting using rectangle has to be disabled
1651 updateViewNet();
1652 }
1653 return GUISUMOAbstractView::onKeyRelease(obj, sel, eventData);
1654 } else {
1655 return 0;
1656 }
1657}
1658
1659
1660void
1661GNEViewNet::abortOperation(bool clearSelection) {
1662 // steal focus from any text fields and place it over view net
1663 setFocus();
1664 // check what supermode is enabled
1666 // abort operation depending of current mode
1668 // abort edge creation in create edge frame
1672 // check if current selection has to be cleaned
1673 if (clearSelection) {
1675 }
1677 // abort changes in Connector Frame
1680 // continue depending of current TLS frame state
1685 } else {
1687 }
1693 // abort current drawing
1697 // abort current drawing
1699 } else if (myViewParent->getTAZFrame()->getCurrentTAZModule()->getTAZ() != nullptr) {
1700 // finish current editing TAZ
1702 }
1706 // clear view selection
1708 // abort path
1711 // abort path
1713 }
1715 // abort operation depending of current mode
1718 // check if current selection has to be cleaned
1719 if (clearSelection) {
1721 }
1734 }
1735 } else if (myEditModes.isCurrentSupermodeData()) {
1736 // abort operation depending of current mode
1739 // check if current selection has to be cleaned
1740 if (clearSelection) {
1742 }
1747 }
1748 }
1749 // abort undo list
1751 // update view
1752 updateViewNet();
1753}
1754
1755
1756void
1758 // delete elements depending of current supermode
1761 setStatusBarText(TL("Cannot delete in this mode"));
1763 // delete inspected elements
1764 myUndoList->begin(GUIIcon::MODEDELETE, TL("delete network inspected elements"));
1767 }
1768 myUndoList->end();
1769 } else {
1770 // get selected ACs
1771 const auto selectedNetworkACs = myNet->getAttributeCarriers()->getSelectedAttributeCarriers(false);
1772 // delete selected elements
1773 if (selectedNetworkACs.size() > 0) {
1774 myUndoList->begin(GUIIcon::MODEDELETE, TL("delete network selection"));
1775 for (const auto selectedAC : selectedNetworkACs) {
1777 }
1778 myUndoList->end();
1779 }
1780 }
1783 // delete inspected elements
1784 myUndoList->begin(GUIIcon::MODEDELETE, TL("delete demand inspected elements"));
1787 }
1788 myUndoList->end();
1789 } else {
1790 // get selected ACs
1791 const auto selectedDemandACs = myNet->getAttributeCarriers()->getSelectedAttributeCarriers(false);
1792 // delete selected elements
1793 if (selectedDemandACs.size() > 0) {
1794 myUndoList->begin(GUIIcon::MODEDELETE, TL("delete demand selection"));
1795 for (const auto selectedAC : selectedDemandACs) {
1796 deleteDemandAttributeCarrier(selectedAC);
1797 }
1798 myUndoList->end();
1799 }
1800 }
1801 } else if (myEditModes.isCurrentSupermodeData()) {
1803 // delete inspected elements
1804 myUndoList->begin(GUIIcon::MODEDELETE, TL("delete data inspected elements"));
1807 }
1808 myUndoList->end();
1809 } else {
1810 // get selected ACs
1811 const auto selectedDataACs = myNet->getAttributeCarriers()->getSelectedAttributeCarriers(false);
1812 // delete selected elements
1813 if (selectedDataACs.size() > 0) {
1814 myUndoList->begin(GUIIcon::MODEDELETE, TL("delete data selection"));
1815 for (const auto selectedAC : selectedDataACs) {
1816 deleteDataAttributeCarrier(selectedAC);
1817 }
1818 myUndoList->end();
1819 }
1820 }
1821 }
1822}
1823
1824
1825void
1827 // check what supermode is enabled
1829 // abort operation depending of current mode
1831 // Accept changes in Connector Frame
1834 // continue depending of current TLS frame state
1841 }
1846 // stop current drawing
1848 } else {
1849 // start drawing
1851 }
1856 // stop current drawing
1858 } else if (myViewParent->getTAZFrame()->getCurrentTAZModule()->getTAZ() == nullptr) {
1859 // start drawing
1862 // save pending changes
1864 }
1866 // create path element
1869 // create path element
1871 }
1876 myViewParent->getVehicleFrame()->getPathCreator()->onCmdCreatePath(nullptr, 0, nullptr);
1878 myViewParent->getPersonFrame()->getPlanCreator()->onCmdCreatePath(nullptr, 0, nullptr);
1885 }
1886 } else if (myEditModes.isCurrentSupermodeData()) {
1891 }
1892 }
1893}
1894
1895
1896void
1898 // check what supermode is enabled
1902 }
1916 }
1917 } else if (myEditModes.isCurrentSupermodeData()) {
1920 }
1921 }
1922}
1923
1924void
1926 // if there is a visible frame, set focus over it. In other case, set focus over ViewNet
1927 if (myCurrentFrame != nullptr) {
1929 } else {
1930 setFocus();
1931 }
1932}
1933
1934
1937 return myViewParent;
1938}
1939
1940
1941GNENet*
1943 return myNet;
1944}
1945
1946
1949 return myUndoList;
1950}
1951
1952
1957
1958
1963
1964
1969
1970
1975
1976
1977bool
1981
1982
1983bool
1984GNEViewNet::checkOverLockedElement(const GUIGlObject* GLObject, const bool isSelected) const {
1985 // check if elemet is blocked
1986 if (myLockManager.isObjectLocked(GLObject->getType(), isSelected)) {
1987 return false;
1988 }
1989 // get front GLObject
1990 const auto glObjectFront = myViewObjectsSelector.getGUIGlObjectFront();
1991 // check if element is under cursor
1992 if (glObjectFront) {
1993 if (glObjectFront == GLObject) {
1994 return true;
1995 } else if (glObjectFront->getType() == GLObject->getType()) {
1996 for (const auto& glObjectUnderCursor : myViewObjectsSelector.getGLObjects()) {
1997 if (glObjectUnderCursor == GLObject) {
1998 return true;
1999 }
2000 }
2001 }
2002 }
2003 return false;
2004}
2005
2006
2011
2012
2013void
2015 myLastCreatedRoute = lastCreatedRoute;
2016}
2017
2018
2021 // get first object that can be found in their container
2022 for (const auto& glObjectLayer : gViewObjectsHandler.getSelectedObjects()) {
2023 for (const auto& glObject : glObjectLayer.second) {
2024 auto junction = myNet->getAttributeCarriers()->retrieveJunction(glObject.object->getMicrosimID(), false);
2025 if (junction) {
2026 return junction;
2027 }
2028 }
2029 }
2030 return nullptr;
2031}
2032
2033
2036 // get first object that can be found in their container
2037 for (const auto& glObjectLayer : gViewObjectsHandler.getSelectedObjects()) {
2038 for (const auto& glObject : glObjectLayer.second) {
2039 auto connection = myNet->getAttributeCarriers()->retrieveConnection(glObject.object, false);
2040 if (connection) {
2041 return connection;
2042 }
2043 }
2044 }
2045 return nullptr;
2046}
2047
2048
2051 // get first object that can be found in their container
2052 for (const auto& glObjectLayer : gViewObjectsHandler.getSelectedObjects()) {
2053 for (const auto& glObject : glObjectLayer.second) {
2054 auto crossing = myNet->getAttributeCarriers()->retrieveCrossing(glObject.object, false);
2055 if (crossing) {
2056 return crossing;
2057 }
2058 }
2059 }
2060 return nullptr;
2061}
2062
2063
2066 // get first object that can be found in their container
2067 for (const auto& glObjectLayer : gViewObjectsHandler.getSelectedObjects()) {
2068 for (const auto& glObject : glObjectLayer.second) {
2069 auto walkingArea = myNet->getAttributeCarriers()->retrieveWalkingArea(glObject.object, false);
2070 if (walkingArea) {
2071 return walkingArea;
2072 }
2073 }
2074 }
2075 return nullptr;
2076}
2077
2078
2079GNEEdge*
2081 // get first object that can be found in their container
2082 for (const auto& glObjectLayer : gViewObjectsHandler.getSelectedObjects()) {
2083 for (const auto& glObject : glObjectLayer.second) {
2084 auto edge = myNet->getAttributeCarriers()->retrieveEdge(glObject.object->getMicrosimID(), false);
2085 if (edge) {
2086 return edge;
2087 }
2088 }
2089 }
2090 return nullptr;
2091}
2092
2093
2094GNELane*
2096 // get first object that can be found in their container
2097 for (const auto& glObjectLayer : gViewObjectsHandler.getSelectedObjects()) {
2098 for (const auto& glObject : glObjectLayer.second) {
2099 auto lane = myNet->getAttributeCarriers()->retrieveLane(glObject.object, false);
2100 if (lane) {
2101 return lane;
2102 }
2103 }
2104 }
2105 return nullptr;
2106}
2107
2108
2111 // get first object that can be found in their container
2112 for (const auto& glObjectLayer : gViewObjectsHandler.getSelectedObjects()) {
2113 for (const auto& glObject : glObjectLayer.second) {
2114 auto additionalElement = myNet->getAttributeCarriers()->retrieveAdditional(glObject.object, false);
2115 if (additionalElement) {
2116 return additionalElement;
2117 }
2118 }
2119 }
2120 return nullptr;
2121}
2122
2123
2126 // get first object that can be found in their container
2127 for (const auto& glObjectLayer : gViewObjectsHandler.getSelectedObjects()) {
2128 for (const auto& glObject : glObjectLayer.second) {
2129 auto demandElement = myNet->getAttributeCarriers()->retrieveDemandElement(glObject.object, false);
2130 if (demandElement) {
2131 return demandElement;
2132 }
2133 }
2134 }
2135 return nullptr;
2136}
2137
2138
2139GNEPoly*
2141 // get first object that can be parsed to poly element
2142 for (const auto& glObjectLayer : gViewObjectsHandler.getSelectedObjects()) {
2143 for (const auto& glObject : glObjectLayer.second) {
2144 auto polygon = dynamic_cast<GNEPoly*>(myNet->getAttributeCarriers()->retrieveAdditional(glObject.object, false));
2145 if (polygon) {
2146 return polygon;
2147 }
2148 }
2149 }
2150 return nullptr;
2151}
2152
2153
2154GNEPOI*
2156 // get first object that can be parsed to POI element
2157 for (const auto& glObjectLayer : gViewObjectsHandler.getSelectedObjects()) {
2158 for (const auto& glObject : glObjectLayer.second) {
2159 auto POI = dynamic_cast<GNEPOI*>(myNet->getAttributeCarriers()->retrieveAdditional(glObject.object, false));
2160 if (POI) {
2161 return POI;
2162 }
2163 }
2164 }
2165 return nullptr;
2166}
2167
2168
2169GNETAZ*
2171 // get first object that can be parsed to TAZ element
2172 for (const auto& glObjectLayer : gViewObjectsHandler.getSelectedObjects()) {
2173 for (const auto& glObject : glObjectLayer.second) {
2174 auto TAZ = dynamic_cast<GNETAZ*>(myNet->getAttributeCarriers()->retrieveAdditional(glObject.object, false));
2175 if (TAZ) {
2176 return TAZ;
2177 }
2178 }
2179 }
2180 return nullptr;
2181}
2182
2183
2186 // get first object that can be parsed to TAZ element
2187 for (const auto& glObjectLayer : gViewObjectsHandler.getSelectedObjects()) {
2188 for (const auto& glObject : glObjectLayer.second) {
2189 if (glObject.object->getType() == GLO_JUNCTION) {
2190 auto junction = myNet->getAttributeCarriers()->retrieveJunction(glObject.object->getMicrosimID());
2191 if (junction->isShapeEdited()) {
2192 return junction;
2193 }
2194 } else if (glObject.object->getType() == GLO_CROSSING) {
2195 auto crossing = myNet->getAttributeCarriers()->retrieveCrossing(glObject.object);
2196 if (crossing->isShapeEdited()) {
2197 return crossing;
2198 }
2199 } else if (glObject.object->getType() == GLO_CONNECTION) {
2200 auto connection = myNet->getAttributeCarriers()->retrieveConnection(glObject.object);
2201 if (connection->isShapeEdited()) {
2202 return connection;
2203 }
2204 }
2205 }
2206 }
2207 return nullptr;
2208}
2209
2210
2211long
2212GNEViewNet::onCmdSetSupermode(FXObject*, FXSelector sel, void*) {
2213 // check what network mode will be set
2214 switch (FXSELID(sel)) {
2216 if (myEditModes.networkButton->shown()) {
2218 }
2219 break;
2221 if (myEditModes.demandButton->shown()) {
2223 }
2224 break;
2226 if (myEditModes.dataButton->shown()) {
2228 }
2229 break;
2230 default:
2231 break;
2232 }
2233 return 1;
2234}
2235
2236
2237long
2238GNEViewNet::onCmdSetMode(FXObject*, FXSelector sel, void*) {
2239 // first filter modes depending of view
2241 // network
2243 switch (FXSELID(sel)) {
2244 // common
2248 // infrastructure
2253 // shapes
2256 break;
2257 default:
2258 return 0;
2259 }
2260 }
2261 // demand
2263 switch (FXSELID(sel)) {
2264 // common
2268 // persons
2271 // routes
2274 // types
2277 break;
2278 default:
2279 return 0;
2280 }
2281 }
2282 // data
2284 // all modes disabled
2285 return 0;
2286 }
2287 }
2288 // continue depending of supermode
2290 // check what network mode will be set
2291 switch (FXSELID(sel)) {
2294 break;
2297 break;
2300 break;
2303 break;
2306 break;
2309 break;
2312 break;
2315 break;
2318 break;
2321 break;
2324 break;
2327 break;
2330 break;
2333 break;
2334 default:
2335 break;
2336 }
2338 // check what demand mode will be set
2339 switch (FXSELID(sel)) {
2342 break;
2345 break;
2348 break;
2351 break;
2354 break;
2357 break;
2360 break;
2363 break;
2366 break;
2369 break;
2372 break;
2375 break;
2378 break;
2381 break;
2382 default:
2383 break;
2384 }
2385 } else if (myEditModes.isCurrentSupermodeData()) {
2386 // check what demand mode will be set
2387 switch (FXSELID(sel)) {
2390 break;
2393 break;
2396 break;
2399 break;
2402 break;
2405 break;
2408 break;
2409 default:
2410 break;
2411 }
2412 }
2413 return 1;
2414}
2415
2416
2417long
2418GNEViewNet::onCmdSplitEdge(FXObject*, FXSelector, void*) {
2420 if (edge != nullptr) {
2422 }
2423 return 1;
2424}
2425
2426
2427long
2428GNEViewNet::onCmdSplitEdgeBidi(FXObject*, FXSelector, void*) {
2430 if (edge != nullptr) {
2431 // obtain reverse edge
2432 const auto oppositeEdges = edge->getOppositeEdges();
2433 // check that reverse edge works
2434 if (oppositeEdges.size() > 0) {
2435 for (const auto& oppositeEdge : oppositeEdges) {
2436 // get reverse inner geometry
2437 const auto reverseGeometry = oppositeEdge->getNBEdge()->getInnerGeometry().reverse();
2438 if (reverseGeometry == edge->getNBEdge()->getInnerGeometry()) {
2439 myNet->splitEdgesBidi(edge, oppositeEdge, edge->getSplitPos(getPopupPosition()), myUndoList);
2440 return 1;
2441 }
2442 }
2443 }
2444 }
2445 return 1;
2446}
2447
2448
2449long
2450GNEViewNet::onCmdReverseEdge(FXObject*, FXSelector, void*) {
2452 if (edge != nullptr) {
2453 if (edge->isAttributeCarrierSelected()) {
2454 myUndoList->begin(edge, TL("Reverse selected edges"));
2455 const auto selectedEdges = myNet->getAttributeCarriers()->getSelectedEdges();
2456 for (const auto& selectedEdge : selectedEdges) {
2457 myNet->reverseEdge(selectedEdge, myUndoList);
2458 }
2459 myUndoList->end();
2460 } else {
2461 myUndoList->begin(edge, TL("Reverse edge"));
2463 myUndoList->end();
2464 }
2465 }
2466 return 1;
2467}
2468
2469
2470long
2471GNEViewNet::onCmdAddReversedEdge(FXObject*, FXSelector, void*) {
2473 if (edge != nullptr) {
2474 if (edge->isAttributeCarrierSelected()) {
2475 myUndoList->begin(edge, TL("Add Reverse edge for selected edges"));
2476 const auto selectedEdges = myNet->getAttributeCarriers()->getSelectedEdges();
2477 for (const auto& selectedEdge : selectedEdges) {
2478 myNet->addReversedEdge(selectedEdge, false, myUndoList);
2479 }
2480 myUndoList->end();
2481 } else {
2482 myUndoList->begin(edge, TL("Add reverse edge"));
2483 myNet->addReversedEdge(edge, false, myUndoList);
2484 myUndoList->end();
2485 }
2486 }
2487 return 1;
2488}
2489
2490
2491long
2494 if (edge != nullptr) {
2495 if (edge->isAttributeCarrierSelected()) {
2496 myUndoList->begin(edge, TL("Add Reverse disconnected edge for selected edges"));
2497 const auto selectedEdges = myNet->getAttributeCarriers()->getSelectedEdges();
2498 for (const auto& selectedEdge : selectedEdges) {
2499 myNet->addReversedEdge(selectedEdge, true, myUndoList);
2500 }
2501 myUndoList->end();
2502 } else {
2503 myUndoList->begin(edge, TL("Add reverse disconnected edge"));
2504 myNet->addReversedEdge(edge, true, myUndoList);
2505 myUndoList->end();
2506 }
2507 }
2508 return 1;
2509}
2510
2511
2512long
2513GNEViewNet::onCmdEditEdgeEndpoint(FXObject*, FXSelector, void*) {
2515 if (edge != nullptr) {
2516 // snap to active grid the Popup position
2518 }
2519 return 1;
2520}
2521
2522
2523long
2524GNEViewNet::onCmdResetEdgeEndpoint(FXObject*, FXSelector, void*) {
2526 if (edge != nullptr) {
2527 // check if edge is selected
2528 if (edge->isAttributeCarrierSelected()) {
2529 // get all selected edges
2530 const auto selectedEdges = myNet->getAttributeCarriers()->getSelectedEdges();
2531 // begin operation
2532 myUndoList->begin(edge, TL("reset geometry points"));
2533 // iterate over selected edges
2534 for (const auto& selectedEdge : selectedEdges) {
2535 // reset both end points
2536 selectedEdge->resetBothEndpoint(myUndoList);
2537 }
2538 // end operation
2539 myUndoList->end();
2540 } else {
2542 }
2543 }
2544 return 1;
2545}
2546
2547
2548long
2549GNEViewNet::onCmdStraightenEdges(FXObject*, FXSelector, void*) {
2551 if (edge != nullptr) {
2552 if (edge->isAttributeCarrierSelected()) {
2553 myUndoList->begin(edge, TL("straighten selected edges"));
2554 const auto selectedEdges = myNet->getAttributeCarriers()->getSelectedEdges();
2555 for (const auto& selectedEdge : selectedEdges) {
2556 selectedEdge->setAttribute(SUMO_ATTR_SHAPE, "", myUndoList);
2557 }
2558 myUndoList->end();
2559 } else {
2560
2561 myUndoList->begin(edge, TL("straighten edge"));
2563 myUndoList->end();
2564 }
2565 }
2566 return 1;
2567}
2568
2569
2570long
2571GNEViewNet::onCmdSmoothEdges(FXObject*, FXSelector, void*) {
2573 if (edge != nullptr) {
2574 if (edge->isAttributeCarrierSelected()) {
2575 myUndoList->begin(edge, TL("smooth selected edges"));
2576 const auto selectedEdges = myNet->getAttributeCarriers()->getSelectedEdges();
2577 for (const auto& selectedEdge : selectedEdges) {
2578 selectedEdge->smooth(myUndoList);
2579 }
2580 myUndoList->end();
2581 } else {
2582 myUndoList->begin(edge, TL("smooth edge"));
2583 edge->smooth(myUndoList);
2584 myUndoList->end();
2585 }
2586 }
2587 return 1;
2588}
2589
2590
2591long
2592GNEViewNet::onCmdStraightenEdgesElevation(FXObject*, FXSelector, void*) {
2594 if (edge != nullptr) {
2595 if (edge->isAttributeCarrierSelected()) {
2596 myUndoList->begin(edge, TL("straighten elevation of selected edges"));
2597 const auto selectedEdges = myNet->getAttributeCarriers()->getSelectedEdges();
2598 for (const auto& selectedEdge : selectedEdges) {
2599 selectedEdge->straightenElevation(myUndoList);
2600 }
2601 myUndoList->end();
2602 } else {
2603 myUndoList->begin(edge, TL("straighten edge elevation"));
2605 myUndoList->end();
2606 }
2607 }
2608 return 1;
2609}
2610
2611
2612long
2613GNEViewNet::onCmdSmoothEdgesElevation(FXObject*, FXSelector, void*) {
2615 if (edge != nullptr) {
2616 if (edge->isAttributeCarrierSelected()) {
2617 myUndoList->begin(edge, TL("smooth elevation of selected edges"));
2618 const auto selectedEdges = myNet->getAttributeCarriers()->getSelectedEdges();
2619 for (const auto& selectedEdge : selectedEdges) {
2620 selectedEdge->smoothElevation(myUndoList);
2621 }
2622 myUndoList->end();
2623 } else {
2624 myUndoList->begin(edge, TL("smooth edge elevation"));
2626 myUndoList->end();
2627 }
2628 }
2629 return 1;
2630}
2631
2632
2633long
2634GNEViewNet::onCmdResetLength(FXObject*, FXSelector, void*) {
2636 if (edge != nullptr) {
2637 if (edge->isAttributeCarrierSelected()) {
2638 myUndoList->begin(edge, TL("reset edge lengths"));
2639 const auto selectedEdges = myNet->getAttributeCarriers()->getSelectedEdges();
2640 for (const auto& selectedEdge : selectedEdges) {
2641 selectedEdge->setAttribute(SUMO_ATTR_LENGTH, "-1", myUndoList);
2642 }
2643 myUndoList->end();
2644 } else {
2646 }
2647 }
2648 return 1;
2649}
2650
2651
2652long
2653GNEViewNet::onCmdEdgeUseAsTemplate(FXObject*, FXSelector, void*) {
2655 if (edge != nullptr) {
2657 }
2658 return 1;
2659}
2660
2661
2662long
2663GNEViewNet::onCmdEgeApplyTemplate(FXObject*, FXSelector, void*) {
2664 GNEEdge* edgeAtPosition = getEdgeAtPopupPosition();
2665 if ((edgeAtPosition != nullptr) && myViewParent->getInspectorFrame()->getTemplateEditor()->getEdgeTemplate()) {
2666 // begin copy template
2667 myUndoList->begin(edgeAtPosition, TL("copy edge template"));
2668 if (edgeAtPosition->isAttributeCarrierSelected()) {
2669 // copy template in all selected edges
2670 for (const auto& edge : myNet->getAttributeCarriers()->getEdges()) {
2671 if (edge.second->isAttributeCarrierSelected()) {
2672 edge.second->copyTemplate(myViewParent->getInspectorFrame()->getTemplateEditor()->getEdgeTemplate(), myUndoList);
2673 }
2674 }
2675 } else {
2676 // copy template
2678 }
2679 // end copy template
2680 myUndoList->end();
2681 }
2682 return 1;
2683}
2684
2685
2686long
2687GNEViewNet::onCmdSimplifyShape(FXObject*, FXSelector, void*) {
2688 // get polygon under mouse
2689 GNEPoly* polygonUnderMouse = getPolygonAtPopupPosition();
2690 // check polygon
2691 if (polygonUnderMouse) {
2692 // check if shape is selected
2693 if (polygonUnderMouse->isAttributeCarrierSelected()) {
2694 // begin undo-list
2695 myNet->getViewNet()->getUndoList()->begin(polygonUnderMouse, TL("simplify shapes"));
2696 // get shapes
2697 const auto selectedShapes = myNet->getAttributeCarriers()->getSelectedShapes();
2698 // iterate over shapes
2699 for (const auto& selectedShape : selectedShapes) {
2700 // check if shape is a poly
2701 if ((selectedShape->getTagProperty()->getTag() == SUMO_TAG_POLY) ||
2702 (selectedShape->getTagProperty()->getTag() == GNE_TAG_JPS_WALKABLEAREA) ||
2703 (selectedShape->getTagProperty()->getTag() == GNE_TAG_JPS_OBSTACLE)) {
2704 // simplify shape
2705 dynamic_cast<GNEPoly*>(selectedShape)->simplifyShape();
2706 }
2707 }
2708 // end undo-list
2710 } else {
2711 polygonUnderMouse->simplifyShape();
2712 }
2713 }
2714 return 1;
2715}
2716
2717
2718long
2719GNEViewNet::onCmdDeleteGeometryPoint(FXObject*, FXSelector, void*) {
2720 GNEPoly* polygonUnderMouse = getPolygonAtPopupPosition();
2721 if (polygonUnderMouse) {
2722 polygonUnderMouse->deleteGeometryPoint(getPopupPosition());
2723 }
2724 return 1;
2725}
2726
2727
2728long
2729GNEViewNet::onCmdClosePolygon(FXObject*, FXSelector, void*) {
2730 // get polygon under mouse
2731 GNEPoly* polygonUnderMouse = getPolygonAtPopupPosition();
2732 // check polygon
2733 if (polygonUnderMouse) {
2734 // check if shape is selected
2735 if (polygonUnderMouse->isAttributeCarrierSelected()) {
2736 // begin undo-list
2737 myNet->getViewNet()->getUndoList()->begin(polygonUnderMouse, TL("close polygon shapes"));
2738 // get selectedshapes
2739 const auto selectedShapes = myNet->getAttributeCarriers()->getSelectedShapes();
2740 // iterate over shapes
2741 for (const auto& selectedShape : selectedShapes) {
2742 // check if shape is a poly
2743 if ((selectedShape->getTagProperty()->getTag() == SUMO_TAG_POLY) ||
2744 (selectedShape->getTagProperty()->getTag() == GNE_TAG_JPS_WALKABLEAREA) ||
2745 (selectedShape->getTagProperty()->getTag() == GNE_TAG_JPS_OBSTACLE)) {
2746 // close polygon
2747 dynamic_cast<GNEPoly*>(selectedShape)->closePolygon();
2748 }
2749 }
2750 // end undo-list
2752 } else {
2753 polygonUnderMouse->closePolygon();
2754 }
2755 }
2756 return 1;
2757}
2758
2759
2760long
2761GNEViewNet::onCmdOpenPolygon(FXObject*, FXSelector, void*) {
2762 // get polygon under mouse
2763 GNEPoly* polygonUnderMouse = getPolygonAtPopupPosition();
2764 // check polygon
2765 if (polygonUnderMouse) {
2766 // check if shape is selected
2767 if (polygonUnderMouse->isAttributeCarrierSelected()) {
2768 // begin undo-list
2769 myNet->getViewNet()->getUndoList()->begin(polygonUnderMouse, TL("open polygon shapes"));
2770 // get shapes
2771 const auto selectedShapes = myNet->getAttributeCarriers()->getSelectedShapes();
2772 // iterate over shapes
2773 for (const auto& selectedShape : selectedShapes) {
2774 // check if shape is a poly
2775 if ((selectedShape->getTagProperty()->getTag() == SUMO_TAG_POLY) ||
2776 (selectedShape->getTagProperty()->getTag() == GNE_TAG_JPS_WALKABLEAREA) ||
2777 (selectedShape->getTagProperty()->getTag() == GNE_TAG_JPS_OBSTACLE)) {
2778 // open polygon
2779 dynamic_cast<GNEPoly*>(selectedShape)->openPolygon();
2780 }
2781 }
2782 // end undo-list
2784 } else {
2785 polygonUnderMouse->openPolygon();
2786 }
2787 }
2788 return 1;
2789}
2790
2791
2792long
2793GNEViewNet::onCmdSelectPolygonElements(FXObject*, FXSelector, void*) {
2794 // get polygon under mouse
2795 GNEPoly* polygonUnderMouse = getPolygonAtPopupPosition();
2796 // check polygon
2797 if (polygonUnderMouse) {
2798 // get all elements under polygon shape
2799 updateObjectsInShape(polygonUnderMouse->getShape());
2800 // declare filtered ACs
2801 std::vector<GNEAttributeCarrier*> ACsUnderPolygon;
2802 ACsUnderPolygon.reserve(myViewObjectsSelector.getAttributeCarriers().size());
2803 // iterate over obtained GUIGlIDs
2804 for (const auto& AC : myViewObjectsSelector.getAttributeCarriers()) {
2805 if ((AC->getTagProperty()->getTag() == SUMO_TAG_EDGE) && checkSelectEdges()) {
2806 ACsUnderPolygon.push_back(AC);
2807 } else if ((AC->getTagProperty()->getTag() == SUMO_TAG_LANE) && !checkSelectEdges()) {
2808 ACsUnderPolygon.push_back(AC);
2809 } else if (!AC->getTagProperty()->isSymbol() && (AC != polygonUnderMouse)) {
2810 ACsUnderPolygon.push_back(AC);
2811 }
2812 }
2813 // continue if there are ACs
2814 if (ACsUnderPolygon.size() > 0) {
2815 // begin undo-list
2816 myNet->getViewNet()->getUndoList()->begin(GUIIcon::MODESELECT, TL("select within polygon boundary"));
2817 // iterate over shapes
2818 for (const auto& AC : ACsUnderPolygon) {
2819 AC->setAttribute(GNE_ATTR_SELECTED, "true", myUndoList);
2820 }
2821 // end undo-list
2823 }
2824 }
2825 return 1;
2826}
2827
2828
2829long
2830GNEViewNet::onCmdTriangulatePolygon(FXObject*, FXSelector, void*) {
2831// get polygon under mouse
2832 GNEPoly* polygonUnderMouse = getPolygonAtPopupPosition();
2833 // check polygon
2834 if (polygonUnderMouse) {
2835 // declare additional handler
2836 GNEAdditionalHandler additionalHandler(myNet, polygonUnderMouse->getFilename(), myViewParent->getGNEAppWindows()->isUndoRedoAllowed(), false);
2837 // triangulate shape
2838 const auto triangulation = Triangle::triangulate(polygonUnderMouse->getShape());
2839 // begin undo-list
2840 myNet->getViewNet()->getUndoList()->begin(GUIIcon::POLY, TL("triangulate polygon"));
2841 // create every individual triangle
2842 for (const auto& triangle : triangulation) {
2843 auto basePolygon = polygonUnderMouse->getSumoBaseObject();
2845 basePolygon->addPositionVectorAttribute(SUMO_ATTR_SHAPE, triangle.getShape());
2846 // build shape
2847 additionalHandler.parseSumoBaseObject(basePolygon);
2848 }
2849 // delete original polygon
2850 myNet->deleteAdditional(polygonUnderMouse, myNet->getViewNet()->getUndoList());
2851 // end undo-list
2853 }
2854 return 1;
2855}
2856
2857
2858long
2859GNEViewNet::onCmdSetFirstGeometryPoint(FXObject*, FXSelector, void*) {
2860 GNEPoly* polygonUnderMouse = getPolygonAtPopupPosition();
2861 if (polygonUnderMouse) {
2862 polygonUnderMouse->changeFirstGeometryPoint(polygonUnderMouse->getVertexIndex(getPopupPosition(), false));
2863 }
2864
2865 return 1;
2866}
2867
2868
2869long
2870GNEViewNet::onCmdSimplifyShapeEdited(FXObject*, FXSelector, void*) {
2871 auto undoList = myNet->getViewNet()->getUndoList();
2872 // get shape edited under mouse
2874 if (shapeEdited) {
2875 // simplify edited shape using undo-redo
2876 undoList->begin(shapeEdited, TL("simplify edited shape"));
2877 shapeEdited->simplifyShapeEdited(undoList);
2878 undoList->end();
2879 }
2880 return 1;
2881}
2882
2883
2884long
2885GNEViewNet::onCmdStraightenShapeEdited(FXObject*, FXSelector, void*) {
2886 auto undoList = myNet->getViewNet()->getUndoList();
2887 // get shape edited under mouse
2889 if (shapeEdited) {
2890 // simplify edited shape using undo-redo
2891 undoList->begin(shapeEdited, TL("straigthen edited shape"));
2892 shapeEdited->straigthenShapeEdited(undoList);
2893 undoList->end();
2894 }
2895 return 1;
2896}
2897
2898
2899long
2900GNEViewNet::onCmdCloseShapeEdited(FXObject*, FXSelector, void*) {
2901 auto undoList = myNet->getViewNet()->getUndoList();
2902 // get shape edited under mouse
2904 if (shapeEdited) {
2905 // close edited shape using undo-redo
2906 undoList->begin(shapeEdited, TL("simplify edited shape"));
2907 shapeEdited->closeShapeEdited(undoList);
2908 undoList->end();
2909 }
2910 return 1;
2911}
2912
2913
2914long
2915GNEViewNet::onCmdOpenShapeEdited(FXObject*, FXSelector, void*) {
2916 auto undoList = myNet->getViewNet()->getUndoList();
2917 // get shape edited under mouse
2919 if (shapeEdited) {
2920 // open edited shape using undo-redo
2921 undoList->begin(shapeEdited, TL("simplify edited shape"));
2922 shapeEdited->openShapeEdited(undoList);
2923 undoList->end();
2924 }
2925 return 1;
2926}
2927
2928
2929long
2931 auto undoList = myNet->getViewNet()->getUndoList();
2932 // get shape edited under mouse
2934 if (shapeEdited) {
2935 // get geometry point index under cursor
2936 const auto geometryPointIndex = shapeEdited->getGeometryPointUnderCursorShapeEdited();
2937 // set first geometry point in edited shape using undo-redo
2938 undoList->begin(shapeEdited, TL("simplify edited shape"));
2939 shapeEdited->setFirstGeometryPointShapeEdited(geometryPointIndex, undoList);
2940 undoList->end();
2941 }
2942 return 1;
2943}
2944
2945
2946long
2948 auto undoList = myNet->getViewNet()->getUndoList();
2949 // get shape edited under mouse
2951 if (shapeEdited) {
2952 // get geometry point index under cursor
2953 const auto geometryPointIndex = shapeEdited->getGeometryPointUnderCursorShapeEdited();
2954 // delete geometry point edited shape using undo-redo
2955 undoList->begin(shapeEdited, TL("simplify edited shape"));
2956 shapeEdited->deleteGeometryPointShapeEdited(geometryPointIndex, undoList);
2957 undoList->end();
2958 }
2959 return 1;
2960}
2961
2962
2963long
2964GNEViewNet::onCmdResetShapeEdited(FXObject*, FXSelector, void*) {
2965 auto undoList = myNet->getViewNet()->getUndoList();
2966 // get shape edited under mouse
2968 if (shapeEdited) {
2969 // simplify edited shape using undo-redo
2970 undoList->begin(shapeEdited, TL("simplify edited shape"));
2971 shapeEdited->resetShapeEdited(undoList);
2972 undoList->end();
2973 }
2974 return 1;
2975}
2976
2977
2978long
2979GNEViewNet::onCmdFinishShapeEdited(FXObject*, FXSelector, void*) {
2980 // the same behavior as when we press enter
2981 hotkeyEnter();
2982 return 1;
2983}
2984
2985
2986long
2987GNEViewNet::onCmdTransformPOI(FXObject*, FXSelector, void*) {
2988 // obtain POI at popup position
2990 if (POI) {
2991 // declare additional handler
2992 GNEAdditionalHandler additionalHandler(myNet, POI->getFilename(), myViewParent->getGNEAppWindows()->isUndoRedoAllowed(), false);
2993 // check what type of POI will be transformed
2994 if (POI->getTagProperty()->getTag() == SUMO_TAG_POI) {
2995 // obtain lanes around POI boundary
2996 std::vector<GUIGlID> GLIDs = getObjectsInBoundary(POI->getCenteringBoundary());
2997 std::vector<GNELane*> lanes;
2998 for (const auto& GLID : GLIDs) {
3000 if (lane) {
3001 lanes.push_back(lane);
3002 }
3003 }
3004 if (lanes.empty()) {
3005 WRITE_WARNINGF(TL("No lanes around % to attach it"), toString(SUMO_TAG_POI));
3006 } else {
3007 // obtain nearest lane to POI
3008 GNELane* nearestLane = lanes.front();
3009 double minorPosOverLane = nearestLane->getLaneShape().nearest_offset_to_point2D(POI->getPositionInView());
3010 double minorLateralOffset = nearestLane->getLaneShape().positionAtOffset(minorPosOverLane).distanceTo(POI->getPositionInView());
3011 for (const auto& lane : lanes) {
3012 double posOverLane = lane->getLaneShape().nearest_offset_to_point2D(POI->getPositionInView());
3013 double lateralOffset = lane->getLaneShape().positionAtOffset(posOverLane).distanceTo(POI->getPositionInView());
3014 if (lateralOffset < minorLateralOffset) {
3015 minorPosOverLane = posOverLane;
3016 minorLateralOffset = lateralOffset;
3017 nearestLane = lane;
3018 }
3019 }
3020 // get sumo base object of POI (And all common attributes)
3021 CommonXMLStructure::SumoBaseObject* POIBaseObject = POI->getSumoBaseObject();
3022 // add specific attributes
3023 POIBaseObject->addStringAttribute(SUMO_ATTR_LANE, nearestLane->getID());
3024 POIBaseObject->addDoubleAttribute(SUMO_ATTR_POSITION, minorPosOverLane);
3025 POIBaseObject->addBoolAttribute(SUMO_ATTR_FRIENDLY_POS, POI->getFriendlyPos());
3026 POIBaseObject->addDoubleAttribute(SUMO_ATTR_POSITION_LAT, 0);
3027 // remove POI
3028 myUndoList->begin(POI, TL("attach POI into lane"));
3030 // add new POI use route handler
3031 additionalHandler.parseSumoBaseObject(POIBaseObject);
3032 myUndoList->end();
3033 }
3034 } else {
3035 // get sumo base object of POI (And all common attributes)
3036 CommonXMLStructure::SumoBaseObject* POIBaseObject = POI->getSumoBaseObject();
3037 // add specific attributes
3038 POIBaseObject->addDoubleAttribute(SUMO_ATTR_X, POI->x());
3039 POIBaseObject->addDoubleAttribute(SUMO_ATTR_Y, POI->y());
3040 // remove POI
3041 myUndoList->begin(POI, TL("release POI from lane"));
3043 // add new POI use route handler
3044 additionalHandler.parseSumoBaseObject(POIBaseObject);
3045 myUndoList->end();
3046 }
3047 }
3048 return 1;
3049}
3050
3051
3052long
3053GNEViewNet::onCmdReverse(FXObject*, FXSelector, void*) {
3054 // obtain demand element at popup position
3056 if (demandElement) {
3057 // begin undo list
3058 myUndoList->begin(demandElement, TLF("reverse % '%'", demandElement->getTagStr(), demandElement->getID()));
3059 GNERouteHandler::reverse(demandElement);
3060 myUndoList->end();
3061 }
3062 return 1;
3063}
3064
3065
3066long
3067GNEViewNet::onCmdAddReverse(FXObject*, FXSelector, void*) {
3068 // obtain demand element at popup position
3070 if (demandElement) {
3071 // begin undo list
3072 myUndoList->begin(demandElement, TLF("add reverse '%'", demandElement->getTagStr()));
3073 GNERouteHandler::addReverse(demandElement);
3074 myUndoList->end();
3075 }
3076 return 1;
3077}
3078
3079
3080long
3081GNEViewNet::onCmdSetCustomGeometryPoint(FXObject*, FXSelector, void*) {
3082 // get element at popup position
3086 // check element
3087 if (edge != nullptr) {
3088 // make a copy of edge geometry
3089 auto edgeGeometry = edge->getNBEdge()->getGeometry();
3090 // get index position
3091 const int index = edgeGeometry.indexOfClosest(getPositionInformation(), true);
3092 // get new position
3093 Position newPosition = edgeGeometry[index];
3094 // edit using modal GNEGeometryPointDialog
3095 GNEGeometryPointDialog(this, &newPosition); // NOSONAR, constructor returns after dialog has been closed
3096 // now check position
3097 if (newPosition != edgeGeometry[index]) {
3098 // update new position
3099 edgeGeometry[index] = newPosition;
3100 // begin undo list
3101 myUndoList->begin(edge, TL("change edge Geometry Point position"));
3102 // continue depending of index
3103 if (index == 0) {
3104 // change shape start
3106 } else if (index == ((int)edgeGeometry.size() - 1)) {
3107 // change shape end
3109 } else {
3110 // remove front and back geometry points
3111 edgeGeometry.pop_front();
3112 edgeGeometry.pop_back();
3113 // change shape
3115 }
3116 // end undo list
3117 myUndoList->end();
3118 }
3119 } else if (poly != nullptr) {
3120 // make a copy of polygon geometry
3121 PositionVector polygonGeometry = poly->getShape();
3122 // get index position
3123 const int index = polygonGeometry.indexOfClosest(getPositionInformation(), true);
3124 // get new position
3125 Position newPosition = polygonGeometry[index];
3126 // edit using modal GNEGeometryPointDialog
3127 GNEGeometryPointDialog(this, &newPosition); // NOSONAR, constructor returns after dialog has been closed
3128 // now check position
3129 if (newPosition != polygonGeometry[index]) {
3130 // update new position
3131 polygonGeometry[index] = newPosition;
3132 // begin undo list
3133 myUndoList->begin(poly, TL("change polygon Geometry Point position"));
3134 // change shape
3136 // end undo list
3137 myUndoList->end();
3138 }
3139 } else if (TAZ != nullptr) {
3140 // make a copy of TAZ geometry
3141 PositionVector TAZGeometry = TAZ->getAdditionalGeometry().getShape();
3142 // get index position
3143 const int index = TAZGeometry.indexOfClosest(getPositionInformation(), true);
3144 // get new position
3145 Position newPosition = TAZGeometry[index];
3146 // edit using modal GNEGeometryPointDialog
3147 GNEGeometryPointDialog(this, &newPosition); // NOSONAR, constructor returns after dialog has been closed
3148 // now check position
3149 if (newPosition != TAZGeometry[index]) {
3150 // update new position
3151 TAZGeometry[index] = newPosition;
3152 // begin undo list
3153 myUndoList->begin(TAZ, TL("change TAZ Geometry Point position"));
3154 // change shape
3156 // end undo list
3157 myUndoList->end();
3158 }
3159 }
3160 return 1;
3161}
3162
3163
3164long
3165GNEViewNet::onCmdResetEndPoints(FXObject*, FXSelector, void*) {
3166 // get lane at popup position
3167 GNELane* laneAtPopupPosition = getLaneAtPopupPosition();
3168 // check element
3169 if (laneAtPopupPosition != nullptr) {
3170 // get parent edge
3171 GNEEdge* edge = laneAtPopupPosition->getParentEdge();
3172 // check if edge is selected
3173 if (edge->isAttributeCarrierSelected()) {
3174 // get selected edges
3175 const auto selectedEdges = myNet->getAttributeCarriers()->getSelectedEdges();
3176 // begin undo list
3177 myUndoList->begin(edge, TL("reset end points of selected edges"));
3178 // iterate over edges
3179 for (const auto& selectedEdge : selectedEdges) {
3180 // reset both end points
3181 selectedEdge->setAttribute(GNE_ATTR_SHAPE_START, "", myUndoList);
3182 selectedEdge->setAttribute(GNE_ATTR_SHAPE_END, "", myUndoList);
3183 }
3184 // end undo list
3185 myUndoList->end();
3186 } else {
3187 // begin undo list
3188 myUndoList->begin(edge, TL("reset end points of edge '") + edge->getID());
3189 // reset both end points
3192 // end undo list
3193 myUndoList->end();
3194 }
3195 }
3196 return 1;
3197}
3198
3199
3200long
3201GNEViewNet::onCmdDuplicateLane(FXObject*, FXSelector, void*) {
3202 GNELane* laneAtPopupPosition = getLaneAtPopupPosition();
3203 if (laneAtPopupPosition != nullptr) {
3204 // when duplicating an unselected lane, keep all connections as they
3205 // are, otherwise recompute them
3206 if (laneAtPopupPosition->isAttributeCarrierSelected()) {
3207 myUndoList->begin(laneAtPopupPosition, TL("duplicate selected lanes"));
3208 const auto selectedLanes = myNet->getAttributeCarriers()->getSelectedLanes();
3209 for (const auto& lane : selectedLanes) {
3210 myNet->duplicateLane(lane, myUndoList, true);
3211 }
3212 myUndoList->end();
3213 } else {
3214 myUndoList->begin(laneAtPopupPosition, TL("duplicate lane"));
3215 myNet->duplicateLane(laneAtPopupPosition, myUndoList, false);
3216 myUndoList->end();
3217 }
3218 }
3219 return 1;
3220}
3221
3222
3223long
3224GNEViewNet::onCmdEditLaneShape(FXObject*, FXSelector, void*) {
3225 // Obtain lane under mouse
3227 if (lane) {
3229 }
3230 // destroy pop-up and update view Net
3231 destroyPopup();
3232 setFocus();
3233 return 1;
3234}
3235
3236
3237long
3238GNEViewNet::onCmdResetLaneCustomShape(FXObject*, FXSelector, void*) {
3239 GNELane* laneAtPopupPosition = getLaneAtPopupPosition();
3240 if (laneAtPopupPosition != nullptr) {
3241 // when duplicating an unselected lane, keep all connections as they
3242 // are, otherwise recompute them
3243 if (laneAtPopupPosition->isAttributeCarrierSelected()) {
3244 myUndoList->begin(laneAtPopupPosition, TL("reset custom lane shapes"));
3245 const auto selectedLanes = myNet->getAttributeCarriers()->getSelectedLanes();
3246 for (const auto& lane : selectedLanes) {
3247 lane->setAttribute(SUMO_ATTR_CUSTOMSHAPE, "", myUndoList);
3248 }
3249 myUndoList->end();
3250 } else {
3251 myUndoList->begin(laneAtPopupPosition, TL("reset custom lane shape"));
3252 laneAtPopupPosition->setAttribute(SUMO_ATTR_CUSTOMSHAPE, "", myUndoList);
3253 myUndoList->end();
3254 }
3255 }
3256 return 1;
3257}
3258
3259
3260long
3261GNEViewNet::onCmdResetOppositeLane(FXObject*, FXSelector, void*) {
3262 GNELane* laneAtPopupPosition = getLaneAtPopupPosition();
3263 if (laneAtPopupPosition != nullptr) {
3264 // when duplicating an unselected lane, keep all connections as they
3265 // are, otherwise recompute them
3266 if (laneAtPopupPosition->isAttributeCarrierSelected()) {
3267 myUndoList->begin(laneAtPopupPosition, TL("reset opposite lanes"));
3268 const auto selectedLanes = myNet->getAttributeCarriers()->getSelectedLanes();
3269 for (const auto& lane : selectedLanes) {
3270 lane->setAttribute(GNE_ATTR_OPPOSITE, "", myUndoList);
3271 }
3272 myUndoList->end();
3273 } else {
3274 myUndoList->begin(laneAtPopupPosition, TL("reset opposite lane"));
3275 laneAtPopupPosition->setAttribute(GNE_ATTR_OPPOSITE, "", myUndoList);
3276 myUndoList->end();
3277 }
3278 }
3279 return 1;
3280}
3281
3282
3283long
3284GNEViewNet::onCmdLaneOperation(FXObject*, FXSelector sel, void*) {
3285 GNELane* laneAtPopupPosition = getLaneAtPopupPosition();
3286 if (laneAtPopupPosition) {
3287 // check lane operation
3288 switch (FXSELID(sel)) {
3290 return restrictLane(laneAtPopupPosition, SVC_PEDESTRIAN);
3292 return restrictLane(laneAtPopupPosition, SVC_BICYCLE);
3294 return restrictLane(laneAtPopupPosition, SVC_BUS);
3296 return restrictLane(laneAtPopupPosition, SVC_IGNORING);
3298 return addRestrictedLane(laneAtPopupPosition, SVC_PEDESTRIAN, false);
3300 return addRestrictedLane(laneAtPopupPosition, SVC_BICYCLE, false);
3302 return addRestrictedLane(laneAtPopupPosition, SVC_BUS, false);
3304 return addRestrictedLane(laneAtPopupPosition, SVC_IGNORING, true);
3306 return addRestrictedLane(laneAtPopupPosition, SVC_IGNORING, false);
3308 return removeRestrictedLane(laneAtPopupPosition, SVC_PEDESTRIAN);
3310 return removeRestrictedLane(laneAtPopupPosition, SVC_BICYCLE);
3312 return removeRestrictedLane(laneAtPopupPosition, SVC_BUS);
3314 return removeRestrictedLane(laneAtPopupPosition, SVC_IGNORING);
3315 default:
3316 return 0;
3317 }
3318 } else {
3319 return 0;
3320 }
3321}
3322
3323
3324long
3325GNEViewNet::onCmdLaneReachability(FXObject* menu, FXSelector, void*) {
3326 GNELane* laneAtPopupPosition = getLaneAtPopupPosition();
3327 if (laneAtPopupPosition != nullptr) {
3328 // obtain vClass
3329 const SUMOVehicleClass vClass = SumoVehicleClassStrings.get(dynamic_cast<FXMenuCommand*>(menu)->getText().text());
3330 // calculate reachability
3332 // select all lanes with reachability greater than 0
3333 myUndoList->begin(laneAtPopupPosition, TL("select lane reachability"));
3334 for (const auto& edge : myNet->getAttributeCarriers()->getEdges()) {
3335 for (const auto& lane : edge.second->getChildLanes()) {
3336 if (lane->getReachability() >= 0) {
3337 lane->setAttribute(GNE_ATTR_SELECTED, "true", myUndoList);
3338 }
3339 }
3340 }
3341 myUndoList->end();
3342 }
3343 return 1;
3344}
3345
3346
3347long
3348GNEViewNet::onCmdOpenAdditionalDialog(FXObject*, FXSelector, void*) {
3349 // retrieve additional under cursor
3351 // check if additional can open dialog
3352 if (addtional && addtional->getTagProperty()->hasDialog()) {
3353 addtional->openAdditionalDialog();
3354 }
3355 return 1;
3356}
3357
3358
3359void
3361 FXEvent* evt = (FXEvent*)eventData;
3362 // process click
3363 destroyPopup();
3364 setFocus();
3365 myChanger->onLeftBtnPress(eventData);
3366 grab();
3367 // Check there are double click
3368 if (evt->click_count == 2) {
3369 handle(this, FXSEL(SEL_DOUBLECLICKED, 0), eventData);
3370 }
3371}
3372
3373
3374void
3376 // first check if we're panning
3377 if (myPanning) {
3378 // move view
3381 } else {
3382 // declare flags
3383 bool cursorMoveView = false;
3384 bool cursorInspect = false;
3385 bool cursorSelect = false;
3386 bool cursorMoveElement = false;
3387 bool cursorDelete = false;
3388 // continue depending of supermode
3390 // move view
3396 cursorMoveView = true;
3397 }
3398 // specific mode
3400 cursorInspect = true;
3402 cursorSelect = true;
3404 cursorMoveElement = true;
3406 cursorDelete = true;
3407 }
3409 // move view
3413 cursorMoveView = true;
3414 }
3415 // specific mode
3417 cursorInspect = true;
3419 cursorSelect = true;
3421 cursorMoveElement = true;
3423 cursorDelete = true;
3424 }
3425 } else if (myEditModes.isCurrentSupermodeData()) {
3426 // move view
3428 cursorMoveView = true;
3429 }
3430 // specific mode
3432 cursorInspect = true;
3434 cursorSelect = true;
3436 cursorDelete = true;
3437 }
3438 }
3439 // set cursor
3440 if (myMouseButtonKeyPressed.controlKeyPressed() && cursorMoveView) {
3441 // move view cursor if control key is pressed
3444 } else if (cursorInspect) {
3445 // special case for inspect lanes
3447 // inspect lane cursor
3450 } else {
3451 // inspect cursor
3454 }
3455 } else if (cursorSelect) {
3456 // special case for select lanes
3458 // select lane cursor
3461 } else {
3462 // select cursor
3465 }
3466 } else if (cursorMoveElement) {
3467 // move cursor
3470 } else if (cursorDelete) {
3471 // delete cursor
3474 } else {
3475 // default cursor
3478 }
3479 }
3480}
3481
3482
3483int
3485 // udpdate drawing toggle
3486 if (myDrawingToggle > 10000) {
3487 myDrawingToggle = 0;
3488 } else {
3490 }
3491 // set default scale
3493 // calculate boundary extremes
3494 const float minB[2] = { (float)bound.xmin(), (float)bound.ymin() };
3495 const float maxB[2] = { (float)bound.xmax(), (float)bound.ymax() };
3496 // reset gl line to 1
3497 glLineWidth(1);
3498 // set drawing modes
3499 glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
3500 glEnable(GL_POLYGON_OFFSET_FILL);
3501 glEnable(GL_POLYGON_OFFSET_LINE);
3502 // draw all elements between minB and maxB, obtain objects included in minB and maxB
3503 return myGrid->Search(minB, maxB, *myVisualizationSettings);
3504}
3505
3506
3507void
3509 // depending of the visualizationSettings, enable or disable check box show grid
3511 // change show grid
3514 // change to true
3517 // update show grid buttons
3520 }
3521 // draw grid only in network and demand mode
3523 paintGLGrid();
3524 }
3525 } else {
3526 // change show grid
3529 // change to false
3532 // update show grid buttons
3535 }
3536 }
3537}
3538
3539
3540long
3541GNEViewNet::onCmdResetEdgeEndPoints(FXObject*, FXSelector, void*) {
3542 // Obtain junction under mouse
3544 if (junction) {
3545 myUndoList->begin(GUIIcon::EDGE, TL("reset edge endpoints"));
3546 // are, otherwise recompute them
3547 if (junction->isAttributeCarrierSelected()) {
3548 const auto selectedJunctions = myNet->getAttributeCarriers()->getSelectedJunctions();
3549 for (const auto& selectedJunction : selectedJunctions) {
3550 // reset shape end from incoming edges
3551 for (const auto& incomingEdge : selectedJunction->getGNEIncomingEdges()) {
3552 incomingEdge->setAttribute(GNE_ATTR_SHAPE_END, "", myUndoList);
3553 }
3554 // reset shape start from outgoing edges
3555 for (const auto& outgoingEdge : selectedJunction->getGNEOutgoingEdges()) {
3556 outgoingEdge->setAttribute(GNE_ATTR_SHAPE_START, "", myUndoList);
3557 }
3558 }
3559 } else {
3560 // reset shape end from incoming edges
3561 for (const auto& incomingEdge : junction->getGNEIncomingEdges()) {
3562 incomingEdge->setAttribute(GNE_ATTR_SHAPE_END, "", myUndoList);
3563 }
3564 // reset shape start from outgoing edges
3565 for (const auto& outgoingEdge : junction->getGNEOutgoingEdges()) {
3566 outgoingEdge->setAttribute(GNE_ATTR_SHAPE_START, "", myUndoList);
3567 }
3568 }
3569 myUndoList->end();
3570 }
3571 // destroy pop-up and set focus in view net
3572 destroyPopup();
3573 setFocus();
3574 return 1;
3575}
3576
3577
3578long
3579GNEViewNet::onCmdEditJunctionShape(FXObject*, FXSelector, void*) {
3580 // Obtain junction under mouse
3582 if (junction) {
3583 // check if network has to be updated
3584 if (junction->getNBNode()->getShape().size() == 0) {
3585 // recompute the whole network
3587 }
3588 // if grid is enabled, show warning
3590 WRITE_WARNING(TL("Grid is still active, press ctrl+g to deactivate"));
3591 }
3592 // start edit custom shape
3594 }
3595 // destroy pop-up and set focus in view net
3596 destroyPopup();
3597 setFocus();
3598 return 1;
3599}
3600
3601
3602long
3603GNEViewNet::onCmdResetJunctionShape(FXObject*, FXSelector, void*) {
3604 // Obtain junction under mouse
3606 if (junction) {
3607 // are, otherwise recompute them
3608 if (junction->isAttributeCarrierSelected()) {
3609 myUndoList->begin(junction, TL("reset custom junction shapes"));
3610 const auto selectedJunctions = myNet->getAttributeCarriers()->getSelectedJunctions();
3611 for (const auto& selectedJunction : selectedJunctions) {
3612 selectedJunction->setAttribute(SUMO_ATTR_SHAPE, "", myUndoList);
3613 }
3614 myUndoList->end();
3615 } else {
3616 myUndoList->begin(junction, TL("reset custom junction shape"));
3617 junction->setAttribute(SUMO_ATTR_SHAPE, "", myUndoList);
3618 myUndoList->end();
3619 }
3620 }
3621 // destroy pop-up and set focus in view net
3622 destroyPopup();
3623 setFocus();
3624 return 1;
3625}
3626
3627
3628long
3629GNEViewNet::onCmdReplaceJunction(FXObject*, FXSelector, void*) {
3631 if (junction != nullptr) {
3633 }
3634 // destroy pop-up and set focus in view net
3635 destroyPopup();
3636 setFocus();
3637 return 1;
3638}
3639
3640
3641long
3642GNEViewNet::onCmdSplitJunction(FXObject*, FXSelector, void*) {
3644 if (junction != nullptr) {
3645 myNet->splitJunction(junction, false, myUndoList);
3646 }
3647 // destroy pop-up and set focus in view net
3648 destroyPopup();
3649 setFocus();
3650 return 1;
3651}
3652
3653
3654long
3655GNEViewNet::onCmdSplitJunctionReconnect(FXObject*, FXSelector, void*) {
3657 if (junction != nullptr) {
3658 myNet->splitJunction(junction, true, myUndoList);
3659 }
3660 // destroy pop-up and set focus in view net
3661 destroyPopup();
3662 setFocus();
3663 return 1;
3664}
3665
3666long
3667GNEViewNet::onCmdSelectRoundabout(FXObject*, FXSelector, void*) {
3669 if (junction != nullptr) {
3670 myNet->selectRoundabout(junction, myUndoList);
3671 }
3672 // destroy pop-up and set focus in view net
3673 destroyPopup();
3674 setFocus();
3675 return 1;
3676}
3677
3678long
3679GNEViewNet::onCmdConvertRoundabout(FXObject*, FXSelector, void*) {
3681 if (junction != nullptr) {
3682 myNet->createRoundabout(junction, myUndoList);
3683 }
3684 // destroy pop-up and set focus in view net
3685 destroyPopup();
3686 setFocus();
3687 return 1;
3688}
3689
3690
3691long
3692GNEViewNet::onEnterConvertRoundabout(FXObject*, FXSelector, void*) {
3694 update();
3695 return 1;
3696}
3697
3698
3699long
3700GNEViewNet::onLeaveConvertRoundabout(FXObject*, FXSelector, void*) {
3702 update();
3703 return 1;
3704}
3705
3706
3707long
3708GNEViewNet::onCmdClearConnections(FXObject*, FXSelector, void*) {
3710 if (junction != nullptr) {
3711 // make sure we do not inspect the connection will it is being deleted
3714 }
3715 // make sure that connections isn't the front attribute
3716 const auto frontElements = myMarkFrontElements.getACs();
3717 for (const auto& AC : frontElements) {
3718 if (AC->getTagProperty()->getTag() == SUMO_TAG_CONNECTION) {
3720 }
3721 }
3722 // check if we're handling a selection
3723 if (junction->isAttributeCarrierSelected()) {
3724 const auto selectedJunctions = myNet->getAttributeCarriers()->getSelectedJunctions();
3725 myUndoList->begin(GUIIcon::CONNECTION, TL("clear connections of selected junctions"));
3726 for (const auto& selectedJunction : selectedJunctions) {
3727 myNet->clearJunctionConnections(selectedJunction, myUndoList);
3728 }
3729 myUndoList->end();
3730 } else {
3732 }
3733 }
3734 // destroy pop-up and set focus in view net
3735 destroyPopup();
3736 setFocus();
3737 return 1;
3738}
3739
3740
3741long
3742GNEViewNet::onCmdResetConnections(FXObject*, FXSelector, void*) {
3744 if (junction != nullptr) {
3745 // make sure we do not inspect the connection will it is being deleted
3748 }
3749 // make sure that connections isn't the front attribute
3750 const auto frontElements = myMarkFrontElements.getACs();
3751 for (const auto& AC : frontElements) {
3752 if (AC->getTagProperty()->getTag() == SUMO_TAG_CONNECTION) {
3754 }
3755 }
3756 // check if we're handling a selection
3757 if (junction->isAttributeCarrierSelected()) {
3758 const auto selectedJunctions = myNet->getAttributeCarriers()->getSelectedJunctions();
3759 myUndoList->begin(GUIIcon::CONNECTION, TL("reset connections of selected junctions"));
3760 for (const auto& selectedJunction : selectedJunctions) {
3761 myNet->resetJunctionConnections(selectedJunction, myUndoList);
3762 }
3763 myUndoList->end();
3764 } else {
3766 }
3767 }
3768 // destroy pop-up and set focus in view net
3769 destroyPopup();
3770 setFocus();
3771 return 1;
3772}
3773
3774
3775long
3776GNEViewNet::onCmdAddTLS(FXObject*, FXSelector, void*) {
3778 if (junction != nullptr) {
3779 // check if we're adding TLS in multiple junctions
3780 if (junction->isAttributeCarrierSelected()) {
3781 const auto selectedJunctions = myNet->getAttributeCarriers()->getSelectedJunctions();
3782 myNet->getViewNet()->getUndoList()->begin(GUIIcon::MODETLS, TL("add TLS in multiple junctions"));
3783 for (const auto& selectedJunction : selectedJunctions) {
3784 selectedJunction->setAttribute(SUMO_ATTR_TYPE, "traffic_light", myUndoList);
3785 }
3787 } else {
3788 // change junction type
3789 junction->setAttribute(SUMO_ATTR_TYPE, "traffic_light", myUndoList);
3790 // change to TLS Mode
3792 // set junction in TLS mode
3794 }
3795 }
3796 // destroy pop-up and set focus in view net
3797 destroyPopup();
3798 setFocus();
3799 return 1;
3800}
3801
3802
3803long
3804GNEViewNet::onCmdAddJoinTLS(FXObject*, FXSelector, void*) {
3806 if (junction != nullptr) {
3807 // check if we're adding TLS in multiple junctions
3808 if (junction->isAttributeCarrierSelected()) {
3809 myNet->getViewNet()->getUndoList()->begin(GUIIcon::MODETLS, TL("add TLS in multiple junctions"));
3810 }
3811 // change junction type
3812 junction->setAttribute(SUMO_ATTR_TYPE, "traffic_light", myUndoList);
3813 // if TLS was sucesfully created, apply the same TLID to other selected junctions
3814 if (junction->getAttribute(SUMO_ATTR_TLID).size() > 0) {
3815 const auto selectedJunctions = myNet->getAttributeCarriers()->getSelectedJunctions();
3816 // iterate over all selected junctions
3817 for (const auto& selectedJunction : selectedJunctions) {
3818 // check that doesn't have a TL
3819 if (selectedJunction->getNBNode()->getControllingTLS().empty()) {
3820 selectedJunction->setAttribute(SUMO_ATTR_TYPE, "traffic_light", myUndoList);
3821 selectedJunction->setAttribute(SUMO_ATTR_TLID, junction->getAttribute(SUMO_ATTR_TLID), myUndoList);
3822 }
3823 }
3824 }
3825 // rename traffic light
3826 if (junction->getNBNode()->getControllingTLS().size() > 0) {
3827 const auto TLSDef = (*junction->getNBNode()->getControllingTLS().begin());
3828 if (!myNet->getTLLogicCont().exist(TLSDef->getID() + "_joined")) {
3829 myUndoList->add(new GNEChange_TLS(junction, TLSDef, TLSDef->getID() + "_joined"), true);
3830 }
3831 }
3832 // end undoList
3833 if (junction->isAttributeCarrierSelected()) {
3835 }
3836 // change to TLS Mode
3838 // set junction in TLS mode
3840 }
3841 // destroy pop-up and set focus in view net
3842 destroyPopup();
3843 setFocus();
3844 return 1;
3845}
3846
3847long
3848GNEViewNet::onCmdEditConnectionShape(FXObject*, FXSelector, void*) {
3849 // Obtain connection under mouse
3851 if (connection) {
3853 }
3854 // if grid is enabled, show warning
3856 WRITE_WARNING(TL("Grid is still active, press ctrl+g to deactivate"));
3857 }
3858 // destroy pop-up and update view Net
3859 destroyPopup();
3860 setFocus();
3861 return 1;
3862}
3863
3864
3865long
3866GNEViewNet::onCmdSmoothConnectionShape(FXObject*, FXSelector, void*) {
3867 // Obtain connection under mouse
3869 if (connection) {
3870 connection->smootShape();
3871 }
3872 // destroy pop-up and update view Net
3873 destroyPopup();
3874 setFocus();
3875 return 1;
3876}
3877
3878
3879long
3880GNEViewNet::onCmdEditCrossingShape(FXObject*, FXSelector, void*) {
3881 // Obtain crossing under mouse
3883 if (crossing) {
3884 // check if network has to be updated
3885 if (crossing->getParentJunctions().front()->getNBNode()->getShape().size() == 0) {
3886 // recompute the whole network
3888 }
3889 // if grid is enabled, show warning
3891 WRITE_WARNING(TL("Grid is still active, press ctrl+g to deactivate"));
3892 }
3893 // start edit custom shape
3895 }
3896 // destroy pop-up and update view Net
3897 destroyPopup();
3898 setFocus();
3899 return 1;
3900}
3901
3902
3903long
3904GNEViewNet::onCmdEditWalkingAreaShape(FXObject*, FXSelector, void*) {
3905 // Obtain walkingArea under mouse
3907 if (walkingArea) {
3908 // check if network has to be updated
3909 if (walkingArea->getParentJunctions().front()->getNBNode()->getShape().size() == 0) {
3910 // recompute the whole network
3912 // if grid is enabled, show warning
3914 WRITE_WARNING(TL("Grid is still active, press ctrl+g to deactivate"));
3915 }
3916 }
3917 // start edit custom shape
3919 }
3920 // destroy pop-up and update view Net
3921 destroyPopup();
3922 setFocus();
3923 return 1;
3924}
3925
3926
3927long
3928GNEViewNet::onCmdToggleSelectEdges(FXObject*, FXSelector sel, void*) {
3929 // Toggle menuCheckSelectEdges
3932 } else {
3934 }
3936 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
3937 if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_SELECTEDGES)) {
3939 }
3940 return 1;
3941}
3942
3943
3944long
3945GNEViewNet::onCmdToggleShowConnections(FXObject*, FXSelector sel, void*) {
3946 // Toggle menuCheckShowConnections
3949 } else {
3951 }
3953 // if show was enabled, init GNEConnections
3956 }
3957 // change flag "showLane2Lane" in myVisualizationSettings
3959 // Hide/show connections require recompute
3961 // Update viewNet to show/hide connections
3962 updateViewNet();
3963 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
3964 if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_SHOWCONNECTIONS)) {
3966 }
3967 return 1;
3968}
3969
3970
3971long
3972GNEViewNet::onCmdToggleHideConnections(FXObject*, FXSelector sel, void*) {
3973 // Toggle menuCheckHideConnections
3976 } else {
3978 }
3980 // Update viewNet to show/hide connections
3981 updateViewNet();
3982 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
3983 if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_HIDECONNECTIONS)) {
3985 }
3986 return 1;
3987}
3988
3989
3990long
3991GNEViewNet::onCmdToggleShowAdditionalSubElements(FXObject*, FXSelector sel, void*) {
3992 // Toggle menuCheckShowAdditionalSubElements
3995 } else {
3997 }
3999 // Update viewNet to show/hide sub elements
4000 updateViewNet();
4001 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4002 if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_SHOWSUBADDITIONALS)) {
4004 }
4005 return 1;
4006}
4007
4008
4009long
4010GNEViewNet::onCmdToggleShowTAZElements(FXObject*, FXSelector sel, void*) {
4011 // Toggle menuCheckShowAdditionalSubElements
4014 } else {
4016 }
4018 // Update viewNet to show/hide TAZ elements
4019 updateViewNet();
4020 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4021 if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_SHOWTAZELEMENTS)) {
4023 }
4024 return 1;
4025}
4026
4027
4028long
4029GNEViewNet::onCmdToggleExtendSelection(FXObject*, FXSelector sel, void*) {
4030 // Toggle menuCheckExtendSelection
4033 } else {
4035 }
4037 // Only update view
4038 updateViewNet();
4039 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4040 if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_EXTENDSELECTION)) {
4042 }
4043 return 1;
4044}
4045
4046
4047long
4048GNEViewNet::onCmdToggleChangeAllPhases(FXObject*, FXSelector sel, void*) {
4049 // Toggle menuCheckChangeAllPhases
4052 } else {
4054 }
4056 // Only update view
4057 updateViewNet();
4058 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4059 if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_CHANGEALLPHASES)) {
4061 }
4062 return 1;
4063}
4064
4065
4066long
4067GNEViewNet::onCmdToggleShowGrid(FXObject*, FXSelector sel, void*) {
4068 // show or hide grid depending of myNetworkViewOptions.menuCheckToggleGrid
4073 } else {
4077 }
4080 // update view to show grid
4081 updateViewNet();
4082 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4083 if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_TOGGLEGRID)) {
4085 } else if (sel == FXSEL(SEL_COMMAND, MID_GNE_DEMANDVIEWOPTIONS_SHOWGRID)) {
4087 }
4088 return 1;
4089}
4090
4091
4092long
4093GNEViewNet::onCmdToggleDrawJunctionShape(FXObject*, FXSelector sel, void*) {
4094 // toggle state
4096 // gui button has 'hide' semantics
4097 const bool hide = !myVisualizationSettings->drawJunctionShape;
4101
4105 // update view to show DrawJunctionShape
4106 updateViewNet();
4107 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4108 if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_TOGGLEDRAWJUNCTIONSHAPE)) {
4110 } else if (sel == FXSEL(SEL_COMMAND, MID_GNE_DEMANDVIEWOPTIONS_TOGGLEDRAWJUNCTIONSHAPE)) {
4112 } else if (sel == FXSEL(SEL_COMMAND, MID_GNE_DATAVIEWOPTIONS_TOGGLEDRAWJUNCTIONSHAPE)) {
4114 }
4115 return 1;
4116}
4117
4118long
4119GNEViewNet::onCmdToggleDrawSpreadVehicles(FXObject*, FXSelector sel, void*) {
4120 // Toggle menuCheckShowDemandElements
4125 } else {
4128 }
4131 // declare edge set
4132 std::set<GNEEdge*> edgesToUpdate;
4133 // compute vehicle geometry
4134 for (const auto& vehicle : myNet->getAttributeCarriers()->getDemandElements().at(SUMO_TAG_VEHICLE)) {
4135 if (vehicle.second->getParentEdges().size() > 0) {
4136 edgesToUpdate.insert(vehicle.second->getParentEdges().front());
4137 } else if (vehicle.second->getChildDemandElements().size() > 0 && (vehicle.second->getChildDemandElements().front()->getTagProperty()->getTag() == GNE_TAG_ROUTE_EMBEDDED)) {
4138 edgesToUpdate.insert(vehicle.second->getChildDemandElements().front()->getParentEdges().front());
4139 }
4140 }
4141 for (const auto& routeFlow : myNet->getAttributeCarriers()->getDemandElements().at(GNE_TAG_FLOW_ROUTE)) {
4142 if (routeFlow.second->getParentEdges().size() > 0) {
4143 edgesToUpdate.insert(routeFlow.second->getParentEdges().front());
4144 } else if (routeFlow.second->getChildDemandElements().size() > 0 && (routeFlow.second->getChildDemandElements().front()->getTagProperty()->getTag() == GNE_TAG_ROUTE_EMBEDDED)) {
4145 edgesToUpdate.insert(routeFlow.second->getChildDemandElements().front()->getParentEdges().front());
4146 }
4147 }
4148 for (const auto& trip : myNet->getAttributeCarriers()->getDemandElements().at(SUMO_TAG_TRIP)) {
4149 if (trip.second->getParentEdges().size() > 0) {
4150 edgesToUpdate.insert(trip.second->getParentEdges().front());
4151 }
4152 }
4153 for (const auto& flow : myNet->getAttributeCarriers()->getDemandElements().at(SUMO_TAG_FLOW)) {
4154 if (flow.second->getParentEdges().size() > 0) {
4155 edgesToUpdate.insert(flow.second->getParentEdges().front());
4156 }
4157 }
4158 // update spread geometries of all edges
4159 for (const auto& edge : edgesToUpdate) {
4160 edge->updateVehicleSpreadGeometries();
4161 }
4162 // update view to show new vehicles positions
4163 updateViewNet();
4164 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4165 if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_DRAWSPREADVEHICLES)) {
4167 } else if (sel == FXSEL(SEL_COMMAND, MID_GNE_DEMANDVIEWOPTIONS_DRAWSPREADVEHICLES)) {
4169 }
4170 return 1;
4171}
4172
4173
4174long
4175GNEViewNet::onCmdToggleMergeAutomatically(FXObject*, FXSelector sel, void*) {
4176 // Toggle menuCheckWarnAboutMerge
4179 } else {
4181 }
4183 // Only update view
4184 updateViewNet();
4185 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4186 if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_MERGEAUTOMATICALLY)) {
4188 }
4189 return 1;
4190}
4191
4192
4193long
4194GNEViewNet::onCmdToggleShowJunctionBubbles(FXObject*, FXSelector sel, void*) {
4195 // Toggle menuCheckShowJunctionBubble
4198 } else {
4200 }
4202 // Only update view
4203 updateViewNet();
4204 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4205 if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_SHOWBUBBLES)) {
4207 }
4208 return 1;
4209}
4210
4211
4212long
4213GNEViewNet::onCmdToggleMoveElevation(FXObject*, FXSelector sel, void*) {
4214 // Toggle menuCheckMoveElevation
4217 } else {
4219 }
4221 // Only update view
4222 updateViewNet();
4223 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4224 if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_MOVEELEVATION)) {
4226 }
4227 return 1;
4228}
4229
4230
4231long
4232GNEViewNet::onCmdToggleChainEdges(FXObject*, FXSelector sel, void*) {
4233 // Toggle menuCheckMoveElevation
4236 } else {
4238 }
4240 // Only update view
4241 updateViewNet();
4242 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4243 if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_CHAINEDGES)) {
4245 }
4246 return 1;
4247}
4248
4249
4250long
4251GNEViewNet::onCmdToggleAutoOppositeEdge(FXObject*, FXSelector sel, void*) {
4252 // Toggle menuCheckAutoOppositeEdge
4255 } else {
4257 }
4259 // Only update view
4260 updateViewNet();
4261 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4262 if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_AUTOOPPOSITEEDGES)) {
4264 }
4265 return 1;
4266}
4267
4268
4269long
4271 // Toggle menuCheckHideNonInspectedDemandElements
4274 } else {
4276 }
4278 // Only update view
4279 updateViewNet();
4280 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4281 if (sel == FXSEL(SEL_COMMAND, MID_GNE_DEMANDVIEWOPTIONS_HIDENONINSPECTED)) {
4283 }
4284 return 1;
4285}
4286
4287
4288long
4289GNEViewNet::onCmdToggleShowOverlappedRoutes(FXObject*, FXSelector sel, void*) {
4290 // Toggle menuCheckShowOverlappedRoutes
4293 } else {
4295 }
4297 // Only update view
4298 updateViewNet();
4299 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4300 if (sel == FXSEL(SEL_COMMAND, MID_GNE_DEMANDVIEWOPTIONS_SHOWOVERLAPPEDROUTES)) {
4302 }
4303 return 1;
4304}
4305
4306
4307long
4308GNEViewNet::onCmdToggleHideShapes(FXObject*, FXSelector sel, void*) {
4309 // Toggle menuCheckHideShapes
4312 } else {
4314 }
4316 // Only update view
4317 updateViewNet();
4318 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4319 if (sel == FXSEL(SEL_COMMAND, MID_GNE_DEMANDVIEWOPTIONS_HIDESHAPES)) {
4321 }
4322 return 1;
4323}
4324
4325
4326long
4327GNEViewNet::onCmdToggleShowTrips(FXObject*, FXSelector sel, void*) {
4328 // Toggle menuCheckHideShapes
4331 } else {
4333 }
4335 // Only update view
4336 updateViewNet();
4337 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4338 if (sel == FXSEL(SEL_COMMAND, MID_GNE_DEMANDVIEWOPTIONS_SHOWTRIPS)) {
4340 }
4341 return 1;
4342}
4343
4344
4345long
4346GNEViewNet::onCmdToggleShowAllPersonPlans(FXObject*, FXSelector sel, void*) {
4347 // Toggle menuCheckShowAllPersonPlans
4350 } else {
4352 }
4354 // Only update view
4355 updateViewNet();
4356 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4357 if (sel == FXSEL(SEL_COMMAND, MID_GNE_DEMANDVIEWOPTIONS_SHOWALLPERSONPLANS)) {
4359 }
4360 return 1;
4361}
4362
4363
4364long
4365GNEViewNet::onCmdToggleLockPerson(FXObject*, FXSelector sel, void*) {
4366 // Toggle menuCheckLockPerson
4371 }
4373 // lock or unlock current inspected person depending of menuCheckLockPerson value
4375 // obtain locked person or person plan
4376 const GNEDemandElement* personOrPersonPlan = dynamic_cast<const GNEDemandElement*>(myInspectedElements.getFirstAC());
4377 if (personOrPersonPlan) {
4378 // lock person depending if casted demand element is either a person or a person plan
4379 if (personOrPersonPlan->getTagProperty()->isPerson()) {
4380 myDemandViewOptions.lockPerson(personOrPersonPlan);
4381 } else {
4382 myDemandViewOptions.lockPerson(personOrPersonPlan->getParentDemandElements().front());
4383 }
4384 }
4385 } else {
4386 // unlock current person
4388 }
4389 // update view
4390 updateViewNet();
4391 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4392 if (sel == FXSEL(SEL_COMMAND, MID_GNE_DEMANDVIEWOPTIONS_LOCKPERSON)) {
4394 }
4395 return 1;
4396}
4397
4398
4399long
4400GNEViewNet::onCmdToggleShowAllContainerPlans(FXObject*, FXSelector sel, void*) {
4401 // Toggle menuCheckShowAllContainerPlans
4404 } else {
4406 }
4408 // Only update view
4409 updateViewNet();
4410 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4411 if (sel == FXSEL(SEL_COMMAND, MID_GNE_DEMANDVIEWOPTIONS_SHOWALLCONTAINERPLANS)) {
4413 }
4414 return 1;
4415}
4416
4417
4418long
4419GNEViewNet::onCmdToggleLockContainer(FXObject*, FXSelector sel, void*) {
4420 // Toggle menuCheckLockContainer
4425 }
4427 // lock or unlock current inspected container depending of menuCheckLockContainer value
4429 // obtain locked container or container plan
4430 const GNEDemandElement* containerOrContainerPlan = dynamic_cast<const GNEDemandElement*>(myInspectedElements.getFirstAC());
4431 if (containerOrContainerPlan) {
4432 // lock container depending if casted demand element is either a container or a container plan
4433 if (containerOrContainerPlan->getTagProperty()->isContainer()) {
4434 myDemandViewOptions.lockContainer(containerOrContainerPlan);
4435 } else {
4436 myDemandViewOptions.lockContainer(containerOrContainerPlan->getParentDemandElements().front());
4437 }
4438 }
4439 } else {
4440 // unlock current container
4442 }
4443 // update view
4444 updateViewNet();
4445 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4446 if (sel == FXSEL(SEL_COMMAND, MID_GNE_DEMANDVIEWOPTIONS_LOCKCONTAINER)) {
4448 }
4449 return 1;
4450}
4451
4452
4453long
4454GNEViewNet::onCmdToggleShowAdditionals(FXObject*, FXSelector sel, void*) {
4455 // Toggle menuCheckShowAdditionals
4458 } else {
4460 }
4462 // Only update view
4463 updateViewNet();
4464 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4465 if (sel == FXSEL(SEL_COMMAND, MID_GNE_DATAVIEWOPTIONS_SHOWADDITIONALS)) {
4467 }
4468 return 1;
4469}
4470
4471
4472long
4473GNEViewNet::onCmdToggleShowShapes(FXObject*, FXSelector sel, void*) {
4474 // Toggle menuCheckShowShapes
4477 } else {
4479 }
4481 // Only update view
4482 updateViewNet();
4483 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4484 if (sel == FXSEL(SEL_COMMAND, MID_GNE_DATAVIEWOPTIONS_SHOWSHAPES)) {
4486 }
4487 return 1;
4488}
4489
4490
4491long
4492GNEViewNet::onCmdToggleShowDemandElementsNetwork(FXObject*, FXSelector sel, void*) {
4493 // Toggle menuCheckShowDemandElements
4496 } else {
4498 }
4500 // compute demand elements
4502 // update view to show demand elements
4503 updateViewNet();
4504 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4505 if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_SHOWDEMANDELEMENTS)) {
4507 }
4508 return 1;
4509}
4510
4511
4512long
4513GNEViewNet::onCmdToggleShowDemandElementsData(FXObject*, FXSelector sel, void*) {
4514 // Toggle menuCheckShowDemandElements
4517 } else {
4519 }
4521 // compute demand elements
4523 // update view to show demand elements
4524 updateViewNet();
4525 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4526 if (sel == FXSEL(SEL_COMMAND, MID_GNE_DATAVIEWOPTIONS_SHOWDEMANDELEMENTS)) {
4528 }
4529 return 1;
4530}
4531
4532
4533long
4534GNEViewNet::onCmdToggleTAZRelDrawing(FXObject*, FXSelector sel, void*) {
4535 // Toggle menuCheckShowDemandElements
4538 } else {
4540 }
4542 // update view to show demand elements
4543 updateViewNet();
4544 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4545 if (sel == FXSEL(SEL_COMMAND, MID_GNE_DATAVIEWOPTIONS_TAZRELDRAWING)) {
4547 }
4548 return 1;
4549}
4550
4551
4552long
4553GNEViewNet::onCmdToggleTAZDrawFill(FXObject*, FXSelector sel, void*) {
4554 // Toggle menuCheckShowDemandElements
4557 } else {
4559 }
4561 // update view to show demand elements
4562 updateViewNet();
4563 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4564 if (sel == FXSEL(SEL_COMMAND, MID_GNE_DATAVIEWOPTIONS_TAZDRAWFILL)) {
4566 }
4567 return 1;
4568}
4569
4570
4571long
4572GNEViewNet::onCmdToggleTAZRelOnlyFrom(FXObject*, FXSelector sel, void*) {
4573 // Toggle menuCheckShowDemandElements
4576 } else {
4578 }
4580 // update view to show demand elements
4581 updateViewNet();
4582 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4583 if (sel == FXSEL(SEL_COMMAND, MID_GNE_DATAVIEWOPTIONS_TAZRELONLYFROM)) {
4585 }
4586 return 1;
4587}
4588
4589
4590long
4591GNEViewNet::onCmdToggleTAZRelOnlyTo(FXObject*, FXSelector sel, void*) {
4592 // Toggle menuCheckShowDemandElements
4595 } else {
4597 }
4599 // update view to show demand elements
4600 updateViewNet();
4601 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4602 if (sel == FXSEL(SEL_COMMAND, MID_GNE_DATAVIEWOPTIONS_TAZRELONLYTO)) {
4604 }
4605 return 1;
4606}
4607
4608
4609long
4610GNEViewNet::onCmdIntervalBarGenericDataType(FXObject*, FXSelector, void*) {
4612 return 1;
4613}
4614
4615
4616long
4617GNEViewNet::onCmdIntervalBarDataSet(FXObject*, FXSelector, void*) {
4619 return 1;
4620}
4621
4622
4623long
4624GNEViewNet::onCmdIntervalBarLimit(FXObject*, FXSelector, void*) {
4626 return 1;
4627}
4628
4629
4630long
4631GNEViewNet::onCmdIntervalBarSetBegin(FXObject*, FXSelector, void*) {
4633 return 1;
4634}
4635
4636
4637long
4638GNEViewNet::onCmdIntervalBarSetEnd(FXObject*, FXSelector, void*) {
4640 return 1;
4641}
4642
4643
4644long
4645GNEViewNet::onCmdIntervalBarSetParameter(FXObject*, FXSelector, void*) {
4647 return 1;
4648}
4649
4650
4651long
4652GNEViewNet::onCmdAddSelected(FXObject*, FXSelector, void*) {
4653 // only select if AC under cursor isn't previously selected
4655 if (AC && !AC->isAttributeCarrierSelected()) {
4657 }
4658 return 1;
4659}
4660
4661
4662long
4663GNEViewNet::onCmdRemoveSelected(FXObject*, FXSelector, void*) {
4664 // only unselect if AC under cursor isn't previously selected
4666 if (AC && AC->isAttributeCarrierSelected()) {
4668 }
4669 return 1;
4670}
4671
4672
4673long
4674GNEViewNet::onCmdAddEdgeSelected(FXObject*, FXSelector, void*) {
4675 // only select if edge under cursor isn't previously selected
4676 auto edge = myViewObjectsSelector.getEdgeFront();
4677 if (edge && !edge->isAttributeCarrierSelected()) {
4678 edge->selectAttributeCarrier();
4679 }
4680 return 1;
4681}
4682
4683
4684long
4685GNEViewNet::onCmdRemoveEdgeSelected(FXObject*, FXSelector, void*) {
4686 // only unselect if edge under cursor isn't previously selected
4687 auto edge = myViewObjectsSelector.getEdgeFront();
4688 if (edge && edge->isAttributeCarrierSelected()) {
4690 }
4691 return 1;
4692}
4693
4694
4695long
4696GNEViewNet::onCmdSetNeteditView(FXObject*, FXSelector sel, void*) {
4697 myEditModes.setView(FXSELID(sel));
4698 update();
4699 return 1;
4700}
4701
4702// ===========================================================================
4703// private
4704// ===========================================================================
4705
4706void
4708 // build supermode buttons
4710
4711 // build save elements buttons
4713
4714 // build time switch buttons
4716
4717 // build menu checks for Common checkable buttons
4719
4720 // build menu checks for Network checkable buttons
4722
4723 // build menu checks for Demand checkable buttons
4725
4726 // build menu checks of view options Data
4728
4729 // Create Vertical separator
4731 // XXX for some reason the vertical groove is not visible. adding more spacing to emphasize the separation
4734
4735 // build menu checks of view options Network
4737
4738 // build menu checks of view options Demand
4740
4741 // build menu checks of view options Data
4743
4744 // build interval bar
4746}
4747
4748
4749void
4751 // get menu checks
4753 // hide all checkbox of view options Network
4755 // hide all checkbox of view options Demand
4757 // hide all checkbox of view options Data
4759 // disable all common edit modes
4761 // disable all network edit modes
4763 // disable all network edit modes
4765 // hide interval bar
4767 // hide all frames
4769 // hide all menuchecks
4773 // In network mode, always show option "show grid", "draw spread vehicles" and "show demand elements"
4778 menuChecks.menuCheckToggleGrid->show();
4779 menuChecks.menuCheckToggleDrawJunctionShape->show();
4780 menuChecks.menuCheckDrawSpreadVehicles->show();
4781 menuChecks.menuCheckShowDemandElements->show();
4782 // show separator
4783 menuChecks.separator->show();
4784 // enable selected controls
4785 switch (myEditModes.networkEditMode) {
4786 // common modes
4792 // show view options
4798 // show menu checks
4799 menuChecks.menuCheckSelectEdges->show();
4800 menuChecks.menuCheckShowConnections->show();
4801 menuChecks.menuCheckShowAdditionalSubElements->show();
4802 menuChecks.menuCheckShowTAZElements->show();
4803 menuChecks.menuCheckShowJunctionBubble->show();
4804 // update lock menu bar
4806 // show
4807 break;
4817 // show view options
4820 menuChecks.menuCheckShowAdditionalSubElements->show();
4821 menuChecks.menuCheckShowTAZElements->show();
4822 menuChecks.menuCheckShowJunctionBubble->show();
4823 // show menu checks
4824 menuChecks.menuCheckSelectEdges->show();
4825 menuChecks.menuCheckShowConnections->show();
4826 break;
4832 // show view options
4839 // show menu checks
4840 menuChecks.menuCheckSelectEdges->show();
4841 menuChecks.menuCheckShowConnections->show();
4842 menuChecks.menuCheckExtendSelection->show();
4843 menuChecks.menuCheckShowAdditionalSubElements->show();
4844 menuChecks.menuCheckShowTAZElements->show();
4845 menuChecks.menuCheckShowJunctionBubble->show();
4846 break;
4847 // specific modes
4853 // show view options
4857 // show menu checks
4858 menuChecks.menuCheckChainEdges->show();
4859 menuChecks.menuCheckAutoOppositeEdge->show();
4860 menuChecks.menuCheckShowJunctionBubble->show();
4861 break;
4867 // show view options
4871 // show menu checks
4872 menuChecks.menuCheckMergeAutomatically->show();
4873 menuChecks.menuCheckShowJunctionBubble->show();
4874 menuChecks.menuCheckMoveElevation->show();
4875 break;
4881 break;
4887 // show view options
4889 // show menu checks
4890 menuChecks.menuCheckChangeAllPhases->show();
4891 break;
4897 // show view options
4899 // show menu checks
4900 menuChecks.menuCheckShowAdditionalSubElements->show();
4901 break;
4907 break;
4913 break;
4919 break;
4925 break;
4931 break;
4937 break;
4938 default:
4939 break;
4940 }
4941 // update menuChecks shorcuts
4942 menuChecks.updateShortcuts();
4943 // update common Network buttons
4945 // Update Network buttons
4947 // recalc toolbar
4950 // force repaint because different modes draw different things
4951 onPaint(nullptr, 0, nullptr);
4952 // finally update view
4953 updateViewNet();
4954}
4955
4956
4957void
4959 // get menu checks
4961 // hide all checkbox of view options Network
4963 // hide all checkbox of view options Demand
4965 // hide all checkbox of view options Data
4967 // disable all common edit modes
4969 // disable all Demand edit modes
4971 // disable all network edit modes
4973 // hide interval bar
4975 // hide all frames
4977 // hide all menuchecks
4981 // always show "hide shapes", "show grid", "draw spread vehicles", "show overlapped routes" and show/lock persons and containers
4992 menuChecks.menuCheckToggleGrid->show();
4993 menuChecks.menuCheckToggleDrawJunctionShape->show();
4994 menuChecks.menuCheckDrawSpreadVehicles->show();
4995 menuChecks.menuCheckHideShapes->show();
4996 menuChecks.menuCheckShowAllTrips->show();
4997 menuChecks.menuCheckShowAllPersonPlans->show();
4998 menuChecks.menuCheckLockPerson->show();
4999 menuChecks.menuCheckShowAllContainerPlans->show();
5000 menuChecks.menuCheckLockContainer->show();
5001 menuChecks.menuCheckShowOverlappedRoutes->show();
5002 // show separator
5003 menuChecks.separator->show();
5004 // enable selected controls
5005 switch (myEditModes.demandEditMode) {
5006 // common modes
5011 // set checkable button
5013 // show view options
5015 // show menu checks
5016 menuChecks.menuCheckHideNonInspectedDemandElements->show();
5017 break;
5022 // set checkable button
5024 break;
5029 // set checkable button
5031 break;
5036 // set checkable button
5038 break;
5039 // specific modes
5044 // set checkable button
5046 break;
5051 // set checkable button
5053 break;
5058 // set checkable button
5060 break;
5065 // set checkable button
5067 break;
5072 // set checkable button
5074 break;
5079 // set checkable button
5081 break;
5086 // set checkable button
5088 break;
5093 // set checkable button
5095 break;
5100 // set checkable button
5102 break;
5107 // set checkable button
5109 break;
5110 default:
5111 break;
5112 }
5113 // update menuChecks shorcuts
5114 menuChecks.updateShortcuts();
5115 // update common Network buttons
5117 // Update Demand buttons
5119 // recalc toolbar
5122 // force repaint because different modes draw different things
5123 onPaint(nullptr, 0, nullptr);
5124 // finally update view
5125 updateViewNet();
5126}
5127
5128
5129void
5131 // get menu checks
5133 // hide all checkbox of view options Network
5135 // hide all checkbox of view options Demand
5137 // hide all checkbox of view options Data
5139 // disable all common edit modes
5141 // disable all Data edit modes
5143 // show interval bar
5145 // hide all frames
5147 // hide all menuchecks
5151 // In data mode, always show options for show elements
5156 menuChecks.menuCheckToggleDrawJunctionShape->show();
5157 menuChecks.menuCheckShowAdditionals->show();
5158 menuChecks.menuCheckShowShapes->show();
5159 menuChecks.menuCheckShowDemandElements->show();
5160 // show separator
5161 menuChecks.separator->show();
5162 // enable selected controls
5163 switch (myEditModes.dataEditMode) {
5164 // common modes
5169 // set checkable button
5171 // show view option
5176 // show menu check
5177 menuChecks.menuCheckToggleTAZRelDrawing->show();
5178 menuChecks.menuCheckToggleTAZDrawFill->show();
5179 menuChecks.menuCheckToggleTAZRelOnlyFrom->show();
5180 menuChecks.menuCheckToggleTAZRelOnlyTo->show();
5181 break;
5186 // set checkable button
5188 // show toggle TAZRel drawing view option
5192 // show toggle TAZRel drawing menu check
5193 menuChecks.menuCheckToggleTAZRelDrawing->show();
5194 menuChecks.menuCheckToggleTAZRelOnlyFrom->show();
5195 menuChecks.menuCheckToggleTAZRelOnlyTo->show();
5196 break;
5201 // set checkable button
5203 // show toggle TAZRel drawing view option
5207 // show toggle TAZRel drawing menu check
5208 menuChecks.menuCheckToggleTAZRelDrawing->show();
5209 menuChecks.menuCheckToggleTAZRelOnlyFrom->show();
5210 menuChecks.menuCheckToggleTAZRelOnlyTo->show();
5211 break;
5216 // set checkable button
5218 break;
5223 // set checkable button
5225 break;
5230 // set checkable button
5232 // show view option
5237 // show menu check
5238 menuChecks.menuCheckToggleTAZRelDrawing->show();
5239 menuChecks.menuCheckToggleTAZDrawFill->show();
5240 menuChecks.menuCheckToggleTAZRelOnlyFrom->show();
5241 menuChecks.menuCheckToggleTAZRelOnlyTo->show();
5242 break;
5247 // set checkable button
5249 break;
5250 default:
5251 break;
5252 }
5253 // update menuChecks shorcuts
5254 menuChecks.updateShortcuts();
5255 // update common Network buttons
5257 // Update Data buttons
5259 // recalc toolbar
5262 // force repaint because different modes draw different things
5263 onPaint(nullptr, 0, nullptr);
5264 // finally update view
5265 updateViewNet();
5266}
5267
5268
5269void
5271 if (AC->getTagProperty()->getTag() == SUMO_TAG_JUNCTION) {
5272 // get junction (note: could be already removed if is a child, then hardfail=false)
5273 GNEJunction* junction = myNet->getAttributeCarriers()->retrieveJunction(AC->getID(), false);
5274 // if exist, remove it
5275 if (junction) {
5276 myNet->deleteJunction(junction, myUndoList);
5277 }
5278 } else if (AC->getTagProperty()->getTag() == SUMO_TAG_CROSSING) {
5279 // get crossing (note: could be already removed if is a child, then hardfail=false)
5281 // if exist, remove it
5282 if (crossing) {
5283 myNet->deleteCrossing(crossing, myUndoList);
5284 }
5285 } else if (AC->getTagProperty()->getTag() == SUMO_TAG_EDGE) {
5286 // get edge (note: could be already removed if is a child, then hardfail=false)
5287 GNEEdge* edge = myNet->getAttributeCarriers()->retrieveEdge(AC->getID(), false);
5288 // if exist, remove it
5289 if (edge) {
5290 myNet->deleteEdge(edge, myUndoList, false);
5291 }
5292 } else if (AC->getTagProperty()->getTag() == SUMO_TAG_LANE) {
5293 // get lane (note: could be already removed if is a child, then hardfail=false)
5295 // if exist, remove it
5296 if (lane) {
5297 myNet->deleteLane(lane, myUndoList, false);
5298 }
5299 } else if (AC->getTagProperty()->getTag() == SUMO_TAG_CONNECTION) {
5300 // get connection (note: could be already removed if is a child, then hardfail=false)
5302 // if exist, remove it
5303 if (connection) {
5304 myNet->deleteConnection(connection, myUndoList);
5305 }
5306 } else if ((AC->getTagProperty()->getTag() == SUMO_TAG_TAZSOURCE) || (AC->getTagProperty()->getTag() == SUMO_TAG_TAZSINK)) {
5307 // get TAZ SourceSink Element (note: could be already removed if is a child, then hardfail=false)
5308 GNETAZSourceSink* TAZSourceSink = myNet->getAttributeCarriers()->retrieveTAZSourceSink(AC, false);
5309 // if exist, remove it
5310 if (TAZSourceSink) {
5311 myNet->deleteTAZSourceSink(TAZSourceSink, myUndoList);
5312 }
5313 } else if (AC->getTagProperty()->isAdditionalElement()) {
5314 // get additional Element (note: could be already removed if is a child, then hardfail=false)
5315 GNEAdditional* additionalElement = myNet->getAttributeCarriers()->retrieveAdditional(AC->getGUIGlObject(), false);
5316 // if exist, remove it
5317 if (additionalElement) {
5318 myNet->deleteAdditional(additionalElement, myUndoList);
5319 }
5320 }
5321}
5322
5323
5324void
5326 // get demand Element (note: could be already removed if is a child, then hardfail=false)
5328 // if exist, remove it
5329 if (demandElement) {
5330 myNet->deleteDemandElement(demandElement, myUndoList);
5331 }
5332}
5333
5334
5335void
5337 if (AC->getTagProperty()->getTag() == SUMO_TAG_DATASET) {
5338 // get data set (note: could be already removed if is a child, then hardfail=false)
5339 GNEDataSet* dataSet = myNet->getAttributeCarriers()->retrieveDataSet(AC->getID(), false);
5340 // if exist, remove it
5341 if (dataSet) {
5342 myNet->deleteDataSet(dataSet, myUndoList);
5343 }
5344 } else if (AC->getTagProperty()->getTag() == SUMO_TAG_DATAINTERVAL) {
5345 // get data interval (note: could be already removed if is a child, then hardfail=false)
5346 GNEDataInterval* dataInterval = myNet->getAttributeCarriers()->retrieveDataInterval(AC, false);
5347 // if exist, remove it
5348 if (dataInterval) {
5349 myNet->deleteDataInterval(dataInterval, myUndoList);
5350 }
5351 } else {
5352 // get generic data (note: could be already removed if is a child, then hardfail=false)
5354 // if exist, remove it
5355 if (genericData) {
5356 myNet->deleteGenericData(genericData, myUndoList);
5357 }
5358 }
5359}
5360
5361
5362void
5365 switch (myEditModes.networkEditMode) {
5367 myViewParent->getInspectorFrame()->update();
5368 break;
5369 default:
5370 break;
5371 }
5372 }
5374 switch (myEditModes.demandEditMode) {
5376 myViewParent->getInspectorFrame()->update();
5377 break;
5380 break;
5383 break;
5386 break;
5389 break;
5392 break;
5395 break;
5398 break;
5401 break;
5404 break;
5405 default:
5406 break;
5407 }
5408 }
5410 switch (myEditModes.dataEditMode) {
5412 myViewParent->getInspectorFrame()->update();
5413 break;
5414 default:
5415 break;
5416 }
5417 // update data interval
5419 }
5420 // update view
5421 updateViewNet();
5422}
5423
5424// ---------------------------------------------------------------------------
5425// Private methods
5426// ---------------------------------------------------------------------------
5427
5428void
5430 PositionVector temporalShape;
5431 bool deleteLastCreatedPoint = false;
5432 // obtain temporal shape and delete last created point flag
5439 }
5440 // check if we're in drawing mode
5441 if (temporalShape.size() > 0) {
5442 // draw blue line with the current drawed shape
5444 glLineWidth(2);
5445 glTranslated(0, 0, GLO_TEMPORALSHAPE);
5447 GLHelper::drawLine(temporalShape);
5449 // draw red line from the last point of shape to the current mouse position
5451 glLineWidth(2);
5452 glTranslated(0, 0, GLO_TEMPORALSHAPE);
5453 // draw last line depending if shift key (delete last created point) is pressed
5454 if (deleteLastCreatedPoint) {
5456 } else {
5458 }
5461 }
5462}
5463
5464
5465void
5467 // first check if we're in correct mode
5472 // get mouse position
5473 const Position mousePosition = snapToActiveGrid(getPositionInformation());
5474 // get junction exaggeration
5475 const double junctionExaggeration = myVisualizationSettings->junctionSize.getExaggeration(*myVisualizationSettings, nullptr, 4);
5476 // get bubble color
5478 // change alpha
5479 bubbleColor.setAlpha(200);
5480 // push layer matrix
5482 // translate to temporal shape layer
5483 glTranslated(0, 0, GLO_TEMPORALSHAPE);
5484 // push junction matrix
5486 // move matrix junction center
5487 glTranslated(mousePosition.x(), mousePosition.y(), 0.1);
5488 // set color
5489 GLHelper::setColor(bubbleColor);
5490 // draw outline circle
5491 const double circleWidth = myVisualizationSettings->neteditSizeSettings.junctionBubbleRadius * junctionExaggeration;
5492 GLHelper::drawOutlineCircle(circleWidth, circleWidth * 0.75, 32);
5493 // pop junction matrix
5495 // draw temporal edge
5497 // set temporal edge color
5498 RGBColor temporalEdgeColor = RGBColor::BLACK;
5499 temporalEdgeColor.setAlpha(200);
5500 // declare temporal edge geometry
5501 GUIGeometry temporalEdgeGeometry;
5502 // calculate geometry between source junction and mouse position
5503 PositionVector temporalEdge = {mousePosition, myViewParent->getCreateEdgeFrame()->getJunctionSource()->getPositionInView()};
5504 // move temporal edge 2 side
5505 temporalEdge.move2side(-1);
5506 // update geometry
5507 temporalEdgeGeometry.updateGeometry(temporalEdge);
5508 // push temporal edge matrix
5510 // set color
5511 GLHelper::setColor(temporalEdgeColor);
5512 // draw temporal edge
5514 // check if we have to draw opposite edge
5516 // move temporal edge to opposite edge
5517 temporalEdge.move2side(2);
5518 // update geometry
5519 temporalEdgeGeometry.updateGeometry(temporalEdge);
5520 // draw temporal edge
5522 }
5523 // pop temporal edge matrix
5525 }
5526 // pop layer matrix
5528 }
5529}
5530
5531
5532void
5534 // first check if we're in correct mode
5539 (gViewObjectsHandler.markedEdge != nullptr)) {
5540 // calculate split position
5541 const auto lane = gViewObjectsHandler.markedEdge->getChildLanes().back();
5542 auto shape = lane->getLaneShape();
5543 // move shape to side
5544 shape.move2side(lane->getDrawingConstants()->getDrawingWidth() * -1);
5545 const auto offset = shape.nearest_offset_to_point2D(snapToActiveGrid(getPositionInformation()));
5546 const auto splitPosition = shape.positionAtOffset2D(offset);
5547 // get junction exaggeration
5548 const double junctionExaggeration = myVisualizationSettings->junctionSize.getExaggeration(*myVisualizationSettings, nullptr, 4);
5549 // get bubble color
5551 // push layer matrix
5553 // translate to temporal shape layer
5554 glTranslated(0, 0, GLO_TEMPORALSHAPE);
5555 // push junction matrix
5557 // move matrix junction center
5558 glTranslated(splitPosition.x(), splitPosition.y(), 0.1);
5559 // set color
5560 GLHelper::setColor(bubbleColor);
5561 // draw outline circle
5562 const double circleWidth = myVisualizationSettings->neteditSizeSettings.junctionBubbleRadius * junctionExaggeration;
5563 GLHelper::drawOutlineCircle(circleWidth, circleWidth * 0.75, 32);
5564 // draw filled circle
5566 // pop junction matrix
5568 // pop layer matrix
5570 }
5571}
5572
5573
5574void
5576 // check conditions
5577 if ((myCurrentObjectsDialog.size() > 0) && (myCurrentObjectsDialog.front()->getType() == GLO_JUNCTION) && myDrawPreviewRoundabout) {
5578 // get junction
5579 const auto junction = myNet->getAttributeCarriers()->retrieveJunction(myCurrentObjectsDialog.front()->getMicrosimID());
5580 // push layer matrix
5582 // translate to temporal shape layer
5583 glTranslated(0, 0, GLO_TEMPORALSHAPE);
5584 // push junction matrix
5586 // move matrix junction center
5587 glTranslated(junction->getNBNode()->getPosition().x(), junction->getNBNode()->getPosition().y(), 0.1);
5588 // set color
5590 // draw outline circle
5591 const double circleWidth = (junction->getNBNode()->getRadius() < 0) ? 4.0 : junction->getNBNode()->getRadius();
5592 GLHelper::drawOutlineCircle(circleWidth * 1.30, circleWidth, 32);
5593 // pop junction matrix
5595 // pop layer matrix
5597 }
5598}
5599
5600
5601void
5603 // check conditions
5605 // get junction
5607 // push layer matrix
5609 // translate to TLLogic
5610 glTranslated(0, 0, GLO_TEMPORALSHAPE);
5611 // iterate over all E1 detectors
5612 for (const auto& E1ID : myViewParent->getTLSEditorFrame()->getTLSAttributes()->getE1Detectors()) {
5613 // first check if E1 exists
5614 const auto E1 = myNet->getAttributeCarriers()->retrieveAdditional(SUMO_TAG_INDUCTION_LOOP, E1ID.second, false);
5615 if (E1) {
5616 // push line matrix
5618 // draw line between junction and E1
5619 GUIGeometry::drawChildLine(*myVisualizationSettings, junctionPos, E1->getPositionInView(),
5621 // pop line matrix
5623 }
5624 }
5625 // pop layer matrix
5627 }
5628}
5629
5630
5631void
5633 // check conditions
5635 // get junction
5637 // push layer matrix
5639 // translate to TLLogic
5640 glTranslated(0, 0, GLO_TEMPORALSHAPE);
5641 // iterate over all Junction detectors
5642 for (const auto& selectedJunctionID : myViewParent->getTLSEditorFrame()->getTLSJunction()->getSelectedJunctionIDs()) {
5643 // get junction
5644 const auto selectedJunction = myNet->getAttributeCarriers()->retrieveJunction(selectedJunctionID);
5645 // push line matrix
5647 // draw line between junction and Junction
5648 GUIGeometry::drawChildLine(*myVisualizationSettings, junctionPos, selectedJunction->getPositionInView(),
5650 // pop line matrix
5652 }
5653 // pop layer matrix
5655 }
5656}
5657
5658
5659void
5662 /*
5663 myViewParent->getAdditionalFrame()->getNeteditAttributesEditor()->drawLaneReference(gViewObjectsHandler.markedLane);
5664 // get element length
5665 const double elementLength = getElementLength();
5666 // check lane
5667 if (lane && shown() && myReferencePointComboBox->shown() && (myReferencePoint != ReferencePoint::INVALID) &&
5668 (elementLength != INVALID_DOUBLE)) {
5669 // Obtain position of the mouse over lane (limited over grid)
5670 const double mousePosOverLane = lane->getLaneShape().nearest_offset_to_point2D(myFrameParent->getViewNet()->snapToActiveGrid(myFrameParent->getViewNet()->getPositionInformation())) / lane->getLengthGeometryFactor();
5671 // continue depending of mouse pos over lane
5672 if (mousePosOverLane >= 0) {
5673 // set start and end position
5674 const double startPos = setStartPosition(mousePosOverLane, elementLength);
5675 const double endPos = setEndPosition(mousePosOverLane, elementLength, lane->getLaneShape().length2D());
5676 // get lane geometry
5677 const auto laneShape = lane->getLaneGeometry().getShape();
5678 // difference between start-end position and elementLength
5679 const auto lengthDifference = (endPos - startPos) - elementLength;
5680 // set color
5681 RGBColor segmentColor;
5682 // check if force length
5683 if (myForceLengthFrame->shown() && (myForceLengthCheckButton->getCheck() == TRUE) && abs(lengthDifference) >= 0.1) {
5684 segmentColor = RGBColor::RED;
5685 } else {
5686 segmentColor = RGBColor::ORANGE;
5687 }
5688 // declare geometries
5689 GUIGeometry geometry;
5690 // trim geomtry
5691 geometry.updateGeometry(laneShape,
5692 (startPos == INVALID_DOUBLE) ? -1 : startPos,
5693 Position::INVALID,
5694 (endPos == INVALID_DOUBLE) ? -1 : endPos,
5695 Position::INVALID);
5696 // push layer matrix
5697 GLHelper::pushMatrix();
5698 // translate to temporal shape layer
5699 glTranslated(0, 0, GLO_TEMPORALSHAPE);
5700 // set color
5701 GLHelper::setColor(segmentColor);
5702 // draw temporal edge
5703 GUIGeometry::drawGeometry(lane->getDrawingConstants()->getDetail(), geometry, 0.45);
5704 // check if draw starPos
5705 if (startPos != INVALID_DOUBLE) {
5706 // cut start pos
5707 geometry.updateGeometry(laneShape, startPos, Position::INVALID, startPos + 0.5, Position::INVALID);
5708 // draw startPos
5709 GUIGeometry::drawGeometry(lane->getDrawingConstants()->getDetail(), geometry, 1);
5710 } else {
5711 // push circle matrix
5712 GLHelper::pushMatrix();
5713 // translate to test layer, but under magenta square
5714 glTranslated(laneShape.front().x(), laneShape.front().y(), 0);
5715 // draw circle
5716 GLHelper::drawFilledCircle(0.8, 8);
5717 // pop circle matrix
5718 GLHelper::popMatrix();
5719 }
5720 // check if draw endPos
5721 if (endPos != INVALID_DOUBLE) {
5722 // cut endPos
5723 geometry.updateGeometry(laneShape, endPos - 0.5, Position::INVALID, endPos, Position::INVALID);
5724 // draw endPos
5725 GUIGeometry::drawGeometry(lane->getDrawingConstants()->getDetail(), geometry, 1);
5726 } else {
5727 // push circle matrix
5728 GLHelper::pushMatrix();
5729 // translate to test layer, but under magenta square
5730 glTranslated(laneShape.back().x(), laneShape.back().y(), 0);
5731 // draw circle
5732 GLHelper::drawFilledCircle(0.8, 8);
5733 // pop circle matrix
5734 GLHelper::popMatrix();
5735 }
5736 // set color
5737 GLHelper::setColor(segmentColor.changedBrightness(-32));
5738 // translate to front
5739 glTranslated(0, 0, 2);
5740 // check if draw at end, or over circle
5741 if (endPos == INVALID_DOUBLE) {
5742 // cut endPos
5743 geometry.updateGeometry(laneShape, laneShape.length() - 0.5, Position::INVALID, laneShape.length(), Position::INVALID);
5744 // draw triangle at end
5745 GLHelper::drawTriangleAtEnd(geometry.getShape().front(), geometry.getShape().back(), (double) 0.45, (double) 0.3, 0.3);
5746 } else {
5747 // draw triangle at end
5748 GLHelper::drawTriangleAtEnd(geometry.getShape().front(), geometry.getShape().back(), (double) 0.45, (double) 0.3, -0.1);
5749 }
5750 // pop layer matrix
5751 GLHelper::popMatrix();
5752 }
5753 }
5754 */
5755 }
5756}
5757
5758
5759void
5762 // get mouse position
5763 const Position mousePosition = snapToActiveGrid(getPositionInformation());
5764 // push layer matrix
5766 // translate to test layer, but under magenta square
5767 glTranslated(mousePosition.x(), mousePosition.y(), GLO_TESTELEMENT - 1);
5768 // set color
5770 // draw circle
5772 // pop layer matrix
5774 }
5775}
5776
5777
5778void
5780 // reset moving selected edge
5782 // decide what to do based on mode
5783 switch (myEditModes.networkEditMode) {
5785 // first swap lane to edges if mySelectEdges is enabled and shift key isn't pressed
5786 if (checkSelectEdges()) {
5788 } else {
5790 }
5791 // now filter locked elements
5793 // check if we're selecting a new parent for the current inspected element
5796 } else {
5797 // inspect clicked elements
5799 }
5800 // process click
5801 processClick(eventData);
5802 break;
5803 }
5805 // first swap lane to edges if mySelectEdges is enabled and shift key isn't pressed
5806 if (checkSelectEdges()) {
5808 } else {
5810 }
5811 // now filter locked elements forcing excluding walkingAreas
5813 // continue depending of AC
5815 // now check if we want only delete geometry points
5817 // only remove geometry point
5820 // remove all selected attribute carriers
5823 }
5824 } else {
5825 // remove attribute carrier under cursor
5827 }
5828 } else {
5829 // process click
5830 processClick(eventData);
5831 }
5832 break;
5833 }
5835 // first swap lane to edges if mySelectEdges is enabled and shift key isn't pressed
5836 if (checkSelectEdges()) {
5838 } else {
5840 }
5841 // now filter locked elements
5843 // avoid to select if control key is pressed
5845 // check if a rect for selecting is being created
5847 // begin rectangle selection
5850 // process click
5851 processClick(eventData);
5852 }
5853 } else {
5854 // process click
5855 processClick(eventData);
5856 }
5857 break;
5859 // check what buttons are pressed
5861 // get edge under cursor
5863 if (edge) {
5864 // obtain reverse edge
5865 const auto oppositeEdges = edge->getOppositeEdges();
5866 // check if we're split one or both edges
5869 } else if (oppositeEdges.size() > 0) {
5870 myNet->splitEdgesBidi(edge, oppositeEdges.front(), edge->getSplitPos(getPositionInformation()), myUndoList);
5871 } else {
5873 }
5874 }
5876 // process left click in create edge frame Frame
5881 }
5882 // process click
5883 processClick(eventData);
5884 break;
5885 }
5887 // editing lane shapes in move mode isn't finished, then always filter lanes
5889 // filter locked elements
5891 // check if we're editing a shape
5893 // check if we're removing a geometry point
5895 // remove geometry point
5898 }
5900 // process click if there isn't movable elements (to move camera using drag an drop)
5901 processClick(eventData);
5902 }
5903 } else {
5904 // filter connections and crossings, because are moved setting custom shape
5907 // get AC under cursor
5909 // check that AC is an network or additional element
5910 if (AC && (AC->getTagProperty()->isNetworkElement() || AC->getTagProperty()->isAdditionalElement())) {
5911 // check if we're moving a set of selected items
5912 if (AC->isAttributeCarrierSelected()) {
5913 // move selected ACs
5916 // process click if there isn't movable elements (to move camera using drag an drop)
5917 processClick(eventData);
5918 }
5919 } else {
5920 // process click if there isn't movable elements (to move camera using drag an drop)
5921 processClick(eventData);
5922 }
5923 }
5924 break;
5925 }
5927 // check if we're clicked over a non locked lane
5929 // Handle laneclick (shift key may pass connections, Control key allow conflicts)
5931 updateViewNet();
5932 }
5933 // process click
5934 processClick(eventData);
5935 break;
5936 }
5938 // edit TLS in TLSEditor frame
5940 // process click
5941 processClick(eventData);
5942 break;
5943 }
5945 // avoid create additionals if control key is pressed
5948 updateViewNet();
5949 }
5950 }
5951 // process click
5952 processClick(eventData);
5953 break;
5954 }
5956 // filter elements over junctions
5960 // call function addCrossing from crossing frame
5962 // process click
5963 processClick(eventData);
5964 break;
5965 }
5967 // avoid create TAZs if control key is pressed
5969 // check if we want to create a rect for selecting edges
5971 // begin rectangle selection
5973 } else {
5974 // check if process click was successfully
5976 updateViewNet();
5977 }
5978 // process click
5979 processClick(eventData);
5980 }
5981 } else {
5982 // process click
5983 processClick(eventData);
5984 }
5985 break;
5986 }
5988 // avoid create shapes if control key is pressed
5991 // declare processClick flag
5992 bool updateTemporalShape = false;
5993 // process click
5995 updateViewNet();
5996 // process click depending of the result of "process click"
5997 if (!updateTemporalShape) {
5998 // process click
5999 processClick(eventData);
6000 }
6001 }
6002 } else {
6003 // process click
6004 processClick(eventData);
6005 }
6006 break;
6007 }
6010 // shift key may pass connections, Control key allow conflicts.
6012 updateViewNet();
6013 }
6014 // process click
6015 processClick(eventData);
6016 break;
6017 }
6019 // avoid create wires if control key is pressed
6022 updateViewNet();
6023 }
6024 // process click
6025 processClick(eventData);
6026 break;
6027 }
6029 // process click
6030 processClick(eventData);
6031 break;
6032 }
6033 default: {
6034 // process click
6035 processClick(eventData);
6036 }
6037 }
6038}
6039
6040
6041void
6043 // check moved items
6047 // check if we're creating a rectangle selection or we want only to select a lane
6049 // check if we're selecting all type of elements o we only want a set of edges for TAZ
6053 // process edge selection
6055 }
6057 // check if there is a lane in objects under cursor
6059 // if we clicked over an lane with shift key pressed, select or unselect it
6062 } else {
6064 }
6065 }
6066 }
6067 // finish selection
6069 } else {
6070 // finish moving of single elements
6072 }
6073}
6074
6075
6076void
6077GNEViewNet::processMoveMouseNetwork(const bool mouseLeftButtonPressed) {
6078 // change "delete last created point" depending if during movement shift key is pressed
6083 }
6084 // check what type of additional is moved
6086 // move entire selection
6087 myMoveMultipleElements.moveSelection(mouseLeftButtonPressed);
6089 // update selection corner of selecting area
6091 } else {
6092 // move single elements
6093 myMoveSingleElement.moveSingleElement(mouseLeftButtonPressed);
6094 }
6095}
6096
6097
6098void
6100 // filter shapes (because POIs and polygons doesn't interact in demand mode)
6102 // decide what to do based on mode
6103 switch (myEditModes.demandEditMode) {
6105 // filter locked elements
6107 // inspect clicked elements
6109 // process click
6110 processClick(eventData);
6111 break;
6112 }
6114 // filter locked elements
6116 // get front AC
6117 const auto markAC = myViewObjectsSelector.getAttributeCarrierFront();
6118 // check conditions
6119 if (markAC) {
6120 // check if we are deleting a selection or an single attribute carrier
6121 if (markAC->isAttributeCarrierSelected()) {
6123 } else {
6125 }
6126 } else {
6127 // process click
6128 processClick(eventData);
6129 }
6130 break;
6131 }
6133 // filter locked elements
6135 // avoid to select if control key is pressed
6137 // check if a rect for selecting is being created
6139 // begin rectangle selection
6142 // process click
6143 processClick(eventData);
6144 }
6145 } else {
6146 // process click
6147 processClick(eventData);
6148 }
6149 break;
6151 // filter locked elements
6153 // get front AC
6154 const auto markAC = myViewObjectsSelector.getAttributeCarrierFront();
6155 // check that AC under cursor is a demand element
6156 if (markAC) {
6157 // check if we're moving a set of selected items
6158 if (markAC->isAttributeCarrierSelected()) {
6159 // move selected ACs
6162 // process click if there isn't movable elements (to move camera using drag an drop)
6163 processClick(eventData);
6164 }
6165 } else {
6166 // process click if there isn't movable elements (to move camera using drag an drop)
6167 processClick(eventData);
6168 }
6169 break;
6170 }
6172 // check if we clicked over a lane
6174 // Handle edge click
6176 }
6177 // process click
6178 processClick(eventData);
6179 break;
6180 }
6182 // filter additionals (except TAZs) and demands (except routes)
6185 // Handle click
6187 // process click
6188 processClick(eventData);
6189 break;
6190 }
6192 // filter additionals (except stoppingPlaces) and demands
6195 // Handle click
6197 updateViewNet();
6198 }
6199 // process click
6200 processClick(eventData);
6201 break;
6202 }
6204 // filter additionals (except stoppingPlaces and TAZs)
6207 // special case if we're creating person over walk routes
6210 } else {
6212 }
6213 // Handle click
6215 }
6216 // process click
6217 processClick(eventData);
6218 break;
6219 }
6221 // filter additionals (except stoppingPlaces and TAZs)
6224 // special case if we're creating person over walk routes
6227 } else {
6229 }
6230 // Handle person plan click
6232 }
6233 // process click
6234 processClick(eventData);
6235 break;
6236 }
6238 // filter additionals (except stoppingPlaces and TAZs) and demands
6241 // Handle click
6243 // process click
6244 processClick(eventData);
6245 break;
6246 }
6248 // filter additionals (except stoppingPlaces and TAZs) and demands
6251 // Handle container plan click
6253 // process click
6254 processClick(eventData);
6255 break;
6256 }
6257 default: {
6258 // process click
6259 processClick(eventData);
6260 }
6261 }
6262}
6263
6264
6265void
6267 // check moved items
6271 // check if we're creating a rectangle selection or we want only to select a lane
6274 }
6275 // finish selection
6277 } else {
6278 // finish moving of single elements
6280 }
6281}
6282
6283
6284void
6285GNEViewNet::processMoveMouseDemand(const bool mouseLeftButtonPressed) {
6287 // update selection corner of selecting area
6289 } else {
6290 // move single elements
6291 myMoveSingleElement.moveSingleElement(mouseLeftButtonPressed);
6292 }
6293}
6294
6295
6296void
6298 // get AC
6300 // decide what to do based on mode
6301 switch (myEditModes.dataEditMode) {
6303 // filter locked elements
6305 // process left click in Inspector Frame
6306 if (AC && AC->getTagProperty()->getTag() == SUMO_TAG_TAZ) {
6308 } else {
6309 // inspect clicked elements
6311 }
6312 // process click
6313 processClick(eventData);
6314 break;
6315 }
6317 // check conditions
6318 if (AC) {
6319 // check if we are deleting a selection or an single attribute carrier
6320 if (AC->isAttributeCarrierSelected()) {
6321 if (!AC->getGUIGlObject()->isGLObjectLocked()) {
6323 }
6324 } else {
6326 }
6327 } else {
6328 // process click
6329 processClick(eventData);
6330 }
6331 break;
6332 }
6334 // filter locked elements
6336 // avoid to select if control key is pressed
6338 // check if a rect for selecting is being created
6340 // begin rectangle selection
6343 // process click
6344 processClick(eventData);
6345 }
6346 } else {
6347 // process click
6348 processClick(eventData);
6349 }
6350 break;
6352 // avoid create edgeData if control key is pressed
6355 updateViewNet();
6356 }
6357 }
6358 // process click
6359 processClick(eventData);
6360 break;
6362 // avoid create edgeData if control key is pressed
6365 updateViewNet();
6366 }
6367 }
6368 // process click
6369 processClick(eventData);
6370 break;
6372 // avoid create TAZData if control key is pressed
6375 updateViewNet();
6376 }
6377 }
6378 // process click
6379 processClick(eventData);
6380 break;
6382 // avoid create TAZData if control key is pressed
6384 //
6385 }
6386 // process click
6387 processClick(eventData);
6388 break;
6389 default: {
6390 // process click
6391 processClick(eventData);
6392 }
6393 }
6394}
6395
6396
6397void
6399 // check moved items
6403 // check if we're creating a rectangle selection or we want only to select a lane
6406 }
6407 // finish selection
6409 } else {
6410 // finish moving of single elements
6412 }
6413}
6414
6415
6416void
6417GNEViewNet::processMoveMouseData(const bool mouseLeftButtonPressed) {
6419 // update selection corner of selecting area
6421 } else {
6422 // move single elements
6423 myMoveSingleElement.moveSingleElement(mouseLeftButtonPressed);
6424 }
6425}
6426
6427/****************************************************************************/
FXDEFMAP(GNEViewNet) GNEViewNetMap[]
@ DATA_MEANDATA
mode for create meanData elements
@ DATA_EDGERELDATA
mode for create edgeRelData elements
@ DATA_SELECT
mode for selecting data elements
@ DATA_TAZRELDATA
mode for create TAZRelData elements
@ DATA_INSPECT
mode for inspecting data elements
@ DATA_EDGEDATA
mode for create edgeData elements
@ DATA_DELETE
mode for deleting data elements
Supermode
@brie enum for supermodes
@ NETWORK
Network mode (Edges, junctions, etc..)
@ DATA
Data mode (edgeData, LaneData etc..)
@ DEMAND
Demand mode (Routes, Vehicles etc..)
@ NETWORK_SHAPE
Mode for editing Polygons.
@ NETWORK_DELETE
mode for deleting network elements
@ NETWORK_MOVE
mode for moving network elements
@ NETWORK_WIRE
Mode for editing wires.
@ NETWORK_ADDITIONAL
Mode for editing additionals.
@ NETWORK_TAZ
Mode for editing TAZ.
@ NETWORK_CREATE_EDGE
mode for creating new edges
@ NETWORK_TLS
mode for editing tls
@ NETWORK_CROSSING
Mode for editing crossing.
@ NETWORK_SELECT
mode for selecting network elements
@ NETWORK_INSPECT
mode for inspecting network elements
@ NETWORK_PROHIBITION
Mode for editing connection prohibitions.
@ NETWORK_CONNECT
mode for connecting lanes
@ NETWORK_DECAL
Mode for editing decals.
@ DEMAND_PERSONPLAN
Mode for editing person plan.
@ DEMAND_INSPECT
mode for inspecting demand elements
@ DEMAND_CONTAINER
Mode for editing container.
@ DEMAND_DELETE
mode for deleting demand elements
@ DEMAND_ROUTEDISTRIBUTION
Mode for editing route distributions.
@ DEMAND_PERSON
Mode for editing person.
@ DEMAND_TYPEDISTRIBUTION
Mode for editing type distributions.
@ DEMAND_SELECT
mode for selecting demand elements
@ DEMAND_ROUTE
Mode for editing routes.
@ DEMAND_VEHICLE
Mode for editing vehicles.
@ DEMAND_MOVE
mode for moving demand elements
@ DEMAND_STOP
Mode for editing stops.
@ DEMAND_CONTAINERPLAN
Mode for editing container plan.
@ DEMAND_TYPE
Mode for editing types.
@ MID_GNE_NETWORKVIEWOPTIONS_AUTOOPPOSITEEDGES
automatically create opposite edge
Definition GUIAppEnum.h:847
@ MID_GNE_ADDSELECT_EDGE
Add edge to selected items - menu entry.
Definition GUIAppEnum.h:849
@ MID_HOTKEY_F3_SUPERMODE_DEMAND
select demand supermode in netedit
Definition GUIAppEnum.h:234
@ MID_GNE_LANE_EDIT_SHAPE
edit lane shape
@ MID_GNE_DEMANDVIEWOPTIONS_SHOWALLPERSONPLANS
show all person plans
Definition GUIAppEnum.h:931
@ MID_HOTKEY_SHIFT_S_LOCATESTOP
Locate stop - button.
Definition GUIAppEnum.h:188
@ MID_GNE_LANE_TRANSFORM_BIKE
transform lane to bikelane
@ MID_GNE_DATAVIEWOPTIONS_TAZRELDRAWING
toggle TAZRel drawing
Definition GUIAppEnum.h:955
@ MID_GNE_EDGE_REVERSE
reverse an edge
@ MID_GNE_JUNCTION_ADDTLS
Add TLS into junction.
@ MID_ADDSELECT
Add to selected items - menu entry.
Definition GUIAppEnum.h:485
@ MID_HOTKEY_U_MODE_DECAL_TYPEDISTRIBUTION
hotkey for mode decal AND type distribution
Definition GUIAppEnum.h:69
@ MID_GNE_LANE_ADD_BUS
add busLane
@ MID_GNE_NETWORKVIEWOPTIONS_DRAWSPREADVEHICLES
Draw vehicles in begin position or spread in lane.
Definition GUIAppEnum.h:821
@ MID_GNE_JUNCTION_RESET_EDGE_ENDPOINTS
reset edge endpoints
@ MID_GNE_NETWORKVIEWOPTIONS_MOVEELEVATION
move elevation instead of x,y
Definition GUIAppEnum.h:843
@ MID_GNE_NETWORKVIEWOPTIONS_HIDECONNECTIONS
hide connections
Definition GUIAppEnum.h:829
@ MID_GNE_REMOVESELECT_EDGE
Remove edge from selected items - Menu Entry.
Definition GUIAppEnum.h:851
@ MID_GNE_NETWORKVIEWOPTIONS_SHOWCONNECTIONS
show connections
Definition GUIAppEnum.h:827
@ MID_GNE_INTERVALBAR_BEGIN
begin changed in InterbalBar
Definition GUIAppEnum.h:975
@ MID_GNE_DATAVIEWOPTIONS_TAZRELONLYTO
toggle draw TAZRel only to
Definition GUIAppEnum.h:961
@ MID_GNE_ADDREVERSE
add reverse element
@ MID_GNE_CONNECTION_SMOOTH_SHAPE
@ brief smooth connection shape
@ MID_GNE_DATAVIEWOPTIONS_TOGGLEDRAWJUNCTIONSHAPE
toggle draw junction shape
Definition GUIAppEnum.h:947
@ MID_GNE_NETWORKVIEWOPTIONS_SHOWTAZELEMENTS
show TAZ elements
Definition GUIAppEnum.h:833
@ MID_GNE_DEMANDVIEWOPTIONS_LOCKPERSON
lock person
Definition GUIAppEnum.h:933
@ MID_HOTKEY_Z_MODE_TAZ_TAZREL
hotkey for mode editing TAZ and TAZRel
Definition GUIAppEnum.h:75
@ MID_GNE_DEMANDVIEWOPTIONS_TOGGLEDRAWJUNCTIONSHAPE
toggle draw junction shape
Definition GUIAppEnum.h:921
@ MID_GNE_JUNCTION_CLEAR_CONNECTIONS
clear junction's connections
@ MID_HOTKEY_A_MODE_STARTSIMULATION_ADDITIONALS_STOPS
hotkey for start simulation in SUMO and set editing mode additionals AND stops in netedit
Definition GUIAppEnum.h:43
@ MID_GNE_JUNCTION_SELECT_ROUNDABOUT
select all roundabout nodes and edges of the current roundabout
@ MID_GNE_JUNCTION_RESET_SHAPE
reset junction shape
@ MID_GNE_JUNCTION_RESET_CONNECTIONS
reset junction's connections
@ MID_GNE_DEMANDVIEWOPTIONS_SHOWGRID
show grid
Definition GUIAppEnum.h:919
@ MID_GNE_POLYGON_TRIANGULATE
triangulate polygon
@ MID_GNE_JUNCTION_SPLIT
turn junction into multiple junctions
@ MID_GNE_EDGE_STRAIGHTEN_ELEVATION
interpolate z values linear between junctions
@ MID_HOTKEY_D_MODE_SINGLESIMULATIONSTEP_DELETE
hotkey for perform a single simulation step in SUMO and set delete mode in netedit
Definition GUIAppEnum.h:49
@ MID_GNE_NETWORKVIEWOPTIONS_CHAINEDGES
create edges in chain mode
Definition GUIAppEnum.h:845
@ MID_GNE_DATAVIEWOPTIONS_SHOWDEMANDELEMENTS
show demand elements
Definition GUIAppEnum.h:953
@ MID_GNE_POLYGON_CLOSE
close opened polygon
@ MID_GNE_EDGE_SMOOTH
smooth geometry
@ MID_HOTKEY_C_MODE_CONNECT_CONTAINER
hotkey for mode connecting lanes AND container
Definition GUIAppEnum.h:45
@ MID_HOTKEY_H_MODE_PROHIBITION_CONTAINERPLAN
hotkey for mode prohibition AND container plan
Definition GUIAppEnum.h:53
@ MID_HOTKEY_SHIFT_O_LOCATEPOI
Locate poi - button.
Definition GUIAppEnum.h:182
@ MID_HOTKEY_W_MODE_WIRE_ROUTEDISTRIBUTION
hotkey for mode editing overhead wires AND route distributions
Definition GUIAppEnum.h:73
@ MID_HOTKEY_T_MODE_TLS_TYPE
hotkey for mode editing TLS AND Vehicle Types
Definition GUIAppEnum.h:67
@ MID_GNE_LANE_RESET_CUSTOMSHAPE
reset custom shape
@ MID_GNE_EDGE_STRAIGHTEN
remove inner geometry
@ MID_GNE_DEMANDVIEWOPTIONS_HIDESHAPES
hide shapes
Definition GUIAppEnum.h:927
@ MID_GNE_LANE_TRANSFORM_BUS
transform lane to busLane
@ MID_GNE_POLYGON_SET_FIRST_POINT
Set a vertex of polygon as first vertex.
@ MID_GNE_SHAPEEDITED_DELETE_GEOMETRY_POINT
delete geometry point in shape edited
@ MID_HOTKEY_SHIFT_A_LOCATEADDITIONAL
Locate additional structure - button.
Definition GUIAppEnum.h:172
@ MID_GNE_LANE_DUPLICATE
duplicate a lane
@ MID_GNE_DATAVIEWOPTIONS_SHOWADDITIONALS
show additionals
Definition GUIAppEnum.h:949
@ MID_HOTKEY_SHIFT_R_LOCATEROUTE
Locate route - button.
Definition GUIAppEnum.h:186
@ MID_GNE_NETWORKVIEWOPTIONS_SHOWBUBBLES
show junctions as bubbles
Definition GUIAppEnum.h:841
@ MID_GNE_LANE_ADD_GREENVERGE_FRONT
add greenVerge front of current lane
@ MID_GNE_INTERVALBAR_END
end changed in InterbalBar
Definition GUIAppEnum.h:977
@ MID_HOTKEY_SHIFT_W_LOCATEWALKINGAREA
Locate edge - button.
Definition GUIAppEnum.h:194
@ MID_GNE_NETWORKVIEWOPTIONS_EXTENDSELECTION
extend selection
Definition GUIAppEnum.h:835
@ MID_GNE_LANE_REMOVE_GREENVERGE
remove greenVerge
@ MID_HOTKEY_S_MODE_STOPSIMULATION_SELECT
hotkey for stop simulation in SUMO and set select mode in netedit
Definition GUIAppEnum.h:63
@ MID_GNE_EDGE_ADD_REVERSE_DISCONNECTED
add reverse edge disconnected (used for for spreadtype center)
@ MID_GNE_EDGE_SPLIT_BIDI
split an edge
@ MID_GNE_NETWORKVIEWOPTIONS_SHOWSUBADDITIONALS
show sub-additionals
Definition GUIAppEnum.h:831
@ MID_GNE_JUNCTION_REPLACE
turn junction into geometry node
@ MID_HOTKEY_SHIFT_C_LOCATECONTAINER
Locate container - button.
Definition GUIAppEnum.h:174
@ MID_GNE_DEMANDVIEWOPTIONS_SHOWALLCONTAINERPLANS
show all container plans
Definition GUIAppEnum.h:935
@ MID_HOTKEY_SHIFT_V_LOCATEVEHICLE
Locate vehicle - button.
Definition GUIAppEnum.h:192
@ MID_GNE_VIEW_DEFAULT
set default view
Definition GUIAppEnum.h:783
@ MID_HOTKEY_F4_SUPERMODE_DATA
select data supermode in netedit
Definition GUIAppEnum.h:236
@ MID_HOTKEY_SHIFT_L_LOCATEPOLY
Locate polygons - button.
Definition GUIAppEnum.h:180
@ MID_GNE_LANE_REMOVE_BIKE
remove bikelane
@ MID_GNE_SHAPEEDITED_RESET
reset shape
@ MID_HOTKEY_SHIFT_E_LOCATEEDGE
Locate edge - button.
Definition GUIAppEnum.h:176
@ MID_GNE_VIEW_JUPEDSIM
set juPedSim view
Definition GUIAppEnum.h:785
@ MID_GNE_SHAPEEDITED_STRAIGHTEN
straighten shape edited geometry
@ MID_GNE_POI_TRANSFORM
Transform POI to POILane, and viceversa.
@ MID_GNE_LANE_RESET_OPPOSITELANE
reset opposite lane
@ MID_GNE_INTERVALBAR_PARAMETER
parameter changed in InterbalBar
Definition GUIAppEnum.h:979
@ MID_HOTKEY_R_MODE_CROSSING_ROUTE_EDGERELDATA
hotkey for mode editing crossing, routes and edge rel datas
Definition GUIAppEnum.h:65
@ MID_GNE_JUNCTION_CONVERT_ROUNDABOUT
convert junction to roundabout
@ MID_GNE_DATAVIEWOPTIONS_TAZDRAWFILL
toggle draw TAZ fill
Definition GUIAppEnum.h:957
@ MID_REACHABILITY
show reachability from a given lane
Definition GUIAppEnum.h:531
@ MID_HOTKEY_L_MODE_PERSONPLAN
hotkey for mode person plan
Definition GUIAppEnum.h:57
@ MID_GNE_EDGE_RESET_LENGTH
reset custom lengths
@ MID_HOTKEY_V_MODE_VEHICLE
hotkey for mode create vehicles
Definition GUIAppEnum.h:71
@ MID_HOTKEY_SHIFT_P_LOCATEPERSON
Locate person - button.
Definition GUIAppEnum.h:184
@ MID_HOTKEY_I_MODE_INSPECT
hotkey for mode inspecting object attributes
Definition GUIAppEnum.h:55
@ MID_GNE_LANE_REMOVE_BUS
remove busLane
@ MID_GNE_NETWORKVIEWOPTIONS_SHOWDEMANDELEMENTS
show demand elements
Definition GUIAppEnum.h:823
@ MID_HOTKEY_SHIFT_J_LOCATEJUNCTION
Locate junction - button.
Definition GUIAppEnum.h:178
@ MID_GNE_POLYGON_SELECT
select elements within polygon boundary
@ MID_GNE_JUNCTION_SPLIT_RECONNECT
turn junction into multiple junctions and reconnect them heuristically
@ MID_GNE_REVERSE
reverse current element
@ MID_OPEN_ADDITIONAL_DIALOG
open additional dialog (used in netedit)
Definition GUIAppEnum.h:469
@ MID_GNE_WALKINGAREA_EDIT_SHAPE
edit crossing shape
@ MID_GNE_DEMANDVIEWOPTIONS_HIDENONINSPECTED
hide non-inspected demand element
Definition GUIAppEnum.h:925
@ MID_GNE_JUNCTION_EDIT_SHAPE
edit junction shape
@ MID_GNE_LANE_REMOVE_SIDEWALK
remove sidewalk
@ MID_GNE_SHAPEEDITED_OPEN
open closed shape edited
@ MID_GNE_EDGE_RESET_ENDPOINT
reset default geometry endpoints
@ MID_GNE_INTERVALBAR_GENERICDATATYPE
generic data selected
Definition GUIAppEnum.h:969
@ MID_GNE_LANE_ADD_GREENVERGE_BACK
add greenVerge back of current lane
@ MID_GNE_NETWORKVIEWOPTIONS_MERGEAUTOMATICALLY
don't ask before merging junctions
Definition GUIAppEnum.h:839
@ MID_GNE_EDGE_SMOOTH_ELEVATION
smooth elevation with regard to adjoining edges
@ MID_GNE_NETWORKVIEWOPTIONS_CHANGEALLPHASES
change all phases
Definition GUIAppEnum.h:837
@ MID_GNE_DATAVIEWOPTIONS_SHOWSHAPES
show shapes
Definition GUIAppEnum.h:951
@ MID_HOTKEY_E_MODE_EDGE_EDGEDATA
hotkey for mode adding edges AND edgeDatas
Definition GUIAppEnum.h:51
@ MID_GNE_DATAVIEWOPTIONS_TAZRELONLYFROM
toggle draw TAZRel only from
Definition GUIAppEnum.h:959
@ MID_GNE_EDGE_ADD_REVERSE
add reverse edge
@ MID_GNE_EDGE_APPLYTEMPLATE
apply template
@ MID_GNE_EDGE_USEASTEMPLATE
use edge as tempalte
@ MID_GNE_NETWORKVIEWOPTIONS_TOGGLEDRAWJUNCTIONSHAPE
toggle draw junction shape
Definition GUIAppEnum.h:819
@ MID_GNE_SHAPEEDITED_SIMPLIFY
simplify shape edited geometry
@ MID_GNE_DEMANDVIEWOPTIONS_DRAWSPREADVEHICLES
Draw vehicles in begin position or spread in lane.
Definition GUIAppEnum.h:923
@ MID_GNE_LANE_ADD_SIDEWALK
add sidewalk
@ MID_GNE_DEMANDVIEWOPTIONS_SHOWOVERLAPPEDROUTES
show overlapped routes
Definition GUIAppEnum.h:939
@ MID_GNE_SHAPEEDITED_FINISH
finish editing shape edited
@ MID_GNE_RESET_GEOMETRYPOINT
reset geometry point
@ MID_GNE_CONNECTION_EDIT_SHAPE
edit connection shape
@ MID_GNE_SHAPEEDITED_CLOSE
close opened shape edited
@ MID_GNE_INTERVALBAR_DATASET
data set selected
Definition GUIAppEnum.h:971
@ MID_HOTKEY_SHIFT_T_LOCATETLS
Locate TLS - button.
Definition GUIAppEnum.h:190
@ MID_GNE_LANE_TRANSFORM_SIDEWALK
transform lane to sidewalk
@ MID_GNE_SHAPEEDITED_SET_FIRST_POINT
Set a vertex of shape edited as first vertex.
@ MID_GNE_LANE_ADD_BIKE
add bikelane
@ MID_HOTKEY_M_MODE_MOVE_MEANDATA
hotkey for mode moving element AND mean data
Definition GUIAppEnum.h:59
@ MID_HOTKEY_F2_SUPERMODE_NETWORK
select network supermode in netedit
Definition GUIAppEnum.h:232
@ MID_GNE_DEMANDVIEWOPTIONS_LOCKCONTAINER
lock container
Definition GUIAppEnum.h:937
@ MID_GNE_NETWORKVIEWOPTIONS_SELECTEDGES
select edges
Definition GUIAppEnum.h:825
@ MID_GNE_EDGE_SPLIT
split an edge
@ MID_GNE_LANE_TRANSFORM_GREENVERGE
transform lane to greenVerge
@ MID_GNE_CUSTOM_GEOMETRYPOINT
set custom geometry point
@ MID_GNE_DEMANDVIEWOPTIONS_SHOWTRIPS
show all trips
Definition GUIAppEnum.h:929
@ MID_GNE_NETWORKVIEWOPTIONS_TOGGLEGRID
show grid
Definition GUIAppEnum.h:817
@ MID_GNE_INTERVALBAR_LIMITED
enable/disable show data elements by interval
Definition GUIAppEnum.h:973
@ MID_GNE_EDGE_EDIT_ENDPOINT
change default geometry endpoints
@ MID_GNE_POLYGON_DELETE_GEOMETRY_POINT
delete geometry point
@ MID_HOTKEY_P_MODE_POLYGON_PERSON
hotkey for mode creating polygons
Definition GUIAppEnum.h:61
@ MID_GNE_JUNCTION_ADDJOINTLS
Add join TLS into junctions.
@ MID_GNE_CROSSING_EDIT_SHAPE
edit crossing shape
@ MID_GNE_POLYGON_OPEN
open closed polygon
@ MID_GNE_POLYGON_SIMPLIFY_SHAPE
simplify polygon geometry
@ MID_REMOVESELECT
Remove from selected items - Menu Entry.
Definition GUIAppEnum.h:487
GUICompleteSchemeStorage gSchemeStorage
@ MOVEELEMENT
move element cursor
@ MOVEVIEW
move view cursor
@ SELECT_LANE
select lanecursor
@ DEFAULT
default cursor
@ SELECT
select cursor
@ DELETE_CURSOR
delete cursor
@ INSPECT_LANE
inspect lane cursor
@ INSPECT
inspect cursor
#define GUIDesignButtonPopup
checkable button placed in popup (for example, locate buttons)
Definition GUIDesigns.h:112
#define GUIDesignVerticalSeparator
vertical separator
Definition GUIDesigns.h:466
unsigned int GUIGlID
Definition GUIGlObject.h:44
GUIGlObjectType
@ GLO_TAZRELDATA
TAZ relation data.
@ GLO_WALKINGAREA
a walkingArea
@ GLO_TEMPORALSHAPE
temporal shape (used in netedit)
@ GLO_TESTELEMENT
test element (used in netedit)
@ GLO_JUNCTION
a junction
@ GLO_LANE
a lane
@ GLO_CONNECTION
a connection
@ GLO_EDGE
an edge
@ GLO_VEHICLE
a vehicle
@ GLO_TLLOGIC
a tl-logic
@ GLO_CROSSING
a tl-logic
GUIViewObjectsHandler gViewObjectsHandler
GUIViewUpdater gViewUpdater
@ LOCATEVEHICLE
@ LOCATEWALKINGAREA
@ LOCATEPERSON
@ LOCATECONTAINER
@ LOCATEJUNCTION
#define WRITE_WARNINGF(...)
Definition MsgHandler.h:288
#define WRITE_ERROR(msg)
Definition MsgHandler.h:296
#define WRITE_WARNING(msg)
Definition MsgHandler.h:287
#define TL(string)
Definition MsgHandler.h:305
#define TLF(string,...)
Definition MsgHandler.h:307
StringBijection< SUMOVehicleClass > SumoVehicleClassStrings(sumoVehicleClassStringInitializer, SVC_CUSTOM2, false)
long long int SVCPermissions
bitset where each bit declares whether a certain SVC may use this edge/lane
SUMOVehicleClass
Definition of vehicle classes to differ between different lane usage and authority types.
@ SVC_IGNORING
vehicles ignoring classes
@ SVC_BICYCLE
vehicle is a bicycle
@ SVC_BUS
vehicle is a bus
@ SVC_PEDESTRIAN
pedestrian
@ SUMO_TAG_EDGEREL
a relation between two edges
@ SUMO_TAG_DATAINTERVAL
@ SUMO_TAG_TAZ
a traffic assignment zone
@ SUMO_TAG_TAZSINK
a sink within a district (connection road)
@ GNE_TAG_EDGEREL_SINGLE
@ SUMO_TAG_POI
begin/end of the description of a Point of interest
@ SUMO_TAG_VEHICLE
description of a vehicle
@ GNE_TAG_FLOW_ROUTE
a flow definition using a route instead of a from-to edges route
@ SUMO_TAG_FLOW
a flow definition using from and to edges or a route
@ SUMO_TAG_CONNECTION
connectioon between two lanes
@ SUMO_TAG_JUNCTION
begin/end of the description of a junction
@ SUMO_TAG_CROSSING
crossing between edges for pedestrians
@ SUMO_TAG_POLY
begin/end of the description of a polygon
@ SUMO_TAG_LANE
begin/end of the description of a single lane
@ SUMO_TAG_DATASET
@ GNE_TAG_JPS_OBSTACLE
polygon used for draw juPedSim obstacles
@ SUMO_TAG_TAZREL
a relation between two TAZs
@ SUMO_TAG_TAZSOURCE
a source within a district (connection road)
@ GNE_TAG_ROUTE_EMBEDDED
embedded route
@ SUMO_TAG_INDUCTION_LOOP
alternative tag for e1 detector
@ GNE_TAG_JPS_WALKABLEAREA
polygon used for draw juPedSim walkable areas
@ SUMO_TAG_VIEWSETTINGS
@ SUMO_TAG_VIEWPORT
@ SUMO_TAG_TRIP
a single trip definition (used by router)
@ SUMO_TAG_EDGE
begin/end of the description of an edge
@ SUMO_ATTR_LANE
@ GNE_ATTR_OPPOSITE
to busStop (used by personPlans)
@ SUMO_ATTR_Y
@ SUMO_ATTR_X
@ GNE_ATTR_SELECTED
element is selected
@ SUMO_ATTR_CUSTOMSHAPE
whether a given shape is user-defined
@ SUMO_ATTR_POSITION_LAT
@ SUMO_ATTR_ZOOM
@ SUMO_ATTR_SHAPE
edge: the shape in xml-definition
@ SUMO_ATTR_ANGLE
@ GNE_ATTR_SHAPE_END
last coordinate of edge shape
@ SUMO_ATTR_TLID
link,node: the traffic light id responsible for this link
@ SUMO_ATTR_FRIENDLY_POS
@ SUMO_ATTR_TYPE
@ SUMO_ATTR_LENGTH
@ SUMO_ATTR_ID
@ GNE_ATTR_SHAPE_START
first coordinate of edge shape
@ SUMO_ATTR_POSITION
const double SUMO_const_laneWidth
Definition StdDefs.h:48
T MIN2(T a, T b)
Definition StdDefs.h:76
T MAX2(T a, T b)
Definition StdDefs.h:82
const unsigned char TLS[]
Definition TLS.cpp:22
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
Definition ToString.h:46
void parseSumoBaseObject(CommonXMLStructure::SumoBaseObject *obj)
parse SumoBaseObject (it's called recursivelly)
A class that stores a 2D geometrical boundary.
Definition Boundary.h:39
void add(double x, double y, double z=0)
Makes the boundary include the given coordinate.
Definition Boundary.cpp:75
double ymin() const
Returns minimum y-coordinate.
Definition Boundary.cpp:127
double xmin() const
Returns minimum x-coordinate.
Definition Boundary.cpp:115
Boundary & grow(double by)
extends the boundary by the given amount
Definition Boundary.cpp:340
double ymax() const
Returns maximum y-coordinate.
Definition Boundary.cpp:133
double xmax() const
Returns maximum x-coordinate.
Definition Boundary.cpp:121
void addBoolAttribute(const SumoXMLAttr attr, const bool value)
add bool attribute into current SumoBaseObject node
void addDoubleAttribute(const SumoXMLAttr attr, const double value)
add double attribute into current SumoBaseObject node
void addStringAttribute(const SumoXMLAttr attr, const std::string &value)
add string attribute into current SumoBaseObject node
static void drawLine(const Position &beg, double rot, double visLength)
Draws a thin line.
Definition GLHelper.cpp:437
static void setColor(const RGBColor &c)
Sets the gl-color to this value.
Definition GLHelper.cpp:653
static void drawOutlineCircle(double radius, double iRadius, int steps=8)
Draws an unfilled circle around (0,0)
Definition GLHelper.cpp:595
static void drawFilledCircle(const double widradiusth, const int steps=8)
Draws a filled circle around (0,0)
Definition GLHelper.cpp:568
static void popMatrix()
pop matrix
Definition GLHelper.cpp:135
static void pushMatrix()
push matrix
Definition GLHelper.cpp:122
GNEConsecutiveSelector * getConsecutiveLaneSelector() const
get consecutive lane selector
bool createPath(const bool useLastRoute)
create path
bool addAdditional(const GNEViewNetHelper::ViewObjectsSelector &viewObjects)
add additional element
GNEViewObjectSelector * getViewObjetsSelector() const
get module for select view objects
virtual void openAdditionalDialog()
open Additional Dialog
GNEApplicationWindowHelper::EditMenuCommands & getEditMenuCommands()
get Edit Menu Commands (needed for show/hide menu commands)
bool allowInputSignals(FXObject *obj) const
check if ignore input signal (using during netedit tests)
GNEApplicationWindowHelper::ToolbarsGrip & getToolbarsGrip()
get ToolbarsGrip
const std::string getID() const
get ID (all Attribute Carriers have one)
bool isAttributeCarrierSelected() const
check if attribute carrier is selected
void selectAttributeCarrier()
select attribute carrier using GUIGlobalSelection
void unselectAttributeCarrier()
unselect attribute carrier using GUIGlobalSelection
const std::string & getTagStr() const
get tag assigned to this object in string format
const std::string & getFilename() const
get filename in which save this AC
const GNETagProperties * getTagProperty() const
get tagProperty associated with this Attribute Carrier
virtual GUIGlObject * getGUIGlObject()=0
void setNewParent(const GNEAttributeCarrier *AC)
set new parent
static void changeAttribute(GNEAttributeCarrier *AC, SumoXMLAttr key, const std::string &value, GNEUndoList *undoList, const bool force=false)
change attribute
void smootShape()
smoothShape
long onCmdSaveModifications(FXObject *, FXSelector, void *)
Called when the user presses the OK-Button saves any connection modifications.
long onCmdCancelModifications(FXObject *, FXSelector, void *)
Called when the user presses the Cancel-button discards any connection modifications.
ConnectionModifications * getConnectionModifications() const
get pointer to ConnectionModifications module
void handleLaneClick(const GNEViewNetHelper::ViewObjectsSelector &viewObjects)
either sets the current lane or toggles the connection of the
void drawTemporalConsecutiveLanePath() const
draw temporal consecutive lane path
void abortPathCreation()
abort path creation
void removeLastElement()
remove path element
GNEPlanCreator * getPlanCreator() const
get plan creator module
bool addContainer(const GNEViewNetHelper::ViewObjectsSelector &viewObjects)
add vehicle element
void show()
show Frame
GNEPlanCreator * getPlanCreator() const
get plan creator module
bool addContainerPlanElement(const GNEViewNetHelper::ViewObjectsSelector &viewObjects)
add container plan element
void processClick(const Position &clickedPosition, const GNEViewNetHelper::ViewObjectsSelector &viewObjects, const bool oppositeEdge, const bool chainEdge)
handle processClick and set the relative coloring
void abortEdgeCreation()
abort current edge creation
void show()
show create edge frame
const GNEJunction * getJunctionSource() const
get junction source for new edge
void clearEdgesHotkey()
clear edges (used when user press ESC key in Crossing mode)
void createCrossingHotkey()
create crossing (used when user press ENTER key in Crossing mode)
void addCrossing(const GNEViewNetHelper::ViewObjectsSelector &viewObjects)
add Crossing element
This object is responsible for drawing a shape and for supplying a a popup menu. Messages are routete...
Definition GNECrossing.h:44
bool deleteOnlyGeometryPoints() const
check if only delete geometry points checkbox is enabled
bool removeGeometryPoint(const GNEViewNetHelper::ViewObjectsSelector &viewObjects)
remove geometry point
DeleteOptions * getDeleteOptions() const
get delete options modul
void removeSelectedAttributeCarriers()
remove selected attribute carriers (element)
void removeAttributeCarrier(const GNEViewNetHelper::ViewObjectsSelector &viewObjects)
remove attribute carrier (element)
void show()
show delete frame
void startDrawing()
start drawing
bool isDrawing() const
return true if currently a shape is drawed
bool getDeleteLastCreatedPoint()
get flag delete last created point
void abortDrawing()
abort drawing
void setDeleteLastCreatedPoint(bool value)
enable or disable delete last created point
void stopDrawing()
stop drawing and check if shape can be created
const PositionVector & getTemporalShape() const
get Temporal shape
bool addEdgeData(const GNEViewNetHelper::ViewObjectsSelector &viewObjects, const GNEViewNetHelper::MouseButtonKeyPressed &mouseButtonKeyPressed)
add additional element
A road/street connecting two junctions (netedit-version)
Definition GNEEdge.h:53
void smooth(GNEUndoList *undoList)
make geometry smooth
Definition GNEEdge.cpp:2461
NBEdge * getNBEdge() const
returns the internal NBEdge
Definition GNEEdge.cpp:829
void smoothElevation(GNEUndoList *undoList)
smooth elevation with regard to adjoining edges
Definition GNEEdge.cpp:2473
std::vector< GNEEdge * > getOppositeEdges() const
get opposite edges
Definition GNEEdge.cpp:763
void copyTemplate(const GNEEdgeTemplate *edgeTemplate, GNEUndoList *undoList)
copy edge attributes from edgetemplate
Definition GNEEdge.cpp:1098
void editEndpoint(Position pos, GNEUndoList *undoList)
makes pos the new geometry endpoint at the appropriate end, or remove current existent endpoint
Definition GNEEdge.cpp:851
Position getSplitPos(const Position &clickPos)
Definition GNEEdge.cpp:835
void straightenElevation(GNEUndoList *undoList)
interpolate z values linear between junctions
Definition GNEEdge.cpp:2378
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
Definition GNEEdge.cpp:1290
void resetEndpoint(const Position &pos, GNEUndoList *undoList)
restores the endpoint to the junction position at the appropriate end
Definition GNEEdge.cpp:903
bool addEdgeRelationData(const GNEViewNetHelper::ViewObjectsSelector &viewObjects, const GNEViewNetHelper::MouseButtonKeyPressed &mouseButtonKeyPressed)
add additional element
void focusUpperElement()
focus upper element of frame
Definition GNEFrame.cpp:114
virtual void show()
show Frame
Definition GNEFrame.cpp:120
GNEPathCreator * getPathCreator() const
get GNEPathCreator modul
Dialog to edit geometry points.
const GNEHierarchicalContainerParents< GNEDemandElement * > & getParentDemandElements() const
get parent demand elements
const GNEHierarchicalContainerChildren< GNELane * > & getChildLanes() const
get child lanes
const GNEHierarchicalContainerParents< GNEJunction * > & getParentJunctions() const
get parent junctions
void setEdgeTemplate(const GNEEdge *edge)
set edge template
GNEEdgeTemplate * getEdgeTemplate() const
get edge template (to copy attributes from)
TemplateEditor * getTemplateEditor() const
get template editor
bool inspectClickedElements(GNEViewNetHelper::ViewObjectsSelector &viewObjects, const Position &clickedPosition, const bool shiftKeyPressed)
process click over Viewnet
void show()
show inspector frame
GNEOverlappedInspection * getOverlappedInspection() const
get GNEOverlappedInspection modul
void clearInspection()
clear inspection
GNEAttributesEditor * getAttributesEditor() const
get AttributesEditor
void inspectElement(GNEAttributeCarrier *AC, GNEAttributeCarrier *previousInspectedAC=nullptr)
Inspect a single element.
const std::vector< GNEEdge * > & getGNEIncomingEdges() const
Returns incoming GNEEdges.
std::string getAttribute(SumoXMLAttr key) const
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
Position getPositionInView() const
Returns position of hierarchical element in view.
const std::vector< GNEEdge * > & getGNEOutgoingEdges() const
Returns incoming GNEEdges.
NBNode * getNBNode() const
Return net build node.
This lane is powered by an underlying GNEEdge and basically knows how to draw itself.
Definition GNELane.h:46
const PositionVector & getLaneShape() const
get elements shape
Definition GNELane.cpp:220
int getIndex() const
returns the index of the lane
Definition GNELane.cpp:650
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
Definition GNELane.cpp:777
GNEEdge * getParentEdge() const
get parent edge
Definition GNELane.cpp:202
void show()
show Frame
virtual void removeGeometryPoint(const Position clickedPosition, GNEUndoList *undoList)=0
remove geometry point in the clicked position
void show()
show prohibition frame
const std::unordered_map< SumoXMLTag, std::unordered_map< const GUIGlObject *, GNEDemandElement * >, std::hash< int > > & getDemandElements() const
get demand elements
GNETAZSourceSink * retrieveTAZSourceSink(const GNEAttributeCarrier *sourceSink, bool hardFail=true) const
Returns the named sourceSink.
GNEAttributeCarrier * retrieveAttributeCarrier(const GUIGlID id, bool hardFail=true) const
get a single attribute carrier based on a GLID
std::vector< GNEAdditional * > getSelectedShapes() const
get selected shapes
GNELane * retrieveLane(const std::string &id, bool hardFail=true, bool checkVolatileChange=false) const
get lane by id
const std::unordered_map< SumoXMLTag, std::unordered_map< const GUIGlObject *, GNEGenericData * >, std::hash< int > > & getGenericDatas() const
get all generic datas
GNECrossing * retrieveCrossing(const GUIGlObject *glObject, bool hardFail=true) const
get Crossing by AC
GNEAdditional * retrieveAdditional(SumoXMLTag type, const std::string &id, bool hardFail=true) const
Returns the named additional.
GNEWalkingArea * retrieveWalkingArea(const GUIGlObject *glObject, bool hardFail=true) const
get WalkingArea by GlObject
GNEJunction * retrieveJunction(const std::string &id, bool hardFail=true) const
get junction by id
GNEDataSet * retrieveDataSet(const std::string &id, bool hardFail=true) const
Returns the named data set.
std::vector< GNELane * > getSelectedLanes() const
get selected lanes
const std::map< std::string, GNEEdge * > & getEdges() const
map with the ID and pointer to edges of net
std::string generateAdditionalID(SumoXMLTag type) const
generate additional id
std::vector< GNEJunction * > getSelectedJunctions() const
return selected junctions
GNEDataInterval * retrieveDataInterval(const GNEAttributeCarrier *AC, bool hardFail=true) const
Returns the data interval.
GNEEdge * retrieveEdge(const std::string &id, bool hardFail=true) const
get edge by id
const std::unordered_map< const GUIGlObject *, GNELane * > & getLanes() const
get lanes
std::vector< GNEEdge * > getSelectedEdges() const
return all edges
const std::map< std::string, GNEJunction * > & getJunctions() const
get junctions
GNEDemandElement * retrieveDemandElement(SumoXMLTag type, const std::string &id, bool hardFail=true) const
Returns the named demand element.
GNEGenericData * retrieveGenericData(const GUIGlObject *glObject, bool hardFail=true) const
Returns the generic data.
std::vector< GNEAttributeCarrier * > getSelectedAttributeCarriers(const bool ignoreCurrentSupermode)
get all selected attribute carriers (or only relative to current supermode
GNEConnection * retrieveConnection(const std::string &id, bool hardFail=true) const
get Connection by id
A NBNetBuilder extended by visualisation and editing capabilities.
Definition GNENet.h:42
void deleteEdge(GNEEdge *edge, GNEUndoList *undoList, bool recomputeConnections)
removes edge
Definition GNENet.cpp:461
void deleteLane(GNELane *lane, GNEUndoList *undoList, bool recomputeConnections)
removes lane
Definition GNENet.cpp:640
void deleteCrossing(GNECrossing *crossing, GNEUndoList *undoList)
remove crossing
Definition GNENet.cpp:697
SUMORTree & getGrid()
Returns the RTree used for visualisation speed-up.
Definition GNENet.cpp:196
void deleteAdditional(GNEAdditional *additional, GNEUndoList *undoList)
remove additional
Definition GNENet.cpp:715
void computeAndUpdate(OptionsCont &neteditOptions, bool volatileOptions)
recompute the network and update lane geometries
Definition GNENet.cpp:3016
GNEPathManager * getDataPathManager()
get data path manager
Definition GNENet.cpp:183
void reverseEdge(GNEEdge *edge, GNEUndoList *undoList)
reverse edge
Definition GNENet.cpp:1117
NBTrafficLightLogicCont & getTLLogicCont()
returns the tllcont of the underlying netbuilder
Definition GNENet.cpp:2201
bool restrictLane(SUMOVehicleClass vclass, GNELane *lane, GNEUndoList *undoList)
transform lane to restricted lane
Definition GNENet.cpp:856
void setViewNet(GNEViewNet *viewNet)
Set the net to be notified of network changes.
Definition GNENet.cpp:1425
void deleteDemandElement(GNEDemandElement *demandElement, GNEUndoList *undoList)
remove demand element
Definition GNENet.cpp:749
void duplicateLane(GNELane *lane, GNEUndoList *undoList, bool recomputeConnections)
duplicates lane
Definition GNENet.cpp:840
void deleteDataInterval(GNEDataInterval *dataInterval, GNEUndoList *undoList)
remove data interval
Definition GNENet.cpp:788
void deleteConnection(GNEConnection *connection, GNEUndoList *undoList)
remove connection
Definition GNENet.cpp:682
GNEPathManager * getDemandPathManager()
get demand path manager
Definition GNENet.cpp:177
void resetJunctionConnections(GNEJunction *junction, GNEUndoList *undoList)
reset junction's connections
Definition GNENet.cpp:2116
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
Definition GNENet.cpp:230
void deleteGenericData(GNEGenericData *genericData, GNEUndoList *undoList)
remove generic data
Definition GNENet.cpp:801
std::pair< GNEJunction *, GNEEdge * > splitEdge(GNEEdge *edge, const Position &pos, GNEUndoList *undoList, GNEJunction *newJunction=0)
split edge at position by inserting a new junction
Definition GNENet.cpp:976
GNENetHelper::AttributeCarriers * getAttributeCarriers() const
get all attribute carriers used in this net
Definition GNENet.cpp:147
GNEEdge * addReversedEdge(GNEEdge *edge, const bool disconnected, GNEUndoList *undoList)
add reversed edge
Definition GNENet.cpp:1133
void splitEdgesBidi(GNEEdge *edge, GNEEdge *oppositeEdge, const Position &pos, GNEUndoList *undoList)
split all edges at position by inserting one new junction
Definition GNENet.cpp:1093
bool removeRestrictedLane(SUMOVehicleClass vclass, GNEEdge *edge, GNEUndoList *undoList)
remove restricted lane
Definition GNENet.cpp:962
void deleteTAZSourceSink(GNETAZSourceSink *TAZSourceSink, GNEUndoList *undoList)
remove TAZSourceSink
Definition GNENet.cpp:740
bool addRestrictedLane(SUMOVehicleClass vclass, GNEEdge *edge, int index, GNEUndoList *undoList)
add restricted lane to edge
Definition GNENet.cpp:909
bool addGreenVergeLane(GNEEdge *edge, int index, GNEUndoList *undoList)
add restricted lane to edge
Definition GNENet.cpp:945
void deleteDataSet(GNEDataSet *dataSet, GNEUndoList *undoList)
remove data set
Definition GNENet.cpp:775
GNEPathManager * getNetworkPathManager()
get network path manager
Definition GNENet.cpp:171
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:2019
void selectRoundabout(GNEJunction *junction, GNEUndoList *undoList)
select all roundabout edges and junctions for the current roundabout
Definition GNENet.cpp:1202
void replaceJunctionByGeometry(GNEJunction *junction, GNEUndoList *undoList)
replace the selected junction by geometry node(s) and merge the edges
Definition GNENet.cpp:1974
void createRoundabout(GNEJunction *junction, GNEUndoList *undoList)
transform the given junction into a roundabout
Definition GNENet.cpp:1221
void requireRecompute()
inform the net about the need for recomputation
Definition GNENet.cpp:1601
void initGNEConnections()
initialize GNEConnections
Definition GNENet.cpp:3003
void deleteJunction(GNEJunction *junction, GNEUndoList *undoList)
removes junction and all incident edges
Definition GNENet.cpp:414
NBEdgeCont & getEdgeCont()
returns the NBEdgeCont of the underlying netbuilder
Definition GNENet.cpp:2207
GNEViewNet * getViewNet() const
get view net
Definition GNENet.cpp:2195
void clearJunctionConnections(GNEJunction *junction, GNEUndoList *undoList)
clear junction's connections
Definition GNENet.cpp:2104
void computeDemandElements(GNEApplicationWindow *window)
compute demand elements param[in] window The window to inform about delay
Definition GNENet.cpp:1550
void closeShapeEdited(GNEUndoList *undoList)
close shape edited
void setFirstGeometryPointShapeEdited(const int index, GNEUndoList *undoList)
set first geometry point shape edited
void openShapeEdited(GNEUndoList *undoList)
open shape edited
int getGeometryPointUnderCursorShapeEdited() const
get index geometry point under cursor of shape edited
void simplifyShapeEdited(GNEUndoList *undoList)
simplify shape edited
void straigthenShapeEdited(GNEUndoList *undoList)
straigthen shape edited
void deleteGeometryPointShapeEdited(const int index, GNEUndoList *undoList)
delete geometry point shape edited
void resetShapeEdited(GNEUndoList *undoList)
reset shape edited
bool overlappedInspectionShown() const
check if overlappedInspection modul is shown
long onCmdCreatePath(FXObject *, FXSelector, void *)
void abortPathCreation()
abort path creation
void removeLastElement()
remove path element
bool createPath(const bool useLastRoute)
create path
void drawTemporalRoute(const GUIVisualizationSettings &s) const
draw temporal route
void calculateReachability(const SUMOVehicleClass vClass, GNEEdge *originEdge)
calculate reachability for given edge
void clearPathDraw()
clear path draw
PathCalculator * getPathCalculator()
obtain instance of PathCalculator
PathDraw * getPathDraw()
obtain instance of PathDraw
void redrawPathElements(const GUIVisualizationSettings &s) const
redraw path elements saved in gViewObjectsHandler buffer
void show()
show Frame
GNEPlanCreator * getPlanCreator() const
get plan creator module
GNEPlanSelector * getPlanSelector() const
get personPlan selector
bool addPerson(const GNEViewNetHelper::ViewObjectsSelector &viewObjects)
add vehicle element
bool addPersonPlanElement(const GNEViewNetHelper::ViewObjectsSelector &viewObjects)
add person plan element
GNEPlanCreator * getPlanCreator() const
get plan creator module
GNEPlanSelector * getPlanSelector() const
get personPlan selector
void removeLastElement()
remove path element
long onCmdCreatePath(FXObject *, FXSelector, void *)
void abortPathCreation()
abort path creation
void drawTemporalRoute(const GUIVisualizationSettings &s) const
draw temporal route
const GNETagProperties * getCurrentPlanTagProperties() const
get current plan tag properties
int getVertexIndex(Position pos, bool snapToGrid)
return index of a vertex of shape, or of a new vertex if position is over an shape's edge
Definition GNEPoly.cpp:345
void closePolygon(bool allowUndo=true)
close polygon
Definition GNEPoly.cpp:424
void changeFirstGeometryPoint(int oldIndex, bool allowUndo=true)
change first geometry point
Definition GNEPoly.cpp:445
void deleteGeometryPoint(const Position &pos, bool allowUndo=true)
delete the geometry point closest to the given pos
Definition GNEPoly.cpp:361
CommonXMLStructure::SumoBaseObject * getSumoBaseObject() const
get SUMOBaseObject with all polygon attributes
Definition GNEPoly.cpp:517
void simplifyShape(bool allowUndo=true)
replace the current shape with a rectangle
Definition GNEPoly.cpp:485
void openPolygon(bool allowUndo=true)
open polygon
Definition GNEPoly.cpp:403
long onCmdCancel(FXObject *, FXSelector, void *)
Called when the user presses the Cancel-button discards any prohibition modifications.
void handleProhibitionClick(const GNEViewNetHelper::ViewObjectsSelector &viewObjects)
handle prohibitions and set the relative coloring
GNEProhibitionFrame::Selection * getSelectionModul() const
get selection module
void show()
show prohibition frame
GNEDistributionFrame::DistributionSelector * getDistributionSelector() const
get route distribution selector
void show()
show delete frame
GNEPathCreator * getPathCreator() const
get path creator module
bool addEdgeRoute(GNEEdge *clickedEdge, const GNEViewNetHelper::MouseButtonKeyPressed &mouseButtonKeyPressed)
add route edge
static void addReverse(GNEDemandElement *element)
add reverse for given demand element
static void reverse(GNEDemandElement *element)
reverse given demand element
void show()
show Frame
void clearCurrentSelection() const
clear current selection with possibility of undo/redo
bool selectAttributeCarrier(const GNEViewNetHelper::ViewObjectsSelector &viewObjects)
select attribute carrier (element)
void show()
show Frame
bool processClick(const Position &clickedPosition, const GNEViewNetHelper::ViewObjectsSelector &viewObjects, bool &updateTemporalShape)
process click over Viewnet
GNEDrawingShape * getDrawingShapeModule() const
get drawing mode editor
void show()
show Frame
bool addStop(const GNEViewNetHelper::ViewObjectsSelector &viewObjects, const GNEViewNetHelper::MouseButtonKeyPressed &mouseButtonKeyPressed)
add Stop element
void setTAZ(GNETAZ *editedTAZ)
set current TAZ
GNETAZ * getTAZ() const
get current TAZ
bool isChangesPending() const
return true if there is changes to save
long onCmdSaveChanges(FXObject *, FXSelector, void *)
TAZSaveChanges * getTAZSaveChangesModule() const
get TAZ Save Changes modul
GNEDrawingShape * getDrawingShapeModule() const
get drawing mode modul
CurrentTAZ * getCurrentTAZModule() const
get Current TAZ modul
void show()
show TAZ Frame
void processEdgeSelection(const std::vector< GNEEdge * > &edges)
process selection of edges in view net
bool processClick(const Position &clickedPosition, const GNEViewNetHelper::ViewObjectsSelector &viewObjects)
process click over Viewnet
bool setTAZ(const GNEViewNetHelper::ViewObjectsSelector &viewObjects)
set clicked TAZ
void buildTAZRelationData()
build TAZRelation data
void clearTAZSelection()
clear TAZ selection
bool isSetDetectorsToggleButtonEnabled() const
toggle button for set detectors mode
void disableE1DetectorMode()
disable detector mode
const std::map< std::string, std::string > & getE1Detectors() const
get E1 detectors vinculated with this TLS
const std::vector< std::string > & getSelectedJunctionIDs() const
get selected junction IDs
long onCmdCancelJoin(FXObject *, FXSelector, void *)
cancel join
long onCmdAcceptJoin(FXObject *, FXSelector, void *)
accept join
GNEJunction * getCurrentJunction() const
get current modified junction
bool isJoiningJunctions() const
is joining junctions
bool checkHaveModifications() const
check if current TLS was modified
long onCmdSaveChanges(FXObject *, FXSelector, void *)
Called when the user presses the save-Button.
void discardChanges(const bool editJunctionAgain)
discard changes
GNETLSEditorFrame::TLSAttributes * getTLSAttributes() const
get module for TLS attributes
void editJunction(GNEJunction *junction)
edits the traffic light for the given junction
GNETLSEditorFrame::TLSJunction * getTLSJunction() const
get module for TLS Junction
void editTLS(GNEViewNetHelper::ViewObjectsSelector &viewObjects, const Position &clickedPosition, const bool shiftKeyPressed)
edits the traffic light for the given clicked junction
GNETLSEditorFrame::TLSPrograms * getTLSPrograms() const
get module for TLS Definition
void show()
show inspector frame
bool isContainer() const
return true if tag correspond to a container element
bool planRoute() const
return true if tag correspond to a plan placed over route
bool isPlacedInRTree() const
return true if Tag correspond to an element that has to be placed in RTREE
SumoXMLTag getTag() const
get Tag vinculated with this attribute Property
bool hasDialog() const
return true if tag correspond to an element that can be edited using a dialog
bool isAdditionalElement() const
return true if tag correspond to an additional element (note: this include TAZ, shapes and wires)
bool isPerson() const
return true if tag correspond to a person element
GNEDistributionFrame::DistributionSelector * getDistributionSelector() const
get type distribution selector
void show()
show Frame
void end()
End undo command sub-group. If the sub-group is still empty, it will be deleted; otherwise,...
void begin(GUIIcon icon, const std::string &description)
Begin undo command sub-group with current supermode. This begins a new group of commands that are tre...
void abortAllChangeGroups()
reverts and discards ALL active chained change groups
void add(GNEChange *command, bool doit=false, bool merge=true)
Add new command, executing it if desired. The new command will be merged with the previous command if...
GNEPathCreator * getPathCreator() const
get GNEPathCreator module
void show()
show Frame
bool addVehicle(const GNEViewNetHelper::ViewObjectsSelector &viewObjects, const GNEViewNetHelper::MouseButtonKeyPressed &mouseButtonKeyPressed)
add vehicle element
class used for group inspected elements
bool isInspectingElements() const
check if we're inspecting at least one element
const std::unordered_set< GNEAttributeCarrier * > & getACs() const
get hash table with all inspected ACs
GNEAttributeCarrier * getFirstAC() const
class used to group all variables related to interval bar
void hideIntervalBar()
hide all options menu checks
void setGenericDataType()
set generic data type
void showIntervalBar()
show interval option bar
void buildIntervalBarElements()
build interval bar elements
void setInterval()
update limit by interval
void updateLockMenuBar()
update lock inspect menuBar
bool isObjectLocked(GUIGlObjectType objectType, const bool selected) const
check if given GLObject is locked for inspect, select, delete and move
class used for group front elements
void unmarkAC(GNEAttributeCarrier *AC)
unmark AC for drawing front
const std::unordered_set< GNEAttributeCarrier * > & getACs() const
get hash table with all fronted ACs
class used to group all variables related with objects under cursor after a click over view
void updateObjects()
update objects (using gViewObjectsHandler)
void filterConnections()
filter (remove) connections
void updateMergingJunctions()
update merging junctions
GNEConnection * getConnectionFront() const
get front connection or a pointer to nullptr
const std::vector< GNEAttributeCarrier * > & getAttributeCarriers() const
get vector with ACs
void filterEdges()
filter (remove) edges
void filterLockedElements(const std::vector< GUIGlObjectType > ignoreFilter={})
filter locked elements (except the ignoreFilter)
void filterCrossings()
filter (remove) crossings
GNEPOI * getPOIFront() const
get front POI or a pointer to nullptr
GNEEdge * getEdgeFront() const
get front edge or a pointer to nullptr
GNEAttributeCarrier * getAttributeCarrierFront() const
get front attribute carrier or a pointer to nullptr
void filterDemandElements(const bool includeRoutes)
filter (remove) demand elements
void filterWalkingAreas()
filter (remove) walkingAreas
void filterAdditionals(const bool includeStoppigPlaces, const bool includeTAZs)
filter (remove) additionals
GNELane * getLaneFront() const
get front lane or a pointer to nullptr
GNELane * getLaneFrontNonLocked() const
get front lane or a pointer to nullptr checking if is locked
const GUIGlObject * getGUIGlObjectFront() const
get front GUIGLObject or a pointer to nullptr
GNENetworkElement * getNetworkElementFront() const
get front network element or a pointer to nullptr
void filterLanes()
filter (remove) lanes
const std::vector< GUIGlObject * > & getGLObjects() const
get vector with GL objects
void filterShapes()
filter (remove) polys and POIs
GNEViewNetHelper::EditNetworkElementShapes myEditNetworkElementShapes
struct for grouping all variables related with edit shapes
Definition GNEViewNet.h:730
long onCmdToggleShowDemandElementsNetwork(FXObject *, FXSelector, void *)
toggle show demand elements (network)
long onCmdClosePolygon(FXObject *, FXSelector, void *)
close opened polygon
bool isCurrentlyMovingElements() const
check if an element is being moved
long onCmdEditCrossingShape(FXObject *, FXSelector, void *)
edit crossing shape
void processMoveMouseNetwork(const bool mouseLeftButtonPressed)
process move mouse function in Supermode Network
const GNEViewNetHelper::DataViewOptions & getDataViewOptions() const
get data view options
GNENet * getNet() const
get the net object
long onCmdSetFirstGeometryPoint(FXObject *, FXSelector, void *)
set as first geometry point the closes geometry point
long onCmdEdgeUseAsTemplate(FXObject *, FXSelector, void *)
use edge as template
long onCmdSmoothConnectionShape(FXObject *, FXSelector, void *)
edit connection shape
GNEViewNetHelper::CommonCheckableButtons myCommonCheckableButtons
variable used to save checkable buttons for common supermodes
Definition GNEViewNet.h:651
long onMouseMove(FXObject *, FXSelector, void *)
called when user moves mouse
void hotkeyBackSpace()
handle backspace keypress
GNEViewNetHelper::MarkFrontElements myMarkFrontElements
front element
Definition GNEViewNet.h:739
GNEDemandElement * myLastCreatedRoute
last created route
Definition GNEViewNet.h:754
const GNEViewNetHelper::EditModes & getEditModes() const
get edit modes
long onCmdAddSelected(FXObject *, FXSelector, void *)
select AC under cursor
const GNEViewNetHelper::EditNetworkElementShapes & getEditNetworkElementShapes() const
get Edit Shape module
GNEFixAdditionalElements * myFixAdditionalElementsDialog
fix additional elements dialog
Definition GNEViewNet.h:713
GNEAllowVClassesDialog * getAllowVClassesDialog() const
get allow vClasses dialog
GNECrossing * getCrossingAtPopupPosition()
try to retrieve a crossing at popup position
void buildViewToolBars(GUIGlChildWindow *v)
builds the view toolbars
void updateNetworkModeSpecificControls()
updates Network mode specific controls
long onCmdAddTLS(FXObject *, FXSelector, void *)
add TLS
long onCmdSmoothEdges(FXObject *, FXSelector, void *)
smooth geometry
long onCmdStraightenEdges(FXObject *, FXSelector, void *)
makes selected edges straight
const GNEViewNetHelper::MouseButtonKeyPressed & getMouseButtonKeyPressed() const
get Key Pressed module
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:632
long onCmdReplaceJunction(FXObject *, FXSelector, void *)
replace node by geometry
bool restrictLane(GNELane *lane, SUMOVehicleClass vclass)
restrict lane
long onCmdSplitJunction(FXObject *, FXSelector, void *)
split junction into multiple junctions
void drawGrid() const
draw grid and update grid button
void deleteDemandAttributeCarrier(const GNEAttributeCarrier *AC)
delete given demand attribute carriers
long onCmdClearConnections(FXObject *, FXSelector, void *)
clear junction connections
void abortOperation(bool clearSelection=true)
abort current edition operation
long onCmdToggleTAZDrawFill(FXObject *, FXSelector, void *)
toggle TAZdrawFill
long onCmdResetEndPoints(FXObject *, FXSelector, void *)
reset edge end points
void updateObjectsInPosition(const Position &pos)
update objects and boundaries in position
GNEViewNetHelper::TestingMode myTestingMode
variable used to save variables related with testing mode
Definition GNEViewNet.h:635
GNEDemandElement * getLastCreatedRoute() const
get last created route
GNEViewNetHelper::InspectedElements & getInspectedElements()
get inspected elements
long onCmdToggleDrawSpreadVehicles(FXObject *, FXSelector, void *)
toggle draw vehicles in begin position or spread in lane
GNEPOI * getPOIAtPopupPosition()
try to retrieve a POILane at popup position
GNEViewNetHelper::SelectingArea mySelectingArea
variable used for grouping all variables related with selecting areas
Definition GNEViewNet.h:727
GNENetworkElement * getShapeEditedAtPopupPosition()
try to retreive a edited shape at popup position
const GNEViewNetHelper::MoveSingleElementModul & getMoveSingleElementValues() const
get move single element values
long onCmdToggleShowConnections(FXObject *, FXSelector, void *)
toggle show connections
long onCmdLaneReachability(FXObject *, FXSelector sel, void *)
show lane reachability
long onCmdToggleShowTAZElements(FXObject *, FXSelector, void *)
toggle show TAZ elements
GNEViewNetHelper::NetworkCheckableButtons myNetworkCheckableButtons
variable used to save checkable buttons for Supermode Network
Definition GNEViewNet.h:654
long onCmdCloseShapeEdited(FXObject *, FXSelector, void *)
close opened shape edited
std::vector< std::string > getEdgeDataAttrs() const
return list of loaded edgeData attributes
bool myCreatedPopup
flag for mark if during this frame a popup was created (needed to avoid problems in linux with Cursor...
Definition GNEViewNet.h:760
void openSelectDialogAtCursor(const std::vector< GUIGlObject * > &GLObjects)
open select dialog at cursor
long onCmdSimplifyShapeEdited(FXObject *, FXSelector, void *)
void openObjectDialogAtCursor(const FXEvent *ev)
open object dialog
void processClick(void *eventData)
Auxiliary function used by onLeftBtnPress(...)
void drawNeteditAttributesReferences()
draw circle in testing mode (needed for grid)
long onCmdSimplifyShape(FXObject *, FXSelector, void *)
simply shape of current polygon
GNELane * getLaneAtPopupPosition()
try to retrieve a lane at popup position
GNEViewNetHelper::MouseButtonKeyPressed myMouseButtonKeyPressed
variable used to save key status after certain events
Definition GNEViewNet.h:643
bool askMergeJunctions(const GNEJunction *movedJunction, const GNEJunction *targetJunction, bool &alreadyAsked)
ask merge junctions
void recalculateBoundaries()
recalculate boundaries
GNEViewNetHelper::IntervalBar myIntervalBar
variable used to save IntervalBar
Definition GNEViewNet.h:679
GNEViewParent * myViewParent
view parent
Definition GNEViewNet.h:742
bool showJunctionAsBubbles() const
return true if junction must be showed as bubbles
bool changeAllPhases() const
change all phases
long onCmdEditJunctionShape(FXObject *, FXSelector, void *)
edit junction shape
long onCmdToggleMoveElevation(FXObject *, FXSelector, void *)
toggle move elevation
GNEWalkingArea * getWalkingAreaAtPopupPosition()
try to retrieve a walkingArea at popup position
long onCmdToggleShowAllPersonPlans(FXObject *, FXSelector, void *)
toggle show all person plans in super mode demand
bool setColorScheme(const std::string &name)
set color scheme
long onCmdOpenAdditionalDialog(FXObject *, FXSelector, void *)
open additional dialog
long onCmdToggleTAZRelOnlyTo(FXObject *, FXSelector, void *)
toggle TAZRez only to
long onCmdEgeApplyTemplate(FXObject *, FXSelector, void *)
apply template to edge
long onCmdSetNeteditView(FXObject *, FXSelector sel, void *)
called when a new view is set
const GNEViewNetHelper::NetworkViewOptions & getNetworkViewOptions() const
get network view options
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:671
void drawTemporalJunctionTLSLines() const
draw temporal Junction TLS Lines
std::vector< std::string > getEdgeLaneParamKeys(bool edgeKeys) const
return list of available edge parameters
long onCmdLaneOperation(FXObject *, FXSelector sel, void *)
add/remove/restrict lane
void processMoveMouseData(const bool mouseLeftButtonPressed)
process move mouse function in Supermode Data
GNEFrame * myCurrentFrame
the current frame
Definition GNEViewNet.h:748
bool autoSelectNodes()
whether to autoselect nodes or to lanes
void drawTemporalRoundabout() const
draw temporal roundabout
void deleteDataAttributeCarrier(const GNEAttributeCarrier *AC)
delete data attribute carriers
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:751
GNEViewNetHelper::NetworkViewOptions myNetworkViewOptions
variable used to save variables related with view options in supermode Network
Definition GNEViewNet.h:668
void doInit()
called after some features are already initialized
long onCmdResetEdgeEndPoints(FXObject *, FXSelector, void *)
edit junction shape
void buildEditModeControls()
create edit mode buttons and elements
GNEViewNetHelper::MoveSingleElementModul myMoveSingleElement
modul used for moving single element
Definition GNEViewNet.h:685
long onMiddleBtnRelease(FXObject *, FXSelector, void *)
called when user releases mouse's left button
int getDrawingToggle() const
get draw toggle (used to avoid drawing junctions twice)
GNEViewNetHelper::DataCheckableButtons myDataCheckableButtons
variable used to save checkable buttons for Supermode Data
Definition GNEViewNet.h:660
long onCmdToggleShowGrid(FXObject *, FXSelector, void *)
toggle show grid
void processLeftButtonPressDemand(void *eventData)
process left button press function in Supermode Demand
GNEAllowVClassesDialog * myAllowVClassesDialog
allowVClasses dialog
Definition GNEViewNet.h:707
GNEDemandElement * getDemandElementAtPopupPosition()
try to retrieve a demand element at popup position
GNEViewNetHelper::TimeFormat myTimeFormat
variable used for grouping all variables related with switch time
Definition GNEViewNet.h:724
long onLeaveConvertRoundabout(FXObject *, FXSelector, void *)
leave to convert junction to roundabout
GNEViewNetHelper::IntervalBar & getIntervalBar()
get interval bar
long onCmdEditLaneShape(FXObject *, FXSelector, void *)
edit lane shape
GNEViewNetHelper::MarkFrontElements & getMarkFrontElements()
get marked for drawing front elements
long onCmdToggleHideNonInspecteDemandElements(FXObject *, FXSelector, void *)
toggle hide non inspected demand elements
GNEViewParent * getViewParent() const
get the net object
GNEFixNetworkElements * myFixNetworkElementsDialog
fix network elements dialog
Definition GNEViewNet.h:710
long onCmdToggleDrawJunctionShape(FXObject *, FXSelector, void *)
toggle draw junction shape
bool checkOverLockedElement(const GUIGlObject *GLObject, const bool isSelected) const
check if given element is locked (used for drawing select and delete contour)
long onCmdStraightenShapeEdited(FXObject *, FXSelector, void *)
straight shape edited
long onCmdAddReversedEdge(FXObject *, FXSelector, void *)
add reversed edge
void processLeftButtonReleaseNetwork()
process left button release function in Supermode Network
long onCmdDeleteGeometryPointShapeEdited(FXObject *, FXSelector, void *)
delete the closes geometry point in shape edited
bool checkSelectEdges() const
check if select edges (toggle using button or shift)
long onMiddleBtnPress(FXObject *, FXSelector, void *)
called when user press mouse's left button
long onCmdAddReversedEdgeDisconnected(FXObject *, FXSelector, void *)
add reversed edge disconnected
long onCmdIntervalBarGenericDataType(FXObject *, FXSelector, void *)
change generic data type in interval bar
long onCmdConvertRoundabout(FXObject *, FXSelector, void *)
convert junction to roundabout
long onCmdRemoveEdgeSelected(FXObject *, FXSelector, void *)
unselect Edge under cursor
long onCmdAddReverse(FXObject *, FXSelector, void *)
add a reverse demand element
long onCmdToggleShowShapes(FXObject *, FXSelector, void *)
toggle show shapes in super mode data
long onCmdToggleMergeAutomatically(FXObject *, FXSelector, void *)
toggle warn for merge
long onRightBtnPress(FXObject *, FXSelector, void *)
called when user press mouse's right button
long onCmdOpenPolygon(FXObject *, FXSelector, void *)
open closed polygon
GNEViewNetHelper::InspectedElements myInspectedElements
inspected element
Definition GNEViewNet.h:736
long onCmdSetCustomGeometryPoint(FXObject *, FXSelector, void *)
set custom geometry point
bool removeRestrictedLane(GNELane *lane, SUMOVehicleClass vclass)
remove restricted lane
long onCmdIntervalBarDataSet(FXObject *, FXSelector, void *)
change data set in interval bar
GNEViewNetHelper::SaveElements & getSaveElements()
get variable used to save elements
void processLeftButtonReleaseDemand()
process left button release function in Supermode Demand
const GNEViewNetHelper::TestingMode & getTestingMode() const
get testing mode
GNEUndoList * getUndoList() const
get the undoList object
void processLeftButtonPressData(void *eventData)
process left button press function in Supermode Data
long onCmdTransformPOI(FXObject *, FXSelector, void *)
transform POI to POILane, and vice versa
void saveVisualizationSettings() const
GNEViewNetHelper::SaveElements mySaveElements
variable used for grouping all variables related with salve elements
Definition GNEViewNet.h:721
const GNEViewNetHelper::MoveMultipleElementModul & getMoveMultipleElementValues() const
get move multiple element values
void deleteNetworkAttributeCarrier(const GNEAttributeCarrier *AC)
delete given network attribute carriers
GNEViewNetHelper::LockManager myLockManager
lock manager
Definition GNEViewNet.h:733
long onCmdAddEdgeSelected(FXObject *, FXSelector, void *)
select Edge under cursor
long onCmdIntervalBarSetEnd(FXObject *, FXSelector, void *)
change end in interval bar
const GNEViewNetHelper::ViewObjectsSelector & getViewObjectsSelector() const
get objects under cursor
void drawTemporalDrawingShape() const
draw temporal polygon shape in Polygon Mode
void setLastCreatedRoute(GNEDemandElement *lastCreatedRoute)
set last created route
GNEFixNetworkElements * getFixNetworkElementsDialog() const
get fix network elements dialog
void drawTestsCircle() const
draw circle in testing mode (needed for grid)
long onCmdSplitEdgeBidi(FXObject *, FXSelector, void *)
split edge at cursor position
long onCmdAddJoinTLS(FXObject *, FXSelector, void *)
add Join TLS
GUIGlID getToolTipID()
returns the id of object under cursor to show their tooltip
GNEJunction * getJunctionAtPopupPosition()
try to retrieve a junction at popup position
void drawTemporalSplitJunction() const
draw temporal split junction in create edge mode
long onCmdSetSupermode(FXObject *, FXSelector sel, void *)
long onCmdToggleExtendSelection(FXObject *, FXSelector, void *)
toggle extend selection
long onCmdTriangulatePolygon(FXObject *, FXSelector, void *)
triangulate polygon
GNEViewNetHelper::DemandCheckableButtons myDemandCheckableButtons
variable used to save checkable buttons for Supermode Demand
Definition GNEViewNet.h:657
bool aksChangeSupermode(const std::string &operation, Supermode expectedSupermode)
ask about change supermode
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 onCmdSetFirstGeometryPointShapeEdited(FXObject *, FXSelector, void *)
set first geometry point in shape edited
long onLeftBtnRelease(FXObject *, FXSelector, void *)
called when user releases mouse's left button
long onCmdRemoveSelected(FXObject *, FXSelector, void *)
unselect AC under cursor
long onCmdDeleteGeometryPoint(FXObject *, FXSelector, void *)
delete the closes geometry point
long onCmdDuplicateLane(FXObject *, FXSelector, void *)
duplicate selected lane
void processLeftButtonPressNetwork(void *eventData)
mouse process functions
void hotkeyEnter()
handle enter keypress
GNEConnection * getConnectionAtPopupPosition()
try to retrieve a connection at popup position
long onCmdOpenShapeEdited(FXObject *, FXSelector, void *)
open closed shape edited
long onKeyPress(FXObject *o, FXSelector sel, void *data)
called when user press a key
long onCmdToggleShowOverlappedRoutes(FXObject *, FXSelector, void *)
toggle hide non inspected demand elements
long onCmdToggleAutoOppositeEdge(FXObject *, FXSelector, void *)
toggle autoOpposite edge
long onCmdSplitEdge(FXObject *, FXSelector, void *)
split edge at cursor position
GNEViewNetHelper::LockManager & getLockManager()
get lock manager
long onCmdStraightenEdgesElevation(FXObject *, FXSelector, void *)
interpolate z values linear between junctions
void updateControls()
update control contents after undo/redo or recompute
~GNEViewNet()
destructor
GNEViewNetHelper::MoveMultipleElementModul myMoveMultipleElements
modul used for moving multiple elements
Definition GNEViewNet.h:688
long onCmdSplitJunctionReconnect(FXObject *, FXSelector, void *)
split junction into multiple junctions and reconnect them
long onCmdFinishShapeEdited(FXObject *, FXSelector, void *)
finish shape edited
void hotkeyDel()
handle del keypress
GNEFixDemandElements * getFixDemandElementsDialog() const
get fix additional elements dialog
long onCmdToggleChangeAllPhases(FXObject *, FXSelector, void *)
toggle change all phases
long onEnterConvertRoundabout(FXObject *, FXSelector, void *)
enter to convert junction to roundabout
bool myDrawPreviewRoundabout
draw preview roundabout
Definition GNEViewNet.h:757
void redrawPathElementContours()
redraw elements only for calculating boundary
GNEViewNet()
FOX needs this.
long onCmdToggleTAZRelDrawing(FXObject *, FXSelector, void *)
toggle TAZRel drawing
long onCmdToggleShowJunctionBubbles(FXObject *, FXSelector, void *)
toggle show junction bubbles
bool selectingDetectorsTLSMode() const
check if we're selecting detectors in TLS mode
bool selectingJunctionsTLSMode() const
check if we're selecting junctions in TLS mode
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
GNEFixAdditionalElements * getFixAdditionalElementsDialog() const
get fix additional elements dialog
long onCmdToggleTAZRelOnlyFrom(FXObject *, FXSelector, void *)
toggle TAZRez only from
long onCmdResetShapeEdited(FXObject *, FXSelector, void *)
reset shape edited
long onRightBtnRelease(FXObject *, FXSelector, void *)
called when user releases mouse's right button
void buildColorRainbow(const GUIVisualizationSettings &s, GUIColorScheme &scheme, int active, GUIGlObjectType objectType, const GUIVisualizationRainbowSettings &rs)
recalibrate color scheme according to the current value range
long onCmdIntervalBarSetParameter(FXObject *, FXSelector, void *)
change parameter in interval bar
void drawTemporalE1TLSLines() const
draw temporal E1 TLS Lines
long onCmdReverseEdge(FXObject *, FXSelector, void *)
reverse edge
void processLeftButtonReleaseData()
process left button release function in Supermode Data
long onCmdToggleShowAdditionals(FXObject *, FXSelector, void *)
toggle show additionals in super mode data
long onCmdToggleLockPerson(FXObject *, FXSelector, void *)
toggle lock person in super mode demand
GNEViewNetHelper::TimeFormat & getTimeFormat()
get variable used to switch between time formats
GNENet * myNet
Pointer to current net. (We are not responsible for deletion)
Definition GNEViewNet.h:745
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:674
int myDrawingToggle
drawin toggle (used in drawGLElements to avoid draw elements twice)
Definition GNEViewNet.h:763
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
long onCmdToggleHideConnections(FXObject *, FXSelector, void *)
toggle hide connections
void openDeleteDialogAtCursor(const std::vector< GUIGlObject * > &GLObjects)
open delete dialog at cursor
long onKeyRelease(FXObject *o, FXSelector sel, void *data)
called when user release a key
long onCmdResetConnections(FXObject *, FXSelector, void *)
reset junction connections
long onCmdResetLaneCustomShape(FXObject *, FXSelector, void *)
reset custom shapes of selected lanes
bool addRestrictedLane(GNELane *lane, SUMOVehicleClass vclass, const bool insertAtFront)
add restricted lane
void setStatusBarText(const std::string &text)
set statusBar text
long onCmdEditWalkingAreaShape(FXObject *, FXSelector, void *)
edit walkingArea shape
void processMoveMouseDemand(const bool mouseLeftButtonPressed)
process move mouse function in Supermode Demand
long onCmdResetOppositeLane(FXObject *, FXSelector, void *)
reset oppositeLane of current lane
void setSelectorFrameScale(double selectionScale)
set selection scaling (in GNESelectorFrame)
void viewUpdated()
called when view is updated
long onCmdEditConnectionShape(FXObject *, FXSelector, void *)
edit connection shape
void updateObjectsInShape(const PositionVector &shape)
get objects in the given shape (using triangulation)
void updateDemandModeSpecificControls()
updates Demand mode specific controls
void forceSupemodeNetwork()
force supermode network(used after load/create new network)
GNEAdditional * getAdditionalAtPopupPosition()
try to retrieve a additional at popup position
long onCmdReverse(FXObject *, FXSelector, void *)
reverse current demand element
void drawTemporalJunction() const
draw temporal junction in create edge mode
long onCmdSelectRoundabout(FXObject *, FXSelector, void *)
select all roundabout nodes and edges
long onLeftBtnPress(FXObject *, FXSelector, void *)
GNEFixDemandElements * myFixDemandElementsDialog
fix additional elements dialog
Definition GNEViewNet.h:716
void updateViewNet(const bool ignoreViewUpdater=true) const
Mark the entire GNEViewNet to be repainted later.
int doPaintGL(int mode, const Boundary &drawingBoundary)
do paintGL
std::vector< std::string > getRelDataAttrs() const
return list of loaded edgeRelation and tazRelation attributes
int drawGLElements(const Boundary &bound)
draw functions
long onCmdIntervalBarLimit(FXObject *, FXSelector, void *)
change limit interval in interval bar
GNEViewNetHelper::ViewObjectsSelector myViewObjectsSelector
variable use to select objects in view
Definition GNEViewNet.h:626
void clearSelection()
clear selection
A single child window which contains a view of the simulation area.
GNECrossingFrame * getCrossingFrame() const
get frame for NETWORK_CROSSING
GNEConnectorFrame * getConnectorFrame() const
get frame for NETWORK_CONNECT
GNEStopFrame * getStopFrame() const
get frame for DEMAND_STOP
GNEProhibitionFrame * getProhibitionFrame() const
get frame for NETWORK_PROHIBITION
GNEPersonPlanFrame * getPersonPlanFrame() const
get frame for DEMAND_PERSONFRAME
GNEMeanDataFrame * getMeanDataFrame() const
get frame for DATA_TAZRELDATA
GNEShapeFrame * getShapeFrame() const
get frame for NETWORK_SHAPE
GNETAZRelDataFrame * getTAZRelDataFrame() const
get frame for DATA_TAZRELDATA
GNEMoveFrame * getMoveFrame() const
get frame for move elements
GNESelectorFrame * getSelectorFrame() const
get frame for select elements
GNEContainerPlanFrame * getContainerPlanFrame() const
get frame for DEMAND_CONTAINERFRAME
GNEEdgeDataFrame * getEdgeDataFrame() const
get frame for DATA_EDGEDATA
GNEDeleteFrame * getDeleteFrame() const
get frame for delete elements
GNETypeDistributionFrame * getTypeDistributionFrame() const
get frame for DEMAND_TYPEDISTRIBUTION
GNEVehicleFrame * getVehicleFrame() const
get frame for DEMAND_VEHICLE
GNEDecalFrame * getDecalFrame() const
get frame for NETWORK_DECAL
void hideAllFrames()
hide all frames
GNETypeFrame * getTypeFrame() const
get frame for DEMAND_TYPE
GNETAZFrame * getTAZFrame() const
get frame for NETWORK_TAZ
GNETLSEditorFrame * getTLSEditorFrame() const
get frame for NETWORK_TLS
GNEApplicationWindow * getGNEAppWindows() const
get GNE Application Windows
GNEContainerFrame * getContainerFrame() const
get frame for DEMAND_CONTAINER
GNEAdditionalFrame * getAdditionalFrame() const
get frame for NETWORK_ADDITIONAL
GNERouteDistributionFrame * getRouteDistributionFrame() const
get frame for DEMAND_ROUTEDISTRIBUTION
GNEWireFrame * getWireFrame() const
get frame for NETWORK_WIRE
GNEPersonFrame * getPersonFrame() const
get frame for DEMAND_PERSON
GNEInspectorFrame * getInspectorFrame() const
get frame for inspect elements
GNEEdgeRelDataFrame * getEdgeRelDataFrame() const
get frame for DATA_EDGERELDATA
GNECreateEdgeFrame * getCreateEdgeFrame() const
get frame for NETWORK_CREATEEDGE
GNERouteFrame * getRouteFrame() const
get frame for DEMAND_ROUTE
This object is responsible for drawing a shape and for supplying a a popup menu. Messages are routete...
GNEConsecutiveSelector * getConsecutiveLaneSelector() const
get consecutive lane selector
bool createPath(const bool useLastRoute)
create path
void show()
show wire frame
bool addWire(const GNEViewNetHelper::ViewObjectsSelector &viewObjects)
add wire element
bool contains(const std::string &name) const
Returns the information whether a setting with the given name is stored.
GUIVisualizationSettings & get(const std::string &name)
Returns the named scheme.
const std::vector< std::string > & getNames() const
Returns a list of stored settings names.
Dialog for edit rerouter intervals.
static FXCursor * getCursor(GUICursor which)
returns a cursor previously defined in the enum GUICursor
std::string getCurrentScheme() const
Returns the name of the currently chosen scheme.
void setCurrentScheme(const std::string &)
Sets the named scheme as the current.
static void drawGeometry(const GUIVisualizationSettings::Detail d, const GUIGeometry &geometry, const double width, double offset=0)
draw geometry
static void drawChildLine(const GUIVisualizationSettings &s, const Position &child, const Position &parent, const RGBColor &color, const bool drawEntire, const double lineWidth)
draw line between child and parent (used in netedit)
void updateGeometry(const PositionVector &shape)
update entire geometry
MFXComboBoxIcon * getColoringSchemesCombo()
return combobox with the current coloring schemes (standard, fastest standard, real world....
FXPopup * getLocatorPopup()
@ brief return a pointer to locator popup
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 bool isGLObjectLocked() const
check if element is locked (Currently used only in netedit)
GUIGlID getGlID() const
Returns the numerical id of the object.
GUIGlObject * getObjectBlocking(GUIGlID id) const
Returns the object from the container locking it.
static GUIGlObjectStorage gIDStorage
A single static instance of this class.
static FXIcon * getIcon(const GUIIcon which)
returns a icon previously defined in the enum GUIIcon
MFXStaticToolTip * getStaticTooltipMenu() const
get static toolTip for menus
virtual void setStatusBarText(const std::string &)
get status bar text (can be implemented in children)
virtual double getRotation() const =0
Returns the rotation of the canvas stored in this changer.
virtual double getZoom() const =0
Returns the zoom factor computed stored in this changer.
virtual void onLeftBtnPress(void *data)
mouse functions
virtual double getXPos() const =0
Returns the x-offset of the field to show stored in this changer.
virtual double getYPos() const =0
Returns the y-offset of the field to show stored in this changer.
T getColor(const double value) const
const std::string & getName() const
int addColor(const T &color, const double threshold, const std::string &name="")
bool myAmInitialised
Internal information whether doInit() was called.
Position snapToActiveGrid(const Position &pos, bool snapXY=true) const
Returns a position that is mapped to the closest grid point if the grid is active.
std::vector< GUIGlObject * > myCurrentObjectsDialog
vector with current objects dialog
virtual long onLeftBtnRelease(FXObject *, FXSelector, void *)
const SUMORTree * myGrid
The visualization speed-up.
void openObjectDialog(const std::vector< GUIGlObject * > &objects, const bool filter=true)
open object dialog for the given object
void paintGLGrid() const
paints a grid
FXbool makeCurrent()
A reimplementation due to some internal reasons.
Position myClickedPopupPosition
clicked poup position
void buildMinMaxRainbow(const GUIVisualizationSettings &s, GUIColorScheme &scheme, const GUIVisualizationRainbowSettings &rs, double minValue, double maxValue, bool hasMissingData)
helper function for buildColorRainbow
virtual long onMiddleBtnRelease(FXObject *, FXSelector, void *)
virtual long onMouseMove(FXObject *, FXSelector, void *)
bool myPanning
Panning flag.
GUIMainWindow * myApp
The application.
std::vector< GUIGlID > getObjectsInBoundary(Boundary bound)
returns the ids of all objects in the given boundary
const Position & getPopupPosition() const
get position of current popup
double m2p(double meter) const
meter-to-pixels conversion method
GUIVisualizationSettings * myVisualizationSettings
visualization settings
void destroyPopup()
destroys the popup
virtual long onKeyPress(FXObject *o, FXSelector sel, void *data)
keyboard functions
virtual long onMiddleBtnPress(FXObject *, FXSelector, void *)
virtual Position getPositionInformation() const
Returns the cursor's x/y position within the network.
virtual long onKeyRelease(FXObject *o, FXSelector sel, void *data)
GUIDialog_ViewSettings * myGUIDialogViewSettings
Visualization changer.
void drawDecals()
Draws the stored decals.
virtual long onRightBtnRelease(FXObject *, FXSelector, void *)
GUIPerspectiveChanger * myChanger
The perspective changer.
GUIGLObjectPopupMenu * myPopup
The current popup-menu.
virtual long onPaint(FXObject *, FXSelector, void *)
virtual long onRightBtnPress(FXObject *, FXSelector, void *)
void openPopupDialog()
open popup dialog
static void resetTextures()
Reset textures.
void setSelectionPosition(const Position &pos)
set selection position
void addToRedrawPathElements(const GNEPathElement *pathElement)
add path element to redrawing set
void reverseSelectedObjects()
reverse selected objects
void isolateEdgeGeometryPoints()
isolate edge geometry points (used for moving)
void reset()
reset view objects handler
void setSelectionTriangle(const Triangle &triangle)
set selection triangle
const GLObjectsSortedContainer & getSelectedObjects() const
get all elements under cursor sorted by layer
const GNEEdge * markedEdge
marked edge (used in create edge mode, for splitting)
void updateFrontObject(const GUIGlObject *GLObject)
move the given object to the front (currently used only in netedit)
bool allowUpdate()
allow update
Stores the information about how to visualize structures.
GUIVisualizationSizeSettings junctionSize
bool drawForRectangleSelection
whether drawing is performed for the purpose of selecting objects using a rectangle
std::string name
The name of this setting.
bool drawJunctionShape
whether the shape of the junction should be drawn
bool disableLaneIcons
whether drawing is performed in left-hand networks
bool lefthand
whether drawing is performed in left-hand networks
bool showLane2Lane
Information whether lane-to-lane arrows shall be drawn.
GUIVisualizationColorSettings colorSettings
color settings
bool showGrid
Information whether a grid shall be shown.
void save(OutputDevice &dev) const
Writes the settings into an output device.
double scale
information about a lane's width (temporary, used for a single view)
void updateIgnoreHideByZoom()
update ignore hide by zoom (call BEFORE drawing all elements).
bool drawForViewObjectsHandler
whether drawing is performed for the purpose of selecting objects in view using ViewObjectsHandler
GUIVisualizationAdditionalSettings additionalSettings
Additional settings.
double selectorFrameScale
the current selection scaling in netedit (set in SelectorFrame)
GUIColorer junctionColorer
The junction colorer.
static const std::string SCHEME_NAME_PERMISSION_CODE
GUIVisualizationNeteditSizeSettings neteditSizeSettings
netedit size settings
bool amChecked() const
check if this MFXCheckableButton is checked
void setChecked(bool val, const bool inform=false)
check or uncheck this MFXCheckableButton
long setCurrentItem(const FXint index, FXbool notify=FALSE)
Set the current item (index is zero-based)
FXint getNumItems() const
Return the number of items in the list.
FXint appendIconItem(const FXString &text, FXIcon *icon=nullptr, FXColor bgColor=FXRGB(255, 255, 255), void *ptr=nullptr)
append icon item in the last position
EdgeVector getAllEdges() const
return all edges
The representation of a single edge during network building.
Definition NBEdge.h:92
const PositionVector & getGeometry() const
Returns the geometry of the edge.
Definition NBEdge.h:783
const PositionVector getInnerGeometry() const
Returns the geometry of the edge without the endpoints.
Definition NBEdge.cpp:590
const std::set< NBTrafficLightDefinition * > & getControllingTLS() const
Returns the traffic lights that were assigned to this node (The set of tls that control this node)
Definition NBNode.h:340
const Position & getPosition() const
Definition NBNode.h:260
const PositionVector & getShape() const
retrieve the junction shape
Definition NBNode.cpp:2757
bool exist(const std::string &newID, bool requireComputed=true) const
check if exists a definition with the given ID
bool getBool(const std::string &name) const
Returns the boolean-value of the named option (only for Option_Bool)
static OptionsCont & getOptions()
Retrieves the options.
Static storage of an output device and its base (abstract) implementation.
OutputDevice & writeAttr(const SumoXMLAttr attr, const T &val)
writes a named attribute
void close()
Closes the device and removes it from the dictionary.
OutputDevice & openTag(const std::string &xmlElement)
Opens an XML tag.
bool closeTag(const std::string &comment="")
Closes the most recently opened tag and optionally adds a comment.
static OutputDevice & getDevice(const std::string &name, bool usePrefix=true)
Returns the described OutputDevice.
C++ TraCI client API implementation.
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 dimensions
Definition Position.h:263
double distanceSquaredTo(const Position &p2) const
returns the square of the distance to another position
Definition Position.h:268
double x() const
Returns the x-position.
Definition Position.h:52
double y() const
Returns the y-position.
Definition Position.h:57
A list of positions.
Position positionAtOffset(double pos, double lateralOffset=0) const
Returns the position at the given length.
double nearest_offset_to_point2D(const Position &p, bool perpendicular=true) const
return the nearest offest to point 2D
int indexOfClosest(const Position &p, bool twoD=false) const
void move2side(double amount, double maxExtension=100)
move position vector to side using certain amount
void setAlpha(unsigned char alpha)
Sets a new alpha value.
Definition RGBColor.cpp:108
static const RGBColor BLUE
Definition RGBColor.h:190
static const RGBColor ORANGE
Definition RGBColor.h:194
static const RGBColor GREEN
Definition RGBColor.h:189
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:403
static const RGBColor BLACK
Definition RGBColor.h:196
static const RGBColor RED
named colors
Definition RGBColor.h:188
const PositionVector & getShape() const
Returns the shape of the polygon.
void addAdditionalGLObject(GUIGlObject *o, const double exaggeration=1)
Adds an additional object (detector/shape/trigger) for visualisation.
Definition SUMORTree.h:122
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:114
static std::vector< Triangle > triangulate(PositionVector shape)
Definition Triangle.cpp:129
DemandViewOptions demandViewOptions
demand view options
NetworkViewOptions networkViewOptions
network view options
FXMenuBar * modes
The application menu bar (for select, inspect...)
void buildCommonCheckableButtons()
build checkable buttons
void updateCommonCheckableButtons()
update Common checkable buttons
void disableCommonCheckableButtons()
hide all options menu checks
MFXCheckableButton * selectButton
checkable button for edit mode select
MFXCheckableButton * inspectButton
checkable button for edit mode inspect
MFXCheckableButton * deleteButton
checkable button for edit mode delete
void disableDataCheckableButtons()
hide all options menu checks
void buildDataCheckableButtons()
build checkable buttons
void updateDataCheckableButtons()
update Data checkable buttons
MFXCheckableButton * edgeDataButton
checkable button for edit mode "edgeData"
MFXCheckableButton * edgeRelDataButton
checkable button for edit mode "edgeRelData"
MFXCheckableButton * TAZRelDataButton
checkable button for edit mode "TAZRelData"
MFXCheckableButton * meanDataButton
checkable button for edit mode "meanData"
struct used to group all variables related to view options in supermode Data
void hideDataViewOptionsMenuChecks()
hide all options menu checks
MFXCheckableButton * menuCheckToggleTAZDrawFill
menu check to toggle TAZ draw fill
MFXCheckableButton * menuCheckShowAdditionals
menu check to show Additionals
MFXCheckableButton * menuCheckShowShapes
menu check to show Shapes
MFXCheckableButton * menuCheckToggleTAZRelOnlyFrom
menu check to toggle TAZRel only from
MFXCheckableButton * menuCheckToggleDrawJunctionShape
checkable button to show junction shapes
void buildDataViewOptionsMenuChecks()
build menu checks
MFXCheckableButton * menuCheckToggleTAZRelDrawing
menu check to toggle TAZ Rel drawing
MFXCheckableButton * menuCheckShowDemandElements
menu check to show Demand Elements
MFXCheckableButton * menuCheckToggleTAZRelOnlyTo
menu check to toggle TAZRel only to
MFXCheckableButton * routeDistributionButton
checkable button for edit mode create route distributions
MFXCheckableButton * containerButton
checkable button for edit mode create containers
MFXCheckableButton * moveDemandElementsButton
checkable button for edit mode "move demand elements"
MFXCheckableButton * typeButton
checkable button for edit mode create type
void buildDemandCheckableButtons()
build checkable buttons
MFXCheckableButton * vehicleButton
checkable button for edit mode create vehicles
MFXCheckableButton * containerPlanButton
checkable button for edit mode create container plans
MFXCheckableButton * routeButton
checkable button for edit mode create routes
MFXCheckableButton * stopButton
checkable button for edit mode create stops
MFXCheckableButton * personPlanButton
checkable button for edit mode create person plans
MFXCheckableButton * personButton
checkable button for edit mode create persons
void updateDemandCheckableButtons()
update Demand checkable buttons
MFXCheckableButton * typeDistributionButton
checkable button for edit mode create type distribution
void disableDemandCheckableButtons()
hide all options menu checks
struct used to group all variables related to view options in supermode Demand
MFXCheckableButton * menuCheckShowAllTrips
show all trips
void lockPerson(const GNEDemandElement *person)
lock person
MFXCheckableButton * menuCheckToggleGrid
menu check to show grid button
MFXCheckableButton * menuCheckToggleDrawJunctionShape
checkable button to show junction shapes
void lockContainer(const GNEDemandElement *container)
lock container
void buildDemandViewOptionsMenuChecks()
build menu checks
const GNEDemandElement * getLockedPerson() const
get locked person
MFXCheckableButton * menuCheckDrawSpreadVehicles
menu check to draw vehicles in begin position or spread in lane
MFXCheckableButton * menuCheckShowOverlappedRoutes
show overlapped routes
void hideDemandViewOptionsMenuChecks()
hide all options menu checks
MFXCheckableButton * menuCheckShowAllPersonPlans
show all person plans
MFXCheckableButton * menuCheckShowAllContainerPlans
show all container plans
MFXCheckableButton * menuCheckHideNonInspectedDemandElements
Hide non inspected demand elements.
MFXCheckableButton * menuCheckHideShapes
Hide shapes (Polygons and POIs)
MFXCheckableButton * menuCheckLockPerson
Lock Person.
MFXCheckableButton * menuCheckLockContainer
Lock Container.
struct used to group all variables related with Supermodes
DataEditMode dataEditMode
the current Data edit mode
void buildSuperModeButtons()
build checkable buttons
DemandEditMode demandEditMode
the current Demand edit mode
Supermode currentSupermode
the current supermode
NetworkEditMode networkEditMode
the current Network edit mode
bool isCurrentSupermodeDemand() const
@check if current supermode is Demand
void setDemandEditMode(DemandEditMode demandMode, const bool force=false)
set Demand edit mode
MFXCheckableButton * dataButton
checkable button for supermode Data
bool isCurrentSupermodeData() const
@check if current supermode is Data
void setView(FXSelector sel)
set view
bool isCurrentSupermodeNetwork() const
@check if current supermode is Network
MFXCheckableButton * networkButton
checkable button for supermode Network
bool isJuPedSimView() const
check if default view is enabled
void setSupermode(Supermode supermode, const bool force)
set supermode
MFXCheckableButton * demandButton
checkable button for supermode Demand
void setNetworkEditMode(NetworkEditMode networkMode, const bool force=false)
set Network edit mode
void setDataEditMode(DataEditMode dataMode, const bool force=false)
set Data edit mode
struct used to group all variables related with edit shapes of NetworkElements
GNENetworkElement * getEditedNetworkElement() const
pointer to edited network element
void startEditCustomShape(GNENetworkElement *element)
start edit custom shape
class used to group all variables related with mouse buttons and key pressed after certain events
bool shiftKeyPressed() const
check if SHIFT is pressed during current event
bool altKeyPressed() const
check if ALT is pressed during current event
void update(void *eventData)
update status of MouseButtonKeyPressed during current event
bool controlKeyPressed() const
check if CONTROL is pressed during current event
bool mouseLeftButtonPressed() const
check if mouse left button is pressed during current event
struct used to group all variables related with movement of groups of elements
void moveSelection(const bool mouseLeftButtonPressed)
move selection
bool isCurrentlyMovingMultipleElements() const
check if there are moving elements
void finishMoveSelection()
finish moving selection
bool isMovingSelection() const
check if currently there is element being moved
void resetMovingSelectedEdge()
reset flag for moving edge
struct used to group all variables related with movement of single elements
bool beginMoveSingleElementDemandMode()
begin move single element in Demand mode
void moveSingleElement(const bool mouseLeftButtonPressed)
move single element in Network AND Demand mode
bool isCurrentlyMovingSingleElement() const
check if there are moving elements
bool beginMoveSingleElementNetworkMode()
begin move single element in Network mode
bool beginMoveNetworkElementShape()
begin move network elementshape
void finishMoveSingleElement()
finish moving single elements in Network AND Demand mode
void updateNetworkCheckableButtons()
update network checkable buttons
MFXCheckableButton * trafficLightButton
checkable button for edit mode traffic light
MFXCheckableButton * moveNetworkElementsButton
checkable button for edit mode "move network elements"
MFXCheckableButton * additionalButton
checkable button for edit mode additional
MFXCheckableButton * crossingButton
checkable button for edit mode crossing
MFXCheckableButton * createEdgeButton
checkable button for edit mode create edge
MFXCheckableButton * prohibitionButton
checkable button for edit mode prohibition
void buildNetworkCheckableButtons()
build checkable buttons
MFXCheckableButton * shapeButton
checkable button for edit mode shape
MFXCheckableButton * connectionButton
checkable button for edit mode connection
MFXCheckableButton * TAZButton
checkable button for edit mode TAZ
void disableNetworkCheckableButtons()
hide all options menu checks
MFXCheckableButton * wireButton
checkable button for edit mode wires
MFXCheckableButton * decalButton
checkable button for edit mode decals
struct used to group all variables related to view options in supermode Network
MFXCheckableButton * menuCheckSelectEdges
checkable button to select only edges
MFXCheckableButton * menuCheckChainEdges
checkable button to the endpoint for a created edge should be set as the new source
MFXCheckableButton * menuCheckShowDemandElements
checkable button to show Demand Elements
MFXCheckableButton * menuCheckMoveElevation
checkable button to apply movement to elevation
MFXCheckableButton * menuCheckShowTAZElements
checkable button to show TAZ elements
MFXCheckableButton * menuCheckAutoOppositeEdge
check checkable to create auto create opposite edge
MFXCheckableButton * menuCheckDrawSpreadVehicles
checkable button to draw vehicles in begin position or spread in lane
MFXCheckableButton * menuCheckShowConnections
checkable button to show connections
MFXCheckableButton * menuCheckHideConnections
checkable button to hide connections in connect mode
MFXCheckableButton * menuCheckToggleDrawJunctionShape
checkable button to show junction shapes
MFXCheckableButton * menuCheckToggleGrid
checkable button to show grid button
MFXCheckableButton * menuCheckMergeAutomatically
checkable button to we should't warn about merging junctions
bool selectEdges() const
check if select edges checkbox is enabled
MFXCheckableButton * menuCheckShowJunctionBubble
checkable button to show connection as bubble in "Move" mode.
void hideNetworkViewOptionsMenuChecks()
hide all options menu checks
MFXCheckableButton * menuCheckShowAdditionalSubElements
checkable button to show additional sub-elements
void buildNetworkViewOptionsMenuChecks()
build menu checks
MFXCheckableButton * menuCheckChangeAllPhases
checkable button to set change all phases
MFXCheckableButton * menuCheckExtendSelection
checkable button to extend to edge nodes
struct used to group all variables related with save elements
void buildSaveElementsButtons()
build save buttons
void finishRectangleSelection()
finish rectangle selection
void drawRectangleSelection(const RGBColor &color) const
draw rectangle selection
void beginRectangleSelection()
begin rectangle selection
bool selectingUsingRectangle
whether we have started rectangle-selection
void moveRectangleSelection()
move rectangle selection
bool startDrawing
whether we have started rectangle-selection
void processRectangleSelection()
process rectangle Selection
std::vector< GNEEdge * > processEdgeRectangleSelection()
process rectangle Selection (only limited to Edges)
struct used to group all variables related with testing
void drawTestingElements(GUIMainWindow *mainWindow)
draw testing element
void initTestingMode()
init testing mode
struct used to group all variables related with time format
void buildTimeFormatButtons()
build time format buttons
static const RGBColor TLSConnectionColor
connection color between E1/junctions and TLS
RGBColor selectionColor
basic selection color
static const double junctionBubbleRadius
junction bubble radius
double getExaggeration(const GUIVisualizationSettings &s, const GUIGlObject *o, double factor=20) const
return the drawing size including exaggeration and constantSize values