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-2024 German Aerospace Center (DLR) and others.
4// This program and the accompanying materials are made available under the
5// terms of the Eclipse Public License 2.0 which is available at
6// https://www.eclipse.org/legal/epl-2.0/
7// This Source Code may also be made available under the following Secondary
8// Licenses when the conditions for such availability set forth in the Eclipse
9// Public License 2.0 are satisfied: GNU General Public License, version 2
10// or later which is available at
11// https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html
12// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later
13/****************************************************************************/
19// A view on the network being edited (adapted from GUIViewTraffic)
20/****************************************************************************/
21
22#include <netbuild/NBEdgeCont.h>
74
75#include <unordered_set>
76
77#include "GNENet.h"
78#include "GNEUndoList.h"
79#include "GNEViewNet.h"
80#include "GNEViewParent.h"
82
83
84// ===========================================================================
85// FOX callback mapping
86// ===========================================================================
87
88FXDEFMAP(GNEViewNet) GNEViewNetMap[] = {
89 // Super Modes
93 // Modes
110 // Network view options
127 // Demand view options
139 // Data view options
148 // Select elements
149 FXMAPFUNC(SEL_COMMAND, MID_ADDSELECT, GNEViewNet::onCmdAddSelected),
150 FXMAPFUNC(SEL_COMMAND, MID_REMOVESELECT, GNEViewNet::onCmdRemoveSelected),
153 // Junctions
166 FXMAPFUNC(SEL_COMMAND, MID_GNE_JUNCTION_ADDTLS, GNEViewNet::onCmdAddTLS),
168 // Connections
171 // Crossings
173 // WalkingArea
175 // Edges
176 FXMAPFUNC(SEL_COMMAND, MID_GNE_EDGE_SPLIT, GNEViewNet::onCmdSplitEdge),
178 FXMAPFUNC(SEL_COMMAND, MID_GNE_EDGE_REVERSE, GNEViewNet::onCmdReverseEdge),
184 FXMAPFUNC(SEL_COMMAND, MID_GNE_EDGE_SMOOTH, GNEViewNet::onCmdSmoothEdges),
190 // Lanes
209 // Additionals
211 // Polygons
214 FXMAPFUNC(SEL_COMMAND, MID_GNE_POLYGON_OPEN, GNEViewNet::onCmdOpenPolygon),
218 // edit custom shapes
227 // POIs
229 // Demand elements
230 FXMAPFUNC(SEL_COMMAND, MID_GNE_REVERSE, GNEViewNet::onCmdReverse),
231 FXMAPFUNC(SEL_COMMAND, MID_GNE_ADDREVERSE, GNEViewNet::onCmdAddReverse),
232 // Geometry Points
235 // toolbar views
238 // IntervalBar
245};
246
247// Object implementation
248FXIMPLEMENT(GNEViewNet, GUISUMOAbstractView, GNEViewNetMap, ARRAYNUMBER(GNEViewNetMap))
249
250
251// ===========================================================================
252// member method definitions
253// ===========================================================================
254GNEViewNet::GNEViewNet(FXComposite* tmpParent, FXComposite* actualParent, GUIMainWindow& app,
255 GNEViewParent* viewParent, GNENet* net, GNEUndoList* undoList,
256 FXGLVisual* glVis, FXGLCanvas* share) :
257 GUISUMOAbstractView(tmpParent, app, viewParent, net->getGrid(), glVis, share),
258 myViewObjectsSelector(this),
259 myEditModes(this),
260 myTestingMode(this),
261 myCommonCheckableButtons(this),
262 myNetworkCheckableButtons(this),
263 myDemandCheckableButtons(this),
264 myDataCheckableButtons(this),
265 myNetworkViewOptions(this),
266 myDemandViewOptions(this),
267 myDataViewOptions(this),
268 myIntervalBar(this),
269 myMoveSingleElement(this),
270 myMoveMultipleElements(this),
271 myVehicleOptions(this),
272 myVehicleTypeOptions(this),
273 mySaveElements(this),
274 myTimeFormat(this),
275 mySelectingArea(this),
276 myEditNetworkElementShapes(this),
277 myLockManager(this),
278 myViewParent(viewParent),
279 myNet(net),
280 myUndoList(undoList) {
281 // view must be the final member of actualParent
282 reparent(actualParent);
283 // Build edit modes
284 buildEditModeControls();
285 // set this net in Net
286 myNet->setViewNet(this);
287 // set drag delay
288 ((GUIDanielPerspectiveChanger*)myChanger)->setDragDelay(100000000); // 100 milliseconds
289 // Reset textures
291 // init testing mode
292 myTestingMode.initTestingMode();
293 // update grid flags
294 myNetworkViewOptions.menuCheckToggleGrid->setChecked(myVisualizationSettings->showGrid);
295 myDemandViewOptions.menuCheckToggleGrid->setChecked(myVisualizationSettings->showGrid);
296 // update junction shape flags
297 const bool hide = !myVisualizationSettings->drawJunctionShape;
298 myNetworkViewOptions.menuCheckToggleDrawJunctionShape->setChecked(hide);
299 myDemandViewOptions.menuCheckToggleDrawJunctionShape->setChecked(hide);
300 myDataViewOptions.menuCheckToggleDrawJunctionShape->setChecked(hide);
301}
302
303
306
307
308void
310 if (myNet && makeCurrent()) {
311 // declare boundary
312 const Boundary maxBoundary(1000000000.0, 1000000000.0, -1000000000.0, -1000000000.0);
313 // get all objects in boundary
314 const std::vector<GUIGlID> GLIDs = getObjectsInBoundary(maxBoundary);
315 // finish make OpenGL context current
316 makeNonCurrent();
317 // declare set
318 std::set<GNEAttributeCarrier*> ACs;
319 // iterate over GUIGlIDs
320 for (const auto& GLId : GLIDs) {
322 // Make sure that object exists
323 if (AC && AC->getTagProperty().isPlacedInRTree()) {
324 ACs.insert(AC);
325 }
326 }
327 // interate over ACs
328 for (const auto& AC : ACs) {
329 // remove object and insert again with exaggeration
330 myNet->getGrid().removeAdditionalGLObject(AC->getGUIGlObject());
331 myNet->getGrid().addAdditionalGLObject(AC->getGUIGlObject(), AC->getGUIGlObject()->getExaggeration(*myVisualizationSettings));
332 }
333 }
334}
335
336
337void
339
340
345 } else {
346 return 0;
347 }
348}
349
350
351void
353 // build coloring tools
354 {
355 for (auto it_names : gSchemeStorage.getNames()) {
356 v->getColoringSchemesCombo()->appendIconItem(it_names.c_str());
357 if (it_names == myVisualizationSettings->name) {
359 }
360 }
361 }
362 // for junctions
364 std::string("\t") + TL("Locate Junctions") + std::string("\t") + TL("Locate a junction within the network. (Shift+J)"),
366 // for edges
368 std::string("\t") + TL("Locate Edges") + std::string("\t") + TL("Locate an edge within the network. (Shift+E)"),
370 // for walkingAreas
372 std::string("\t") + TL("Locate WalkingAreas") + std::string("\t") + TL("Locate a walkingArea within the network. (Shift+W)"),
374 // for vehicles
376 std::string("\t") + TL("Locate Vehicles") + std::string("\t") + TL("Locate a vehicle within the network. (Shift+V)"),
378 // for person
380 std::string("\t") + TL("Locate Persons") + std::string("\t") + TL("Locate a person within the network. (Shift+P)"),
382 // for container
384 std::string("\t") + TL("Locate Containers") + std::string("\t") + TL("Locate a container within the network. (Shift+C)"),
386 // for routes
388 std::string("\t") + TL("Locate Route") + std::string("\t") + TL("Locate a route within the network. (Shift+R)"),
390 // for routes
392 std::string("\t") + TL("Locate Stops") + std::string("\t") + TL("Locate a stop within the network. (Shift+S)"),
394 // for persons (currently unused)
395 /*
396 new MFXButtonTooltip(v->getLocatorPopup(),
397 std::string("\t") + TL("Locate Vehicle\tLocate a person within the network.",
398 GUIIconSubSys::getIcon(GUIIcon::LOCATEPERSON), &v, MID_LOCATEPERSON,
399 GUIDesignButtonPopup);
400 */
401 // for tls
403 std::string("\t") + TL("Locate TLS") + std::string("\t") + TL("Locate a tls within the network. (Shift+T)"),
405 // for additional stuff
407 std::string("\t") + TL("Locate Additional") + std::string("\t") + TL("Locate an additional structure within the network. (Shift+A)"),
409 // for pois
411 std::string("\t") + TL("Locate PoI") + std::string("\t") + TL("Locate a PoI within the network. (Shift+O)"),
413 // for polygons
415 std::string("\t") + TL("Locate Polygon") + std::string("\t") + TL("Locate a Polygon within the network. (Shift+L)"),
417}
418
419
420void
421GNEViewNet::updateViewNet(const bool ignoreViewUpdater) const {
422 // this call is only used for breakpoints (to check when view is updated)
423 if (ignoreViewUpdater || gViewUpdater.allowUpdate()) {
424 GUISUMOAbstractView::update();
425 }
426}
427
428
429void
433
434
435void
438 // hide data button (and adjust width)
439 myEditModes.dataButton->hide();
440 // check network modes
448 break;
449 default:
450 break;
451 }
452 // check demand modes
453 switch (myEditModes.demandEditMode) {
460 break;
461 default:
462 break;
463 }
464 // go to network mode if we're in data mode
467 } else {
468 // refresh current supermode
470 }
471 } else {
472 // show data button
473 myEditModes.dataButton->show();
474 // refresh current supermode
476 }
477}
478
479
484
485
486void
488 // clear post drawing elements
490 // set selection boundary in gObjectsInPosition
492 // push matrix
494 // enable draw for object under cursor and rectangle selection
497 // draw all GL elements within the small boundary
498 drawGLElements(boundary);
499 // restore draw for object under cursor
502 // pop matrix
504 // check if update front elements
505 for (const auto& AC : myMarkFrontElements.getACs()) {
506 gViewObjectsHandler.updateFrontObject(AC->getGUIGlObject());
507 }
508 // after draw elements, update objects under cursor
510}
511
512
513void
515 // clear post drawing elements
517 // set selection position in gObjectsInPosition
519 // create an small boundary
520 Boundary positionBoundary;
521 positionBoundary.add(pos);
522 positionBoundary.grow(POSITION_EPS);
523 // push matrix
525 // enable draw for view objects handler (this calculate the contours)
527 // draw all GL elements within the small boundary
528 drawGLElements(positionBoundary);
529 // check if filter edges that have the mouse over their geometry points
532 }
533 // restore draw for view objects handler (this calculate the contours)
535 // pop matrix
537 // check if update front elements
538 for (const auto& AC : myMarkFrontElements.getACs()) {
539 gViewObjectsHandler.updateFrontObject(AC->getGUIGlObject());
540 }
541 // after draw elements, update objects under cursor
543}
544
545
546void
548 // if we're inspecting an element, add it to redraw path elements
549 for (const auto& AC : myInspectedElements.getACs()) {
550 const auto pathElement = dynamic_cast<const GNEPathElement*>(AC);
551 if (pathElement) {
553 }
554 }
555 // enable draw for view objects handler (this calculate the contours)
557 // push matrix
559 // redraw elements in buffer
563 // pop matrix
565 // disable drawForViewObjectsHandler
567}
568
569
574
575
580
581
582void
591
592
593bool
594GNEViewNet::setColorScheme(const std::string& name) {
595 if (!gSchemeStorage.contains(name)) {
596 return false;
597 }
598 if (myGUIDialogViewSettings != nullptr) {
601 }
602 }
605 return true;
606}
607
608
609void
611 // reimplemented from GUISUMOAbstractView due GNEOverlappedInspection
612 ungrab();
613 // make network current
614 if (isEnabled() && myAmInitialised) {
615 // check if we're cliking while alt button is pressed
617 // set clicked popup position
619 // create cursor popup dialog for mark front element
621 // open popup dialog
623 } else if (myViewObjectsSelector.getGLObjects().empty()) {
625 } else {
626 // declare filtered objects
627 std::vector<GUIGlObject*> filteredGLObjects;
628 // get GUIGLObject front
629 GUIGlObject* overlappedElement = nullptr;
630 // we need to check if we're inspecting a overlapping element
633 overlappedElement = myInspectedElements.getFirstAC()->getGUIGlObject();
634 filteredGLObjects.push_back(overlappedElement);
635 }
636 bool connections = false;
637 bool TLS = false;
638 // fill filtered objects
639 if ((myViewObjectsSelector.getGLObjects().size() == 1) && (myViewObjectsSelector.getGLObjects().back()->getType() == GLO_EDGE)) {
640 // special case for edge geometry points (because edges uses the lane pop ups)
641 filteredGLObjects.push_back(myViewObjectsSelector.getGLObjects().back());
642 } else {
643 for (const auto& glObject : myViewObjectsSelector.getGLObjects()) {
644 // always avoid edges
645 if (glObject->getType() == GLO_EDGE) {
646 continue;
647 }
648 if (glObject->getType() == GLO_CONNECTION) {
649 connections = true;
650 }
651 if (glObject->getType() == GLO_TLLOGIC) {
652 TLS = true;
653 }
654 filteredGLObjects.push_back(glObject);
655 }
656 auto it = filteredGLObjects.begin();
657 if (connections) {
658 // filter junctions if there are connections
659 while (it != filteredGLObjects.end()) {
660 if ((*it)->getType() == GLO_JUNCTION) {
661 it = filteredGLObjects.erase(it);
662 } else {
663 it++;
664 }
665 }
666 } else if (TLS) {
667 // filter all elements except TLLogic
668 while (it != filteredGLObjects.end()) {
669 if ((*it)->getType() != GLO_TLLOGIC) {
670 it = filteredGLObjects.erase(it);
671 } else {
672 it++;
673 }
674 }
675 }
676 }
677 // remove duplicated elements using an unordered set
678 auto itDuplicated = filteredGLObjects.begin();
679 std::unordered_set<GUIGlObject*> unorderedSet;
680 for (auto itElement = filteredGLObjects.begin(); itElement != filteredGLObjects.end(); itElement++) {
681 if (unorderedSet.insert(*itElement).second) {
682 *itDuplicated++ = *itElement;
683 }
684 }
685 filteredGLObjects.erase(itDuplicated, filteredGLObjects.end());
686 // open object dialog
687 openObjectDialog(filteredGLObjects);
688 }
689 }
690}
691
692
693void
694GNEViewNet::openDeleteDialogAtCursor(const std::vector<GUIGlObject*>& GLObjects) {
695 if (myPopup) {
696 destroyPopup();
697 }
698 // set clicked popup position
700 // create cursor popup dialog for delete element
702 myCreatedPopup = true;
703 // open popup dialog
705}
706
707
708void
709GNEViewNet::openSelectDialogAtCursor(const std::vector<GUIGlObject*>& GLObjects) {
710 if (myPopup) {
711 destroyPopup();
712 }
713 // set clicked popup position
715 // create cursor popup dialog for select element
717 myCreatedPopup = true;
718 // open popup dialog
720}
721
722
723void
725 // first check if we have to save gui settings in a file (only used for testing purposes)
726 const auto& neteditOptions = OptionsCont::getOptions();
727 if (neteditOptions.getString("gui-testing.setting-output").size() > 0) {
728 try {
729 // open output device
730 OutputDevice& output = OutputDevice::getDevice(neteditOptions.getString("gui-testing.setting-output"));
731 // save view settings
734 // save viewport (zoom, X, Y and Z)
740 output.closeTag();
741 output.closeTag();
742 // close output device
743 output.close();
744 } catch (...) {
745 WRITE_ERROR(TL("GUI-Settings cannot be saved in ") + neteditOptions.getString("gui-testing.setting-output"));
746 }
747 }
748}
749
750
753 return myEditModes;
754}
755
756
759 return myTestingMode;
760}
761
762
767
768
773
774
779
780
785
786
791
792
793void
796 assert(!scheme.isFixed());
797 double minValue = std::numeric_limits<double>::infinity();
798 double maxValue = -std::numeric_limits<double>::infinity();
799 // retrieve range
800 bool hasMissingData = false;
801 if (objectType == GLO_LANE) {
802 // XXX (see #3409) multi-colors are not currently handled. this is a quick hack
803 if (active == 9) {
804 active = 8; // segment height, fall back to start height
805 } else if (active == 11) {
806 active = 10; // segment incline, fall back to total incline
807 }
808 for (const auto& lane : myNet->getAttributeCarriers()->getLanes()) {
809 const double val = lane.second->getColorValue(s, active);
810 if (val == s.MISSING_DATA) {
811 hasMissingData = true;
812 continue;
813 }
814 minValue = MIN2(minValue, val);
815 maxValue = MAX2(maxValue, val);
816 }
817 } else if (objectType == GLO_JUNCTION) {
818 if (active == 3) {
819 for (const auto& junction : myNet->getAttributeCarriers()->getJunctions()) {
820 minValue = MIN2(minValue, junction.second->getPositionInView().z());
821 maxValue = MAX2(maxValue, junction.second->getPositionInView().z());
822 }
823 }
824 } else if (objectType == GLO_TAZRELDATA) {
825 if (active == 4) {
826 for (const auto& genericData : myNet->getAttributeCarriers()->getGenericDatas().at(SUMO_TAG_TAZREL)) {
827 const double value = genericData.second->getColorValue(s, active);
828 if (value == s.MISSING_DATA) {
829 continue;
830 }
831 minValue = MIN2(minValue, value);
832 maxValue = MAX2(maxValue, value);
833 }
834 }
835 }
837 scheme.clear();
838 // add threshold for every distinct value
839 std::set<SVCPermissions> codes;
840 for (const auto& lane : myNet->getAttributeCarriers()->getLanes()) {
841 codes.insert(lane.second->getParentEdge()->getNBEdge()->getPermissions(lane.second->getIndex()));
842 }
843 int step = MAX2(1, 360 / (int)codes.size());
844 int hue = 0;
845 for (SVCPermissions p : codes) {
846 scheme.addColor(RGBColor::fromHSV(hue, 1, 1), (double)p);
847 hue = (hue + step) % 360;
848 }
849 return;
850 }
851 buildMinMaxRainbow(s, scheme, rs, minValue, maxValue, hasMissingData);
852}
853
854
855void
856GNEViewNet::setStatusBarText(const std::string& text) {
857 myApp->setStatusBarText(text);
858}
859
860
861void
865
866
867bool
870 return false;
871 } else {
873 }
874}
875
876
877void
878GNEViewNet::setSelectorFrameScale(double selectionScale) {
880}
881
882
883bool
887
888
889bool
893
894
895bool
897 // first check if there are junctions to merging
898 if (gViewObjectsHandler.getMergingJunctions().size() > 1) {
899 // get junctions (this call is neccesary because merging junctions are constants)
900 auto movedJunction = myNet->getAttributeCarriers()->retrieveJunction(gViewObjectsHandler.getMergingJunctions().at(0)->getID());
901 auto targetJunction = myNet->getAttributeCarriers()->retrieveJunction(gViewObjectsHandler.getMergingJunctions().at(1)->getID());
902 if (askMergeJunctions(movedJunction, targetJunction)) {
903 // merge moved and targed junctions
904 myNet->mergeJunctions(movedJunction, targetJunction, myUndoList);
905 return true;
906 }
907 }
908 return false;
909}
910
911
912bool
913GNEViewNet::askMergeJunctions(const GNEJunction* movedJunction, const GNEJunction* targetJunction) {
914 // optionally ask for confirmation
916 WRITE_DEBUG("Opening FXMessageBox 'merge junctions'");
917 // open question box
918 const std::string header = TL("Confirm Junction Merger");
919 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()));
920 const FXuint answer = FXMessageBox::question(this, MBOX_YES_NO, header.c_str(), "%s", body.c_str());
921 if (answer != 1) { //1:yes, 2:no, 4:esc
922 // write warning if netedit is running in testing mode
923 if (answer == 2) {
924 WRITE_DEBUG("Closed FXMessageBox 'merge junctions' with 'No'");
925 } else if (answer == 4) {
926 WRITE_DEBUG("Closed FXMessageBox 'merge junctions' with 'ESC'");
927 }
928 return false;
929 } else {
930 // write warning if netedit is running in testing mode
931 WRITE_DEBUG("Closed FXMessageBox 'merge junctions' with 'Yes'");
932 }
933 }
934 return true;
935}
936
937
938bool
939GNEViewNet::aksChangeSupermode(const std::string& operation, Supermode expectedSupermode) {
940 // first check if ignore option is enabled
941 if (OptionsCont::getOptions().getBool("ignore-supermode-question")) {
942 return true;
943 }
944 std::string body;
945 if (expectedSupermode == Supermode::NETWORK) {
946 body = (operation + TL(" requires switch to network mode. Continue?"));
947 } else if (expectedSupermode == Supermode::DEMAND) {
948 body = (operation + TL(" requires switch to demand mode. Continue?"));
949 } else if (expectedSupermode == Supermode::DATA) {
950 body = (operation + TL(" requires switch to data mode. Continue?"));
951 } else {
952 throw ProcessError("invalid expected supermode");
953 }
954 // open question box
955 const auto answer = FXMessageBox::question(myApp, MBOX_YES_NO, TL("Confirm switch mode"), "%s", body.c_str());
956 // restore focus to view net
957 setFocus();
958 // return answer
959 if (answer == MBOX_CLICKED_YES) {
960 myEditModes.setSupermode(expectedSupermode, true);
961 return true;
962 } else {
963 return false;
964 }
965}
966
967
968bool
970 // separate conditions for code legibly
973 return (TLSMode && selectingDetectors);
974}
975
976
977bool
979 // separate conditions for code legibly
981 const bool selectingJunctions = myViewParent->getTLSEditorFrame()->getTLSJunction()->isJoiningJunctions();
982 return (TLSMode && selectingJunctions);
983}
984
985
990
991
996
997
998bool
1000 // Get selected lanes
1001 const auto selectedLanes = myNet->getAttributeCarriers()->getSelectedLanes();
1002 // Declare map of edges and lanes
1003 std::map<GNEEdge*, GNELane*> mapOfEdgesAndLanes;
1004 // Iterate over selected lanes
1005 for (const auto& selectedLane : selectedLanes) {
1006 mapOfEdgesAndLanes[myNet->getAttributeCarriers()->retrieveEdge(selectedLane->getParentEdge()->getID())] = selectedLane;
1007 }
1008 // Throw warning dialog if there hare multiple lanes selected in the same edge
1009 if (mapOfEdgesAndLanes.size() != selectedLanes.size()) {
1010 const std::string header = TL("Multiple lane in the same edge selected");
1011 const std::string bodyA = TL("There are selected lanes that belong to the same edge.");
1012 const std::string bodyB = TLF("Only one lane per edge will be restricted to %.", toString(vclass));
1013 FXMessageBox::information(getApp(), MBOX_OK, header.c_str(), "%s", (bodyA + std::string("\n") + bodyB).c_str());
1014 }
1015 // If we handeln a set of lanes
1016 if (mapOfEdgesAndLanes.size() > 0) {
1017 // declare counter for number of Sidewalks
1018 int counter = 0;
1019 // iterate over selected lanes
1020 for (const auto& edgeLane : mapOfEdgesAndLanes) {
1021 if (edgeLane.first->hasRestrictedLane(vclass)) {
1022 counter++;
1023 }
1024 }
1025 // if all edges parent own a Sidewalk, stop function
1026 if (counter == (int)mapOfEdgesAndLanes.size()) {
1027 const std::string header = TLF("Set vclass to % for selected lanes", toString(vclass));
1028 const std::string body = TL("All lanes own already another lane in the same edge with a restriction for ");
1029 FXMessageBox::information(getApp(), MBOX_OK, header.c_str(), "%s", (body + toString(vclass) + ".").c_str());
1030 return 0;
1031 } else {
1032 WRITE_DEBUG("Opening FXMessageBox 'restrict lanes'");
1033 // Ask confirmation to user
1034 const std::string header = TLF("Set vclass to % for selected lanes", toString(vclass));
1035 const std::string body = TLF("% lanes will be restricted to %. Continue?", toString(mapOfEdgesAndLanes.size() - counter), toString(vclass));
1036 FXuint answer = FXMessageBox::question(getApp(), MBOX_YES_NO, header.c_str(), "%s", body.c_str());
1037 if (answer != 1) { //1:yes, 2:no, 4:esc
1038 // write warning if netedit is running in testing mode
1039 if (answer == 2) {
1040 WRITE_DEBUG("Closed FXMessageBox 'restrict lanes' with 'No'");
1041 } else if (answer == 4) {
1042 WRITE_DEBUG("Closed FXMessageBox 'restrict lanes' with 'ESC'");
1043 }
1044 return 0;
1045 } else {
1046 // write warning if netedit is running in testing mode
1047 WRITE_DEBUG("Closed FXMessageBox 'restrict lanes' with 'Yes'");
1048 }
1049 }
1050 // begin undo operation
1051 myUndoList->begin(lane, "restrict lanes to " + toString(vclass));
1052 // iterate over selected lanes
1053 for (const auto& edgeLane : mapOfEdgesAndLanes) {
1054 // Transform lane to Sidewalk
1055 myNet->restrictLane(vclass, edgeLane.second, myUndoList);
1056 }
1057 // end undo operation
1058 myUndoList->end();
1059 } else {
1060 // If only have a single lane, start undo/redo operation
1061 myUndoList->begin(lane, TL("restrict lane to ") + toString(vclass));
1062 // Transform lane to Sidewalk
1063 myNet->restrictLane(vclass, lane, myUndoList);
1064 // end undo operation
1065 myUndoList->end();
1066 }
1067 return 1;
1068}
1069
1070
1071bool
1072GNEViewNet::addRestrictedLane(GNELane* lane, SUMOVehicleClass vclass, const bool insertAtFront) {
1073 // Get selected edges
1074 const auto selectedEdges = myNet->getAttributeCarriers()->getSelectedEdges();
1075 // get selected lanes
1076 const auto selectedLanes = myNet->getAttributeCarriers()->getSelectedLanes();
1077 // Declare set of edges
1078 std::set<GNEEdge*> setOfEdges;
1079 // Fill set of edges with vector of edges
1080 for (const auto& edge : selectedEdges) {
1081 setOfEdges.insert(edge);
1082 }
1083 // iterate over selected lanes
1084 for (const auto& selectedLane : selectedLanes) {
1085 // Insert pointer to edge into set of edges (To avoid duplicates)
1086 setOfEdges.insert(myNet->getAttributeCarriers()->retrieveEdge(selectedLane->getParentEdge()->getID()));
1087 }
1088 // If we handeln a set of edges
1090 // declare counter for number of restrictions
1091 int counter = 0;
1092 // iterate over set of edges
1093 for (const auto& edge : setOfEdges) {
1094 // update counter if edge has already a restricted lane of type "vclass"
1095 if (edge->hasRestrictedLane(vclass)) {
1096 counter++;
1097 }
1098 }
1099 // if all lanes own a Sidewalk, stop function
1100 if (counter == (int)setOfEdges.size()) {
1101 const std::string header = TLF("Add vclass % to selected lanes", toString(vclass));
1102 const std::string body = TLF("All lanes own already another lane in the same edge with a restriction to %.", toString(vclass));
1103 FXMessageBox::information(getApp(), MBOX_OK, header.c_str(), "%s", body.c_str());
1104 return 0;
1105 } else {
1106 WRITE_DEBUG("Opening FXMessageBox 'restrict lanes'");
1107 // Ask confirmation to user
1108 const std::string header = TLF("Add vclass % to selected lanes", toString(vclass));
1109 const std::string body = TLF("% restrictions to % will be added. Continue?", toString(setOfEdges.size() - counter), toString(vclass));
1110 FXuint answer = FXMessageBox::question(getApp(), MBOX_YES_NO, header.c_str(), "%s", body.c_str());
1111 if (answer != 1) { //1:yes, 2:no, 4:esc
1112 // write warning if netedit is running in testing mode
1113 if (answer == 2) {
1114 WRITE_DEBUG("Closed FXMessageBox 'restrict lanes' with 'No'");
1115 } else if (answer == 4) {
1116 WRITE_DEBUG("Closed FXMessageBox 'restrict lanes' with 'ESC'");
1117 }
1118 return 0;
1119 } else {
1120 // write warning if netedit is running in testing mode
1121 WRITE_DEBUG("Closed FXMessageBox 'restrict lanes' with 'Yes'");
1122 }
1123 }
1124 // begin undo operation
1125 myUndoList->begin(lane, TL("add restrictions for ") + toString(vclass));
1126 // iterate over set of edges
1127 for (const auto& edge : setOfEdges) {
1128 // add restricted lane (guess target)
1129 myNet->addRestrictedLane(vclass, edge, -1, myUndoList);
1130 }
1131 // end undo operation
1132 myUndoList->end();
1133 } else {
1134 // If only have a single lane, start undo/redo operation
1135 myUndoList->begin(lane, TL("add vclass for ") + toString(vclass));
1136 // Add restricted lane
1137 if (vclass == SVC_PEDESTRIAN) {
1138 // always add pedestrian lanes on the right
1139 myNet->addRestrictedLane(vclass, lane->getParentEdge(), 0, myUndoList);
1140 } else if (vclass == SVC_IGNORING) {
1141 if (insertAtFront) {
1143 } else {
1145 }
1146 } else if (lane->getParentEdge()->getLanes().size() == 1) {
1147 // guess insertion position if there is only 1 lane
1148 myNet->addRestrictedLane(vclass, lane->getParentEdge(), -1, myUndoList);
1149 } else {
1150 myNet->addRestrictedLane(vclass, lane->getParentEdge(), lane->getIndex(), myUndoList);
1151 }
1152 // end undo/redo operation
1153 myUndoList->end();
1154 }
1155 return 1;
1156}
1157
1158
1159bool
1161 // Get selected edges
1162 const auto selectedEdges = myNet->getAttributeCarriers()->getSelectedEdges();
1163 // get selected lanes
1164 const auto selectedLanes = myNet->getAttributeCarriers()->getSelectedLanes();
1165 // Declare set of edges
1166 std::set<GNEEdge*> setOfEdges;
1167 // Fill set of edges with vector of edges
1168 for (const auto& edge : selectedEdges) {
1169 setOfEdges.insert(edge);
1170 }
1171 // iterate over selected lanes
1172 for (const auto& selectedLane : selectedLanes) {
1173 // Insert pointer to edge into set of edges (To avoid duplicates)
1174 setOfEdges.insert(myNet->getAttributeCarriers()->retrieveEdge(selectedLane->getParentEdge()->getID()));
1175 }
1176 // If we handeln a set of edges
1177 if (setOfEdges.size() > 0) {
1178 // declare counter for number of restrictions
1179 int counter = 0;
1180 // iterate over set of edges
1181 for (const auto& edge : setOfEdges) {
1182 // update counter if edge has already a restricted lane of type "vclass"
1183 if (edge->hasRestrictedLane(vclass)) {
1184 counter++;
1185 }
1186 }
1187 // if all lanes don't own a Sidewalk, stop function
1188 if (counter == 0) {
1189 const std::string header = TLF("Remove vclass % from selected lanes", toString(vclass));
1190 const std::string body = TLF("The selected lanes and edges don't have a restriction to %.", toString(vclass));
1191 FXMessageBox::information(getApp(), MBOX_OK, header.c_str(), "%s", body.c_str());
1192 return 0;
1193 } else {
1194 WRITE_DEBUG("Opening FXMessageBox 'restrict lanes'");
1195 // Ask confirmation to user
1196 const std::string header = TLF("Remove vclass % from selected lanes", toString(vclass));
1197 const std::string body = TLF("% restrictions to % will be removed. Continue?", toString(setOfEdges.size() - counter), toString(vclass));
1198 FXuint answer = FXMessageBox::question(getApp(), MBOX_YES_NO, header.c_str(), "%s", body.c_str());
1199 if (answer != 1) { //1:yes, 2:no, 4:esc
1200 // write warning if netedit is running in testing mode
1201 if (answer == 2) {
1202 WRITE_DEBUG("Closed FXMessageBox 'restrict lanes' with 'No'");
1203 } else if (answer == 4) {
1204 WRITE_DEBUG("Closed FXMessageBox 'restrict lanes' with 'ESC'");
1205 }
1206 return 0;
1207 } else {
1208 // write warning if netedit is running in testing mode
1209 WRITE_DEBUG("Closed FXMessageBox 'restrict lanes' with 'Yes'");
1210 }
1211 }
1212 // begin undo operation
1213 myUndoList->begin(lane, "Remove restrictions for " + toString(vclass));
1214 // iterate over set of edges
1215 for (const auto& edge : setOfEdges) {
1216 // add Sidewalk
1217 myNet->removeRestrictedLane(vclass, edge, myUndoList);
1218 }
1219 // end undo operation
1220 myUndoList->end();
1221 } else {
1222 // If only have a single lane, start undo/redo operation
1223 myUndoList->begin(lane, TL("Remove vclass for ") + toString(vclass));
1224 // Remove Sidewalk
1226 // end undo/redo operation
1227 myUndoList->end();
1228 }
1229 return 1;
1230}
1231
1232
1234 myViewObjectsSelector(this),
1235 myEditModes(this),
1236 myTestingMode(this),
1237 myCommonCheckableButtons(this),
1238 myNetworkCheckableButtons(this),
1239 myDemandCheckableButtons(this),
1240 myDataCheckableButtons(this),
1241 myNetworkViewOptions(this),
1242 myDemandViewOptions(this),
1243 myDataViewOptions(this),
1244 myIntervalBar(this),
1245 myMoveSingleElement(this),
1246 myMoveMultipleElements(this),
1247 myVehicleOptions(this),
1248 myVehicleTypeOptions(this),
1249 mySaveElements(this),
1250 myTimeFormat(this),
1251 mySelectingArea(this),
1252 myEditNetworkElementShapes(this),
1253 myLockManager(this) {
1254}
1255
1256
1257std::vector<std::string>
1259 std::set<std::string> keys;
1260 for (const NBEdge* e : myNet->getEdgeCont().getAllEdges()) {
1261 if (edgeKeys) {
1262 for (const auto& item : e->getParametersMap()) {
1263 keys.insert(item.first);
1264 }
1265 for (const auto& con : e->getConnections()) {
1266 for (const auto& item : con.getParametersMap()) {
1267 keys.insert(item.first);
1268 }
1269 }
1270 } else {
1271 for (const auto& lane : e->getLanes()) {
1272 int i = 0;
1273 for (const auto& item : lane.getParametersMap()) {
1274 keys.insert(item.first);
1275 }
1276 for (const auto& con : e->getConnectionsFromLane(i)) {
1277 for (const auto& item : con.getParametersMap()) {
1278 keys.insert(item.first);
1279 }
1280 }
1281 i++;
1282 }
1283 }
1284 }
1285 return std::vector<std::string>(keys.begin(), keys.end());
1286}
1287
1288
1289std::vector<std::string>
1291 std::set<std::string> keys;
1292 for (const auto& genericData : myNet->getAttributeCarriers()->getGenericDatas().at(GNE_TAG_EDGEREL_SINGLE)) {
1293 for (const auto& parameter : genericData.second->getACParametersMap()) {
1294 keys.insert(parameter.first);
1295 }
1296 }
1297 return std::vector<std::string>(keys.begin(), keys.end());
1298}
1299
1300
1301std::vector<std::string>
1303 std::set<std::string> keys;
1304 for (const auto& genericData : myNet->getAttributeCarriers()->getGenericDatas().at(SUMO_TAG_TAZREL)) {
1305 for (const auto& parameter : genericData.second->getACParametersMap()) {
1306 keys.insert(parameter.first);
1307 }
1308 }
1309 for (const auto& genericData : myNet->getAttributeCarriers()->getGenericDatas().at(SUMO_TAG_EDGEREL)) {
1310 for (const auto& parameter : genericData.second->getACParametersMap()) {
1311 keys.insert(parameter.first);
1312 }
1313 }
1314 return std::vector<std::string>(keys.begin(), keys.end());
1315}
1316
1317
1318bool
1322 return true;
1323 } else {
1324 return false;
1325 }
1326}
1327
1328
1329int
1333
1334
1335int
1336GNEViewNet::doPaintGL(int mode, const Boundary& drawingBoundary) {
1337 // set lefthand and laneIcons
1340 // first step: update objects under cursor
1342 // second step: redraw contour of path elements (needed if we're inspecting a path element like a route or trip)
1344 // set render modes
1345 glRenderMode(mode);
1346 glMatrixMode(GL_MODELVIEW);
1348 glDisable(GL_TEXTURE_2D);
1349 glDisable(GL_ALPHA_TEST);
1350 glEnable(GL_BLEND);
1351 glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
1352 glEnable(GL_DEPTH_TEST);
1353 // visualize rectangular selection
1355 // draw decals
1356 drawDecals();
1357 // draw grid (and update grid button)
1358 drawGrid();
1359 // update show connections
1361 // draw temporal junction
1363 // draw temporal drawing shape
1365 // draw testing elements
1367 // draw temporal E2 multilane detectors
1369 // draw temporal overhead wires
1371 // draw temporal trip/flow route
1373 // draw temporal person plan route
1376 // draw temporal container plan route
1379 // draw temporal route
1381 // draw temporal edgeRelPath
1383 // check menu checks of supermode demand
1385 // enable or disable menuCheckShowAllPersonPlans depending of there is a locked person
1388 } else {
1390 }
1391 }
1392 // clear pathDraw
1396 // update ignore hide by zoom
1398 // draw network (boundary
1400 // draw all GL elements
1401 int hits = drawGLElements(drawingBoundary);
1402 // draw temporal split junction
1404 // draw temporal roundabout
1406 // draw temporal lines between E1 detectors and junctions in TLS Mode
1408 // draw temporal lines between junctions in TLS Mode
1410 // draw netedit attributes references
1412 // draw test circle
1414 // pop draw matrix
1416 // update interval bar
1418 // check if recopute boundaries (Deactivated, continue after 1.14 release)
1419 /*
1420 if (gObjectsInPosition.recomputeBoundaries != GLO_NETWORK) {
1421 myNet->getGrid().updateBoundaries(gObjectsInPosition.recomputeBoundaries);
1422 }
1423 */
1424 return hits;
1425}
1426
1427
1428long
1429GNEViewNet::onLeftBtnPress(FXObject*, FXSelector, void* eventData) {
1430 // set focus in view net
1431 setFocus();
1432 // update MouseButtonKeyPressed
1434 // process left button press function depending of supermode
1439 } else if (myEditModes.isCurrentSupermodeData()) {
1440 processLeftButtonPressData(eventData);
1441 }
1442 // update cursor
1443 updateCursor();
1444 // update view
1445 updateViewNet();
1446 return 1;
1447}
1448
1449
1450long
1451GNEViewNet::onLeftBtnRelease(FXObject* obj, FXSelector sel, void* eventData) {
1452 // avoid closing Popup dialog in Linux
1453 if (myCreatedPopup) {
1454 myCreatedPopup = false;
1455 return 1;
1456 }
1457 // process parent function
1458 GUISUMOAbstractView::onLeftBtnRelease(obj, sel, eventData);
1459 // update MouseButtonKeyPressed
1461 // process left button release function depending of supermode
1466 } else if (myEditModes.isCurrentSupermodeData()) {
1468 }
1469 // update cursor
1470 updateCursor();
1471 // update view
1472 updateViewNet();
1473 return 1;
1474}
1475
1476
1477long
1478GNEViewNet::onMiddleBtnPress(FXObject* obj, FXSelector sel, void* eventData) {
1479 // process parent function
1480 GUISUMOAbstractView::onMiddleBtnPress(obj, sel, eventData);
1481 // update cursor
1482 updateCursor();
1483 // update view
1484 updateViewNet();
1485 return 1;
1486}
1487
1488
1489long
1490GNEViewNet::onMiddleBtnRelease(FXObject* obj, FXSelector sel, void* eventData) {
1491 // process parent function
1492 GUISUMOAbstractView::onMiddleBtnRelease(obj, sel, eventData);
1493 // update cursor
1494 updateCursor();
1495 // update view
1496 updateViewNet();
1497 return 1;
1498}
1499
1500
1501long
1502GNEViewNet::onRightBtnPress(FXObject* obj, FXSelector sel, void* eventData) {
1503 // update MouseButtonKeyPressed
1505 // update cursor
1506 updateCursor();
1508 // disable right button press during drawing polygon
1509 return 1;
1510 } else {
1511 return GUISUMOAbstractView::onRightBtnPress(obj, sel, eventData);
1512 }
1513}
1514
1515
1516long
1517GNEViewNet::onRightBtnRelease(FXObject* obj, FXSelector sel, void* eventData) {
1518 // update MouseButtonKeyPressed
1520 // update cursor
1521 updateCursor();
1522 // disable right button release during drawing polygon
1524 return 1;
1525 } else {
1526 return GUISUMOAbstractView::onRightBtnRelease(obj, sel, eventData);
1527 }
1528}
1529
1530
1531long
1532GNEViewNet::onMouseMove(FXObject* obj, FXSelector sel, void* eventData) {
1533 // process mouse move in GUISUMOAbstractView
1534 GUISUMOAbstractView::onMouseMove(obj, sel, eventData);
1535 // update MouseButtonKeyPressed
1537 // update cursor
1538 updateCursor();
1539 // process mouse move function depending of supermode
1544 } else if (myEditModes.isCurrentSupermodeData()) {
1546 }
1547 // update view
1548 updateViewNet();
1549 return 1;
1550}
1551
1552
1553long
1554GNEViewNet::onKeyPress(FXObject* o, FXSelector sel, void* eventData) {
1555 // update MouseButtonKeyPressed
1557 // update cursor
1558 updateCursor();
1559 // continue depending of current edit mode
1561 // update viewNet (for temporal junction)
1562 updateViewNet();
1564 // change "delete last created point" depending of shift key
1567 // change "delete last created point" depending of shift key
1570 updateViewNet();
1571 }
1572 return GUISUMOAbstractView::onKeyPress(o, sel, eventData);
1573}
1574
1575
1576long
1577GNEViewNet::onKeyRelease(FXObject* o, FXSelector sel, void* eventData) {
1578 // update MouseButtonKeyPressed
1580 // update cursor
1581 updateCursor();
1582 // continue depending of current edit mode
1584 // update viewNet (for temporal junction)
1585 updateViewNet();
1587 // change "delete last created point" depending of shift key
1590 // change "delete last created point" depending of shift key
1593 updateViewNet();
1594 }
1595 // check if selecting using rectangle has to be disabled
1598 updateViewNet();
1599 }
1600 return GUISUMOAbstractView::onKeyRelease(o, sel, eventData);
1601}
1602
1603
1604void
1605GNEViewNet::abortOperation(bool clearSelection) {
1606 // steal focus from any text fields and place it over view net
1607 setFocus();
1608 // check what supermode is enabled
1610 // abort operation depending of current mode
1612 // abort edge creation in create edge frame
1616 // check if current selection has to be cleaned
1617 if (clearSelection) {
1619 }
1621 // abort changes in Connector Frame
1624 // continue depending of current TLS frame state
1629 } else {
1631 }
1637 // abort current drawing
1641 // abort current drawing
1643 } else if (myViewParent->getTAZFrame()->getCurrentTAZModule()->getTAZ() != nullptr) {
1644 // finish current editing TAZ
1646 }
1650 // abort both network elements selections
1653 // abort path
1656 // abort path
1658 }
1660 // abort operation depending of current mode
1663 // check if current selection has to be cleaned
1664 if (clearSelection) {
1666 }
1679 }
1680 } else if (myEditModes.isCurrentSupermodeData()) {
1681 // abort operation depending of current mode
1684 // check if current selection has to be cleaned
1685 if (clearSelection) {
1687 }
1692 }
1693 }
1694 // abort undo list
1696 // update view
1697 updateViewNet();
1698}
1699
1700
1701void
1703 // delete elements depending of current supermode
1706 setStatusBarText(TL("Cannot delete in this mode"));
1708 // delete inspected elements
1709 myUndoList->begin(GUIIcon::MODEDELETE, TL("delete network inspected elements"));
1712 }
1713 myUndoList->end();
1714 } else {
1715 // get selected ACs
1716 const auto selectedNetworkACs = myNet->getAttributeCarriers()->getSelectedAttributeCarriers(false);
1717 // delete selected elements
1718 if (selectedNetworkACs.size() > 0) {
1719 myUndoList->begin(GUIIcon::MODEDELETE, TL("delete network selection"));
1720 for (const auto selectedAC : selectedNetworkACs) {
1722 }
1723 myUndoList->end();
1724 }
1725 }
1728 // delete inspected elements
1729 myUndoList->begin(GUIIcon::MODEDELETE, TL("delete demand inspected elements"));
1732 }
1733 myUndoList->end();
1734 } else {
1735 // get selected ACs
1736 const auto selectedDemandACs = myNet->getAttributeCarriers()->getSelectedAttributeCarriers(false);
1737 // delete selected elements
1738 if (selectedDemandACs.size() > 0) {
1739 myUndoList->begin(GUIIcon::MODEDELETE, TL("delete demand selection"));
1740 for (const auto selectedAC : selectedDemandACs) {
1741 deleteDemandAttributeCarrier(selectedAC);
1742 }
1743 myUndoList->end();
1744 }
1745 }
1746 } else if (myEditModes.isCurrentSupermodeData()) {
1748 // delete inspected elements
1749 myUndoList->begin(GUIIcon::MODEDELETE, TL("delete data inspected elements"));
1752 }
1753 myUndoList->end();
1754 } else {
1755 // get selected ACs
1756 const auto selectedDataACs = myNet->getAttributeCarriers()->getSelectedAttributeCarriers(false);
1757 // delete selected elements
1758 if (selectedDataACs.size() > 0) {
1759 myUndoList->begin(GUIIcon::MODEDELETE, TL("delete data selection"));
1760 for (const auto selectedAC : selectedDataACs) {
1761 deleteDataAttributeCarrier(selectedAC);
1762 }
1763 myUndoList->end();
1764 }
1765 }
1766 }
1767}
1768
1769
1770void
1772 // check what supermode is enabled
1774 // abort operation depending of current mode
1776 // Accept changes in Connector Frame
1779 // continue depending of current TLS frame state
1786 }
1791 // stop current drawing
1793 } else {
1794 // start drawing
1796 }
1801 // stop current drawing
1803 } else if (myViewParent->getTAZFrame()->getCurrentTAZModule()->getTAZ() == nullptr) {
1804 // start drawing
1807 // save pending changes
1809 }
1811 // create path element
1814 // create path element
1816 }
1821 myViewParent->getVehicleFrame()->getPathCreator()->onCmdCreatePath(nullptr, 0, nullptr);
1823 myViewParent->getPersonFrame()->getPlanCreator()->onCmdCreatePath(nullptr, 0, nullptr);
1830 }
1831 } else if (myEditModes.isCurrentSupermodeData()) {
1836 }
1837 }
1838}
1839
1840
1841void
1843 // check what supermode is enabled
1847 }
1861 }
1862 } else if (myEditModes.isCurrentSupermodeData()) {
1865 }
1866 }
1867}
1868
1869void
1871 // if there is a visible frame, set focus over it. In other case, set focus over ViewNet
1872 if (myCurrentFrame != nullptr) {
1874 } else {
1875 setFocus();
1876 }
1877}
1878
1879
1882 return myViewParent;
1883}
1884
1885
1886GNENet*
1888 return myNet;
1889}
1890
1891
1894 return myUndoList;
1895}
1896
1897
1902
1903
1908
1909
1914
1915
1920
1921
1922bool
1926
1927
1928bool
1929GNEViewNet::checkOverLockedElement(const GUIGlObject* GLObject, const bool isSelected) const {
1930 // check if elemet is blocked
1931 if (myLockManager.isObjectLocked(GLObject->getType(), isSelected)) {
1932 return false;
1933 }
1934 // get front GLObject
1935 const auto glObjectFront = myViewObjectsSelector.getGUIGlObjectFront();
1936 // check if element is under cursor
1937 if (glObjectFront) {
1938 if (glObjectFront == GLObject) {
1939 return true;
1940 } else if (glObjectFront->getType() == GLObject->getType()) {
1941 for (const auto& glObjectUnderCursor : myViewObjectsSelector.getGLObjects()) {
1942 if (glObjectUnderCursor == GLObject) {
1943 return true;
1944 }
1945 }
1946 }
1947 }
1948 return false;
1949}
1950
1951
1956
1957
1958void
1960 myLastCreatedRoute = lastCreatedRoute;
1961}
1962
1963
1966 // get first object that can be found in their container
1967 for (const auto& glObjectLayer : gViewObjectsHandler.getSelectedObjects()) {
1968 for (const auto& glObject : glObjectLayer.second) {
1969 auto junction = myNet->getAttributeCarriers()->retrieveJunction(glObject.object->getMicrosimID(), false);
1970 if (junction) {
1971 return junction;
1972 }
1973 }
1974 }
1975 return nullptr;
1976}
1977
1978
1981 // get first object that can be found in their container
1982 for (const auto& glObjectLayer : gViewObjectsHandler.getSelectedObjects()) {
1983 for (const auto& glObject : glObjectLayer.second) {
1984 auto connection = myNet->getAttributeCarriers()->retrieveConnection(glObject.object, false);
1985 if (connection) {
1986 return connection;
1987 }
1988 }
1989 }
1990 return nullptr;
1991}
1992
1993
1996 // get first object that can be found in their container
1997 for (const auto& glObjectLayer : gViewObjectsHandler.getSelectedObjects()) {
1998 for (const auto& glObject : glObjectLayer.second) {
1999 auto crossing = myNet->getAttributeCarriers()->retrieveCrossing(glObject.object, false);
2000 if (crossing) {
2001 return crossing;
2002 }
2003 }
2004 }
2005 return nullptr;
2006}
2007
2008
2011 // get first object that can be found in their container
2012 for (const auto& glObjectLayer : gViewObjectsHandler.getSelectedObjects()) {
2013 for (const auto& glObject : glObjectLayer.second) {
2014 auto walkingArea = myNet->getAttributeCarriers()->retrieveWalkingArea(glObject.object, false);
2015 if (walkingArea) {
2016 return walkingArea;
2017 }
2018 }
2019 }
2020 return nullptr;
2021}
2022
2023
2024GNEEdge*
2026 // get first object that can be found in their container
2027 for (const auto& glObjectLayer : gViewObjectsHandler.getSelectedObjects()) {
2028 for (const auto& glObject : glObjectLayer.second) {
2029 auto edge = myNet->getAttributeCarriers()->retrieveEdge(glObject.object->getMicrosimID(), false);
2030 if (edge) {
2031 return edge;
2032 }
2033 }
2034 }
2035 return nullptr;
2036}
2037
2038
2039GNELane*
2041 // get first object that can be found in their container
2042 for (const auto& glObjectLayer : gViewObjectsHandler.getSelectedObjects()) {
2043 for (const auto& glObject : glObjectLayer.second) {
2044 auto lane = myNet->getAttributeCarriers()->retrieveLane(glObject.object, false);
2045 if (lane) {
2046 return lane;
2047 }
2048 }
2049 }
2050 return nullptr;
2051}
2052
2053
2056 // get first object that can be found in their container
2057 for (const auto& glObjectLayer : gViewObjectsHandler.getSelectedObjects()) {
2058 for (const auto& glObject : glObjectLayer.second) {
2059 auto additionalElement = myNet->getAttributeCarriers()->retrieveAdditional(glObject.object, false);
2060 if (additionalElement) {
2061 return additionalElement;
2062 }
2063 }
2064 }
2065 return nullptr;
2066}
2067
2068
2071 // get first object that can be found in their container
2072 for (const auto& glObjectLayer : gViewObjectsHandler.getSelectedObjects()) {
2073 for (const auto& glObject : glObjectLayer.second) {
2074 auto demandElement = myNet->getAttributeCarriers()->retrieveDemandElement(glObject.object, false);
2075 if (demandElement) {
2076 return demandElement;
2077 }
2078 }
2079 }
2080 return nullptr;
2081}
2082
2083
2084GNEPoly*
2086 // get first object that can be parsed to poly element
2087 for (const auto& glObjectLayer : gViewObjectsHandler.getSelectedObjects()) {
2088 for (const auto& glObject : glObjectLayer.second) {
2089 auto polygon = dynamic_cast<GNEPoly*>(myNet->getAttributeCarriers()->retrieveAdditional(glObject.object, false));
2090 if (polygon) {
2091 return polygon;
2092 }
2093 }
2094 }
2095 return nullptr;
2096}
2097
2098
2099GNEPOI*
2101 // get first object that can be parsed to POI element
2102 for (const auto& glObjectLayer : gViewObjectsHandler.getSelectedObjects()) {
2103 for (const auto& glObject : glObjectLayer.second) {
2104 auto POI = dynamic_cast<GNEPOI*>(myNet->getAttributeCarriers()->retrieveAdditional(glObject.object, false));
2105 if (POI) {
2106 return POI;
2107 }
2108 }
2109 }
2110 return nullptr;
2111}
2112
2113
2114GNETAZ*
2116 // get first object that can be parsed to TAZ element
2117 for (const auto& glObjectLayer : gViewObjectsHandler.getSelectedObjects()) {
2118 for (const auto& glObject : glObjectLayer.second) {
2119 auto TAZ = dynamic_cast<GNETAZ*>(myNet->getAttributeCarriers()->retrieveAdditional(glObject.object, false));
2120 if (TAZ) {
2121 return TAZ;
2122 }
2123 }
2124 }
2125 return nullptr;
2126}
2127
2128
2131 // get first object that can be parsed to TAZ element
2132 for (const auto& glObjectLayer : gViewObjectsHandler.getSelectedObjects()) {
2133 for (const auto& glObject : glObjectLayer.second) {
2134 if (glObject.object->getType() == GLO_JUNCTION) {
2135 auto junction = myNet->getAttributeCarriers()->retrieveJunction(glObject.object->getMicrosimID());
2136 if (junction->isShapeEdited()) {
2137 return junction;
2138 }
2139 } else if (glObject.object->getType() == GLO_CROSSING) {
2140 auto crossing = myNet->getAttributeCarriers()->retrieveCrossing(glObject.object);
2141 if (crossing->isShapeEdited()) {
2142 return crossing;
2143 }
2144 } else if (glObject.object->getType() == GLO_CONNECTION) {
2145 auto connection = myNet->getAttributeCarriers()->retrieveConnection(glObject.object);
2146 if (connection->isShapeEdited()) {
2147 return connection;
2148 }
2149 }
2150 }
2151 }
2152 return nullptr;
2153}
2154
2155
2156long
2157GNEViewNet::onCmdSetSupermode(FXObject*, FXSelector sel, void*) {
2158 // check what network mode will be set
2159 switch (FXSELID(sel)) {
2161 if (myEditModes.networkButton->shown()) {
2163 }
2164 break;
2166 if (myEditModes.demandButton->shown()) {
2168 }
2169 break;
2171 if (myEditModes.dataButton->shown()) {
2173 }
2174 break;
2175 default:
2176 break;
2177 }
2178 return 1;
2179}
2180
2181
2182long
2183GNEViewNet::onCmdSetMode(FXObject*, FXSelector sel, void*) {
2184 // first filter modes depending of view
2186 // network
2188 switch (FXSELID(sel)) {
2189 // common
2193 // infrastructure
2198 // shapes
2201 break;
2202 default:
2203 return 0;
2204 }
2205 }
2206 // demand
2208 switch (FXSELID(sel)) {
2209 // common
2213 // persons
2216 // routes
2219 // types
2222 break;
2223 default:
2224 return 0;
2225 }
2226 }
2227 // data
2229 // all modes disabled
2230 return 0;
2231 }
2232 }
2233 // continue depending of supermode
2235 // check what network mode will be set
2236 switch (FXSELID(sel)) {
2239 break;
2242 break;
2245 break;
2248 break;
2251 break;
2254 break;
2257 break;
2260 break;
2263 break;
2266 break;
2269 break;
2272 break;
2275 break;
2278 break;
2279 default:
2280 break;
2281 }
2283 // check what demand mode will be set
2284 switch (FXSELID(sel)) {
2287 break;
2290 break;
2293 break;
2296 break;
2299 break;
2302 break;
2305 break;
2308 break;
2311 break;
2314 break;
2317 break;
2320 break;
2323 break;
2326 break;
2327 default:
2328 break;
2329 }
2330 } else if (myEditModes.isCurrentSupermodeData()) {
2331 // check what demand mode will be set
2332 switch (FXSELID(sel)) {
2335 break;
2338 break;
2341 break;
2344 break;
2347 break;
2350 break;
2353 break;
2354 default:
2355 break;
2356 }
2357 }
2358 return 1;
2359}
2360
2361
2362long
2363GNEViewNet::onCmdSplitEdge(FXObject*, FXSelector, void*) {
2365 if (edge != nullptr) {
2367 }
2368 return 1;
2369}
2370
2371
2372long
2373GNEViewNet::onCmdSplitEdgeBidi(FXObject*, FXSelector, void*) {
2375 if (edge != nullptr) {
2376 // obtain reverse edge
2377 const auto oppositeEdges = edge->getOppositeEdges();
2378 // check that reverse edge works
2379 if (oppositeEdges.size() > 0) {
2380 for (const auto& oppositeEdge : oppositeEdges) {
2381 // get reverse inner geometry
2382 const auto reverseGeometry = oppositeEdge->getNBEdge()->getInnerGeometry().reverse();
2383 if (reverseGeometry == edge->getNBEdge()->getInnerGeometry()) {
2384 myNet->splitEdgesBidi(edge, oppositeEdge, edge->getSplitPos(getPopupPosition()), myUndoList);
2385 return 1;
2386 }
2387 }
2388 }
2389 }
2390 return 1;
2391}
2392
2393
2394long
2395GNEViewNet::onCmdReverseEdge(FXObject*, FXSelector, void*) {
2397 if (edge != nullptr) {
2398 if (edge->isAttributeCarrierSelected()) {
2399 myUndoList->begin(edge, TL("Reverse selected edges"));
2400 const auto selectedEdges = myNet->getAttributeCarriers()->getSelectedEdges();
2401 for (const auto& selectedEdge : selectedEdges) {
2402 myNet->reverseEdge(selectedEdge, myUndoList);
2403 }
2404 myUndoList->end();
2405 } else {
2406 myUndoList->begin(edge, TL("Reverse edge"));
2408 myUndoList->end();
2409 }
2410 }
2411 return 1;
2412}
2413
2414
2415long
2416GNEViewNet::onCmdAddReversedEdge(FXObject*, FXSelector, void*) {
2418 if (edge != nullptr) {
2419 if (edge->isAttributeCarrierSelected()) {
2420 myUndoList->begin(edge, TL("Add Reverse edge for selected edges"));
2421 const auto selectedEdges = myNet->getAttributeCarriers()->getSelectedEdges();
2422 for (const auto& selectedEdge : selectedEdges) {
2423 myNet->addReversedEdge(selectedEdge, false, myUndoList);
2424 }
2425 myUndoList->end();
2426 } else {
2427 myUndoList->begin(edge, TL("Add reverse edge"));
2428 myNet->addReversedEdge(edge, false, myUndoList);
2429 myUndoList->end();
2430 }
2431 }
2432 return 1;
2433}
2434
2435
2436long
2439 if (edge != nullptr) {
2440 if (edge->isAttributeCarrierSelected()) {
2441 myUndoList->begin(edge, TL("Add Reverse disconnected edge for selected edges"));
2442 const auto selectedEdges = myNet->getAttributeCarriers()->getSelectedEdges();
2443 for (const auto& selectedEdge : selectedEdges) {
2444 myNet->addReversedEdge(selectedEdge, true, myUndoList);
2445 }
2446 myUndoList->end();
2447 } else {
2448 myUndoList->begin(edge, TL("Add reverse disconnected edge"));
2449 myNet->addReversedEdge(edge, true, myUndoList);
2450 myUndoList->end();
2451 }
2452 }
2453 return 1;
2454}
2455
2456
2457long
2458GNEViewNet::onCmdEditEdgeEndpoint(FXObject*, FXSelector, void*) {
2460 if (edge != nullptr) {
2461 // snap to active grid the Popup position
2463 }
2464 return 1;
2465}
2466
2467
2468long
2469GNEViewNet::onCmdResetEdgeEndpoint(FXObject*, FXSelector, void*) {
2471 if (edge != nullptr) {
2472 // check if edge is selected
2473 if (edge->isAttributeCarrierSelected()) {
2474 // get all selected edges
2475 const auto selectedEdges = myNet->getAttributeCarriers()->getSelectedEdges();
2476 // begin operation
2477 myUndoList->begin(edge, TL("reset geometry points"));
2478 // iterate over selected edges
2479 for (const auto& selectedEdge : selectedEdges) {
2480 // reset both end points
2481 selectedEdge->resetBothEndpoint(myUndoList);
2482 }
2483 // end operation
2484 myUndoList->end();
2485 } else {
2487 }
2488 }
2489 return 1;
2490}
2491
2492
2493long
2494GNEViewNet::onCmdStraightenEdges(FXObject*, FXSelector, void*) {
2496 if (edge != nullptr) {
2497 if (edge->isAttributeCarrierSelected()) {
2498 myUndoList->begin(edge, TL("straighten selected edges"));
2499 const auto selectedEdges = myNet->getAttributeCarriers()->getSelectedEdges();
2500 for (const auto& selectedEdge : selectedEdges) {
2501 selectedEdge->setAttribute(SUMO_ATTR_SHAPE, "", myUndoList);
2502 }
2503 myUndoList->end();
2504 } else {
2505
2506 myUndoList->begin(edge, TL("straighten edge"));
2508 myUndoList->end();
2509 }
2510 }
2511 return 1;
2512}
2513
2514
2515long
2516GNEViewNet::onCmdSmoothEdges(FXObject*, FXSelector, void*) {
2518 if (edge != nullptr) {
2519 if (edge->isAttributeCarrierSelected()) {
2520 myUndoList->begin(edge, TL("smooth selected edges"));
2521 const auto selectedEdges = myNet->getAttributeCarriers()->getSelectedEdges();
2522 for (const auto& selectedEdge : selectedEdges) {
2523 selectedEdge->smooth(myUndoList);
2524 }
2525 myUndoList->end();
2526 } else {
2527 myUndoList->begin(edge, TL("smooth edge"));
2528 edge->smooth(myUndoList);
2529 myUndoList->end();
2530 }
2531 }
2532 return 1;
2533}
2534
2535
2536long
2537GNEViewNet::onCmdStraightenEdgesElevation(FXObject*, FXSelector, void*) {
2539 if (edge != nullptr) {
2540 if (edge->isAttributeCarrierSelected()) {
2541 myUndoList->begin(edge, TL("straighten elevation of selected edges"));
2542 const auto selectedEdges = myNet->getAttributeCarriers()->getSelectedEdges();
2543 for (const auto& selectedEdge : selectedEdges) {
2544 selectedEdge->straightenElevation(myUndoList);
2545 }
2546 myUndoList->end();
2547 } else {
2548 myUndoList->begin(edge, TL("straighten edge elevation"));
2550 myUndoList->end();
2551 }
2552 }
2553 return 1;
2554}
2555
2556
2557long
2558GNEViewNet::onCmdSmoothEdgesElevation(FXObject*, FXSelector, void*) {
2560 if (edge != nullptr) {
2561 if (edge->isAttributeCarrierSelected()) {
2562 myUndoList->begin(edge, TL("smooth elevation of selected edges"));
2563 const auto selectedEdges = myNet->getAttributeCarriers()->getSelectedEdges();
2564 for (const auto& selectedEdge : selectedEdges) {
2565 selectedEdge->smoothElevation(myUndoList);
2566 }
2567 myUndoList->end();
2568 } else {
2569 myUndoList->begin(edge, TL("smooth edge elevation"));
2571 myUndoList->end();
2572 }
2573 }
2574 return 1;
2575}
2576
2577
2578long
2579GNEViewNet::onCmdResetLength(FXObject*, FXSelector, void*) {
2581 if (edge != nullptr) {
2582 if (edge->isAttributeCarrierSelected()) {
2583 myUndoList->begin(edge, TL("reset edge lengths"));
2584 const auto selectedEdges = myNet->getAttributeCarriers()->getSelectedEdges();
2585 for (const auto& selectedEdge : selectedEdges) {
2586 selectedEdge->setAttribute(SUMO_ATTR_LENGTH, "-1", myUndoList);
2587 }
2588 myUndoList->end();
2589 } else {
2591 }
2592 }
2593 return 1;
2594}
2595
2596
2597long
2598GNEViewNet::onCmdEdgeUseAsTemplate(FXObject*, FXSelector, void*) {
2600 if (edge != nullptr) {
2602 }
2603 return 1;
2604}
2605
2606
2607long
2608GNEViewNet::onCmdEgeApplyTemplate(FXObject*, FXSelector, void*) {
2609 GNEEdge* edgeAtPosition = getEdgeAtPopupPosition();
2610 if ((edgeAtPosition != nullptr) && myViewParent->getInspectorFrame()->getTemplateEditor()->getEdgeTemplate()) {
2611 // begin copy template
2612 myUndoList->begin(edgeAtPosition, TL("copy edge template"));
2613 if (edgeAtPosition->isAttributeCarrierSelected()) {
2614 // copy template in all selected edges
2615 for (const auto& edge : myNet->getAttributeCarriers()->getEdges()) {
2616 if (edge.second->isAttributeCarrierSelected()) {
2617 edge.second->copyTemplate(myViewParent->getInspectorFrame()->getTemplateEditor()->getEdgeTemplate(), myUndoList);
2618 }
2619 }
2620 } else {
2621 // copy template
2623 }
2624 // end copy template
2625 myUndoList->end();
2626 }
2627 return 1;
2628}
2629
2630
2631long
2632GNEViewNet::onCmdSimplifyShape(FXObject*, FXSelector, void*) {
2633 // get polygon under mouse
2634 GNEPoly* polygonUnderMouse = getPolygonAtPopupPosition();
2635 // check polygon
2636 if (polygonUnderMouse) {
2637 // check if shape is selected
2638 if (polygonUnderMouse->isAttributeCarrierSelected()) {
2639 // begin undo-list
2640 myNet->getViewNet()->getUndoList()->begin(polygonUnderMouse, TL("simplify shapes"));
2641 // get shapes
2642 const auto selectedShapes = myNet->getAttributeCarriers()->getSelectedShapes();
2643 // iterate over shapes
2644 for (const auto& selectedShape : selectedShapes) {
2645 // check if shape is a poly
2646 if ((selectedShape->getTagProperty().getTag() == SUMO_TAG_POLY) ||
2647 (selectedShape->getTagProperty().getTag() == GNE_TAG_JPS_WALKABLEAREA) ||
2648 (selectedShape->getTagProperty().getTag() == GNE_TAG_JPS_OBSTACLE)) {
2649 // simplify shape
2650 dynamic_cast<GNEPoly*>(selectedShape)->simplifyShape();
2651 }
2652 }
2653 // end undo-list
2655 } else {
2656 polygonUnderMouse->simplifyShape();
2657 }
2658 }
2659 return 1;
2660}
2661
2662
2663long
2664GNEViewNet::onCmdDeleteGeometryPoint(FXObject*, FXSelector, void*) {
2665 GNEPoly* polygonUnderMouse = getPolygonAtPopupPosition();
2666 if (polygonUnderMouse) {
2667 polygonUnderMouse->deleteGeometryPoint(getPopupPosition());
2668 }
2669 return 1;
2670}
2671
2672
2673long
2674GNEViewNet::onCmdClosePolygon(FXObject*, FXSelector, void*) {
2675 // get polygon under mouse
2676 GNEPoly* polygonUnderMouse = getPolygonAtPopupPosition();
2677 // check polygon
2678 if (polygonUnderMouse) {
2679 // check if shape is selected
2680 if (polygonUnderMouse->isAttributeCarrierSelected()) {
2681 // begin undo-list
2682 myNet->getViewNet()->getUndoList()->begin(polygonUnderMouse, TL("close polygon shapes"));
2683 // get selectedshapes
2684 const auto selectedShapes = myNet->getAttributeCarriers()->getSelectedShapes();
2685 // iterate over shapes
2686 for (const auto& selectedShape : selectedShapes) {
2687 // check if shape is a poly
2688 if ((selectedShape->getTagProperty().getTag() == SUMO_TAG_POLY) ||
2689 (selectedShape->getTagProperty().getTag() == GNE_TAG_JPS_WALKABLEAREA) ||
2690 (selectedShape->getTagProperty().getTag() == GNE_TAG_JPS_OBSTACLE)) {
2691 // close polygon
2692 dynamic_cast<GNEPoly*>(selectedShape)->closePolygon();
2693 }
2694 }
2695 // end undo-list
2697 } else {
2698 polygonUnderMouse->closePolygon();
2699 }
2700 }
2701 return 1;
2702}
2703
2704
2705long
2706GNEViewNet::onCmdOpenPolygon(FXObject*, FXSelector, void*) {
2707 // get polygon under mouse
2708 GNEPoly* polygonUnderMouse = getPolygonAtPopupPosition();
2709 // check polygon
2710 if (polygonUnderMouse) {
2711 // check if shape is selected
2712 if (polygonUnderMouse->isAttributeCarrierSelected()) {
2713 // begin undo-list
2714 myNet->getViewNet()->getUndoList()->begin(polygonUnderMouse, TL("open polygon shapes"));
2715 // get shapes
2716 const auto selectedShapes = myNet->getAttributeCarriers()->getSelectedShapes();
2717 // iterate over shapes
2718 for (const auto& selectedShape : selectedShapes) {
2719 // check if shape is a poly
2720 if ((selectedShape->getTagProperty().getTag() == SUMO_TAG_POLY) ||
2721 (selectedShape->getTagProperty().getTag() == GNE_TAG_JPS_WALKABLEAREA) ||
2722 (selectedShape->getTagProperty().getTag() == GNE_TAG_JPS_OBSTACLE)) {
2723 // open polygon
2724 dynamic_cast<GNEPoly*>(selectedShape)->openPolygon();
2725 }
2726 }
2727 // end undo-list
2729 } else {
2730 polygonUnderMouse->openPolygon();
2731 }
2732 }
2733 return 1;
2734}
2735
2736
2737long
2738GNEViewNet::onCmdSelectPolygonElements(FXObject*, FXSelector, void*) {
2739 // get polygon under mouse
2740 GNEPoly* polygonUnderMouse = getPolygonAtPopupPosition();
2741 // check polygon
2742 if (polygonUnderMouse) {
2743 // get ACs in boundary
2744 updateObjectsInBoundary(polygonUnderMouse->getShape().getBoxBoundary());
2745 // declare filtered ACs
2746 std::vector<GNEAttributeCarrier*> filteredACs;
2747 // iterate over obtained GUIGlIDs
2748 for (const auto& AC : myViewObjectsSelector.getAttributeCarriers()) {
2749 if (AC->getTagProperty().getTag() == SUMO_TAG_EDGE) {
2750 if (checkSelectEdges() && myNet->getAttributeCarriers()->isNetworkElementAroundShape(AC, polygonUnderMouse->getShape())) {
2751 filteredACs.push_back(AC);
2752 }
2753 } else if (AC->getTagProperty().getTag() == SUMO_TAG_LANE) {
2754 if (!checkSelectEdges() && myNet->getAttributeCarriers()->isNetworkElementAroundShape(AC, polygonUnderMouse->getShape())) {
2755 filteredACs.push_back(AC);
2756 }
2757 } else if ((AC != polygonUnderMouse) && myNet->getAttributeCarriers()->isNetworkElementAroundShape(AC, polygonUnderMouse->getShape())) {
2758 filteredACs.push_back(AC);
2759 }
2760 }
2761 // continue if there are ACs
2762 if (filteredACs.size() > 0) {
2763 // begin undo-list
2764 myNet->getViewNet()->getUndoList()->begin(GUIIcon::MODESELECT, TL("select within polygon boundary"));
2765 // iterate over shapes
2766 for (const auto& AC : filteredACs) {
2767 AC->setAttribute(GNE_ATTR_SELECTED, "true", myUndoList);
2768 }
2769 // end undo-list
2771 }
2772 }
2773 return 1;
2774}
2775
2776
2777long
2778GNEViewNet::onCmdSetFirstGeometryPoint(FXObject*, FXSelector, void*) {
2779 GNEPoly* polygonUnderMouse = getPolygonAtPopupPosition();
2780 if (polygonUnderMouse) {
2781 polygonUnderMouse->changeFirstGeometryPoint(polygonUnderMouse->getVertexIndex(getPopupPosition(), false));
2782 }
2783
2784 return 1;
2785}
2786
2787
2788long
2789GNEViewNet::onCmdSimplifyShapeEdited(FXObject*, FXSelector, void*) {
2790 auto undoList = myNet->getViewNet()->getUndoList();
2791 // get shape edited under mouse
2793 if (shapeEdited) {
2794 // simplify edited shape using undo-redo
2795 undoList->begin(shapeEdited, TL("simplify edited shape"));
2796 shapeEdited->simplifyShapeEdited(undoList);
2797 undoList->end();
2798 }
2799 return 1;
2800}
2801
2802
2803long
2804GNEViewNet::onCmdStraightenShapeEdited(FXObject*, FXSelector, void*) {
2805 auto undoList = myNet->getViewNet()->getUndoList();
2806 // get shape edited under mouse
2808 if (shapeEdited) {
2809 // simplify edited shape using undo-redo
2810 undoList->begin(shapeEdited, TL("straigthen edited shape"));
2811 shapeEdited->straigthenShapeEdited(undoList);
2812 undoList->end();
2813 }
2814 return 1;
2815}
2816
2817
2818long
2819GNEViewNet::onCmdCloseShapeEdited(FXObject*, FXSelector, void*) {
2820 auto undoList = myNet->getViewNet()->getUndoList();
2821 // get shape edited under mouse
2823 if (shapeEdited) {
2824 // close edited shape using undo-redo
2825 undoList->begin(shapeEdited, TL("simplify edited shape"));
2826 shapeEdited->closeShapeEdited(undoList);
2827 undoList->end();
2828 }
2829 return 1;
2830}
2831
2832
2833long
2834GNEViewNet::onCmdOpenShapeEdited(FXObject*, FXSelector, void*) {
2835 auto undoList = myNet->getViewNet()->getUndoList();
2836 // get shape edited under mouse
2838 if (shapeEdited) {
2839 // open edited shape using undo-redo
2840 undoList->begin(shapeEdited, TL("simplify edited shape"));
2841 shapeEdited->openShapeEdited(undoList);
2842 undoList->end();
2843 }
2844 return 1;
2845}
2846
2847
2848long
2850 auto undoList = myNet->getViewNet()->getUndoList();
2851 // get shape edited under mouse
2853 if (shapeEdited) {
2854 // get geometry point index under cursor
2855 const auto geometryPointIndex = shapeEdited->getGeometryPointUnderCursorShapeEdited();
2856 // set first geometry point in edited shape using undo-redo
2857 undoList->begin(shapeEdited, TL("simplify edited shape"));
2858 shapeEdited->setFirstGeometryPointShapeEdited(geometryPointIndex, undoList);
2859 undoList->end();
2860 }
2861 return 1;
2862}
2863
2864
2865long
2867 auto undoList = myNet->getViewNet()->getUndoList();
2868 // get shape edited under mouse
2870 if (shapeEdited) {
2871 // get geometry point index under cursor
2872 const auto geometryPointIndex = shapeEdited->getGeometryPointUnderCursorShapeEdited();
2873 // delete geometry point edited shape using undo-redo
2874 undoList->begin(shapeEdited, TL("simplify edited shape"));
2875 shapeEdited->deleteGeometryPointShapeEdited(geometryPointIndex, undoList);
2876 undoList->end();
2877 }
2878 return 1;
2879}
2880
2881
2882long
2883GNEViewNet::onCmdResetShapeEdited(FXObject*, FXSelector, void*) {
2884 auto undoList = myNet->getViewNet()->getUndoList();
2885 // get shape edited under mouse
2887 if (shapeEdited) {
2888 // simplify edited shape using undo-redo
2889 undoList->begin(shapeEdited, TL("simplify edited shape"));
2890 shapeEdited->resetShapeEdited(undoList);
2891 undoList->end();
2892 }
2893 return 1;
2894}
2895
2896
2897long
2898GNEViewNet::onCmdFinishShapeEdited(FXObject*, FXSelector, void*) {
2899 // the same behavior as when we press enter
2900 hotkeyEnter();
2901 return 1;
2902}
2903
2904
2905long
2906GNEViewNet::onCmdTransformPOI(FXObject*, FXSelector, void*) {
2907 // declare additional handler
2909 // obtain POI at popup position
2911 if (POI) {
2912 // check what type of POI will be transformed
2913 if (POI->getTagProperty().getTag() == SUMO_TAG_POI) {
2914 // obtain lanes around POI boundary
2915 std::vector<GUIGlID> GLIDs = getObjectsInBoundary(POI->getCenteringBoundary());
2916 std::vector<GNELane*> lanes;
2917 for (const auto& GLID : GLIDs) {
2919 if (lane) {
2920 lanes.push_back(lane);
2921 }
2922 }
2923 if (lanes.empty()) {
2924 WRITE_WARNINGF(TL("No lanes around % to attach it"), toString(SUMO_TAG_POI));
2925 } else {
2926 // obtain nearest lane to POI
2927 GNELane* nearestLane = lanes.front();
2928 double minorPosOverLane = nearestLane->getLaneShape().nearest_offset_to_point2D(POI->getPositionInView());
2929 double minorLateralOffset = nearestLane->getLaneShape().positionAtOffset(minorPosOverLane).distanceTo(POI->getPositionInView());
2930 for (const auto& lane : lanes) {
2931 double posOverLane = lane->getLaneShape().nearest_offset_to_point2D(POI->getPositionInView());
2932 double lateralOffset = lane->getLaneShape().positionAtOffset(posOverLane).distanceTo(POI->getPositionInView());
2933 if (lateralOffset < minorLateralOffset) {
2934 minorPosOverLane = posOverLane;
2935 minorLateralOffset = lateralOffset;
2936 nearestLane = lane;
2937 }
2938 }
2939 // get sumo base object of POI (And all common attributes)
2940 CommonXMLStructure::SumoBaseObject* POIBaseObject = POI->getSumoBaseObject();
2941 // add specific attributes
2942 POIBaseObject->addStringAttribute(SUMO_ATTR_LANE, nearestLane->getID());
2943 POIBaseObject->addDoubleAttribute(SUMO_ATTR_POSITION, minorPosOverLane);
2944 POIBaseObject->addBoolAttribute(SUMO_ATTR_FRIENDLY_POS, POI->getFriendlyPos());
2945 POIBaseObject->addDoubleAttribute(SUMO_ATTR_POSITION_LAT, 0);
2946 // remove POI
2947 myUndoList->begin(POI, TL("attach POI into lane"));
2949 // add new POI use route handler
2950 additionalHanlder.parseSumoBaseObject(POIBaseObject);
2951 myUndoList->end();
2952 }
2953 } else {
2954 // get sumo base object of POI (And all common attributes)
2955 CommonXMLStructure::SumoBaseObject* POIBaseObject = POI->getSumoBaseObject();
2956 // add specific attributes
2957 POIBaseObject->addDoubleAttribute(SUMO_ATTR_X, POI->x());
2958 POIBaseObject->addDoubleAttribute(SUMO_ATTR_Y, POI->y());
2959 // remove POI
2960 myUndoList->begin(POI, TL("release POI from lane"));
2962 // add new POI use route handler
2963 additionalHanlder.parseSumoBaseObject(POIBaseObject);
2964 myUndoList->end();
2965 }
2966 }
2967 return 1;
2968}
2969
2970
2971long
2972GNEViewNet::onCmdReverse(FXObject*, FXSelector, void*) {
2973 // obtain demand element at popup position
2975 if (demandElement) {
2976 // begin undo list
2977 myUndoList->begin(demandElement, TLF("reverse % '%'", demandElement->getTagStr(), demandElement->getID()));
2978 GNERouteHandler::reverse(demandElement);
2979 myUndoList->end();
2980 }
2981 return 1;
2982}
2983
2984
2985long
2986GNEViewNet::onCmdAddReverse(FXObject*, FXSelector, void*) {
2987 // obtain demand element at popup position
2989 if (demandElement) {
2990 // begin undo list
2991 myUndoList->begin(demandElement, TLF("add reverse '%'", demandElement->getTagStr()));
2992 GNERouteHandler::addReverse(demandElement);
2993 myUndoList->end();
2994 }
2995 return 1;
2996}
2997
2998
2999long
3000GNEViewNet::onCmdSetCustomGeometryPoint(FXObject*, FXSelector, void*) {
3001 // get element at popup position
3005 // check element
3006 if (lane != nullptr) {
3007 // make a copy of edge geometry
3008 PositionVector edgeGeometry = lane->getParentEdge()->getNBEdge()->getGeometry();
3009 // get index position
3010 const int index = edgeGeometry.indexOfClosest(getPositionInformation(), true);
3011 // get new position
3012 Position newPosition = edgeGeometry[index];
3013 // edit using modal GNEGeometryPointDialog
3014 GNEGeometryPointDialog(this, &newPosition); // NOSONAR, constructor returns after dialog has been closed
3015 // now check position
3016 if (newPosition != edgeGeometry[index]) {
3017 // update new position
3018 edgeGeometry[index] = newPosition;
3019 // begin undo list
3020 myUndoList->begin(lane->getParentEdge(), TL("change edge Geometry Point position"));
3021 // continue depending of index
3022 if (index == 0) {
3023 // change shape start
3025 } else if (index == ((int)edgeGeometry.size() - 1)) {
3026 // change shape end
3028 } else {
3029 // remove front and back geometry points
3030 edgeGeometry.pop_front();
3031 edgeGeometry.pop_back();
3032 // change shape
3034 }
3035 // end undo list
3036 myUndoList->end();
3037 }
3038 } else if (poly != nullptr) {
3039 // make a copy of polygon geometry
3040 PositionVector polygonGeometry = poly->getShape();
3041 // get index position
3042 const int index = polygonGeometry.indexOfClosest(getPositionInformation(), true);
3043 // get new position
3044 Position newPosition = polygonGeometry[index];
3045 // edit using modal GNEGeometryPointDialog
3046 GNEGeometryPointDialog(this, &newPosition); // NOSONAR, constructor returns after dialog has been closed
3047 // now check position
3048 if (newPosition != polygonGeometry[index]) {
3049 // update new position
3050 polygonGeometry[index] = newPosition;
3051 // begin undo list
3052 myUndoList->begin(poly, TL("change polygon Geometry Point position"));
3053 // change shape
3055 // end undo list
3056 myUndoList->end();
3057 }
3058 } else if (TAZ != nullptr) {
3059 // make a copy of TAZ geometry
3060 PositionVector TAZGeometry = TAZ->getAdditionalGeometry().getShape();
3061 // get index position
3062 const int index = TAZGeometry.indexOfClosest(getPositionInformation(), true);
3063 // get new position
3064 Position newPosition = TAZGeometry[index];
3065 // edit using modal GNEGeometryPointDialog
3066 GNEGeometryPointDialog(this, &newPosition); // NOSONAR, constructor returns after dialog has been closed
3067 // now check position
3068 if (newPosition != TAZGeometry[index]) {
3069 // update new position
3070 TAZGeometry[index] = newPosition;
3071 // begin undo list
3072 myUndoList->begin(TAZ, TL("change TAZ Geometry Point position"));
3073 // change shape
3075 // end undo list
3076 myUndoList->end();
3077 }
3078 }
3079 return 1;
3080}
3081
3082
3083long
3084GNEViewNet::onCmdResetEndPoints(FXObject*, FXSelector, void*) {
3085 // get lane at popup position
3086 GNELane* laneAtPopupPosition = getLaneAtPopupPosition();
3087 // check element
3088 if (laneAtPopupPosition != nullptr) {
3089 // get parent edge
3090 GNEEdge* edge = laneAtPopupPosition->getParentEdge();
3091 // check if edge is selected
3092 if (edge->isAttributeCarrierSelected()) {
3093 // get selected edges
3094 const auto selectedEdges = myNet->getAttributeCarriers()->getSelectedEdges();
3095 // begin undo list
3096 myUndoList->begin(edge, TL("reset end points of selected edges"));
3097 // iterate over edges
3098 for (const auto& selectedEdge : selectedEdges) {
3099 // reset both end points
3100 selectedEdge->setAttribute(GNE_ATTR_SHAPE_START, "", myUndoList);
3101 selectedEdge->setAttribute(GNE_ATTR_SHAPE_END, "", myUndoList);
3102 }
3103 // end undo list
3104 myUndoList->end();
3105 } else {
3106 // begin undo list
3107 myUndoList->begin(edge, TL("reset end points of edge '") + edge->getID());
3108 // reset both end points
3111 // end undo list
3112 myUndoList->end();
3113 }
3114 }
3115 return 1;
3116}
3117
3118
3119long
3120GNEViewNet::onCmdDuplicateLane(FXObject*, FXSelector, void*) {
3121 GNELane* laneAtPopupPosition = getLaneAtPopupPosition();
3122 if (laneAtPopupPosition != nullptr) {
3123 // when duplicating an unselected lane, keep all connections as they
3124 // are, otherwise recompute them
3125 if (laneAtPopupPosition->isAttributeCarrierSelected()) {
3126 myUndoList->begin(laneAtPopupPosition, TL("duplicate selected lanes"));
3127 const auto selectedLanes = myNet->getAttributeCarriers()->getSelectedLanes();
3128 for (const auto& lane : selectedLanes) {
3129 myNet->duplicateLane(lane, myUndoList, true);
3130 }
3131 myUndoList->end();
3132 } else {
3133 myUndoList->begin(laneAtPopupPosition, TL("duplicate lane"));
3134 myNet->duplicateLane(laneAtPopupPosition, myUndoList, false);
3135 myUndoList->end();
3136 }
3137 }
3138 return 1;
3139}
3140
3141
3142long
3143GNEViewNet::onCmdEditLaneShape(FXObject*, FXSelector, void*) {
3144 // Obtain lane under mouse
3146 if (lane) {
3148 }
3149 // destroy pop-up and update view Net
3150 destroyPopup();
3151 setFocus();
3152 return 1;
3153}
3154
3155
3156long
3157GNEViewNet::onCmdResetLaneCustomShape(FXObject*, FXSelector, void*) {
3158 GNELane* laneAtPopupPosition = getLaneAtPopupPosition();
3159 if (laneAtPopupPosition != nullptr) {
3160 // when duplicating an unselected lane, keep all connections as they
3161 // are, otherwise recompute them
3162 if (laneAtPopupPosition->isAttributeCarrierSelected()) {
3163 myUndoList->begin(laneAtPopupPosition, TL("reset custom lane shapes"));
3164 const auto selectedLanes = myNet->getAttributeCarriers()->getSelectedLanes();
3165 for (const auto& lane : selectedLanes) {
3166 lane->setAttribute(SUMO_ATTR_CUSTOMSHAPE, "", myUndoList);
3167 }
3168 myUndoList->end();
3169 } else {
3170 myUndoList->begin(laneAtPopupPosition, TL("reset custom lane shape"));
3171 laneAtPopupPosition->setAttribute(SUMO_ATTR_CUSTOMSHAPE, "", myUndoList);
3172 myUndoList->end();
3173 }
3174 }
3175 return 1;
3176}
3177
3178
3179long
3180GNEViewNet::onCmdResetOppositeLane(FXObject*, FXSelector, void*) {
3181 GNELane* laneAtPopupPosition = getLaneAtPopupPosition();
3182 if (laneAtPopupPosition != nullptr) {
3183 // when duplicating an unselected lane, keep all connections as they
3184 // are, otherwise recompute them
3185 if (laneAtPopupPosition->isAttributeCarrierSelected()) {
3186 myUndoList->begin(laneAtPopupPosition, TL("reset opposite lanes"));
3187 const auto selectedLanes = myNet->getAttributeCarriers()->getSelectedLanes();
3188 for (const auto& lane : selectedLanes) {
3189 lane->setAttribute(GNE_ATTR_OPPOSITE, "", myUndoList);
3190 }
3191 myUndoList->end();
3192 } else {
3193 myUndoList->begin(laneAtPopupPosition, TL("reset opposite lane"));
3194 laneAtPopupPosition->setAttribute(GNE_ATTR_OPPOSITE, "", myUndoList);
3195 myUndoList->end();
3196 }
3197 }
3198 return 1;
3199}
3200
3201
3202long
3203GNEViewNet::onCmdLaneOperation(FXObject*, FXSelector sel, void*) {
3204 GNELane* laneAtPopupPosition = getLaneAtPopupPosition();
3205 if (laneAtPopupPosition) {
3206 // check lane operation
3207 switch (FXSELID(sel)) {
3209 return restrictLane(laneAtPopupPosition, SVC_PEDESTRIAN);
3211 return restrictLane(laneAtPopupPosition, SVC_BICYCLE);
3213 return restrictLane(laneAtPopupPosition, SVC_BUS);
3215 return restrictLane(laneAtPopupPosition, SVC_IGNORING);
3217 return addRestrictedLane(laneAtPopupPosition, SVC_PEDESTRIAN, false);
3219 return addRestrictedLane(laneAtPopupPosition, SVC_BICYCLE, false);
3221 return addRestrictedLane(laneAtPopupPosition, SVC_BUS, false);
3223 return addRestrictedLane(laneAtPopupPosition, SVC_IGNORING, true);
3225 return addRestrictedLane(laneAtPopupPosition, SVC_IGNORING, false);
3227 return removeRestrictedLane(laneAtPopupPosition, SVC_PEDESTRIAN);
3229 return removeRestrictedLane(laneAtPopupPosition, SVC_BICYCLE);
3231 return removeRestrictedLane(laneAtPopupPosition, SVC_BUS);
3233 return removeRestrictedLane(laneAtPopupPosition, SVC_IGNORING);
3234 default:
3235 return 0;
3236 }
3237 } else {
3238 return 0;
3239 }
3240}
3241
3242
3243long
3244GNEViewNet::onCmdLaneReachability(FXObject* menu, FXSelector, void*) {
3245 GNELane* laneAtPopupPosition = getLaneAtPopupPosition();
3246 if (laneAtPopupPosition != nullptr) {
3247 // obtain vClass
3248 const SUMOVehicleClass vClass = SumoVehicleClassStrings.get(dynamic_cast<FXMenuCommand*>(menu)->getText().text());
3249 // calculate reachability
3251 // select all lanes with reachability greater than 0
3252 myUndoList->begin(laneAtPopupPosition, TL("select lane reachability"));
3253 for (const auto& edge : myNet->getAttributeCarriers()->getEdges()) {
3254 for (const auto& lane : edge.second->getLanes()) {
3255 if (lane->getReachability() >= 0) {
3256 lane->setAttribute(GNE_ATTR_SELECTED, "true", myUndoList);
3257 }
3258 }
3259 }
3260 myUndoList->end();
3261 }
3262 return 1;
3263}
3264
3265
3266long
3267GNEViewNet::onCmdOpenAdditionalDialog(FXObject*, FXSelector, void*) {
3268 // retrieve additional under cursor
3270 // check if additional can open dialog
3271 if (addtional && addtional->getTagProperty().hasDialog()) {
3272 addtional->openAdditionalDialog();
3273 }
3274 return 1;
3275}
3276
3277
3278void
3280 FXEvent* evt = (FXEvent*)eventData;
3281 // process click
3282 destroyPopup();
3283 setFocus();
3284 myChanger->onLeftBtnPress(eventData);
3285 grab();
3286 // Check there are double click
3287 if (evt->click_count == 2) {
3288 handle(this, FXSEL(SEL_DOUBLECLICKED, 0), eventData);
3289 }
3290}
3291
3292
3293void
3295 // first check if we're panning
3296 if (myPanning) {
3297 // move view
3300 } else {
3301 // declare flags
3302 bool cursorMoveView = false;
3303 bool cursorInspect = false;
3304 bool cursorSelect = false;
3305 bool cursorMoveElement = false;
3306 bool cursorDelete = false;
3307 // continue depending of supermode
3309 // move view
3315 cursorMoveView = true;
3316 }
3317 // specific mode
3319 cursorInspect = true;
3321 cursorSelect = true;
3323 cursorMoveElement = true;
3325 cursorDelete = true;
3326 }
3328 // move view
3332 cursorMoveView = true;
3333 }
3334 // specific mode
3336 cursorInspect = true;
3338 cursorSelect = true;
3340 cursorMoveElement = true;
3342 cursorDelete = true;
3343 }
3344 } else if (myEditModes.isCurrentSupermodeData()) {
3345 // move view
3347 cursorMoveView = true;
3348 }
3349 // specific mode
3351 cursorInspect = true;
3353 cursorSelect = true;
3355 cursorDelete = true;
3356 }
3357 }
3358 // set cursor
3359 if (myMouseButtonKeyPressed.controlKeyPressed() && cursorMoveView) {
3360 // move view cursor if control key is pressed
3363 } else if (cursorInspect) {
3364 // special case for inspect lanes
3366 // inspect lane cursor
3369 } else {
3370 // inspect cursor
3373 }
3374 } else if (cursorSelect) {
3375 // special case for select lanes
3377 // select lane cursor
3380 } else {
3381 // select cursor
3384 }
3385 } else if (cursorMoveElement) {
3386 // move cursor
3389 } else if (cursorDelete) {
3390 // delete cursor
3393 } else {
3394 // default cursor
3397 }
3398 }
3399}
3400
3401
3402int
3404 // udpdate drawing toggle
3405 if (myDrawingToggle > 10000) {
3406 myDrawingToggle = 0;
3407 } else {
3409 }
3410 // set default scale
3412 // calculate boundary extremes
3413 const float minB[2] = { (float)bound.xmin(), (float)bound.ymin() };
3414 const float maxB[2] = { (float)bound.xmax(), (float)bound.ymax() };
3415 // reset gl line to 1
3416 glLineWidth(1);
3417 // set drawing modes
3418 glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
3419 glEnable(GL_POLYGON_OFFSET_FILL);
3420 glEnable(GL_POLYGON_OFFSET_LINE);
3421 // draw all elements between minB and maxB, obtain objects included in minB and maxB
3422 return myGrid->Search(minB, maxB, *myVisualizationSettings);
3423}
3424
3425
3426void
3428 // depending of the visualizationSettings, enable or disable check box show grid
3430 // change show grid
3433 // change to true
3436 // update show grid buttons
3439 }
3440 // draw grid only in network and demand mode
3442 paintGLGrid();
3443 }
3444 } else {
3445 // change show grid
3448 // change to false
3451 // update show grid buttons
3454 }
3455 }
3456}
3457
3458
3459long
3460GNEViewNet::onCmdResetEdgeEndPoints(FXObject*, FXSelector, void*) {
3461 // Obtain junction under mouse
3463 if (junction) {
3464 myUndoList->begin(GUIIcon::EDGE, TL("reset edge endpoints"));
3465 // are, otherwise recompute them
3466 if (junction->isAttributeCarrierSelected()) {
3467 const auto selectedJunctions = myNet->getAttributeCarriers()->getSelectedJunctions();
3468 for (const auto& selectedJunction : selectedJunctions) {
3469 // reset shape end from incoming edges
3470 for (const auto& incomingEdge : selectedJunction->getGNEIncomingEdges()) {
3471 incomingEdge->setAttribute(GNE_ATTR_SHAPE_END, "", myUndoList);
3472 }
3473 // reset shape start from outgoing edges
3474 for (const auto& outgoingEdge : selectedJunction->getGNEOutgoingEdges()) {
3475 outgoingEdge->setAttribute(GNE_ATTR_SHAPE_START, "", myUndoList);
3476 }
3477 }
3478 } else {
3479 // reset shape end from incoming edges
3480 for (const auto& incomingEdge : junction->getGNEIncomingEdges()) {
3481 incomingEdge->setAttribute(GNE_ATTR_SHAPE_END, "", myUndoList);
3482 }
3483 // reset shape start from outgoing edges
3484 for (const auto& outgoingEdge : junction->getGNEOutgoingEdges()) {
3485 outgoingEdge->setAttribute(GNE_ATTR_SHAPE_START, "", myUndoList);
3486 }
3487 }
3488 myUndoList->end();
3489 }
3490 // destroy pop-up and set focus in view net
3491 destroyPopup();
3492 setFocus();
3493 return 1;
3494}
3495
3496
3497long
3498GNEViewNet::onCmdEditJunctionShape(FXObject*, FXSelector, void*) {
3499 // Obtain junction under mouse
3501 if (junction) {
3502 // check if network has to be updated
3503 if (junction->getNBNode()->getShape().size() == 0) {
3504 // recompute the whole network
3506 }
3507 // if grid is enabled, show warning
3509 WRITE_WARNING(TL("Grid is still active, press ctrl+g to deactivate"));
3510 }
3511 // start edit custom shape
3513 }
3514 // destroy pop-up and set focus in view net
3515 destroyPopup();
3516 setFocus();
3517 return 1;
3518}
3519
3520
3521long
3522GNEViewNet::onCmdResetJunctionShape(FXObject*, FXSelector, void*) {
3523 // Obtain junction under mouse
3525 if (junction) {
3526 // are, otherwise recompute them
3527 if (junction->isAttributeCarrierSelected()) {
3528 myUndoList->begin(junction, TL("reset custom junction shapes"));
3529 const auto selectedJunctions = myNet->getAttributeCarriers()->getSelectedJunctions();
3530 for (const auto& selectedJunction : selectedJunctions) {
3531 selectedJunction->setAttribute(SUMO_ATTR_SHAPE, "", myUndoList);
3532 }
3533 myUndoList->end();
3534 } else {
3535 myUndoList->begin(junction, TL("reset custom junction shape"));
3536 junction->setAttribute(SUMO_ATTR_SHAPE, "", myUndoList);
3537 myUndoList->end();
3538 }
3539 }
3540 // destroy pop-up and set focus in view net
3541 destroyPopup();
3542 setFocus();
3543 return 1;
3544}
3545
3546
3547long
3548GNEViewNet::onCmdReplaceJunction(FXObject*, FXSelector, void*) {
3550 if (junction != nullptr) {
3552 }
3553 // destroy pop-up and set focus in view net
3554 destroyPopup();
3555 setFocus();
3556 return 1;
3557}
3558
3559
3560long
3561GNEViewNet::onCmdSplitJunction(FXObject*, FXSelector, void*) {
3563 if (junction != nullptr) {
3564 myNet->splitJunction(junction, false, myUndoList);
3565 }
3566 // destroy pop-up and set focus in view net
3567 destroyPopup();
3568 setFocus();
3569 return 1;
3570}
3571
3572
3573long
3574GNEViewNet::onCmdSplitJunctionReconnect(FXObject*, FXSelector, void*) {
3576 if (junction != nullptr) {
3577 myNet->splitJunction(junction, true, myUndoList);
3578 }
3579 // destroy pop-up and set focus in view net
3580 destroyPopup();
3581 setFocus();
3582 return 1;
3583}
3584
3585long
3586GNEViewNet::onCmdSelectRoundabout(FXObject*, FXSelector, void*) {
3588 if (junction != nullptr) {
3589 myNet->selectRoundabout(junction, myUndoList);
3590 }
3591 // destroy pop-up and set focus in view net
3592 destroyPopup();
3593 setFocus();
3594 return 1;
3595}
3596
3597long
3598GNEViewNet::onCmdConvertRoundabout(FXObject*, FXSelector, void*) {
3600 if (junction != nullptr) {
3601 myNet->createRoundabout(junction, myUndoList);
3602 }
3603 // destroy pop-up and set focus in view net
3604 destroyPopup();
3605 setFocus();
3606 return 1;
3607}
3608
3609
3610long
3611GNEViewNet::onEnterConvertRoundabout(FXObject*, FXSelector, void*) {
3613 update();
3614 return 1;
3615}
3616
3617
3618long
3619GNEViewNet::onLeaveConvertRoundabout(FXObject*, FXSelector, void*) {
3621 update();
3622 return 1;
3623}
3624
3625
3626long
3627GNEViewNet::onCmdClearConnections(FXObject*, FXSelector, void*) {
3629 if (junction != nullptr) {
3630 // make sure we do not inspect the connection will it is being deleted
3633 }
3634 // make sure that connections isn't the front attribute
3635 const auto frontElements = myMarkFrontElements.getACs();
3636 for (const auto& AC : frontElements) {
3637 if (AC->getTagProperty().getTag() == SUMO_TAG_CONNECTION) {
3639 }
3640 }
3641 // check if we're handling a selection
3642 if (junction->isAttributeCarrierSelected()) {
3643 const auto selectedJunctions = myNet->getAttributeCarriers()->getSelectedJunctions();
3644 myUndoList->begin(GUIIcon::CONNECTION, TL("clear connections of selected junctions"));
3645 for (const auto& selectedJunction : selectedJunctions) {
3646 myNet->clearJunctionConnections(selectedJunction, myUndoList);
3647 }
3648 myUndoList->end();
3649 } else {
3651 }
3652 }
3653 // destroy pop-up and set focus in view net
3654 destroyPopup();
3655 setFocus();
3656 return 1;
3657}
3658
3659
3660long
3661GNEViewNet::onCmdResetConnections(FXObject*, FXSelector, void*) {
3663 if (junction != nullptr) {
3664 // make sure we do not inspect the connection will it is being deleted
3667 }
3668 // make sure that connections isn't the front attribute
3669 const auto frontElements = myMarkFrontElements.getACs();
3670 for (const auto& AC : frontElements) {
3671 if (AC->getTagProperty().getTag() == SUMO_TAG_CONNECTION) {
3673 }
3674 }
3675 // check if we're handling a selection
3676 if (junction->isAttributeCarrierSelected()) {
3677 const auto selectedJunctions = myNet->getAttributeCarriers()->getSelectedJunctions();
3678 myUndoList->begin(GUIIcon::CONNECTION, TL("reset connections of selected junctions"));
3679 for (const auto& selectedJunction : selectedJunctions) {
3680 myNet->resetJunctionConnections(selectedJunction, myUndoList);
3681 }
3682 myUndoList->end();
3683 } else {
3685 }
3686 }
3687 // destroy pop-up and set focus in view net
3688 destroyPopup();
3689 setFocus();
3690 return 1;
3691}
3692
3693
3694long
3695GNEViewNet::onCmdAddTLS(FXObject*, FXSelector, void*) {
3697 if (junction != nullptr) {
3698 // check if we're adding TLS in multiple junctions
3699 if (junction->isAttributeCarrierSelected()) {
3700 const auto selectedJunctions = myNet->getAttributeCarriers()->getSelectedJunctions();
3701 myNet->getViewNet()->getUndoList()->begin(GUIIcon::MODETLS, TL("add TLS in multiple junctions"));
3702 for (const auto& selectedJunction : selectedJunctions) {
3703 selectedJunction->setAttribute(SUMO_ATTR_TYPE, "traffic_light", myUndoList);
3704 }
3706 } else {
3707 // change junction type
3708 junction->setAttribute(SUMO_ATTR_TYPE, "traffic_light", myUndoList);
3709 // change to TLS Mode
3711 // set junction in TLS mode
3713 }
3714 }
3715 // destroy pop-up and set focus in view net
3716 destroyPopup();
3717 setFocus();
3718 return 1;
3719}
3720
3721
3722long
3723GNEViewNet::onCmdAddJoinTLS(FXObject*, FXSelector, void*) {
3725 if (junction != nullptr) {
3726 // check if we're adding TLS in multiple junctions
3727 if (junction->isAttributeCarrierSelected()) {
3728 myNet->getViewNet()->getUndoList()->begin(GUIIcon::MODETLS, TL("add TLS in multiple junctions"));
3729 }
3730 // change junction type
3731 junction->setAttribute(SUMO_ATTR_TYPE, "traffic_light", myUndoList);
3732 // if TLS was sucesfully created, apply the same TLID to other selected junctions
3733 if (junction->getAttribute(SUMO_ATTR_TLID).size() > 0) {
3734 const auto selectedJunctions = myNet->getAttributeCarriers()->getSelectedJunctions();
3735 // iterate over all selected junctions
3736 for (const auto& selectedJunction : selectedJunctions) {
3737 // check that doesn't have a TL
3738 if (selectedJunction->getNBNode()->getControllingTLS().empty()) {
3739 selectedJunction->setAttribute(SUMO_ATTR_TYPE, "traffic_light", myUndoList);
3740 selectedJunction->setAttribute(SUMO_ATTR_TLID, junction->getAttribute(SUMO_ATTR_TLID), myUndoList);
3741 }
3742 }
3743 }
3744 // rename traffic light
3745 if (junction->getNBNode()->getControllingTLS().size() > 0) {
3746 const auto TLSDef = (*junction->getNBNode()->getControllingTLS().begin());
3747 if (!myNet->getTLLogicCont().exist(TLSDef->getID() + "_joined")) {
3748 myUndoList->add(new GNEChange_TLS(junction, TLSDef, TLSDef->getID() + "_joined"), true);
3749 }
3750 }
3751 // end undoList
3752 if (junction->isAttributeCarrierSelected()) {
3754 }
3755 // change to TLS Mode
3757 // set junction in TLS mode
3759 }
3760 // destroy pop-up and set focus in view net
3761 destroyPopup();
3762 setFocus();
3763 return 1;
3764}
3765
3766long
3767GNEViewNet::onCmdEditConnectionShape(FXObject*, FXSelector, void*) {
3768 // Obtain connection under mouse
3770 if (connection) {
3772 }
3773 // if grid is enabled, show warning
3775 WRITE_WARNING(TL("Grid is still active, press ctrl+g to deactivate"));
3776 }
3777 // destroy pop-up and update view Net
3778 destroyPopup();
3779 setFocus();
3780 return 1;
3781}
3782
3783
3784long
3785GNEViewNet::onCmdSmoothConnectionShape(FXObject*, FXSelector, void*) {
3786 // Obtain connection under mouse
3788 if (connection) {
3789 connection->smootShape();
3790 }
3791 // destroy pop-up and update view Net
3792 destroyPopup();
3793 setFocus();
3794 return 1;
3795}
3796
3797
3798long
3799GNEViewNet::onCmdEditCrossingShape(FXObject*, FXSelector, void*) {
3800 // Obtain crossing under mouse
3802 if (crossing) {
3803 // check if network has to be updated
3804 if (crossing->getParentJunction()->getNBNode()->getShape().size() == 0) {
3805 // recompute the whole network
3807 }
3808 // if grid is enabled, show warning
3810 WRITE_WARNING(TL("Grid is still active, press ctrl+g to deactivate"));
3811 }
3812 // start edit custom shape
3814 }
3815 // destroy pop-up and update view Net
3816 destroyPopup();
3817 setFocus();
3818 return 1;
3819}
3820
3821
3822long
3823GNEViewNet::onCmdEditWalkingAreaShape(FXObject*, FXSelector, void*) {
3824 // Obtain walkingArea under mouse
3826 if (walkingArea) {
3827 // check if network has to be updated
3828 if (walkingArea->getParentJunction()->getNBNode()->getShape().size() == 0) {
3829 // recompute the whole network
3831 // if grid is enabled, show warning
3833 WRITE_WARNING(TL("Grid is still active, press ctrl+g to deactivate"));
3834 }
3835 }
3836 // start edit custom shape
3838 }
3839 // destroy pop-up and update view Net
3840 destroyPopup();
3841 setFocus();
3842 return 1;
3843}
3844
3845
3846long
3847GNEViewNet::onCmdToggleSelectEdges(FXObject*, FXSelector sel, void*) {
3848 // Toggle menuCheckSelectEdges
3851 } else {
3853 }
3855 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
3856 if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_SELECTEDGES)) {
3858 }
3859 return 1;
3860}
3861
3862
3863long
3864GNEViewNet::onCmdToggleShowConnections(FXObject*, FXSelector sel, void*) {
3865 // Toggle menuCheckShowConnections
3868 } else {
3870 }
3872 // if show was enabled, init GNEConnections
3875 }
3876 // change flag "showLane2Lane" in myVisualizationSettings
3878 // Hide/show connections require recompute
3880 // Update viewNet to show/hide connections
3881 updateViewNet();
3882 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
3883 if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_SHOWCONNECTIONS)) {
3885 }
3886 return 1;
3887}
3888
3889
3890long
3891GNEViewNet::onCmdToggleHideConnections(FXObject*, FXSelector sel, void*) {
3892 // Toggle menuCheckHideConnections
3895 } else {
3897 }
3899 // Update viewNet to show/hide connections
3900 updateViewNet();
3901 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
3902 if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_HIDECONNECTIONS)) {
3904 }
3905 return 1;
3906}
3907
3908
3909long
3910GNEViewNet::onCmdToggleShowAdditionalSubElements(FXObject*, FXSelector sel, void*) {
3911 // Toggle menuCheckShowAdditionalSubElements
3914 } else {
3916 }
3918 // Update viewNet to show/hide sub elements
3919 updateViewNet();
3920 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
3921 if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_SHOWSUBADDITIONALS)) {
3923 }
3924 return 1;
3925}
3926
3927
3928long
3929GNEViewNet::onCmdToggleShowTAZElements(FXObject*, FXSelector sel, void*) {
3930 // Toggle menuCheckShowAdditionalSubElements
3933 } else {
3935 }
3937 // Update viewNet to show/hide TAZ elements
3938 updateViewNet();
3939 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
3940 if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_SHOWTAZELEMENTS)) {
3942 }
3943 return 1;
3944}
3945
3946
3947long
3948GNEViewNet::onCmdToggleExtendSelection(FXObject*, FXSelector sel, void*) {
3949 // Toggle menuCheckExtendSelection
3952 } else {
3954 }
3956 // Only update view
3957 updateViewNet();
3958 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
3959 if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_EXTENDSELECTION)) {
3961 }
3962 return 1;
3963}
3964
3965
3966long
3967GNEViewNet::onCmdToggleChangeAllPhases(FXObject*, FXSelector sel, void*) {
3968 // Toggle menuCheckChangeAllPhases
3971 } else {
3973 }
3975 // Only update view
3976 updateViewNet();
3977 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
3978 if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_CHANGEALLPHASES)) {
3980 }
3981 return 1;
3982}
3983
3984
3985long
3986GNEViewNet::onCmdToggleShowGrid(FXObject*, FXSelector sel, void*) {
3987 // show or hide grid depending of myNetworkViewOptions.menuCheckToggleGrid
3992 } else {
3996 }
3999 // update view to show grid
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_TOGGLEGRID)) {
4004 } else if (sel == FXSEL(SEL_COMMAND, MID_GNE_DEMANDVIEWOPTIONS_SHOWGRID)) {
4006 }
4007 return 1;
4008}
4009
4010
4011long
4012GNEViewNet::onCmdToggleDrawJunctionShape(FXObject*, FXSelector sel, void*) {
4013 // toggle state
4015 // gui button has 'hide' semantics
4016 const bool hide = !myVisualizationSettings->drawJunctionShape;
4020
4024 // update view to show DrawJunctionShape
4025 updateViewNet();
4026 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4027 if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_TOGGLEDRAWJUNCTIONSHAPE)) {
4029 } else if (sel == FXSEL(SEL_COMMAND, MID_GNE_DEMANDVIEWOPTIONS_TOGGLEDRAWJUNCTIONSHAPE)) {
4031 } else if (sel == FXSEL(SEL_COMMAND, MID_GNE_DATAVIEWOPTIONS_TOGGLEDRAWJUNCTIONSHAPE)) {
4033 }
4034 return 1;
4035}
4036
4037long
4038GNEViewNet::onCmdToggleDrawSpreadVehicles(FXObject*, FXSelector sel, void*) {
4039 // Toggle menuCheckShowDemandElements
4044 } else {
4047 }
4050 // declare edge set
4051 std::set<GNEEdge*> edgesToUpdate;
4052 // compute vehicle geometry
4053 for (const auto& vehicle : myNet->getAttributeCarriers()->getDemandElements().at(SUMO_TAG_VEHICLE)) {
4054 if (vehicle.second->getParentEdges().size() > 0) {
4055 edgesToUpdate.insert(vehicle.second->getParentEdges().front());
4056 } else if (vehicle.second->getChildDemandElements().size() > 0 && (vehicle.second->getChildDemandElements().front()->getTagProperty().getTag() == GNE_TAG_ROUTE_EMBEDDED)) {
4057 edgesToUpdate.insert(vehicle.second->getChildDemandElements().front()->getParentEdges().front());
4058 }
4059 }
4060 for (const auto& routeFlow : myNet->getAttributeCarriers()->getDemandElements().at(GNE_TAG_FLOW_ROUTE)) {
4061 if (routeFlow.second->getParentEdges().size() > 0) {
4062 edgesToUpdate.insert(routeFlow.second->getParentEdges().front());
4063 } else if (routeFlow.second->getChildDemandElements().size() > 0 && (routeFlow.second->getChildDemandElements().front()->getTagProperty().getTag() == GNE_TAG_ROUTE_EMBEDDED)) {
4064 edgesToUpdate.insert(routeFlow.second->getChildDemandElements().front()->getParentEdges().front());
4065 }
4066 }
4067 for (const auto& trip : myNet->getAttributeCarriers()->getDemandElements().at(SUMO_TAG_TRIP)) {
4068 if (trip.second->getParentEdges().size() > 0) {
4069 edgesToUpdate.insert(trip.second->getParentEdges().front());
4070 }
4071 }
4072 for (const auto& flow : myNet->getAttributeCarriers()->getDemandElements().at(SUMO_TAG_FLOW)) {
4073 if (flow.second->getParentEdges().size() > 0) {
4074 edgesToUpdate.insert(flow.second->getParentEdges().front());
4075 }
4076 }
4077 // update spread geometries of all edges
4078 for (const auto& edge : edgesToUpdate) {
4079 edge->updateVehicleSpreadGeometries();
4080 }
4081 // update view to show new vehicles positions
4082 updateViewNet();
4083 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4084 if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_DRAWSPREADVEHICLES)) {
4086 } else if (sel == FXSEL(SEL_COMMAND, MID_GNE_DEMANDVIEWOPTIONS_DRAWSPREADVEHICLES)) {
4088 }
4089 return 1;
4090}
4091
4092
4093long
4094GNEViewNet::onCmdToggleWarnAboutMerge(FXObject*, FXSelector sel, void*) {
4095 // Toggle menuCheckWarnAboutMerge
4098 } else {
4100 }
4102 // Only update view
4103 updateViewNet();
4104 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4105 if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_ASKFORMERGE)) {
4107 }
4108 return 1;
4109}
4110
4111
4112long
4113GNEViewNet::onCmdToggleShowJunctionBubbles(FXObject*, FXSelector sel, void*) {
4114 // Toggle menuCheckShowJunctionBubble
4117 } else {
4119 }
4121 // Only update view
4122 updateViewNet();
4123 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4124 if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_SHOWBUBBLES)) {
4126 }
4127 return 1;
4128}
4129
4130
4131long
4132GNEViewNet::onCmdToggleMoveElevation(FXObject*, FXSelector sel, void*) {
4133 // Toggle menuCheckMoveElevation
4136 } else {
4138 }
4140 // Only update view
4141 updateViewNet();
4142 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4143 if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_MOVEELEVATION)) {
4145 }
4146 return 1;
4147}
4148
4149
4150long
4151GNEViewNet::onCmdToggleChainEdges(FXObject*, FXSelector sel, void*) {
4152 // Toggle menuCheckMoveElevation
4155 } else {
4157 }
4159 // Only update view
4160 updateViewNet();
4161 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4162 if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_CHAINEDGES)) {
4164 }
4165 return 1;
4166}
4167
4168
4169long
4170GNEViewNet::onCmdToggleAutoOppositeEdge(FXObject*, FXSelector sel, void*) {
4171 // Toggle menuCheckAutoOppositeEdge
4174 } else {
4176 }
4178 // Only update view
4179 updateViewNet();
4180 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4181 if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_AUTOOPPOSITEEDGES)) {
4183 }
4184 return 1;
4185}
4186
4187
4188long
4190 // Toggle menuCheckHideNonInspectedDemandElements
4193 } else {
4195 }
4197 // Only update view
4198 updateViewNet();
4199 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4200 if (sel == FXSEL(SEL_COMMAND, MID_GNE_DEMANDVIEWOPTIONS_HIDENONINSPECTED)) {
4202 }
4203 return 1;
4204}
4205
4206
4207long
4208GNEViewNet::onCmdToggleShowOverlappedRoutes(FXObject*, FXSelector sel, void*) {
4209 // Toggle menuCheckShowOverlappedRoutes
4212 } else {
4214 }
4216 // Only update view
4217 updateViewNet();
4218 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4219 if (sel == FXSEL(SEL_COMMAND, MID_GNE_DEMANDVIEWOPTIONS_SHOWOVERLAPPEDROUTES)) {
4221 }
4222 return 1;
4223}
4224
4225
4226long
4227GNEViewNet::onCmdToggleHideShapes(FXObject*, FXSelector sel, void*) {
4228 // Toggle menuCheckHideShapes
4231 } else {
4233 }
4235 // Only update view
4236 updateViewNet();
4237 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4238 if (sel == FXSEL(SEL_COMMAND, MID_GNE_DEMANDVIEWOPTIONS_HIDESHAPES)) {
4240 }
4241 return 1;
4242}
4243
4244
4245long
4246GNEViewNet::onCmdToggleShowTrips(FXObject*, FXSelector sel, void*) {
4247 // Toggle menuCheckHideShapes
4250 } else {
4252 }
4254 // Only update view
4255 updateViewNet();
4256 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4257 if (sel == FXSEL(SEL_COMMAND, MID_GNE_DEMANDVIEWOPTIONS_SHOWTRIPS)) {
4259 }
4260 return 1;
4261}
4262
4263
4264long
4265GNEViewNet::onCmdToggleShowAllPersonPlans(FXObject*, FXSelector sel, void*) {
4266 // Toggle menuCheckShowAllPersonPlans
4269 } else {
4271 }
4273 // Only update view
4274 updateViewNet();
4275 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4276 if (sel == FXSEL(SEL_COMMAND, MID_GNE_DEMANDVIEWOPTIONS_SHOWALLPERSONPLANS)) {
4278 }
4279 return 1;
4280}
4281
4282
4283long
4284GNEViewNet::onCmdToggleLockPerson(FXObject*, FXSelector sel, void*) {
4285 // Toggle menuCheckLockPerson
4290 }
4292 // lock or unlock current inspected person depending of menuCheckLockPerson value
4294 // obtain locked person or person plan
4295 const GNEDemandElement* personOrPersonPlan = dynamic_cast<const GNEDemandElement*>(myInspectedElements.getFirstAC());
4296 if (personOrPersonPlan) {
4297 // lock person depending if casted demand element is either a person or a person plan
4298 if (personOrPersonPlan->getTagProperty().isPerson()) {
4299 myDemandViewOptions.lockPerson(personOrPersonPlan);
4300 } else {
4301 myDemandViewOptions.lockPerson(personOrPersonPlan->getParentDemandElements().front());
4302 }
4303 }
4304 } else {
4305 // unlock current person
4307 }
4308 // update view
4309 updateViewNet();
4310 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4311 if (sel == FXSEL(SEL_COMMAND, MID_GNE_DEMANDVIEWOPTIONS_LOCKPERSON)) {
4313 }
4314 return 1;
4315}
4316
4317
4318long
4319GNEViewNet::onCmdToggleShowAllContainerPlans(FXObject*, FXSelector sel, void*) {
4320 // Toggle menuCheckShowAllContainerPlans
4323 } else {
4325 }
4327 // Only update view
4328 updateViewNet();
4329 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4330 if (sel == FXSEL(SEL_COMMAND, MID_GNE_DEMANDVIEWOPTIONS_SHOWALLCONTAINERPLANS)) {
4332 }
4333 return 1;
4334}
4335
4336
4337long
4338GNEViewNet::onCmdToggleLockContainer(FXObject*, FXSelector sel, void*) {
4339 // Toggle menuCheckLockContainer
4344 }
4346 // lock or unlock current inspected container depending of menuCheckLockContainer value
4348 // obtain locked container or container plan
4349 const GNEDemandElement* containerOrContainerPlan = dynamic_cast<const GNEDemandElement*>(myInspectedElements.getFirstAC());
4350 if (containerOrContainerPlan) {
4351 // lock container depending if casted demand element is either a container or a container plan
4352 if (containerOrContainerPlan->getTagProperty().isContainer()) {
4353 myDemandViewOptions.lockContainer(containerOrContainerPlan);
4354 } else {
4355 myDemandViewOptions.lockContainer(containerOrContainerPlan->getParentDemandElements().front());
4356 }
4357 }
4358 } else {
4359 // unlock current container
4361 }
4362 // update view
4363 updateViewNet();
4364 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4365 if (sel == FXSEL(SEL_COMMAND, MID_GNE_DEMANDVIEWOPTIONS_LOCKCONTAINER)) {
4367 }
4368 return 1;
4369}
4370
4371
4372long
4373GNEViewNet::onCmdToggleShowAdditionals(FXObject*, FXSelector sel, void*) {
4374 // Toggle menuCheckShowAdditionals
4377 } else {
4379 }
4381 // Only update view
4382 updateViewNet();
4383 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4384 if (sel == FXSEL(SEL_COMMAND, MID_GNE_DATAVIEWOPTIONS_SHOWADDITIONALS)) {
4386 }
4387 return 1;
4388}
4389
4390
4391long
4392GNEViewNet::onCmdToggleShowShapes(FXObject*, FXSelector sel, void*) {
4393 // Toggle menuCheckShowShapes
4396 } else {
4398 }
4400 // Only update view
4401 updateViewNet();
4402 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4403 if (sel == FXSEL(SEL_COMMAND, MID_GNE_DATAVIEWOPTIONS_SHOWSHAPES)) {
4405 }
4406 return 1;
4407}
4408
4409
4410long
4411GNEViewNet::onCmdToggleShowDemandElementsNetwork(FXObject*, FXSelector sel, void*) {
4412 // Toggle menuCheckShowDemandElements
4415 } else {
4417 }
4419 // compute demand elements
4421 // update view to show demand elements
4422 updateViewNet();
4423 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4424 if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_SHOWDEMANDELEMENTS)) {
4426 }
4427 return 1;
4428}
4429
4430
4431long
4432GNEViewNet::onCmdToggleShowDemandElementsData(FXObject*, FXSelector sel, void*) {
4433 // Toggle menuCheckShowDemandElements
4436 } else {
4438 }
4440 // compute demand elements
4442 // update view to show demand elements
4443 updateViewNet();
4444 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4445 if (sel == FXSEL(SEL_COMMAND, MID_GNE_DATAVIEWOPTIONS_SHOWDEMANDELEMENTS)) {
4447 }
4448 return 1;
4449}
4450
4451
4452long
4453GNEViewNet::onCmdToggleTAZRelDrawing(FXObject*, FXSelector sel, void*) {
4454 // Toggle menuCheckShowDemandElements
4457 } else {
4459 }
4461 // update view to show demand elements
4462 updateViewNet();
4463 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4464 if (sel == FXSEL(SEL_COMMAND, MID_GNE_DATAVIEWOPTIONS_TAZRELDRAWING)) {
4466 }
4467 return 1;
4468}
4469
4470
4471long
4472GNEViewNet::onCmdToggleTAZDrawFill(FXObject*, FXSelector sel, void*) {
4473 // Toggle menuCheckShowDemandElements
4476 } else {
4478 }
4480 // update view to show demand elements
4481 updateViewNet();
4482 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4483 if (sel == FXSEL(SEL_COMMAND, MID_GNE_DATAVIEWOPTIONS_TAZDRAWFILL)) {
4485 }
4486 return 1;
4487}
4488
4489
4490long
4491GNEViewNet::onCmdToggleTAZRelOnlyFrom(FXObject*, FXSelector sel, void*) {
4492 // Toggle menuCheckShowDemandElements
4495 } else {
4497 }
4499 // update view to show demand elements
4500 updateViewNet();
4501 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4502 if (sel == FXSEL(SEL_COMMAND, MID_GNE_DATAVIEWOPTIONS_TAZRELONLYFROM)) {
4504 }
4505 return 1;
4506}
4507
4508
4509long
4510GNEViewNet::onCmdToggleTAZRelOnlyTo(FXObject*, FXSelector sel, void*) {
4511 // Toggle menuCheckShowDemandElements
4514 } else {
4516 }
4518 // update view to show demand elements
4519 updateViewNet();
4520 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4521 if (sel == FXSEL(SEL_COMMAND, MID_GNE_DATAVIEWOPTIONS_TAZRELONLYTO)) {
4523 }
4524 return 1;
4525}
4526
4527
4528long
4529GNEViewNet::onCmdIntervalBarGenericDataType(FXObject*, FXSelector, void*) {
4531 return 1;
4532}
4533
4534
4535long
4536GNEViewNet::onCmdIntervalBarDataSet(FXObject*, FXSelector, void*) {
4538 return 1;
4539}
4540
4541
4542long
4543GNEViewNet::onCmdIntervalBarLimit(FXObject*, FXSelector, void*) {
4545 return 1;
4546}
4547
4548
4549long
4550GNEViewNet::onCmdIntervalBarSetBegin(FXObject*, FXSelector, void*) {
4552 return 1;
4553}
4554
4555
4556long
4557GNEViewNet::onCmdIntervalBarSetEnd(FXObject*, FXSelector, void*) {
4559 return 1;
4560}
4561
4562
4563long
4564GNEViewNet::onCmdIntervalBarSetParameter(FXObject*, FXSelector, void*) {
4566 return 1;
4567}
4568
4569
4570long
4571GNEViewNet::onCmdAddSelected(FXObject*, FXSelector, void*) {
4572 // only select if AC under cursor isn't previously selected
4574 if (AC && !AC->isAttributeCarrierSelected()) {
4576 }
4577 return 1;
4578}
4579
4580
4581long
4582GNEViewNet::onCmdRemoveSelected(FXObject*, FXSelector, void*) {
4583 // only unselect if AC under cursor isn't previously selected
4585 if (AC && AC->isAttributeCarrierSelected()) {
4587 }
4588 return 1;
4589}
4590
4591
4592long
4593GNEViewNet::onCmdAddEdgeSelected(FXObject*, FXSelector, void*) {
4594 // only select if edge under cursor isn't previously selected
4595 auto edge = myViewObjectsSelector.getEdgeFront();
4596 if (edge && !edge->isAttributeCarrierSelected()) {
4597 edge->selectAttributeCarrier();
4598 }
4599 return 1;
4600}
4601
4602
4603long
4604GNEViewNet::onCmdRemoveEdgeSelected(FXObject*, FXSelector, void*) {
4605 // only unselect if edge under cursor isn't previously selected
4606 auto edge = myViewObjectsSelector.getEdgeFront();
4607 if (edge && edge->isAttributeCarrierSelected()) {
4609 }
4610 return 1;
4611}
4612
4613
4614long
4615GNEViewNet::onCmdSetNeteditView(FXObject*, FXSelector sel, void*) {
4616 myEditModes.setView(FXSELID(sel));
4617 update();
4618 return 1;
4619}
4620
4621// ===========================================================================
4622// private
4623// ===========================================================================
4624
4625void
4627 // build supermode buttons
4629
4630 // build save elements buttons
4632
4633 // build time switch buttons
4635
4636 // build menu checks for Common checkable buttons
4638
4639 // build menu checks for Network checkable buttons
4641
4642 // build menu checks for Demand checkable buttons
4644
4645 // build menu checks of view options Data
4647
4648 // Create Vertical separator
4650 // XXX for some reason the vertical groove is not visible. adding more spacing to emphasize the separation
4653
4654 // build menu checks of view options Network
4656
4657 // build menu checks of view options Demand
4659
4660 // build menu checks of view options Data
4662
4663 // build interval bar
4665}
4666
4667
4668void
4670 // get menu checks
4672 // hide all checkbox of view options Network
4674 // hide all checkbox of view options Demand
4676 // hide all checkbox of view options Data
4678 // disable all common edit modes
4680 // disable all network edit modes
4682 // disable all network edit modes
4684 // hide interval bar
4686 // hide all frames
4688 // hide all menuchecks
4692 // In network mode, always show option "show grid", "draw spread vehicles" and "show demand elements"
4697 menuChecks.menuCheckToggleGrid->show();
4698 menuChecks.menuCheckToggleDrawJunctionShape->show();
4699 menuChecks.menuCheckDrawSpreadVehicles->show();
4700 menuChecks.menuCheckShowDemandElements->show();
4701 // show separator
4702 menuChecks.separator->show();
4703 // enable selected controls
4704 switch (myEditModes.networkEditMode) {
4705 // common modes
4711 // show view options
4716 // show menu checks
4717 menuChecks.menuCheckSelectEdges->show();
4718 menuChecks.menuCheckShowConnections->show();
4719 menuChecks.menuCheckShowAdditionalSubElements->show();
4720 menuChecks.menuCheckShowTAZElements->show();
4721 // update lock menu bar
4723 // show
4724 break;
4733 // show view options
4736 menuChecks.menuCheckShowAdditionalSubElements->show();
4737 menuChecks.menuCheckShowTAZElements->show();
4738 // show menu checks
4739 menuChecks.menuCheckSelectEdges->show();
4740 menuChecks.menuCheckShowConnections->show();
4741 break;
4747 // show view options
4753 // show menu checks
4754 menuChecks.menuCheckSelectEdges->show();
4755 menuChecks.menuCheckShowConnections->show();
4756 menuChecks.menuCheckExtendSelection->show();
4757 menuChecks.menuCheckShowAdditionalSubElements->show();
4758 menuChecks.menuCheckShowTAZElements->show();
4759 break;
4760 // specific modes
4766 // show view options
4769 // show menu checks
4770 menuChecks.menuCheckChainEdges->show();
4771 menuChecks.menuCheckAutoOppositeEdge->show();
4772 break;
4778 // show view options
4782 // show menu checks
4783 menuChecks.menuCheckWarnAboutMerge->show();
4784 menuChecks.menuCheckShowJunctionBubble->show();
4785 menuChecks.menuCheckMoveElevation->show();
4786 break;
4792 break;
4798 // show view options
4800 // show menu checks
4801 menuChecks.menuCheckChangeAllPhases->show();
4802 break;
4808 // show view options
4810 // show menu checks
4811 menuChecks.menuCheckShowAdditionalSubElements->show();
4812 break;
4818 break;
4824 break;
4830 break;
4836 break;
4842 break;
4848 break;
4849 default:
4850 break;
4851 }
4852 // update menuChecks shorcuts
4853 menuChecks.updateShortcuts();
4854 // update common Network buttons
4856 // Update Network buttons
4858 // recalc toolbar
4861 // force repaint because different modes draw different things
4862 onPaint(nullptr, 0, nullptr);
4863 // finally update view
4864 updateViewNet();
4865}
4866
4867
4868void
4870 // get menu checks
4872 // hide all checkbox of view options Network
4874 // hide all checkbox of view options Demand
4876 // hide all checkbox of view options Data
4878 // disable all common edit modes
4880 // disable all Demand edit modes
4882 // disable all network edit modes
4884 // hide interval bar
4886 // hide all frames
4888 // hide all menuchecks
4892 // always show "hide shapes", "show grid", "draw spread vehicles", "show overlapped routes" and show/lock persons and containers
4903 menuChecks.menuCheckToggleGrid->show();
4904 menuChecks.menuCheckToggleDrawJunctionShape->show();
4905 menuChecks.menuCheckDrawSpreadVehicles->show();
4906 menuChecks.menuCheckHideShapes->show();
4907 menuChecks.menuCheckShowAllTrips->show();
4908 menuChecks.menuCheckShowAllPersonPlans->show();
4909 menuChecks.menuCheckLockPerson->show();
4910 menuChecks.menuCheckShowAllContainerPlans->show();
4911 menuChecks.menuCheckLockContainer->show();
4912 menuChecks.menuCheckShowOverlappedRoutes->show();
4913 // show separator
4914 menuChecks.separator->show();
4915 // enable selected controls
4916 switch (myEditModes.demandEditMode) {
4917 // common modes
4922 // set checkable button
4924 // show view options
4926 // show menu checks
4927 menuChecks.menuCheckHideNonInspectedDemandElements->show();
4928 break;
4933 // set checkable button
4935 break;
4940 // set checkable button
4942 break;
4947 // set checkable button
4949 break;
4950 // specific modes
4955 // set checkable button
4957 break;
4962 // set checkable button
4964 break;
4969 // set checkable button
4971 break;
4976 // set checkable button
4978 break;
4983 // set checkable button
4985 break;
4990 // set checkable button
4992 break;
4997 // set checkable button
4999 break;
5004 // set checkable button
5006 break;
5011 // set checkable button
5013 break;
5018 // set checkable button
5020 break;
5021 default:
5022 break;
5023 }
5024 // update menuChecks shorcuts
5025 menuChecks.updateShortcuts();
5026 // update common Network buttons
5028 // Update Demand buttons
5030 // recalc toolbar
5033 // force repaint because different modes draw different things
5034 onPaint(nullptr, 0, nullptr);
5035 // finally update view
5036 updateViewNet();
5037}
5038
5039
5040void
5042 // get menu checks
5044 // hide all checkbox of view options Network
5046 // hide all checkbox of view options Demand
5048 // hide all checkbox of view options Data
5050 // disable all common edit modes
5052 // disable all Data edit modes
5054 // show interval bar
5056 // hide all frames
5058 // hide all menuchecks
5062 // In data mode, always show options for show elements
5067 menuChecks.menuCheckToggleDrawJunctionShape->show();
5068 menuChecks.menuCheckShowAdditionals->show();
5069 menuChecks.menuCheckShowShapes->show();
5070 menuChecks.menuCheckShowDemandElements->show();
5071 // show separator
5072 menuChecks.separator->show();
5073 // enable selected controls
5074 switch (myEditModes.dataEditMode) {
5075 // common modes
5080 // set checkable button
5082 // show view option
5087 // show menu check
5088 menuChecks.menuCheckToggleTAZRelDrawing->show();
5089 menuChecks.menuCheckToggleTAZDrawFill->show();
5090 menuChecks.menuCheckToggleTAZRelOnlyFrom->show();
5091 menuChecks.menuCheckToggleTAZRelOnlyTo->show();
5092 break;
5097 // set checkable button
5099 // show toggle TAZRel drawing view option
5103 // show toggle TAZRel drawing menu check
5104 menuChecks.menuCheckToggleTAZRelDrawing->show();
5105 menuChecks.menuCheckToggleTAZRelOnlyFrom->show();
5106 menuChecks.menuCheckToggleTAZRelOnlyTo->show();
5107 break;
5112 // set checkable button
5114 // show toggle TAZRel drawing view option
5118 // show toggle TAZRel drawing menu check
5119 menuChecks.menuCheckToggleTAZRelDrawing->show();
5120 menuChecks.menuCheckToggleTAZRelOnlyFrom->show();
5121 menuChecks.menuCheckToggleTAZRelOnlyTo->show();
5122 break;
5127 // set checkable button
5129 break;
5134 // set checkable button
5136 break;
5141 // set checkable button
5143 // show view option
5148 // show menu check
5149 menuChecks.menuCheckToggleTAZRelDrawing->show();
5150 menuChecks.menuCheckToggleTAZDrawFill->show();
5151 menuChecks.menuCheckToggleTAZRelOnlyFrom->show();
5152 menuChecks.menuCheckToggleTAZRelOnlyTo->show();
5153 break;
5158 // set checkable button
5160 break;
5161 default:
5162 break;
5163 }
5164 // update menuChecks shorcuts
5165 menuChecks.updateShortcuts();
5166 // update common Network buttons
5168 // Update Data buttons
5170 // recalc toolbar
5173 // force repaint because different modes draw different things
5174 onPaint(nullptr, 0, nullptr);
5175 // finally update view
5176 updateViewNet();
5177}
5178
5179
5180void
5182 if (AC->getTagProperty().getTag() == SUMO_TAG_JUNCTION) {
5183 // get junction (note: could be already removed if is a child, then hardfail=false)
5184 GNEJunction* junction = myNet->getAttributeCarriers()->retrieveJunction(AC->getID(), false);
5185 // if exist, remove it
5186 if (junction) {
5187 myNet->deleteJunction(junction, myUndoList);
5188 }
5189 } else if (AC->getTagProperty().getTag() == SUMO_TAG_CROSSING) {
5190 // get crossing (note: could be already removed if is a child, then hardfail=false)
5192 // if exist, remove it
5193 if (crossing) {
5194 myNet->deleteCrossing(crossing, myUndoList);
5195 }
5196 } else if (AC->getTagProperty().getTag() == SUMO_TAG_EDGE) {
5197 // get edge (note: could be already removed if is a child, then hardfail=false)
5198 GNEEdge* edge = myNet->getAttributeCarriers()->retrieveEdge(AC->getID(), false);
5199 // if exist, remove it
5200 if (edge) {
5201 myNet->deleteEdge(edge, myUndoList, false);
5202 }
5203 } else if (AC->getTagProperty().getTag() == SUMO_TAG_LANE) {
5204 // get lane (note: could be already removed if is a child, then hardfail=false)
5206 // if exist, remove it
5207 if (lane) {
5208 myNet->deleteLane(lane, myUndoList, false);
5209 }
5210 } else if (AC->getTagProperty().getTag() == SUMO_TAG_CONNECTION) {
5211 // get connection (note: could be already removed if is a child, then hardfail=false)
5213 // if exist, remove it
5214 if (connection) {
5215 myNet->deleteConnection(connection, myUndoList);
5216 }
5217 } else if (AC->getTagProperty().isAdditionalElement()) {
5218 // get additional Element (note: could be already removed if is a child, then hardfail=false)
5219 GNEAdditional* additionalElement = myNet->getAttributeCarriers()->retrieveAdditional(AC->getGUIGlObject(), false);
5220 // if exist, remove it
5221 if (additionalElement) {
5222 myNet->deleteAdditional(additionalElement, myUndoList);
5223 }
5224 }
5225}
5226
5227
5228void
5230 // get demand Element (note: could be already removed if is a child, then hardfail=false)
5232 // if exist, remove it
5233 if (demandElement) {
5234 myNet->deleteDemandElement(demandElement, myUndoList);
5235 }
5236}
5237
5238
5239void
5241 if (AC->getTagProperty().getTag() == SUMO_TAG_DATASET) {
5242 // get data set (note: could be already removed if is a child, then hardfail=false)
5243 GNEDataSet* dataSet = myNet->getAttributeCarriers()->retrieveDataSet(AC->getID(), false);
5244 // if exist, remove it
5245 if (dataSet) {
5246 myNet->deleteDataSet(dataSet, myUndoList);
5247 }
5248 } else if (AC->getTagProperty().getTag() == SUMO_TAG_DATAINTERVAL) {
5249 // get data interval (note: could be already removed if is a child, then hardfail=false)
5250 GNEDataInterval* dataInterval = myNet->getAttributeCarriers()->retrieveDataInterval(AC, false);
5251 // if exist, remove it
5252 if (dataInterval) {
5253 myNet->deleteDataInterval(dataInterval, myUndoList);
5254 }
5255 } else {
5256 // get generic data (note: could be already removed if is a child, then hardfail=false)
5258 // if exist, remove it
5259 if (genericData) {
5260 myNet->deleteGenericData(genericData, myUndoList);
5261 }
5262 }
5263}
5264
5265
5266void
5269 switch (myEditModes.networkEditMode) {
5271 myViewParent->getInspectorFrame()->update();
5272 break;
5273 default:
5274 break;
5275 }
5276 }
5278 switch (myEditModes.demandEditMode) {
5280 myViewParent->getInspectorFrame()->update();
5281 break;
5284 break;
5287 break;
5290 break;
5293 break;
5296 break;
5299 break;
5302 break;
5305 break;
5308 break;
5309 default:
5310 break;
5311 }
5312 }
5314 switch (myEditModes.dataEditMode) {
5316 myViewParent->getInspectorFrame()->update();
5317 break;
5318 default:
5319 break;
5320 }
5321 // update data interval
5323 }
5324 // update view
5325 updateViewNet();
5326}
5327
5328// ---------------------------------------------------------------------------
5329// Private methods
5330// ---------------------------------------------------------------------------
5331
5332void
5334 PositionVector temporalShape;
5335 bool deleteLastCreatedPoint = false;
5336 // obtain temporal shape and delete last created point flag
5343 }
5344 // check if we're in drawing mode
5345 if (temporalShape.size() > 0) {
5346 // draw blue line with the current drawed shape
5348 glLineWidth(2);
5349 glTranslated(0, 0, GLO_TEMPORALSHAPE);
5351 GLHelper::drawLine(temporalShape);
5353 // draw red line from the last point of shape to the current mouse position
5355 glLineWidth(2);
5356 glTranslated(0, 0, GLO_TEMPORALSHAPE);
5357 // draw last line depending if shift key (delete last created point) is pressed
5358 if (deleteLastCreatedPoint) {
5360 } else {
5362 }
5365 }
5366}
5367
5368
5369void
5371 // first check if we're in correct mode
5376 // get mouse position
5377 const Position mousePosition = snapToActiveGrid(getPositionInformation());
5378 // get junction exaggeration
5379 const double junctionExaggeration = myVisualizationSettings->junctionSize.getExaggeration(*myVisualizationSettings, nullptr, 4);
5380 // get bubble color
5382 // change alpha
5383 bubbleColor.setAlpha(200);
5384 // push layer matrix
5386 // translate to temporal shape layer
5387 glTranslated(0, 0, GLO_TEMPORALSHAPE);
5388 // push junction matrix
5390 // move matrix junction center
5391 glTranslated(mousePosition.x(), mousePosition.y(), 0.1);
5392 // set color
5393 GLHelper::setColor(bubbleColor);
5394 // draw outline circle
5395 const double circleWidth = myVisualizationSettings->neteditSizeSettings.junctionBubbleRadius * junctionExaggeration;
5396 GLHelper::drawOutlineCircle(circleWidth, circleWidth * 0.75, 32);
5397 // pop junction matrix
5399 // draw temporal edge
5401 // set temporal edge color
5402 RGBColor temporalEdgeColor = RGBColor::BLACK;
5403 temporalEdgeColor.setAlpha(200);
5404 // declare temporal edge geometry
5405 GUIGeometry temporalEdgeGeometry;
5406 // calculate geometry between source junction and mouse position
5407 PositionVector temporalEdge = {mousePosition, myViewParent->getCreateEdgeFrame()->getJunctionSource()->getPositionInView()};
5408 // move temporal edge 2 side
5409 temporalEdge.move2side(-1);
5410 // update geometry
5411 temporalEdgeGeometry.updateGeometry(temporalEdge);
5412 // push temporal edge matrix
5414 // set color
5415 GLHelper::setColor(temporalEdgeColor);
5416 // draw temporal edge
5418 // check if we have to draw opposite edge
5420 // move temporal edge to opposite edge
5421 temporalEdge.move2side(2);
5422 // update geometry
5423 temporalEdgeGeometry.updateGeometry(temporalEdge);
5424 // draw temporal edge
5426 }
5427 // pop temporal edge matrix
5429 }
5430 // pop layer matrix
5432 }
5433}
5434
5435
5436void
5438 // first check if we're in correct mode
5443 (gViewObjectsHandler.markedEdge != nullptr)) {
5444 // calculate split position
5445 const auto lane = gViewObjectsHandler.markedEdge->getLanes().back();
5446 auto shape = lane->getLaneShape();
5447 // move shape to side
5448 shape.move2side(lane->getDrawingConstants()->getDrawingWidth() * -1);
5449 const auto offset = shape.nearest_offset_to_point2D(snapToActiveGrid(getPositionInformation()));
5450 const auto splitPosition = shape.positionAtOffset2D(offset);
5451 // get junction exaggeration
5452 const double junctionExaggeration = myVisualizationSettings->junctionSize.getExaggeration(*myVisualizationSettings, nullptr, 4);
5453 // get bubble color
5455 // push layer matrix
5457 // translate to temporal shape layer
5458 glTranslated(0, 0, GLO_TEMPORALSHAPE);
5459 // push junction matrix
5461 // move matrix junction center
5462 glTranslated(splitPosition.x(), splitPosition.y(), 0.1);
5463 // set color
5464 GLHelper::setColor(bubbleColor);
5465 // draw outline circle
5466 const double circleWidth = myVisualizationSettings->neteditSizeSettings.junctionBubbleRadius * junctionExaggeration;
5467 GLHelper::drawOutlineCircle(circleWidth, circleWidth * 0.75, 32);
5468 // draw filled circle
5470 // pop junction matrix
5472 // pop layer matrix
5474 }
5475}
5476
5477
5478void
5480 // check conditions
5481 if ((myCurrentObjectsDialog.size() > 0) && (myCurrentObjectsDialog.front()->getType() == GLO_JUNCTION) && myDrawPreviewRoundabout) {
5482 // get junction
5483 const auto junction = myNet->getAttributeCarriers()->retrieveJunction(myCurrentObjectsDialog.front()->getMicrosimID());
5484 // push layer matrix
5486 // translate to temporal shape layer
5487 glTranslated(0, 0, GLO_TEMPORALSHAPE);
5488 // push junction matrix
5490 // move matrix junction center
5491 glTranslated(junction->getNBNode()->getPosition().x(), junction->getNBNode()->getPosition().y(), 0.1);
5492 // set color
5494 // draw outline circle
5495 const double circleWidth = (junction->getNBNode()->getRadius() < 0) ? 4.0 : junction->getNBNode()->getRadius();
5496 GLHelper::drawOutlineCircle(circleWidth * 1.30, circleWidth, 32);
5497 // pop junction matrix
5499 // pop layer matrix
5501 }
5502}
5503
5504
5505void
5507 // check conditions
5509 // get junction
5511 // push layer matrix
5513 // translate to TLLogic
5514 glTranslated(0, 0, GLO_TEMPORALSHAPE);
5515 // iterate over all E1 detectors
5516 for (const auto& E1ID : myViewParent->getTLSEditorFrame()->getTLSAttributes()->getE1Detectors()) {
5517 // first check if E1 exists
5518 const auto E1 = myNet->getAttributeCarriers()->retrieveAdditional(SUMO_TAG_INDUCTION_LOOP, E1ID.second, false);
5519 if (E1) {
5520 // push line matrix
5522 // draw line between junction and E1
5523 GUIGeometry::drawChildLine(*myVisualizationSettings, junctionPos, E1->getPositionInView(),
5525 // pop line matrix
5527 }
5528 }
5529 // pop layer matrix
5531 }
5532}
5533
5534
5535void
5537 // check conditions
5539 // get junction
5541 // push layer matrix
5543 // translate to TLLogic
5544 glTranslated(0, 0, GLO_TEMPORALSHAPE);
5545 // iterate over all Junction detectors
5546 for (const auto& selectedJunctionID : myViewParent->getTLSEditorFrame()->getTLSJunction()->getSelectedJunctionIDs()) {
5547 // get junction
5548 const auto selectedJunction = myNet->getAttributeCarriers()->retrieveJunction(selectedJunctionID);
5549 // push line matrix
5551 // draw line between junction and Junction
5552 GUIGeometry::drawChildLine(*myVisualizationSettings, junctionPos, selectedJunction->getPositionInView(),
5554 // pop line matrix
5556 }
5557 // pop layer matrix
5559 }
5560}
5561
5562
5563void
5569
5570
5571void
5574 // get mouse position
5575 const Position mousePosition = snapToActiveGrid(getPositionInformation());
5576 // push layer matrix
5578 // translate to test layer, but under magenta square
5579 glTranslated(mousePosition.x(), mousePosition.y(), GLO_TESTELEMENT - 1);
5580 // set color
5582 // draw circle
5584 // pop layer matrix
5586 }
5587}
5588
5589
5590void
5592 // reset moving selected edge
5594 // decide what to do based on mode
5595 switch (myEditModes.networkEditMode) {
5597 // first swap lane to edges if mySelectEdges is enabled and shift key isn't pressed
5598 if (checkSelectEdges()) {
5600 } else {
5602 }
5603 // now filter locked elements
5605 // check if we're selecting a new parent for the current inspected element
5608 } else {
5609 // inspect clicked elements
5611 }
5612 // process click
5613 processClick(eventData);
5614 break;
5615 }
5617 // first swap lane to edges if mySelectEdges is enabled and shift key isn't pressed
5618 if (checkSelectEdges()) {
5620 } else {
5622 }
5623 // now filter locked elements forcing excluding walkingAreas
5625 // continue depending of AC
5627 // now check if we want only delete geometry points
5629 // only remove geometry point
5632 // remove all selected attribute carriers
5635 }
5636 } else {
5637 // remove attribute carrier under cursor
5639 }
5640 } else {
5641 // process click
5642 processClick(eventData);
5643 }
5644 break;
5645 }
5647 // first swap lane to edges if mySelectEdges is enabled and shift key isn't pressed
5648 if (checkSelectEdges()) {
5650 } else {
5652 }
5653 // now filter locked elements
5655 // avoid to select if control key is pressed
5657 // check if a rect for selecting is being created
5659 // begin rectangle selection
5662 // process click
5663 processClick(eventData);
5664 }
5665 } else {
5666 // process click
5667 processClick(eventData);
5668 }
5669 break;
5671 // check what buttons are pressed
5673 // get edge under cursor
5675 if (edge) {
5676 // obtain reverse edge
5677 const auto oppositeEdges = edge->getOppositeEdges();
5678 // check if we're split one or both edges
5681 } else if (oppositeEdges.size() > 0) {
5682 myNet->splitEdgesBidi(edge, oppositeEdges.front(), edge->getSplitPos(getPositionInformation()), myUndoList);
5683 } else {
5685 }
5686 }
5688 // process left click in create edge frame Frame
5693 }
5694 // process click
5695 processClick(eventData);
5696 break;
5697 }
5699 // editing lane shapes in move mode isn't finished, then always filter lanes
5701 // filter locked elements
5703 // check if we're editing a shape
5705 // check if we're removing a geometry point
5707 // remove geometry point
5710 }
5712 // process click if there isn't movable elements (to move camera using drag an drop)
5713 processClick(eventData);
5714 }
5715 } else {
5716 // filter connections and crossings, because are moved setting custom shape
5719 // get AC under cursor
5721 // check that AC is an network or additional element
5722 if (AC && (AC->getTagProperty().isNetworkElement() || AC->getTagProperty().isAdditionalElement())) {
5723 // check if we're moving a set of selected items
5724 if (AC->isAttributeCarrierSelected()) {
5725 // move selected ACs
5728 // process click if there isn't movable elements (to move camera using drag an drop)
5729 processClick(eventData);
5730 }
5731 } else {
5732 // process click if there isn't movable elements (to move camera using drag an drop)
5733 processClick(eventData);
5734 }
5735 }
5736 break;
5737 }
5739 // check if we're clicked over a non locked lane
5741 // Handle laneclick (shift key may pass connections, Control key allow conflicts)
5743 updateViewNet();
5744 }
5745 // process click
5746 processClick(eventData);
5747 break;
5748 }
5751 // edit TLS in TLSEditor frame
5753 updateViewNet();
5754 }
5755 // process click
5756 processClick(eventData);
5757 break;
5758 }
5760 // avoid create additionals if control key is pressed
5763 WRITE_WARNING(TL("Shift + click to create two additionals in the same position"));
5765 // save last mouse position
5767 updateViewNet();
5768 }
5769 }
5770 // process click
5771 processClick(eventData);
5772 break;
5773 }
5775 // filter elements over junctions
5779 // call function addCrossing from crossing frame
5781 // process click
5782 processClick(eventData);
5783 break;
5784 }
5786 // avoid create TAZs if control key is pressed
5788 // check if we want to create a rect for selecting edges
5790 // begin rectangle selection
5792 } else {
5793 // check if process click was successfully
5795 updateViewNet();
5796 }
5797 // process click
5798 processClick(eventData);
5799 }
5800 } else {
5801 // process click
5802 processClick(eventData);
5803 }
5804 break;
5805 }
5807 // avoid create shapes if control key is pressed
5810 // declare processClick flag
5811 bool updateTemporalShape = false;
5812 // process click
5814 updateViewNet();
5815 // process click depending of the result of "process click"
5816 if (!updateTemporalShape) {
5817 // process click
5818 processClick(eventData);
5819 }
5820 }
5821 } else {
5822 // process click
5823 processClick(eventData);
5824 }
5825 break;
5826 }
5829 // shift key may pass connections, Control key allow conflicts.
5831 updateViewNet();
5832 }
5833 // process click
5834 processClick(eventData);
5835 break;
5836 }
5838 // avoid create wires if control key is pressed
5841 updateViewNet();
5842 }
5843 // process click
5844 processClick(eventData);
5845 break;
5846 }
5848 // process click
5849 processClick(eventData);
5850 break;
5851 }
5852 default: {
5853 // process click
5854 processClick(eventData);
5855 }
5856 }
5857}
5858
5859
5860void
5862 // check moved items
5866 // check if we're creating a rectangle selection or we want only to select a lane
5868 // check if we're selecting all type of elements o we only want a set of edges for TAZ
5872 // process edge selection
5874 }
5876 // check if there is a lane in objects under cursor
5878 // if we clicked over an lane with shift key pressed, select or unselect it
5881 } else {
5883 }
5884 }
5885 }
5886 // finish selection
5888 } else {
5889 // finish moving of single elements
5891 }
5892}
5893
5894
5895void
5896GNEViewNet::processMoveMouseNetwork(const bool mouseLeftButtonPressed) {
5897 // change "delete last created point" depending if during movement shift key is pressed
5902 }
5903 // check what type of additional is moved
5905 // move entire selection
5906 myMoveMultipleElements.moveSelection(mouseLeftButtonPressed);
5908 // update selection corner of selecting area
5910 } else {
5911 // move single elements
5912 myMoveSingleElement.moveSingleElement(mouseLeftButtonPressed);
5913 }
5914}
5915
5916
5917void
5919 // filter shapes (because POIs and polygons doesn't interact in demand mode)
5921 // decide what to do based on mode
5922 switch (myEditModes.demandEditMode) {
5924 // filter locked elements
5926 // inspect clicked elements
5928 // process click
5929 processClick(eventData);
5930 break;
5931 }
5933 // filter locked elements
5935 // get front AC
5936 const auto markAC = myViewObjectsSelector.getAttributeCarrierFront();
5937 // check conditions
5938 if (markAC) {
5939 // check if we are deleting a selection or an single attribute carrier
5940 if (markAC->isAttributeCarrierSelected()) {
5942 } else {
5944 }
5945 } else {
5946 // process click
5947 processClick(eventData);
5948 }
5949 break;
5950 }
5952 // filter locked elements
5954 // avoid to select if control key is pressed
5956 // check if a rect for selecting is being created
5958 // begin rectangle selection
5961 // process click
5962 processClick(eventData);
5963 }
5964 } else {
5965 // process click
5966 processClick(eventData);
5967 }
5968 break;
5970 // filter locked elements
5972 // get front AC
5973 const auto markAC = myViewObjectsSelector.getAttributeCarrierFront();
5974 // check that AC under cursor is a demand element
5975 if (markAC) {
5976 // check if we're moving a set of selected items
5977 if (markAC->isAttributeCarrierSelected()) {
5978 // move selected ACs
5981 // process click if there isn't movable elements (to move camera using drag an drop)
5982 processClick(eventData);
5983 }
5984 } else {
5985 // process click if there isn't movable elements (to move camera using drag an drop)
5986 processClick(eventData);
5987 }
5988 break;
5989 }
5991 // check if we clicked over a lane
5993 // Handle edge click
5995 }
5996 // process click
5997 processClick(eventData);
5998 break;
5999 }
6001 // filter additionals (except TAZs) and demands (except routes)
6004 // Handle click
6006 // process click
6007 processClick(eventData);
6008 break;
6009 }
6011 // filter additionals (except stoppingPlaces) and demands
6014 // Handle click
6016 WRITE_WARNING(TL("Control + click to create two stop in the same position"));
6018 updateViewNet();
6019 // save last mouse position
6021 }
6022 // process click
6023 processClick(eventData);
6024 break;
6025 }
6027 // filter additionals (except stoppingPlaces and TAZs)
6029 // special case if we're creating person over walk routes
6032 } else {
6034 }
6035 // Handle click
6037 // process click
6038 processClick(eventData);
6039 break;
6040 }
6042 // filter additionals (except stoppingPlaces and TAZs)
6044 // special case if we're creating person over walk routes
6047 } else {
6049 }
6050 // Handle person plan click
6052 // process click
6053 processClick(eventData);
6054 break;
6055 }
6057 // filter additionals (except stoppingPlaces and TAZs) and demands
6060 // Handle click
6062 // process click
6063 processClick(eventData);
6064 break;
6065 }
6067 // filter additionals (except stoppingPlaces and TAZs) and demands
6070 // Handle container plan click
6072 // process click
6073 processClick(eventData);
6074 break;
6075 }
6076 default: {
6077 // process click
6078 processClick(eventData);
6079 }
6080 }
6081}
6082
6083
6084void
6086 // check moved items
6090 // check if we're creating a rectangle selection or we want only to select a lane
6093 }
6094 // finish selection
6096 } else {
6097 // finish moving of single elements
6099 }
6100}
6101
6102
6103void
6104GNEViewNet::processMoveMouseDemand(const bool mouseLeftButtonPressed) {
6106 // update selection corner of selecting area
6108 } else {
6109 // move single elements
6110 myMoveSingleElement.moveSingleElement(mouseLeftButtonPressed);
6111 }
6112}
6113
6114
6115void
6117 // get AC
6119 // decide what to do based on mode
6120 switch (myEditModes.dataEditMode) {
6122 // filter locked elements
6124 // process left click in Inspector Frame
6125 if (AC && AC->getTagProperty().getTag() == SUMO_TAG_TAZ) {
6127 } else {
6128 // inspect clicked elements
6130 }
6131 // process click
6132 processClick(eventData);
6133 break;
6134 }
6136 // check conditions
6137 if (AC) {
6138 // check if we are deleting a selection or an single attribute carrier
6139 if (AC->isAttributeCarrierSelected()) {
6140 if (!AC->getGUIGlObject()->isGLObjectLocked()) {
6142 }
6143 } else {
6145 }
6146 } else {
6147 // process click
6148 processClick(eventData);
6149 }
6150 break;
6151 }
6153 // filter locked elements
6155 // avoid to select if control key is pressed
6157 // check if a rect for selecting is being created
6159 // begin rectangle selection
6162 // process click
6163 processClick(eventData);
6164 }
6165 } else {
6166 // process click
6167 processClick(eventData);
6168 }
6169 break;
6171 // avoid create edgeData if control key is pressed
6174 updateViewNet();
6175 }
6176 }
6177 // process click
6178 processClick(eventData);
6179 break;
6181 // avoid create edgeData if control key is pressed
6184 updateViewNet();
6185 }
6186 }
6187 // process click
6188 processClick(eventData);
6189 break;
6191 // avoid create TAZData if control key is pressed
6194 updateViewNet();
6195 }
6196 }
6197 // process click
6198 processClick(eventData);
6199 break;
6201 // avoid create TAZData if control key is pressed
6203 //
6204 }
6205 // process click
6206 processClick(eventData);
6207 break;
6208 default: {
6209 // process click
6210 processClick(eventData);
6211 }
6212 }
6213}
6214
6215
6216void
6218 // check moved items
6222 // check if we're creating a rectangle selection or we want only to select a lane
6225 }
6226 // finish selection
6228 } else {
6229 // finish moving of single elements
6231 }
6232}
6233
6234
6235void
6236GNEViewNet::processMoveMouseData(const bool mouseLeftButtonPressed) {
6238 // update selection corner of selecting area
6240 } else {
6241 // move single elements
6242 myMoveSingleElement.moveSingleElement(mouseLeftButtonPressed);
6243 }
6244}
6245
6246
6247/****************************************************************************/
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:879
@ 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:903
@ 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:923
@ MID_GNE_DATAVIEWOPTIONS_TAZRELONLYTO
toggle draw TAZRel only to
Definition GUIAppEnum.h:909
@ 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:895
@ MID_GNE_NETWORKVIEWOPTIONS_SHOWTAZELEMENTS
show TAZ elements
Definition GUIAppEnum.h:833
@ MID_GNE_DEMANDVIEWOPTIONS_LOCKPERSON
lock person
Definition GUIAppEnum.h:881
@ 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:869
@ 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_NETWORKVIEWOPTIONS_ASKFORMERGE
ask before merging junctions
Definition GUIAppEnum.h:839
@ MID_GNE_JUNCTION_RESET_CONNECTIONS
reset junction's connections
@ MID_GNE_DEMANDVIEWOPTIONS_SHOWGRID
show grid
Definition GUIAppEnum.h:867
@ 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:901
@ 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:875
@ 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:897
@ 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:925
@ 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:883
@ 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:927
@ 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:905
@ 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:873
@ 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:917
@ MID_GNE_LANE_ADD_GREENVERGE_BACK
add greenVerge back of current lane
@ 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:899
@ 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:907
@ 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:871
@ MID_GNE_LANE_ADD_SIDEWALK
add sidewalk
@ MID_GNE_DEMANDVIEWOPTIONS_SHOWOVERLAPPEDROUTES
show overlapped routes
Definition GUIAppEnum.h:887
@ 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:919
@ 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:885
@ 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:877
@ MID_GNE_NETWORKVIEWOPTIONS_TOGGLEGRID
show grid
Definition GUIAppEnum.h:817
@ MID_GNE_INTERVALBAR_LIMITED
enable/disable show data elements by interval
Definition GUIAppEnum.h:921
@ 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:43
GUIGlObjectType
@ GLO_TAZRELDATA
TAZ relation data.
@ GLO_WALKINGAREA
a walkingArea
@ GLO_TEMPORALSHAPE
temporal shape (used in netedit)
@ GLO_TESTELEMENT
test element (used in netedit)
@ GLO_JUNCTION
a junction
@ GLO_LANE
a lane
@ GLO_CONNECTION
a connection
@ GLO_EDGE
an edge
@ GLO_TLLOGIC
a tl-logic
@ GLO_CROSSING
a tl-logic
GUIViewObjectsHandler gViewObjectsHandler
GUIViewUpdater gViewUpdater
@ LOCATEVEHICLE
@ LOCATEWALKINGAREA
@ LOCATEPERSON
@ LOCATECONTAINER
@ LOCATEJUNCTION
#define WRITE_DEBUG(msg)
Definition MsgHandler.h:306
#define WRITE_WARNINGF(...)
Definition MsgHandler.h:296
#define WRITE_ERROR(msg)
Definition MsgHandler.h:304
#define WRITE_WARNING(msg)
Definition MsgHandler.h:295
#define TL(string)
Definition MsgHandler.h:315
#define TLF(string,...)
Definition MsgHandler.h:317
StringBijection< SUMOVehicleClass > SumoVehicleClassStrings(sumoVehicleClassStringInitializer, SVC_CUSTOM2, false)
long long int SVCPermissions
bitset where each bit declares whether a certain SVC may use this edge/lane
SUMOVehicleClass
Definition of vehicle classes to differ between different lane usage and authority types.
@ SVC_IGNORING
vehicles ignoring classes
@ SVC_BICYCLE
vehicle is a bicycle
@ SVC_BUS
vehicle is a bus
@ SVC_PEDESTRIAN
pedestrian
@ SUMO_TAG_EDGEREL
a relation between two edges
@ SUMO_TAG_DATAINTERVAL
@ SUMO_TAG_TAZ
a traffic assignment zone
@ GNE_TAG_EDGEREL_SINGLE
@ SUMO_TAG_POI
begin/end of the description of a Point of interest
@ SUMO_TAG_VEHICLE
description of a vehicle
@ GNE_TAG_FLOW_ROUTE
a flow definition using a route instead of a from-to edges route
@ SUMO_TAG_FLOW
a flow definition using from and to edges or a route
@ SUMO_TAG_CONNECTION
connectioon between two lanes
@ SUMO_TAG_JUNCTION
begin/end of the description of a junction
@ SUMO_TAG_CROSSING
crossing between edges for pedestrians
@ SUMO_TAG_POLY
begin/end of the description of a polygon
@ SUMO_TAG_LANE
begin/end of the description of a single lane
@ SUMO_TAG_DATASET
@ GNE_TAG_JPS_OBSTACLE
polygon used for draw juPedSim obstacles
@ SUMO_TAG_TAZREL
a relation between two TAZs
@ GNE_TAG_ROUTE_EMBEDDED
embedded route
@ SUMO_TAG_INDUCTION_LOOP
alternative tag for e1 detector
@ GNE_TAG_JPS_WALKABLEAREA
polygon used for draw juPedSim walkable areas
@ SUMO_TAG_VIEWSETTINGS
@ SUMO_TAG_VIEWPORT
@ SUMO_TAG_TRIP
a single trip definition (used by router)
@ SUMO_TAG_EDGE
begin/end of the description of an edge
@ SUMO_ATTR_LANE
@ GNE_ATTR_OPPOSITE
to busStop (used by personPlans)
@ SUMO_ATTR_Y
@ SUMO_ATTR_X
@ GNE_ATTR_SELECTED
element is selected
@ SUMO_ATTR_CUSTOMSHAPE
whether a given shape is user-defined
@ SUMO_ATTR_POSITION_LAT
@ SUMO_ATTR_ZOOM
@ SUMO_ATTR_SHAPE
edge: the shape in xml-definition
@ SUMO_ATTR_ANGLE
@ GNE_ATTR_SHAPE_END
last coordinate of edge shape
@ SUMO_ATTR_TLID
link,node: the traffic light id responsible for this link
@ SUMO_ATTR_FRIENDLY_POS
@ SUMO_ATTR_TYPE
@ SUMO_ATTR_LENGTH
@ GNE_ATTR_SHAPE_START
first coordinate of edge shape
@ SUMO_ATTR_POSITION
const double SUMO_const_laneWidth
Definition StdDefs.h:48
T MIN2(T a, T b)
Definition StdDefs.h:76
T MAX2(T a, T b)
Definition StdDefs.h:82
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:78
double ymin() const
Returns minimum y-coordinate.
Definition Boundary.cpp:130
double xmin() const
Returns minimum x-coordinate.
Definition Boundary.cpp:118
Boundary & grow(double by)
extends the boundary by the given amount
Definition Boundary.cpp:343
double ymax() const
Returns maximum y-coordinate.
Definition Boundary.cpp:136
double xmax() const
Returns maximum x-coordinate.
Definition Boundary.cpp:124
void addBoolAttribute(const SumoXMLAttr attr, const bool value)
add bool attribute into current SumoBaseObject node
void addDoubleAttribute(const SumoXMLAttr attr, const double value)
add double attribute into current SumoBaseObject node
void addStringAttribute(const SumoXMLAttr attr, const std::string &value)
add string attribute into current SumoBaseObject node
static void drawLine(const Position &beg, double rot, double visLength)
Draws a thin line.
Definition GLHelper.cpp:433
static void setColor(const RGBColor &c)
Sets the gl-color to this value.
Definition GLHelper.cpp:649
static void drawOutlineCircle(double radius, double iRadius, int steps=8)
Draws an unfilled circle around (0,0)
Definition GLHelper.cpp:591
static void drawFilledCircle(const double widradiusth, const int steps=8)
Draws a filled circle around (0,0)
Definition GLHelper.cpp:564
static void popMatrix()
pop matrix
Definition GLHelper.cpp:131
static void pushMatrix()
push matrix
Definition GLHelper.cpp:118
GNEConsecutiveSelector * getConsecutiveLaneSelector() const
get consecutive lane selector
GNENetworkSelector * getLanesSelector() const
get edges selector
bool createPath(const bool useLastRoute)
create path
bool addAdditional(const GNEViewNetHelper::ViewObjectsSelector &viewObjects)
add additional element
GNENetworkSelector * getEdgesSelector() const
get edges selector
GNENeteditAttributes * getNeteditAttributes() const
get Netedit parameter
Builds additional objects for GNENet (busStops, chargingStations, detectors, etc.....
An Element which don't belong to GNENet but has influence in the simulation.
virtual void openAdditionalDialog()
open Additional Dialog
GNEApplicationWindowHelper::EditMenuCommands & getEditMenuCommands()
get Edit Menu Commands (needed for show/hide menu commands)
GNEApplicationWindowHelper::ToolbarsGrip & getToolbarsGrip()
get ToolbarsGrip
const std::string getID() const
get ID (all Attribute Carriers have one)
bool isAttributeCarrierSelected() const
check if attribute carrier is selected
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 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
GNEJunction * getParentJunction() const
get parent Junction
An Element which don't belong to GNENet but has influence in the simulation.
bool deleteOnlyGeometryPoints() const
check if only delete geometry points checkbox is enabled
bool removeGeometryPoint(const GNEViewNetHelper::ViewObjectsSelector &viewObjects)
remove geometry point
DeleteOptions * getDeleteOptions() const
get delete options modul
void removeSelectedAttributeCarriers()
remove selected attribute carriers (element)
void removeAttributeCarrier(const GNEViewNetHelper::ViewObjectsSelector &viewObjects)
remove attribute carrier (element)
void show()
show delete frame
void startDrawing()
start drawing
bool isDrawing() const
return true if currently a shape is drawed
bool getDeleteLastCreatedPoint()
get flag delete last created point
void abortDrawing()
abort drawing
void setDeleteLastCreatedPoint(bool value)
enable or disable delete last created point
void stopDrawing()
stop drawing and check if shape can be created
const PositionVector & getTemporalShape() const
get Temporal shape
bool addEdgeData(const GNEViewNetHelper::ViewObjectsSelector &viewObjects, const GNEViewNetHelper::MouseButtonKeyPressed &mouseButtonKeyPressed)
add additional element
A road/street connecting two junctions (netedit-version)
Definition GNEEdge.h:53
void smooth(GNEUndoList *undoList)
make geometry smooth
Definition GNEEdge.cpp:2430
NBEdge * getNBEdge() const
returns the internal NBEdge
Definition GNEEdge.cpp:781
void smoothElevation(GNEUndoList *undoList)
smooth elevation with regard to adjoining edges
Definition GNEEdge.cpp:2442
const std::vector< GNELane * > & getLanes() const
returns a reference to the lane vector
Definition GNEEdge.cpp:1118
std::vector< GNEEdge * > getOppositeEdges() const
get opposite edges
Definition GNEEdge.cpp:715
void copyTemplate(const GNEEdgeTemplate *edgeTemplate, GNEUndoList *undoList)
copy edge attributes from edgetemplate
Definition GNEEdge.cpp:1055
void editEndpoint(Position pos, GNEUndoList *undoList)
makes pos the new geometry endpoint at the appropriate end, or remove current existent endpoint
Definition GNEEdge.cpp:803
Position getSplitPos(const Position &clickPos)
Definition GNEEdge.cpp:787
void straightenElevation(GNEUndoList *undoList)
interpolate z values linear between junctions
Definition GNEEdge.cpp:2347
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
Definition GNEEdge.cpp:1249
void resetEndpoint(const Position &pos, GNEUndoList *undoList)
restores the endpoint to the junction position at the appropriate end
Definition GNEEdge.cpp:855
bool addEdgeRelationData(const GNEViewNetHelper::ViewObjectsSelector &viewObjects, const GNEViewNetHelper::MouseButtonKeyPressed &mouseButtonKeyPressed)
add additional element
void focusUpperElement()
focus upper element of frame
Definition GNEFrame.cpp:109
virtual void show()
show Frame
Definition GNEFrame.cpp:115
GNEPathCreator * getPathCreator() const
get GNEPathCreator modul
An Element which don't belong to GNENet but has influence in the simulation.
Dialog to edit geometry points.
const std::vector< GNEDemandElement * > & getParentDemandElements() const
get parent demand elements
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
void inspectElement(GNEAttributeCarrier *AC, GNEAttributeCarrier *previousInspectedAC=nullptr)
Inspect a single element.
GNEAttributesEditor * getNeteditAttributesEditor() const
get Netedit Attributes editor
const std::vector< GNEEdge * > & getGNEIncomingEdges() const
Returns incoming GNEEdges.
std::string getAttribute(SumoXMLAttr key) const
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
Position getPositionInView() const
Returns position of hierarchical element in view.
const std::vector< GNEEdge * > & getGNEOutgoingEdges() const
Returns incoming GNEEdges.
NBNode * getNBNode() const
Return net build node.
This lane is powered by an underlying GNEEdge and basically knows how to draw itself.
Definition GNELane.h:46
const PositionVector & getLaneShape() const
get elements shape
Definition GNELane.cpp:214
int getIndex() const
returns the index of the lane
Definition GNELane.cpp:620
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
Definition GNELane.cpp:749
GNEEdge * getParentEdge() const
get parent edge
Definition GNELane.cpp:196
void show()
show Frame
virtual void removeGeometryPoint(const Position clickedPosition, GNEUndoList *undoList)=0
remove geometry point in the clicked position
void show()
show prohibition frame
GNEAttributeCarrier * retrieveAttributeCarrier(const GUIGlID id, bool hardFail=true) const
get a single attribute carrier based on a GLID
const std::unordered_map< SumoXMLTag, std::unordered_map< const GUIGlObject *, GNEDemandElement * > > & getDemandElements() const
get demand elements
std::vector< GNEAdditional * > getSelectedShapes() const
get selected shapes
GNELane * retrieveLane(const std::string &id, bool hardFail=true, bool checkVolatileChange=false) const
get lane by id
GNECrossing * retrieveCrossing(const GUIGlObject *glObject, bool hardFail=true) const
get Crossing by AC
GNEAdditional * retrieveAdditional(SumoXMLTag type, const std::string &id, bool hardFail=true) const
Returns the named additional.
const std::unordered_map< SumoXMLTag, std::unordered_map< const GUIGlObject *, GNEGenericData * > > & getGenericDatas() const
get all generic datas
GNEWalkingArea * retrieveWalkingArea(const GUIGlObject *glObject, bool hardFail=true) const
get WalkingArea by GlObject
bool isNetworkElementAroundShape(GNEAttributeCarrier *AC, const PositionVector &shape) const
check if shape of given AC (network element) is around the given shape
GNEJunction * retrieveJunction(const std::string &id, bool hardFail=true) const
get junction by id
GNEDataSet * retrieveDataSet(const std::string &id, bool hardFail=true) const
Returns the named data set.
std::vector< GNELane * > getSelectedLanes() const
get selected lanes
const std::map< std::string, GNEEdge * > & getEdges() const
map with the ID and pointer to edges of net
std::vector< GNEJunction * > getSelectedJunctions() const
return selected junctions
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:433
void deleteLane(GNELane *lane, GNEUndoList *undoList, bool recomputeConnections)
removes lane
Definition GNENet.cpp:601
void deleteCrossing(GNECrossing *crossing, GNEUndoList *undoList)
remove crossing
Definition GNENet.cpp:658
SUMORTree & getGrid()
Returns the RTree used for visualisation speed-up.
Definition GNENet.cpp:164
void deleteAdditional(GNEAdditional *additional, GNEUndoList *undoList)
remove additional
Definition GNENet.cpp:676
void computeAndUpdate(OptionsCont &neteditOptions, bool volatileOptions)
recompute the network and update lane geometries
Definition GNENet.cpp:2929
GNEPathManager * getDataPathManager()
get data path manager
Definition GNENet.cpp:151
void reverseEdge(GNEEdge *edge, GNEUndoList *undoList)
reverse edge
Definition GNENet.cpp:1065
NBTrafficLightLogicCont & getTLLogicCont()
returns the tllcont of the underlying netbuilder
Definition GNENet.cpp:2169
bool restrictLane(SUMOVehicleClass vclass, GNELane *lane, GNEUndoList *undoList)
transform lane to restricted lane
Definition GNENet.cpp:804
void deleteDemandElement(GNEDemandElement *demandElement, GNEUndoList *undoList)
remove demand element
Definition GNENet.cpp:697
void duplicateLane(GNELane *lane, GNEUndoList *undoList, bool recomputeConnections)
duplicates lane
Definition GNENet.cpp:788
void deleteDataInterval(GNEDataInterval *dataInterval, GNEUndoList *undoList)
remove data interval
Definition GNENet.cpp:736
void deleteConnection(GNEConnection *connection, GNEUndoList *undoList)
remove connection
Definition GNENet.cpp:643
GNEPathManager * getDemandPathManager()
get demand path manager
Definition GNENet.cpp:145
void resetJunctionConnections(GNEJunction *junction, GNEUndoList *undoList)
reset junction's connections
Definition GNENet.cpp:2093
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
Definition GNENet.cpp:198
void deleteGenericData(GNEGenericData *genericData, GNEUndoList *undoList)
remove generic data
Definition GNENet.cpp:749
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:924
GNENetHelper::AttributeCarriers * getAttributeCarriers() const
get all attribute carriers used in this net
Definition GNENet.cpp:127
GNEEdge * addReversedEdge(GNEEdge *edge, const bool disconnected, GNEUndoList *undoList)
add reversed edge
Definition GNENet.cpp:1078
void splitEdgesBidi(GNEEdge *edge, GNEEdge *oppositeEdge, const Position &pos, GNEUndoList *undoList)
split all edges at position by inserting one new junction
Definition GNENet.cpp:1041
bool removeRestrictedLane(SUMOVehicleClass vclass, GNEEdge *edge, GNEUndoList *undoList)
remove restricted lane
Definition GNENet.cpp:910
void mergeJunctions(GNEJunction *moved, GNEJunction *target, GNEUndoList *undoList)
merge the given junctions edges between the given junctions will be deleted
Definition GNENet.cpp:1116
bool addRestrictedLane(SUMOVehicleClass vclass, GNEEdge *edge, int index, GNEUndoList *undoList)
add restricted lane to edge
Definition GNENet.cpp:857
bool addGreenVergeLane(GNEEdge *edge, int index, GNEUndoList *undoList)
add restricted lane to edge
Definition GNENet.cpp:893
void deleteDataSet(GNEDataSet *dataSet, GNEUndoList *undoList)
remove data set
Definition GNENet.cpp:723
GNEPathManager * getNetworkPathManager()
get network path manager
Definition GNENet.cpp:139
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:1993
void selectRoundabout(GNEJunction *junction, GNEUndoList *undoList)
select all roundabout edges and junctions for the current roundabout
Definition GNENet.cpp:1149
void replaceJunctionByGeometry(GNEJunction *junction, GNEUndoList *undoList)
replace the selected junction by geometry node(s) and merge the edges
Definition GNENet.cpp:1939
void createRoundabout(GNEJunction *junction, GNEUndoList *undoList)
transform the given junction into a roundabout
Definition GNENet.cpp:1168
void requireRecompute()
inform the net about the need for recomputation
Definition GNENet.cpp:1545
void initGNEConnections()
initialize GNEConnections
Definition GNENet.cpp:2916
void deleteJunction(GNEJunction *junction, GNEUndoList *undoList)
removes junction and all incident edges
Definition GNENet.cpp:386
NBEdgeCont & getEdgeCont()
returns the NBEdgeCont of the underlying netbuilder
Definition GNENet.cpp:2175
GNEViewNet * getViewNet() const
get view net
Definition GNENet.cpp:2163
void clearJunctionConnections(GNEJunction *junction, GNEUndoList *undoList)
clear junction's connections
Definition GNENet.cpp:2081
void computeDemandElements(GNEApplicationWindow *window)
compute demand elements param[in] window The window to inform about delay
Definition GNENet.cpp:1494
void drawLaneReference(const GNELane *lane) const
draw lane reference
void closeShapeEdited(GNEUndoList *undoList)
close shape edited
void setFirstGeometryPointShapeEdited(const int index, GNEUndoList *undoList)
set first geometry point shape edited
void openShapeEdited(GNEUndoList *undoList)
open shape edited
int getGeometryPointUnderCursorShapeEdited() const
get index geometry point under cursor of shape edited
void simplifyShapeEdited(GNEUndoList *undoList)
simplify shape edited
void straigthenShapeEdited(GNEUndoList *undoList)
straigthen shape edited
void deleteGeometryPointShapeEdited(const int index, GNEUndoList *undoList)
delete geometry point shape edited
void resetShapeEdited(GNEUndoList *undoList)
reset shape edited
void clearSelection()
clear selection
bool overlappedInspectionShown() const
check if overlappedInspection modul is shown
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:350
void closePolygon(bool allowUndo=true)
close polygon
Definition GNEPoly.cpp:429
void changeFirstGeometryPoint(int oldIndex, bool allowUndo=true)
change first geometry point
Definition GNEPoly.cpp:450
void deleteGeometryPoint(const Position &pos, bool allowUndo=true)
delete the geometry point closest to the given pos
Definition GNEPoly.cpp:366
void simplifyShape(bool allowUndo=true)
replace the current shape with a rectangle
Definition GNEPoly.cpp:490
void openPolygon(bool allowUndo=true)
open polygon
Definition GNEPoly.cpp:408
long onCmdCancel(FXObject *, FXSelector, void *)
Called when the user presses the Cancel-button discards any prohibition modifications.
void handleProhibitionClick(const GNEViewNetHelper::ViewObjectsSelector &viewObjects)
handle prohibitions and set the relative coloring
GNEProhibitionFrame::Selection * getSelectionModul() const
get selection module
void show()
show prohibition frame
GNEDistributionFrame::DistributionSelector * getDistributionSelector() const
get route distribution selector
void show()
show delete frame
GNEPathCreator * getPathCreator() const
get path creator module
bool addEdgeRoute(GNEEdge *clickedEdge, const GNEViewNetHelper::MouseButtonKeyPressed &mouseButtonKeyPressed)
add route edge
static void addReverse(GNEDemandElement *element)
add reverse for given demand element
static void reverse(GNEDemandElement *element)
reverse given demand element
void show()
show Frame
void clearCurrentSelection() const
clear current selection with possibility of undo/redo
bool selectAttributeCarrier(const GNEViewNetHelper::ViewObjectsSelector &viewObjects)
select attribute carrier (element)
void show()
show Frame
bool processClick(const Position &clickedPosition, const GNEViewNetHelper::ViewObjectsSelector &viewObjects, bool &updateTemporalShape)
process click over Viewnet
GNEDrawingShape * getDrawingShapeModule() const
get drawing mode editor
void show()
show Frame
bool addStop(const GNEViewNetHelper::ViewObjectsSelector &viewObjects, const GNEViewNetHelper::MouseButtonKeyPressed &mouseButtonKeyPressed)
add Stop element
void setTAZ(GNETAZ *editedTAZ)
set current TAZ
GNETAZ * getTAZ() const
get current TAZ
bool isChangesPending() const
return true if there is changes to save
long onCmdSaveChanges(FXObject *, FXSelector, void *)
TAZSaveChanges * getTAZSaveChangesModule() const
get TAZ Save Changes modul
GNEDrawingShape * getDrawingShapeModule() const
get drawing mode modul
CurrentTAZ * getCurrentTAZModule() const
get Current TAZ modul
void processEdgeSelection(const std::vector< GNEEdge * > &edges)
process selection of edges in view net
bool processClick(const Position &clickedPosition, const GNEViewNetHelper::ViewObjectsSelector &viewObjects)
process click over Viewnet
bool setTAZ(const GNEViewNetHelper::ViewObjectsSelector &viewObjects)
set clicked TAZ
void buildTAZRelationData()
build TAZRelation data
void clearTAZSelection()
clear TAZ selection
bool isSetDetectorsToggleButtonEnabled() const
toggle button for set detectors mode
void disableE1DetectorMode()
disable detector mode
const std::map< std::string, std::string > & getE1Detectors() const
get E1 detectors vinculated with this TLS
bool checkHaveModifications() const
check if current TLS was modified
long onCmdSaveChanges(FXObject *, FXSelector, void *)
Called when the user presses the save-Button.
void discardChanges(const bool editJunctionAgain)
discard changes
const std::vector< std::string > & getSelectedJunctionIDs() const
get selected junction IDs
long onCmdCancelJoin(FXObject *, FXSelector, void *)
cancel join
long onCmdAcceptJoin(FXObject *, FXSelector, void *)
accept join
GNEJunction * getCurrentJunction() const
get current modified junction
bool isJoiningJunctions() const
is joining junctions
GNETLSEditorFrame::TLSAttributes * getTLSAttributes() const
get module for TLS attributes
void editJunction(GNEJunction *junction)
edits the traffic light for the given junction
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::TLSDefinition * getTLSDefinition() const
get module for TLS Definition
void show()
show inspector frame
bool isContainer() const
return true if tag correspond to a container element
bool planRoute() const
return true if tag correspond to a plan placed over route
bool isPlacedInRTree() const
return true if Tag correspond to an element that has to be placed in RTREE
SumoXMLTag getTag() const
get Tag vinculated with this attribute Property
bool hasDialog() const
return true if tag correspond to an element that can be edited using a dialog
bool 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
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
GNEAdditional * getAdditionalFront() const
get front additional element or a pointer to nullptr
GNELane * getLaneFrontNonLocked() const
get front lane or a pointer to nullptr checking if is locked
const GUIGlObject * getGUIGlObjectFront() const
get front GUIGLObject or a pointer to nullptr
GNENetworkElement * getNetworkElementFront() const
get front network element or a pointer to nullptr
GNEJunction * getJunctionFront() const
get front junction or a pointer to nullptr
void filterLanes()
filter (remove) lanes
const std::vector< GUIGlObject * > & getGLObjects() const
get vector with GL objects
void filterShapes()
filter (remove) polys and POIs
GNEViewNetHelper::EditNetworkElementShapes myEditNetworkElementShapes
struct for grouping all variables related with edit shapes
Definition GNEViewNet.h:722
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:660
long onMouseMove(FXObject *, FXSelector, void *)
called when user moves mouse
void hotkeyBackSpace()
handle backspace keypress
GNEViewNetHelper::MarkFrontElements myMarkFrontElements
front element
Definition GNEViewNet.h:731
GNEDemandElement * myLastCreatedRoute
last created route
Definition GNEViewNet.h:746
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
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:641
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:644
GNEDemandElement * getLastCreatedRoute() const
get last created route
GNEViewNetHelper::InspectedElements & getInspectedElements()
get inspected elements
long onCmdToggleWarnAboutMerge(FXObject *, FXSelector, void *)
toggle warn for merge
long onCmdToggleDrawSpreadVehicles(FXObject *, FXSelector, void *)
toggle draw vehicles in begin position or spread in lane
GNEPOI * getPOIAtPopupPosition()
try to retrieve a POILane at popup position
GNEViewNetHelper::SelectingArea mySelectingArea
variable used for grouping all variables related with selecting areas
Definition GNEViewNet.h:719
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
void updateObjectsInBoundary(const Boundary &boundary)
get objects in the given boundary
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:663
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:755
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:652
void recalculateBoundaries()
recalculate boundaries
GNEViewNetHelper::IntervalBar myIntervalBar
variable used to save IntervalBar
Definition GNEViewNet.h:688
GNEViewParent * myViewParent
view parent
Definition GNEViewNet.h:734
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:680
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:740
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:743
GNEViewNetHelper::NetworkViewOptions myNetworkViewOptions
variable used to save variables related with view options in supermode Network
Definition GNEViewNet.h:677
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:694
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:669
long onCmdToggleShowGrid(FXObject *, FXSelector, void *)
toggle show grid
void processLeftButtonPressDemand(void *eventData)
process left button press function in Supermode Demand
GNEDemandElement * getDemandElementAtPopupPosition()
try to retrieve a demand element at popup position
GNEViewNetHelper::TimeFormat myTimeFormat
variable used for grouping all variables related with switch time
Definition GNEViewNet.h:716
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
long onCmdToggleDrawJunctionShape(FXObject *, FXSelector, void *)
toggle draw junction shape
bool checkOverLockedElement(const GUIGlObject *GLObject, const bool isSelected) const
check if given element is locked (used for drawing select and delete contour)
long onCmdStraightenShapeEdited(FXObject *, FXSelector, void *)
straight shape edited
long onCmdAddReversedEdge(FXObject *, FXSelector, void *)
add reversed edge
void processLeftButtonReleaseNetwork()
process left button release function in Supermode Network
long onCmdDeleteGeometryPointShapeEdited(FXObject *, FXSelector, void *)
delete the closes geometry point in shape edited
bool checkSelectEdges() const
check if select edges (toggle using button or shift)
long onMiddleBtnPress(FXObject *, FXSelector, void *)
called when user press mouse's left button
long onCmdAddReversedEdgeDisconnected(FXObject *, FXSelector, void *)
add reversed edge disconnected
long onCmdIntervalBarGenericDataType(FXObject *, FXSelector, void *)
change generic data type in interval bar
long onCmdConvertRoundabout(FXObject *, FXSelector, void *)
convert junction to roundabout
long onCmdRemoveEdgeSelected(FXObject *, FXSelector, void *)
unselect Edge under cursor
long onCmdAddReverse(FXObject *, FXSelector, void *)
add a reverse demand element
long onCmdToggleShowShapes(FXObject *, FXSelector, void *)
toggle show shapes in super mode data
long onRightBtnPress(FXObject *, FXSelector, void *)
called when user press mouse's right button
long onCmdOpenPolygon(FXObject *, FXSelector, void *)
open closed polygon
GNEViewNetHelper::InspectedElements myInspectedElements
inspected element
Definition GNEViewNet.h:728
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
void resetLastClickedPosition()
reset last clicked position
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:713
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:725
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
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
GNEViewNetHelper::DemandCheckableButtons myDemandCheckableButtons
variable used to save checkable buttons for Supermode Demand
Definition GNEViewNet.h:666
bool checkMergeJunctions()
try to merge moved junction with another junction in that spot return true if merging did take place
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
bool askMergeJunctions(const GNEJunction *movedJunction, const GNEJunction *targetJunction)
ask merge junctions
long onCmdIntervalBarSetBegin(FXObject *, FXSelector, void *)
change begin in interval bar
long onCmdResetLength(FXObject *, FXSelector, void *)
reset custom edge lengths
Position myLastClickedPosition
last clicked position
Definition GNEViewNet.h:752
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:697
long onCmdSplitJunctionReconnect(FXObject *, FXSelector, void *)
split junction into multiple junctions and reconnect them
long onCmdFinishShapeEdited(FXObject *, FXSelector, void *)
finish shape edited
void buildSelectionACPopupEntry(GUIGLObjectPopupMenu *ret, GNEAttributeCarrier *AC)
Builds an entry which allows to (de)select the object.
void hotkeyDel()
handle del keypress
long onCmdToggleChangeAllPhases(FXObject *, FXSelector, void *)
toggle change all phases
long onEnterConvertRoundabout(FXObject *, FXSelector, void *)
enter to convert junction to roundabout
bool myDrawPreviewRoundabout
draw preview roundabout
Definition GNEViewNet.h:749
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
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:737
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:683
int myDrawingToggle
drawin toggle (used in drawGLElements to avoid draw elements twice)
Definition GNEViewNet.h:758
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 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 *)
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:635
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...
GNEJunction * getParentJunction() const
get parent Junction
GNEConsecutiveSelector * getConsecutiveLaneSelector() const
get consecutive lane selector
bool createPath(const bool useLastRoute)
create path
void show()
show wire frame
bool addWire(const GNEViewNetHelper::ViewObjectsSelector &viewObjects)
add wire element
bool contains(const std::string &name) const
Returns the information whether a setting with the given name is stored.
GUIVisualizationSettings & get(const std::string &name)
Returns the named scheme.
const std::vector< std::string > & getNames() const
Returns a list of stored settings names.
Dialog for edit rerouter intervals.
static FXCursor * getCursor(GUICursor which)
returns a cursor previously defined in the enum GUICursor
static FXMenuCommand * buildFXMenuCommand(FXComposite *p, const std::string &text, FXIcon *icon, FXObject *tgt, FXSelector sel, const bool disable=false)
build menu command
std::string getCurrentScheme() const
Returns the name of the currently chosen scheme.
void setCurrentScheme(const std::string &)
Sets the named scheme as the current.
The popup menu of a globject.
static void drawGeometry(const GUIVisualizationSettings::Detail d, const GUIGeometry &geometry, const double width, double offset=0)
draw geometry
static void drawChildLine(const GUIVisualizationSettings &s, const Position &child, const Position &parent, const RGBColor &color, const bool drawEntire, const double lineWidth)
draw line between child and parent (used in netedit)
void updateGeometry(const PositionVector &shape)
update entire geometry
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 isolateEdgeGeometryPoints()
isolate edge geometry points (used for moving)
void reset()
reset view objects handler
void setSelectionBoundary(const Boundary &boundary)
set selection boundary
const GLObjectsSortedContainer & getSelectedObjects() const
get all elements under cursor sorted by layer
const GNEEdge * markedEdge
marked edge (used in create edge mode, for splitting)
const GNELane * markedLane
marked lane (used in create edge mode, for splitting)
void updateFrontObject(const GUIGlObject *GLObject)
move the given object to the front (currently used only in netedit)
const std::vector< const GNEJunction * > & getMergingJunctions() const
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:336
const Position & getPosition() const
Definition NBNode.h:260
const PositionVector & getShape() const
retrieve the junction shape
Definition NBNode.cpp:2667
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
static const Position INVALID
used to indicate that a position is valid
Definition Position.h:322
double distanceTo(const Position &p2) const
returns the euclidean distance in 3 dimensions
Definition Position.h:266
double distanceSquaredTo(const Position &p2) const
returns the square of the distance to another position
Definition Position.h:271
double x() const
Returns the x-position.
Definition Position.h:55
double y() const
Returns the y-position.
Definition Position.h:60
A list of positions.
Position positionAtOffset(double pos, double lateralOffset=0) const
Returns the position at the given length.
double nearest_offset_to_point2D(const Position &p, bool perpendicular=true) const
return the nearest offest to point 2D
int indexOfClosest(const Position &p, bool twoD=false) const
void move2side(double amount, double maxExtension=100)
move position vector to side using certain amount
Boundary getBoxBoundary() const
Returns a boundary enclosing this list of lines.
void pop_front()
pop first Position
void setAlpha(unsigned char alpha)
Sets a new alpha value.
Definition RGBColor.cpp:108
static const RGBColor BLUE
Definition RGBColor.h:187
static const RGBColor ORANGE
Definition RGBColor.h:191
static const RGBColor GREEN
Definition RGBColor.h:186
static RGBColor fromHSV(double h, double s, double v)
Converts the given hsv-triplet to rgb, inspired by http://alvyray.com/Papers/CG/hsv2rgb....
Definition RGBColor.cpp:371
static const RGBColor BLACK
Definition RGBColor.h:193
static const RGBColor RED
named colors
Definition RGBColor.h:185
const PositionVector & getShape() const
Returns the shape of the polygon.
void addAdditionalGLObject(GUIGlObject *o, const double exaggeration=1)
Adds an additional object (detector/shape/trigger) for visualisation.
Definition SUMORTree.h:124
void removeAdditionalGLObject(GUIGlObject *o, const double exaggeration=1)
Removes an additional object (detector/shape/trigger) from being visualised.
Definition SUMORTree.h:162
virtual int Search(const float a_min[2], const float a_max[2], const GUIVisualizationSettings &c) const
Find all within search rectangle.
Definition SUMORTree.h:116
DemandViewOptions demandViewOptions
demand view options
NetworkViewOptions networkViewOptions
network view options
FXMenuBar * modes
The application menu bar (for select, inspect...)
void buildCommonCheckableButtons()
build checkable buttons
void updateCommonCheckableButtons()
update Common checkable buttons
void disableCommonCheckableButtons()
hide all options menu checks
MFXCheckableButton * selectButton
checkable button for edit mode select
MFXCheckableButton * inspectButton
checkable button for edit mode inspect
MFXCheckableButton * deleteButton
checkable button for edit mode delete
void disableDataCheckableButtons()
hide all options menu checks
void buildDataCheckableButtons()
build checkable buttons
void updateDataCheckableButtons()
update Data checkable buttons
MFXCheckableButton * edgeDataButton
checkable button for edit mode "edgeData"
MFXCheckableButton * edgeRelDataButton
checkable button for edit mode "edgeRelData"
MFXCheckableButton * TAZRelDataButton
checkable button for edit mode "TAZRelData"
MFXCheckableButton * meanDataButton
checkable button for edit mode "meanData"
struct used to group all variables related to view options in supermode Data
void hideDataViewOptionsMenuChecks()
hide all options menu checks
MFXCheckableButton * menuCheckToggleTAZDrawFill
menu check to toggle TAZ draw fill
MFXCheckableButton * menuCheckShowAdditionals
menu check to show Additionals
MFXCheckableButton * menuCheckShowShapes
menu check to show Shapes
MFXCheckableButton * menuCheckToggleTAZRelOnlyFrom
menu check to toggle TAZRel only from
MFXCheckableButton * menuCheckToggleDrawJunctionShape
checkable button to show junction shapes
void buildDataViewOptionsMenuChecks()
build menu checks
MFXCheckableButton * menuCheckToggleTAZRelDrawing
menu check to toggle TAZ Rel drawing
MFXCheckableButton * menuCheckShowDemandElements
menu check to show Demand Elements
MFXCheckableButton * menuCheckToggleTAZRelOnlyTo
menu check to toggle TAZRel only to
MFXCheckableButton * routeDistributionButton
checkable button for edit mode create route distributions
MFXCheckableButton * containerButton
checkable button for edit mode create containers
MFXCheckableButton * moveDemandElementsButton
checkable button for edit mode "move demand elements"
MFXCheckableButton * typeButton
checkable button for edit mode create type
void buildDemandCheckableButtons()
build checkable buttons
MFXCheckableButton * vehicleButton
checkable button for edit mode create vehicles
MFXCheckableButton * containerPlanButton
checkable button for edit mode create container plans
MFXCheckableButton * routeButton
checkable button for edit mode create routes
MFXCheckableButton * stopButton
checkable button for edit mode create stops
MFXCheckableButton * personPlanButton
checkable button for edit mode create person plans
MFXCheckableButton * personButton
checkable button for edit mode create persons
void updateDemandCheckableButtons()
update Demand checkable buttons
MFXCheckableButton * typeDistributionButton
checkable button for edit mode create type distribution
void disableDemandCheckableButtons()
hide all options menu checks
struct used to group all variables related to view options in supermode Demand
MFXCheckableButton * menuCheckShowAllTrips
show all trips
void lockPerson(const GNEDemandElement *person)
lock person
MFXCheckableButton * menuCheckToggleGrid
menu check to show grid button
MFXCheckableButton * menuCheckToggleDrawJunctionShape
checkable button to show junction shapes
void lockContainer(const GNEDemandElement *container)
lock container
void buildDemandViewOptionsMenuChecks()
build menu checks
const GNEDemandElement * getLockedPerson() const
get locked person
MFXCheckableButton * menuCheckDrawSpreadVehicles
menu check to draw vehicles in begin position or spread in lane
MFXCheckableButton * menuCheckShowOverlappedRoutes
show overlapped routes
void hideDemandViewOptionsMenuChecks()
hide all options menu checks
MFXCheckableButton * menuCheckShowAllPersonPlans
show all person plans
MFXCheckableButton * menuCheckShowAllContainerPlans
show all container plans
MFXCheckableButton * menuCheckHideNonInspectedDemandElements
Hide non inspected demand elements.
MFXCheckableButton * menuCheckHideShapes
Hide shapes (Polygons and POIs)
MFXCheckableButton * menuCheckLockPerson
Lock Person.
MFXCheckableButton * menuCheckLockContainer
Lock Container.
struct used to group all variables related with Supermodes
DataEditMode dataEditMode
the current Data edit mode
void buildSuperModeButtons()
build checkable buttons
DemandEditMode demandEditMode
the current Demand edit mode
Supermode currentSupermode
the current supermode
NetworkEditMode networkEditMode
the current Network edit mode
bool isCurrentSupermodeDemand() const
@check if current supermode is Demand
void setDemandEditMode(DemandEditMode demandMode, const bool force=false)
set Demand edit mode
MFXCheckableButton * dataButton
checkable button for supermode Data
bool isCurrentSupermodeData() const
@check if current supermode is Data
void setView(FXSelector sel)
set view
bool isCurrentSupermodeNetwork() const
@check if current supermode is Network
MFXCheckableButton * networkButton
checkable button for supermode Network
bool isJuPedSimView() const
check if default view is enabled
void setSupermode(Supermode supermode, const bool force)
set supermode
MFXCheckableButton * demandButton
checkable button for supermode Demand
void setNetworkEditMode(NetworkEditMode networkMode, const bool force=false)
set Network edit mode
void setDataEditMode(DataEditMode dataMode, const bool force=false)
set Data edit mode
struct used to group all variables related with edit shapes of NetworkElements
GNENetworkElement * getEditedNetworkElement() const
pointer to edited network element
void startEditCustomShape(GNENetworkElement *element)
start edit custom shape
class used to group all variables related with mouse buttons and key pressed after certain events
bool shiftKeyPressed() const
check if SHIFT is pressed during current event
bool altKeyPressed() const
check if ALT is pressed during current event
void update(void *eventData)
update status of MouseButtonKeyPressed during current event
bool controlKeyPressed() const
check if CONTROL is pressed during current event
bool mouseLeftButtonPressed() const
check if mouse left button is pressed during current event
struct used to group all variables related with movement of groups of elements
void moveSelection(const bool mouseLeftButtonPressed)
move selection
bool isCurrentlyMovingMultipleElements() const
check if there are moving elements
void finishMoveSelection()
finish moving selection
bool isMovingSelection() const
check if currently there is element being moved
void resetMovingSelectedEdge()
reset flag for moving edge
struct used to group all variables related with movement of single elements
bool beginMoveSingleElementDemandMode()
begin move single element in Demand mode
void moveSingleElement(const bool mouseLeftButtonPressed)
move single element in Network AND Demand mode
bool isCurrentlyMovingSingleElement() const
check if there are moving elements
bool beginMoveSingleElementNetworkMode()
begin move single element in Network mode
bool beginMoveNetworkElementShape()
begin move network elementshape
void finishMoveSingleElement()
finish moving single elements in Network AND Demand mode
void updateNetworkCheckableButtons()
update network checkable buttons
MFXCheckableButton * trafficLightButton
checkable button for edit mode traffic light
MFXCheckableButton * moveNetworkElementsButton
checkable button for edit mode "move network elements"
MFXCheckableButton * additionalButton
checkable button for edit mode additional
MFXCheckableButton * crossingButton
checkable button for edit mode crossing
MFXCheckableButton * createEdgeButton
checkable button for edit mode create edge
MFXCheckableButton * prohibitionButton
checkable button for edit mode prohibition
void buildNetworkCheckableButtons()
build checkable buttons
MFXCheckableButton * shapeButton
checkable button for edit mode shape
MFXCheckableButton * connectionButton
checkable button for edit mode connection
MFXCheckableButton * TAZButton
checkable button for edit mode TAZ
void disableNetworkCheckableButtons()
hide all options menu checks
MFXCheckableButton * wireButton
checkable button for edit mode wires
MFXCheckableButton * decalButton
checkable button for edit mode decals
struct used to group all variables related to view options in supermode Network
MFXCheckableButton * menuCheckSelectEdges
checkable button to select only edges
MFXCheckableButton * menuCheckChainEdges
checkable button to the endpoint for a created edge should be set as the new source
MFXCheckableButton * menuCheckShowDemandElements
checkable button to show Demand Elements
MFXCheckableButton * menuCheckMoveElevation
checkable button to apply movement to elevation
MFXCheckableButton * menuCheckShowTAZElements
checkable button to show TAZ elements
MFXCheckableButton * menuCheckAutoOppositeEdge
check checkable to create auto create opposite edge
MFXCheckableButton * menuCheckDrawSpreadVehicles
checkable button to draw vehicles in begin position or spread in lane
MFXCheckableButton * menuCheckShowConnections
checkable button to show connections
MFXCheckableButton * menuCheckHideConnections
checkable button to hide connections in connect mode
MFXCheckableButton * menuCheckToggleDrawJunctionShape
checkable button to show junction shapes
MFXCheckableButton * menuCheckToggleGrid
checkable button to show grid button
bool selectEdges() const
check if select edges checkbox is enabled
MFXCheckableButton * menuCheckShowJunctionBubble
checkable button to show connection as bubble in "Move" mode.
MFXCheckableButton * menuCheckWarnAboutMerge
checkable button to we should warn about merging junctions
void hideNetworkViewOptionsMenuChecks()
hide all options menu checks
MFXCheckableButton * menuCheckShowAdditionalSubElements
checkable button to show additional sub-elements
void buildNetworkViewOptionsMenuChecks()
build menu checks
MFXCheckableButton * menuCheckChangeAllPhases
checkable button to set change all phases
MFXCheckableButton * menuCheckExtendSelection
checkable button to extend to edge nodes
struct used to group all variables related with save elements
void buildSaveElementsButtons()
build save buttons
void finishRectangleSelection()
finish rectangle selection
void drawRectangleSelection(const RGBColor &color) const
draw rectangle selection
void beginRectangleSelection()
begin rectangle selection
bool selectingUsingRectangle
whether we have started rectangle-selection
void moveRectangleSelection()
move rectangle selection
bool startDrawing
whether we have started rectangle-selection
void processRectangleSelection()
process rectangle Selection
std::vector< GNEEdge * > processEdgeRectangleSelection()
process rectangle Selection (only limited to Edges)
struct used to group all variables related with testing
void drawTestingElements(GUIMainWindow *mainWindow)
draw testing element
struct used to group all variables related with time format
void buildTimeFormatButtons()
build time format buttons
static const RGBColor TLSConnectionColor
connection color between E1/junctions and TLS
RGBColor selectionColor
basic selection color
static const double junctionBubbleRadius
junction bubble radius
double getExaggeration(const GUIVisualizationSettings &s, const GUIGlObject *o, double factor=20) const
return the drawing size including exaggeration and constantSize values