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
496 // draw all GL elements within the small boundary
497 drawGLElements(boundary);
498 // restore draw for object under cursor
500 // pop matrix
502 // check if update front element
505 }
506 // after draw elements, update objects under cursor
508}
509
510
511void
513 // clear post drawing elements
515 // set selection position in gObjectsInPosition
517 // create an small boundary
518 Boundary positionBoundary;
519 positionBoundary.add(pos);
520 positionBoundary.grow(POSITION_EPS);
521 // push matrix
523 // enable draw for view objects handler (this calculate the contours)
525 // draw all GL elements within the small boundary
526 drawGLElements(positionBoundary);
527 // check if filter edges that have the mouse over their geometry points
530 }
531 // restore draw for view objects handler (this calculate the contours)
533 // pop matrix
535 // check if update front element
538 }
539 // after draw elements, update objects under cursor
541}
542
543
544void
546 // if we're inspecting an element, add it to redraw path elements
547 for (const auto& AC : myInspectedElements.getACs()) {
548 const auto pathElement = dynamic_cast<const GNEPathElement*>(AC);
549 if (pathElement) {
551 }
552 }
553 // enable draw for view objects handler (this calculate the contours)
555 // push matrix
557 // redraw elements in buffer
561 // pop matrix
563 // disable drawForViewObjectsHandler
565}
566
567
572
573
578
579
580void
589
590
591bool
592GNEViewNet::setColorScheme(const std::string& name) {
593 if (!gSchemeStorage.contains(name)) {
594 return false;
595 }
596 if (myGUIDialogViewSettings != nullptr) {
599 }
600 }
603 return true;
604}
605
606
607void
609 // reimplemented from GUISUMOAbstractView due GNEOverlappedInspection
610 ungrab();
611 // make network current
612 if (isEnabled() && myAmInitialised) {
613 // check if we're cliking while alt button is pressed
615 // set clicked popup position
617 // create cursor popup dialog for mark front element
619 // open popup dialog
621 } else if (myViewObjectsSelector.getGLObjects().empty()) {
623 } else {
624 // declare filtered objects
625 std::vector<GUIGlObject*> filteredGLObjects;
626 // get GUIGLObject front
627 GUIGlObject* overlappedElement = nullptr;
628 // we need to check if we're inspecting a overlapping element
632 overlappedElement = myInspectedElements.getFirstAC()->getGUIGlObject();
633 filteredGLObjects.push_back(overlappedElement);
634 }
635 bool connections = false;
636 bool TLS = false;
637 // fill filtered objects
638 if ((myViewObjectsSelector.getGLObjects().size() == 1) && (myViewObjectsSelector.getGLObjects().back()->getType() == GLO_EDGE)) {
639 // special case for edge geometry points (because edges uses the lane pop ups)
640 filteredGLObjects.push_back(myViewObjectsSelector.getGLObjects().back());
641 } else {
642 for (const auto& glObject : myViewObjectsSelector.getGLObjects()) {
643 // always avoid edges
644 if (glObject->getType() == GLO_EDGE) {
645 continue;
646 }
647 if (glObject->getType() == GLO_CONNECTION) {
648 connections = true;
649 }
650 if (glObject->getType() == GLO_TLLOGIC) {
651 TLS = true;
652 }
653 filteredGLObjects.push_back(glObject);
654 }
655 auto it = filteredGLObjects.begin();
656 if (connections) {
657 // filter junctions if there are connections
658 while (it != filteredGLObjects.end()) {
659 if ((*it)->getType() == GLO_JUNCTION) {
660 it = filteredGLObjects.erase(it);
661 } else {
662 it++;
663 }
664 }
665 } else if (TLS) {
666 // filter all elements except TLLogic
667 while (it != filteredGLObjects.end()) {
668 if ((*it)->getType() != GLO_TLLOGIC) {
669 it = filteredGLObjects.erase(it);
670 } else {
671 it++;
672 }
673 }
674 }
675 }
676 // remove duplicated elements using an unordered set
677 auto itDuplicated = filteredGLObjects.begin();
678 std::unordered_set<GUIGlObject*> unorderedSet;
679 for (auto itElement = filteredGLObjects.begin(); itElement != filteredGLObjects.end(); itElement++) {
680 if (unorderedSet.insert(*itElement).second) {
681 *itDuplicated++ = *itElement;
682 }
683 }
684 filteredGLObjects.erase(itDuplicated, filteredGLObjects.end());
685 // open object dialog
686 openObjectDialog(filteredGLObjects);
687 }
688 }
689}
690
691
692void
693GNEViewNet::openDeleteDialogAtCursor(const std::vector<GUIGlObject*>& GLObjects) {
694 if (myPopup) {
695 destroyPopup();
696 }
697 // set clicked popup position
699 // create cursor popup dialog for delete element
701 myCreatedPopup = true;
702 // open popup dialog
704}
705
706
707void
708GNEViewNet::openSelectDialogAtCursor(const std::vector<GUIGlObject*>& GLObjects) {
709 if (myPopup) {
710 destroyPopup();
711 }
712 // set clicked popup position
714 // create cursor popup dialog for select element
716 myCreatedPopup = true;
717 // open popup dialog
719}
720
721
722void
724 // first check if we have to save gui settings in a file (only used for testing purposes)
725 const auto& neteditOptions = OptionsCont::getOptions();
726 if (neteditOptions.getString("gui-testing.setting-output").size() > 0) {
727 try {
728 // open output device
729 OutputDevice& output = OutputDevice::getDevice(neteditOptions.getString("gui-testing.setting-output"));
730 // save view settings
733 // save viewport (zoom, X, Y and Z)
739 output.closeTag();
740 output.closeTag();
741 // close output device
742 output.close();
743 } catch (...) {
744 WRITE_ERROR(TL("GUI-Settings cannot be saved in ") + neteditOptions.getString("gui-testing.setting-output"));
745 }
746 }
747}
748
749
752 return myEditModes;
753}
754
755
758 return myTestingMode;
759}
760
761
766
767
772
773
778
779
784
785
790
791
792void
795 assert(!scheme.isFixed());
796 double minValue = std::numeric_limits<double>::infinity();
797 double maxValue = -std::numeric_limits<double>::infinity();
798 // retrieve range
799 bool hasMissingData = false;
800 if (objectType == GLO_LANE) {
801 // XXX (see #3409) multi-colors are not currently handled. this is a quick hack
802 if (active == 9) {
803 active = 8; // segment height, fall back to start height
804 } else if (active == 11) {
805 active = 10; // segment incline, fall back to total incline
806 }
807 for (const auto& lane : myNet->getAttributeCarriers()->getLanes()) {
808 const double val = lane.second->getColorValue(s, active);
809 if (val == s.MISSING_DATA) {
810 hasMissingData = true;
811 continue;
812 }
813 minValue = MIN2(minValue, val);
814 maxValue = MAX2(maxValue, val);
815 }
816 } else if (objectType == GLO_JUNCTION) {
817 if (active == 3) {
818 for (const auto& junction : myNet->getAttributeCarriers()->getJunctions()) {
819 minValue = MIN2(minValue, junction.second->getPositionInView().z());
820 maxValue = MAX2(maxValue, junction.second->getPositionInView().z());
821 }
822 }
823 } else if (objectType == GLO_TAZRELDATA) {
824 if (active == 4) {
825 for (const auto& genericData : myNet->getAttributeCarriers()->getGenericDatas().at(SUMO_TAG_TAZREL)) {
826 const double value = genericData.second->getColorValue(s, active);
827 if (value == s.MISSING_DATA) {
828 continue;
829 }
830 minValue = MIN2(minValue, value);
831 maxValue = MAX2(maxValue, value);
832 }
833 }
834 }
836 scheme.clear();
837 // add threshold for every distinct value
838 std::set<SVCPermissions> codes;
839 for (const auto& lane : myNet->getAttributeCarriers()->getLanes()) {
840 codes.insert(lane.second->getParentEdge()->getNBEdge()->getPermissions(lane.second->getIndex()));
841 }
842 int step = MAX2(1, 360 / (int)codes.size());
843 int hue = 0;
844 for (SVCPermissions p : codes) {
845 scheme.addColor(RGBColor::fromHSV(hue, 1, 1), (double)p);
846 hue = (hue + step) % 360;
847 }
848 return;
849 }
850 buildMinMaxRainbow(s, scheme, rs, minValue, maxValue, hasMissingData);
851}
852
853
854void
855GNEViewNet::setStatusBarText(const std::string& text) {
856 myApp->setStatusBarText(text);
857}
858
859
860void
864
865
866bool
869 return false;
870 } else {
872 }
873}
874
875
876void
877GNEViewNet::setSelectorFrameScale(double selectionScale) {
879}
880
881
882bool
886
887
888bool
892
893
894bool
896 // first check if there are junctions to merging
897 if (gViewObjectsHandler.getMergingJunctions().size() > 1) {
898 // get junctions (this call is neccesary because merging junctions are constants)
899 auto movedJunction = myNet->getAttributeCarriers()->retrieveJunction(gViewObjectsHandler.getMergingJunctions().at(0)->getID());
900 auto targetJunction = myNet->getAttributeCarriers()->retrieveJunction(gViewObjectsHandler.getMergingJunctions().at(1)->getID());
901 if (askMergeJunctions(movedJunction, targetJunction)) {
902 // merge moved and targed junctions
903 myNet->mergeJunctions(movedJunction, targetJunction, myUndoList);
904 return true;
905 }
906 }
907 return false;
908}
909
910
911bool
912GNEViewNet::askMergeJunctions(const GNEJunction* movedJunction, const GNEJunction* targetJunction) {
913 // optionally ask for confirmation
915 WRITE_DEBUG("Opening FXMessageBox 'merge junctions'");
916 // open question box
917 const std::string header = TL("Confirm Junction Merger");
918 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()));
919 const FXuint answer = FXMessageBox::question(this, MBOX_YES_NO, header.c_str(), "%s", body.c_str());
920 if (answer != 1) { //1:yes, 2:no, 4:esc
921 // write warning if netedit is running in testing mode
922 if (answer == 2) {
923 WRITE_DEBUG("Closed FXMessageBox 'merge junctions' with 'No'");
924 } else if (answer == 4) {
925 WRITE_DEBUG("Closed FXMessageBox 'merge junctions' with 'ESC'");
926 }
927 return false;
928 } else {
929 // write warning if netedit is running in testing mode
930 WRITE_DEBUG("Closed FXMessageBox 'merge junctions' with 'Yes'");
931 }
932 }
933 return true;
934}
935
936
937bool
938GNEViewNet::aksChangeSupermode(const std::string& operation, Supermode expectedSupermode) {
939 // first check if ignore option is enabled
940 if (OptionsCont::getOptions().getBool("ignore-supermode-question")) {
941 return true;
942 }
943 std::string body;
944 if (expectedSupermode == Supermode::NETWORK) {
945 body = (operation + TL(" requires switch to network mode. Continue?"));
946 } else if (expectedSupermode == Supermode::DEMAND) {
947 body = (operation + TL(" requires switch to demand mode. Continue?"));
948 } else if (expectedSupermode == Supermode::DATA) {
949 body = (operation + TL(" requires switch to data mode. Continue?"));
950 } else {
951 throw ProcessError("invalid expected supermode");
952 }
953 // open question box
954 const auto answer = FXMessageBox::question(myApp, MBOX_YES_NO, TL("Confirm switch mode"), "%s", body.c_str());
955 // restore focus to view net
956 setFocus();
957 // return answer
958 if (answer == MBOX_CLICKED_YES) {
959 myEditModes.setSupermode(expectedSupermode, true);
960 return true;
961 } else {
962 return false;
963 }
964}
965
966
967bool
969 // separate conditions for code legibly
972 return (TLSMode && selectingDetectors);
973}
974
975
976bool
978 // separate conditions for code legibly
980 const bool selectingJunctions = myViewParent->getTLSEditorFrame()->getTLSJunction()->isJoiningJunctions();
981 return (TLSMode && selectingJunctions);
982}
983
984
989
990
995
996
997bool
999 // Get selected lanes
1000 const auto selectedLanes = myNet->getAttributeCarriers()->getSelectedLanes();
1001 // Declare map of edges and lanes
1002 std::map<GNEEdge*, GNELane*> mapOfEdgesAndLanes;
1003 // Iterate over selected lanes
1004 for (const auto& selectedLane : selectedLanes) {
1005 mapOfEdgesAndLanes[myNet->getAttributeCarriers()->retrieveEdge(selectedLane->getParentEdge()->getID())] = selectedLane;
1006 }
1007 // Throw warning dialog if there hare multiple lanes selected in the same edge
1008 if (mapOfEdgesAndLanes.size() != selectedLanes.size()) {
1009 const std::string header = TL("Multiple lane in the same edge selected");
1010 const std::string bodyA = TL("There are selected lanes that belong to the same edge.");
1011 const std::string bodyB = TLF("Only one lane per edge will be restricted to %.", toString(vclass));
1012 FXMessageBox::information(getApp(), MBOX_OK, header.c_str(), "%s", (bodyA + std::string("\n") + bodyB).c_str());
1013 }
1014 // If we handeln a set of lanes
1015 if (mapOfEdgesAndLanes.size() > 0) {
1016 // declare counter for number of Sidewalks
1017 int counter = 0;
1018 // iterate over selected lanes
1019 for (const auto& edgeLane : mapOfEdgesAndLanes) {
1020 if (edgeLane.first->hasRestrictedLane(vclass)) {
1021 counter++;
1022 }
1023 }
1024 // if all edges parent own a Sidewalk, stop function
1025 if (counter == (int)mapOfEdgesAndLanes.size()) {
1026 const std::string header = TLF("Set vclass to % for selected lanes", toString(vclass));
1027 const std::string body = TL("All lanes own already another lane in the same edge with a restriction for ");
1028 FXMessageBox::information(getApp(), MBOX_OK, header.c_str(), "%s", (body + toString(vclass) + ".").c_str());
1029 return 0;
1030 } else {
1031 WRITE_DEBUG("Opening FXMessageBox 'restrict lanes'");
1032 // Ask confirmation to user
1033 const std::string header = TLF("Set vclass to % for selected lanes", toString(vclass));
1034 const std::string body = TLF("% lanes will be restricted to %. Continue?", toString(mapOfEdgesAndLanes.size() - counter), toString(vclass));
1035 FXuint answer = FXMessageBox::question(getApp(), MBOX_YES_NO, header.c_str(), "%s", body.c_str());
1036 if (answer != 1) { //1:yes, 2:no, 4:esc
1037 // write warning if netedit is running in testing mode
1038 if (answer == 2) {
1039 WRITE_DEBUG("Closed FXMessageBox 'restrict lanes' with 'No'");
1040 } else if (answer == 4) {
1041 WRITE_DEBUG("Closed FXMessageBox 'restrict lanes' with 'ESC'");
1042 }
1043 return 0;
1044 } else {
1045 // write warning if netedit is running in testing mode
1046 WRITE_DEBUG("Closed FXMessageBox 'restrict lanes' with 'Yes'");
1047 }
1048 }
1049 // begin undo operation
1050 myUndoList->begin(lane, "restrict lanes to " + toString(vclass));
1051 // iterate over selected lanes
1052 for (const auto& edgeLane : mapOfEdgesAndLanes) {
1053 // Transform lane to Sidewalk
1054 myNet->restrictLane(vclass, edgeLane.second, myUndoList);
1055 }
1056 // end undo operation
1057 myUndoList->end();
1058 } else {
1059 // If only have a single lane, start undo/redo operation
1060 myUndoList->begin(lane, TL("restrict lane to ") + toString(vclass));
1061 // Transform lane to Sidewalk
1062 myNet->restrictLane(vclass, lane, myUndoList);
1063 // end undo operation
1064 myUndoList->end();
1065 }
1066 return 1;
1067}
1068
1069
1070bool
1071GNEViewNet::addRestrictedLane(GNELane* lane, SUMOVehicleClass vclass, const bool insertAtFront) {
1072 // Get selected edges
1073 const auto selectedEdges = myNet->getAttributeCarriers()->getSelectedEdges();
1074 // get selected lanes
1075 const auto selectedLanes = myNet->getAttributeCarriers()->getSelectedLanes();
1076 // Declare set of edges
1077 std::set<GNEEdge*> setOfEdges;
1078 // Fill set of edges with vector of edges
1079 for (const auto& edge : selectedEdges) {
1080 setOfEdges.insert(edge);
1081 }
1082 // iterate over selected lanes
1083 for (const auto& selectedLane : selectedLanes) {
1084 // Insert pointer to edge into set of edges (To avoid duplicates)
1085 setOfEdges.insert(myNet->getAttributeCarriers()->retrieveEdge(selectedLane->getParentEdge()->getID()));
1086 }
1087 // If we handeln a set of edges
1089 // declare counter for number of restrictions
1090 int counter = 0;
1091 // iterate over set of edges
1092 for (const auto& edge : setOfEdges) {
1093 // update counter if edge has already a restricted lane of type "vclass"
1094 if (edge->hasRestrictedLane(vclass)) {
1095 counter++;
1096 }
1097 }
1098 // if all lanes own a Sidewalk, stop function
1099 if (counter == (int)setOfEdges.size()) {
1100 const std::string header = TLF("Add vclass % to selected lanes", toString(vclass));
1101 const std::string body = TLF("All lanes own already another lane in the same edge with a restriction to %.", toString(vclass));
1102 FXMessageBox::information(getApp(), MBOX_OK, header.c_str(), "%s", body.c_str());
1103 return 0;
1104 } else {
1105 WRITE_DEBUG("Opening FXMessageBox 'restrict lanes'");
1106 // Ask confirmation to user
1107 const std::string header = TLF("Add vclass % to selected lanes", toString(vclass));
1108 const std::string body = TLF("% restrictions to % will be added. Continue?", toString(setOfEdges.size() - counter), toString(vclass));
1109 FXuint answer = FXMessageBox::question(getApp(), MBOX_YES_NO, header.c_str(), "%s", body.c_str());
1110 if (answer != 1) { //1:yes, 2:no, 4:esc
1111 // write warning if netedit is running in testing mode
1112 if (answer == 2) {
1113 WRITE_DEBUG("Closed FXMessageBox 'restrict lanes' with 'No'");
1114 } else if (answer == 4) {
1115 WRITE_DEBUG("Closed FXMessageBox 'restrict lanes' with 'ESC'");
1116 }
1117 return 0;
1118 } else {
1119 // write warning if netedit is running in testing mode
1120 WRITE_DEBUG("Closed FXMessageBox 'restrict lanes' with 'Yes'");
1121 }
1122 }
1123 // begin undo operation
1124 myUndoList->begin(lane, TL("add restrictions for ") + toString(vclass));
1125 // iterate over set of edges
1126 for (const auto& edge : setOfEdges) {
1127 // add restricted lane (guess target)
1128 myNet->addRestrictedLane(vclass, edge, -1, myUndoList);
1129 }
1130 // end undo operation
1131 myUndoList->end();
1132 } else {
1133 // If only have a single lane, start undo/redo operation
1134 myUndoList->begin(lane, TL("add vclass for ") + toString(vclass));
1135 // Add restricted lane
1136 if (vclass == SVC_PEDESTRIAN) {
1137 // always add pedestrian lanes on the right
1138 myNet->addRestrictedLane(vclass, lane->getParentEdge(), 0, myUndoList);
1139 } else if (vclass == SVC_IGNORING) {
1140 if (insertAtFront) {
1142 } else {
1144 }
1145 } else if (lane->getParentEdge()->getLanes().size() == 1) {
1146 // guess insertion position if there is only 1 lane
1147 myNet->addRestrictedLane(vclass, lane->getParentEdge(), -1, myUndoList);
1148 } else {
1149 myNet->addRestrictedLane(vclass, lane->getParentEdge(), lane->getIndex(), myUndoList);
1150 }
1151 // end undo/redo operation
1152 myUndoList->end();
1153 }
1154 return 1;
1155}
1156
1157
1158bool
1160 // Get selected edges
1161 const auto selectedEdges = myNet->getAttributeCarriers()->getSelectedEdges();
1162 // get selected lanes
1163 const auto selectedLanes = myNet->getAttributeCarriers()->getSelectedLanes();
1164 // Declare set of edges
1165 std::set<GNEEdge*> setOfEdges;
1166 // Fill set of edges with vector of edges
1167 for (const auto& edge : selectedEdges) {
1168 setOfEdges.insert(edge);
1169 }
1170 // iterate over selected lanes
1171 for (const auto& selectedLane : selectedLanes) {
1172 // Insert pointer to edge into set of edges (To avoid duplicates)
1173 setOfEdges.insert(myNet->getAttributeCarriers()->retrieveEdge(selectedLane->getParentEdge()->getID()));
1174 }
1175 // If we handeln a set of edges
1176 if (setOfEdges.size() > 0) {
1177 // declare counter for number of restrictions
1178 int counter = 0;
1179 // iterate over set of edges
1180 for (const auto& edge : setOfEdges) {
1181 // update counter if edge has already a restricted lane of type "vclass"
1182 if (edge->hasRestrictedLane(vclass)) {
1183 counter++;
1184 }
1185 }
1186 // if all lanes don't own a Sidewalk, stop function
1187 if (counter == 0) {
1188 const std::string header = TLF("Remove vclass % from selected lanes", toString(vclass));
1189 const std::string body = TLF("The selected lanes and edges don't have a restriction to %.", toString(vclass));
1190 FXMessageBox::information(getApp(), MBOX_OK, header.c_str(), "%s", body.c_str());
1191 return 0;
1192 } else {
1193 WRITE_DEBUG("Opening FXMessageBox 'restrict lanes'");
1194 // Ask confirmation to user
1195 const std::string header = TLF("Remove vclass % from selected lanes", toString(vclass));
1196 const std::string body = TLF("% restrictions to % will be removed. Continue?", toString(setOfEdges.size() - counter), toString(vclass));
1197 FXuint answer = FXMessageBox::question(getApp(), MBOX_YES_NO, header.c_str(), "%s", body.c_str());
1198 if (answer != 1) { //1:yes, 2:no, 4:esc
1199 // write warning if netedit is running in testing mode
1200 if (answer == 2) {
1201 WRITE_DEBUG("Closed FXMessageBox 'restrict lanes' with 'No'");
1202 } else if (answer == 4) {
1203 WRITE_DEBUG("Closed FXMessageBox 'restrict lanes' with 'ESC'");
1204 }
1205 return 0;
1206 } else {
1207 // write warning if netedit is running in testing mode
1208 WRITE_DEBUG("Closed FXMessageBox 'restrict lanes' with 'Yes'");
1209 }
1210 }
1211 // begin undo operation
1212 myUndoList->begin(lane, "Remove restrictions for " + toString(vclass));
1213 // iterate over set of edges
1214 for (const auto& edge : setOfEdges) {
1215 // add Sidewalk
1216 myNet->removeRestrictedLane(vclass, edge, myUndoList);
1217 }
1218 // end undo operation
1219 myUndoList->end();
1220 } else {
1221 // If only have a single lane, start undo/redo operation
1222 myUndoList->begin(lane, TL("Remove vclass for ") + toString(vclass));
1223 // Remove Sidewalk
1225 // end undo/redo operation
1226 myUndoList->end();
1227 }
1228 return 1;
1229}
1230
1231
1233 myViewObjectsSelector(this),
1234 myEditModes(this),
1235 myTestingMode(this),
1236 myCommonCheckableButtons(this),
1237 myNetworkCheckableButtons(this),
1238 myDemandCheckableButtons(this),
1239 myDataCheckableButtons(this),
1240 myNetworkViewOptions(this),
1241 myDemandViewOptions(this),
1242 myDataViewOptions(this),
1243 myIntervalBar(this),
1244 myMoveSingleElement(this),
1245 myMoveMultipleElements(this),
1246 myVehicleOptions(this),
1247 myVehicleTypeOptions(this),
1248 mySaveElements(this),
1249 myTimeFormat(this),
1250 mySelectingArea(this),
1251 myEditNetworkElementShapes(this),
1252 myLockManager(this) {
1253}
1254
1255
1256std::vector<std::string>
1258 std::set<std::string> keys;
1259 for (const NBEdge* e : myNet->getEdgeCont().getAllEdges()) {
1260 if (edgeKeys) {
1261 for (const auto& item : e->getParametersMap()) {
1262 keys.insert(item.first);
1263 }
1264 for (const auto& con : e->getConnections()) {
1265 for (const auto& item : con.getParametersMap()) {
1266 keys.insert(item.first);
1267 }
1268 }
1269 } else {
1270 for (const auto& lane : e->getLanes()) {
1271 int i = 0;
1272 for (const auto& item : lane.getParametersMap()) {
1273 keys.insert(item.first);
1274 }
1275 for (const auto& con : e->getConnectionsFromLane(i)) {
1276 for (const auto& item : con.getParametersMap()) {
1277 keys.insert(item.first);
1278 }
1279 }
1280 i++;
1281 }
1282 }
1283 }
1284 return std::vector<std::string>(keys.begin(), keys.end());
1285}
1286
1287
1288std::vector<std::string>
1290 std::set<std::string> keys;
1291 for (const auto& genericData : myNet->getAttributeCarriers()->getGenericDatas().at(GNE_TAG_EDGEREL_SINGLE)) {
1292 for (const auto& parameter : genericData.second->getACParametersMap()) {
1293 keys.insert(parameter.first);
1294 }
1295 }
1296 return std::vector<std::string>(keys.begin(), keys.end());
1297}
1298
1299
1300std::vector<std::string>
1302 std::set<std::string> keys;
1303 for (const auto& genericData : myNet->getAttributeCarriers()->getGenericDatas().at(SUMO_TAG_TAZREL)) {
1304 for (const auto& parameter : genericData.second->getACParametersMap()) {
1305 keys.insert(parameter.first);
1306 }
1307 }
1308 for (const auto& genericData : myNet->getAttributeCarriers()->getGenericDatas().at(SUMO_TAG_EDGEREL)) {
1309 for (const auto& parameter : genericData.second->getACParametersMap()) {
1310 keys.insert(parameter.first);
1311 }
1312 }
1313 return std::vector<std::string>(keys.begin(), keys.end());
1314}
1315
1316
1317bool
1321 return true;
1322 } else {
1323 return false;
1324 }
1325}
1326
1327
1328int
1332
1333
1334int
1335GNEViewNet::doPaintGL(int mode, const Boundary& drawingBoundary) {
1336 // set lefthand and laneIcons
1339 // first step: update objects under cursor
1341 // second step: redraw contour of path elements (needed if we're inspecting a path element like a route or trip)
1343 // set render modes
1344 glRenderMode(mode);
1345 glMatrixMode(GL_MODELVIEW);
1347 glDisable(GL_TEXTURE_2D);
1348 glDisable(GL_ALPHA_TEST);
1349 glEnable(GL_BLEND);
1350 glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
1351 glEnable(GL_DEPTH_TEST);
1352 // visualize rectangular selection
1354 // draw certain elements only if we aren't in rectangle selection mode
1356 // draw decals
1357 drawDecals();
1358 // draw grid (and update grid button)
1359 drawGrid();
1360 // update show connections
1362 // draw temporal junction
1364 // draw temporal drawing shape
1366 // draw testing elements
1368 // draw temporal E2 multilane detectors
1370 // draw temporal overhead wires
1372 // draw temporal trip/flow route
1374 // draw temporal person plan route
1377 // draw temporal container plan route
1380 // draw temporal route
1382 // draw temporal edgeRelPath
1384 }
1385 // check menu checks of supermode demand
1387 // enable or disable menuCheckShowAllPersonPlans depending of there is a locked person
1390 } else {
1392 }
1393 }
1394 // clear pathDraw
1398 // update ignore hide by zoom
1400 // draw network (boundary
1402 // draw all GL elements
1403 int hits = drawGLElements(drawingBoundary);
1404 // draw temporal split junction
1406 // draw temporal roundabout
1408 // draw temporal lines between E1 detectors and junctions in TLS Mode
1410 // draw temporal lines between junctions in TLS Mode
1412 // draw netedit attributes references
1414 // draw test circle
1416 // pop draw matrix
1418 // update interval bar
1420 // check if recopute boundaries (Deactivated, continue after 1.14 release)
1421 /*
1422 if (gObjectsInPosition.recomputeBoundaries != GLO_NETWORK) {
1423 myNet->getGrid().updateBoundaries(gObjectsInPosition.recomputeBoundaries);
1424 }
1425 */
1426 return hits;
1427}
1428
1429
1430long
1431GNEViewNet::onLeftBtnPress(FXObject*, FXSelector, void* eventData) {
1432 // set focus in view net
1433 setFocus();
1434 // update MouseButtonKeyPressed
1436 // process left button press function depending of supermode
1441 } else if (myEditModes.isCurrentSupermodeData()) {
1442 processLeftButtonPressData(eventData);
1443 }
1444 // update cursor
1445 updateCursor();
1446 // update view
1447 updateViewNet();
1448 return 1;
1449}
1450
1451
1452long
1453GNEViewNet::onLeftBtnRelease(FXObject* obj, FXSelector sel, void* eventData) {
1454 // avoid closing Popup dialog in Linux
1455 if (myCreatedPopup) {
1456 myCreatedPopup = false;
1457 return 1;
1458 }
1459 // process parent function
1460 GUISUMOAbstractView::onLeftBtnRelease(obj, sel, eventData);
1461 // update MouseButtonKeyPressed
1463 // process left button release function depending of supermode
1468 } else if (myEditModes.isCurrentSupermodeData()) {
1470 }
1471 // update cursor
1472 updateCursor();
1473 // update view
1474 updateViewNet();
1475 return 1;
1476}
1477
1478
1479long
1480GNEViewNet::onMiddleBtnPress(FXObject* obj, FXSelector sel, void* eventData) {
1481 // process parent function
1482 GUISUMOAbstractView::onMiddleBtnPress(obj, sel, eventData);
1483 // update cursor
1484 updateCursor();
1485 // update view
1486 updateViewNet();
1487 return 1;
1488}
1489
1490
1491long
1492GNEViewNet::onMiddleBtnRelease(FXObject* obj, FXSelector sel, void* eventData) {
1493 // process parent function
1494 GUISUMOAbstractView::onMiddleBtnRelease(obj, sel, eventData);
1495 // update cursor
1496 updateCursor();
1497 // update view
1498 updateViewNet();
1499 return 1;
1500}
1501
1502
1503long
1504GNEViewNet::onRightBtnPress(FXObject* obj, FXSelector sel, void* eventData) {
1505 // update MouseButtonKeyPressed
1507 // update cursor
1508 updateCursor();
1510 // disable right button press during drawing polygon
1511 return 1;
1512 } else {
1513 return GUISUMOAbstractView::onRightBtnPress(obj, sel, eventData);
1514 }
1515}
1516
1517
1518long
1519GNEViewNet::onRightBtnRelease(FXObject* obj, FXSelector sel, void* eventData) {
1520 // update MouseButtonKeyPressed
1522 // update cursor
1523 updateCursor();
1524 // disable right button release during drawing polygon
1526 return 1;
1527 } else {
1528 return GUISUMOAbstractView::onRightBtnRelease(obj, sel, eventData);
1529 }
1530}
1531
1532
1533long
1534GNEViewNet::onMouseMove(FXObject* obj, FXSelector sel, void* eventData) {
1535 // process mouse move in GUISUMOAbstractView
1536 GUISUMOAbstractView::onMouseMove(obj, sel, eventData);
1537 // update MouseButtonKeyPressed
1539 // update cursor
1540 updateCursor();
1541 // process mouse move function depending of supermode
1546 } else if (myEditModes.isCurrentSupermodeData()) {
1548 }
1549 // update view
1550 updateViewNet();
1551 return 1;
1552}
1553
1554
1555long
1556GNEViewNet::onKeyPress(FXObject* o, FXSelector sel, void* eventData) {
1557 // update MouseButtonKeyPressed
1559 // update cursor
1560 updateCursor();
1561 // continue depending of current edit mode
1563 // update viewNet (for temporal junction)
1564 updateViewNet();
1566 // change "delete last created point" depending of shift key
1569 // change "delete last created point" depending of shift key
1572 updateViewNet();
1573 }
1574 return GUISUMOAbstractView::onKeyPress(o, sel, eventData);
1575}
1576
1577
1578long
1579GNEViewNet::onKeyRelease(FXObject* o, FXSelector sel, void* eventData) {
1580 // update MouseButtonKeyPressed
1582 // update cursor
1583 updateCursor();
1584 // continue depending of current edit mode
1586 // update viewNet (for temporal junction)
1587 updateViewNet();
1589 // change "delete last created point" depending of shift key
1592 // change "delete last created point" depending of shift key
1595 updateViewNet();
1596 }
1597 // check if selecting using rectangle has to be disabled
1600 updateViewNet();
1601 }
1602 return GUISUMOAbstractView::onKeyRelease(o, sel, eventData);
1603}
1604
1605
1606void
1607GNEViewNet::abortOperation(bool clearSelection) {
1608 // steal focus from any text fields and place it over view net
1609 setFocus();
1610 // check what supermode is enabled
1612 // abort operation depending of current mode
1614 // abort edge creation in create edge frame
1618 // check if current selection has to be cleaned
1619 if (clearSelection) {
1621 }
1623 // abort changes in Connector Frame
1626 // continue depending of current TLS frame state
1631 } else {
1633 }
1639 // abort current drawing
1643 // abort current drawing
1645 } else if (myViewParent->getTAZFrame()->getCurrentTAZModule()->getTAZ() != nullptr) {
1646 // finish current editing TAZ
1648 }
1652 // abort both network elements selections
1655 // abort path
1658 // abort path
1660 }
1662 // abort operation depending of current mode
1665 // check if current selection has to be cleaned
1666 if (clearSelection) {
1668 }
1681 }
1682 } else if (myEditModes.isCurrentSupermodeData()) {
1683 // abort operation depending of current mode
1686 // check if current selection has to be cleaned
1687 if (clearSelection) {
1689 }
1694 }
1695 }
1696 // abort undo list
1698 // update view
1699 updateViewNet();
1700}
1701
1702
1703void
1705 // delete elements depending of current supermode
1708 setStatusBarText(TL("Cannot delete in this mode"));
1710 // delete inspected elements
1711 myUndoList->begin(GUIIcon::MODEDELETE, TL("delete network inspected elements"));
1714 }
1715 myUndoList->end();
1716 } else {
1717 // get selected ACs
1718 const auto selectedNetworkACs = myNet->getAttributeCarriers()->getSelectedAttributeCarriers(false);
1719 // delete selected elements
1720 if (selectedNetworkACs.size() > 0) {
1721 myUndoList->begin(GUIIcon::MODEDELETE, TL("delete network selection"));
1722 for (const auto selectedAC : selectedNetworkACs) {
1724 }
1725 myUndoList->end();
1726 }
1727 }
1730 // delete inspected elements
1731 myUndoList->begin(GUIIcon::MODEDELETE, TL("delete demand inspected elements"));
1734 }
1735 myUndoList->end();
1736 } else {
1737 // get selected ACs
1738 const auto selectedDemandACs = myNet->getAttributeCarriers()->getSelectedAttributeCarriers(false);
1739 // delete selected elements
1740 if (selectedDemandACs.size() > 0) {
1741 myUndoList->begin(GUIIcon::MODEDELETE, TL("delete demand selection"));
1742 for (const auto selectedAC : selectedDemandACs) {
1743 deleteDemandAttributeCarrier(selectedAC);
1744 }
1745 myUndoList->end();
1746 }
1747 }
1748 } else if (myEditModes.isCurrentSupermodeData()) {
1750 // delete inspected elements
1751 myUndoList->begin(GUIIcon::MODEDELETE, TL("delete data inspected elements"));
1754 }
1755 myUndoList->end();
1756 } else {
1757 // get selected ACs
1758 const auto selectedDataACs = myNet->getAttributeCarriers()->getSelectedAttributeCarriers(false);
1759 // delete selected elements
1760 if (selectedDataACs.size() > 0) {
1761 myUndoList->begin(GUIIcon::MODEDELETE, TL("delete data selection"));
1762 for (const auto selectedAC : selectedDataACs) {
1763 deleteDataAttributeCarrier(selectedAC);
1764 }
1765 myUndoList->end();
1766 }
1767 }
1768 }
1769}
1770
1771
1772void
1774 // check what supermode is enabled
1776 // abort operation depending of current mode
1778 // Accept changes in Connector Frame
1781 // continue depending of current TLS frame state
1788 }
1793 // stop current drawing
1795 } else {
1796 // start drawing
1798 }
1803 // stop current drawing
1805 } else if (myViewParent->getTAZFrame()->getCurrentTAZModule()->getTAZ() == nullptr) {
1806 // start drawing
1809 // save pending changes
1811 }
1813 // create path element
1816 // create path element
1818 }
1823 myViewParent->getVehicleFrame()->getPathCreator()->onCmdCreatePath(nullptr, 0, nullptr);
1825 myViewParent->getPersonFrame()->getPlanCreator()->onCmdCreatePath(nullptr, 0, nullptr);
1832 }
1833 } else if (myEditModes.isCurrentSupermodeData()) {
1838 }
1839 }
1840}
1841
1842
1843void
1845 // check what supermode is enabled
1849 }
1863 }
1864 } else if (myEditModes.isCurrentSupermodeData()) {
1867 }
1868 }
1869}
1870
1871void
1873 // if there is a visible frame, set focus over it. In other case, set focus over ViewNet
1874 if (myCurrentFrame != nullptr) {
1876 } else {
1877 setFocus();
1878 }
1879}
1880
1881
1884 return myViewParent;
1885}
1886
1887
1888GNENet*
1890 return myNet;
1891}
1892
1893
1896 return myUndoList;
1897}
1898
1899
1904
1905
1910
1911
1916
1917
1922
1923
1924const GUIGlObject*
1928 } else {
1929 return nullptr;
1930 }
1931}
1932
1933
1934void
1939
1940
1941void
1942GNEViewNet::drawTranslateFrontAttributeCarrier(const GNEAttributeCarrier* AC, double typeOrLayer, const double extraOffset) {
1943 if (myFrontAttributeCarrier == AC) {
1944 glTranslated(0, 0, GLO_FRONTELEMENT + extraOffset);
1945 } else {
1946 glTranslated(0, 0, typeOrLayer + extraOffset);
1947 }
1948}
1949
1950
1951bool
1955
1956
1957bool
1958GNEViewNet::checkOverLockedElement(const GUIGlObject* GLObject, const bool isSelected) const {
1959 // check if elemet is blocked
1960 if (myLockManager.isObjectLocked(GLObject->getType(), isSelected)) {
1961 return false;
1962 }
1963 // get front GLObject
1964 const auto glObjectFront = myViewObjectsSelector.getGUIGlObjectFront();
1965 // check if element is under cursor
1966 if (glObjectFront) {
1967 if (glObjectFront == GLObject) {
1968 return true;
1969 } else if (glObjectFront->getType() == GLObject->getType()) {
1970 for (const auto& glObjectUnderCursor : myViewObjectsSelector.getGLObjects()) {
1971 if (glObjectUnderCursor == GLObject) {
1972 return true;
1973 }
1974 }
1975 }
1976 }
1977 return false;
1978}
1979
1980
1985
1986
1987void
1989 myLastCreatedRoute = lastCreatedRoute;
1990}
1991
1992
1995 // get first object that can be found in their container
1996 for (const auto& glObjectLayer : gViewObjectsHandler.getSelectedObjects()) {
1997 for (const auto& glObject : glObjectLayer.second) {
1998 auto junction = myNet->getAttributeCarriers()->retrieveJunction(glObject.object->getMicrosimID(), false);
1999 if (junction) {
2000 return junction;
2001 }
2002 }
2003 }
2004 return nullptr;
2005}
2006
2007
2010 // get first object that can be found in their container
2011 for (const auto& glObjectLayer : gViewObjectsHandler.getSelectedObjects()) {
2012 for (const auto& glObject : glObjectLayer.second) {
2013 auto connection = myNet->getAttributeCarriers()->retrieveConnection(glObject.object, false);
2014 if (connection) {
2015 return connection;
2016 }
2017 }
2018 }
2019 return nullptr;
2020}
2021
2022
2025 // get first object that can be found in their container
2026 for (const auto& glObjectLayer : gViewObjectsHandler.getSelectedObjects()) {
2027 for (const auto& glObject : glObjectLayer.second) {
2028 auto crossing = myNet->getAttributeCarriers()->retrieveCrossing(glObject.object, false);
2029 if (crossing) {
2030 return crossing;
2031 }
2032 }
2033 }
2034 return nullptr;
2035}
2036
2037
2040 // get first object that can be found in their container
2041 for (const auto& glObjectLayer : gViewObjectsHandler.getSelectedObjects()) {
2042 for (const auto& glObject : glObjectLayer.second) {
2043 auto walkingArea = myNet->getAttributeCarriers()->retrieveWalkingArea(glObject.object, false);
2044 if (walkingArea) {
2045 return walkingArea;
2046 }
2047 }
2048 }
2049 return nullptr;
2050}
2051
2052
2053GNEEdge*
2055 // get first object that can be found in their container
2056 for (const auto& glObjectLayer : gViewObjectsHandler.getSelectedObjects()) {
2057 for (const auto& glObject : glObjectLayer.second) {
2058 auto edge = myNet->getAttributeCarriers()->retrieveEdge(glObject.object->getMicrosimID(), false);
2059 if (edge) {
2060 return edge;
2061 }
2062 }
2063 }
2064 return nullptr;
2065}
2066
2067
2068GNELane*
2070 // get first object that can be found in their container
2071 for (const auto& glObjectLayer : gViewObjectsHandler.getSelectedObjects()) {
2072 for (const auto& glObject : glObjectLayer.second) {
2073 auto lane = myNet->getAttributeCarriers()->retrieveLane(glObject.object, false);
2074 if (lane) {
2075 return lane;
2076 }
2077 }
2078 }
2079 return nullptr;
2080}
2081
2082
2085 // get first object that can be found in their container
2086 for (const auto& glObjectLayer : gViewObjectsHandler.getSelectedObjects()) {
2087 for (const auto& glObject : glObjectLayer.second) {
2088 auto additionalElement = myNet->getAttributeCarriers()->retrieveAdditional(glObject.object, false);
2089 if (additionalElement) {
2090 return additionalElement;
2091 }
2092 }
2093 }
2094 return nullptr;
2095}
2096
2097
2100 // get first object that can be found in their container
2101 for (const auto& glObjectLayer : gViewObjectsHandler.getSelectedObjects()) {
2102 for (const auto& glObject : glObjectLayer.second) {
2103 auto demandElement = myNet->getAttributeCarriers()->retrieveDemandElement(glObject.object, false);
2104 if (demandElement) {
2105 return demandElement;
2106 }
2107 }
2108 }
2109 return nullptr;
2110}
2111
2112
2113GNEPoly*
2115 // get first object that can be parsed to poly element
2116 for (const auto& glObjectLayer : gViewObjectsHandler.getSelectedObjects()) {
2117 for (const auto& glObject : glObjectLayer.second) {
2118 auto polygon = dynamic_cast<GNEPoly*>(myNet->getAttributeCarriers()->retrieveAdditional(glObject.object, false));
2119 if (polygon) {
2120 return polygon;
2121 }
2122 }
2123 }
2124 return nullptr;
2125}
2126
2127
2128GNEPOI*
2130 // get first object that can be parsed to POI element
2131 for (const auto& glObjectLayer : gViewObjectsHandler.getSelectedObjects()) {
2132 for (const auto& glObject : glObjectLayer.second) {
2133 auto POI = dynamic_cast<GNEPOI*>(myNet->getAttributeCarriers()->retrieveAdditional(glObject.object, false));
2134 if (POI) {
2135 return POI;
2136 }
2137 }
2138 }
2139 return nullptr;
2140}
2141
2142
2143GNETAZ*
2145 // get first object that can be parsed to TAZ element
2146 for (const auto& glObjectLayer : gViewObjectsHandler.getSelectedObjects()) {
2147 for (const auto& glObject : glObjectLayer.second) {
2148 auto TAZ = dynamic_cast<GNETAZ*>(myNet->getAttributeCarriers()->retrieveAdditional(glObject.object, false));
2149 if (TAZ) {
2150 return TAZ;
2151 }
2152 }
2153 }
2154 return nullptr;
2155}
2156
2157
2160 // get first object that can be parsed to TAZ element
2161 for (const auto& glObjectLayer : gViewObjectsHandler.getSelectedObjects()) {
2162 for (const auto& glObject : glObjectLayer.second) {
2163 if (glObject.object->getType() == GLO_JUNCTION) {
2164 auto junction = myNet->getAttributeCarriers()->retrieveJunction(glObject.object->getMicrosimID());
2165 if (junction->isShapeEdited()) {
2166 return junction;
2167 }
2168 } else if (glObject.object->getType() == GLO_CROSSING) {
2169 auto crossing = myNet->getAttributeCarriers()->retrieveCrossing(glObject.object);
2170 if (crossing->isShapeEdited()) {
2171 return crossing;
2172 }
2173 } else if (glObject.object->getType() == GLO_CONNECTION) {
2174 auto connection = myNet->getAttributeCarriers()->retrieveConnection(glObject.object);
2175 if (connection->isShapeEdited()) {
2176 return connection;
2177 }
2178 }
2179 }
2180 }
2181 return nullptr;
2182}
2183
2184
2185long
2186GNEViewNet::onCmdSetSupermode(FXObject*, FXSelector sel, void*) {
2187 // check what network mode will be set
2188 switch (FXSELID(sel)) {
2190 if (myEditModes.networkButton->shown()) {
2192 }
2193 break;
2195 if (myEditModes.demandButton->shown()) {
2197 }
2198 break;
2200 if (myEditModes.dataButton->shown()) {
2202 }
2203 break;
2204 default:
2205 break;
2206 }
2207 return 1;
2208}
2209
2210
2211long
2212GNEViewNet::onCmdSetMode(FXObject*, FXSelector sel, void*) {
2213 // first filter modes depending of view
2215 // network
2217 switch (FXSELID(sel)) {
2218 // common
2222 // infrastructure
2227 // shapes
2230 break;
2231 default:
2232 return 0;
2233 }
2234 }
2235 // demand
2237 switch (FXSELID(sel)) {
2238 // common
2242 // persons
2245 // routes
2248 // types
2251 break;
2252 default:
2253 return 0;
2254 }
2255 }
2256 // data
2258 // all modes disabled
2259 return 0;
2260 }
2261 }
2262 // continue depending of supermode
2264 // check what network mode will be set
2265 switch (FXSELID(sel)) {
2268 break;
2271 break;
2274 break;
2277 break;
2280 break;
2283 break;
2286 break;
2289 break;
2292 break;
2295 break;
2298 break;
2301 break;
2304 break;
2307 break;
2308 default:
2309 break;
2310 }
2312 // check what demand mode will be set
2313 switch (FXSELID(sel)) {
2316 break;
2319 break;
2322 break;
2325 break;
2328 break;
2331 break;
2334 break;
2337 break;
2340 break;
2343 break;
2346 break;
2349 break;
2352 break;
2355 break;
2356 default:
2357 break;
2358 }
2359 } else if (myEditModes.isCurrentSupermodeData()) {
2360 // check what demand mode will be set
2361 switch (FXSELID(sel)) {
2364 break;
2367 break;
2370 break;
2373 break;
2376 break;
2379 break;
2382 break;
2383 default:
2384 break;
2385 }
2386 }
2387 return 1;
2388}
2389
2390
2391long
2392GNEViewNet::onCmdSplitEdge(FXObject*, FXSelector, void*) {
2394 if (edge != nullptr) {
2396 }
2397 return 1;
2398}
2399
2400
2401long
2402GNEViewNet::onCmdSplitEdgeBidi(FXObject*, FXSelector, void*) {
2404 if (edge != nullptr) {
2405 // obtain reverse edge
2406 const auto oppositeEdges = edge->getOppositeEdges();
2407 // check that reverse edge works
2408 if (oppositeEdges.size() > 0) {
2409 for (const auto& oppositeEdge : oppositeEdges) {
2410 // get reverse inner geometry
2411 const auto reverseGeometry = oppositeEdge->getNBEdge()->getInnerGeometry().reverse();
2412 if (reverseGeometry == edge->getNBEdge()->getInnerGeometry()) {
2413 myNet->splitEdgesBidi(edge, oppositeEdge, edge->getSplitPos(getPopupPosition()), myUndoList);
2414 return 1;
2415 }
2416 }
2417 }
2418 }
2419 return 1;
2420}
2421
2422
2423long
2424GNEViewNet::onCmdReverseEdge(FXObject*, FXSelector, void*) {
2426 if (edge != nullptr) {
2427 if (edge->isAttributeCarrierSelected()) {
2428 myUndoList->begin(edge, TL("Reverse selected edges"));
2429 const auto selectedEdges = myNet->getAttributeCarriers()->getSelectedEdges();
2430 for (const auto& selectedEdge : selectedEdges) {
2431 myNet->reverseEdge(selectedEdge, myUndoList);
2432 }
2433 myUndoList->end();
2434 } else {
2435 myUndoList->begin(edge, TL("Reverse edge"));
2437 myUndoList->end();
2438 }
2439 }
2440 return 1;
2441}
2442
2443
2444long
2445GNEViewNet::onCmdAddReversedEdge(FXObject*, FXSelector, void*) {
2447 if (edge != nullptr) {
2448 if (edge->isAttributeCarrierSelected()) {
2449 myUndoList->begin(edge, TL("Add Reverse edge for selected edges"));
2450 const auto selectedEdges = myNet->getAttributeCarriers()->getSelectedEdges();
2451 for (const auto& selectedEdge : selectedEdges) {
2452 myNet->addReversedEdge(selectedEdge, false, myUndoList);
2453 }
2454 myUndoList->end();
2455 } else {
2456 myUndoList->begin(edge, TL("Add reverse edge"));
2457 myNet->addReversedEdge(edge, false, myUndoList);
2458 myUndoList->end();
2459 }
2460 }
2461 return 1;
2462}
2463
2464
2465long
2468 if (edge != nullptr) {
2469 if (edge->isAttributeCarrierSelected()) {
2470 myUndoList->begin(edge, TL("Add Reverse disconnected edge for selected edges"));
2471 const auto selectedEdges = myNet->getAttributeCarriers()->getSelectedEdges();
2472 for (const auto& selectedEdge : selectedEdges) {
2473 myNet->addReversedEdge(selectedEdge, true, myUndoList);
2474 }
2475 myUndoList->end();
2476 } else {
2477 myUndoList->begin(edge, TL("Add reverse disconnected edge"));
2478 myNet->addReversedEdge(edge, true, myUndoList);
2479 myUndoList->end();
2480 }
2481 }
2482 return 1;
2483}
2484
2485
2486long
2487GNEViewNet::onCmdEditEdgeEndpoint(FXObject*, FXSelector, void*) {
2489 if (edge != nullptr) {
2490 // snap to active grid the Popup position
2492 }
2493 return 1;
2494}
2495
2496
2497long
2498GNEViewNet::onCmdResetEdgeEndpoint(FXObject*, FXSelector, void*) {
2500 if (edge != nullptr) {
2501 // check if edge is selected
2502 if (edge->isAttributeCarrierSelected()) {
2503 // get all selected edges
2504 const auto selectedEdges = myNet->getAttributeCarriers()->getSelectedEdges();
2505 // begin operation
2506 myUndoList->begin(edge, TL("reset geometry points"));
2507 // iterate over selected edges
2508 for (const auto& selectedEdge : selectedEdges) {
2509 // reset both end points
2510 selectedEdge->resetBothEndpoint(myUndoList);
2511 }
2512 // end operation
2513 myUndoList->end();
2514 } else {
2516 }
2517 }
2518 return 1;
2519}
2520
2521
2522long
2523GNEViewNet::onCmdStraightenEdges(FXObject*, FXSelector, void*) {
2525 if (edge != nullptr) {
2526 if (edge->isAttributeCarrierSelected()) {
2527 myUndoList->begin(edge, TL("straighten selected edges"));
2528 const auto selectedEdges = myNet->getAttributeCarriers()->getSelectedEdges();
2529 for (const auto& selectedEdge : selectedEdges) {
2530 selectedEdge->setAttribute(SUMO_ATTR_SHAPE, "", myUndoList);
2531 }
2532 myUndoList->end();
2533 } else {
2534
2535 myUndoList->begin(edge, TL("straighten edge"));
2537 myUndoList->end();
2538 }
2539 }
2540 return 1;
2541}
2542
2543
2544long
2545GNEViewNet::onCmdSmoothEdges(FXObject*, FXSelector, void*) {
2547 if (edge != nullptr) {
2548 if (edge->isAttributeCarrierSelected()) {
2549 myUndoList->begin(edge, TL("smooth selected edges"));
2550 const auto selectedEdges = myNet->getAttributeCarriers()->getSelectedEdges();
2551 for (const auto& selectedEdge : selectedEdges) {
2552 selectedEdge->smooth(myUndoList);
2553 }
2554 myUndoList->end();
2555 } else {
2556 myUndoList->begin(edge, TL("smooth edge"));
2557 edge->smooth(myUndoList);
2558 myUndoList->end();
2559 }
2560 }
2561 return 1;
2562}
2563
2564
2565long
2566GNEViewNet::onCmdStraightenEdgesElevation(FXObject*, FXSelector, void*) {
2568 if (edge != nullptr) {
2569 if (edge->isAttributeCarrierSelected()) {
2570 myUndoList->begin(edge, TL("straighten elevation of selected edges"));
2571 const auto selectedEdges = myNet->getAttributeCarriers()->getSelectedEdges();
2572 for (const auto& selectedEdge : selectedEdges) {
2573 selectedEdge->straightenElevation(myUndoList);
2574 }
2575 myUndoList->end();
2576 } else {
2577 myUndoList->begin(edge, TL("straighten edge elevation"));
2579 myUndoList->end();
2580 }
2581 }
2582 return 1;
2583}
2584
2585
2586long
2587GNEViewNet::onCmdSmoothEdgesElevation(FXObject*, FXSelector, void*) {
2589 if (edge != nullptr) {
2590 if (edge->isAttributeCarrierSelected()) {
2591 myUndoList->begin(edge, TL("smooth elevation of selected edges"));
2592 const auto selectedEdges = myNet->getAttributeCarriers()->getSelectedEdges();
2593 for (const auto& selectedEdge : selectedEdges) {
2594 selectedEdge->smoothElevation(myUndoList);
2595 }
2596 myUndoList->end();
2597 } else {
2598 myUndoList->begin(edge, TL("smooth edge elevation"));
2600 myUndoList->end();
2601 }
2602 }
2603 return 1;
2604}
2605
2606
2607long
2608GNEViewNet::onCmdResetLength(FXObject*, FXSelector, void*) {
2610 if (edge != nullptr) {
2611 if (edge->isAttributeCarrierSelected()) {
2612 myUndoList->begin(edge, TL("reset edge lengths"));
2613 const auto selectedEdges = myNet->getAttributeCarriers()->getSelectedEdges();
2614 for (const auto& selectedEdge : selectedEdges) {
2615 selectedEdge->setAttribute(SUMO_ATTR_LENGTH, "-1", myUndoList);
2616 }
2617 myUndoList->end();
2618 } else {
2620 }
2621 }
2622 return 1;
2623}
2624
2625
2626long
2627GNEViewNet::onCmdEdgeUseAsTemplate(FXObject*, FXSelector, void*) {
2629 if (edge != nullptr) {
2631 }
2632 return 1;
2633}
2634
2635
2636long
2637GNEViewNet::onCmdEgeApplyTemplate(FXObject*, FXSelector, void*) {
2638 GNEEdge* edgeAtPosition = getEdgeAtPopupPosition();
2639 if ((edgeAtPosition != nullptr) && myViewParent->getInspectorFrame()->getTemplateEditor()->getEdgeTemplate()) {
2640 // begin copy template
2641 myUndoList->begin(edgeAtPosition, TL("copy edge template"));
2642 if (edgeAtPosition->isAttributeCarrierSelected()) {
2643 // copy template in all selected edges
2644 for (const auto& edge : myNet->getAttributeCarriers()->getEdges()) {
2645 if (edge.second->isAttributeCarrierSelected()) {
2646 edge.second->copyTemplate(myViewParent->getInspectorFrame()->getTemplateEditor()->getEdgeTemplate(), myUndoList);
2647 }
2648 }
2649 } else {
2650 // copy template
2652 }
2653 // end copy template
2654 myUndoList->end();
2655 }
2656 return 1;
2657}
2658
2659
2660long
2661GNEViewNet::onCmdSimplifyShape(FXObject*, FXSelector, void*) {
2662 // get polygon under mouse
2663 GNEPoly* polygonUnderMouse = getPolygonAtPopupPosition();
2664 // check polygon
2665 if (polygonUnderMouse) {
2666 // check if shape is selected
2667 if (polygonUnderMouse->isAttributeCarrierSelected()) {
2668 // begin undo-list
2669 myNet->getViewNet()->getUndoList()->begin(polygonUnderMouse, TL("simplify shapes"));
2670 // get shapes
2671 const auto selectedShapes = myNet->getAttributeCarriers()->getSelectedShapes();
2672 // iterate over shapes
2673 for (const auto& selectedShape : selectedShapes) {
2674 // check if shape is a poly
2675 if ((selectedShape->getTagProperty().getTag() == SUMO_TAG_POLY) ||
2676 (selectedShape->getTagProperty().getTag() == GNE_TAG_JPS_WALKABLEAREA) ||
2677 (selectedShape->getTagProperty().getTag() == GNE_TAG_JPS_OBSTACLE)) {
2678 // simplify shape
2679 dynamic_cast<GNEPoly*>(selectedShape)->simplifyShape();
2680 }
2681 }
2682 // end undo-list
2684 } else {
2685 polygonUnderMouse->simplifyShape();
2686 }
2687 }
2688 return 1;
2689}
2690
2691
2692long
2693GNEViewNet::onCmdDeleteGeometryPoint(FXObject*, FXSelector, void*) {
2694 GNEPoly* polygonUnderMouse = getPolygonAtPopupPosition();
2695 if (polygonUnderMouse) {
2696 polygonUnderMouse->deleteGeometryPoint(getPopupPosition());
2697 }
2698 return 1;
2699}
2700
2701
2702long
2703GNEViewNet::onCmdClosePolygon(FXObject*, FXSelector, void*) {
2704 // get polygon under mouse
2705 GNEPoly* polygonUnderMouse = getPolygonAtPopupPosition();
2706 // check polygon
2707 if (polygonUnderMouse) {
2708 // check if shape is selected
2709 if (polygonUnderMouse->isAttributeCarrierSelected()) {
2710 // begin undo-list
2711 myNet->getViewNet()->getUndoList()->begin(polygonUnderMouse, TL("close polygon shapes"));
2712 // get selectedshapes
2713 const auto selectedShapes = myNet->getAttributeCarriers()->getSelectedShapes();
2714 // iterate over shapes
2715 for (const auto& selectedShape : selectedShapes) {
2716 // check if shape is a poly
2717 if ((selectedShape->getTagProperty().getTag() == SUMO_TAG_POLY) ||
2718 (selectedShape->getTagProperty().getTag() == GNE_TAG_JPS_WALKABLEAREA) ||
2719 (selectedShape->getTagProperty().getTag() == GNE_TAG_JPS_OBSTACLE)) {
2720 // close polygon
2721 dynamic_cast<GNEPoly*>(selectedShape)->closePolygon();
2722 }
2723 }
2724 // end undo-list
2726 } else {
2727 polygonUnderMouse->closePolygon();
2728 }
2729 }
2730 return 1;
2731}
2732
2733
2734long
2735GNEViewNet::onCmdOpenPolygon(FXObject*, FXSelector, void*) {
2736 // get polygon under mouse
2737 GNEPoly* polygonUnderMouse = getPolygonAtPopupPosition();
2738 // check polygon
2739 if (polygonUnderMouse) {
2740 // check if shape is selected
2741 if (polygonUnderMouse->isAttributeCarrierSelected()) {
2742 // begin undo-list
2743 myNet->getViewNet()->getUndoList()->begin(polygonUnderMouse, TL("open polygon shapes"));
2744 // get shapes
2745 const auto selectedShapes = myNet->getAttributeCarriers()->getSelectedShapes();
2746 // iterate over shapes
2747 for (const auto& selectedShape : selectedShapes) {
2748 // check if shape is a poly
2749 if ((selectedShape->getTagProperty().getTag() == SUMO_TAG_POLY) ||
2750 (selectedShape->getTagProperty().getTag() == GNE_TAG_JPS_WALKABLEAREA) ||
2751 (selectedShape->getTagProperty().getTag() == GNE_TAG_JPS_OBSTACLE)) {
2752 // open polygon
2753 dynamic_cast<GNEPoly*>(selectedShape)->openPolygon();
2754 }
2755 }
2756 // end undo-list
2758 } else {
2759 polygonUnderMouse->openPolygon();
2760 }
2761 }
2762 return 1;
2763}
2764
2765
2766long
2767GNEViewNet::onCmdSelectPolygonElements(FXObject*, FXSelector, void*) {
2768 // get polygon under mouse
2769 GNEPoly* polygonUnderMouse = getPolygonAtPopupPosition();
2770 // check polygon
2771 if (polygonUnderMouse) {
2772 // get ACs in boundary
2773 updateObjectsInBoundary(polygonUnderMouse->getShape().getBoxBoundary());
2774 // declare filtered ACs
2775 std::vector<GNEAttributeCarrier*> filteredACs;
2776 // iterate over obtained GUIGlIDs
2777 for (const auto& AC : myViewObjectsSelector.getAttributeCarriers()) {
2778 if (AC->getTagProperty().getTag() == SUMO_TAG_EDGE) {
2779 if (checkSelectEdges() && myNet->getAttributeCarriers()->isNetworkElementAroundShape(AC, polygonUnderMouse->getShape())) {
2780 filteredACs.push_back(AC);
2781 }
2782 } else if (AC->getTagProperty().getTag() == SUMO_TAG_LANE) {
2783 if (!checkSelectEdges() && myNet->getAttributeCarriers()->isNetworkElementAroundShape(AC, polygonUnderMouse->getShape())) {
2784 filteredACs.push_back(AC);
2785 }
2786 } else if ((AC != polygonUnderMouse) && myNet->getAttributeCarriers()->isNetworkElementAroundShape(AC, polygonUnderMouse->getShape())) {
2787 filteredACs.push_back(AC);
2788 }
2789 }
2790 // continue if there are ACs
2791 if (filteredACs.size() > 0) {
2792 // begin undo-list
2793 myNet->getViewNet()->getUndoList()->begin(GUIIcon::MODESELECT, TL("select within polygon boundary"));
2794 // iterate over shapes
2795 for (const auto& AC : filteredACs) {
2796 AC->setAttribute(GNE_ATTR_SELECTED, "true", myUndoList);
2797 }
2798 // end undo-list
2800 }
2801 }
2802 return 1;
2803}
2804
2805
2806long
2807GNEViewNet::onCmdSetFirstGeometryPoint(FXObject*, FXSelector, void*) {
2808 GNEPoly* polygonUnderMouse = getPolygonAtPopupPosition();
2809 if (polygonUnderMouse) {
2810 polygonUnderMouse->changeFirstGeometryPoint(polygonUnderMouse->getVertexIndex(getPopupPosition(), false));
2811 }
2812
2813 return 1;
2814}
2815
2816
2817long
2818GNEViewNet::onCmdSimplifyShapeEdited(FXObject*, FXSelector, void*) {
2819 auto undoList = myNet->getViewNet()->getUndoList();
2820 // get shape edited under mouse
2822 if (shapeEdited) {
2823 // simplify edited shape using undo-redo
2824 undoList->begin(shapeEdited, TL("simplify edited shape"));
2825 shapeEdited->simplifyShapeEdited(undoList);
2826 undoList->end();
2827 }
2828 return 1;
2829}
2830
2831
2832long
2833GNEViewNet::onCmdStraightenShapeEdited(FXObject*, FXSelector, void*) {
2834 auto undoList = myNet->getViewNet()->getUndoList();
2835 // get shape edited under mouse
2837 if (shapeEdited) {
2838 // simplify edited shape using undo-redo
2839 undoList->begin(shapeEdited, TL("straigthen edited shape"));
2840 shapeEdited->straigthenShapeEdited(undoList);
2841 undoList->end();
2842 }
2843 return 1;
2844}
2845
2846
2847long
2848GNEViewNet::onCmdCloseShapeEdited(FXObject*, FXSelector, void*) {
2849 auto undoList = myNet->getViewNet()->getUndoList();
2850 // get shape edited under mouse
2852 if (shapeEdited) {
2853 // close edited shape using undo-redo
2854 undoList->begin(shapeEdited, TL("simplify edited shape"));
2855 shapeEdited->closeShapeEdited(undoList);
2856 undoList->end();
2857 }
2858 return 1;
2859}
2860
2861
2862long
2863GNEViewNet::onCmdOpenShapeEdited(FXObject*, FXSelector, void*) {
2864 auto undoList = myNet->getViewNet()->getUndoList();
2865 // get shape edited under mouse
2867 if (shapeEdited) {
2868 // open edited shape using undo-redo
2869 undoList->begin(shapeEdited, TL("simplify edited shape"));
2870 shapeEdited->openShapeEdited(undoList);
2871 undoList->end();
2872 }
2873 return 1;
2874}
2875
2876
2877long
2879 auto undoList = myNet->getViewNet()->getUndoList();
2880 // get shape edited under mouse
2882 if (shapeEdited) {
2883 // get geometry point index under cursor
2884 const auto geometryPointIndex = shapeEdited->getGeometryPointUnderCursorShapeEdited();
2885 // set first geometry point in edited shape using undo-redo
2886 undoList->begin(shapeEdited, TL("simplify edited shape"));
2887 shapeEdited->setFirstGeometryPointShapeEdited(geometryPointIndex, undoList);
2888 undoList->end();
2889 }
2890 return 1;
2891}
2892
2893
2894long
2896 auto undoList = myNet->getViewNet()->getUndoList();
2897 // get shape edited under mouse
2899 if (shapeEdited) {
2900 // get geometry point index under cursor
2901 const auto geometryPointIndex = shapeEdited->getGeometryPointUnderCursorShapeEdited();
2902 // delete geometry point edited shape using undo-redo
2903 undoList->begin(shapeEdited, TL("simplify edited shape"));
2904 shapeEdited->deleteGeometryPointShapeEdited(geometryPointIndex, undoList);
2905 undoList->end();
2906 }
2907 return 1;
2908}
2909
2910
2911long
2912GNEViewNet::onCmdResetShapeEdited(FXObject*, FXSelector, void*) {
2913 auto undoList = myNet->getViewNet()->getUndoList();
2914 // get shape edited under mouse
2916 if (shapeEdited) {
2917 // simplify edited shape using undo-redo
2918 undoList->begin(shapeEdited, TL("simplify edited shape"));
2919 shapeEdited->resetShapeEdited(undoList);
2920 undoList->end();
2921 }
2922 return 1;
2923}
2924
2925
2926long
2927GNEViewNet::onCmdFinishShapeEdited(FXObject*, FXSelector, void*) {
2928 // the same behavior as when we press enter
2929 hotkeyEnter();
2930 return 1;
2931}
2932
2933
2934long
2935GNEViewNet::onCmdTransformPOI(FXObject*, FXSelector, void*) {
2936 // declare additional handler
2938 // obtain POI at popup position
2940 if (POI) {
2941 // check what type of POI will be transformed
2942 if (POI->getTagProperty().getTag() == SUMO_TAG_POI) {
2943 // obtain lanes around POI boundary
2944 std::vector<GUIGlID> GLIDs = getObjectsInBoundary(POI->getCenteringBoundary());
2945 std::vector<GNELane*> lanes;
2946 for (const auto& GLID : GLIDs) {
2948 if (lane) {
2949 lanes.push_back(lane);
2950 }
2951 }
2952 if (lanes.empty()) {
2953 WRITE_WARNINGF(TL("No lanes around % to attach it"), toString(SUMO_TAG_POI));
2954 } else {
2955 // obtain nearest lane to POI
2956 GNELane* nearestLane = lanes.front();
2957 double minorPosOverLane = nearestLane->getLaneShape().nearest_offset_to_point2D(POI->getPositionInView());
2958 double minorLateralOffset = nearestLane->getLaneShape().positionAtOffset(minorPosOverLane).distanceTo(POI->getPositionInView());
2959 for (const auto& lane : lanes) {
2960 double posOverLane = lane->getLaneShape().nearest_offset_to_point2D(POI->getPositionInView());
2961 double lateralOffset = lane->getLaneShape().positionAtOffset(posOverLane).distanceTo(POI->getPositionInView());
2962 if (lateralOffset < minorLateralOffset) {
2963 minorPosOverLane = posOverLane;
2964 minorLateralOffset = lateralOffset;
2965 nearestLane = lane;
2966 }
2967 }
2968 // get sumo base object of POI (And all common attributes)
2969 CommonXMLStructure::SumoBaseObject* POIBaseObject = POI->getSumoBaseObject();
2970 // add specific attributes
2971 POIBaseObject->addStringAttribute(SUMO_ATTR_LANE, nearestLane->getID());
2972 POIBaseObject->addDoubleAttribute(SUMO_ATTR_POSITION, minorPosOverLane);
2973 POIBaseObject->addBoolAttribute(SUMO_ATTR_FRIENDLY_POS, POI->getFriendlyPos());
2974 POIBaseObject->addDoubleAttribute(SUMO_ATTR_POSITION_LAT, 0);
2975 // remove POI
2976 myUndoList->begin(POI, TL("attach POI into lane"));
2978 // add new POI use route handler
2979 additionalHanlder.parseSumoBaseObject(POIBaseObject);
2980 myUndoList->end();
2981 }
2982 } else {
2983 // get sumo base object of POI (And all common attributes)
2984 CommonXMLStructure::SumoBaseObject* POIBaseObject = POI->getSumoBaseObject();
2985 // add specific attributes
2986 POIBaseObject->addDoubleAttribute(SUMO_ATTR_X, POI->x());
2987 POIBaseObject->addDoubleAttribute(SUMO_ATTR_Y, POI->y());
2988 // remove POI
2989 myUndoList->begin(POI, TL("release POI from lane"));
2991 // add new POI use route handler
2992 additionalHanlder.parseSumoBaseObject(POIBaseObject);
2993 myUndoList->end();
2994 }
2995 }
2996 return 1;
2997}
2998
2999
3000long
3001GNEViewNet::onCmdReverse(FXObject*, FXSelector, void*) {
3002 // obtain demand element at popup position
3004 if (demandElement) {
3005 // begin undo list
3006 myUndoList->begin(demandElement, TLF("reverse % '%'", demandElement->getTagStr(), demandElement->getID()));
3007 GNERouteHandler::reverse(demandElement);
3008 myUndoList->end();
3009 }
3010 return 1;
3011}
3012
3013
3014long
3015GNEViewNet::onCmdAddReverse(FXObject*, FXSelector, void*) {
3016 // obtain demand element at popup position
3018 if (demandElement) {
3019 // begin undo list
3020 myUndoList->begin(demandElement, TLF("add reverse '%'", demandElement->getTagStr()));
3021 GNERouteHandler::addReverse(demandElement);
3022 myUndoList->end();
3023 }
3024 return 1;
3025}
3026
3027
3028long
3029GNEViewNet::onCmdSetCustomGeometryPoint(FXObject*, FXSelector, void*) {
3030 // get element at popup position
3034 // check element
3035 if (lane != nullptr) {
3036 // make a copy of edge geometry
3037 PositionVector edgeGeometry = lane->getParentEdge()->getNBEdge()->getGeometry();
3038 // get index position
3039 const int index = edgeGeometry.indexOfClosest(getPositionInformation(), true);
3040 // get new position
3041 Position newPosition = edgeGeometry[index];
3042 // edit using modal GNEGeometryPointDialog
3043 GNEGeometryPointDialog(this, &newPosition); // NOSONAR, constructor returns after dialog has been closed
3044 // now check position
3045 if (newPosition != edgeGeometry[index]) {
3046 // update new position
3047 edgeGeometry[index] = newPosition;
3048 // begin undo list
3049 myUndoList->begin(lane->getParentEdge(), TL("change edge Geometry Point position"));
3050 // continue depending of index
3051 if (index == 0) {
3052 // change shape start
3054 } else if (index == ((int)edgeGeometry.size() - 1)) {
3055 // change shape end
3057 } else {
3058 // remove front and back geometry points
3059 edgeGeometry.pop_front();
3060 edgeGeometry.pop_back();
3061 // change shape
3063 }
3064 // end undo list
3065 myUndoList->end();
3066 }
3067 } else if (poly != nullptr) {
3068 // make a copy of polygon geometry
3069 PositionVector polygonGeometry = poly->getShape();
3070 // get index position
3071 const int index = polygonGeometry.indexOfClosest(getPositionInformation(), true);
3072 // get new position
3073 Position newPosition = polygonGeometry[index];
3074 // edit using modal GNEGeometryPointDialog
3075 GNEGeometryPointDialog(this, &newPosition); // NOSONAR, constructor returns after dialog has been closed
3076 // now check position
3077 if (newPosition != polygonGeometry[index]) {
3078 // update new position
3079 polygonGeometry[index] = newPosition;
3080 // begin undo list
3081 myUndoList->begin(poly, TL("change polygon Geometry Point position"));
3082 // change shape
3084 // end undo list
3085 myUndoList->end();
3086 }
3087 } else if (TAZ != nullptr) {
3088 // make a copy of TAZ geometry
3089 PositionVector TAZGeometry = TAZ->getAdditionalGeometry().getShape();
3090 // get index position
3091 const int index = TAZGeometry.indexOfClosest(getPositionInformation(), true);
3092 // get new position
3093 Position newPosition = TAZGeometry[index];
3094 // edit using modal GNEGeometryPointDialog
3095 GNEGeometryPointDialog(this, &newPosition); // NOSONAR, constructor returns after dialog has been closed
3096 // now check position
3097 if (newPosition != TAZGeometry[index]) {
3098 // update new position
3099 TAZGeometry[index] = newPosition;
3100 // begin undo list
3101 myUndoList->begin(TAZ, TL("change TAZ Geometry Point position"));
3102 // change shape
3104 // end undo list
3105 myUndoList->end();
3106 }
3107 }
3108 return 1;
3109}
3110
3111
3112long
3113GNEViewNet::onCmdResetEndPoints(FXObject*, FXSelector, void*) {
3114 // get lane at popup position
3115 GNELane* laneAtPopupPosition = getLaneAtPopupPosition();
3116 // check element
3117 if (laneAtPopupPosition != nullptr) {
3118 // get parent edge
3119 GNEEdge* edge = laneAtPopupPosition->getParentEdge();
3120 // check if edge is selected
3121 if (edge->isAttributeCarrierSelected()) {
3122 // get selected edges
3123 const auto selectedEdges = myNet->getAttributeCarriers()->getSelectedEdges();
3124 // begin undo list
3125 myUndoList->begin(edge, TL("reset end points of selected edges"));
3126 // iterate over edges
3127 for (const auto& selectedEdge : selectedEdges) {
3128 // reset both end points
3129 selectedEdge->setAttribute(GNE_ATTR_SHAPE_START, "", myUndoList);
3130 selectedEdge->setAttribute(GNE_ATTR_SHAPE_END, "", myUndoList);
3131 }
3132 // end undo list
3133 myUndoList->end();
3134 } else {
3135 // begin undo list
3136 myUndoList->begin(edge, TL("reset end points of edge '") + edge->getID());
3137 // reset both end points
3140 // end undo list
3141 myUndoList->end();
3142 }
3143 }
3144 return 1;
3145}
3146
3147
3148long
3149GNEViewNet::onCmdDuplicateLane(FXObject*, FXSelector, void*) {
3150 GNELane* laneAtPopupPosition = getLaneAtPopupPosition();
3151 if (laneAtPopupPosition != nullptr) {
3152 // when duplicating an unselected lane, keep all connections as they
3153 // are, otherwise recompute them
3154 if (laneAtPopupPosition->isAttributeCarrierSelected()) {
3155 myUndoList->begin(laneAtPopupPosition, TL("duplicate selected lanes"));
3156 const auto selectedLanes = myNet->getAttributeCarriers()->getSelectedLanes();
3157 for (const auto& lane : selectedLanes) {
3158 myNet->duplicateLane(lane, myUndoList, true);
3159 }
3160 myUndoList->end();
3161 } else {
3162 myUndoList->begin(laneAtPopupPosition, TL("duplicate lane"));
3163 myNet->duplicateLane(laneAtPopupPosition, myUndoList, false);
3164 myUndoList->end();
3165 }
3166 }
3167 return 1;
3168}
3169
3170
3171long
3172GNEViewNet::onCmdEditLaneShape(FXObject*, FXSelector, void*) {
3173 // Obtain lane under mouse
3175 if (lane) {
3177 }
3178 // destroy pop-up and update view Net
3179 destroyPopup();
3180 setFocus();
3181 return 1;
3182}
3183
3184
3185long
3186GNEViewNet::onCmdResetLaneCustomShape(FXObject*, FXSelector, void*) {
3187 GNELane* laneAtPopupPosition = getLaneAtPopupPosition();
3188 if (laneAtPopupPosition != nullptr) {
3189 // when duplicating an unselected lane, keep all connections as they
3190 // are, otherwise recompute them
3191 if (laneAtPopupPosition->isAttributeCarrierSelected()) {
3192 myUndoList->begin(laneAtPopupPosition, TL("reset custom lane shapes"));
3193 const auto selectedLanes = myNet->getAttributeCarriers()->getSelectedLanes();
3194 for (const auto& lane : selectedLanes) {
3195 lane->setAttribute(SUMO_ATTR_CUSTOMSHAPE, "", myUndoList);
3196 }
3197 myUndoList->end();
3198 } else {
3199 myUndoList->begin(laneAtPopupPosition, TL("reset custom lane shape"));
3200 laneAtPopupPosition->setAttribute(SUMO_ATTR_CUSTOMSHAPE, "", myUndoList);
3201 myUndoList->end();
3202 }
3203 }
3204 return 1;
3205}
3206
3207
3208long
3209GNEViewNet::onCmdResetOppositeLane(FXObject*, FXSelector, void*) {
3210 GNELane* laneAtPopupPosition = getLaneAtPopupPosition();
3211 if (laneAtPopupPosition != nullptr) {
3212 // when duplicating an unselected lane, keep all connections as they
3213 // are, otherwise recompute them
3214 if (laneAtPopupPosition->isAttributeCarrierSelected()) {
3215 myUndoList->begin(laneAtPopupPosition, TL("reset opposite lanes"));
3216 const auto selectedLanes = myNet->getAttributeCarriers()->getSelectedLanes();
3217 for (const auto& lane : selectedLanes) {
3218 lane->setAttribute(GNE_ATTR_OPPOSITE, "", myUndoList);
3219 }
3220 myUndoList->end();
3221 } else {
3222 myUndoList->begin(laneAtPopupPosition, TL("reset opposite lane"));
3223 laneAtPopupPosition->setAttribute(GNE_ATTR_OPPOSITE, "", myUndoList);
3224 myUndoList->end();
3225 }
3226 }
3227 return 1;
3228}
3229
3230
3231long
3232GNEViewNet::onCmdLaneOperation(FXObject*, FXSelector sel, void*) {
3233 GNELane* laneAtPopupPosition = getLaneAtPopupPosition();
3234 if (laneAtPopupPosition) {
3235 // check lane operation
3236 switch (FXSELID(sel)) {
3238 return restrictLane(laneAtPopupPosition, SVC_PEDESTRIAN);
3240 return restrictLane(laneAtPopupPosition, SVC_BICYCLE);
3242 return restrictLane(laneAtPopupPosition, SVC_BUS);
3244 return restrictLane(laneAtPopupPosition, SVC_IGNORING);
3246 return addRestrictedLane(laneAtPopupPosition, SVC_PEDESTRIAN, false);
3248 return addRestrictedLane(laneAtPopupPosition, SVC_BICYCLE, false);
3250 return addRestrictedLane(laneAtPopupPosition, SVC_BUS, false);
3252 return addRestrictedLane(laneAtPopupPosition, SVC_IGNORING, true);
3254 return addRestrictedLane(laneAtPopupPosition, SVC_IGNORING, false);
3256 return removeRestrictedLane(laneAtPopupPosition, SVC_PEDESTRIAN);
3258 return removeRestrictedLane(laneAtPopupPosition, SVC_BICYCLE);
3260 return removeRestrictedLane(laneAtPopupPosition, SVC_BUS);
3262 return removeRestrictedLane(laneAtPopupPosition, SVC_IGNORING);
3263 default:
3264 return 0;
3265 }
3266 } else {
3267 return 0;
3268 }
3269}
3270
3271
3272long
3273GNEViewNet::onCmdLaneReachability(FXObject* menu, FXSelector, void*) {
3274 GNELane* laneAtPopupPosition = getLaneAtPopupPosition();
3275 if (laneAtPopupPosition != nullptr) {
3276 // obtain vClass
3277 const SUMOVehicleClass vClass = SumoVehicleClassStrings.get(dynamic_cast<FXMenuCommand*>(menu)->getText().text());
3278 // calculate reachability
3280 // select all lanes with reachability greater than 0
3281 myUndoList->begin(laneAtPopupPosition, TL("select lane reachability"));
3282 for (const auto& edge : myNet->getAttributeCarriers()->getEdges()) {
3283 for (const auto& lane : edge.second->getLanes()) {
3284 if (lane->getReachability() >= 0) {
3285 lane->setAttribute(GNE_ATTR_SELECTED, "true", myUndoList);
3286 }
3287 }
3288 }
3289 myUndoList->end();
3290 }
3291 return 1;
3292}
3293
3294
3295long
3296GNEViewNet::onCmdOpenAdditionalDialog(FXObject*, FXSelector, void*) {
3297 // retrieve additional under cursor
3299 // check if additional can open dialog
3300 if (addtional && addtional->getTagProperty().hasDialog()) {
3301 addtional->openAdditionalDialog();
3302 }
3303 return 1;
3304}
3305
3306
3307void
3309 FXEvent* evt = (FXEvent*)eventData;
3310 // process click
3311 destroyPopup();
3312 setFocus();
3313 myChanger->onLeftBtnPress(eventData);
3314 grab();
3315 // Check there are double click
3316 if (evt->click_count == 2) {
3317 handle(this, FXSEL(SEL_DOUBLECLICKED, 0), eventData);
3318 }
3319}
3320
3321
3322void
3324 // first check if we're panning
3325 if (myPanning) {
3326 // move view
3329 } else {
3330 // declare flags
3331 bool cursorMoveView = false;
3332 bool cursorInspect = false;
3333 bool cursorSelect = false;
3334 bool cursorMoveElement = false;
3335 bool cursorDelete = false;
3336 // continue depending of supermode
3338 // move view
3344 cursorMoveView = true;
3345 }
3346 // specific mode
3348 cursorInspect = true;
3350 cursorSelect = true;
3352 cursorMoveElement = true;
3354 cursorDelete = true;
3355 }
3357 // move view
3361 cursorMoveView = true;
3362 }
3363 // specific mode
3365 cursorInspect = true;
3367 cursorSelect = true;
3369 cursorMoveElement = true;
3371 cursorDelete = true;
3372 }
3373 } else if (myEditModes.isCurrentSupermodeData()) {
3374 // move view
3376 cursorMoveView = true;
3377 }
3378 // specific mode
3380 cursorInspect = true;
3382 cursorSelect = true;
3384 cursorDelete = true;
3385 }
3386 }
3387 // set cursor
3388 if (myMouseButtonKeyPressed.controlKeyPressed() && cursorMoveView) {
3389 // move view cursor if control key is pressed
3392 } else if (cursorInspect) {
3393 // special case for inspect lanes
3395 // inspect lane cursor
3398 } else {
3399 // inspect cursor
3402 }
3403 } else if (cursorSelect) {
3404 // special case for select lanes
3406 // select lane cursor
3409 } else {
3410 // select cursor
3413 }
3414 } else if (cursorMoveElement) {
3415 // move cursor
3418 } else if (cursorDelete) {
3419 // delete cursor
3422 } else {
3423 // default cursor
3426 }
3427 }
3428}
3429
3430
3431int
3433 // udpdate drawing toggle
3434 if (myDrawingToggle > 10000) {
3435 myDrawingToggle = 0;
3436 } else {
3438 }
3439 // set default scale
3441 // calculate boundary extremes
3442 const float minB[2] = { (float)bound.xmin(), (float)bound.ymin() };
3443 const float maxB[2] = { (float)bound.xmax(), (float)bound.ymax() };
3444 // reset gl line to 1
3445 glLineWidth(1);
3446 // set drawing modes
3447 glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
3448 glEnable(GL_POLYGON_OFFSET_FILL);
3449 glEnable(GL_POLYGON_OFFSET_LINE);
3450 // draw all elements between minB and maxB, obtain objects included in minB and maxB
3451 return myGrid->Search(minB, maxB, *myVisualizationSettings);
3452}
3453
3454
3455void
3457 // depending of the visualizationSettings, enable or disable check box show grid
3459 // change show grid
3462 // change to true
3465 // update show grid buttons
3468 }
3469 // draw grid only in network and demand mode
3471 paintGLGrid();
3472 }
3473 } else {
3474 // change show grid
3477 // change to false
3480 // update show grid buttons
3483 }
3484 }
3485}
3486
3487
3488long
3489GNEViewNet::onCmdResetEdgeEndPoints(FXObject*, FXSelector, void*) {
3490 // Obtain junction under mouse
3492 if (junction) {
3493 myUndoList->begin(GUIIcon::EDGE, TL("reset edge endpoints"));
3494 // are, otherwise recompute them
3495 if (junction->isAttributeCarrierSelected()) {
3496 const auto selectedJunctions = myNet->getAttributeCarriers()->getSelectedJunctions();
3497 for (const auto& selectedJunction : selectedJunctions) {
3498 // reset shape end from incoming edges
3499 for (const auto& incomingEdge : selectedJunction->getGNEIncomingEdges()) {
3500 incomingEdge->setAttribute(GNE_ATTR_SHAPE_END, "", myUndoList);
3501 }
3502 // reset shape start from outgoing edges
3503 for (const auto& outgoingEdge : selectedJunction->getGNEOutgoingEdges()) {
3504 outgoingEdge->setAttribute(GNE_ATTR_SHAPE_START, "", myUndoList);
3505 }
3506 }
3507 } else {
3508 // reset shape end from incoming edges
3509 for (const auto& incomingEdge : junction->getGNEIncomingEdges()) {
3510 incomingEdge->setAttribute(GNE_ATTR_SHAPE_END, "", myUndoList);
3511 }
3512 // reset shape start from outgoing edges
3513 for (const auto& outgoingEdge : junction->getGNEOutgoingEdges()) {
3514 outgoingEdge->setAttribute(GNE_ATTR_SHAPE_START, "", myUndoList);
3515 }
3516 }
3517 myUndoList->end();
3518 }
3519 // destroy pop-up and set focus in view net
3520 destroyPopup();
3521 setFocus();
3522 return 1;
3523}
3524
3525
3526long
3527GNEViewNet::onCmdEditJunctionShape(FXObject*, FXSelector, void*) {
3528 // Obtain junction under mouse
3530 if (junction) {
3531 // check if network has to be updated
3532 if (junction->getNBNode()->getShape().size() == 0) {
3533 // recompute the whole network
3535 }
3536 // if grid is enabled, show warning
3538 WRITE_WARNING(TL("Grid is still active, press ctrl+g to deactivate"));
3539 }
3540 // start edit custom shape
3542 }
3543 // destroy pop-up and set focus in view net
3544 destroyPopup();
3545 setFocus();
3546 return 1;
3547}
3548
3549
3550long
3551GNEViewNet::onCmdResetJunctionShape(FXObject*, FXSelector, void*) {
3552 // Obtain junction under mouse
3554 if (junction) {
3555 // are, otherwise recompute them
3556 if (junction->isAttributeCarrierSelected()) {
3557 myUndoList->begin(junction, TL("reset custom junction shapes"));
3558 const auto selectedJunctions = myNet->getAttributeCarriers()->getSelectedJunctions();
3559 for (const auto& selectedJunction : selectedJunctions) {
3560 selectedJunction->setAttribute(SUMO_ATTR_SHAPE, "", myUndoList);
3561 }
3562 myUndoList->end();
3563 } else {
3564 myUndoList->begin(junction, TL("reset custom junction shape"));
3565 junction->setAttribute(SUMO_ATTR_SHAPE, "", myUndoList);
3566 myUndoList->end();
3567 }
3568 }
3569 // destroy pop-up and set focus in view net
3570 destroyPopup();
3571 setFocus();
3572 return 1;
3573}
3574
3575
3576long
3577GNEViewNet::onCmdReplaceJunction(FXObject*, FXSelector, void*) {
3579 if (junction != nullptr) {
3581 }
3582 // destroy pop-up and set focus in view net
3583 destroyPopup();
3584 setFocus();
3585 return 1;
3586}
3587
3588
3589long
3590GNEViewNet::onCmdSplitJunction(FXObject*, FXSelector, void*) {
3592 if (junction != nullptr) {
3593 myNet->splitJunction(junction, false, myUndoList);
3594 }
3595 // destroy pop-up and set focus in view net
3596 destroyPopup();
3597 setFocus();
3598 return 1;
3599}
3600
3601
3602long
3603GNEViewNet::onCmdSplitJunctionReconnect(FXObject*, FXSelector, void*) {
3605 if (junction != nullptr) {
3606 myNet->splitJunction(junction, true, myUndoList);
3607 }
3608 // destroy pop-up and set focus in view net
3609 destroyPopup();
3610 setFocus();
3611 return 1;
3612}
3613
3614long
3615GNEViewNet::onCmdSelectRoundabout(FXObject*, FXSelector, void*) {
3617 if (junction != nullptr) {
3618 myNet->selectRoundabout(junction, myUndoList);
3619 }
3620 // destroy pop-up and set focus in view net
3621 destroyPopup();
3622 setFocus();
3623 return 1;
3624}
3625
3626long
3627GNEViewNet::onCmdConvertRoundabout(FXObject*, FXSelector, void*) {
3629 if (junction != nullptr) {
3630 myNet->createRoundabout(junction, myUndoList);
3631 }
3632 // destroy pop-up and set focus in view net
3633 destroyPopup();
3634 setFocus();
3635 return 1;
3636}
3637
3638
3639long
3640GNEViewNet::onEnterConvertRoundabout(FXObject*, FXSelector, void*) {
3642 update();
3643 return 1;
3644}
3645
3646
3647long
3648GNEViewNet::onLeaveConvertRoundabout(FXObject*, FXSelector, void*) {
3650 update();
3651 return 1;
3652}
3653
3654
3655long
3656GNEViewNet::onCmdClearConnections(FXObject*, FXSelector, void*) {
3658 if (junction != nullptr) {
3659 // make sure we do not inspect the connection will it is being deleted
3662 }
3663 // make sure that connections isn't the front attribute
3665 myFrontAttributeCarrier = nullptr;
3666 }
3667 // check if we're handling a selection
3668 if (junction->isAttributeCarrierSelected()) {
3669 const auto selectedJunctions = myNet->getAttributeCarriers()->getSelectedJunctions();
3670 myUndoList->begin(GUIIcon::CONNECTION, TL("clear connections of selected junctions"));
3671 for (const auto& selectedJunction : selectedJunctions) {
3672 myNet->clearJunctionConnections(selectedJunction, myUndoList);
3673 }
3674 myUndoList->end();
3675 } else {
3677 }
3678 }
3679 // destroy pop-up and set focus in view net
3680 destroyPopup();
3681 setFocus();
3682 return 1;
3683}
3684
3685
3686long
3687GNEViewNet::onCmdResetConnections(FXObject*, FXSelector, void*) {
3689 if (junction != nullptr) {
3690 // make sure we do not inspect the connection will it is being deleted
3693 }
3694 // make sure that connections isn't the front attribute
3696 myFrontAttributeCarrier = nullptr;
3697 }
3698 // check if we're handling a selection
3699 if (junction->isAttributeCarrierSelected()) {
3700 const auto selectedJunctions = myNet->getAttributeCarriers()->getSelectedJunctions();
3701 myUndoList->begin(GUIIcon::CONNECTION, TL("reset connections of selected junctions"));
3702 for (const auto& selectedJunction : selectedJunctions) {
3703 myNet->resetJunctionConnections(selectedJunction, myUndoList);
3704 }
3705 myUndoList->end();
3706 } else {
3708 }
3709 }
3710 // destroy pop-up and set focus in view net
3711 destroyPopup();
3712 setFocus();
3713 return 1;
3714}
3715
3716
3717long
3718GNEViewNet::onCmdAddTLS(FXObject*, FXSelector, void*) {
3720 if (junction != nullptr) {
3721 // check if we're adding TLS in multiple junctions
3722 if (junction->isAttributeCarrierSelected()) {
3723 const auto selectedJunctions = myNet->getAttributeCarriers()->getSelectedJunctions();
3724 myNet->getViewNet()->getUndoList()->begin(GUIIcon::MODETLS, TL("add TLS in multiple junctions"));
3725 for (const auto& selectedJunction : selectedJunctions) {
3726 selectedJunction->setAttribute(SUMO_ATTR_TYPE, "traffic_light", myUndoList);
3727 }
3729 } else {
3730 // change junction type
3731 junction->setAttribute(SUMO_ATTR_TYPE, "traffic_light", myUndoList);
3732 // change to TLS Mode
3734 // set junction in TLS mode
3736 }
3737 }
3738 // destroy pop-up and set focus in view net
3739 destroyPopup();
3740 setFocus();
3741 return 1;
3742}
3743
3744
3745long
3746GNEViewNet::onCmdAddJoinTLS(FXObject*, FXSelector, void*) {
3748 if (junction != nullptr) {
3749 // check if we're adding TLS in multiple junctions
3750 if (junction->isAttributeCarrierSelected()) {
3751 myNet->getViewNet()->getUndoList()->begin(GUIIcon::MODETLS, TL("add TLS in multiple junctions"));
3752 }
3753 // change junction type
3754 junction->setAttribute(SUMO_ATTR_TYPE, "traffic_light", myUndoList);
3755 // if TLS was sucesfully created, apply the same TLID to other selected junctions
3756 if (junction->getAttribute(SUMO_ATTR_TLID).size() > 0) {
3757 const auto selectedJunctions = myNet->getAttributeCarriers()->getSelectedJunctions();
3758 // iterate over all selected junctions
3759 for (const auto& selectedJunction : selectedJunctions) {
3760 // check that doesn't have a TL
3761 if (selectedJunction->getNBNode()->getControllingTLS().empty()) {
3762 selectedJunction->setAttribute(SUMO_ATTR_TYPE, "traffic_light", myUndoList);
3763 selectedJunction->setAttribute(SUMO_ATTR_TLID, junction->getAttribute(SUMO_ATTR_TLID), myUndoList);
3764 }
3765 }
3766 }
3767 // rename traffic light
3768 if (junction->getNBNode()->getControllingTLS().size() > 0) {
3769 const auto TLSDef = (*junction->getNBNode()->getControllingTLS().begin());
3770 if (!myNet->getTLLogicCont().exist(TLSDef->getID() + "_joined")) {
3771 myUndoList->add(new GNEChange_TLS(junction, TLSDef, TLSDef->getID() + "_joined"), true);
3772 }
3773 }
3774 // end undoList
3775 if (junction->isAttributeCarrierSelected()) {
3777 }
3778 // change to TLS Mode
3780 // set junction in TLS mode
3782 }
3783 // destroy pop-up and set focus in view net
3784 destroyPopup();
3785 setFocus();
3786 return 1;
3787}
3788
3789long
3790GNEViewNet::onCmdEditConnectionShape(FXObject*, FXSelector, void*) {
3791 // Obtain connection under mouse
3793 if (connection) {
3795 }
3796 // if grid is enabled, show warning
3798 WRITE_WARNING(TL("Grid is still active, press ctrl+g to deactivate"));
3799 }
3800 // destroy pop-up and update view Net
3801 destroyPopup();
3802 setFocus();
3803 return 1;
3804}
3805
3806
3807long
3808GNEViewNet::onCmdSmoothConnectionShape(FXObject*, FXSelector, void*) {
3809 // Obtain connection under mouse
3811 if (connection) {
3812 connection->smootShape();
3813 }
3814 // destroy pop-up and update view Net
3815 destroyPopup();
3816 setFocus();
3817 return 1;
3818}
3819
3820
3821long
3822GNEViewNet::onCmdEditCrossingShape(FXObject*, FXSelector, void*) {
3823 // Obtain crossing under mouse
3825 if (crossing) {
3826 // check if network has to be updated
3827 if (crossing->getParentJunction()->getNBNode()->getShape().size() == 0) {
3828 // recompute the whole network
3830 }
3831 // if grid is enabled, show warning
3833 WRITE_WARNING(TL("Grid is still active, press ctrl+g to deactivate"));
3834 }
3835 // start edit custom shape
3837 }
3838 // destroy pop-up and update view Net
3839 destroyPopup();
3840 setFocus();
3841 return 1;
3842}
3843
3844
3845long
3846GNEViewNet::onCmdEditWalkingAreaShape(FXObject*, FXSelector, void*) {
3847 // Obtain walkingArea under mouse
3849 if (walkingArea) {
3850 // check if network has to be updated
3851 if (walkingArea->getParentJunction()->getNBNode()->getShape().size() == 0) {
3852 // recompute the whole network
3854 // if grid is enabled, show warning
3856 WRITE_WARNING(TL("Grid is still active, press ctrl+g to deactivate"));
3857 }
3858 }
3859 // start edit custom shape
3861 }
3862 // destroy pop-up and update view Net
3863 destroyPopup();
3864 setFocus();
3865 return 1;
3866}
3867
3868
3869long
3870GNEViewNet::onCmdToggleSelectEdges(FXObject*, FXSelector sel, void*) {
3871 // Toggle menuCheckSelectEdges
3874 } else {
3876 }
3878 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
3879 if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_SELECTEDGES)) {
3881 }
3882 return 1;
3883}
3884
3885
3886long
3887GNEViewNet::onCmdToggleShowConnections(FXObject*, FXSelector sel, void*) {
3888 // Toggle menuCheckShowConnections
3891 } else {
3893 }
3895 // if show was enabled, init GNEConnections
3898 }
3899 // change flag "showLane2Lane" in myVisualizationSettings
3901 // Hide/show connections require recompute
3903 // Update viewNet to show/hide connections
3904 updateViewNet();
3905 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
3906 if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_SHOWCONNECTIONS)) {
3908 }
3909 return 1;
3910}
3911
3912
3913long
3914GNEViewNet::onCmdToggleHideConnections(FXObject*, FXSelector sel, void*) {
3915 // Toggle menuCheckHideConnections
3918 } else {
3920 }
3922 // Update viewNet to show/hide connections
3923 updateViewNet();
3924 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
3925 if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_HIDECONNECTIONS)) {
3927 }
3928 return 1;
3929}
3930
3931
3932long
3933GNEViewNet::onCmdToggleShowAdditionalSubElements(FXObject*, FXSelector sel, void*) {
3934 // Toggle menuCheckShowAdditionalSubElements
3937 } else {
3939 }
3941 // Update viewNet to show/hide sub elements
3942 updateViewNet();
3943 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
3944 if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_SHOWSUBADDITIONALS)) {
3946 }
3947 return 1;
3948}
3949
3950
3951long
3952GNEViewNet::onCmdToggleShowTAZElements(FXObject*, FXSelector sel, void*) {
3953 // Toggle menuCheckShowAdditionalSubElements
3956 } else {
3958 }
3960 // Update viewNet to show/hide TAZ elements
3961 updateViewNet();
3962 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
3963 if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_SHOWTAZELEMENTS)) {
3965 }
3966 return 1;
3967}
3968
3969
3970long
3971GNEViewNet::onCmdToggleExtendSelection(FXObject*, FXSelector sel, void*) {
3972 // Toggle menuCheckExtendSelection
3975 } else {
3977 }
3979 // Only update view
3980 updateViewNet();
3981 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
3982 if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_EXTENDSELECTION)) {
3984 }
3985 return 1;
3986}
3987
3988
3989long
3990GNEViewNet::onCmdToggleChangeAllPhases(FXObject*, FXSelector sel, void*) {
3991 // Toggle menuCheckChangeAllPhases
3994 } else {
3996 }
3998 // Only update view
3999 updateViewNet();
4000 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4001 if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_CHANGEALLPHASES)) {
4003 }
4004 return 1;
4005}
4006
4007
4008long
4009GNEViewNet::onCmdToggleShowGrid(FXObject*, FXSelector sel, void*) {
4010 // show or hide grid depending of myNetworkViewOptions.menuCheckToggleGrid
4015 } else {
4019 }
4022 // update view to show grid
4023 updateViewNet();
4024 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4025 if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_TOGGLEGRID)) {
4027 } else if (sel == FXSEL(SEL_COMMAND, MID_GNE_DEMANDVIEWOPTIONS_SHOWGRID)) {
4029 }
4030 return 1;
4031}
4032
4033
4034long
4035GNEViewNet::onCmdToggleDrawJunctionShape(FXObject*, FXSelector sel, void*) {
4036 // toggle state
4038 // gui button has 'hide' semantics
4039 const bool hide = !myVisualizationSettings->drawJunctionShape;
4043
4047 // update view to show DrawJunctionShape
4048 updateViewNet();
4049 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4050 if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_TOGGLEDRAWJUNCTIONSHAPE)) {
4052 } else if (sel == FXSEL(SEL_COMMAND, MID_GNE_DEMANDVIEWOPTIONS_TOGGLEDRAWJUNCTIONSHAPE)) {
4054 } else if (sel == FXSEL(SEL_COMMAND, MID_GNE_DATAVIEWOPTIONS_TOGGLEDRAWJUNCTIONSHAPE)) {
4056 }
4057 return 1;
4058}
4059
4060long
4061GNEViewNet::onCmdToggleDrawSpreadVehicles(FXObject*, FXSelector sel, void*) {
4062 // Toggle menuCheckShowDemandElements
4067 } else {
4070 }
4073 // declare edge set
4074 std::set<GNEEdge*> edgesToUpdate;
4075 // compute vehicle geometry
4076 for (const auto& vehicle : myNet->getAttributeCarriers()->getDemandElements().at(SUMO_TAG_VEHICLE)) {
4077 if (vehicle.second->getParentEdges().size() > 0) {
4078 edgesToUpdate.insert(vehicle.second->getParentEdges().front());
4079 } else if (vehicle.second->getChildDemandElements().size() > 0 && (vehicle.second->getChildDemandElements().front()->getTagProperty().getTag() == GNE_TAG_ROUTE_EMBEDDED)) {
4080 edgesToUpdate.insert(vehicle.second->getChildDemandElements().front()->getParentEdges().front());
4081 }
4082 }
4083 for (const auto& routeFlow : myNet->getAttributeCarriers()->getDemandElements().at(GNE_TAG_FLOW_ROUTE)) {
4084 if (routeFlow.second->getParentEdges().size() > 0) {
4085 edgesToUpdate.insert(routeFlow.second->getParentEdges().front());
4086 } else if (routeFlow.second->getChildDemandElements().size() > 0 && (routeFlow.second->getChildDemandElements().front()->getTagProperty().getTag() == GNE_TAG_ROUTE_EMBEDDED)) {
4087 edgesToUpdate.insert(routeFlow.second->getChildDemandElements().front()->getParentEdges().front());
4088 }
4089 }
4090 for (const auto& trip : myNet->getAttributeCarriers()->getDemandElements().at(SUMO_TAG_TRIP)) {
4091 if (trip.second->getParentEdges().size() > 0) {
4092 edgesToUpdate.insert(trip.second->getParentEdges().front());
4093 }
4094 }
4095 for (const auto& flow : myNet->getAttributeCarriers()->getDemandElements().at(SUMO_TAG_FLOW)) {
4096 if (flow.second->getParentEdges().size() > 0) {
4097 edgesToUpdate.insert(flow.second->getParentEdges().front());
4098 }
4099 }
4100 // update spread geometries of all edges
4101 for (const auto& edge : edgesToUpdate) {
4102 edge->updateVehicleSpreadGeometries();
4103 }
4104 // update view to show new vehicles positions
4105 updateViewNet();
4106 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4107 if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_DRAWSPREADVEHICLES)) {
4109 } else if (sel == FXSEL(SEL_COMMAND, MID_GNE_DEMANDVIEWOPTIONS_DRAWSPREADVEHICLES)) {
4111 }
4112 return 1;
4113}
4114
4115
4116long
4117GNEViewNet::onCmdToggleWarnAboutMerge(FXObject*, FXSelector sel, void*) {
4118 // Toggle menuCheckWarnAboutMerge
4121 } else {
4123 }
4125 // Only update view
4126 updateViewNet();
4127 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4128 if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_ASKFORMERGE)) {
4130 }
4131 return 1;
4132}
4133
4134
4135long
4136GNEViewNet::onCmdToggleShowJunctionBubbles(FXObject*, FXSelector sel, void*) {
4137 // Toggle menuCheckShowJunctionBubble
4140 } else {
4142 }
4144 // Only update view
4145 updateViewNet();
4146 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4147 if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_SHOWBUBBLES)) {
4149 }
4150 return 1;
4151}
4152
4153
4154long
4155GNEViewNet::onCmdToggleMoveElevation(FXObject*, FXSelector sel, void*) {
4156 // Toggle menuCheckMoveElevation
4159 } else {
4161 }
4163 // Only update view
4164 updateViewNet();
4165 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4166 if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_MOVEELEVATION)) {
4168 }
4169 return 1;
4170}
4171
4172
4173long
4174GNEViewNet::onCmdToggleChainEdges(FXObject*, FXSelector sel, void*) {
4175 // Toggle menuCheckMoveElevation
4178 } else {
4180 }
4182 // Only update view
4183 updateViewNet();
4184 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4185 if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_CHAINEDGES)) {
4187 }
4188 return 1;
4189}
4190
4191
4192long
4193GNEViewNet::onCmdToggleAutoOppositeEdge(FXObject*, FXSelector sel, void*) {
4194 // Toggle menuCheckAutoOppositeEdge
4197 } else {
4199 }
4201 // Only update view
4202 updateViewNet();
4203 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4204 if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_AUTOOPPOSITEEDGES)) {
4206 }
4207 return 1;
4208}
4209
4210
4211long
4213 // Toggle menuCheckHideNonInspectedDemandElements
4216 } else {
4218 }
4220 // Only update view
4221 updateViewNet();
4222 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4223 if (sel == FXSEL(SEL_COMMAND, MID_GNE_DEMANDVIEWOPTIONS_HIDENONINSPECTED)) {
4225 }
4226 return 1;
4227}
4228
4229
4230long
4231GNEViewNet::onCmdToggleShowOverlappedRoutes(FXObject*, FXSelector sel, void*) {
4232 // Toggle menuCheckShowOverlappedRoutes
4235 } else {
4237 }
4239 // Only update view
4240 updateViewNet();
4241 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4242 if (sel == FXSEL(SEL_COMMAND, MID_GNE_DEMANDVIEWOPTIONS_SHOWOVERLAPPEDROUTES)) {
4244 }
4245 return 1;
4246}
4247
4248
4249long
4250GNEViewNet::onCmdToggleHideShapes(FXObject*, FXSelector sel, void*) {
4251 // Toggle menuCheckHideShapes
4254 } else {
4256 }
4258 // Only update view
4259 updateViewNet();
4260 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4261 if (sel == FXSEL(SEL_COMMAND, MID_GNE_DEMANDVIEWOPTIONS_HIDESHAPES)) {
4263 }
4264 return 1;
4265}
4266
4267
4268long
4269GNEViewNet::onCmdToggleShowTrips(FXObject*, FXSelector sel, void*) {
4270 // Toggle menuCheckHideShapes
4273 } else {
4275 }
4277 // Only update view
4278 updateViewNet();
4279 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4280 if (sel == FXSEL(SEL_COMMAND, MID_GNE_DEMANDVIEWOPTIONS_SHOWTRIPS)) {
4282 }
4283 return 1;
4284}
4285
4286
4287long
4288GNEViewNet::onCmdToggleShowAllPersonPlans(FXObject*, FXSelector sel, void*) {
4289 // Toggle menuCheckShowAllPersonPlans
4292 } else {
4294 }
4296 // Only update view
4297 updateViewNet();
4298 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4299 if (sel == FXSEL(SEL_COMMAND, MID_GNE_DEMANDVIEWOPTIONS_SHOWALLPERSONPLANS)) {
4301 }
4302 return 1;
4303}
4304
4305
4306long
4307GNEViewNet::onCmdToggleLockPerson(FXObject*, FXSelector sel, void*) {
4308 // Toggle menuCheckLockPerson
4313 }
4315 // lock or unlock current inspected person depending of menuCheckLockPerson value
4317 // obtain locked person or person plan
4318 const GNEDemandElement* personOrPersonPlan = dynamic_cast<const GNEDemandElement*>(myInspectedElements.getFirstAC());
4319 if (personOrPersonPlan) {
4320 // lock person depending if casted demand element is either a person or a person plan
4321 if (personOrPersonPlan->getTagProperty().isPerson()) {
4322 myDemandViewOptions.lockPerson(personOrPersonPlan);
4323 } else {
4324 myDemandViewOptions.lockPerson(personOrPersonPlan->getParentDemandElements().front());
4325 }
4326 }
4327 } else {
4328 // unlock current person
4330 }
4331 // update view
4332 updateViewNet();
4333 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4334 if (sel == FXSEL(SEL_COMMAND, MID_GNE_DEMANDVIEWOPTIONS_LOCKPERSON)) {
4336 }
4337 return 1;
4338}
4339
4340
4341long
4342GNEViewNet::onCmdToggleShowAllContainerPlans(FXObject*, FXSelector sel, void*) {
4343 // Toggle menuCheckShowAllContainerPlans
4346 } else {
4348 }
4350 // Only update view
4351 updateViewNet();
4352 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4353 if (sel == FXSEL(SEL_COMMAND, MID_GNE_DEMANDVIEWOPTIONS_SHOWALLCONTAINERPLANS)) {
4355 }
4356 return 1;
4357}
4358
4359
4360long
4361GNEViewNet::onCmdToggleLockContainer(FXObject*, FXSelector sel, void*) {
4362 // Toggle menuCheckLockContainer
4367 }
4369 // lock or unlock current inspected container depending of menuCheckLockContainer value
4371 // obtain locked container or container plan
4372 const GNEDemandElement* containerOrContainerPlan = dynamic_cast<const GNEDemandElement*>(myInspectedElements.getFirstAC());
4373 if (containerOrContainerPlan) {
4374 // lock container depending if casted demand element is either a container or a container plan
4375 if (containerOrContainerPlan->getTagProperty().isContainer()) {
4376 myDemandViewOptions.lockContainer(containerOrContainerPlan);
4377 } else {
4378 myDemandViewOptions.lockContainer(containerOrContainerPlan->getParentDemandElements().front());
4379 }
4380 }
4381 } else {
4382 // unlock current container
4384 }
4385 // update view
4386 updateViewNet();
4387 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4388 if (sel == FXSEL(SEL_COMMAND, MID_GNE_DEMANDVIEWOPTIONS_LOCKCONTAINER)) {
4390 }
4391 return 1;
4392}
4393
4394
4395long
4396GNEViewNet::onCmdToggleShowAdditionals(FXObject*, FXSelector sel, void*) {
4397 // Toggle menuCheckShowAdditionals
4400 } else {
4402 }
4404 // Only update view
4405 updateViewNet();
4406 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4407 if (sel == FXSEL(SEL_COMMAND, MID_GNE_DATAVIEWOPTIONS_SHOWADDITIONALS)) {
4409 }
4410 return 1;
4411}
4412
4413
4414long
4415GNEViewNet::onCmdToggleShowShapes(FXObject*, FXSelector sel, void*) {
4416 // Toggle menuCheckShowShapes
4419 } else {
4421 }
4423 // Only update view
4424 updateViewNet();
4425 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4426 if (sel == FXSEL(SEL_COMMAND, MID_GNE_DATAVIEWOPTIONS_SHOWSHAPES)) {
4428 }
4429 return 1;
4430}
4431
4432
4433long
4434GNEViewNet::onCmdToggleShowDemandElementsNetwork(FXObject*, FXSelector sel, void*) {
4435 // Toggle menuCheckShowDemandElements
4438 } else {
4440 }
4442 // compute demand elements
4444 // update view to show demand elements
4445 updateViewNet();
4446 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4447 if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_SHOWDEMANDELEMENTS)) {
4449 }
4450 return 1;
4451}
4452
4453
4454long
4455GNEViewNet::onCmdToggleShowDemandElementsData(FXObject*, FXSelector sel, void*) {
4456 // Toggle menuCheckShowDemandElements
4459 } else {
4461 }
4463 // compute demand elements
4465 // update view to show demand elements
4466 updateViewNet();
4467 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4468 if (sel == FXSEL(SEL_COMMAND, MID_GNE_DATAVIEWOPTIONS_SHOWDEMANDELEMENTS)) {
4470 }
4471 return 1;
4472}
4473
4474
4475long
4476GNEViewNet::onCmdToggleTAZRelDrawing(FXObject*, FXSelector sel, void*) {
4477 // Toggle menuCheckShowDemandElements
4480 } else {
4482 }
4484 // update view to show demand elements
4485 updateViewNet();
4486 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4487 if (sel == FXSEL(SEL_COMMAND, MID_GNE_DATAVIEWOPTIONS_TAZRELDRAWING)) {
4489 }
4490 return 1;
4491}
4492
4493
4494long
4495GNEViewNet::onCmdToggleTAZDrawFill(FXObject*, FXSelector sel, void*) {
4496 // Toggle menuCheckShowDemandElements
4499 } else {
4501 }
4503 // update view to show demand elements
4504 updateViewNet();
4505 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4506 if (sel == FXSEL(SEL_COMMAND, MID_GNE_DATAVIEWOPTIONS_TAZDRAWFILL)) {
4508 }
4509 return 1;
4510}
4511
4512
4513long
4514GNEViewNet::onCmdToggleTAZRelOnlyFrom(FXObject*, FXSelector sel, void*) {
4515 // Toggle menuCheckShowDemandElements
4518 } else {
4520 }
4522 // update view to show demand elements
4523 updateViewNet();
4524 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4525 if (sel == FXSEL(SEL_COMMAND, MID_GNE_DATAVIEWOPTIONS_TAZRELONLYFROM)) {
4527 }
4528 return 1;
4529}
4530
4531
4532long
4533GNEViewNet::onCmdToggleTAZRelOnlyTo(FXObject*, FXSelector sel, void*) {
4534 // Toggle menuCheckShowDemandElements
4537 } else {
4539 }
4541 // update view to show demand elements
4542 updateViewNet();
4543 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4544 if (sel == FXSEL(SEL_COMMAND, MID_GNE_DATAVIEWOPTIONS_TAZRELONLYTO)) {
4546 }
4547 return 1;
4548}
4549
4550
4551long
4552GNEViewNet::onCmdIntervalBarGenericDataType(FXObject*, FXSelector, void*) {
4554 return 1;
4555}
4556
4557
4558long
4559GNEViewNet::onCmdIntervalBarDataSet(FXObject*, FXSelector, void*) {
4561 return 1;
4562}
4563
4564
4565long
4566GNEViewNet::onCmdIntervalBarLimit(FXObject*, FXSelector, void*) {
4568 return 1;
4569}
4570
4571
4572long
4573GNEViewNet::onCmdIntervalBarSetBegin(FXObject*, FXSelector, void*) {
4575 return 1;
4576}
4577
4578
4579long
4580GNEViewNet::onCmdIntervalBarSetEnd(FXObject*, FXSelector, void*) {
4582 return 1;
4583}
4584
4585
4586long
4587GNEViewNet::onCmdIntervalBarSetParameter(FXObject*, FXSelector, void*) {
4589 return 1;
4590}
4591
4592
4593long
4594GNEViewNet::onCmdAddSelected(FXObject*, FXSelector, void*) {
4595 // only select if AC under cursor isn't previously selected
4597 if (AC && !AC->isAttributeCarrierSelected()) {
4599 }
4600 return 1;
4601}
4602
4603
4604long
4605GNEViewNet::onCmdRemoveSelected(FXObject*, FXSelector, void*) {
4606 // only unselect if AC under cursor isn't previously selected
4608 if (AC && AC->isAttributeCarrierSelected()) {
4610 }
4611 return 1;
4612}
4613
4614
4615long
4616GNEViewNet::onCmdAddEdgeSelected(FXObject*, FXSelector, void*) {
4617 // only select if edge under cursor isn't previously selected
4618 auto edge = myViewObjectsSelector.getEdgeFront();
4619 if (edge && !edge->isAttributeCarrierSelected()) {
4620 edge->selectAttributeCarrier();
4621 }
4622 return 1;
4623}
4624
4625
4626long
4627GNEViewNet::onCmdRemoveEdgeSelected(FXObject*, FXSelector, void*) {
4628 // only unselect if edge under cursor isn't previously selected
4629 auto edge = myViewObjectsSelector.getEdgeFront();
4630 if (edge && edge->isAttributeCarrierSelected()) {
4632 }
4633 return 1;
4634}
4635
4636
4637long
4638GNEViewNet::onCmdSetNeteditView(FXObject*, FXSelector sel, void*) {
4639 myEditModes.setView(FXSELID(sel));
4640 update();
4641 return 1;
4642}
4643
4644// ===========================================================================
4645// private
4646// ===========================================================================
4647
4648void
4650 // build supermode buttons
4652
4653 // build save elements buttons
4655
4656 // build time switch buttons
4658
4659 // build menu checks for Common checkable buttons
4661
4662 // build menu checks for Network checkable buttons
4664
4665 // build menu checks for Demand checkable buttons
4667
4668 // build menu checks of view options Data
4670
4671 // Create Vertical separator
4673 // XXX for some reason the vertical groove is not visible. adding more spacing to emphasize the separation
4676
4677 // build menu checks of view options Network
4679
4680 // build menu checks of view options Demand
4682
4683 // build menu checks of view options Data
4685
4686 // build interval bar
4688}
4689
4690
4691void
4693 // get menu checks
4695 // hide all checkbox of view options Network
4697 // hide all checkbox of view options Demand
4699 // hide all checkbox of view options Data
4701 // disable all common edit modes
4703 // disable all network edit modes
4705 // disable all network edit modes
4707 // hide interval bar
4709 // hide all frames
4711 // hide all menuchecks
4715 // In network mode, always show option "show grid", "draw spread vehicles" and "show demand elements"
4720 menuChecks.menuCheckToggleGrid->show();
4721 menuChecks.menuCheckToggleDrawJunctionShape->show();
4722 menuChecks.menuCheckDrawSpreadVehicles->show();
4723 menuChecks.menuCheckShowDemandElements->show();
4724 // show separator
4725 menuChecks.separator->show();
4726 // enable selected controls
4727 switch (myEditModes.networkEditMode) {
4728 // common modes
4734 // show view options
4739 // show menu checks
4740 menuChecks.menuCheckSelectEdges->show();
4741 menuChecks.menuCheckShowConnections->show();
4742 menuChecks.menuCheckShowAdditionalSubElements->show();
4743 menuChecks.menuCheckShowTAZElements->show();
4744 // update lock menu bar
4746 // show
4747 break;
4756 // show view options
4759 menuChecks.menuCheckShowAdditionalSubElements->show();
4760 menuChecks.menuCheckShowTAZElements->show();
4761 // show menu checks
4762 menuChecks.menuCheckSelectEdges->show();
4763 menuChecks.menuCheckShowConnections->show();
4764 break;
4770 // show view options
4776 // show menu checks
4777 menuChecks.menuCheckSelectEdges->show();
4778 menuChecks.menuCheckShowConnections->show();
4779 menuChecks.menuCheckExtendSelection->show();
4780 menuChecks.menuCheckShowAdditionalSubElements->show();
4781 menuChecks.menuCheckShowTAZElements->show();
4782 break;
4783 // specific modes
4789 // show view options
4792 // show menu checks
4793 menuChecks.menuCheckChainEdges->show();
4794 menuChecks.menuCheckAutoOppositeEdge->show();
4795 break;
4801 // show view options
4805 // show menu checks
4806 menuChecks.menuCheckWarnAboutMerge->show();
4807 menuChecks.menuCheckShowJunctionBubble->show();
4808 menuChecks.menuCheckMoveElevation->show();
4809 break;
4815 break;
4821 // show view options
4823 // show menu checks
4824 menuChecks.menuCheckChangeAllPhases->show();
4825 break;
4831 // show view options
4833 // show menu checks
4834 menuChecks.menuCheckShowAdditionalSubElements->show();
4835 break;
4841 break;
4847 break;
4853 break;
4859 break;
4865 break;
4871 break;
4872 default:
4873 break;
4874 }
4875 // update menuChecks shorcuts
4876 menuChecks.updateShortcuts();
4877 // update common Network buttons
4879 // Update Network buttons
4881 // recalc toolbar
4884 // force repaint because different modes draw different things
4885 onPaint(nullptr, 0, nullptr);
4886 // finally update view
4887 updateViewNet();
4888}
4889
4890
4891void
4893 // get menu checks
4895 // hide all checkbox of view options Network
4897 // hide all checkbox of view options Demand
4899 // hide all checkbox of view options Data
4901 // disable all common edit modes
4903 // disable all Demand edit modes
4905 // disable all network edit modes
4907 // hide interval bar
4909 // hide all frames
4911 // hide all menuchecks
4915 // always show "hide shapes", "show grid", "draw spread vehicles", "show overlapped routes" and show/lock persons and containers
4926 menuChecks.menuCheckToggleGrid->show();
4927 menuChecks.menuCheckToggleDrawJunctionShape->show();
4928 menuChecks.menuCheckDrawSpreadVehicles->show();
4929 menuChecks.menuCheckHideShapes->show();
4930 menuChecks.menuCheckShowAllTrips->show();
4931 menuChecks.menuCheckShowAllPersonPlans->show();
4932 menuChecks.menuCheckLockPerson->show();
4933 menuChecks.menuCheckShowAllContainerPlans->show();
4934 menuChecks.menuCheckLockContainer->show();
4935 menuChecks.menuCheckShowOverlappedRoutes->show();
4936 // show separator
4937 menuChecks.separator->show();
4938 // enable selected controls
4939 switch (myEditModes.demandEditMode) {
4940 // common modes
4945 // set checkable button
4947 // show view options
4949 // show menu checks
4950 menuChecks.menuCheckHideNonInspectedDemandElements->show();
4951 break;
4956 // set checkable button
4958 break;
4963 // set checkable button
4965 break;
4970 // set checkable button
4972 break;
4973 // specific modes
4978 // set checkable button
4980 break;
4985 // set checkable button
4987 break;
4992 // set checkable button
4994 break;
4999 // set checkable button
5001 break;
5006 // set checkable button
5008 break;
5013 // set checkable button
5015 break;
5020 // set checkable button
5022 break;
5027 // set checkable button
5029 break;
5034 // set checkable button
5036 break;
5041 // set checkable button
5043 break;
5044 default:
5045 break;
5046 }
5047 // update menuChecks shorcuts
5048 menuChecks.updateShortcuts();
5049 // update common Network buttons
5051 // Update Demand buttons
5053 // recalc toolbar
5056 // force repaint because different modes draw different things
5057 onPaint(nullptr, 0, nullptr);
5058 // finally update view
5059 updateViewNet();
5060}
5061
5062
5063void
5065 // get menu checks
5067 // hide all checkbox of view options Network
5069 // hide all checkbox of view options Demand
5071 // hide all checkbox of view options Data
5073 // disable all common edit modes
5075 // disable all Data edit modes
5077 // show interval bar
5079 // hide all frames
5081 // hide all menuchecks
5085 // In data mode, always show options for show elements
5090 menuChecks.menuCheckToggleDrawJunctionShape->show();
5091 menuChecks.menuCheckShowAdditionals->show();
5092 menuChecks.menuCheckShowShapes->show();
5093 menuChecks.menuCheckShowDemandElements->show();
5094 // show separator
5095 menuChecks.separator->show();
5096 // enable selected controls
5097 switch (myEditModes.dataEditMode) {
5098 // common modes
5103 // set checkable button
5105 // show view option
5110 // show menu check
5111 menuChecks.menuCheckToggleTAZRelDrawing->show();
5112 menuChecks.menuCheckToggleTAZDrawFill->show();
5113 menuChecks.menuCheckToggleTAZRelOnlyFrom->show();
5114 menuChecks.menuCheckToggleTAZRelOnlyTo->show();
5115 break;
5120 // set checkable button
5122 // show toggle TAZRel drawing view option
5126 // show toggle TAZRel drawing menu check
5127 menuChecks.menuCheckToggleTAZRelDrawing->show();
5128 menuChecks.menuCheckToggleTAZRelOnlyFrom->show();
5129 menuChecks.menuCheckToggleTAZRelOnlyTo->show();
5130 break;
5135 // set checkable button
5137 // show toggle TAZRel drawing view option
5141 // show toggle TAZRel drawing menu check
5142 menuChecks.menuCheckToggleTAZRelDrawing->show();
5143 menuChecks.menuCheckToggleTAZRelOnlyFrom->show();
5144 menuChecks.menuCheckToggleTAZRelOnlyTo->show();
5145 break;
5150 // set checkable button
5152 break;
5157 // set checkable button
5159 break;
5164 // set checkable button
5166 // show view option
5171 // show menu check
5172 menuChecks.menuCheckToggleTAZRelDrawing->show();
5173 menuChecks.menuCheckToggleTAZDrawFill->show();
5174 menuChecks.menuCheckToggleTAZRelOnlyFrom->show();
5175 menuChecks.menuCheckToggleTAZRelOnlyTo->show();
5176 break;
5181 // set checkable button
5183 break;
5184 default:
5185 break;
5186 }
5187 // update menuChecks shorcuts
5188 menuChecks.updateShortcuts();
5189 // update common Network buttons
5191 // Update Data buttons
5193 // recalc toolbar
5196 // force repaint because different modes draw different things
5197 onPaint(nullptr, 0, nullptr);
5198 // finally update view
5199 updateViewNet();
5200}
5201
5202
5203void
5205 if (AC->getTagProperty().getTag() == SUMO_TAG_JUNCTION) {
5206 // get junction (note: could be already removed if is a child, then hardfail=false)
5207 GNEJunction* junction = myNet->getAttributeCarriers()->retrieveJunction(AC->getID(), false);
5208 // if exist, remove it
5209 if (junction) {
5210 myNet->deleteJunction(junction, myUndoList);
5211 }
5212 } else if (AC->getTagProperty().getTag() == SUMO_TAG_CROSSING) {
5213 // get crossing (note: could be already removed if is a child, then hardfail=false)
5215 // if exist, remove it
5216 if (crossing) {
5217 myNet->deleteCrossing(crossing, myUndoList);
5218 }
5219 } else if (AC->getTagProperty().getTag() == SUMO_TAG_EDGE) {
5220 // get edge (note: could be already removed if is a child, then hardfail=false)
5221 GNEEdge* edge = myNet->getAttributeCarriers()->retrieveEdge(AC->getID(), false);
5222 // if exist, remove it
5223 if (edge) {
5224 myNet->deleteEdge(edge, myUndoList, false);
5225 }
5226 } else if (AC->getTagProperty().getTag() == SUMO_TAG_LANE) {
5227 // get lane (note: could be already removed if is a child, then hardfail=false)
5229 // if exist, remove it
5230 if (lane) {
5231 myNet->deleteLane(lane, myUndoList, false);
5232 }
5233 } else if (AC->getTagProperty().getTag() == SUMO_TAG_CONNECTION) {
5234 // get connection (note: could be already removed if is a child, then hardfail=false)
5236 // if exist, remove it
5237 if (connection) {
5238 myNet->deleteConnection(connection, myUndoList);
5239 }
5240 } else if (AC->getTagProperty().isAdditionalElement()) {
5241 // get additional Element (note: could be already removed if is a child, then hardfail=false)
5242 GNEAdditional* additionalElement = myNet->getAttributeCarriers()->retrieveAdditional(AC->getGUIGlObject(), false);
5243 // if exist, remove it
5244 if (additionalElement) {
5245 myNet->deleteAdditional(additionalElement, myUndoList);
5246 }
5247 }
5248}
5249
5250
5251void
5253 // get demand Element (note: could be already removed if is a child, then hardfail=false)
5255 // if exist, remove it
5256 if (demandElement) {
5257 myNet->deleteDemandElement(demandElement, myUndoList);
5258 }
5259}
5260
5261
5262void
5264 if (AC->getTagProperty().getTag() == SUMO_TAG_DATASET) {
5265 // get data set (note: could be already removed if is a child, then hardfail=false)
5266 GNEDataSet* dataSet = myNet->getAttributeCarriers()->retrieveDataSet(AC->getID(), false);
5267 // if exist, remove it
5268 if (dataSet) {
5269 myNet->deleteDataSet(dataSet, myUndoList);
5270 }
5271 } else if (AC->getTagProperty().getTag() == SUMO_TAG_DATAINTERVAL) {
5272 // get data interval (note: could be already removed if is a child, then hardfail=false)
5273 GNEDataInterval* dataInterval = myNet->getAttributeCarriers()->retrieveDataInterval(AC, false);
5274 // if exist, remove it
5275 if (dataInterval) {
5276 myNet->deleteDataInterval(dataInterval, myUndoList);
5277 }
5278 } else {
5279 // get generic data (note: could be already removed if is a child, then hardfail=false)
5281 // if exist, remove it
5282 if (genericData) {
5283 myNet->deleteGenericData(genericData, myUndoList);
5284 }
5285 }
5286}
5287
5288
5289void
5292 switch (myEditModes.networkEditMode) {
5294 myViewParent->getInspectorFrame()->update();
5295 break;
5296 default:
5297 break;
5298 }
5299 }
5301 switch (myEditModes.demandEditMode) {
5303 myViewParent->getInspectorFrame()->update();
5304 break;
5307 break;
5310 break;
5313 break;
5316 break;
5319 break;
5322 break;
5325 break;
5328 break;
5331 break;
5332 default:
5333 break;
5334 }
5335 }
5337 switch (myEditModes.dataEditMode) {
5339 myViewParent->getInspectorFrame()->update();
5340 break;
5341 default:
5342 break;
5343 }
5344 // update data interval
5346 }
5347 // update view
5348 updateViewNet();
5349}
5350
5351// ---------------------------------------------------------------------------
5352// Private methods
5353// ---------------------------------------------------------------------------
5354
5355void
5357 PositionVector temporalShape;
5358 bool deleteLastCreatedPoint = false;
5359 // obtain temporal shape and delete last created point flag
5366 }
5367 // check if we're in drawing mode
5368 if (temporalShape.size() > 0) {
5369 // draw blue line with the current drawed shape
5371 glLineWidth(2);
5372 glTranslated(0, 0, GLO_TEMPORALSHAPE);
5374 GLHelper::drawLine(temporalShape);
5376 // draw red line from the last point of shape to the current mouse position
5378 glLineWidth(2);
5379 glTranslated(0, 0, GLO_TEMPORALSHAPE);
5380 // draw last line depending if shift key (delete last created point) is pressed
5381 if (deleteLastCreatedPoint) {
5383 } else {
5385 }
5388 }
5389}
5390
5391
5392void
5394 // first check if we're in correct mode
5399 // get mouse position
5400 const Position mousePosition = snapToActiveGrid(getPositionInformation());
5401 // get junction exaggeration
5402 const double junctionExaggeration = myVisualizationSettings->junctionSize.getExaggeration(*myVisualizationSettings, nullptr, 4);
5403 // get bubble color
5405 // change alpha
5406 bubbleColor.setAlpha(200);
5407 // push layer matrix
5409 // translate to temporal shape layer
5410 glTranslated(0, 0, GLO_TEMPORALSHAPE);
5411 // push junction matrix
5413 // move matrix junction center
5414 glTranslated(mousePosition.x(), mousePosition.y(), 0.1);
5415 // set color
5416 GLHelper::setColor(bubbleColor);
5417 // draw outline circle
5418 const double circleWidth = myVisualizationSettings->neteditSizeSettings.junctionBubbleRadius * junctionExaggeration;
5419 GLHelper::drawOutlineCircle(circleWidth, circleWidth * 0.75, 32);
5420 // pop junction matrix
5422 // draw temporal edge
5424 // set temporal edge color
5425 RGBColor temporalEdgeColor = RGBColor::BLACK;
5426 temporalEdgeColor.setAlpha(200);
5427 // declare temporal edge geometry
5428 GUIGeometry temporalEdgeGeometry;
5429 // calculate geometry between source junction and mouse position
5430 PositionVector temporalEdge = {mousePosition, myViewParent->getCreateEdgeFrame()->getJunctionSource()->getPositionInView()};
5431 // move temporal edge 2 side
5432 temporalEdge.move2side(-1);
5433 // update geometry
5434 temporalEdgeGeometry.updateGeometry(temporalEdge);
5435 // push temporal edge matrix
5437 // set color
5438 GLHelper::setColor(temporalEdgeColor);
5439 // draw temporal edge
5441 // check if we have to draw opposite edge
5443 // move temporal edge to opposite edge
5444 temporalEdge.move2side(2);
5445 // update geometry
5446 temporalEdgeGeometry.updateGeometry(temporalEdge);
5447 // draw temporal edge
5449 }
5450 // pop temporal edge matrix
5452 }
5453 // pop layer matrix
5455 }
5456}
5457
5458
5459void
5461 // first check if we're in correct mode
5466 (gViewObjectsHandler.markedEdge != nullptr)) {
5467 // calculate split position
5468 const auto lane = gViewObjectsHandler.markedEdge->getLanes().back();
5469 auto shape = lane->getLaneShape();
5470 // move shape to side
5471 shape.move2side(lane->getDrawingConstants()->getDrawingWidth() * -1);
5472 const auto offset = shape.nearest_offset_to_point2D(snapToActiveGrid(getPositionInformation()));
5473 const auto splitPosition = shape.positionAtOffset2D(offset);
5474 // get junction exaggeration
5475 const double junctionExaggeration = myVisualizationSettings->junctionSize.getExaggeration(*myVisualizationSettings, nullptr, 4);
5476 // get bubble color
5478 // push layer matrix
5480 // translate to temporal shape layer
5481 glTranslated(0, 0, GLO_TEMPORALSHAPE);
5482 // push junction matrix
5484 // move matrix junction center
5485 glTranslated(splitPosition.x(), splitPosition.y(), 0.1);
5486 // set color
5487 GLHelper::setColor(bubbleColor);
5488 // draw outline circle
5489 const double circleWidth = myVisualizationSettings->neteditSizeSettings.junctionBubbleRadius * junctionExaggeration;
5490 GLHelper::drawOutlineCircle(circleWidth, circleWidth * 0.75, 32);
5491 // draw filled circle
5493 // pop junction matrix
5495 // pop layer matrix
5497 }
5498}
5499
5500
5501void
5503 // check conditions
5504 if ((myCurrentObjectsDialog.size() > 0) && (myCurrentObjectsDialog.front()->getType() == GLO_JUNCTION) && myDrawPreviewRoundabout) {
5505 // get junction
5506 const auto junction = myNet->getAttributeCarriers()->retrieveJunction(myCurrentObjectsDialog.front()->getMicrosimID());
5507 // push layer matrix
5509 // translate to temporal shape layer
5510 glTranslated(0, 0, GLO_TEMPORALSHAPE);
5511 // push junction matrix
5513 // move matrix junction center
5514 glTranslated(junction->getNBNode()->getPosition().x(), junction->getNBNode()->getPosition().y(), 0.1);
5515 // set color
5517 // draw outline circle
5518 const double circleWidth = (junction->getNBNode()->getRadius() < 0) ? 4.0 : junction->getNBNode()->getRadius();
5519 GLHelper::drawOutlineCircle(circleWidth * 1.30, circleWidth, 32);
5520 // pop junction matrix
5522 // pop layer matrix
5524 }
5525}
5526
5527
5528void
5530 // check conditions
5532 // get junction
5534 // push layer matrix
5536 // translate to TLLogic
5537 glTranslated(0, 0, GLO_TEMPORALSHAPE);
5538 // iterate over all E1 detectors
5539 for (const auto& E1ID : myViewParent->getTLSEditorFrame()->getTLSAttributes()->getE1Detectors()) {
5540 // first check if E1 exists
5541 const auto E1 = myNet->getAttributeCarriers()->retrieveAdditional(SUMO_TAG_INDUCTION_LOOP, E1ID.second, false);
5542 if (E1) {
5543 // push line matrix
5545 // draw line between junction and E1
5546 GUIGeometry::drawChildLine(*myVisualizationSettings, junctionPos, E1->getPositionInView(),
5548 // pop line matrix
5550 }
5551 }
5552 // pop layer matrix
5554 }
5555}
5556
5557
5558void
5560 // check conditions
5562 // get junction
5564 // push layer matrix
5566 // translate to TLLogic
5567 glTranslated(0, 0, GLO_TEMPORALSHAPE);
5568 // iterate over all Junction detectors
5569 for (const auto& selectedJunctionID : myViewParent->getTLSEditorFrame()->getTLSJunction()->getSelectedJunctionIDs()) {
5570 // get junction
5571 const auto selectedJunction = myNet->getAttributeCarriers()->retrieveJunction(selectedJunctionID);
5572 // push line matrix
5574 // draw line between junction and Junction
5575 GUIGeometry::drawChildLine(*myVisualizationSettings, junctionPos, selectedJunction->getPositionInView(),
5577 // pop line matrix
5579 }
5580 // pop layer matrix
5582 }
5583}
5584
5585
5586void
5592
5593
5594void
5597 // get mouse position
5598 const Position mousePosition = snapToActiveGrid(getPositionInformation());
5599 // push layer matrix
5601 // translate to test layer, but under magenta square
5602 glTranslated(mousePosition.x(), mousePosition.y(), GLO_TESTELEMENT - 1);
5603 // set color
5605 // draw circle
5607 // pop layer matrix
5609 }
5610}
5611
5612
5613void
5615 // reset moving selected edge
5617 // decide what to do based on mode
5618 switch (myEditModes.networkEditMode) {
5620 // first swap lane to edges if mySelectEdges is enabled and shift key isn't pressed
5621 if (checkSelectEdges()) {
5623 } else {
5625 }
5626 // now filter locked elements
5628 // check if we're selecting a new parent for the current inspected element
5631 } else {
5632 // process left click in Inspector Frame
5634 }
5635 // process click
5636 processClick(eventData);
5637 break;
5638 }
5640 // first swap lane to edges if mySelectEdges is enabled and shift key isn't pressed
5641 if (checkSelectEdges()) {
5643 } else {
5645 }
5646 // now filter locked elements forcing excluding walkingAreas
5648 // continue depending of AC
5650 // now check if we want only delete geometry points
5652 // only remove geometry point
5655 // remove all selected attribute carriers
5658 }
5659 } else {
5660 // remove attribute carrier under cursor
5662 }
5663 } else {
5664 // process click
5665 processClick(eventData);
5666 }
5667 break;
5668 }
5670 // first swap lane to edges if mySelectEdges is enabled and shift key isn't pressed
5671 if (checkSelectEdges()) {
5673 } else {
5675 }
5676 // now filter locked elements
5678 // avoid to select if control key is pressed
5680 // check if a rect for selecting is being created
5682 // begin rectangle selection
5685 // process click
5686 processClick(eventData);
5687 }
5688 } else {
5689 // process click
5690 processClick(eventData);
5691 }
5692 break;
5694 // check what buttons are pressed
5696 // get edge under cursor
5698 if (edge) {
5699 // obtain reverse edge
5700 const auto oppositeEdges = edge->getOppositeEdges();
5701 // check if we're split one or both edges
5704 } else if (oppositeEdges.size() > 0) {
5705 myNet->splitEdgesBidi(edge, oppositeEdges.front(), edge->getSplitPos(getPositionInformation()), myUndoList);
5706 } else {
5708 }
5709 }
5711 // process left click in create edge frame Frame
5716 }
5717 // process click
5718 processClick(eventData);
5719 break;
5720 }
5722 // editing lane shapes in move mode isn't finished, then always filter lanes
5724 // filter locked elements
5726 // check if we're editing a shape
5728 // check if we're removing a geometry point
5730 // remove geometry point
5733 }
5735 // process click if there isn't movable elements (to move camera using drag an drop)
5736 processClick(eventData);
5737 }
5738 } else {
5739 // get AC under cursor
5741 // check that AC is an network or additional element
5742 if (AC && (AC->getTagProperty().isNetworkElement() || AC->getTagProperty().isAdditionalElement())) {
5743 // check if we're moving a set of selected items
5744 if (AC->isAttributeCarrierSelected()) {
5745 // move selected ACs
5748 // process click if there isn't movable elements (to move camera using drag an drop)
5749 processClick(eventData);
5750 }
5751 } else {
5752 // process click if there isn't movable elements (to move camera using drag an drop)
5753 processClick(eventData);
5754 }
5755 }
5756 break;
5757 }
5759 // check if we're clicked over a non locked lane
5761 // Handle laneclick (shift key may pass connections, Control key allow conflicts)
5763 updateViewNet();
5764 }
5765 // process click
5766 processClick(eventData);
5767 break;
5768 }
5771 // edit TLS in TLSEditor frame
5773 updateViewNet();
5774 }
5775 // process click
5776 processClick(eventData);
5777 break;
5778 }
5780 // avoid create additionals if control key is pressed
5783 WRITE_WARNING(TL("Shift + click to create two additionals in the same position"));
5785 // save last mouse position
5787 updateViewNet();
5788 }
5789 }
5790 // process click
5791 processClick(eventData);
5792 break;
5793 }
5795 // call function addCrossing from crossing frame
5797 // process click
5798 processClick(eventData);
5799 break;
5800 }
5802 // avoid create TAZs if control key is pressed
5804 // check if we want to create a rect for selecting edges
5806 // begin rectangle selection
5808 } else {
5809 // check if process click was successfully
5811 updateViewNet();
5812 }
5813 // process click
5814 processClick(eventData);
5815 }
5816 } else {
5817 // process click
5818 processClick(eventData);
5819 }
5820 break;
5821 }
5823 // avoid create shapes if control key is pressed
5826 // declare processClick flag
5827 bool updateTemporalShape = false;
5828 // process click
5830 updateViewNet();
5831 // process click depending of the result of "process click"
5832 if (!updateTemporalShape) {
5833 // process click
5834 processClick(eventData);
5835 }
5836 }
5837 } else {
5838 // process click
5839 processClick(eventData);
5840 }
5841 break;
5842 }
5845 // shift key may pass connections, Control key allow conflicts.
5847 updateViewNet();
5848 }
5849 // process click
5850 processClick(eventData);
5851 break;
5852 }
5854 // avoid create wires if control key is pressed
5857 updateViewNet();
5858 }
5859 // process click
5860 processClick(eventData);
5861 break;
5862 }
5864 // process click
5865 processClick(eventData);
5866 break;
5867 }
5868 default: {
5869 // process click
5870 processClick(eventData);
5871 }
5872 }
5873}
5874
5875
5876void
5878 // check moved items
5882 // check if we're creating a rectangle selection or we want only to select a lane
5884 // check if we're selecting all type of elements o we only want a set of edges for TAZ
5888 // process edge selection
5890 }
5892 // check if there is a lane in objects under cursor
5894 // if we clicked over an lane with shift key pressed, select or unselect it
5897 } else {
5899 }
5900 }
5901 }
5902 // finish selection
5904 } else {
5905 // finish moving of single elements
5907 }
5908}
5909
5910
5911void
5912GNEViewNet::processMoveMouseNetwork(const bool mouseLeftButtonPressed) {
5913 // change "delete last created point" depending if during movement shift key is pressed
5918 }
5919 // check what type of additional is moved
5921 // move entire selection
5922 myMoveMultipleElements.moveSelection(mouseLeftButtonPressed);
5924 // update selection corner of selecting area
5926 } else {
5927 // move single elements
5928 myMoveSingleElement.moveSingleElement(mouseLeftButtonPressed);
5929 }
5930}
5931
5932
5933void
5935 // filter shapes (because POIs and polygons doesn't interact in demand mode)
5937 // decide what to do based on mode
5938 switch (myEditModes.demandEditMode) {
5940 // filter locked elements
5942 // process left click in Inspector Frame
5944 // process click
5945 processClick(eventData);
5946 break;
5947 }
5949 // filter locked elements
5951 // get front AC
5952 const auto frontAC = myViewObjectsSelector.getAttributeCarrierFront();
5953 // check conditions
5954 if (frontAC) {
5955 // check if we are deleting a selection or an single attribute carrier
5956 if (frontAC->isAttributeCarrierSelected()) {
5958 } else {
5960 }
5961 } else {
5962 // process click
5963 processClick(eventData);
5964 }
5965 break;
5966 }
5968 // filter locked elements
5970 // avoid to select if control key is pressed
5972 // check if a rect for selecting is being created
5974 // begin rectangle selection
5977 // process click
5978 processClick(eventData);
5979 }
5980 } else {
5981 // process click
5982 processClick(eventData);
5983 }
5984 break;
5986 // filter locked elements
5988 // get front AC
5989 const auto frontAC = myViewObjectsSelector.getAttributeCarrierFront();
5990 // check that AC under cursor is a demand element
5991 if (frontAC) {
5992 // check if we're moving a set of selected items
5993 if (frontAC->isAttributeCarrierSelected()) {
5994 // move selected ACs
5997 // process click if there isn't movable elements (to move camera using drag an drop)
5998 processClick(eventData);
5999 }
6000 } else {
6001 // process click if there isn't movable elements (to move camera using drag an drop)
6002 processClick(eventData);
6003 }
6004 break;
6005 }
6007 // check if we clicked over a lane
6009 // Handle edge click
6011 }
6012 // process click
6013 processClick(eventData);
6014 break;
6015 }
6017 // filter additionals (except TAZs) and demands (except routes)
6020 // Handle click
6022 // process click
6023 processClick(eventData);
6024 break;
6025 }
6027 // filter additionals (except stoppingPlaces) and demands
6030 // Handle click
6032 WRITE_WARNING(TL("Control + click to create two stop in the same position"));
6034 updateViewNet();
6035 // save last mouse position
6037 }
6038 // process click
6039 processClick(eventData);
6040 break;
6041 }
6043 // filter additionals (except stoppingPlaces and TAZs)
6045 // special case if we're creating person over walk routes
6048 } else {
6050 }
6051 // Handle click
6053 // process click
6054 processClick(eventData);
6055 break;
6056 }
6058 // filter additionals (except stoppingPlaces and TAZs)
6060 // special case if we're creating person over walk routes
6063 } else {
6065 }
6066 // Handle person plan click
6068 // process click
6069 processClick(eventData);
6070 break;
6071 }
6073 // filter additionals (except stoppingPlaces and TAZs) and demands
6076 // Handle click
6078 // process click
6079 processClick(eventData);
6080 break;
6081 }
6083 // filter additionals (except stoppingPlaces and TAZs) and demands
6086 // Handle container plan click
6088 // process click
6089 processClick(eventData);
6090 break;
6091 }
6092 default: {
6093 // process click
6094 processClick(eventData);
6095 }
6096 }
6097}
6098
6099
6100void
6102 // check moved items
6106 // check if we're creating a rectangle selection or we want only to select a lane
6109 }
6110 // finish selection
6112 } else {
6113 // finish moving of single elements
6115 }
6116}
6117
6118
6119void
6120GNEViewNet::processMoveMouseDemand(const bool mouseLeftButtonPressed) {
6122 // update selection corner of selecting area
6124 } else {
6125 // move single elements
6126 myMoveSingleElement.moveSingleElement(mouseLeftButtonPressed);
6127 }
6128}
6129
6130
6131void
6133 // get AC
6135 // decide what to do based on mode
6136 switch (myEditModes.dataEditMode) {
6138 // filter locked elements
6140 // process left click in Inspector Frame
6141 if (AC && AC->getTagProperty().getTag() == SUMO_TAG_TAZ) {
6143 } else {
6145 }
6146 // process click
6147 processClick(eventData);
6148 break;
6149 }
6151 // check conditions
6152 if (AC) {
6153 // check if we are deleting a selection or an single attribute carrier
6154 if (AC->isAttributeCarrierSelected()) {
6155 if (!AC->getGUIGlObject()->isGLObjectLocked()) {
6157 }
6158 } else {
6160 }
6161 } else {
6162 // process click
6163 processClick(eventData);
6164 }
6165 break;
6166 }
6168 // filter locked elements
6170 // avoid to select if control key is pressed
6172 // check if a rect for selecting is being created
6174 // begin rectangle selection
6177 // process click
6178 processClick(eventData);
6179 }
6180 } else {
6181 // process click
6182 processClick(eventData);
6183 }
6184 break;
6186 // avoid create edgeData if control key is pressed
6189 updateViewNet();
6190 }
6191 }
6192 // process click
6193 processClick(eventData);
6194 break;
6196 // avoid create edgeData if control key is pressed
6199 updateViewNet();
6200 }
6201 }
6202 // process click
6203 processClick(eventData);
6204 break;
6206 // avoid create TAZData if control key is pressed
6209 updateViewNet();
6210 }
6211 }
6212 // process click
6213 processClick(eventData);
6214 break;
6216 // avoid create TAZData if control key is pressed
6218 //
6219 }
6220 // process click
6221 processClick(eventData);
6222 break;
6223 default: {
6224 // process click
6225 processClick(eventData);
6226 }
6227 }
6228}
6229
6230
6231void
6233 // check moved items
6237 // check if we're creating a rectangle selection or we want only to select a lane
6240 }
6241 // finish selection
6243 } else {
6244 // finish moving of single elements
6246 }
6247}
6248
6249
6250void
6251GNEViewNet::processMoveMouseData(const bool mouseLeftButtonPressed) {
6253 // update selection corner of selecting area
6255 } else {
6256 // move single elements
6257 myMoveSingleElement.moveSingleElement(mouseLeftButtonPressed);
6258 }
6259}
6260
6261
6262/****************************************************************************/
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:118
#define GUIDesignVerticalSeparator
vertical separator
Definition GUIDesigns.h:469
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_FRONTELEMENT
front element (used in netedit)
@ 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:438
static void setColor(const RGBColor &c)
Sets the gl-color to this value.
Definition GLHelper.cpp:654
static void drawOutlineCircle(double radius, double iRadius, int steps=8)
Draws an unfilled circle around (0,0)
Definition GLHelper.cpp:596
static void drawFilledCircle(const double widradiusth, const int steps=8)
Draws a filled circle around (0,0)
Definition GLHelper.cpp:569
static void popMatrix()
pop matrix
Definition GLHelper.cpp:130
static void pushMatrix()
push matrix
Definition GLHelper.cpp:117
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
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
void unselectAttributeCarrier(const bool changeFlag=true)
unselect attribute carrier using GUIGlobalSelection
void selectAttributeCarrier(const bool changeFlag=true)
select attribute carrier using GUIGlobalSelection
virtual GUIGlObject * getGUIGlObject()=0
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:2440
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:2452
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:2357
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
Definition GNEEdge.cpp:1251
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
bool isSelectingParent() const
check if we're selecting a new parent
void setNewParent(GNEAttributeCarrier *clickedAC)
set new parent
void setEdgeTemplate(const GNEEdge *edge)
set edge template
GNEEdgeTemplate * getEdgeTemplate() const
get edge template (to copy attributes from)
void inspectSingleElement(GNEAttributeCarrier *AC)
Inspect a single element.
TemplateEditor * getTemplateEditor() const
get template editor
bool processDemandSupermodeClick(const Position &clickedPosition, GNEViewNetHelper::ViewObjectsSelector &viewObjects)
process click over Viewnet in Supermode Demand
void clearInspectedAC()
Clear all current inspected ACs.
void show()
show inspector frame
GNEOverlappedInspection * getOverlappedInspection() const
get GNEOverlappedInspection modul
GNEInspectorFrame::NeteditAttributesEditor * getNeteditAttributesEditor() const
get Netedit Attributes editor
bool processNetworkSupermodeClick(const Position &clickedPosition, GNEViewNetHelper::ViewObjectsSelector &viewObjects)
process click over Viewnet in Supermode Network
bool processDataSupermodeClick(const Position &clickedPosition, GNEViewNetHelper::ViewObjectsSelector &viewObjects)
process click over Viewnet in Supermode Data
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:751
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:2888
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:2161
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:2085
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:1989
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:1935
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:1541
void initGNEConnections()
initialize GNEConnections
Definition GNENet.cpp:2875
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:2167
GNEViewNet * getViewNet() const
get view net
Definition GNENet.cpp:2155
void clearJunctionConnections(GNEJunction *junction, GNEUndoList *undoList)
clear junction's connections
Definition GNENet.cpp:2073
void computeDemandElements(GNEApplicationWindow *window)
compute demand elements param[in] window The window to inform about delay
Definition GNENet.cpp:1490
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
bool checkSavedPosition(const Position &clickedPosition) const
check if given position is near to saved position
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
void editTLS(const Position &clickedPosition, const GNEViewNetHelper::ViewObjectsSelector &viewObjects)
edits the traffic light for the given clicked junction
GNETLSEditorFrame::TLSJunction * getTLSJunction() const
get module for TLS 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 to group all variables related with objects under cursor after a click over view
void updateObjects()
update objects (using gViewObjectsHandler)
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)
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 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:731
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:669
long onMouseMove(FXObject *, FXSelector, void *)
called when user moves mouse
const GNEAttributeCarrier * getFrontAttributeCarrier() const
get front attributeCarrier
void hotkeyBackSpace()
handle backspace keypress
GNEDemandElement * myLastCreatedRoute
last created route
Definition GNEViewNet.h:755
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
void setFrontAttributeCarrier(GNEAttributeCarrier *AC)
set front attributeCarrier
GNECrossing * getCrossingAtPopupPosition()
try to retrieve a crossing at popup position
void buildViewToolBars(GUIGlChildWindow *v)
builds the view toolbars
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:650
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:653
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:728
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:672
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:764
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
GNEAttributeCarrier * myFrontAttributeCarrier
front attribute carrier
Definition GNEViewNet.h:752
GNEViewNetHelper::MouseButtonKeyPressed myMouseButtonKeyPressed
variable used to save key status after certain events
Definition GNEViewNet.h:661
void recalculateBoundaries()
recalculate boundaries
GNEViewNetHelper::IntervalBar myIntervalBar
variable used to save IntervalBar
Definition GNEViewNet.h:697
GNEViewParent * myViewParent
view parent
Definition GNEViewNet.h:740
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:689
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:746
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:749
void drawTranslateFrontAttributeCarrier(const GNEAttributeCarrier *AC, double typeOrLayer, const double extraOffset=0)
draw front attributeCarrier
GNEViewNetHelper::NetworkViewOptions myNetworkViewOptions
variable used to save variables related with view options in supermode Network
Definition GNEViewNet.h:686
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:703
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:678
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:725
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
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:737
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:722
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:734
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:675
const GUIGlObject * getFrontGLObject() const
get front glObject
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:761
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:706
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:758
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:743
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:692
int myDrawingToggle
drawin toggle (used in drawGLElements to avoid draw elements twice)
Definition GNEViewNet.h:767
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:644
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:2616
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