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
305
306
307void
309 if (myNet && makeCurrent()) {
310 // declare boundary
311 const Boundary maxBoundary(1000000000.0, 1000000000.0, -1000000000.0, -1000000000.0);
312 // get all objects in boundary
313 const std::vector<GUIGlID> GLIDs = getObjectsInBoundary(maxBoundary);
314 // finish make OpenGL context current
315 makeNonCurrent();
316 // declare set
317 std::set<GNEAttributeCarrier*> ACs;
318 // iterate over GUIGlIDs
319 for (const auto& GLId : GLIDs) {
321 // Make sure that object exists
322 if (AC && AC->getTagProperty().isPlacedInRTree()) {
323 ACs.insert(AC);
324 }
325 }
326 // interate over ACs
327 for (const auto& AC : ACs) {
328 // remove object and insert again with exaggeration
329 myNet->getGrid().removeAdditionalGLObject(AC->getGUIGlObject());
330 myNet->getGrid().addAdditionalGLObject(AC->getGUIGlObject(), AC->getGUIGlObject()->getExaggeration(*myVisualizationSettings));
331 }
332 }
333}
334
335
336void
338
339
344 } else {
345 return 0;
346 }
347}
348
349
350void
352 // build coloring tools
353 {
354 for (auto it_names : gSchemeStorage.getNames()) {
355 v->getColoringSchemesCombo()->appendIconItem(it_names.c_str());
356 if (it_names == myVisualizationSettings->name) {
358 }
359 }
360 }
361 // for junctions
363 std::string("\t") + TL("Locate Junctions") + std::string("\t") + TL("Locate a junction within the network. (Shift+J)"),
365 // for edges
367 std::string("\t") + TL("Locate Edges") + std::string("\t") + TL("Locate an edge within the network. (Shift+E)"),
369 // for walkingAreas
371 std::string("\t") + TL("Locate WalkingAreas") + std::string("\t") + TL("Locate a walkingArea within the network. (Shift+W)"),
373 // for vehicles
375 std::string("\t") + TL("Locate Vehicles") + std::string("\t") + TL("Locate a vehicle within the network. (Shift+V)"),
377 // for person
379 std::string("\t") + TL("Locate Persons") + std::string("\t") + TL("Locate a person within the network. (Shift+P)"),
381 // for container
383 std::string("\t") + TL("Locate Containers") + std::string("\t") + TL("Locate a container within the network. (Shift+C)"),
385 // for routes
387 std::string("\t") + TL("Locate Route") + std::string("\t") + TL("Locate a route within the network. (Shift+R)"),
389 // for routes
391 std::string("\t") + TL("Locate Stops") + std::string("\t") + TL("Locate a stop within the network. (Shift+S)"),
393 // for persons (currently unused)
394 /*
395 new MFXButtonTooltip(v->getLocatorPopup(),
396 std::string("\t") + TL("Locate Vehicle\tLocate a person within the network.",
397 GUIIconSubSys::getIcon(GUIIcon::LOCATEPERSON), &v, MID_LOCATEPERSON,
398 GUIDesignButtonPopup);
399 */
400 // for tls
402 std::string("\t") + TL("Locate TLS") + std::string("\t") + TL("Locate a tls within the network. (Shift+T)"),
404 // for additional stuff
406 std::string("\t") + TL("Locate Additional") + std::string("\t") + TL("Locate an additional structure within the network. (Shift+A)"),
408 // for pois
410 std::string("\t") + TL("Locate PoI") + std::string("\t") + TL("Locate a PoI within the network. (Shift+O)"),
412 // for polygons
414 std::string("\t") + TL("Locate Polygon") + std::string("\t") + TL("Locate a Polygon within the network. (Shift+L)"),
416}
417
418
419void
420GNEViewNet::updateViewNet(const bool ignoreViewUpdater) const {
421 // this call is only used for breakpoints (to check when view is updated)
422 if (ignoreViewUpdater || gViewUpdater.allowUpdate()) {
423 GUISUMOAbstractView::update();
424 }
425}
426
427
428void
432
433
434void
437 // hide data button (and adjust width)
438 myEditModes.dataButton->hide();
439 // check network modes
447 break;
448 default:
449 break;
450 }
451 // check demand modes
452 switch (myEditModes.demandEditMode) {
459 break;
460 default:
461 break;
462 }
463 // go to network mode if we're in data mode
466 } else {
467 // refresh current supermode
469 }
470 } else {
471 // show data button
472 myEditModes.dataButton->show();
473 // refresh current supermode
475 }
476}
477
478
483
484
485void
487 // clear post drawing elements
489 // set selection boundary in gObjectsInPosition
491 // push matrix
493 // enable draw for object under cursor
495 // draw all GL elements within the small boundary
496 drawGLElements(boundary);
497 // restore draw for object under cursor
499 // pop matrix
501 // check if update front element
504 }
505 // after draw elements, update objects under cursor
507}
508
509
510void
512 // clear post drawing elements
514 // set selection position in gObjectsInPosition
516 // create an small boundary
517 Boundary positionBoundary;
518 positionBoundary.add(pos);
519 positionBoundary.grow(POSITION_EPS);
520 // push matrix
522 // enable draw for view objects handler (this calculate the contours)
524 // draw all GL elements within the small boundary
525 drawGLElements(positionBoundary);
526 // check if filter edges that have the mouse over their geometry points
529 }
530 // restore draw for view objects handler (this calculate the contours)
532 // pop matrix
534 // check if update front element
537 }
538 // after draw elements, update objects under cursor
540}
541
542
543void
545 // first add all inspected elements to redraw objects
546 for (const auto& insectedAC : myInspectedAttributeCarriers) {
547 gViewObjectsHandler.addToRedrawObjects(insectedAC->getGUIGlObject());
548 }
549 // push matrix
551 // enable draw for view objects handler (this calculate the contours)
553 // make a copy of redraw objects
554 std::set<const GUIGlObject*> redrawObjectsInDrawingBoundary;
555 // only draw objects within the drawing boundary
556 for (const auto& object : gViewObjectsHandler.getRedrawObjects()) {
557 if (drawingBoundary.overlaps2D(object->getCenteringBoundary())) {
558 redrawObjectsInDrawingBoundary.insert(object);
559 }
560 }
561 for (const auto& object : redrawObjectsInDrawingBoundary) {
562 object->drawGL(*myVisualizationSettings);
563 }
564 // restore draw for view objects handler (this calculate the contours)
566 // pop matrix
568}
569
570
575
576
581
582
583void
592
593
594bool
595GNEViewNet::setColorScheme(const std::string& name) {
596 if (!gSchemeStorage.contains(name)) {
597 return false;
598 }
599 if (myGUIDialogViewSettings != nullptr) {
602 }
603 }
606 return true;
607}
608
609
610void
612 // reimplemented from GUISUMOAbstractView due GNEOverlappedInspection
613 ungrab();
614 // make network current
615 if (isEnabled() && myAmInitialised) {
616 // check if we're cliking while alt button is pressed
618 // set clicked popup position
620 // create cursor popup dialog for mark front element
622 // open popup dialog
624 } else if (myViewObjectsSelector.getGLObjects().empty()) {
626 } else {
627 // declare filtered objects
628 std::vector<GUIGlObject*> filteredGLObjects;
629 // get GUIGLObject front
630 GUIGlObject* overlappedElement = nullptr;
631 // we need to check if we're inspecting a overlapping element
634 myInspectedAttributeCarriers.size() > 0) {
635 overlappedElement = myInspectedAttributeCarriers.front()->getGUIGlObject();
636 filteredGLObjects.push_back(overlappedElement);
637 }
638 bool connections = false;
639 bool TLS = false;
640 // fill filtered objects
641 if ((myViewObjectsSelector.getGLObjects().size() == 1) && (myViewObjectsSelector.getGLObjects().back()->getType() == GLO_EDGE)) {
642 // special case for edge geometry points (because edges uses the lane pop ups)
643 filteredGLObjects.push_back(myViewObjectsSelector.getGLObjects().back());
644 } else {
645 for (const auto& glObject : myViewObjectsSelector.getGLObjects()) {
646 // always avoid edges
647 if (glObject->getType() == GLO_EDGE) {
648 continue;
649 }
650 if (glObject->getType() == GLO_CONNECTION) {
651 connections = true;
652 }
653 if (glObject->getType() == GLO_TLLOGIC) {
654 TLS = true;
655 }
656 filteredGLObjects.push_back(glObject);
657 }
658 auto it = filteredGLObjects.begin();
659 if (connections) {
660 // filter junctions if there are connections
661 while (it != filteredGLObjects.end()) {
662 if ((*it)->getType() == GLO_JUNCTION) {
663 it = filteredGLObjects.erase(it);
664 } else {
665 it++;
666 }
667 }
668 } else if (TLS) {
669 // filter all elements except TLLogic
670 while (it != filteredGLObjects.end()) {
671 if ((*it)->getType() != GLO_TLLOGIC) {
672 it = filteredGLObjects.erase(it);
673 } else {
674 it++;
675 }
676 }
677 }
678 }
679 // remove duplicated elements using an unordered set
680 auto itDuplicated = filteredGLObjects.begin();
681 std::unordered_set<GUIGlObject*> unorderedSet;
682 for (auto itElement = filteredGLObjects.begin(); itElement != filteredGLObjects.end(); itElement++) {
683 if (unorderedSet.insert(*itElement).second) {
684 *itDuplicated++ = *itElement;
685 }
686 }
687 filteredGLObjects.erase(itDuplicated, filteredGLObjects.end());
688 // open object dialog
689 openObjectDialog(filteredGLObjects);
690 }
691 }
692}
693
694
695void
696GNEViewNet::openDeleteDialogAtCursor(const std::vector<GUIGlObject*>& GLObjects) {
697 if (myPopup) {
698 destroyPopup();
699 }
700 // set clicked popup position
702 // create cursor popup dialog for delete element
704 myCreatedPopup = true;
705 // open popup dialog
707}
708
709
710void
711GNEViewNet::openSelectDialogAtCursor(const std::vector<GUIGlObject*>& GLObjects) {
712 if (myPopup) {
713 destroyPopup();
714 }
715 // set clicked popup position
717 // create cursor popup dialog for select element
719 myCreatedPopup = true;
720 // open popup dialog
722}
723
724
725void
727 // first check if we have to save gui settings in a file (only used for testing purposes)
728 const auto& neteditOptions = OptionsCont::getOptions();
729 if (neteditOptions.getString("gui-testing.setting-output").size() > 0) {
730 try {
731 // open output device
732 OutputDevice& output = OutputDevice::getDevice(neteditOptions.getString("gui-testing.setting-output"));
733 // save view settings
736 // save viewport (zoom, X, Y and Z)
742 output.closeTag();
743 output.closeTag();
744 // close output device
745 output.close();
746 } catch (...) {
747 WRITE_ERROR(TL("GUI-Settings cannot be saved in ") + neteditOptions.getString("gui-testing.setting-output"));
748 }
749 }
750}
751
752
755 return myEditModes;
756}
757
758
761 return myTestingMode;
762}
763
764
769
770
775
776
781
782
787
788
793
794
795void
798 assert(!scheme.isFixed());
799 double minValue = std::numeric_limits<double>::infinity();
800 double maxValue = -std::numeric_limits<double>::infinity();
801 // retrieve range
802 bool hasMissingData = false;
803 if (objectType == GLO_LANE) {
804 // XXX (see #3409) multi-colors are not currently handled. this is a quick hack
805 if (active == 9) {
806 active = 8; // segment height, fall back to start height
807 } else if (active == 11) {
808 active = 10; // segment incline, fall back to total incline
809 }
810 for (const auto& lane : myNet->getAttributeCarriers()->getLanes()) {
811 const double val = lane.second->getColorValue(s, active);
812 if (val == s.MISSING_DATA) {
813 hasMissingData = true;
814 continue;
815 }
816 minValue = MIN2(minValue, val);
817 maxValue = MAX2(maxValue, val);
818 }
819 } else if (objectType == GLO_JUNCTION) {
820 if (active == 3) {
821 for (const auto& junction : myNet->getAttributeCarriers()->getJunctions()) {
822 minValue = MIN2(minValue, junction.second->getPositionInView().z());
823 maxValue = MAX2(maxValue, junction.second->getPositionInView().z());
824 }
825 }
826 } else if (objectType == GLO_TAZRELDATA) {
827 if (active == 4) {
828 for (const auto& genericData : myNet->getAttributeCarriers()->getGenericDatas().at(SUMO_TAG_TAZREL)) {
829 const double value = genericData.second->getColorValue(s, active);
830 if (value == s.MISSING_DATA) {
831 continue;
832 }
833 minValue = MIN2(minValue, value);
834 maxValue = MAX2(maxValue, value);
835 }
836 }
837 }
839 scheme.clear();
840 // add threshold for every distinct value
841 std::set<SVCPermissions> codes;
842 for (const auto& lane : myNet->getAttributeCarriers()->getLanes()) {
843 codes.insert(lane.second->getParentEdge()->getNBEdge()->getPermissions(lane.second->getIndex()));
844 }
845 int step = MAX2(1, 360 / (int)codes.size());
846 int hue = 0;
847 for (SVCPermissions p : codes) {
848 scheme.addColor(RGBColor::fromHSV(hue, 1, 1), (double)p);
849 hue = (hue + step) % 360;
850 }
851 return;
852 }
853 buildMinMaxRainbow(s, scheme, rs, minValue, maxValue, hasMissingData);
854}
855
856
857void
858GNEViewNet::setStatusBarText(const std::string& text) {
859 myApp->setStatusBarText(text);
860}
861
862
863void
867
868
869bool
872 return false;
873 } else {
875 }
876}
877
878
879void
880GNEViewNet::setSelectorFrameScale(double selectionScale) {
882}
883
884
885bool
889
890
891bool
895
896
897bool
899 // first check if there are junctions to merging
900 if (gViewObjectsHandler.getMergingJunctions().size() > 1) {
901 // get junctions (this call is neccesary because merging junctions are constants)
902 auto movedJunction = myNet->getAttributeCarriers()->retrieveJunction(gViewObjectsHandler.getMergingJunctions().at(0)->getID());
903 auto targetJunction = myNet->getAttributeCarriers()->retrieveJunction(gViewObjectsHandler.getMergingJunctions().at(1)->getID());
904 if (askMergeJunctions(movedJunction, targetJunction)) {
905 // merge moved and targed junctions
906 myNet->mergeJunctions(movedJunction, targetJunction, myUndoList);
907 return true;
908 }
909 }
910 return false;
911}
912
913
914bool
915GNEViewNet::askMergeJunctions(const GNEJunction* movedJunction, const GNEJunction* targetJunction) {
916 // optionally ask for confirmation
918 WRITE_DEBUG("Opening FXMessageBox 'merge junctions'");
919 // open question box
920 const std::string header = TL("Confirm Junction Merger");
921 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()));
922 const FXuint answer = FXMessageBox::question(this, MBOX_YES_NO, header.c_str(), "%s", body.c_str());
923 if (answer != 1) { //1:yes, 2:no, 4:esc
924 // write warning if netedit is running in testing mode
925 if (answer == 2) {
926 WRITE_DEBUG("Closed FXMessageBox 'merge junctions' with 'No'");
927 } else if (answer == 4) {
928 WRITE_DEBUG("Closed FXMessageBox 'merge junctions' with 'ESC'");
929 }
930 return false;
931 } else {
932 // write warning if netedit is running in testing mode
933 WRITE_DEBUG("Closed FXMessageBox 'merge junctions' with 'Yes'");
934 }
935 }
936 return true;
937}
938
939
940bool
941GNEViewNet::aksChangeSupermode(const std::string& operation, Supermode expectedSupermode) {
942 // first check if ignore option is enabled
943 if (OptionsCont::getOptions().getBool("ignore-supermode-question")) {
944 return true;
945 }
946 std::string body;
947 if (expectedSupermode == Supermode::NETWORK) {
948 body = (operation + TL(" requires switch to network mode. Continue?"));
949 } else if (expectedSupermode == Supermode::DEMAND) {
950 body = (operation + TL(" requires switch to demand mode. Continue?"));
951 } else if (expectedSupermode == Supermode::DATA) {
952 body = (operation + TL(" requires switch to data mode. Continue?"));
953 } else {
954 throw ProcessError("invalid expected supermode");
955 }
956 // open question box
957 const auto answer = FXMessageBox::question(myApp, MBOX_YES_NO, TL("Confirm switch mode"), "%s", body.c_str());
958 // restore focus to view net
959 setFocus();
960 // return answer
961 if (answer == MBOX_CLICKED_YES) {
962 myEditModes.setSupermode(expectedSupermode, true);
963 return true;
964 } else {
965 return false;
966 }
967}
968
969
970bool
972 // separate conditions for code legibly
975 return (TLSMode && selectingDetectors);
976}
977
978
979bool
981 // separate conditions for code legibly
983 const bool selectingJunctions = myViewParent->getTLSEditorFrame()->getTLSJunction()->isJoiningJunctions();
984 return (TLSMode && selectingJunctions);
985}
986
987
992
993
998
999
1000bool
1002 // Get selected lanes
1003 const auto selectedLanes = myNet->getAttributeCarriers()->getSelectedLanes();
1004 // Declare map of edges and lanes
1005 std::map<GNEEdge*, GNELane*> mapOfEdgesAndLanes;
1006 // Iterate over selected lanes
1007 for (const auto& selectedLane : selectedLanes) {
1008 mapOfEdgesAndLanes[myNet->getAttributeCarriers()->retrieveEdge(selectedLane->getParentEdge()->getID())] = selectedLane;
1009 }
1010 // Throw warning dialog if there hare multiple lanes selected in the same edge
1011 if (mapOfEdgesAndLanes.size() != selectedLanes.size()) {
1012 const std::string header = TL("Multiple lane in the same edge selected");
1013 const std::string bodyA = TL("There are selected lanes that belong to the same edge.");
1014 const std::string bodyB = TLF("Only one lane per edge will be restricted to %.", toString(vclass));
1015 FXMessageBox::information(getApp(), MBOX_OK, header.c_str(), "%s", (bodyA + std::string("\n") + bodyB).c_str());
1016 }
1017 // If we handeln a set of lanes
1018 if (mapOfEdgesAndLanes.size() > 0) {
1019 // declare counter for number of Sidewalks
1020 int counter = 0;
1021 // iterate over selected lanes
1022 for (const auto& edgeLane : mapOfEdgesAndLanes) {
1023 if (edgeLane.first->hasRestrictedLane(vclass)) {
1024 counter++;
1025 }
1026 }
1027 // if all edges parent own a Sidewalk, stop function
1028 if (counter == (int)mapOfEdgesAndLanes.size()) {
1029 const std::string header = TLF("Set vclass to % for selected lanes", toString(vclass));
1030 const std::string body = TL("All lanes own already another lane in the same edge with a restriction for ");
1031 FXMessageBox::information(getApp(), MBOX_OK, header.c_str(), "%s", (body + toString(vclass) + ".").c_str());
1032 return 0;
1033 } else {
1034 WRITE_DEBUG("Opening FXMessageBox 'restrict lanes'");
1035 // Ask confirmation to user
1036 const std::string header = TLF("Set vclass to % for selected lanes", toString(vclass));
1037 const std::string body = TLF("% lanes will be restricted to %. Continue?", toString(mapOfEdgesAndLanes.size() - counter), toString(vclass));
1038 FXuint answer = FXMessageBox::question(getApp(), MBOX_YES_NO, header.c_str(), "%s", body.c_str());
1039 if (answer != 1) { //1:yes, 2:no, 4:esc
1040 // write warning if netedit is running in testing mode
1041 if (answer == 2) {
1042 WRITE_DEBUG("Closed FXMessageBox 'restrict lanes' with 'No'");
1043 } else if (answer == 4) {
1044 WRITE_DEBUG("Closed FXMessageBox 'restrict lanes' with 'ESC'");
1045 }
1046 return 0;
1047 } else {
1048 // write warning if netedit is running in testing mode
1049 WRITE_DEBUG("Closed FXMessageBox 'restrict lanes' with 'Yes'");
1050 }
1051 }
1052 // begin undo operation
1053 myUndoList->begin(lane, "restrict lanes to " + toString(vclass));
1054 // iterate over selected lanes
1055 for (const auto& edgeLane : mapOfEdgesAndLanes) {
1056 // Transform lane to Sidewalk
1057 myNet->restrictLane(vclass, edgeLane.second, myUndoList);
1058 }
1059 // end undo operation
1060 myUndoList->end();
1061 } else {
1062 // If only have a single lane, start undo/redo operation
1063 myUndoList->begin(lane, TL("restrict lane to ") + toString(vclass));
1064 // Transform lane to Sidewalk
1065 myNet->restrictLane(vclass, lane, myUndoList);
1066 // end undo operation
1067 myUndoList->end();
1068 }
1069 return 1;
1070}
1071
1072
1073bool
1074GNEViewNet::addRestrictedLane(GNELane* lane, SUMOVehicleClass vclass, const bool insertAtFront) {
1075 // Get selected edges
1076 const auto selectedEdges = myNet->getAttributeCarriers()->getSelectedEdges();
1077 // get selected lanes
1078 const auto selectedLanes = myNet->getAttributeCarriers()->getSelectedLanes();
1079 // Declare set of edges
1080 std::set<GNEEdge*> setOfEdges;
1081 // Fill set of edges with vector of edges
1082 for (const auto& edge : selectedEdges) {
1083 setOfEdges.insert(edge);
1084 }
1085 // iterate over selected lanes
1086 for (const auto& selectedLane : selectedLanes) {
1087 // Insert pointer to edge into set of edges (To avoid duplicates)
1088 setOfEdges.insert(myNet->getAttributeCarriers()->retrieveEdge(selectedLane->getParentEdge()->getID()));
1089 }
1090 // If we handeln a set of edges
1092 // declare counter for number of restrictions
1093 int counter = 0;
1094 // iterate over set of edges
1095 for (const auto& edge : setOfEdges) {
1096 // update counter if edge has already a restricted lane of type "vclass"
1097 if (edge->hasRestrictedLane(vclass)) {
1098 counter++;
1099 }
1100 }
1101 // if all lanes own a Sidewalk, stop function
1102 if (counter == (int)setOfEdges.size()) {
1103 const std::string header = TLF("Add vclass % to selected lanes", toString(vclass));
1104 const std::string body = TLF("All lanes own already another lane in the same edge with a restriction to %.", toString(vclass));
1105 FXMessageBox::information(getApp(), MBOX_OK, header.c_str(), "%s", body.c_str());
1106 return 0;
1107 } else {
1108 WRITE_DEBUG("Opening FXMessageBox 'restrict lanes'");
1109 // Ask confirmation to user
1110 const std::string header = TLF("Add vclass % to selected lanes", toString(vclass));
1111 const std::string body = TLF("% restrictions to % will be added. Continue?", toString(setOfEdges.size() - counter), toString(vclass));
1112 FXuint answer = FXMessageBox::question(getApp(), MBOX_YES_NO, header.c_str(), "%s", body.c_str());
1113 if (answer != 1) { //1:yes, 2:no, 4:esc
1114 // write warning if netedit is running in testing mode
1115 if (answer == 2) {
1116 WRITE_DEBUG("Closed FXMessageBox 'restrict lanes' with 'No'");
1117 } else if (answer == 4) {
1118 WRITE_DEBUG("Closed FXMessageBox 'restrict lanes' with 'ESC'");
1119 }
1120 return 0;
1121 } else {
1122 // write warning if netedit is running in testing mode
1123 WRITE_DEBUG("Closed FXMessageBox 'restrict lanes' with 'Yes'");
1124 }
1125 }
1126 // begin undo operation
1127 myUndoList->begin(lane, TL("add restrictions for ") + toString(vclass));
1128 // iterate over set of edges
1129 for (const auto& edge : setOfEdges) {
1130 // add restricted lane (guess target)
1131 myNet->addRestrictedLane(vclass, edge, -1, myUndoList);
1132 }
1133 // end undo operation
1134 myUndoList->end();
1135 } else {
1136 // If only have a single lane, start undo/redo operation
1137 myUndoList->begin(lane, TL("add vclass for ") + toString(vclass));
1138 // Add restricted lane
1139 if (vclass == SVC_PEDESTRIAN) {
1140 // always add pedestrian lanes on the right
1141 myNet->addRestrictedLane(vclass, lane->getParentEdge(), 0, myUndoList);
1142 } else if (vclass == SVC_IGNORING) {
1143 if (insertAtFront) {
1145 } else {
1147 }
1148 } else if (lane->getParentEdge()->getLanes().size() == 1) {
1149 // guess insertion position if there is only 1 lane
1150 myNet->addRestrictedLane(vclass, lane->getParentEdge(), -1, myUndoList);
1151 } else {
1152 myNet->addRestrictedLane(vclass, lane->getParentEdge(), lane->getIndex(), myUndoList);
1153 }
1154 // end undo/redo operation
1155 myUndoList->end();
1156 }
1157 return 1;
1158}
1159
1160
1161bool
1163 // Get selected edges
1164 const auto selectedEdges = myNet->getAttributeCarriers()->getSelectedEdges();
1165 // get selected lanes
1166 const auto selectedLanes = myNet->getAttributeCarriers()->getSelectedLanes();
1167 // Declare set of edges
1168 std::set<GNEEdge*> setOfEdges;
1169 // Fill set of edges with vector of edges
1170 for (const auto& edge : selectedEdges) {
1171 setOfEdges.insert(edge);
1172 }
1173 // iterate over selected lanes
1174 for (const auto& selectedLane : selectedLanes) {
1175 // Insert pointer to edge into set of edges (To avoid duplicates)
1176 setOfEdges.insert(myNet->getAttributeCarriers()->retrieveEdge(selectedLane->getParentEdge()->getID()));
1177 }
1178 // If we handeln a set of edges
1179 if (setOfEdges.size() > 0) {
1180 // declare counter for number of restrictions
1181 int counter = 0;
1182 // iterate over set of edges
1183 for (const auto& edge : setOfEdges) {
1184 // update counter if edge has already a restricted lane of type "vclass"
1185 if (edge->hasRestrictedLane(vclass)) {
1186 counter++;
1187 }
1188 }
1189 // if all lanes don't own a Sidewalk, stop function
1190 if (counter == 0) {
1191 const std::string header = TLF("Remove vclass % from selected lanes", toString(vclass));
1192 const std::string body = TLF("The selected lanes and edges don't have a restriction to %.", toString(vclass));
1193 FXMessageBox::information(getApp(), MBOX_OK, header.c_str(), "%s", body.c_str());
1194 return 0;
1195 } else {
1196 WRITE_DEBUG("Opening FXMessageBox 'restrict lanes'");
1197 // Ask confirmation to user
1198 const std::string header = TLF("Remove vclass % from selected lanes", toString(vclass));
1199 const std::string body = TLF("% restrictions to % will be removed. Continue?", toString(setOfEdges.size() - counter), toString(vclass));
1200 FXuint answer = FXMessageBox::question(getApp(), MBOX_YES_NO, header.c_str(), "%s", body.c_str());
1201 if (answer != 1) { //1:yes, 2:no, 4:esc
1202 // write warning if netedit is running in testing mode
1203 if (answer == 2) {
1204 WRITE_DEBUG("Closed FXMessageBox 'restrict lanes' with 'No'");
1205 } else if (answer == 4) {
1206 WRITE_DEBUG("Closed FXMessageBox 'restrict lanes' with 'ESC'");
1207 }
1208 return 0;
1209 } else {
1210 // write warning if netedit is running in testing mode
1211 WRITE_DEBUG("Closed FXMessageBox 'restrict lanes' with 'Yes'");
1212 }
1213 }
1214 // begin undo operation
1215 myUndoList->begin(lane, "Remove restrictions for " + toString(vclass));
1216 // iterate over set of edges
1217 for (const auto& edge : setOfEdges) {
1218 // add Sidewalk
1219 myNet->removeRestrictedLane(vclass, edge, myUndoList);
1220 }
1221 // end undo operation
1222 myUndoList->end();
1223 } else {
1224 // If only have a single lane, start undo/redo operation
1225 myUndoList->begin(lane, TL("Remove vclass for ") + toString(vclass));
1226 // Remove Sidewalk
1228 // end undo/redo operation
1229 myUndoList->end();
1230 }
1231 return 1;
1232}
1233
1234
1236 myViewObjectsSelector(this),
1237 myEditModes(this),
1238 myTestingMode(this),
1239 myCommonCheckableButtons(this),
1240 myNetworkCheckableButtons(this),
1241 myDemandCheckableButtons(this),
1242 myDataCheckableButtons(this),
1243 myNetworkViewOptions(this),
1244 myDemandViewOptions(this),
1245 myDataViewOptions(this),
1246 myIntervalBar(this),
1247 myMoveSingleElement(this),
1248 myMoveMultipleElements(this),
1249 myVehicleOptions(this),
1250 myVehicleTypeOptions(this),
1251 mySaveElements(this),
1252 myTimeFormat(this),
1253 mySelectingArea(this),
1254 myEditNetworkElementShapes(this),
1255 myLockManager(this) {
1256}
1257
1258
1259std::vector<std::string>
1261 std::set<std::string> keys;
1262 for (const NBEdge* e : myNet->getEdgeCont().getAllEdges()) {
1263 if (edgeKeys) {
1264 for (const auto& item : e->getParametersMap()) {
1265 keys.insert(item.first);
1266 }
1267 for (const auto& con : e->getConnections()) {
1268 for (const auto& item : con.getParametersMap()) {
1269 keys.insert(item.first);
1270 }
1271 }
1272 } else {
1273 for (const auto& lane : e->getLanes()) {
1274 int i = 0;
1275 for (const auto& item : lane.getParametersMap()) {
1276 keys.insert(item.first);
1277 }
1278 for (const auto& con : e->getConnectionsFromLane(i)) {
1279 for (const auto& item : con.getParametersMap()) {
1280 keys.insert(item.first);
1281 }
1282 }
1283 i++;
1284 }
1285 }
1286 }
1287 return std::vector<std::string>(keys.begin(), keys.end());
1288}
1289
1290
1291std::vector<std::string>
1293 std::set<std::string> keys;
1294 for (const auto& genericData : myNet->getAttributeCarriers()->getGenericDatas().at(GNE_TAG_EDGEREL_SINGLE)) {
1295 for (const auto& parameter : genericData.second->getACParametersMap()) {
1296 keys.insert(parameter.first);
1297 }
1298 }
1299 return std::vector<std::string>(keys.begin(), keys.end());
1300}
1301
1302
1303std::vector<std::string>
1305 std::set<std::string> keys;
1306 for (const auto& genericData : myNet->getAttributeCarriers()->getGenericDatas().at(SUMO_TAG_TAZREL)) {
1307 for (const auto& parameter : genericData.second->getACParametersMap()) {
1308 keys.insert(parameter.first);
1309 }
1310 }
1311 for (const auto& genericData : myNet->getAttributeCarriers()->getGenericDatas().at(SUMO_TAG_EDGEREL)) {
1312 for (const auto& parameter : genericData.second->getACParametersMap()) {
1313 keys.insert(parameter.first);
1314 }
1315 }
1316 return std::vector<std::string>(keys.begin(), keys.end());
1317}
1318
1319
1320bool
1324 return true;
1325 } else {
1326 return false;
1327 }
1328}
1329
1330
1331int
1335
1336
1337int
1338GNEViewNet::doPaintGL(int mode, const Boundary& drawingBoundary) {
1339 // set lefthand and laneIcons
1342 // first step: update objects under cursor
1344 // second step: redraw contour elements (for example, the path element childrens)
1345 redrawContourElements(drawingBoundary);
1346 // set render modes
1347 glRenderMode(mode);
1348 glMatrixMode(GL_MODELVIEW);
1350 glDisable(GL_TEXTURE_2D);
1351 glDisable(GL_ALPHA_TEST);
1352 glEnable(GL_BLEND);
1353 glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
1354 glEnable(GL_DEPTH_TEST);
1355 // visualize rectangular selection
1357 // draw certain elements only if we aren't in rectangle selection mode
1359 // draw decals
1360 drawDecals();
1361 // draw grid (and update grid button)
1362 drawGrid();
1363 // update show connections
1365 // draw temporal junction
1367 // draw temporal drawing shape
1369 // draw testing elements
1371 // draw temporal E2 multilane detectors
1373 // draw temporal overhead wires
1375 // draw temporal trip/flow route
1377 // draw temporal person plan route
1380 // draw temporal container plan route
1383 // draw temporal route
1385 // draw temporal edgeRelPath
1387 }
1388 // check menu checks of supermode demand
1390 // enable or disable menuCheckShowAllPersonPlans depending of there is a locked person
1393 } else {
1395 }
1396 }
1397 // clear pathDraw
1400 // update ignore hide by zoom
1402 // draw network (boundary
1404 // draw all GL elements
1405 int hits = drawGLElements(drawingBoundary);
1406 // draw temporal split junction
1408 // draw temporal roundabout
1410 // draw temporal lines between E1 detectors and junctions in TLS Mode
1412 // draw temporal lines between junctions in TLS Mode
1414 // draw netedit attributes references
1416 // draw test circle
1418 // pop draw matrix
1420 // update interval bar
1422 // check if recopute boundaries (Deactivated, continue after 1.14 release)
1423 /*
1424 if (gObjectsInPosition.recomputeBoundaries != GLO_NETWORK) {
1425 myNet->getGrid().updateBoundaries(gObjectsInPosition.recomputeBoundaries);
1426 }
1427 */
1428 return hits;
1429}
1430
1431
1432long
1433GNEViewNet::onLeftBtnPress(FXObject*, FXSelector, void* eventData) {
1434 // set focus in view net
1435 setFocus();
1436 // update MouseButtonKeyPressed
1438 // process left button press function depending of supermode
1443 } else if (myEditModes.isCurrentSupermodeData()) {
1444 processLeftButtonPressData(eventData);
1445 }
1446 // update cursor
1447 updateCursor();
1448 // update view
1449 updateViewNet();
1450 return 1;
1451}
1452
1453
1454long
1455GNEViewNet::onLeftBtnRelease(FXObject* obj, FXSelector sel, void* eventData) {
1456 // avoid closing Popup dialog in Linux
1457 if (myCreatedPopup) {
1458 myCreatedPopup = false;
1459 return 1;
1460 }
1461 // process parent function
1462 GUISUMOAbstractView::onLeftBtnRelease(obj, sel, eventData);
1463 // update MouseButtonKeyPressed
1465 // process left button release function depending of supermode
1470 } else if (myEditModes.isCurrentSupermodeData()) {
1472 }
1473 // update cursor
1474 updateCursor();
1475 // update view
1476 updateViewNet();
1477 return 1;
1478}
1479
1480
1481long
1482GNEViewNet::onMiddleBtnPress(FXObject* obj, FXSelector sel, void* eventData) {
1483 // process parent function
1484 GUISUMOAbstractView::onMiddleBtnPress(obj, sel, eventData);
1485 // update cursor
1486 updateCursor();
1487 // update view
1488 updateViewNet();
1489 return 1;
1490}
1491
1492
1493long
1494GNEViewNet::onMiddleBtnRelease(FXObject* obj, FXSelector sel, void* eventData) {
1495 // process parent function
1496 GUISUMOAbstractView::onMiddleBtnRelease(obj, sel, eventData);
1497 // update cursor
1498 updateCursor();
1499 // update view
1500 updateViewNet();
1501 return 1;
1502}
1503
1504
1505long
1506GNEViewNet::onRightBtnPress(FXObject* obj, FXSelector sel, void* eventData) {
1507 // update MouseButtonKeyPressed
1509 // update cursor
1510 updateCursor();
1512 // disable right button press during drawing polygon
1513 return 1;
1514 } else {
1515 return GUISUMOAbstractView::onRightBtnPress(obj, sel, eventData);
1516 }
1517}
1518
1519
1520long
1521GNEViewNet::onRightBtnRelease(FXObject* obj, FXSelector sel, void* eventData) {
1522 // update MouseButtonKeyPressed
1524 // update cursor
1525 updateCursor();
1526 // disable right button release during drawing polygon
1528 return 1;
1529 } else {
1530 return GUISUMOAbstractView::onRightBtnRelease(obj, sel, eventData);
1531 }
1532}
1533
1534
1535long
1536GNEViewNet::onMouseMove(FXObject* obj, FXSelector sel, void* eventData) {
1537 // process mouse move in GUISUMOAbstractView
1538 GUISUMOAbstractView::onMouseMove(obj, sel, eventData);
1539 // update MouseButtonKeyPressed
1541 // update cursor
1542 updateCursor();
1543 // process mouse move function depending of supermode
1548 } else if (myEditModes.isCurrentSupermodeData()) {
1550 }
1551 // update view
1552 updateViewNet();
1553 return 1;
1554}
1555
1556
1557long
1558GNEViewNet::onKeyPress(FXObject* o, FXSelector sel, void* eventData) {
1559 // update MouseButtonKeyPressed
1561 // update cursor
1562 updateCursor();
1563 // continue depending of current edit mode
1565 // update viewNet (for temporal junction)
1566 updateViewNet();
1568 // change "delete last created point" depending of shift key
1571 // change "delete last created point" depending of shift key
1574 updateViewNet();
1575 }
1576 return GUISUMOAbstractView::onKeyPress(o, sel, eventData);
1577}
1578
1579
1580long
1581GNEViewNet::onKeyRelease(FXObject* o, FXSelector sel, void* eventData) {
1582 // update MouseButtonKeyPressed
1584 // update cursor
1585 updateCursor();
1586 // continue depending of current edit mode
1588 // update viewNet (for temporal junction)
1589 updateViewNet();
1591 // change "delete last created point" depending of shift key
1594 // change "delete last created point" depending of shift key
1597 updateViewNet();
1598 }
1599 // check if selecting using rectangle has to be disabled
1602 updateViewNet();
1603 }
1604 return GUISUMOAbstractView::onKeyRelease(o, sel, eventData);
1605}
1606
1607
1608void
1609GNEViewNet::abortOperation(bool clearSelection) {
1610 // steal focus from any text fields and place it over view net
1611 setFocus();
1612 // check what supermode is enabled
1614 // abort operation depending of current mode
1616 // abort edge creation in create edge frame
1620 // check if current selection has to be cleaned
1621 if (clearSelection) {
1623 }
1625 // abort changes in Connector Frame
1628 // continue depending of current TLS frame state
1633 } else {
1635 }
1641 // abort current drawing
1645 // abort current drawing
1647 } else if (myViewParent->getTAZFrame()->getCurrentTAZModule()->getTAZ() != nullptr) {
1648 // finish current editing TAZ
1650 }
1654 // abort both network elements selections
1657 // abort path
1660 // abort path
1662 }
1664 // abort operation depending of current mode
1667 // check if current selection has to be cleaned
1668 if (clearSelection) {
1670 }
1683 }
1684 } else if (myEditModes.isCurrentSupermodeData()) {
1685 // abort operation depending of current mode
1688 // check if current selection has to be cleaned
1689 if (clearSelection) {
1691 }
1696 }
1697 }
1698 // abort undo list
1700 // update view
1701 updateViewNet();
1702}
1703
1704
1705void
1707 // delete elements depending of current supermode
1710 setStatusBarText(TL("Cannot delete in this mode"));
1712 // delete inspected elements
1713 myUndoList->begin(GUIIcon::MODEDELETE, TL("delete network inspected elements"));
1715 myUndoList->end();
1716 } else {
1717 // get selected ACs
1718 const auto selectedACs = myNet->getAttributeCarriers()->getSelectedAttributeCarriers(false);
1719 // delete selected elements
1720 if (selectedACs.size() > 0) {
1721 myUndoList->begin(GUIIcon::MODEDELETE, TL("delete network selection"));
1722 deleteNetworkAttributeCarriers(selectedACs);
1723 myUndoList->end();
1724 }
1725 }
1728 // delete inspected elements
1729 myUndoList->begin(GUIIcon::MODEDELETE, TL("delete demand inspected elements"));
1731 myUndoList->end();
1732 } else {
1733 // get selected ACs
1734 const auto selectedACs = myNet->getAttributeCarriers()->getSelectedAttributeCarriers(false);
1735 // delete selected elements
1736 if (selectedACs.size() > 0) {
1737 myUndoList->begin(GUIIcon::MODEDELETE, TL("delete demand selection"));
1738 deleteDemandAttributeCarriers(selectedACs);
1739 myUndoList->end();
1740 }
1741 }
1742 } else if (myEditModes.isCurrentSupermodeData()) {
1744 // delete inspected elements
1745 myUndoList->begin(GUIIcon::MODEDELETE, TL("delete data inspected elements"));
1747 myUndoList->end();
1748 } else {
1749 // get selected ACs
1750 const auto selectedACs = myNet->getAttributeCarriers()->getSelectedAttributeCarriers(false);
1751 // delete selected elements
1752 if (selectedACs.size() > 0) {
1753 myUndoList->begin(GUIIcon::MODEDELETE, TL("delete data selection"));
1754 deleteDataAttributeCarriers(selectedACs);
1755 myUndoList->end();
1756 }
1757 }
1758 }
1759}
1760
1761
1762void
1764 // check what supermode is enabled
1766 // abort operation depending of current mode
1768 // Accept changes in Connector Frame
1771 // continue depending of current TLS frame state
1778 }
1783 // stop current drawing
1785 } else {
1786 // start drawing
1788 }
1793 // stop current drawing
1795 } else if (myViewParent->getTAZFrame()->getCurrentTAZModule()->getTAZ() == nullptr) {
1796 // start drawing
1799 // save pending changes
1801 }
1803 // create path element
1806 // create path element
1808 }
1813 myViewParent->getVehicleFrame()->getPathCreator()->onCmdCreatePath(nullptr, 0, nullptr);
1815 myViewParent->getPersonFrame()->getPlanCreator()->onCmdCreatePath(nullptr, 0, nullptr);
1822 }
1823 } else if (myEditModes.isCurrentSupermodeData()) {
1828 }
1829 }
1830}
1831
1832
1833void
1835 // check what supermode is enabled
1839 }
1853 }
1854 } else if (myEditModes.isCurrentSupermodeData()) {
1857 }
1858 }
1859}
1860
1861void
1863 // if there is a visible frame, set focus over it. In other case, set focus over ViewNet
1864 if (myCurrentFrame != nullptr) {
1866 } else {
1867 setFocus();
1868 }
1869}
1870
1871
1874 return myViewParent;
1875}
1876
1877
1878GNENet*
1880 return myNet;
1881}
1882
1883
1886 return myUndoList;
1887}
1888
1889
1894
1895
1896const std::vector<GNEAttributeCarrier*>&
1900
1901
1906
1907
1908void
1909GNEViewNet::setInspectedAttributeCarriers(const std::vector<GNEAttributeCarrier*> ACs) {
1911}
1912
1913
1914bool
1916 if (myInspectedAttributeCarriers.empty()) {
1917 return false;
1918 } else {
1919 // search AC in myInspectedAttributeCarriers
1920 const auto it = std::find(myInspectedAttributeCarriers.begin(), myInspectedAttributeCarriers.end(), AC);
1921 if (it == myInspectedAttributeCarriers.end()) {
1922 return false;
1923 } else {
1924 return true;
1925 }
1926 }
1927}
1928
1929
1930void
1932 // search AC in myInspectedAttributeCarriers
1933 const auto it = std::find(myInspectedAttributeCarriers.begin(), myInspectedAttributeCarriers.end(), AC);
1934 if (it != myInspectedAttributeCarriers.end()) {
1937 }
1938}
1939
1940
1945
1946
1947const GUIGlObject*
1951 } else {
1952 return nullptr;
1953 }
1954}
1955
1956
1957void
1962
1963
1964void
1965GNEViewNet::drawTranslateFrontAttributeCarrier(const GNEAttributeCarrier* AC, double typeOrLayer, const double extraOffset) {
1966 if (myFrontAttributeCarrier == AC) {
1967 glTranslated(0, 0, GLO_FRONTELEMENT + extraOffset);
1968 } else {
1969 glTranslated(0, 0, typeOrLayer + extraOffset);
1970 }
1971}
1972
1973
1974bool
1978
1979
1980bool
1981GNEViewNet::checkOverLockedElement(const GUIGlObject* GLObject, const bool isSelected) const {
1982 // check if elemet is blocked
1983 if (myLockManager.isObjectLocked(GLObject->getType(), isSelected)) {
1984 return false;
1985 }
1986 // get front GLObject
1987 const auto glObjectFront = myViewObjectsSelector.getGUIGlObjectFront();
1988 // check if element is under cursor
1989 if (glObjectFront) {
1990 if (glObjectFront == GLObject) {
1991 return true;
1992 } else if (glObjectFront->getType() == GLObject->getType()) {
1993 for (const auto& glObjectUnderCursor : myViewObjectsSelector.getGLObjects()) {
1994 if (glObjectUnderCursor == GLObject) {
1995 return true;
1996 }
1997 }
1998 }
1999 }
2000 return false;
2001}
2002
2003
2008
2009
2010void
2012 myLastCreatedRoute = lastCreatedRoute;
2013}
2014
2015
2018 // get first object that can be found in their container
2019 for (const auto& glObjectLayer : gViewObjectsHandler.getSelectedObjects()) {
2020 for (const auto& glObject : glObjectLayer.second) {
2021 auto junction = myNet->getAttributeCarriers()->retrieveJunction(glObject.object->getMicrosimID(), false);
2022 if (junction) {
2023 return junction;
2024 }
2025 }
2026 }
2027 return nullptr;
2028}
2029
2030
2033 // get first object that can be found in their container
2034 for (const auto& glObjectLayer : gViewObjectsHandler.getSelectedObjects()) {
2035 for (const auto& glObject : glObjectLayer.second) {
2036 auto connection = myNet->getAttributeCarriers()->retrieveConnection(glObject.object, false);
2037 if (connection) {
2038 return connection;
2039 }
2040 }
2041 }
2042 return nullptr;
2043}
2044
2045
2048 // get first object that can be found in their container
2049 for (const auto& glObjectLayer : gViewObjectsHandler.getSelectedObjects()) {
2050 for (const auto& glObject : glObjectLayer.second) {
2051 auto crossing = myNet->getAttributeCarriers()->retrieveCrossing(glObject.object, false);
2052 if (crossing) {
2053 return crossing;
2054 }
2055 }
2056 }
2057 return nullptr;
2058}
2059
2060
2063 // get first object that can be found in their container
2064 for (const auto& glObjectLayer : gViewObjectsHandler.getSelectedObjects()) {
2065 for (const auto& glObject : glObjectLayer.second) {
2066 auto walkingArea = myNet->getAttributeCarriers()->retrieveWalkingArea(glObject.object, false);
2067 if (walkingArea) {
2068 return walkingArea;
2069 }
2070 }
2071 }
2072 return nullptr;
2073}
2074
2075
2076GNEEdge*
2078 // get first object that can be found in their container
2079 for (const auto& glObjectLayer : gViewObjectsHandler.getSelectedObjects()) {
2080 for (const auto& glObject : glObjectLayer.second) {
2081 auto edge = myNet->getAttributeCarriers()->retrieveEdge(glObject.object->getMicrosimID(), false);
2082 if (edge) {
2083 return edge;
2084 }
2085 }
2086 }
2087 return nullptr;
2088}
2089
2090
2091GNELane*
2093 // get first object that can be found in their container
2094 for (const auto& glObjectLayer : gViewObjectsHandler.getSelectedObjects()) {
2095 for (const auto& glObject : glObjectLayer.second) {
2096 auto lane = myNet->getAttributeCarriers()->retrieveLane(glObject.object, false);
2097 if (lane) {
2098 return lane;
2099 }
2100 }
2101 }
2102 return nullptr;
2103}
2104
2105
2108 // get first object that can be found in their container
2109 for (const auto& glObjectLayer : gViewObjectsHandler.getSelectedObjects()) {
2110 for (const auto& glObject : glObjectLayer.second) {
2111 auto additionalElement = myNet->getAttributeCarriers()->retrieveAdditional(glObject.object, false);
2112 if (additionalElement) {
2113 return additionalElement;
2114 }
2115 }
2116 }
2117 return nullptr;
2118}
2119
2120
2123 // get first object that can be found in their container
2124 for (const auto& glObjectLayer : gViewObjectsHandler.getSelectedObjects()) {
2125 for (const auto& glObject : glObjectLayer.second) {
2126 auto demandElement = myNet->getAttributeCarriers()->retrieveDemandElement(glObject.object, false);
2127 if (demandElement) {
2128 return demandElement;
2129 }
2130 }
2131 }
2132 return nullptr;
2133}
2134
2135
2136GNEPoly*
2138 // get first object that can be parsed to poly element
2139 for (const auto& glObjectLayer : gViewObjectsHandler.getSelectedObjects()) {
2140 for (const auto& glObject : glObjectLayer.second) {
2141 auto polygon = dynamic_cast<GNEPoly*>(myNet->getAttributeCarriers()->retrieveAdditional(glObject.object, false));
2142 if (polygon) {
2143 return polygon;
2144 }
2145 }
2146 }
2147 return nullptr;
2148}
2149
2150
2151GNEPOI*
2153 // get first object that can be parsed to POI element
2154 for (const auto& glObjectLayer : gViewObjectsHandler.getSelectedObjects()) {
2155 for (const auto& glObject : glObjectLayer.second) {
2156 auto POI = dynamic_cast<GNEPOI*>(myNet->getAttributeCarriers()->retrieveAdditional(glObject.object, false));
2157 if (POI) {
2158 return POI;
2159 }
2160 }
2161 }
2162 return nullptr;
2163}
2164
2165
2166GNETAZ*
2168 // get first object that can be parsed to TAZ element
2169 for (const auto& glObjectLayer : gViewObjectsHandler.getSelectedObjects()) {
2170 for (const auto& glObject : glObjectLayer.second) {
2171 auto TAZ = dynamic_cast<GNETAZ*>(myNet->getAttributeCarriers()->retrieveAdditional(glObject.object, false));
2172 if (TAZ) {
2173 return TAZ;
2174 }
2175 }
2176 }
2177 return nullptr;
2178}
2179
2180
2183 // get first object that can be parsed to TAZ element
2184 for (const auto& glObjectLayer : gViewObjectsHandler.getSelectedObjects()) {
2185 for (const auto& glObject : glObjectLayer.second) {
2186 if (glObject.object->getType() == GLO_JUNCTION) {
2187 auto junction = myNet->getAttributeCarriers()->retrieveJunction(glObject.object->getMicrosimID());
2188 if (junction->isShapeEdited()) {
2189 return junction;
2190 }
2191 } else if (glObject.object->getType() == GLO_CROSSING) {
2192 auto crossing = myNet->getAttributeCarriers()->retrieveCrossing(glObject.object);
2193 if (crossing->isShapeEdited()) {
2194 return crossing;
2195 }
2196 } else if (glObject.object->getType() == GLO_CONNECTION) {
2197 auto connection = myNet->getAttributeCarriers()->retrieveConnection(glObject.object);
2198 if (connection->isShapeEdited()) {
2199 return connection;
2200 }
2201 }
2202 }
2203 }
2204 return nullptr;
2205}
2206
2207
2208long
2209GNEViewNet::onCmdSetSupermode(FXObject*, FXSelector sel, void*) {
2210 // check what network mode will be set
2211 switch (FXSELID(sel)) {
2213 if (myEditModes.networkButton->shown()) {
2215 }
2216 break;
2218 if (myEditModes.demandButton->shown()) {
2220 }
2221 break;
2223 if (myEditModes.dataButton->shown()) {
2225 }
2226 break;
2227 default:
2228 break;
2229 }
2230 return 1;
2231}
2232
2233
2234long
2235GNEViewNet::onCmdSetMode(FXObject*, FXSelector sel, void*) {
2236 // first filter modes depending of view
2238 // network
2240 switch (FXSELID(sel)) {
2241 // common
2245 // infrastructure
2250 // shapes
2253 break;
2254 default:
2255 return 0;
2256 }
2257 }
2258 // demand
2260 switch (FXSELID(sel)) {
2261 // common
2265 // persons
2268 // routes
2271 // types
2274 break;
2275 default:
2276 return 0;
2277 }
2278 }
2279 // data
2281 // all modes disabled
2282 return 0;
2283 }
2284 }
2285 // continue depending of supermode
2287 // check what network mode will be set
2288 switch (FXSELID(sel)) {
2291 break;
2294 break;
2297 break;
2300 break;
2303 break;
2306 break;
2309 break;
2312 break;
2315 break;
2318 break;
2321 break;
2324 break;
2327 break;
2330 break;
2331 default:
2332 break;
2333 }
2335 // check what demand mode will be set
2336 switch (FXSELID(sel)) {
2339 break;
2342 break;
2345 break;
2348 break;
2351 break;
2354 break;
2357 break;
2360 break;
2363 break;
2366 break;
2369 break;
2372 break;
2375 break;
2378 break;
2379 default:
2380 break;
2381 }
2382 } else if (myEditModes.isCurrentSupermodeData()) {
2383 // check what demand mode will be set
2384 switch (FXSELID(sel)) {
2387 break;
2390 break;
2393 break;
2396 break;
2399 break;
2402 break;
2405 break;
2406 default:
2407 break;
2408 }
2409 }
2410 return 1;
2411}
2412
2413
2414long
2415GNEViewNet::onCmdSplitEdge(FXObject*, FXSelector, void*) {
2417 if (edge != nullptr) {
2419 }
2420 return 1;
2421}
2422
2423
2424long
2425GNEViewNet::onCmdSplitEdgeBidi(FXObject*, FXSelector, void*) {
2427 if (edge != nullptr) {
2428 // obtain reverse edge
2429 const auto oppositeEdges = edge->getOppositeEdges();
2430 // check that reverse edge works
2431 if (oppositeEdges.size() > 0) {
2432 for (const auto& oppositeEdge : oppositeEdges) {
2433 // get reverse inner geometry
2434 const auto reverseGeometry = oppositeEdge->getNBEdge()->getInnerGeometry().reverse();
2435 if (reverseGeometry == edge->getNBEdge()->getInnerGeometry()) {
2436 myNet->splitEdgesBidi(edge, oppositeEdge, edge->getSplitPos(getPopupPosition()), myUndoList);
2437 return 1;
2438 }
2439 }
2440 }
2441 }
2442 return 1;
2443}
2444
2445
2446long
2447GNEViewNet::onCmdReverseEdge(FXObject*, FXSelector, void*) {
2449 if (edge != nullptr) {
2450 if (edge->isAttributeCarrierSelected()) {
2451 myUndoList->begin(edge, TL("Reverse selected edges"));
2452 const auto selectedEdges = myNet->getAttributeCarriers()->getSelectedEdges();
2453 for (const auto& selectedEdge : selectedEdges) {
2454 myNet->reverseEdge(selectedEdge, myUndoList);
2455 }
2456 myUndoList->end();
2457 } else {
2458 myUndoList->begin(edge, TL("Reverse edge"));
2460 myUndoList->end();
2461 }
2462 }
2463 return 1;
2464}
2465
2466
2467long
2468GNEViewNet::onCmdAddReversedEdge(FXObject*, FXSelector, void*) {
2470 if (edge != nullptr) {
2471 if (edge->isAttributeCarrierSelected()) {
2472 myUndoList->begin(edge, TL("Add Reverse edge for selected edges"));
2473 const auto selectedEdges = myNet->getAttributeCarriers()->getSelectedEdges();
2474 for (const auto& selectedEdge : selectedEdges) {
2475 myNet->addReversedEdge(selectedEdge, false, myUndoList);
2476 }
2477 myUndoList->end();
2478 } else {
2479 myUndoList->begin(edge, TL("Add reverse edge"));
2480 myNet->addReversedEdge(edge, false, myUndoList);
2481 myUndoList->end();
2482 }
2483 }
2484 return 1;
2485}
2486
2487
2488long
2491 if (edge != nullptr) {
2492 if (edge->isAttributeCarrierSelected()) {
2493 myUndoList->begin(edge, TL("Add Reverse disconnected edge for selected edges"));
2494 const auto selectedEdges = myNet->getAttributeCarriers()->getSelectedEdges();
2495 for (const auto& selectedEdge : selectedEdges) {
2496 myNet->addReversedEdge(selectedEdge, true, myUndoList);
2497 }
2498 myUndoList->end();
2499 } else {
2500 myUndoList->begin(edge, TL("Add reverse disconnected edge"));
2501 myNet->addReversedEdge(edge, true, myUndoList);
2502 myUndoList->end();
2503 }
2504 }
2505 return 1;
2506}
2507
2508
2509long
2510GNEViewNet::onCmdEditEdgeEndpoint(FXObject*, FXSelector, void*) {
2512 if (edge != nullptr) {
2513 // snap to active grid the Popup position
2515 }
2516 return 1;
2517}
2518
2519
2520long
2521GNEViewNet::onCmdResetEdgeEndpoint(FXObject*, FXSelector, void*) {
2523 if (edge != nullptr) {
2524 // check if edge is selected
2525 if (edge->isAttributeCarrierSelected()) {
2526 // get all selected edges
2527 const auto selectedEdges = myNet->getAttributeCarriers()->getSelectedEdges();
2528 // begin operation
2529 myUndoList->begin(edge, TL("reset geometry points"));
2530 // iterate over selected edges
2531 for (const auto& selectedEdge : selectedEdges) {
2532 // reset both end points
2533 selectedEdge->resetBothEndpoint(myUndoList);
2534 }
2535 // end operation
2536 myUndoList->end();
2537 } else {
2539 }
2540 }
2541 return 1;
2542}
2543
2544
2545long
2546GNEViewNet::onCmdStraightenEdges(FXObject*, FXSelector, void*) {
2548 if (edge != nullptr) {
2549 if (edge->isAttributeCarrierSelected()) {
2550 myUndoList->begin(edge, TL("straighten selected edges"));
2551 const auto selectedEdges = myNet->getAttributeCarriers()->getSelectedEdges();
2552 for (const auto& selectedEdge : selectedEdges) {
2553 selectedEdge->setAttribute(SUMO_ATTR_SHAPE, "", myUndoList);
2554 }
2555 myUndoList->end();
2556 } else {
2557
2558 myUndoList->begin(edge, TL("straighten edge"));
2560 myUndoList->end();
2561 }
2562 }
2563 return 1;
2564}
2565
2566
2567long
2568GNEViewNet::onCmdSmoothEdges(FXObject*, FXSelector, void*) {
2570 if (edge != nullptr) {
2571 if (edge->isAttributeCarrierSelected()) {
2572 myUndoList->begin(edge, TL("smooth selected edges"));
2573 const auto selectedEdges = myNet->getAttributeCarriers()->getSelectedEdges();
2574 for (const auto& selectedEdge : selectedEdges) {
2575 selectedEdge->smooth(myUndoList);
2576 }
2577 myUndoList->end();
2578 } else {
2579 myUndoList->begin(edge, TL("smooth edge"));
2580 edge->smooth(myUndoList);
2581 myUndoList->end();
2582 }
2583 }
2584 return 1;
2585}
2586
2587
2588long
2589GNEViewNet::onCmdStraightenEdgesElevation(FXObject*, FXSelector, void*) {
2591 if (edge != nullptr) {
2592 if (edge->isAttributeCarrierSelected()) {
2593 myUndoList->begin(edge, TL("straighten elevation of selected edges"));
2594 const auto selectedEdges = myNet->getAttributeCarriers()->getSelectedEdges();
2595 for (const auto& selectedEdge : selectedEdges) {
2596 selectedEdge->straightenElevation(myUndoList);
2597 }
2598 myUndoList->end();
2599 } else {
2600 myUndoList->begin(edge, TL("straighten edge elevation"));
2602 myUndoList->end();
2603 }
2604 }
2605 return 1;
2606}
2607
2608
2609long
2610GNEViewNet::onCmdSmoothEdgesElevation(FXObject*, FXSelector, void*) {
2612 if (edge != nullptr) {
2613 if (edge->isAttributeCarrierSelected()) {
2614 myUndoList->begin(edge, TL("smooth elevation of selected edges"));
2615 const auto selectedEdges = myNet->getAttributeCarriers()->getSelectedEdges();
2616 for (const auto& selectedEdge : selectedEdges) {
2617 selectedEdge->smoothElevation(myUndoList);
2618 }
2619 myUndoList->end();
2620 } else {
2621 myUndoList->begin(edge, TL("smooth edge elevation"));
2623 myUndoList->end();
2624 }
2625 }
2626 return 1;
2627}
2628
2629
2630long
2631GNEViewNet::onCmdResetLength(FXObject*, FXSelector, void*) {
2633 if (edge != nullptr) {
2634 if (edge->isAttributeCarrierSelected()) {
2635 myUndoList->begin(edge, TL("reset edge lengths"));
2636 const auto selectedEdges = myNet->getAttributeCarriers()->getSelectedEdges();
2637 for (const auto& selectedEdge : selectedEdges) {
2638 selectedEdge->setAttribute(SUMO_ATTR_LENGTH, "-1", myUndoList);
2639 }
2640 myUndoList->end();
2641 } else {
2643 }
2644 }
2645 return 1;
2646}
2647
2648
2649long
2650GNEViewNet::onCmdEdgeUseAsTemplate(FXObject*, FXSelector, void*) {
2652 if (edge != nullptr) {
2654 }
2655 return 1;
2656}
2657
2658
2659long
2660GNEViewNet::onCmdEgeApplyTemplate(FXObject*, FXSelector, void*) {
2661 GNEEdge* edgeAtPosition = getEdgeAtPopupPosition();
2662 if ((edgeAtPosition != nullptr) && myViewParent->getInspectorFrame()->getTemplateEditor()->getEdgeTemplate()) {
2663 // begin copy template
2664 myUndoList->begin(edgeAtPosition, TL("copy edge template"));
2665 if (edgeAtPosition->isAttributeCarrierSelected()) {
2666 // copy template in all selected edges
2667 for (const auto& edge : myNet->getAttributeCarriers()->getEdges()) {
2668 if (edge.second->isAttributeCarrierSelected()) {
2669 edge.second->copyTemplate(myViewParent->getInspectorFrame()->getTemplateEditor()->getEdgeTemplate(), myUndoList);
2670 }
2671 }
2672 } else {
2673 // copy template
2675 }
2676 // end copy template
2677 myUndoList->end();
2678 }
2679 return 1;
2680}
2681
2682
2683long
2684GNEViewNet::onCmdSimplifyShape(FXObject*, FXSelector, void*) {
2685 // get polygon under mouse
2686 GNEPoly* polygonUnderMouse = getPolygonAtPopupPosition();
2687 // check polygon
2688 if (polygonUnderMouse) {
2689 // check if shape is selected
2690 if (polygonUnderMouse->isAttributeCarrierSelected()) {
2691 // begin undo-list
2692 myNet->getViewNet()->getUndoList()->begin(polygonUnderMouse, TL("simplify shapes"));
2693 // get shapes
2694 const auto selectedShapes = myNet->getAttributeCarriers()->getSelectedShapes();
2695 // iterate over shapes
2696 for (const auto& selectedShape : selectedShapes) {
2697 // check if shape is a poly
2698 if ((selectedShape->getTagProperty().getTag() == SUMO_TAG_POLY) ||
2699 (selectedShape->getTagProperty().getTag() == GNE_TAG_JPS_WALKABLEAREA) ||
2700 (selectedShape->getTagProperty().getTag() == GNE_TAG_JPS_OBSTACLE)) {
2701 // simplify shape
2702 dynamic_cast<GNEPoly*>(selectedShape)->simplifyShape();
2703 }
2704 }
2705 // end undo-list
2707 } else {
2708 polygonUnderMouse->simplifyShape();
2709 }
2710 }
2711 return 1;
2712}
2713
2714
2715long
2716GNEViewNet::onCmdDeleteGeometryPoint(FXObject*, FXSelector, void*) {
2717 GNEPoly* polygonUnderMouse = getPolygonAtPopupPosition();
2718 if (polygonUnderMouse) {
2719 polygonUnderMouse->deleteGeometryPoint(getPopupPosition());
2720 }
2721 return 1;
2722}
2723
2724
2725long
2726GNEViewNet::onCmdClosePolygon(FXObject*, FXSelector, void*) {
2727 // get polygon under mouse
2728 GNEPoly* polygonUnderMouse = getPolygonAtPopupPosition();
2729 // check polygon
2730 if (polygonUnderMouse) {
2731 // check if shape is selected
2732 if (polygonUnderMouse->isAttributeCarrierSelected()) {
2733 // begin undo-list
2734 myNet->getViewNet()->getUndoList()->begin(polygonUnderMouse, TL("close polygon shapes"));
2735 // get selectedshapes
2736 const auto selectedShapes = myNet->getAttributeCarriers()->getSelectedShapes();
2737 // iterate over shapes
2738 for (const auto& selectedShape : selectedShapes) {
2739 // check if shape is a poly
2740 if ((selectedShape->getTagProperty().getTag() == SUMO_TAG_POLY) ||
2741 (selectedShape->getTagProperty().getTag() == GNE_TAG_JPS_WALKABLEAREA) ||
2742 (selectedShape->getTagProperty().getTag() == GNE_TAG_JPS_OBSTACLE)) {
2743 // close polygon
2744 dynamic_cast<GNEPoly*>(selectedShape)->closePolygon();
2745 }
2746 }
2747 // end undo-list
2749 } else {
2750 polygonUnderMouse->closePolygon();
2751 }
2752 }
2753 return 1;
2754}
2755
2756
2757long
2758GNEViewNet::onCmdOpenPolygon(FXObject*, FXSelector, void*) {
2759 // get polygon under mouse
2760 GNEPoly* polygonUnderMouse = getPolygonAtPopupPosition();
2761 // check polygon
2762 if (polygonUnderMouse) {
2763 // check if shape is selected
2764 if (polygonUnderMouse->isAttributeCarrierSelected()) {
2765 // begin undo-list
2766 myNet->getViewNet()->getUndoList()->begin(polygonUnderMouse, TL("open polygon shapes"));
2767 // get shapes
2768 const auto selectedShapes = myNet->getAttributeCarriers()->getSelectedShapes();
2769 // iterate over shapes
2770 for (const auto& selectedShape : selectedShapes) {
2771 // check if shape is a poly
2772 if ((selectedShape->getTagProperty().getTag() == SUMO_TAG_POLY) ||
2773 (selectedShape->getTagProperty().getTag() == GNE_TAG_JPS_WALKABLEAREA) ||
2774 (selectedShape->getTagProperty().getTag() == GNE_TAG_JPS_OBSTACLE)) {
2775 // open polygon
2776 dynamic_cast<GNEPoly*>(selectedShape)->openPolygon();
2777 }
2778 }
2779 // end undo-list
2781 } else {
2782 polygonUnderMouse->openPolygon();
2783 }
2784 }
2785 return 1;
2786}
2787
2788
2789long
2790GNEViewNet::onCmdSelectPolygonElements(FXObject*, FXSelector, void*) {
2791 // get polygon under mouse
2792 GNEPoly* polygonUnderMouse = getPolygonAtPopupPosition();
2793 // check polygon
2794 if (polygonUnderMouse) {
2795 // get ACs in boundary
2796 updateObjectsInBoundary(polygonUnderMouse->getShape().getBoxBoundary());
2797 // declare filtered ACs
2798 std::vector<GNEAttributeCarrier*> filteredACs;
2799 // iterate over obtained GUIGlIDs
2800 for (const auto& AC : myViewObjectsSelector.getAttributeCarriers()) {
2801 if (AC->getTagProperty().getTag() == SUMO_TAG_EDGE) {
2802 if (checkSelectEdges() && myNet->getAttributeCarriers()->isNetworkElementAroundShape(AC, polygonUnderMouse->getShape())) {
2803 filteredACs.push_back(AC);
2804 }
2805 } else if (AC->getTagProperty().getTag() == SUMO_TAG_LANE) {
2806 if (!checkSelectEdges() && myNet->getAttributeCarriers()->isNetworkElementAroundShape(AC, polygonUnderMouse->getShape())) {
2807 filteredACs.push_back(AC);
2808 }
2809 } else if ((AC != polygonUnderMouse) && myNet->getAttributeCarriers()->isNetworkElementAroundShape(AC, polygonUnderMouse->getShape())) {
2810 filteredACs.push_back(AC);
2811 }
2812 }
2813 // continue if there are ACs
2814 if (filteredACs.size() > 0) {
2815 // begin undo-list
2816 myNet->getViewNet()->getUndoList()->begin(GUIIcon::MODESELECT, TL("select within polygon boundary"));
2817 // iterate over shapes
2818 for (const auto& AC : filteredACs) {
2819 AC->setAttribute(GNE_ATTR_SELECTED, "true", myUndoList);
2820 }
2821 // end undo-list
2823 }
2824 }
2825 return 1;
2826}
2827
2828
2829long
2830GNEViewNet::onCmdSetFirstGeometryPoint(FXObject*, FXSelector, void*) {
2831 GNEPoly* polygonUnderMouse = getPolygonAtPopupPosition();
2832 if (polygonUnderMouse) {
2833 polygonUnderMouse->changeFirstGeometryPoint(polygonUnderMouse->getVertexIndex(getPopupPosition(), false));
2834 }
2835
2836 return 1;
2837}
2838
2839
2840long
2841GNEViewNet::onCmdSimplifyShapeEdited(FXObject*, FXSelector, void*) {
2842 auto undoList = myNet->getViewNet()->getUndoList();
2843 // get shape edited under mouse
2845 if (shapeEdited) {
2846 // simplify edited shape using undo-redo
2847 undoList->begin(shapeEdited, TL("simplify edited shape"));
2848 shapeEdited->simplifyShapeEdited(undoList);
2849 undoList->end();
2850 }
2851 return 1;
2852}
2853
2854
2855long
2856GNEViewNet::onCmdStraightenShapeEdited(FXObject*, FXSelector, void*) {
2857 auto undoList = myNet->getViewNet()->getUndoList();
2858 // get shape edited under mouse
2860 if (shapeEdited) {
2861 // simplify edited shape using undo-redo
2862 undoList->begin(shapeEdited, TL("straigthen edited shape"));
2863 shapeEdited->straigthenShapeEdited(undoList);
2864 undoList->end();
2865 }
2866 return 1;
2867}
2868
2869
2870long
2871GNEViewNet::onCmdCloseShapeEdited(FXObject*, FXSelector, void*) {
2872 auto undoList = myNet->getViewNet()->getUndoList();
2873 // get shape edited under mouse
2875 if (shapeEdited) {
2876 // close edited shape using undo-redo
2877 undoList->begin(shapeEdited, TL("simplify edited shape"));
2878 shapeEdited->closeShapeEdited(undoList);
2879 undoList->end();
2880 }
2881 return 1;
2882}
2883
2884
2885long
2886GNEViewNet::onCmdOpenShapeEdited(FXObject*, FXSelector, void*) {
2887 auto undoList = myNet->getViewNet()->getUndoList();
2888 // get shape edited under mouse
2890 if (shapeEdited) {
2891 // open edited shape using undo-redo
2892 undoList->begin(shapeEdited, TL("simplify edited shape"));
2893 shapeEdited->openShapeEdited(undoList);
2894 undoList->end();
2895 }
2896 return 1;
2897}
2898
2899
2900long
2902 auto undoList = myNet->getViewNet()->getUndoList();
2903 // get shape edited under mouse
2905 if (shapeEdited) {
2906 // get geometry point index under cursor
2907 const auto geometryPointIndex = shapeEdited->getGeometryPointUnderCursorShapeEdited();
2908 // set first geometry point in edited shape using undo-redo
2909 undoList->begin(shapeEdited, TL("simplify edited shape"));
2910 shapeEdited->setFirstGeometryPointShapeEdited(geometryPointIndex, undoList);
2911 undoList->end();
2912 }
2913 return 1;
2914}
2915
2916
2917long
2919 auto undoList = myNet->getViewNet()->getUndoList();
2920 // get shape edited under mouse
2922 if (shapeEdited) {
2923 // get geometry point index under cursor
2924 const auto geometryPointIndex = shapeEdited->getGeometryPointUnderCursorShapeEdited();
2925 // delete geometry point edited shape using undo-redo
2926 undoList->begin(shapeEdited, TL("simplify edited shape"));
2927 shapeEdited->deleteGeometryPointShapeEdited(geometryPointIndex, undoList);
2928 undoList->end();
2929 }
2930 return 1;
2931}
2932
2933
2934long
2935GNEViewNet::onCmdResetShapeEdited(FXObject*, FXSelector, void*) {
2936 auto undoList = myNet->getViewNet()->getUndoList();
2937 // get shape edited under mouse
2939 if (shapeEdited) {
2940 // simplify edited shape using undo-redo
2941 undoList->begin(shapeEdited, TL("simplify edited shape"));
2942 shapeEdited->resetShapeEdited(undoList);
2943 undoList->end();
2944 }
2945 return 1;
2946}
2947
2948
2949long
2950GNEViewNet::onCmdFinishShapeEdited(FXObject*, FXSelector, void*) {
2951 // the same behavior as when we press enter
2952 hotkeyEnter();
2953 return 1;
2954}
2955
2956
2957long
2958GNEViewNet::onCmdTransformPOI(FXObject*, FXSelector, void*) {
2959 // declare additional handler
2961 // obtain POI at popup position
2963 if (POI) {
2964 // check what type of POI will be transformed
2965 if (POI->getTagProperty().getTag() == SUMO_TAG_POI) {
2966 // obtain lanes around POI boundary
2967 std::vector<GUIGlID> GLIDs = getObjectsInBoundary(POI->getCenteringBoundary());
2968 std::vector<GNELane*> lanes;
2969 for (const auto& GLID : GLIDs) {
2971 if (lane) {
2972 lanes.push_back(lane);
2973 }
2974 }
2975 if (lanes.empty()) {
2976 WRITE_WARNINGF(TL("No lanes around % to attach it"), toString(SUMO_TAG_POI));
2977 } else {
2978 // obtain nearest lane to POI
2979 GNELane* nearestLane = lanes.front();
2980 double minorPosOverLane = nearestLane->getLaneShape().nearest_offset_to_point2D(POI->getPositionInView());
2981 double minorLateralOffset = nearestLane->getLaneShape().positionAtOffset(minorPosOverLane).distanceTo(POI->getPositionInView());
2982 for (const auto& lane : lanes) {
2983 double posOverLane = lane->getLaneShape().nearest_offset_to_point2D(POI->getPositionInView());
2984 double lateralOffset = lane->getLaneShape().positionAtOffset(posOverLane).distanceTo(POI->getPositionInView());
2985 if (lateralOffset < minorLateralOffset) {
2986 minorPosOverLane = posOverLane;
2987 minorLateralOffset = lateralOffset;
2988 nearestLane = lane;
2989 }
2990 }
2991 // get sumo base object of POI (And all common attributes)
2992 CommonXMLStructure::SumoBaseObject* POIBaseObject = POI->getSumoBaseObject();
2993 // add specific attributes
2994 POIBaseObject->addStringAttribute(SUMO_ATTR_LANE, nearestLane->getID());
2995 POIBaseObject->addDoubleAttribute(SUMO_ATTR_POSITION, minorPosOverLane);
2996 POIBaseObject->addBoolAttribute(SUMO_ATTR_FRIENDLY_POS, POI->getFriendlyPos());
2997 POIBaseObject->addDoubleAttribute(SUMO_ATTR_POSITION_LAT, 0);
2998 // remove POI
2999 myUndoList->begin(POI, TL("attach POI into lane"));
3001 // add new POI use route handler
3002 additionalHanlder.parseSumoBaseObject(POIBaseObject);
3003 myUndoList->end();
3004 }
3005 } else {
3006 // get sumo base object of POI (And all common attributes)
3007 CommonXMLStructure::SumoBaseObject* POIBaseObject = POI->getSumoBaseObject();
3008 // add specific attributes
3009 POIBaseObject->addDoubleAttribute(SUMO_ATTR_X, POI->x());
3010 POIBaseObject->addDoubleAttribute(SUMO_ATTR_Y, POI->y());
3011 // remove POI
3012 myUndoList->begin(POI, TL("release POI from lane"));
3014 // add new POI use route handler
3015 additionalHanlder.parseSumoBaseObject(POIBaseObject);
3016 myUndoList->end();
3017 }
3018 }
3019 return 1;
3020}
3021
3022
3023long
3024GNEViewNet::onCmdReverse(FXObject*, FXSelector, void*) {
3025 // obtain demand element at popup position
3027 if (demandElement) {
3028 // begin undo list
3029 myUndoList->begin(demandElement, TLF("reverse % '%'", demandElement->getTagStr(), demandElement->getID()));
3030 GNERouteHandler::reverse(demandElement);
3031 myUndoList->end();
3032 }
3033 return 1;
3034}
3035
3036
3037long
3038GNEViewNet::onCmdAddReverse(FXObject*, FXSelector, void*) {
3039 // obtain demand element at popup position
3041 if (demandElement) {
3042 // begin undo list
3043 myUndoList->begin(demandElement, TLF("add reverse '%'", demandElement->getTagStr()));
3044 GNERouteHandler::addReverse(demandElement);
3045 myUndoList->end();
3046 }
3047 return 1;
3048}
3049
3050
3051long
3052GNEViewNet::onCmdSetCustomGeometryPoint(FXObject*, FXSelector, void*) {
3053 // get element at popup position
3057 // check element
3058 if (lane != nullptr) {
3059 // make a copy of edge geometry
3060 PositionVector edgeGeometry = lane->getParentEdge()->getNBEdge()->getGeometry();
3061 // get index position
3062 const int index = edgeGeometry.indexOfClosest(getPositionInformation(), true);
3063 // get new position
3064 Position newPosition = edgeGeometry[index];
3065 // edit using modal GNEGeometryPointDialog
3066 GNEGeometryPointDialog(this, &newPosition); // NOSONAR, constructor returns after dialog has been closed
3067 // now check position
3068 if (newPosition != edgeGeometry[index]) {
3069 // update new position
3070 edgeGeometry[index] = newPosition;
3071 // begin undo list
3072 myUndoList->begin(lane->getParentEdge(), TL("change edge Geometry Point position"));
3073 // continue depending of index
3074 if (index == 0) {
3075 // change shape start
3077 } else if (index == ((int)edgeGeometry.size() - 1)) {
3078 // change shape end
3080 } else {
3081 // remove front and back geometry points
3082 edgeGeometry.pop_front();
3083 edgeGeometry.pop_back();
3084 // change shape
3086 }
3087 // end undo list
3088 myUndoList->end();
3089 }
3090 } else if (poly != nullptr) {
3091 // make a copy of polygon geometry
3092 PositionVector polygonGeometry = poly->getShape();
3093 // get index position
3094 const int index = polygonGeometry.indexOfClosest(getPositionInformation(), true);
3095 // get new position
3096 Position newPosition = polygonGeometry[index];
3097 // edit using modal GNEGeometryPointDialog
3098 GNEGeometryPointDialog(this, &newPosition); // NOSONAR, constructor returns after dialog has been closed
3099 // now check position
3100 if (newPosition != polygonGeometry[index]) {
3101 // update new position
3102 polygonGeometry[index] = newPosition;
3103 // begin undo list
3104 myUndoList->begin(poly, TL("change polygon Geometry Point position"));
3105 // change shape
3107 // end undo list
3108 myUndoList->end();
3109 }
3110 } else if (TAZ != nullptr) {
3111 // make a copy of TAZ geometry
3112 PositionVector TAZGeometry = TAZ->getAdditionalGeometry().getShape();
3113 // get index position
3114 const int index = TAZGeometry.indexOfClosest(getPositionInformation(), true);
3115 // get new position
3116 Position newPosition = TAZGeometry[index];
3117 // edit using modal GNEGeometryPointDialog
3118 GNEGeometryPointDialog(this, &newPosition); // NOSONAR, constructor returns after dialog has been closed
3119 // now check position
3120 if (newPosition != TAZGeometry[index]) {
3121 // update new position
3122 TAZGeometry[index] = newPosition;
3123 // begin undo list
3124 myUndoList->begin(TAZ, TL("change TAZ Geometry Point position"));
3125 // change shape
3127 // end undo list
3128 myUndoList->end();
3129 }
3130 }
3131 return 1;
3132}
3133
3134
3135long
3136GNEViewNet::onCmdResetEndPoints(FXObject*, FXSelector, void*) {
3137 // get lane at popup position
3138 GNELane* laneAtPopupPosition = getLaneAtPopupPosition();
3139 // check element
3140 if (laneAtPopupPosition != nullptr) {
3141 // get parent edge
3142 GNEEdge* edge = laneAtPopupPosition->getParentEdge();
3143 // check if edge is selected
3144 if (edge->isAttributeCarrierSelected()) {
3145 // get selected edges
3146 const auto selectedEdges = myNet->getAttributeCarriers()->getSelectedEdges();
3147 // begin undo list
3148 myUndoList->begin(edge, TL("reset end points of selected edges"));
3149 // iterate over edges
3150 for (const auto& selectedEdge : selectedEdges) {
3151 // reset both end points
3152 selectedEdge->setAttribute(GNE_ATTR_SHAPE_START, "", myUndoList);
3153 selectedEdge->setAttribute(GNE_ATTR_SHAPE_END, "", myUndoList);
3154 }
3155 // end undo list
3156 myUndoList->end();
3157 } else {
3158 // begin undo list
3159 myUndoList->begin(edge, TL("reset end points of edge '") + edge->getID());
3160 // reset both end points
3163 // end undo list
3164 myUndoList->end();
3165 }
3166 }
3167 return 1;
3168}
3169
3170
3171long
3172GNEViewNet::onCmdDuplicateLane(FXObject*, FXSelector, void*) {
3173 GNELane* laneAtPopupPosition = getLaneAtPopupPosition();
3174 if (laneAtPopupPosition != nullptr) {
3175 // when duplicating an unselected lane, keep all connections as they
3176 // are, otherwise recompute them
3177 if (laneAtPopupPosition->isAttributeCarrierSelected()) {
3178 myUndoList->begin(laneAtPopupPosition, TL("duplicate selected lanes"));
3179 const auto selectedLanes = myNet->getAttributeCarriers()->getSelectedLanes();
3180 for (const auto& lane : selectedLanes) {
3181 myNet->duplicateLane(lane, myUndoList, true);
3182 }
3183 myUndoList->end();
3184 } else {
3185 myUndoList->begin(laneAtPopupPosition, TL("duplicate lane"));
3186 myNet->duplicateLane(laneAtPopupPosition, myUndoList, false);
3187 myUndoList->end();
3188 }
3189 }
3190 return 1;
3191}
3192
3193
3194long
3195GNEViewNet::onCmdEditLaneShape(FXObject*, FXSelector, void*) {
3196 // Obtain lane under mouse
3198 if (lane) {
3200 }
3201 // destroy pop-up and update view Net
3202 destroyPopup();
3203 setFocus();
3204 return 1;
3205}
3206
3207
3208long
3209GNEViewNet::onCmdResetLaneCustomShape(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 custom lane shapes"));
3216 const auto selectedLanes = myNet->getAttributeCarriers()->getSelectedLanes();
3217 for (const auto& lane : selectedLanes) {
3218 lane->setAttribute(SUMO_ATTR_CUSTOMSHAPE, "", myUndoList);
3219 }
3220 myUndoList->end();
3221 } else {
3222 myUndoList->begin(laneAtPopupPosition, TL("reset custom lane shape"));
3223 laneAtPopupPosition->setAttribute(SUMO_ATTR_CUSTOMSHAPE, "", myUndoList);
3224 myUndoList->end();
3225 }
3226 }
3227 return 1;
3228}
3229
3230
3231long
3232GNEViewNet::onCmdResetOppositeLane(FXObject*, FXSelector, void*) {
3233 GNELane* laneAtPopupPosition = getLaneAtPopupPosition();
3234 if (laneAtPopupPosition != nullptr) {
3235 // when duplicating an unselected lane, keep all connections as they
3236 // are, otherwise recompute them
3237 if (laneAtPopupPosition->isAttributeCarrierSelected()) {
3238 myUndoList->begin(laneAtPopupPosition, TL("reset opposite lanes"));
3239 const auto selectedLanes = myNet->getAttributeCarriers()->getSelectedLanes();
3240 for (const auto& lane : selectedLanes) {
3241 lane->setAttribute(GNE_ATTR_OPPOSITE, "", myUndoList);
3242 }
3243 myUndoList->end();
3244 } else {
3245 myUndoList->begin(laneAtPopupPosition, TL("reset opposite lane"));
3246 laneAtPopupPosition->setAttribute(GNE_ATTR_OPPOSITE, "", myUndoList);
3247 myUndoList->end();
3248 }
3249 }
3250 return 1;
3251}
3252
3253
3254long
3255GNEViewNet::onCmdLaneOperation(FXObject*, FXSelector sel, void*) {
3256 GNELane* laneAtPopupPosition = getLaneAtPopupPosition();
3257 if (laneAtPopupPosition) {
3258 // check lane operation
3259 switch (FXSELID(sel)) {
3261 return restrictLane(laneAtPopupPosition, SVC_PEDESTRIAN);
3263 return restrictLane(laneAtPopupPosition, SVC_BICYCLE);
3265 return restrictLane(laneAtPopupPosition, SVC_BUS);
3267 return restrictLane(laneAtPopupPosition, SVC_IGNORING);
3269 return addRestrictedLane(laneAtPopupPosition, SVC_PEDESTRIAN, false);
3271 return addRestrictedLane(laneAtPopupPosition, SVC_BICYCLE, false);
3273 return addRestrictedLane(laneAtPopupPosition, SVC_BUS, false);
3275 return addRestrictedLane(laneAtPopupPosition, SVC_IGNORING, true);
3277 return addRestrictedLane(laneAtPopupPosition, SVC_IGNORING, false);
3279 return removeRestrictedLane(laneAtPopupPosition, SVC_PEDESTRIAN);
3281 return removeRestrictedLane(laneAtPopupPosition, SVC_BICYCLE);
3283 return removeRestrictedLane(laneAtPopupPosition, SVC_BUS);
3285 return removeRestrictedLane(laneAtPopupPosition, SVC_IGNORING);
3286 default:
3287 return 0;
3288 }
3289 } else {
3290 return 0;
3291 }
3292}
3293
3294
3295long
3296GNEViewNet::onCmdLaneReachability(FXObject* menu, FXSelector, void*) {
3297 GNELane* laneAtPopupPosition = getLaneAtPopupPosition();
3298 if (laneAtPopupPosition != nullptr) {
3299 // obtain vClass
3300 const SUMOVehicleClass vClass = SumoVehicleClassStrings.get(dynamic_cast<FXMenuCommand*>(menu)->getText().text());
3301 // calculate reachability
3303 // select all lanes with reachability greater than 0
3304 myUndoList->begin(laneAtPopupPosition, TL("select lane reachability"));
3305 for (const auto& edge : myNet->getAttributeCarriers()->getEdges()) {
3306 for (const auto& lane : edge.second->getLanes()) {
3307 if (lane->getReachability() >= 0) {
3308 lane->setAttribute(GNE_ATTR_SELECTED, "true", myUndoList);
3309 }
3310 }
3311 }
3312 myUndoList->end();
3313 }
3314 return 1;
3315}
3316
3317
3318long
3319GNEViewNet::onCmdOpenAdditionalDialog(FXObject*, FXSelector, void*) {
3320 // retrieve additional under cursor
3322 // check if additional can open dialog
3323 if (addtional && addtional->getTagProperty().hasDialog()) {
3324 addtional->openAdditionalDialog();
3325 }
3326 return 1;
3327}
3328
3329
3330void
3332 FXEvent* evt = (FXEvent*)eventData;
3333 // process click
3334 destroyPopup();
3335 setFocus();
3336 myChanger->onLeftBtnPress(eventData);
3337 grab();
3338 // Check there are double click
3339 if (evt->click_count == 2) {
3340 handle(this, FXSEL(SEL_DOUBLECLICKED, 0), eventData);
3341 }
3342}
3343
3344
3345void
3347 // first check if we're panning
3348 if (myPanning) {
3349 // move view
3352 } else {
3353 // declare flags
3354 bool cursorMoveView = false;
3355 bool cursorInspect = false;
3356 bool cursorSelect = false;
3357 bool cursorMoveElement = false;
3358 bool cursorDelete = false;
3359 // continue depending of supermode
3361 // move view
3367 cursorMoveView = true;
3368 }
3369 // specific mode
3371 cursorInspect = true;
3373 cursorSelect = true;
3375 cursorMoveElement = true;
3377 cursorDelete = true;
3378 }
3380 // move view
3384 cursorMoveView = true;
3385 }
3386 // specific mode
3388 cursorInspect = true;
3390 cursorSelect = true;
3392 cursorMoveElement = true;
3394 cursorDelete = true;
3395 }
3396 } else if (myEditModes.isCurrentSupermodeData()) {
3397 // move view
3399 cursorMoveView = true;
3400 }
3401 // specific mode
3403 cursorInspect = true;
3405 cursorSelect = true;
3407 cursorDelete = true;
3408 }
3409 }
3410 // set cursor
3411 if (myMouseButtonKeyPressed.controlKeyPressed() && cursorMoveView) {
3412 // move view cursor if control key is pressed
3415 } else if (cursorInspect) {
3416 // special case for inspect lanes
3418 // inspect lane cursor
3421 } else {
3422 // inspect cursor
3425 }
3426 } else if (cursorSelect) {
3427 // special case for select lanes
3429 // select lane cursor
3432 } else {
3433 // select cursor
3436 }
3437 } else if (cursorMoveElement) {
3438 // move cursor
3441 } else if (cursorDelete) {
3442 // delete cursor
3445 } else {
3446 // default cursor
3449 }
3450 }
3451}
3452
3453
3454int
3456 // udpdate drawing toggle
3457 if (myDrawingToggle > 10000) {
3458 myDrawingToggle = 0;
3459 } else {
3461 }
3462 // set default scale
3464 // calculate boundary extremes
3465 const float minB[2] = { (float)bound.xmin(), (float)bound.ymin() };
3466 const float maxB[2] = { (float)bound.xmax(), (float)bound.ymax() };
3467 // reset gl line to 1
3468 glLineWidth(1);
3469 // set drawing modes
3470 glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
3471 glEnable(GL_POLYGON_OFFSET_FILL);
3472 glEnable(GL_POLYGON_OFFSET_LINE);
3473 // draw all elements between minB and maxB, obtain objects included in minB and maxB
3474 return myGrid->Search(minB, maxB, *myVisualizationSettings);
3475}
3476
3477
3478void
3480 // depending of the visualizationSettings, enable or disable check box show grid
3482 // change show grid
3485 // change to true
3488 // update show grid buttons
3491 }
3492 // draw grid only in network and demand mode
3494 paintGLGrid();
3495 }
3496 } else {
3497 // change show grid
3500 // change to false
3503 // update show grid buttons
3506 }
3507 }
3508}
3509
3510
3511long
3512GNEViewNet::onCmdResetEdgeEndPoints(FXObject*, FXSelector, void*) {
3513 // Obtain junction under mouse
3515 if (junction) {
3516 myUndoList->begin(GUIIcon::EDGE, TL("reset edge endpoints"));
3517 // are, otherwise recompute them
3518 if (junction->isAttributeCarrierSelected()) {
3519 const auto selectedJunctions = myNet->getAttributeCarriers()->getSelectedJunctions();
3520 for (const auto& selectedJunction : selectedJunctions) {
3521 // reset shape end from incoming edges
3522 for (const auto& incomingEdge : selectedJunction->getGNEIncomingEdges()) {
3523 incomingEdge->setAttribute(GNE_ATTR_SHAPE_END, "", myUndoList);
3524 }
3525 // reset shape start from outgoing edges
3526 for (const auto& outgoingEdge : selectedJunction->getGNEOutgoingEdges()) {
3527 outgoingEdge->setAttribute(GNE_ATTR_SHAPE_START, "", myUndoList);
3528 }
3529 }
3530 } else {
3531 // reset shape end from incoming edges
3532 for (const auto& incomingEdge : junction->getGNEIncomingEdges()) {
3533 incomingEdge->setAttribute(GNE_ATTR_SHAPE_END, "", myUndoList);
3534 }
3535 // reset shape start from outgoing edges
3536 for (const auto& outgoingEdge : junction->getGNEOutgoingEdges()) {
3537 outgoingEdge->setAttribute(GNE_ATTR_SHAPE_START, "", myUndoList);
3538 }
3539 }
3540 myUndoList->end();
3541 }
3542 // destroy pop-up and set focus in view net
3543 destroyPopup();
3544 setFocus();
3545 return 1;
3546}
3547
3548
3549long
3550GNEViewNet::onCmdEditJunctionShape(FXObject*, FXSelector, void*) {
3551 // Obtain junction under mouse
3553 if (junction) {
3554 // check if network has to be updated
3555 if (junction->getNBNode()->getShape().size() == 0) {
3556 // recompute the whole network
3558 }
3559 // if grid is enabled, show warning
3561 WRITE_WARNING(TL("Grid is still active, press ctrl+g to deactivate"));
3562 }
3563 // start edit custom shape
3565 }
3566 // destroy pop-up and set focus in view net
3567 destroyPopup();
3568 setFocus();
3569 return 1;
3570}
3571
3572
3573long
3574GNEViewNet::onCmdResetJunctionShape(FXObject*, FXSelector, void*) {
3575 // Obtain junction under mouse
3577 if (junction) {
3578 // are, otherwise recompute them
3579 if (junction->isAttributeCarrierSelected()) {
3580 myUndoList->begin(junction, TL("reset custom junction shapes"));
3581 const auto selectedJunctions = myNet->getAttributeCarriers()->getSelectedJunctions();
3582 for (const auto& selectedJunction : selectedJunctions) {
3583 selectedJunction->setAttribute(SUMO_ATTR_SHAPE, "", myUndoList);
3584 }
3585 myUndoList->end();
3586 } else {
3587 myUndoList->begin(junction, TL("reset custom junction shape"));
3588 junction->setAttribute(SUMO_ATTR_SHAPE, "", myUndoList);
3589 myUndoList->end();
3590 }
3591 }
3592 // destroy pop-up and set focus in view net
3593 destroyPopup();
3594 setFocus();
3595 return 1;
3596}
3597
3598
3599long
3600GNEViewNet::onCmdReplaceJunction(FXObject*, FXSelector, void*) {
3602 if (junction != nullptr) {
3604 }
3605 // destroy pop-up and set focus in view net
3606 destroyPopup();
3607 setFocus();
3608 return 1;
3609}
3610
3611
3612long
3613GNEViewNet::onCmdSplitJunction(FXObject*, FXSelector, void*) {
3615 if (junction != nullptr) {
3616 myNet->splitJunction(junction, false, myUndoList);
3617 }
3618 // destroy pop-up and set focus in view net
3619 destroyPopup();
3620 setFocus();
3621 return 1;
3622}
3623
3624
3625long
3626GNEViewNet::onCmdSplitJunctionReconnect(FXObject*, FXSelector, void*) {
3628 if (junction != nullptr) {
3629 myNet->splitJunction(junction, true, myUndoList);
3630 }
3631 // destroy pop-up and set focus in view net
3632 destroyPopup();
3633 setFocus();
3634 return 1;
3635}
3636
3637long
3638GNEViewNet::onCmdSelectRoundabout(FXObject*, FXSelector, void*) {
3640 if (junction != nullptr) {
3641 myNet->selectRoundabout(junction, myUndoList);
3642 }
3643 // destroy pop-up and set focus in view net
3644 destroyPopup();
3645 setFocus();
3646 return 1;
3647}
3648
3649long
3650GNEViewNet::onCmdConvertRoundabout(FXObject*, FXSelector, void*) {
3652 if (junction != nullptr) {
3653 myNet->createRoundabout(junction, myUndoList);
3654 }
3655 // destroy pop-up and set focus in view net
3656 destroyPopup();
3657 setFocus();
3658 return 1;
3659}
3660
3661
3662long
3663GNEViewNet::onEnterConvertRoundabout(FXObject*, FXSelector, void*) {
3665 update();
3666 return 1;
3667}
3668
3669
3670long
3671GNEViewNet::onLeaveConvertRoundabout(FXObject*, FXSelector, void*) {
3673 update();
3674 return 1;
3675}
3676
3677
3678long
3679GNEViewNet::onCmdClearConnections(FXObject*, FXSelector, void*) {
3681 if (junction != nullptr) {
3682 // make sure we do not inspect the connection will it is being deleted
3683 if ((myInspectedAttributeCarriers.size() > 0) && (myInspectedAttributeCarriers.front()->getTagProperty().getTag() == SUMO_TAG_CONNECTION)) {
3685 }
3686 // make sure that connections isn't the front attribute
3688 myFrontAttributeCarrier = nullptr;
3689 }
3690 // check if we're handling a selection
3691 if (junction->isAttributeCarrierSelected()) {
3692 const auto selectedJunctions = myNet->getAttributeCarriers()->getSelectedJunctions();
3693 myUndoList->begin(GUIIcon::CONNECTION, TL("clear connections of selected junctions"));
3694 for (const auto& selectedJunction : selectedJunctions) {
3695 myNet->clearJunctionConnections(selectedJunction, myUndoList);
3696 }
3697 myUndoList->end();
3698 } else {
3700 }
3701 }
3702 // destroy pop-up and set focus in view net
3703 destroyPopup();
3704 setFocus();
3705 return 1;
3706}
3707
3708
3709long
3710GNEViewNet::onCmdResetConnections(FXObject*, FXSelector, void*) {
3712 if (junction != nullptr) {
3713 // make sure we do not inspect the connection will it is being deleted
3714 if ((myInspectedAttributeCarriers.size() > 0) && myInspectedAttributeCarriers.front()->getTagProperty().getTag() == SUMO_TAG_CONNECTION) {
3716 }
3717 // make sure that connections isn't the front attribute
3719 myFrontAttributeCarrier = nullptr;
3720 }
3721 // check if we're handling a selection
3722 if (junction->isAttributeCarrierSelected()) {
3723 const auto selectedJunctions = myNet->getAttributeCarriers()->getSelectedJunctions();
3724 myUndoList->begin(GUIIcon::CONNECTION, TL("reset connections of selected junctions"));
3725 for (const auto& selectedJunction : selectedJunctions) {
3726 myNet->resetJunctionConnections(selectedJunction, myUndoList);
3727 }
3728 myUndoList->end();
3729 } else {
3731 }
3732 }
3733 // destroy pop-up and set focus in view net
3734 destroyPopup();
3735 setFocus();
3736 return 1;
3737}
3738
3739
3740long
3741GNEViewNet::onCmdAddTLS(FXObject*, FXSelector, void*) {
3743 if (junction != nullptr) {
3744 // check if we're adding TLS in multiple junctions
3745 if (junction->isAttributeCarrierSelected()) {
3746 const auto selectedJunctions = myNet->getAttributeCarriers()->getSelectedJunctions();
3747 myNet->getViewNet()->getUndoList()->begin(GUIIcon::MODETLS, TL("add TLS in multiple junctions"));
3748 for (const auto& selectedJunction : selectedJunctions) {
3749 selectedJunction->setAttribute(SUMO_ATTR_TYPE, "traffic_light", myUndoList);
3750 }
3752 } else {
3753 // change junction type
3754 junction->setAttribute(SUMO_ATTR_TYPE, "traffic_light", myUndoList);
3755 // change to TLS Mode
3757 // set junction in TLS mode
3759 }
3760 }
3761 // destroy pop-up and set focus in view net
3762 destroyPopup();
3763 setFocus();
3764 return 1;
3765}
3766
3767
3768long
3769GNEViewNet::onCmdAddJoinTLS(FXObject*, FXSelector, void*) {
3771 if (junction != nullptr) {
3772 // check if we're adding TLS in multiple junctions
3773 if (junction->isAttributeCarrierSelected()) {
3774 myNet->getViewNet()->getUndoList()->begin(GUIIcon::MODETLS, TL("add TLS in multiple junctions"));
3775 }
3776 // change junction type
3777 junction->setAttribute(SUMO_ATTR_TYPE, "traffic_light", myUndoList);
3778 // if TLS was sucesfully created, apply the same TLID to other selected junctions
3779 if (junction->getAttribute(SUMO_ATTR_TLID).size() > 0) {
3780 const auto selectedJunctions = myNet->getAttributeCarriers()->getSelectedJunctions();
3781 // iterate over all selected junctions
3782 for (const auto& selectedJunction : selectedJunctions) {
3783 // check that doesn't have a TL
3784 if (selectedJunction->getNBNode()->getControllingTLS().empty()) {
3785 selectedJunction->setAttribute(SUMO_ATTR_TYPE, "traffic_light", myUndoList);
3786 selectedJunction->setAttribute(SUMO_ATTR_TLID, junction->getAttribute(SUMO_ATTR_TLID), myUndoList);
3787 }
3788 }
3789 }
3790 // rename traffic light
3791 if (junction->getNBNode()->getControllingTLS().size() > 0) {
3792 const auto TLSDef = (*junction->getNBNode()->getControllingTLS().begin());
3793 if (!myNet->getTLLogicCont().exist(TLSDef->getID() + "_joined")) {
3794 myUndoList->add(new GNEChange_TLS(junction, TLSDef, TLSDef->getID() + "_joined"), true);
3795 }
3796 }
3797 // end undoList
3798 if (junction->isAttributeCarrierSelected()) {
3800 }
3801 // change to TLS Mode
3803 // set junction in TLS mode
3805 }
3806 // destroy pop-up and set focus in view net
3807 destroyPopup();
3808 setFocus();
3809 return 1;
3810}
3811
3812long
3813GNEViewNet::onCmdEditConnectionShape(FXObject*, FXSelector, void*) {
3814 // Obtain connection under mouse
3816 if (connection) {
3818 }
3819 // if grid is enabled, show warning
3821 WRITE_WARNING(TL("Grid is still active, press ctrl+g to deactivate"));
3822 }
3823 // destroy pop-up and update view Net
3824 destroyPopup();
3825 setFocus();
3826 return 1;
3827}
3828
3829
3830long
3831GNEViewNet::onCmdSmoothConnectionShape(FXObject*, FXSelector, void*) {
3832 // Obtain connection under mouse
3834 if (connection) {
3835 connection->smootShape();
3836 }
3837 // destroy pop-up and update view Net
3838 destroyPopup();
3839 setFocus();
3840 return 1;
3841}
3842
3843
3844long
3845GNEViewNet::onCmdEditCrossingShape(FXObject*, FXSelector, void*) {
3846 // Obtain crossing under mouse
3848 if (crossing) {
3849 // check if network has to be updated
3850 if (crossing->getParentJunction()->getNBNode()->getShape().size() == 0) {
3851 // recompute the whole network
3853 }
3854 // if grid is enabled, show warning
3856 WRITE_WARNING(TL("Grid is still active, press ctrl+g to deactivate"));
3857 }
3858 // start edit custom shape
3860 }
3861 // destroy pop-up and update view Net
3862 destroyPopup();
3863 setFocus();
3864 return 1;
3865}
3866
3867
3868long
3869GNEViewNet::onCmdEditWalkingAreaShape(FXObject*, FXSelector, void*) {
3870 // Obtain walkingArea under mouse
3872 if (walkingArea) {
3873 // check if network has to be updated
3874 if (walkingArea->getParentJunction()->getNBNode()->getShape().size() == 0) {
3875 // recompute the whole network
3877 // if grid is enabled, show warning
3879 WRITE_WARNING(TL("Grid is still active, press ctrl+g to deactivate"));
3880 }
3881 }
3882 // start edit custom shape
3884 }
3885 // destroy pop-up and update view Net
3886 destroyPopup();
3887 setFocus();
3888 return 1;
3889}
3890
3891
3892long
3893GNEViewNet::onCmdToggleSelectEdges(FXObject*, FXSelector sel, void*) {
3894 // Toggle menuCheckSelectEdges
3897 } else {
3899 }
3901 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
3902 if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_SELECTEDGES)) {
3904 }
3905 return 1;
3906}
3907
3908
3909long
3910GNEViewNet::onCmdToggleShowConnections(FXObject*, FXSelector sel, void*) {
3911 // Toggle menuCheckShowConnections
3914 } else {
3916 }
3918 // if show was enabled, init GNEConnections
3921 }
3922 // change flag "showLane2Lane" in myVisualizationSettings
3924 // Hide/show connections require recompute
3926 // Update viewNet to show/hide connections
3927 updateViewNet();
3928 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
3929 if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_SHOWCONNECTIONS)) {
3931 }
3932 return 1;
3933}
3934
3935
3936long
3937GNEViewNet::onCmdToggleHideConnections(FXObject*, FXSelector sel, void*) {
3938 // Toggle menuCheckHideConnections
3941 } else {
3943 }
3945 // Update viewNet to show/hide connections
3946 updateViewNet();
3947 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
3948 if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_HIDECONNECTIONS)) {
3950 }
3951 return 1;
3952}
3953
3954
3955long
3956GNEViewNet::onCmdToggleShowAdditionalSubElements(FXObject*, FXSelector sel, void*) {
3957 // Toggle menuCheckShowAdditionalSubElements
3960 } else {
3962 }
3964 // Update viewNet to show/hide sub elements
3965 updateViewNet();
3966 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
3967 if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_SHOWSUBADDITIONALS)) {
3969 }
3970 return 1;
3971}
3972
3973
3974long
3975GNEViewNet::onCmdToggleShowTAZElements(FXObject*, FXSelector sel, void*) {
3976 // Toggle menuCheckShowAdditionalSubElements
3979 } else {
3981 }
3983 // Update viewNet to show/hide TAZ elements
3984 updateViewNet();
3985 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
3986 if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_SHOWTAZELEMENTS)) {
3988 }
3989 return 1;
3990}
3991
3992
3993long
3994GNEViewNet::onCmdToggleExtendSelection(FXObject*, FXSelector sel, void*) {
3995 // Toggle menuCheckExtendSelection
3998 } else {
4000 }
4002 // Only update view
4003 updateViewNet();
4004 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4005 if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_EXTENDSELECTION)) {
4007 }
4008 return 1;
4009}
4010
4011
4012long
4013GNEViewNet::onCmdToggleChangeAllPhases(FXObject*, FXSelector sel, void*) {
4014 // Toggle menuCheckChangeAllPhases
4017 } else {
4019 }
4021 // Only update view
4022 updateViewNet();
4023 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4024 if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_CHANGEALLPHASES)) {
4026 }
4027 return 1;
4028}
4029
4030
4031long
4032GNEViewNet::onCmdToggleShowGrid(FXObject*, FXSelector sel, void*) {
4033 // show or hide grid depending of myNetworkViewOptions.menuCheckToggleGrid
4038 } else {
4042 }
4045 // update view to show grid
4046 updateViewNet();
4047 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4048 if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_TOGGLEGRID)) {
4050 } else if (sel == FXSEL(SEL_COMMAND, MID_GNE_DEMANDVIEWOPTIONS_SHOWGRID)) {
4052 }
4053 return 1;
4054}
4055
4056
4057long
4058GNEViewNet::onCmdToggleDrawJunctionShape(FXObject*, FXSelector sel, void*) {
4059 // toggle state
4061 // gui button has 'hide' semantics
4062 const bool hide = !myVisualizationSettings->drawJunctionShape;
4066
4070 // update view to show DrawJunctionShape
4071 updateViewNet();
4072 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4073 if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_TOGGLEDRAWJUNCTIONSHAPE)) {
4075 } else if (sel == FXSEL(SEL_COMMAND, MID_GNE_DEMANDVIEWOPTIONS_TOGGLEDRAWJUNCTIONSHAPE)) {
4077 } else if (sel == FXSEL(SEL_COMMAND, MID_GNE_DATAVIEWOPTIONS_TOGGLEDRAWJUNCTIONSHAPE)) {
4079 }
4080 return 1;
4081}
4082
4083long
4084GNEViewNet::onCmdToggleDrawSpreadVehicles(FXObject*, FXSelector sel, void*) {
4085 // Toggle menuCheckShowDemandElements
4090 } else {
4093 }
4096 // declare edge set
4097 std::set<GNEEdge*> edgesToUpdate;
4098 // compute vehicle geometry
4099 for (const auto& vehicle : myNet->getAttributeCarriers()->getDemandElements().at(SUMO_TAG_VEHICLE)) {
4100 if (vehicle.second->getParentEdges().size() > 0) {
4101 edgesToUpdate.insert(vehicle.second->getParentEdges().front());
4102 } else if (vehicle.second->getChildDemandElements().size() > 0 && (vehicle.second->getChildDemandElements().front()->getTagProperty().getTag() == GNE_TAG_ROUTE_EMBEDDED)) {
4103 edgesToUpdate.insert(vehicle.second->getChildDemandElements().front()->getParentEdges().front());
4104 }
4105 }
4106 for (const auto& routeFlow : myNet->getAttributeCarriers()->getDemandElements().at(GNE_TAG_FLOW_ROUTE)) {
4107 if (routeFlow.second->getParentEdges().size() > 0) {
4108 edgesToUpdate.insert(routeFlow.second->getParentEdges().front());
4109 } else if (routeFlow.second->getChildDemandElements().size() > 0 && (routeFlow.second->getChildDemandElements().front()->getTagProperty().getTag() == GNE_TAG_ROUTE_EMBEDDED)) {
4110 edgesToUpdate.insert(routeFlow.second->getChildDemandElements().front()->getParentEdges().front());
4111 }
4112 }
4113 for (const auto& trip : myNet->getAttributeCarriers()->getDemandElements().at(SUMO_TAG_TRIP)) {
4114 if (trip.second->getParentEdges().size() > 0) {
4115 edgesToUpdate.insert(trip.second->getParentEdges().front());
4116 }
4117 }
4118 for (const auto& flow : myNet->getAttributeCarriers()->getDemandElements().at(SUMO_TAG_FLOW)) {
4119 if (flow.second->getParentEdges().size() > 0) {
4120 edgesToUpdate.insert(flow.second->getParentEdges().front());
4121 }
4122 }
4123 // update spread geometries of all edges
4124 for (const auto& edge : edgesToUpdate) {
4125 edge->updateVehicleSpreadGeometries();
4126 }
4127 // update view to show new vehicles positions
4128 updateViewNet();
4129 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4130 if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_DRAWSPREADVEHICLES)) {
4132 } else if (sel == FXSEL(SEL_COMMAND, MID_GNE_DEMANDVIEWOPTIONS_DRAWSPREADVEHICLES)) {
4134 }
4135 return 1;
4136}
4137
4138
4139long
4140GNEViewNet::onCmdToggleWarnAboutMerge(FXObject*, FXSelector sel, void*) {
4141 // Toggle menuCheckWarnAboutMerge
4144 } else {
4146 }
4148 // Only update view
4149 updateViewNet();
4150 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4151 if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_ASKFORMERGE)) {
4153 }
4154 return 1;
4155}
4156
4157
4158long
4159GNEViewNet::onCmdToggleShowJunctionBubbles(FXObject*, FXSelector sel, void*) {
4160 // Toggle menuCheckShowJunctionBubble
4163 } else {
4165 }
4167 // Only update view
4168 updateViewNet();
4169 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4170 if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_SHOWBUBBLES)) {
4172 }
4173 return 1;
4174}
4175
4176
4177long
4178GNEViewNet::onCmdToggleMoveElevation(FXObject*, FXSelector sel, void*) {
4179 // Toggle menuCheckMoveElevation
4182 } else {
4184 }
4186 // Only update view
4187 updateViewNet();
4188 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4189 if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_MOVEELEVATION)) {
4191 }
4192 return 1;
4193}
4194
4195
4196long
4197GNEViewNet::onCmdToggleChainEdges(FXObject*, FXSelector sel, void*) {
4198 // Toggle menuCheckMoveElevation
4201 } else {
4203 }
4205 // Only update view
4206 updateViewNet();
4207 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4208 if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_CHAINEDGES)) {
4210 }
4211 return 1;
4212}
4213
4214
4215long
4216GNEViewNet::onCmdToggleAutoOppositeEdge(FXObject*, FXSelector sel, void*) {
4217 // Toggle menuCheckAutoOppositeEdge
4220 } else {
4222 }
4224 // Only update view
4225 updateViewNet();
4226 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4227 if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_AUTOOPPOSITEEDGES)) {
4229 }
4230 return 1;
4231}
4232
4233
4234long
4236 // Toggle menuCheckHideNonInspectedDemandElements
4239 } else {
4241 }
4243 // Only update view
4244 updateViewNet();
4245 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4246 if (sel == FXSEL(SEL_COMMAND, MID_GNE_DEMANDVIEWOPTIONS_HIDENONINSPECTED)) {
4248 }
4249 return 1;
4250}
4251
4252
4253long
4254GNEViewNet::onCmdToggleShowOverlappedRoutes(FXObject*, FXSelector sel, void*) {
4255 // Toggle menuCheckShowOverlappedRoutes
4258 } else {
4260 }
4262 // Only update view
4263 updateViewNet();
4264 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4265 if (sel == FXSEL(SEL_COMMAND, MID_GNE_DEMANDVIEWOPTIONS_SHOWOVERLAPPEDROUTES)) {
4267 }
4268 return 1;
4269}
4270
4271
4272long
4273GNEViewNet::onCmdToggleHideShapes(FXObject*, FXSelector sel, void*) {
4274 // Toggle menuCheckHideShapes
4277 } else {
4279 }
4281 // Only update view
4282 updateViewNet();
4283 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4284 if (sel == FXSEL(SEL_COMMAND, MID_GNE_DEMANDVIEWOPTIONS_HIDESHAPES)) {
4286 }
4287 return 1;
4288}
4289
4290
4291long
4292GNEViewNet::onCmdToggleShowTrips(FXObject*, FXSelector sel, void*) {
4293 // Toggle menuCheckHideShapes
4296 } else {
4298 }
4300 // Only update view
4301 updateViewNet();
4302 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4303 if (sel == FXSEL(SEL_COMMAND, MID_GNE_DEMANDVIEWOPTIONS_SHOWTRIPS)) {
4305 }
4306 return 1;
4307}
4308
4309
4310long
4311GNEViewNet::onCmdToggleShowAllPersonPlans(FXObject*, FXSelector sel, void*) {
4312 // Toggle menuCheckShowAllPersonPlans
4315 } else {
4317 }
4319 // Only update view
4320 updateViewNet();
4321 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4322 if (sel == FXSEL(SEL_COMMAND, MID_GNE_DEMANDVIEWOPTIONS_SHOWALLPERSONPLANS)) {
4324 }
4325 return 1;
4326}
4327
4328
4329long
4330GNEViewNet::onCmdToggleLockPerson(FXObject*, FXSelector sel, void*) {
4331 // Toggle menuCheckLockPerson
4334 } else if ((myInspectedAttributeCarriers.size() > 0) && myInspectedAttributeCarriers.front()->getTagProperty().isPerson()) {
4336 }
4338 // lock or unlock current inspected person depending of menuCheckLockPerson value
4340 // obtain locked person or person plan
4341 const GNEDemandElement* personOrPersonPlan = dynamic_cast<const GNEDemandElement*>(myInspectedAttributeCarriers.front());
4342 if (personOrPersonPlan) {
4343 // lock person depending if casted demand element is either a person or a person plan
4344 if (personOrPersonPlan->getTagProperty().isPerson()) {
4345 myDemandViewOptions.lockPerson(personOrPersonPlan);
4346 } else {
4347 myDemandViewOptions.lockPerson(personOrPersonPlan->getParentDemandElements().front());
4348 }
4349 }
4350 } else {
4351 // unlock current person
4353 }
4354 // update view
4355 updateViewNet();
4356 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4357 if (sel == FXSEL(SEL_COMMAND, MID_GNE_DEMANDVIEWOPTIONS_LOCKPERSON)) {
4359 }
4360 return 1;
4361}
4362
4363
4364long
4365GNEViewNet::onCmdToggleShowAllContainerPlans(FXObject*, FXSelector sel, void*) {
4366 // Toggle menuCheckShowAllContainerPlans
4369 } else {
4371 }
4373 // Only update view
4374 updateViewNet();
4375 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4376 if (sel == FXSEL(SEL_COMMAND, MID_GNE_DEMANDVIEWOPTIONS_SHOWALLCONTAINERPLANS)) {
4378 }
4379 return 1;
4380}
4381
4382
4383long
4384GNEViewNet::onCmdToggleLockContainer(FXObject*, FXSelector sel, void*) {
4385 // Toggle menuCheckLockContainer
4388 } else if ((myInspectedAttributeCarriers.size() > 0) && myInspectedAttributeCarriers.front()->getTagProperty().isContainer()) {
4390 }
4392 // lock or unlock current inspected container depending of menuCheckLockContainer value
4394 // obtain locked container or container plan
4395 const GNEDemandElement* containerOrContainerPlan = dynamic_cast<const GNEDemandElement*>(myInspectedAttributeCarriers.front());
4396 if (containerOrContainerPlan) {
4397 // lock container depending if casted demand element is either a container or a container plan
4398 if (containerOrContainerPlan->getTagProperty().isContainer()) {
4399 myDemandViewOptions.lockContainer(containerOrContainerPlan);
4400 } else {
4401 myDemandViewOptions.lockContainer(containerOrContainerPlan->getParentDemandElements().front());
4402 }
4403 }
4404 } else {
4405 // unlock current container
4407 }
4408 // update view
4409 updateViewNet();
4410 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4411 if (sel == FXSEL(SEL_COMMAND, MID_GNE_DEMANDVIEWOPTIONS_LOCKCONTAINER)) {
4413 }
4414 return 1;
4415}
4416
4417
4418long
4419GNEViewNet::onCmdToggleShowAdditionals(FXObject*, FXSelector sel, void*) {
4420 // Toggle menuCheckShowAdditionals
4423 } else {
4425 }
4427 // Only update view
4428 updateViewNet();
4429 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4430 if (sel == FXSEL(SEL_COMMAND, MID_GNE_DATAVIEWOPTIONS_SHOWADDITIONALS)) {
4432 }
4433 return 1;
4434}
4435
4436
4437long
4438GNEViewNet::onCmdToggleShowShapes(FXObject*, FXSelector sel, void*) {
4439 // Toggle menuCheckShowShapes
4442 } else {
4444 }
4446 // Only update view
4447 updateViewNet();
4448 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4449 if (sel == FXSEL(SEL_COMMAND, MID_GNE_DATAVIEWOPTIONS_SHOWSHAPES)) {
4451 }
4452 return 1;
4453}
4454
4455
4456long
4457GNEViewNet::onCmdToggleShowDemandElementsNetwork(FXObject*, FXSelector sel, void*) {
4458 // Toggle menuCheckShowDemandElements
4461 } else {
4463 }
4465 // compute demand elements
4467 // update view to show demand elements
4468 updateViewNet();
4469 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4470 if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_SHOWDEMANDELEMENTS)) {
4472 }
4473 return 1;
4474}
4475
4476
4477long
4478GNEViewNet::onCmdToggleShowDemandElementsData(FXObject*, FXSelector sel, void*) {
4479 // Toggle menuCheckShowDemandElements
4482 } else {
4484 }
4486 // compute demand elements
4488 // update view to show demand elements
4489 updateViewNet();
4490 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4491 if (sel == FXSEL(SEL_COMMAND, MID_GNE_DATAVIEWOPTIONS_SHOWDEMANDELEMENTS)) {
4493 }
4494 return 1;
4495}
4496
4497
4498long
4499GNEViewNet::onCmdToggleTAZRelDrawing(FXObject*, FXSelector sel, void*) {
4500 // Toggle menuCheckShowDemandElements
4503 } else {
4505 }
4507 // update view to show demand elements
4508 updateViewNet();
4509 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4510 if (sel == FXSEL(SEL_COMMAND, MID_GNE_DATAVIEWOPTIONS_TAZRELDRAWING)) {
4512 }
4513 return 1;
4514}
4515
4516
4517long
4518GNEViewNet::onCmdToggleTAZDrawFill(FXObject*, FXSelector sel, void*) {
4519 // Toggle menuCheckShowDemandElements
4522 } else {
4524 }
4526 // update view to show demand elements
4527 updateViewNet();
4528 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4529 if (sel == FXSEL(SEL_COMMAND, MID_GNE_DATAVIEWOPTIONS_TAZDRAWFILL)) {
4531 }
4532 return 1;
4533}
4534
4535
4536long
4537GNEViewNet::onCmdToggleTAZRelOnlyFrom(FXObject*, FXSelector sel, void*) {
4538 // Toggle menuCheckShowDemandElements
4541 } else {
4543 }
4545 // update view to show demand elements
4546 updateViewNet();
4547 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4548 if (sel == FXSEL(SEL_COMMAND, MID_GNE_DATAVIEWOPTIONS_TAZRELONLYFROM)) {
4550 }
4551 return 1;
4552}
4553
4554
4555long
4556GNEViewNet::onCmdToggleTAZRelOnlyTo(FXObject*, FXSelector sel, void*) {
4557 // Toggle menuCheckShowDemandElements
4560 } else {
4562 }
4564 // update view to show demand elements
4565 updateViewNet();
4566 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4567 if (sel == FXSEL(SEL_COMMAND, MID_GNE_DATAVIEWOPTIONS_TAZRELONLYTO)) {
4569 }
4570 return 1;
4571}
4572
4573
4574long
4575GNEViewNet::onCmdIntervalBarGenericDataType(FXObject*, FXSelector, void*) {
4577 return 1;
4578}
4579
4580
4581long
4582GNEViewNet::onCmdIntervalBarDataSet(FXObject*, FXSelector, void*) {
4584 return 1;
4585}
4586
4587
4588long
4589GNEViewNet::onCmdIntervalBarLimit(FXObject*, FXSelector, void*) {
4591 return 1;
4592}
4593
4594
4595long
4596GNEViewNet::onCmdIntervalBarSetBegin(FXObject*, FXSelector, void*) {
4598 return 1;
4599}
4600
4601
4602long
4603GNEViewNet::onCmdIntervalBarSetEnd(FXObject*, FXSelector, void*) {
4605 return 1;
4606}
4607
4608
4609long
4610GNEViewNet::onCmdIntervalBarSetParameter(FXObject*, FXSelector, void*) {
4612 return 1;
4613}
4614
4615
4616long
4617GNEViewNet::onCmdAddSelected(FXObject*, FXSelector, void*) {
4618 // only select if AC under cursor isn't previously selected
4620 if (AC && !AC->isAttributeCarrierSelected()) {
4622 }
4623 return 1;
4624}
4625
4626
4627long
4628GNEViewNet::onCmdRemoveSelected(FXObject*, FXSelector, void*) {
4629 // only unselect if AC under cursor isn't previously selected
4631 if (AC && AC->isAttributeCarrierSelected()) {
4633 }
4634 return 1;
4635}
4636
4637
4638long
4639GNEViewNet::onCmdAddEdgeSelected(FXObject*, FXSelector, void*) {
4640 // only select if edge under cursor isn't previously selected
4641 auto edge = myViewObjectsSelector.getEdgeFront();
4642 if (edge && !edge->isAttributeCarrierSelected()) {
4643 edge->selectAttributeCarrier();
4644 }
4645 return 1;
4646}
4647
4648
4649long
4650GNEViewNet::onCmdRemoveEdgeSelected(FXObject*, FXSelector, void*) {
4651 // only unselect if edge under cursor isn't previously selected
4652 auto edge = myViewObjectsSelector.getEdgeFront();
4653 if (edge && edge->isAttributeCarrierSelected()) {
4655 }
4656 return 1;
4657}
4658
4659
4660long
4661GNEViewNet::onCmdSetNeteditView(FXObject*, FXSelector sel, void*) {
4662 myEditModes.setView(FXSELID(sel));
4663 update();
4664 return 1;
4665}
4666
4667// ===========================================================================
4668// private
4669// ===========================================================================
4670
4671void
4673 // build supermode buttons
4675
4676 // build save elements buttons
4678
4679 // build time switch buttons
4681
4682 // build menu checks for Common checkable buttons
4684
4685 // build menu checks for Network checkable buttons
4687
4688 // build menu checks for Demand checkable buttons
4690
4691 // build menu checks of view options Data
4693
4694 // Create Vertical separator
4696 // XXX for some reason the vertical groove is not visible. adding more spacing to emphasize the separation
4699
4700 // build menu checks of view options Network
4702
4703 // build menu checks of view options Demand
4705
4706 // build menu checks of view options Data
4708
4709 // build interval bar
4711}
4712
4713
4714void
4716 // get menu checks
4718 // hide all checkbox of view options Network
4720 // hide all checkbox of view options Demand
4722 // hide all checkbox of view options Data
4724 // disable all common edit modes
4726 // disable all network edit modes
4728 // disable all network edit modes
4730 // hide interval bar
4732 // hide all frames
4734 // hide all menuchecks
4738 // In network mode, always show option "show grid", "draw spread vehicles" and "show demand elements"
4743 menuChecks.menuCheckToggleGrid->show();
4744 menuChecks.menuCheckToggleDrawJunctionShape->show();
4745 menuChecks.menuCheckDrawSpreadVehicles->show();
4746 menuChecks.menuCheckShowDemandElements->show();
4747 // show separator
4748 menuChecks.separator->show();
4749 // enable selected controls
4750 switch (myEditModes.networkEditMode) {
4751 // common modes
4757 // show view options
4762 // show menu checks
4763 menuChecks.menuCheckSelectEdges->show();
4764 menuChecks.menuCheckShowConnections->show();
4765 menuChecks.menuCheckShowAdditionalSubElements->show();
4766 menuChecks.menuCheckShowTAZElements->show();
4767 // update lock menu bar
4769 // show
4770 break;
4779 // show view options
4782 menuChecks.menuCheckShowAdditionalSubElements->show();
4783 menuChecks.menuCheckShowTAZElements->show();
4784 // show menu checks
4785 menuChecks.menuCheckSelectEdges->show();
4786 menuChecks.menuCheckShowConnections->show();
4787 break;
4793 // show view options
4799 // show menu checks
4800 menuChecks.menuCheckSelectEdges->show();
4801 menuChecks.menuCheckShowConnections->show();
4802 menuChecks.menuCheckExtendSelection->show();
4803 menuChecks.menuCheckShowAdditionalSubElements->show();
4804 menuChecks.menuCheckShowTAZElements->show();
4805 break;
4806 // specific modes
4812 // show view options
4815 // show menu checks
4816 menuChecks.menuCheckChainEdges->show();
4817 menuChecks.menuCheckAutoOppositeEdge->show();
4818 break;
4824 // show view options
4828 // show menu checks
4829 menuChecks.menuCheckWarnAboutMerge->show();
4830 menuChecks.menuCheckShowJunctionBubble->show();
4831 menuChecks.menuCheckMoveElevation->show();
4832 break;
4838 break;
4844 // show view options
4846 // show menu checks
4847 menuChecks.menuCheckChangeAllPhases->show();
4848 break;
4854 // show view options
4856 // show menu checks
4857 menuChecks.menuCheckShowAdditionalSubElements->show();
4858 break;
4864 break;
4870 break;
4876 break;
4882 break;
4888 break;
4894 break;
4895 default:
4896 break;
4897 }
4898 // update menuChecks shorcuts
4899 menuChecks.updateShortcuts();
4900 // update common Network buttons
4902 // Update Network buttons
4904 // recalc toolbar
4907 // force repaint because different modes draw different things
4908 onPaint(nullptr, 0, nullptr);
4909 // finally update view
4910 updateViewNet();
4911}
4912
4913
4914void
4916 // get menu checks
4918 // hide all checkbox of view options Network
4920 // hide all checkbox of view options Demand
4922 // hide all checkbox of view options Data
4924 // disable all common edit modes
4926 // disable all Demand edit modes
4928 // disable all network edit modes
4930 // hide interval bar
4932 // hide all frames
4934 // hide all menuchecks
4938 // always show "hide shapes", "show grid", "draw spread vehicles", "show overlapped routes" and show/lock persons and containers
4949 menuChecks.menuCheckToggleGrid->show();
4950 menuChecks.menuCheckToggleDrawJunctionShape->show();
4951 menuChecks.menuCheckDrawSpreadVehicles->show();
4952 menuChecks.menuCheckHideShapes->show();
4953 menuChecks.menuCheckShowAllTrips->show();
4954 menuChecks.menuCheckShowAllPersonPlans->show();
4955 menuChecks.menuCheckLockPerson->show();
4956 menuChecks.menuCheckShowAllContainerPlans->show();
4957 menuChecks.menuCheckLockContainer->show();
4958 menuChecks.menuCheckShowOverlappedRoutes->show();
4959 // show separator
4960 menuChecks.separator->show();
4961 // enable selected controls
4962 switch (myEditModes.demandEditMode) {
4963 // common modes
4968 // set checkable button
4970 // show view options
4972 // show menu checks
4973 menuChecks.menuCheckHideNonInspectedDemandElements->show();
4974 break;
4979 // set checkable button
4981 break;
4986 // set checkable button
4988 break;
4993 // set checkable button
4995 break;
4996 // specific modes
5001 // set checkable button
5003 break;
5008 // set checkable button
5010 break;
5015 // set checkable button
5017 break;
5022 // set checkable button
5024 break;
5029 // set checkable button
5031 break;
5036 // set checkable button
5038 break;
5043 // set checkable button
5045 break;
5050 // set checkable button
5052 break;
5057 // set checkable button
5059 break;
5064 // set checkable button
5066 break;
5067 default:
5068 break;
5069 }
5070 // update menuChecks shorcuts
5071 menuChecks.updateShortcuts();
5072 // update common Network buttons
5074 // Update Demand buttons
5076 // recalc toolbar
5079 // force repaint because different modes draw different things
5080 onPaint(nullptr, 0, nullptr);
5081 // finally update view
5082 updateViewNet();
5083}
5084
5085
5086void
5088 // get menu checks
5090 // hide all checkbox of view options Network
5092 // hide all checkbox of view options Demand
5094 // hide all checkbox of view options Data
5096 // disable all common edit modes
5098 // disable all Data edit modes
5100 // show interval bar
5102 // hide all frames
5104 // hide all menuchecks
5108 // In data mode, always show options for show elements
5113 menuChecks.menuCheckToggleDrawJunctionShape->show();
5114 menuChecks.menuCheckShowAdditionals->show();
5115 menuChecks.menuCheckShowShapes->show();
5116 menuChecks.menuCheckShowDemandElements->show();
5117 // show separator
5118 menuChecks.separator->show();
5119 // enable selected controls
5120 switch (myEditModes.dataEditMode) {
5121 // common modes
5126 // set checkable button
5128 // show view option
5133 // show menu check
5134 menuChecks.menuCheckToggleTAZRelDrawing->show();
5135 menuChecks.menuCheckToggleTAZDrawFill->show();
5136 menuChecks.menuCheckToggleTAZRelOnlyFrom->show();
5137 menuChecks.menuCheckToggleTAZRelOnlyTo->show();
5138 break;
5143 // set checkable button
5145 // show toggle TAZRel drawing view option
5149 // show toggle TAZRel drawing menu check
5150 menuChecks.menuCheckToggleTAZRelDrawing->show();
5151 menuChecks.menuCheckToggleTAZRelOnlyFrom->show();
5152 menuChecks.menuCheckToggleTAZRelOnlyTo->show();
5153 break;
5158 // set checkable button
5160 // show toggle TAZRel drawing view option
5164 // show toggle TAZRel drawing menu check
5165 menuChecks.menuCheckToggleTAZRelDrawing->show();
5166 menuChecks.menuCheckToggleTAZRelOnlyFrom->show();
5167 menuChecks.menuCheckToggleTAZRelOnlyTo->show();
5168 break;
5173 // set checkable button
5175 break;
5180 // set checkable button
5182 break;
5187 // set checkable button
5189 // show view option
5194 // show menu check
5195 menuChecks.menuCheckToggleTAZRelDrawing->show();
5196 menuChecks.menuCheckToggleTAZDrawFill->show();
5197 menuChecks.menuCheckToggleTAZRelOnlyFrom->show();
5198 menuChecks.menuCheckToggleTAZRelOnlyTo->show();
5199 break;
5204 // set checkable button
5206 break;
5207 default:
5208 break;
5209 }
5210 // update menuChecks shorcuts
5211 menuChecks.updateShortcuts();
5212 // update common Network buttons
5214 // Update Data buttons
5216 // recalc toolbar
5219 // force repaint because different modes draw different things
5220 onPaint(nullptr, 0, nullptr);
5221 // finally update view
5222 updateViewNet();
5223}
5224
5225
5226void
5227GNEViewNet::deleteNetworkAttributeCarriers(const std::vector<GNEAttributeCarrier*> ACs) {
5228 // iterate over ACs and delete it
5229 for (const auto& AC : ACs) {
5230 if (AC->getTagProperty().getTag() == SUMO_TAG_JUNCTION) {
5231 // get junction (note: could be already removed if is a child, then hardfail=false)
5232 GNEJunction* junction = myNet->getAttributeCarriers()->retrieveJunction(AC->getID(), false);
5233 // if exist, remove it
5234 if (junction) {
5235 myNet->deleteJunction(junction, myUndoList);
5236 }
5237 } else if (AC->getTagProperty().getTag() == SUMO_TAG_CROSSING) {
5238 // get crossing (note: could be already removed if is a child, then hardfail=false)
5239 GNECrossing* crossing = myNet->getAttributeCarriers()->retrieveCrossing(AC->getGUIGlObject(), false);
5240 // if exist, remove it
5241 if (crossing) {
5242 myNet->deleteCrossing(crossing, myUndoList);
5243 }
5244 } else if (AC->getTagProperty().getTag() == SUMO_TAG_EDGE) {
5245 // get edge (note: could be already removed if is a child, then hardfail=false)
5246 GNEEdge* edge = myNet->getAttributeCarriers()->retrieveEdge(AC->getID(), false);
5247 // if exist, remove it
5248 if (edge) {
5249 myNet->deleteEdge(edge, myUndoList, false);
5250 }
5251 } else if (AC->getTagProperty().getTag() == SUMO_TAG_LANE) {
5252 // get lane (note: could be already removed if is a child, then hardfail=false)
5253 GNELane* lane = myNet->getAttributeCarriers()->retrieveLane(AC->getGUIGlObject(), false);
5254 // if exist, remove it
5255 if (lane) {
5256 myNet->deleteLane(lane, myUndoList, false);
5257 }
5258 } else if (AC->getTagProperty().getTag() == SUMO_TAG_CONNECTION) {
5259 // get connection (note: could be already removed if is a child, then hardfail=false)
5260 GNEConnection* connection = myNet->getAttributeCarriers()->retrieveConnection(AC->getGUIGlObject(), false);
5261 // if exist, remove it
5262 if (connection) {
5263 myNet->deleteConnection(connection, myUndoList);
5264 }
5265 } else if (AC->getTagProperty().isAdditionalElement()) {
5266 // get additional Element (note: could be already removed if is a child, then hardfail=false)
5267 GNEAdditional* additionalElement = myNet->getAttributeCarriers()->retrieveAdditional(AC->getGUIGlObject(), false);
5268 // if exist, remove it
5269 if (additionalElement) {
5270 myNet->deleteAdditional(additionalElement, myUndoList);
5271 }
5272 }
5273 }
5274}
5275
5276
5277void
5278GNEViewNet::deleteDemandAttributeCarriers(const std::vector<GNEAttributeCarrier*> ACs) {
5279 // iterate over ACs and delete it
5280 for (const auto& AC : ACs) {
5281 // get demand Element (note: could be already removed if is a child, then hardfail=false)
5282 GNEDemandElement* demandElement = myNet->getAttributeCarriers()->retrieveDemandElement(AC->getGUIGlObject(), false);
5283 // if exist, remove it
5284 if (demandElement) {
5285 myNet->deleteDemandElement(demandElement, myUndoList);
5286 }
5287 }
5288}
5289
5290
5291void
5292GNEViewNet::deleteDataAttributeCarriers(const std::vector<GNEAttributeCarrier*> ACs) {
5293 // iterate over ACs and delete it
5294 for (const auto& AC : ACs) {
5295 if (AC->getTagProperty().getTag() == SUMO_TAG_DATASET) {
5296 // get data set (note: could be already removed if is a child, then hardfail=false)
5297 GNEDataSet* dataSet = myNet->getAttributeCarriers()->retrieveDataSet(AC->getID(), false);
5298 // if exist, remove it
5299 if (dataSet) {
5300 myNet->deleteDataSet(dataSet, myUndoList);
5301 }
5302 } else if (AC->getTagProperty().getTag() == SUMO_TAG_DATAINTERVAL) {
5303 // get data interval (note: could be already removed if is a child, then hardfail=false)
5304 GNEDataInterval* dataInterval = myNet->getAttributeCarriers()->retrieveDataInterval(AC, false);
5305 // if exist, remove it
5306 if (dataInterval) {
5307 myNet->deleteDataInterval(dataInterval, myUndoList);
5308 }
5309 } else {
5310 // get generic data (note: could be already removed if is a child, then hardfail=false)
5311 GNEGenericData* genericData = myNet->getAttributeCarriers()->retrieveGenericData(AC->getGUIGlObject(), false);
5312 // if exist, remove it
5313 if (genericData) {
5314 myNet->deleteGenericData(genericData, myUndoList);
5315 }
5316 }
5317 }
5318}
5319
5320
5321void
5324 switch (myEditModes.networkEditMode) {
5326 myViewParent->getInspectorFrame()->update();
5327 break;
5328 default:
5329 break;
5330 }
5331 }
5333 switch (myEditModes.demandEditMode) {
5335 myViewParent->getInspectorFrame()->update();
5336 break;
5339 break;
5342 break;
5345 break;
5348 break;
5351 break;
5354 break;
5357 break;
5360 break;
5363 break;
5364 default:
5365 break;
5366 }
5367 }
5369 switch (myEditModes.dataEditMode) {
5371 myViewParent->getInspectorFrame()->update();
5372 break;
5373 default:
5374 break;
5375 }
5376 // update data interval
5378 }
5379 // update view
5380 updateViewNet();
5381}
5382
5383// ---------------------------------------------------------------------------
5384// Private methods
5385// ---------------------------------------------------------------------------
5386
5387void
5389 PositionVector temporalShape;
5390 bool deleteLastCreatedPoint = false;
5391 // obtain temporal shape and delete last created point flag
5398 }
5399 // check if we're in drawing mode
5400 if (temporalShape.size() > 0) {
5401 // draw blue line with the current drawed shape
5403 glLineWidth(2);
5404 glTranslated(0, 0, GLO_TEMPORALSHAPE);
5406 GLHelper::drawLine(temporalShape);
5408 // draw red line from the last point of shape to the current mouse position
5410 glLineWidth(2);
5411 glTranslated(0, 0, GLO_TEMPORALSHAPE);
5412 // draw last line depending if shift key (delete last created point) is pressed
5413 if (deleteLastCreatedPoint) {
5415 } else {
5417 }
5420 }
5421}
5422
5423
5424void
5426 // first check if we're in correct mode
5431 // get mouse position
5432 const Position mousePosition = snapToActiveGrid(getPositionInformation());
5433 // get junction exaggeration
5434 const double junctionExaggeration = myVisualizationSettings->junctionSize.getExaggeration(*myVisualizationSettings, nullptr, 4);
5435 // get bubble color
5437 // change alpha
5438 bubbleColor.setAlpha(200);
5439 // push layer matrix
5441 // translate to temporal shape layer
5442 glTranslated(0, 0, GLO_TEMPORALSHAPE);
5443 // push junction matrix
5445 // move matrix junction center
5446 glTranslated(mousePosition.x(), mousePosition.y(), 0.1);
5447 // set color
5448 GLHelper::setColor(bubbleColor);
5449 // draw outline circle
5450 const double circleWidth = myVisualizationSettings->neteditSizeSettings.junctionBubbleRadius * junctionExaggeration;
5451 GLHelper::drawOutlineCircle(circleWidth, circleWidth * 0.75, 32);
5452 // pop junction matrix
5454 // draw temporal edge
5456 // set temporal edge color
5457 RGBColor temporalEdgeColor = RGBColor::BLACK;
5458 temporalEdgeColor.setAlpha(200);
5459 // declare temporal edge geometry
5460 GUIGeometry temporalEdgeGeometry;
5461 // calculate geometry between source junction and mouse position
5462 PositionVector temporalEdge = {mousePosition, myViewParent->getCreateEdgeFrame()->getJunctionSource()->getPositionInView()};
5463 // move temporal edge 2 side
5464 temporalEdge.move2side(-1);
5465 // update geometry
5466 temporalEdgeGeometry.updateGeometry(temporalEdge);
5467 // push temporal edge matrix
5469 // set color
5470 GLHelper::setColor(temporalEdgeColor);
5471 // draw temporal edge
5473 // check if we have to draw opposite edge
5475 // move temporal edge to opposite edge
5476 temporalEdge.move2side(2);
5477 // update geometry
5478 temporalEdgeGeometry.updateGeometry(temporalEdge);
5479 // draw temporal edge
5481 }
5482 // pop temporal edge matrix
5484 }
5485 // pop layer matrix
5487 }
5488}
5489
5490
5491void
5493 // first check if we're in correct mode
5498 (gViewObjectsHandler.markedEdge != nullptr)) {
5499 // calculate split position
5500 const auto lane = gViewObjectsHandler.markedEdge->getLanes().back();
5501 auto shape = lane->getLaneShape();
5502 // move shape to side
5503 shape.move2side(lane->getDrawingConstants()->getDrawingWidth() * -1);
5504 const auto offset = shape.nearest_offset_to_point2D(snapToActiveGrid(getPositionInformation()));
5505 const auto splitPosition = shape.positionAtOffset2D(offset);
5506 // get junction exaggeration
5507 const double junctionExaggeration = myVisualizationSettings->junctionSize.getExaggeration(*myVisualizationSettings, nullptr, 4);
5508 // get bubble color
5510 // push layer matrix
5512 // translate to temporal shape layer
5513 glTranslated(0, 0, GLO_TEMPORALSHAPE);
5514 // push junction matrix
5516 // move matrix junction center
5517 glTranslated(splitPosition.x(), splitPosition.y(), 0.1);
5518 // set color
5519 GLHelper::setColor(bubbleColor);
5520 // draw outline circle
5521 const double circleWidth = myVisualizationSettings->neteditSizeSettings.junctionBubbleRadius * junctionExaggeration;
5522 GLHelper::drawOutlineCircle(circleWidth, circleWidth * 0.75, 32);
5523 // draw filled circle
5525 // pop junction matrix
5527 // pop layer matrix
5529 }
5530}
5531
5532
5533void
5535 // check conditions
5536 if ((myCurrentObjectsDialog.size() > 0) && (myCurrentObjectsDialog.front()->getType() == GLO_JUNCTION) && myDrawPreviewRoundabout) {
5537 // get junction
5538 const auto junction = myNet->getAttributeCarriers()->retrieveJunction(myCurrentObjectsDialog.front()->getMicrosimID());
5539 // push layer matrix
5541 // translate to temporal shape layer
5542 glTranslated(0, 0, GLO_TEMPORALSHAPE);
5543 // push junction matrix
5545 // move matrix junction center
5546 glTranslated(junction->getNBNode()->getPosition().x(), junction->getNBNode()->getPosition().y(), 0.1);
5547 // set color
5549 // draw outline circle
5550 const double circleWidth = (junction->getNBNode()->getRadius() < 0) ? 4.0 : junction->getNBNode()->getRadius();
5551 GLHelper::drawOutlineCircle(circleWidth * 1.30, circleWidth, 32);
5552 // pop junction matrix
5554 // pop layer matrix
5556 }
5557}
5558
5559
5560void
5562 // check conditions
5564 // get junction
5566 // push layer matrix
5568 // translate to TLLogic
5569 glTranslated(0, 0, GLO_TEMPORALSHAPE);
5570 // iterate over all E1 detectors
5571 for (const auto& E1ID : myViewParent->getTLSEditorFrame()->getTLSAttributes()->getE1Detectors()) {
5572 // first check if E1 exists
5573 const auto E1 = myNet->getAttributeCarriers()->retrieveAdditional(SUMO_TAG_INDUCTION_LOOP, E1ID.second, false);
5574 if (E1) {
5575 // push line matrix
5577 // draw line between junction and E1
5578 GUIGeometry::drawChildLine(*myVisualizationSettings, junctionPos, E1->getPositionInView(),
5580 // pop line matrix
5582 }
5583 }
5584 // pop layer matrix
5586 }
5587}
5588
5589
5590void
5592 // check conditions
5594 // get junction
5596 // push layer matrix
5598 // translate to TLLogic
5599 glTranslated(0, 0, GLO_TEMPORALSHAPE);
5600 // iterate over all Junction detectors
5601 for (const auto& selectedJunctionID : myViewParent->getTLSEditorFrame()->getTLSJunction()->getSelectedJunctionIDs()) {
5602 // get junction
5603 const auto selectedJunction = myNet->getAttributeCarriers()->retrieveJunction(selectedJunctionID);
5604 // push line matrix
5606 // draw line between junction and Junction
5607 GUIGeometry::drawChildLine(*myVisualizationSettings, junctionPos, selectedJunction->getPositionInView(),
5609 // pop line matrix
5611 }
5612 // pop layer matrix
5614 }
5615}
5616
5617
5618void
5624
5625
5626void
5629 // get mouse position
5630 const Position mousePosition = snapToActiveGrid(getPositionInformation());
5631 // push layer matrix
5633 // translate to test layer, but under magenta square
5634 glTranslated(mousePosition.x(), mousePosition.y(), GLO_TESTELEMENT - 1);
5635 // set color
5637 // draw circle
5639 // pop layer matrix
5641 }
5642}
5643
5644
5645void
5647 // reset moving selected edge
5649 // decide what to do based on mode
5650 switch (myEditModes.networkEditMode) {
5652 // first swap lane to edges if mySelectEdges is enabled and shift key isn't pressed
5653 if (checkSelectEdges()) {
5655 } else {
5657 }
5658 // now filter locked elements
5660 // check if we're selecting a new parent for the current inspected element
5663 } else {
5664 // process left click in Inspector Frame
5666 }
5667 // process click
5668 processClick(eventData);
5669 break;
5670 }
5672 // first swap lane to edges if mySelectEdges is enabled and shift key isn't pressed
5673 if (checkSelectEdges()) {
5675 } else {
5677 }
5678 // now filter locked elements forcing excluding walkingAreas
5680 // continue depending of AC
5682 // now check if we want only delete geometry points
5684 // only remove geometry point
5687 // remove all selected attribute carriers
5690 }
5691 } else {
5692 // remove attribute carrier under cursor
5694 }
5695 } else {
5696 // process click
5697 processClick(eventData);
5698 }
5699 break;
5700 }
5702 // first swap lane to edges if mySelectEdges is enabled and shift key isn't pressed
5703 if (checkSelectEdges()) {
5705 } else {
5707 }
5708 // now filter locked elements
5710 // avoid to select if control key is pressed
5712 // check if a rect for selecting is being created
5714 // begin rectangle selection
5717 // process click
5718 processClick(eventData);
5719 }
5720 } else {
5721 // process click
5722 processClick(eventData);
5723 }
5724 break;
5726 // check what buttons are pressed
5728 // get edge under cursor
5730 if (edge) {
5731 // obtain reverse edge
5732 const auto oppositeEdges = edge->getOppositeEdges();
5733 // check if we're split one or both edges
5736 } else if (oppositeEdges.size() > 0) {
5737 myNet->splitEdgesBidi(edge, oppositeEdges.front(), edge->getSplitPos(getPositionInformation()), myUndoList);
5738 } else {
5740 }
5741 }
5743 // process left click in create edge frame Frame
5748 }
5749 // process click
5750 processClick(eventData);
5751 break;
5752 }
5754 // editing lane shapes in move mode isn't finished, then always filter lanes
5756 // filter locked elements
5758 // check if we're editing a shape
5760 // check if we're removing a geometry point
5762 // remove geometry point
5765 }
5767 // process click if there isn't movable elements (to move camera using drag an drop)
5768 processClick(eventData);
5769 }
5770 } else {
5771 // get AC under cursor
5773 // check that AC is an network or additional element
5774 if (AC && (AC->getTagProperty().isNetworkElement() || AC->getTagProperty().isAdditionalElement())) {
5775 // check if we're moving a set of selected items
5776 if (AC->isAttributeCarrierSelected()) {
5777 // move selected ACs
5780 // process click if there isn't movable elements (to move camera using drag an drop)
5781 processClick(eventData);
5782 }
5783 } else {
5784 // process click if there isn't movable elements (to move camera using drag an drop)
5785 processClick(eventData);
5786 }
5787 }
5788 break;
5789 }
5791 // check if we're clicked over a non locked lane
5793 // Handle laneclick (shift key may pass connections, Control key allow conflicts)
5795 updateViewNet();
5796 }
5797 // process click
5798 processClick(eventData);
5799 break;
5800 }
5803 // edit TLS in TLSEditor frame
5805 updateViewNet();
5806 }
5807 // process click
5808 processClick(eventData);
5809 break;
5810 }
5812 // avoid create additionals if control key is pressed
5815 WRITE_WARNING(TL("Shift + click to create two additionals in the same position"));
5817 // save last mouse position
5819 updateViewNet();
5820 }
5821 }
5822 // process click
5823 processClick(eventData);
5824 break;
5825 }
5827 // call function addCrossing from crossing frame
5829 // process click
5830 processClick(eventData);
5831 break;
5832 }
5834 // avoid create TAZs if control key is pressed
5836 // check if we want to create a rect for selecting edges
5838 // begin rectangle selection
5840 } else {
5841 // check if process click was successfully
5843 updateViewNet();
5844 }
5845 // process click
5846 processClick(eventData);
5847 }
5848 } else {
5849 // process click
5850 processClick(eventData);
5851 }
5852 break;
5853 }
5855 // avoid create shapes if control key is pressed
5858 // declare processClick flag
5859 bool updateTemporalShape = false;
5860 // process click
5862 updateViewNet();
5863 // process click depending of the result of "process click"
5864 if (!updateTemporalShape) {
5865 // process click
5866 processClick(eventData);
5867 }
5868 }
5869 } else {
5870 // process click
5871 processClick(eventData);
5872 }
5873 break;
5874 }
5877 // shift key may pass connections, Control key allow conflicts.
5879 updateViewNet();
5880 }
5881 // process click
5882 processClick(eventData);
5883 break;
5884 }
5886 // avoid create wires if control key is pressed
5889 updateViewNet();
5890 }
5891 // process click
5892 processClick(eventData);
5893 break;
5894 }
5896 // process click
5897 processClick(eventData);
5898 break;
5899 }
5900 default: {
5901 // process click
5902 processClick(eventData);
5903 }
5904 }
5905}
5906
5907
5908void
5910 // check moved items
5914 // check if we're creating a rectangle selection or we want only to select a lane
5916 // check if we're selecting all type of elements o we only want a set of edges for TAZ
5920 // process edge selection
5922 }
5924 // check if there is a lane in objects under cursor
5926 // if we clicked over an lane with shift key pressed, select or unselect it
5929 } else {
5931 }
5932 }
5933 }
5934 // finish selection
5936 } else {
5937 // finish moving of single elements
5939 }
5940}
5941
5942
5943void
5944GNEViewNet::processMoveMouseNetwork(const bool mouseLeftButtonPressed) {
5945 // change "delete last created point" depending if during movement shift key is pressed
5950 }
5951 // check what type of additional is moved
5953 // move entire selection
5954 myMoveMultipleElements.moveSelection(mouseLeftButtonPressed);
5956 // update selection corner of selecting area
5958 } else {
5959 // move single elements
5960 myMoveSingleElement.moveSingleElement(mouseLeftButtonPressed);
5961 }
5962}
5963
5964
5965void
5967 // filter shapes (because POIs and polygons doesn't interact in demand mode)
5969 // decide what to do based on mode
5970 switch (myEditModes.demandEditMode) {
5972 // filter locked elements
5974 // process left click in Inspector Frame
5976 // process click
5977 processClick(eventData);
5978 break;
5979 }
5981 // filter locked elements
5983 // get front AC
5984 const auto frontAC = myViewObjectsSelector.getAttributeCarrierFront();
5985 // check conditions
5986 if (frontAC) {
5987 // check if we are deleting a selection or an single attribute carrier
5988 if (frontAC->isAttributeCarrierSelected()) {
5990 } else {
5992 }
5993 } else {
5994 // process click
5995 processClick(eventData);
5996 }
5997 break;
5998 }
6000 // filter locked elements
6002 // avoid to select if control key is pressed
6004 // check if a rect for selecting is being created
6006 // begin rectangle selection
6009 // process click
6010 processClick(eventData);
6011 }
6012 } else {
6013 // process click
6014 processClick(eventData);
6015 }
6016 break;
6018 // filter locked elements
6020 // get front AC
6021 const auto frontAC = myViewObjectsSelector.getAttributeCarrierFront();
6022 // check that AC under cursor is a demand element
6023 if (frontAC) {
6024 // check if we're moving a set of selected items
6025 if (frontAC->isAttributeCarrierSelected()) {
6026 // move selected ACs
6029 // process click if there isn't movable elements (to move camera using drag an drop)
6030 processClick(eventData);
6031 }
6032 } else {
6033 // process click if there isn't movable elements (to move camera using drag an drop)
6034 processClick(eventData);
6035 }
6036 break;
6037 }
6039 // check if we clicked over a lane
6041 // Handle edge click
6043 }
6044 // process click
6045 processClick(eventData);
6046 break;
6047 }
6049 // filter additionals (except TAZs) and demands (except routes)
6052 // Handle click
6054 // process click
6055 processClick(eventData);
6056 break;
6057 }
6059 // filter additionals (except stoppingPlaces) and demands
6062 // Handle click
6064 WRITE_WARNING(TL("Control + click to create two stop in the same position"));
6066 updateViewNet();
6067 // save last mouse position
6069 }
6070 // process click
6071 processClick(eventData);
6072 break;
6073 }
6075 // filter additionals (except stoppingPlaces and TAZs)
6077 // special case if we're creating person over walk routes
6080 } else {
6082 }
6083 // Handle click
6085 // process click
6086 processClick(eventData);
6087 break;
6088 }
6090 // filter additionals (except stoppingPlaces and TAZs)
6092 // special case if we're creating person over walk routes
6095 } else {
6097 }
6098 // Handle person plan click
6100 // process click
6101 processClick(eventData);
6102 break;
6103 }
6105 // filter additionals (except stoppingPlaces and TAZs) and demands
6108 // Handle click
6110 // process click
6111 processClick(eventData);
6112 break;
6113 }
6115 // filter additionals (except stoppingPlaces and TAZs) and demands
6118 // Handle container plan click
6120 // process click
6121 processClick(eventData);
6122 break;
6123 }
6124 default: {
6125 // process click
6126 processClick(eventData);
6127 }
6128 }
6129}
6130
6131
6132void
6134 // check moved items
6138 // check if we're creating a rectangle selection or we want only to select a lane
6141 }
6142 // finish selection
6144 } else {
6145 // finish moving of single elements
6147 }
6148}
6149
6150
6151void
6152GNEViewNet::processMoveMouseDemand(const bool mouseLeftButtonPressed) {
6154 // update selection corner of selecting area
6156 } else {
6157 // move single elements
6158 myMoveSingleElement.moveSingleElement(mouseLeftButtonPressed);
6159 }
6160}
6161
6162
6163void
6165 // get AC
6167 // decide what to do based on mode
6168 switch (myEditModes.dataEditMode) {
6170 // filter locked elements
6172 // process left click in Inspector Frame
6173 if (AC && AC->getTagProperty().getTag() == SUMO_TAG_TAZ) {
6175 } else {
6177 }
6178 // process click
6179 processClick(eventData);
6180 break;
6181 }
6183 // check conditions
6184 if (AC) {
6185 // check if we are deleting a selection or an single attribute carrier
6186 if (AC->isAttributeCarrierSelected()) {
6187 if (!AC->getGUIGlObject()->isGLObjectLocked()) {
6189 }
6190 } else {
6192 }
6193 } else {
6194 // process click
6195 processClick(eventData);
6196 }
6197 break;
6198 }
6200 // filter locked elements
6202 // avoid to select if control key is pressed
6204 // check if a rect for selecting is being created
6206 // begin rectangle selection
6209 // process click
6210 processClick(eventData);
6211 }
6212 } else {
6213 // process click
6214 processClick(eventData);
6215 }
6216 break;
6218 // avoid create edgeData if control key is pressed
6221 updateViewNet();
6222 }
6223 }
6224 // process click
6225 processClick(eventData);
6226 break;
6228 // avoid create edgeData if control key is pressed
6231 updateViewNet();
6232 }
6233 }
6234 // process click
6235 processClick(eventData);
6236 break;
6238 // avoid create TAZData if control key is pressed
6241 updateViewNet();
6242 }
6243 }
6244 // process click
6245 processClick(eventData);
6246 break;
6248 // avoid create TAZData if control key is pressed
6250 //
6251 }
6252 // process click
6253 processClick(eventData);
6254 break;
6255 default: {
6256 // process click
6257 processClick(eventData);
6258 }
6259 }
6260}
6261
6262
6263void
6265 // check moved items
6269 // check if we're creating a rectangle selection or we want only to select a lane
6272 }
6273 // finish selection
6275 } else {
6276 // finish moving of single elements
6278 }
6279}
6280
6281
6282void
6283GNEViewNet::processMoveMouseData(const bool mouseLeftButtonPressed) {
6285 // update selection corner of selecting area
6287 } else {
6288 // move single elements
6289 myMoveSingleElement.moveSingleElement(mouseLeftButtonPressed);
6290 }
6291}
6292
6293
6294/****************************************************************************/
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
bool overlaps2D(const Boundary &b) const
return true if at least one point of the given boundary is in boundary(only X-Y)
Definition Boundary.cpp:243
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:2435
NBEdge * getNBEdge() const
returns the internal NBEdge
Definition GNEEdge.cpp:779
void smoothElevation(GNEUndoList *undoList)
smooth elevation with regard to adjoining edges
Definition GNEEdge.cpp:2447
const std::vector< GNELane * > & getLanes() const
returns a reference to the lane vector
Definition GNEEdge.cpp:1116
std::vector< GNEEdge * > getOppositeEdges() const
get opposite edges
Definition GNEEdge.cpp:713
void copyTemplate(const GNEEdgeTemplate *edgeTemplate, GNEUndoList *undoList)
copy edge attributes from edgetemplate
Definition GNEEdge.cpp:1053
void editEndpoint(Position pos, GNEUndoList *undoList)
makes pos the new geometry endpoint at the appropriate end, or remove current existent endpoint
Definition GNEEdge.cpp:801
Position getSplitPos(const Position &clickPos)
Definition GNEEdge.cpp:785
void straightenElevation(GNEUndoList *undoList)
interpolate z values linear between junctions
Definition GNEEdge.cpp:2352
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
Definition GNEEdge.cpp:1249
void resetEndpoint(const Position &pos, GNEUndoList *undoList)
restores the endpoint to the junction position at the appropriate end
Definition GNEEdge.cpp:853
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
void inspectMultisection(const std::vector< GNEAttributeCarrier * > &ACs)
Inspect the given multi-selection.
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:622
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
Definition GNELane.cpp:753
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
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.
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
const std::map< SumoXMLTag, std::map< const GUIGlObject *, GNEGenericData * > > & getGenericDatas() const
get all generic datas
const std::map< const GUIGlObject *, GNELane * > & getLanes() const
get lanes
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
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.
const std::map< SumoXMLTag, std::map< const GUIGlObject *, GNEDemandElement * > > & getDemandElements() const
get demand elements
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:423
void deleteLane(GNELane *lane, GNEUndoList *undoList, bool recomputeConnections)
removes lane
Definition GNENet.cpp:590
void deleteCrossing(GNECrossing *crossing, GNEUndoList *undoList)
remove crossing
Definition GNENet.cpp:646
SUMORTree & getGrid()
Returns the RTree used for visualisation speed-up.
Definition GNENet.cpp:155
void deleteAdditional(GNEAdditional *additional, GNEUndoList *undoList)
remove additional
Definition GNENet.cpp:664
void computeAndUpdate(OptionsCont &neteditOptions, bool volatileOptions)
recompute the network and update lane geometries
Definition GNENet.cpp:2880
void reverseEdge(GNEEdge *edge, GNEUndoList *undoList)
reverse edge
Definition GNENet.cpp:1057
NBTrafficLightLogicCont & getTLLogicCont()
returns the tllcont of the underlying netbuilder
Definition GNENet.cpp:2153
bool restrictLane(SUMOVehicleClass vclass, GNELane *lane, GNEUndoList *undoList)
transform lane to restricted lane
Definition GNENet.cpp:796
void deleteDemandElement(GNEDemandElement *demandElement, GNEUndoList *undoList)
remove demand element
Definition GNENet.cpp:685
void duplicateLane(GNELane *lane, GNEUndoList *undoList, bool recomputeConnections)
duplicates lane
Definition GNENet.cpp:780
void deleteDataInterval(GNEDataInterval *dataInterval, GNEUndoList *undoList)
remove data interval
Definition GNENet.cpp:728
void deleteConnection(GNEConnection *connection, GNEUndoList *undoList)
remove connection
Definition GNENet.cpp:631
GNEPathManager * getDemandPathManager()
get demand path manager
Definition GNENet.cpp:142
void resetJunctionConnections(GNEJunction *junction, GNEUndoList *undoList)
reset junction's connections
Definition GNENet.cpp:2077
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
Definition GNENet.cpp:189
void deleteGenericData(GNEGenericData *genericData, GNEUndoList *undoList)
remove generic data
Definition GNENet.cpp:741
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:916
GNENetHelper::AttributeCarriers * getAttributeCarriers() const
get all attribute carriers used in this net
Definition GNENet.cpp:125
GNEEdge * addReversedEdge(GNEEdge *edge, const bool disconnected, GNEUndoList *undoList)
add reversed edge
Definition GNENet.cpp:1070
void splitEdgesBidi(GNEEdge *edge, GNEEdge *oppositeEdge, const Position &pos, GNEUndoList *undoList)
split all edges at position by inserting one new junction
Definition GNENet.cpp:1033
bool removeRestrictedLane(SUMOVehicleClass vclass, GNEEdge *edge, GNEUndoList *undoList)
remove restricted lane
Definition GNENet.cpp:902
void mergeJunctions(GNEJunction *moved, GNEJunction *target, GNEUndoList *undoList)
merge the given junctions edges between the given junctions will be deleted
Definition GNENet.cpp:1108
bool addRestrictedLane(SUMOVehicleClass vclass, GNEEdge *edge, int index, GNEUndoList *undoList)
add restricted lane to edge
Definition GNENet.cpp:849
bool addGreenVergeLane(GNEEdge *edge, int index, GNEUndoList *undoList)
add restricted lane to edge
Definition GNENet.cpp:885
void deleteDataSet(GNEDataSet *dataSet, GNEUndoList *undoList)
remove data set
Definition GNENet.cpp:715
GNEPathManager * getNetworkPathManager()
get network path manager
Definition GNENet.cpp:137
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:1981
void selectRoundabout(GNEJunction *junction, GNEUndoList *undoList)
select all roundabout edges and junctions for the current roundabout
Definition GNENet.cpp:1141
void replaceJunctionByGeometry(GNEJunction *junction, GNEUndoList *undoList)
replace the selected junction by geometry node(s) and merge the edges
Definition GNENet.cpp:1927
void createRoundabout(GNEJunction *junction, GNEUndoList *undoList)
transform the given junction into a roundabout
Definition GNENet.cpp:1160
void requireRecompute()
inform the net about the need for recomputation
Definition GNENet.cpp:1533
void initGNEConnections()
initialize GNEConnections
Definition GNENet.cpp:2867
void deleteJunction(GNEJunction *junction, GNEUndoList *undoList)
removes junction and all incident edges
Definition GNENet.cpp:377
NBEdgeCont & getEdgeCont()
returns the NBEdgeCont of the underlying netbuilder
Definition GNENet.cpp:2159
GNEViewNet * getViewNet() const
get view net
Definition GNENet.cpp:2147
void clearJunctionConnections(GNEJunction *junction, GNEUndoList *undoList)
clear junction's connections
Definition GNENet.cpp:2065
void computeDemandElements(GNEApplicationWindow *window)
compute demand elements param[in] window The window to inform about delay
Definition GNENet.cpp:1482
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 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 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 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 attribute carrier 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:740
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
void deleteNetworkAttributeCarriers(const std::vector< GNEAttributeCarrier * > ACs)
delete given network attribute carriers
long onCmdSetFirstGeometryPoint(FXObject *, FXSelector, void *)
set as first geometry point the closes geometry point
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:678
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:764
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:659
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
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:662
GNEDemandElement * getLastCreatedRoute() const
get last created route
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:737
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:681
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:773
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:761
GNEViewNetHelper::MouseButtonKeyPressed myMouseButtonKeyPressed
variable used to save key status after certain events
Definition GNEViewNet.h:670
void recalculateBoundaries()
recalculate boundaries
GNEViewNetHelper::IntervalBar myIntervalBar
variable used to save IntervalBar
Definition GNEViewNet.h:706
GNEViewParent * myViewParent
view parent
Definition GNEViewNet.h:746
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:698
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:752
bool autoSelectNodes()
whether to autoselect nodes or to lanes
void drawTemporalRoundabout() const
draw temporal roundabout
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:755
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:695
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:712
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:687
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:734
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
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:731
const GNEViewNetHelper::MoveMultipleElementModul & getMoveMultipleElementValues() const
get move multiple element values
GNEViewNetHelper::LockManager myLockManager
lock manager
Definition GNEViewNet.h:743
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 removeFromAttributeCarrierInspected(const GNEAttributeCarrier *AC)
remove given AC of list of inspected Attribute Carriers
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:684
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:770
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
std::vector< GNEAttributeCarrier * > myInspectedAttributeCarriers
current inspected attribute carrier
Definition GNEViewNet.h:758
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
const std::vector< GNEAttributeCarrier * > & getInspectedAttributeCarriers() const
get inspected attribute carriers
long onKeyPress(FXObject *o, FXSelector sel, void *data)
called when user press a key
long onCmdToggleShowOverlappedRoutes(FXObject *, FXSelector, void *)
toggle hide non inspected demand elements
long onCmdToggleAutoOppositeEdge(FXObject *, FXSelector, void *)
toggle autoOpposite edge
long onCmdSplitEdge(FXObject *, FXSelector, void *)
split edge at cursor position
GNEViewNetHelper::LockManager & getLockManager()
get lock manager
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:715
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:767
bool isAttributeCarrierInspected(const GNEAttributeCarrier *AC) const
check if attribute carrier is being inspected
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 redrawContourElements(const Boundary &drawingBoundary)
redraw elements only for calculating boundary
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 deleteDataAttributeCarriers(const std::vector< GNEAttributeCarrier * > ACs)
delete data attribute carriers
void processLeftButtonReleaseData()
process left button release function in Supermode Data
long onCmdToggleShowAdditionals(FXObject *, FXSelector, void *)
toggle show additionals in super mode data
long onCmdToggleLockPerson(FXObject *, FXSelector, void *)
toggle lock person in super mode demand
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:749
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:701
int myDrawingToggle
drawin toggle (used in drawGLElements to avoid draw elements twice)
Definition GNEViewNet.h:776
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
void deleteDemandAttributeCarriers(const std::vector< GNEAttributeCarrier * > ACs)
delete given demand attribute carriers
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
void setInspectedAttributeCarriers(const std::vector< GNEAttributeCarrier * > ACs)
set inspected attributeCarrier
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:653
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
const std::set< const GUIGlObject * > & getRedrawObjects() const
void addToRedrawObjects(const GUIGlObject *GLObject)
get redrawing objects
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