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-2026 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>
87
89#include "GNENet.h"
90#include "GNEUndoList.h"
91#include "GNEViewNet.h"
92#include "GNEViewParent.h"
93
94// ===========================================================================
95// FOX callback mapping
96// ===========================================================================
97
98FXDEFMAP(GNEViewNet) GNEViewNetMap[] = {
99 // Super Modes
103 // Modes
120 // Network view options
138 // Demand view options
150 // Data view options
159 // Select elements
160 FXMAPFUNC(SEL_COMMAND, MID_ADDSELECT, GNEViewNet::onCmdAddSelected),
161 FXMAPFUNC(SEL_COMMAND, MID_REMOVESELECT, GNEViewNet::onCmdRemoveSelected),
164 // Junctions
177 FXMAPFUNC(SEL_COMMAND, MID_GNE_JUNCTION_ADDTLS, GNEViewNet::onCmdAddTLS),
179 // Connections
182 // Crossings
184 // WalkingArea
186 // Edges
187 FXMAPFUNC(SEL_COMMAND, MID_GNE_EDGE_SPLIT, GNEViewNet::onCmdSplitEdge),
189 FXMAPFUNC(SEL_COMMAND, MID_GNE_EDGE_REVERSE, GNEViewNet::onCmdReverseEdge),
195 FXMAPFUNC(SEL_COMMAND, MID_GNE_EDGE_SMOOTH, GNEViewNet::onCmdSmoothEdges),
201 // Lanes
220 // Additionals
222 // Polygons
225 FXMAPFUNC(SEL_COMMAND, MID_GNE_POLYGON_OPEN, GNEViewNet::onCmdOpenPolygon),
230 // edit custom shapes
239 // POIs
240 FXMAPFUNC(SEL_COMMAND, MID_GNE_POI_ATTACH, GNEViewNet::onCmdAttachPOI),
241 FXMAPFUNC(SEL_COMMAND, MID_GNE_POI_RELEASE, GNEViewNet::onCmdReleasePOI),
244 // Demand elements
245 FXMAPFUNC(SEL_COMMAND, MID_GNE_REVERSE, GNEViewNet::onCmdReverse),
246 FXMAPFUNC(SEL_COMMAND, MID_GNE_ADDREVERSE, GNEViewNet::onCmdAddReverse),
247 // Geometry Points
250 // toolbar views
253 // IntervalBar
260};
261
262// Object implementation
263FXIMPLEMENT(GNEViewNet, GUISUMOAbstractView, GNEViewNetMap, ARRAYNUMBER(GNEViewNetMap))
264
265
266// ===========================================================================
267// member method definitions
268// ===========================================================================
269#ifdef _MSC_VER
270#pragma warning(push)
271#pragma warning(disable: 4355) // mask warning about "this" in initializers
272#endif
273GNEViewNet::GNEViewNet(FXComposite* tmpParent, FXComposite* actualParent, GUIMainWindow& app,
274 GNEViewParent* viewParent, GNENet* net, GNEUndoList* undoList,
275 FXGLVisual* glVis, FXGLCanvas* share) :
276 GUISUMOAbstractView(tmpParent, app, viewParent, net->getGrid(), glVis, share),
277 myViewObjectsSelector(this),
278 myEditModes(this),
279 myTestingMode(this),
280 myCommonCheckableButtons(this),
281 myNetworkCheckableButtons(this),
282 myDemandCheckableButtons(this),
283 myDataCheckableButtons(this),
284 myNetworkViewOptions(this),
285 myDemandViewOptions(this),
286 myDataViewOptions(this),
287 myIntervalBar(this),
288 myMoveSingleElement(this),
289 myMoveMultipleElements(this),
290 myVehicleOptions(this),
291 myVehicleTypeOptions(this),
292 mySaveElements(this),
293 myTimeFormat(this),
294 mySelectingArea(this),
295 myEditNetworkElementShapes(this),
296 myLockManager(this),
297 myViewParent(viewParent),
298 myNet(net),
299 myUndoList(undoList) {
300 // view must be the final member of actualParent
301 reparent(actualParent);
302 // Build edit modes
304 // update all edge and ngeometries
305 for (const auto& edge : net->getAttributeCarriers()->getEdges()) {
306 edge.second->updateCenteringBoundary(true);
307 edge.second->updateGeometry();
308 }
309 // set drag delay
310 ((GUIDanielPerspectiveChanger*)myChanger)->setDragDelay(100000000); // 100 milliseconds
311 // Reset textures
313 // init testing mode
315 // update grid flags
318 // update junction shape flags
319 const bool hide = !myVisualizationSettings->drawJunctionShape;
323 update();
324}
325#ifdef _MSC_VER
326#pragma warning(pop)
327#endif
328
329
332
333
334void
336 if (myNet && makeCurrent()) {
337 // declare boundary
338 const Boundary maxBoundary(1000000000.0, 1000000000.0, -1000000000.0, -1000000000.0);
339 // get all objects in boundary
340 const std::vector<GUIGlID> GLIDs = getObjectsInBoundary(maxBoundary);
341 // finish make OpenGL context current
342 makeNonCurrent();
343 // declare set
344 std::set<GNEAttributeCarrier*> ACs;
345 // iterate over GUIGlIDs
346 for (const auto& GLId : GLIDs) {
348 // Make sure that object exists
349 if (AC && AC->getTagProperty()->isPlacedInRTree()) {
350 ACs.insert(AC);
351 }
352 }
353 // interate over ACs
354 for (const auto& AC : ACs) {
355 // remove object and insert again with exaggeration
356 myNet->getGrid().removeAdditionalGLObject(AC->getGUIGlObject());
357 myNet->getGrid().addAdditionalGLObject(AC->getGUIGlObject(), AC->getGUIGlObject()->getExaggeration(*myVisualizationSettings));
358 }
359 }
360}
361
362
363void
365
366
371 } else {
372 return 0;
373 }
374}
375
376
377void
379 // build coloring tools
380 {
381 for (auto it_names : gSchemeStorage.getNames()) {
382 v->getColoringSchemesCombo()->appendIconItem(it_names.c_str());
383 if (it_names == myVisualizationSettings->name) {
385 }
386 }
387 }
388 // for junctions
390 std::string("\t") + TL("Locate Junctions") + std::string("\t") + TL("Locate a junction within the network. (Shift+J)"),
392 // for edges
394 std::string("\t") + TL("Locate Edges") + std::string("\t") + TL("Locate an edge within the network. (Shift+E)"),
396 // for walkingAreas
398 std::string("\t") + TL("Locate WalkingAreas") + std::string("\t") + TL("Locate a walkingArea within the network. (Shift+W)"),
400 // for vehicles
402 std::string("\t") + TL("Locate Vehicles") + std::string("\t") + TL("Locate a vehicle within the network. (Shift+V)"),
404 // for person
406 std::string("\t") + TL("Locate Persons") + std::string("\t") + TL("Locate a person within the network. (Shift+P)"),
408 // for container
410 std::string("\t") + TL("Locate Containers") + std::string("\t") + TL("Locate a container within the network. (Shift+C)"),
412 // for routes
414 std::string("\t") + TL("Locate Route") + std::string("\t") + TL("Locate a route within the network. (Shift+R)"),
416 // for routes
418 std::string("\t") + TL("Locate Stops") + std::string("\t") + TL("Locate a stop within the network. (Shift+S)"),
420 // for persons (currently unused)
421 /*
422 new MFXButtonTooltip(v->getLocatorPopup(),
423 std::string("\t") + TL("Locate Vehicle\tLocate a person within the network.",
424 GUIIconSubSys::getIcon(GUIIcon::LOCATEPERSON), &v, MID_LOCATEPERSON,
425 GUIDesignButtonPopup);
426 */
427 // for tls
429 std::string("\t") + TL("Locate TLS") + std::string("\t") + TL("Locate a tls within the network. (Shift+T)"),
431 // for additional stuff
433 std::string("\t") + TL("Locate Additional") + std::string("\t") + TL("Locate an additional structure within the network. (Shift+A)"),
435 // for pois
437 std::string("\t") + TL("Locate PoI") + std::string("\t") + TL("Locate a PoI within the network. (Shift+O)"),
439 // for polygons
441 std::string("\t") + TL("Locate Polygon") + std::string("\t") + TL("Locate a Polygon within the network. (Shift+L)"),
443}
444
445
446void
447GNEViewNet::updateViewNet(const bool ignoreViewUpdater) const {
448 // this call is only used for breakpoints (to check when view is updated)
449 if (ignoreViewUpdater || gViewUpdater.allowUpdate()) {
450 GUISUMOAbstractView::update();
451 }
452}
453
454
455void
459
460
461void
464 // hide data button (and adjust width)
465 myEditModes.dataButton->hide();
466 // check network modes
474 break;
475 default:
476 break;
477 }
478 // check demand modes
479 switch (myEditModes.demandEditMode) {
486 break;
487 default:
488 break;
489 }
490 // go to network mode if we're in data mode
493 } else {
494 // refresh current supermode
496 }
497 } else {
498 // show data button
499 myEditModes.dataButton->show();
500 // refresh current supermode
502 }
503}
504
505
510
511
512void
514 // clear post drawing elements
516 // set selection position in gObjectsInPosition
518 // create an small boundary
519 Boundary positionBoundary;
520 positionBoundary.add(pos);
521 positionBoundary.grow(POSITION_EPS);
522 // push matrix
524 // enable draw for view objects handler (this calculate the contours)
526 // draw all GL elements within the small boundary
527 drawGLElements(positionBoundary);
528 // draw routeDistributions (temporal)
529 for (auto& routeDistribution : myNet->getAttributeCarriers()->getDemandElements().at(SUMO_TAG_ROUTE_DISTRIBUTION)) {
530 routeDistribution.second->drawGL(*myVisualizationSettings);
531 }
532 // swap selected objects (needed after selecting)
534 // check if filter edges that have the mouse over their geometry points
538 }
539 // restore draw for view objects handler (this calculate the contours)
541 // pop matrix
543 // check if update front elements
544 for (const auto& AC : myMarkFrontElements.getACs()) {
545 gViewObjectsHandler.updateFrontObject(AC->getGUIGlObject());
546 }
547 // after draw elements, update objects under cursor
549}
550
551
552void
554 if (shape.size() == 1) {
555 // if our shape has only one ponit, use updateObjectsInPosition
556 updateObjectsInPosition(shape.front());
557 } else if (shape.size() > 1) {
558 // triangulate shape
559 const auto triangles = Triangle::triangulate(shape);
560 // clear post drawing elements
562 // push matrix
564 // enable draw for object under cursor and rectangle selection
567 // draw all GL elements within the boundares formed by triangles
568 for (const auto& triangle : triangles) {
570 drawGLElements(triangle.getBoundary());
571 }
572 // restore draw for object under cursor
575 // pop matrix
577 // check if update front elements
578 for (const auto& AC : myMarkFrontElements.getACs()) {
579 gViewObjectsHandler.updateFrontObject(AC->getGUIGlObject());
580 }
581 // after draw elements, update objects under cursor
583 }
584}
585
586
587void
589 // if we're inspecting an element, add it to redraw path elements
590 for (const auto& AC : myInspectedElements.getACs()) {
591 const auto pathElement = dynamic_cast<const GNEPathElement*>(AC);
592 if (pathElement) {
594 }
595 }
596 // enable draw for view objects handler (this calculate the contours)
598 // push matrix
600 // redraw elements in buffer
604 // pop matrix
606 // disable drawForViewObjectsHandler
608}
609
610
615
616
621
622
623bool
624GNEViewNet::setColorScheme(const std::string& name) {
625 if (!gSchemeStorage.contains(name)) {
626 return false;
627 }
628 if (myGUIDialogViewSettings != nullptr) {
631 }
632 }
635 return true;
636}
637
638
639void
641 // reimplemented from GUISUMOAbstractView due GNEOverlappedInspection
642 ungrab();
643 // make network current
644 if (isEnabled() && myAmInitialised) {
645 // check if we're cliking while alt button is pressed
647 // set clicked popup position
649 // create cursor popup dialog for mark front element
651 // open popup dialog
653 } else if (myViewObjectsSelector.getGLObjects().empty()) {
655 } else {
656 // declare filtered objects
657 std::vector<GUIGlObject*> filteredGLObjects;
658 // get GUIGLObject front
659 GUIGlObject* overlappedElement = nullptr;
660 // we need to check if we're inspecting a overlapping element
663 overlappedElement = myInspectedElements.getFirstAC()->getGUIGlObject();
664 filteredGLObjects.push_back(overlappedElement);
665 }
666 bool connections = false;
667 bool TLS = false;
668 // fill filtered objects
669 if ((myViewObjectsSelector.getGLObjects().size() == 1) && (myViewObjectsSelector.getGLObjects().back()->getType() == GLO_EDGE)) {
670 // special case for edge geometry points (because edges uses the lane pop ups)
671 filteredGLObjects.push_back(myViewObjectsSelector.getGLObjects().back());
672 } else {
673 for (const auto& glObject : myViewObjectsSelector.getGLObjects()) {
674 // always avoid edges
675 if (glObject->getType() == GLO_EDGE) {
676 continue;
677 }
678 if (glObject->getType() == GLO_CONNECTION) {
679 connections = true;
680 }
681 if (glObject->getType() == GLO_TLLOGIC) {
682 TLS = true;
683 }
684 filteredGLObjects.push_back(glObject);
685 }
686 auto it = filteredGLObjects.begin();
687 if (connections) {
688 // filter junctions if there are connections
689 while (it != filteredGLObjects.end()) {
690 if ((*it)->getType() == GLO_JUNCTION) {
691 it = filteredGLObjects.erase(it);
692 } else {
693 it++;
694 }
695 }
696 } else if (TLS) {
697 // filter all elements except TLLogic
698 while (it != filteredGLObjects.end()) {
699 if ((*it)->getType() != GLO_TLLOGIC) {
700 it = filteredGLObjects.erase(it);
701 } else {
702 it++;
703 }
704 }
705 }
706 }
707 // remove duplicated elements using an unordered set
708 auto itDuplicated = filteredGLObjects.begin();
709 std::unordered_set<GUIGlObject*> unorderedSet;
710 for (auto itElement = filteredGLObjects.begin(); itElement != filteredGLObjects.end(); itElement++) {
711 if (unorderedSet.insert(*itElement).second) {
712 *itDuplicated++ = *itElement;
713 }
714 }
715 filteredGLObjects.erase(itDuplicated, filteredGLObjects.end());
716 // open object dialog
717 openObjectDialog(filteredGLObjects);
718 }
719 }
720}
721
722
723void
724GNEViewNet::openDeleteDialogAtCursor(const std::vector<GUIGlObject*>& GLObjects) {
725 if (myPopup) {
726 destroyPopup();
727 }
728 // set clicked popup position
730 // create cursor popup dialog for delete element
732 myCreatedPopup = true;
733 // open popup dialog
735}
736
737
738void
739GNEViewNet::openSelectDialogAtCursor(const std::vector<GUIGlObject*>& GLObjects) {
740 if (myPopup) {
741 destroyPopup();
742 }
743 // set clicked popup position
745 // create cursor popup dialog for select element
747 myCreatedPopup = true;
748 // open popup dialog
750}
751
752
753void
755 // first check if we have to save gui settings in a file (only used for testing purposes)
756 const auto& neteditOptions = OptionsCont::getOptions();
757 if (neteditOptions.getString("gui-testing.setting-output").size() > 0) {
758 try {
759 // open output device
760 OutputDevice& output = OutputDevice::getDevice(neteditOptions.getString("gui-testing.setting-output"));
761 // save view settings
764 // save viewport (zoom, X, Y and Z)
770 output.closeTag();
771 output.closeTag();
772 // close output device
773 output.close();
774 } catch (...) {
775 WRITE_ERROR(TL("GUI-Settings cannot be saved in ") + neteditOptions.getString("gui-testing.setting-output"));
776 }
777 }
778}
779
780
783 return myEditModes;
784}
785
786
789 return myTestingMode;
790}
791
792
797
798
803
804
809
810
815
816
821
822
823void
826 assert(!scheme.isFixed());
827 double minValue = std::numeric_limits<double>::infinity();
828 double maxValue = -std::numeric_limits<double>::infinity();
829 // retrieve range
830 bool hasMissingData = false;
831 if (objectType == GLO_LANE) {
832 // XXX (see #3409) multi-colors are not currently handled. this is a quick hack
833 if (active == 9) {
834 active = 8; // segment height, fall back to start height
835 } else if (active == 11) {
836 active = 10; // segment incline, fall back to total incline
837 }
838 for (const auto& lane : myNet->getAttributeCarriers()->getLanes()) {
839 const double val = lane.second->getColorValue(s, active);
840 if (val == s.MISSING_DATA) {
841 hasMissingData = true;
842 continue;
843 }
844 minValue = MIN2(minValue, val);
845 maxValue = MAX2(maxValue, val);
846 }
847 } else if (objectType == GLO_VEHICLE) {
848 for (const auto& tagMap : myNet->getAttributeCarriers()->getDemandElements()) {
849 for (const auto& objItem : tagMap.second) {
850 const double val = objItem.first->getColorValue(s, active);
851 if (val == s.MISSING_DATA) {
852 hasMissingData = true;
853 continue;
854 }
855 minValue = MIN2(minValue, val);
856 maxValue = MAX2(maxValue, val);
857 }
858 }
859 } else if (objectType == GLO_JUNCTION) {
860 if (active == 3) {
861 for (const auto& junction : myNet->getAttributeCarriers()->getJunctions()) {
862 minValue = MIN2(minValue, junction.second->getPositionInView().z());
863 maxValue = MAX2(maxValue, junction.second->getPositionInView().z());
864 }
865 }
866 } else if (objectType == GLO_TAZRELDATA) {
867 if (active == 4) {
868 for (const auto& genericData : myNet->getAttributeCarriers()->getGenericDatas().at(SUMO_TAG_TAZREL)) {
869 const double value = genericData.second->getColorValue(s, active);
870 if (value == s.MISSING_DATA) {
871 continue;
872 }
873 minValue = MIN2(minValue, value);
874 maxValue = MAX2(maxValue, value);
875 }
876 }
877 }
879 scheme.clear();
880 // add threshold for every distinct value
881 std::set<SVCPermissions> codes;
882 for (const auto& lane : myNet->getAttributeCarriers()->getLanes()) {
883 codes.insert(lane.second->getParentEdge()->getNBEdge()->getPermissions(lane.second->getIndex()));
884 }
885 int step = MAX2(1, 360 / (int)codes.size());
886 int hue = 0;
887 for (SVCPermissions p : codes) {
888 scheme.addColor(RGBColor::fromHSV(hue, 1, 1), (double)p);
889 hue = (hue + step) % 360;
890 }
891 return;
892 }
893 buildMinMaxRainbow(s, scheme, rs, minValue, maxValue, hasMissingData);
894}
895
896
897void
898GNEViewNet::setStatusBarText(const std::string& text) {
899 myApp->setStatusBarText(text);
900}
901
902
903bool
906 return false;
907 } else {
909 }
910}
911
912
913void
914GNEViewNet::setSelectorFrameScale(double selectionScale) {
916}
917
918
919bool
923
924
925bool
930
931
932bool
933GNEViewNet::askMergeJunctions(const GNEJunction* movedJunction, const GNEJunction* targetJunction, bool& alreadyAsked) {
934 if (alreadyAsked) {
935 return false;
937 return true;
938 } else {
939 alreadyAsked = true;
940 // open question box
941 const std::string header = TL("Confirm Junction Merger");
942 const std::string body = TLF("Do you wish to merge junctions '%' and '%'?\n('%' will be eliminated and its roads added to '%')",
943 movedJunction->getMicrosimID(),
944 targetJunction->getMicrosimID(),
945 movedJunction->getMicrosimID(),
946 targetJunction->getMicrosimID());
948 GNEDialog::Buttons::YES_NO, header, body);
949 // continue depending of result
950 if (questionDialog.getResult() == GNEDialog::Result::ACCEPT) {
951 return true;
952 } else {
953 return false;
954 }
955 }
956}
957
958
959bool
960GNEViewNet::aksChangeSupermode(const std::string& operation, Supermode expectedSupermode) {
961 // first check if ignore option is enabled
962 if (OptionsCont::getOptions().getBool("ignore-supermode-question")) {
963 return true;
964 }
965 std::string body;
966 if (expectedSupermode == Supermode::NETWORK) {
967 body = TLF("% requires switch to network mode. Continue?", operation);
968 } else if (expectedSupermode == Supermode::DEMAND) {
969 body = TLF("% requires switch to demand mode. Continue?", operation);
970 } else if (expectedSupermode == Supermode::DATA) {
971 body = TLF("% requires switch to data mode. Continue?", operation);
972 } else {
973 throw ProcessError("invalid expected supermode");
974 }
975 // open question dialog
977 GNEDialog::Buttons::YES_NO, TL("Confirm switch mode"), body);
978 // continue depending of result
979 if (questionDialog.getResult() == GNEDialog::Result::ACCEPT) {
980 myEditModes.setSupermode(expectedSupermode, true);
981 return true;
982 } else {
983 return false;
984 }
985}
986
987
988bool
990 // separate conditions for code legibly
993 return (TLSMode && selectingDetectors);
994}
995
996
997bool
999 // separate conditions for code legibly
1001 const bool selectingJunctions = myViewParent->getTLSEditorFrame()->getTLSJunction()->isJoiningJunctions();
1002 return (TLSMode && selectingJunctions);
1003}
1004
1005
1010
1011
1016
1017
1018bool
1020 auto GNEApp = myViewParent->getGNEAppWindows();
1021 // Get selected lanes
1022 const auto selectedLanes = myNet->getAttributeCarriers()->getSelectedLanes();
1023 // Declare map of edges and lanes
1024 std::map<GNEEdge*, GNELane*> mapOfEdgesAndLanes;
1025 // Iterate over selected lanes
1026 for (const auto& selectedLane : selectedLanes) {
1027 mapOfEdgesAndLanes[myNet->getAttributeCarriers()->retrieveEdge(selectedLane->getParentEdge()->getID())] = selectedLane;
1028 }
1029 // Throw warning dialog if there hare multiple lanes selected in the same edge
1030 if (mapOfEdgesAndLanes.size() != selectedLanes.size()) {
1031 const std::string header = TL("Multiple lane in the same edge selected");
1032 const std::string bodyA = TL("There are selected lanes that belong to the same edge.");
1033 const std::string bodyB = TLF("Only one lane per edge will be restricted to %.", toString(vclass));
1034 // Show warning dialog
1035 GNEWarningBasicDialog(GNEApp, header, bodyA, bodyB);
1036 }
1037 // If we handeln a set of lanes
1038 if (mapOfEdgesAndLanes.size() > 0) {
1039 // declare counter for number of Sidewalks
1040 int counter = 0;
1041 // iterate over selected lanes
1042 for (const auto& edgeLane : mapOfEdgesAndLanes) {
1043 if (edgeLane.first->hasRestrictedLane(vclass)) {
1044 counter++;
1045 }
1046 }
1047 // if all edges parent own a Sidewalk, stop function
1048 if (counter == (int)mapOfEdgesAndLanes.size()) {
1049 const std::string header = TLF("Set vclass to % for selected lanes", toString(vclass));
1050 const std::string body = TLF("All lanes own already another lane in the same edge with a restriction for %", toString(vclass));
1051 // show information dialog
1052 GNEInformationBasicDialog(GNEApp, header, body);
1053 return 0;
1054 } else {
1055 // Ask confirmation to user
1056 const std::string header = TLF("Set vclass to % for selected lanes", toString(vclass));
1057 const std::string body = TLF("% lanes will be restricted to %. Continue?", toString(mapOfEdgesAndLanes.size() - counter), toString(vclass));
1058 // show question dialog
1059 const GNEQuestionBasicDialog questionDialog(GNEApp, GNEDialog::Buttons::YES_NO, header, body);
1060 // continue depending of result
1061 if (questionDialog.getResult() != GNEDialog::Result::ACCEPT) { //1:yes, 2:no, 4:esc
1062 return 0;
1063 }
1064 }
1065 // begin undo operation
1066 myUndoList->begin(lane, "restrict lanes to " + toString(vclass));
1067 // iterate over selected lanes
1068 for (const auto& edgeLane : mapOfEdgesAndLanes) {
1069 // Transform lane to Sidewalk
1070 myNet->restrictLane(vclass, edgeLane.second, myUndoList);
1071 }
1072 // end undo operation
1073 myUndoList->end();
1074 } else {
1075 // If only have a single lane, start undo/redo operation
1076 myUndoList->begin(lane, TL("restrict lane to ") + toString(vclass));
1077 // Transform lane to Sidewalk
1078 myNet->restrictLane(vclass, lane, myUndoList);
1079 // end undo operation
1080 myUndoList->end();
1081 }
1082 return 1;
1083}
1084
1085
1086bool
1087GNEViewNet::addRestrictedLane(GNELane* lane, SUMOVehicleClass vclass, const bool insertAtFront) {
1088 auto GNEApp = myViewParent->getGNEAppWindows();
1089 // Get selected edges
1090 const auto selectedEdges = myNet->getAttributeCarriers()->getSelectedEdges();
1091 // get selected lanes
1092 const auto selectedLanes = myNet->getAttributeCarriers()->getSelectedLanes();
1093 // Declare set of edges
1094 std::set<GNEEdge*> setOfEdges;
1095 // Fill set of edges with vector of edges
1096 for (const auto& edge : selectedEdges) {
1097 setOfEdges.insert(edge);
1098 }
1099 // iterate over selected lanes
1100 for (const auto& selectedLane : selectedLanes) {
1101 // Insert pointer to edge into set of edges (To avoid duplicates)
1102 setOfEdges.insert(myNet->getAttributeCarriers()->retrieveEdge(selectedLane->getParentEdge()->getID()));
1103 }
1104 // If we handeln a set of edges
1106 // declare counter for number of restrictions
1107 int counter = 0;
1108 // iterate over set of edges
1109 for (const auto& edge : setOfEdges) {
1110 // update counter if edge has already a restricted lane of type "vclass"
1111 if (edge->hasRestrictedLane(vclass)) {
1112 counter++;
1113 }
1114 }
1115 // if all lanes own a Sidewalk, stop function
1116 if (counter == (int)setOfEdges.size()) {
1117 const std::string header = TLF("Add vclass % to selected lanes", toString(vclass));
1118 const std::string body = TLF("All lanes own already another lane in the same edge with a restriction to %.", toString(vclass));
1119 // show information dialog
1120 GNEInformationBasicDialog(GNEApp, header, body);
1121 return 0;
1122 } else {
1123 // Ask confirmation to user
1124 const std::string header = TLF("Add vclass % to selected lanes", toString(vclass));
1125 const std::string body = TLF("% restrictions to % will be added. Continue?", toString(setOfEdges.size() - counter), toString(vclass));
1126 // show question dialog
1127 const GNEQuestionBasicDialog questionDialog(GNEApp, GNEDialog::Buttons::YES_NO, header, body);
1128 // continue depending of result
1129 if (questionDialog.getResult() != GNEDialog::Result::ACCEPT) { //1:yes, 2:no, 4:esc
1130 return 0;
1131 }
1132 }
1133 // begin undo operation
1134 myUndoList->begin(lane, TL("add restrictions for ") + toString(vclass));
1135 // iterate over set of edges
1136 for (const auto& edge : setOfEdges) {
1137 // add restricted lane (guess target)
1138 myNet->addRestrictedLane(vclass, edge, -1, myUndoList);
1139 }
1140 // end undo operation
1141 myUndoList->end();
1142 } else {
1143 // If only have a single lane, start undo/redo operation
1144 myUndoList->begin(lane, TL("add vclass for ") + toString(vclass));
1145 // Add restricted lane
1146 if (vclass == SVC_PEDESTRIAN) {
1147 // always add pedestrian lanes on the right
1148 myNet->addRestrictedLane(vclass, lane->getParentEdge(), 0, myUndoList);
1149 } else if (vclass == SVC_IGNORING) {
1150 if (insertAtFront) {
1152 } else {
1154 }
1155 } else if (lane->getParentEdge()->getChildLanes().size() == 1) {
1156 // guess insertion position if there is only 1 lane
1157 myNet->addRestrictedLane(vclass, lane->getParentEdge(), -1, myUndoList);
1158 } else {
1159 myNet->addRestrictedLane(vclass, lane->getParentEdge(), lane->getIndex(), myUndoList);
1160 }
1161 // end undo/redo operation
1162 myUndoList->end();
1163 }
1164 return 1;
1165}
1166
1167
1168bool
1170 auto GNEApp = myViewParent->getGNEAppWindows();
1171 // Get selected edges
1172 const auto selectedEdges = myNet->getAttributeCarriers()->getSelectedEdges();
1173 // get selected lanes
1174 const auto selectedLanes = myNet->getAttributeCarriers()->getSelectedLanes();
1175 // Declare set of edges
1176 std::set<GNEEdge*> setOfEdges;
1177 // Fill set of edges with vector of edges
1178 for (const auto& edge : selectedEdges) {
1179 setOfEdges.insert(edge);
1180 }
1181 // iterate over selected lanes
1182 for (const auto& selectedLane : selectedLanes) {
1183 // Insert pointer to edge into set of edges (To avoid duplicates)
1184 setOfEdges.insert(myNet->getAttributeCarriers()->retrieveEdge(selectedLane->getParentEdge()->getID()));
1185 }
1186 // If we handeln a set of edges
1187 if (setOfEdges.size() > 0) {
1188 // declare counter for number of restrictions
1189 int counter = 0;
1190 // iterate over set of edges
1191 for (const auto& edge : setOfEdges) {
1192 // update counter if edge has already a restricted lane of type "vclass"
1193 if (edge->hasRestrictedLane(vclass)) {
1194 counter++;
1195 }
1196 }
1197 // if all lanes don't own a Sidewalk, stop function
1198 if (counter == 0) {
1199 const std::string header = TLF("Remove vclass % from selected lanes", toString(vclass));
1200 const std::string body = TLF("The selected lanes and edges don't have a restriction to %.", toString(vclass));
1201 // show information dialog
1202 GNEInformationBasicDialog(GNEApp, header, body);
1203 return 0;
1204 } else {
1205 // Ask confirmation to user
1206 const std::string header = TLF("Remove vclass % from selected lanes", toString(vclass));
1207 const std::string body = TLF("% restrictions to % will be removed. Continue?", toString(setOfEdges.size() - counter), toString(vclass));
1208 // show question dialog
1209 const GNEQuestionBasicDialog questionDialog(GNEApp, GNEDialog::Buttons::YES_NO, header, body);
1210 // continue depending of result
1211 if (questionDialog.getResult() != GNEDialog::Result::ACCEPT) { //1:yes, 2:no, 4:esc
1212 return 0;
1213 }
1214 }
1215 // begin undo operation
1216 myUndoList->begin(lane, "Remove restrictions for " + toString(vclass));
1217 // iterate over set of edges
1218 for (const auto& edge : setOfEdges) {
1219 // add Sidewalk
1220 myNet->removeRestrictedLane(vclass, edge, myUndoList);
1221 }
1222 // end undo operation
1223 myUndoList->end();
1224 } else {
1225 // If only have a single lane, start undo/redo operation
1226 myUndoList->begin(lane, TL("Remove vclass for ") + toString(vclass));
1227 // Remove Sidewalk
1229 // end undo/redo operation
1230 myUndoList->end();
1231 }
1232 return 1;
1233}
1234
1235
1236#ifdef _MSC_VER
1237#pragma warning(push)
1238#pragma warning(disable: 4355) // mask warning about "this" in initializers
1239#endif
1241 myViewObjectsSelector(this),
1242 myEditModes(this),
1243 myTestingMode(this),
1244 myCommonCheckableButtons(this),
1245 myNetworkCheckableButtons(this),
1246 myDemandCheckableButtons(this),
1247 myDataCheckableButtons(this),
1248 myNetworkViewOptions(this),
1249 myDemandViewOptions(this),
1250 myDataViewOptions(this),
1251 myIntervalBar(this),
1252 myMoveSingleElement(this),
1253 myMoveMultipleElements(this),
1254 myVehicleOptions(this),
1255 myVehicleTypeOptions(this),
1256 mySaveElements(this),
1257 myTimeFormat(this),
1258 mySelectingArea(this),
1259 myEditNetworkElementShapes(this),
1260 myLockManager(this) {
1261}
1262#ifdef _MSC_VER
1263#pragma warning(pop)
1264#endif
1265
1266
1267std::vector<std::string>
1269 std::set<std::string> keys;
1270 for (const NBEdge* e : myNet->getEdgeCont().getAllEdges()) {
1271 if (edgeKeys) {
1272 for (const auto& item : e->getParametersMap()) {
1273 keys.insert(item.first);
1274 }
1275 for (const auto& con : e->getConnections()) {
1276 for (const auto& item : con.getParametersMap()) {
1277 keys.insert(item.first);
1278 }
1279 }
1280 } else {
1281 for (const auto& lane : e->getLanes()) {
1282 int i = 0;
1283 for (const auto& item : lane.getParametersMap()) {
1284 keys.insert(item.first);
1285 }
1286 for (const auto& con : e->getConnectionsFromLane(i)) {
1287 for (const auto& item : con.getParametersMap()) {
1288 keys.insert(item.first);
1289 }
1290 }
1291 i++;
1292 }
1293 }
1294 }
1295 return std::vector<std::string>(keys.begin(), keys.end());
1296}
1297
1298
1299std::vector<std::string>
1301 std::set<std::string> keys;
1302 for (const auto& genericData : myNet->getAttributeCarriers()->getGenericDatas().at(GNE_TAG_EDGEREL_SINGLE)) {
1303 for (const auto& parameter : genericData.second->getParameters()->getParametersMap()) {
1304 keys.insert(parameter.first);
1305 }
1306 }
1307 return std::vector<std::string>(keys.begin(), keys.end());
1308}
1309
1310
1311std::vector<std::string>
1313 std::set<std::string> keys;
1314 for (const auto& genericData : myNet->getAttributeCarriers()->getGenericDatas().at(SUMO_TAG_TAZREL)) {
1315 for (const auto& parameter : genericData.second->getParameters()->getParametersMap()) {
1316 keys.insert(parameter.first);
1317 }
1318 }
1319 for (const auto& genericData : myNet->getAttributeCarriers()->getGenericDatas().at(SUMO_TAG_EDGEREL)) {
1320 for (const auto& parameter : genericData.second->getParameters()->getParametersMap()) {
1321 keys.insert(parameter.first);
1322 }
1323 }
1324 return std::vector<std::string>(keys.begin(), keys.end());
1325}
1326
1327
1328std::vector<std::string>
1332
1333
1334bool
1338 return true;
1339 } else {
1340 return false;
1341 }
1342}
1343
1344
1345int
1349
1350
1351int
1352GNEViewNet::doPaintGL(int mode, const Boundary& drawingBoundary) {
1353 // set lefthand and laneIcons
1356 // first step: update objects under cursor
1358 // second step: redraw contour of path elements (needed if we're inspecting a path element like a route or trip)
1360 // set render modes
1361 glRenderMode(mode);
1362 glMatrixMode(GL_MODELVIEW);
1364 glDisable(GL_TEXTURE_2D);
1365 glDisable(GL_ALPHA_TEST);
1366 glEnable(GL_BLEND);
1367 glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
1368 glEnable(GL_DEPTH_TEST);
1369 // visualize rectangular selection
1371 // draw decals
1372 drawDecals();
1373 // draw grid (and update grid button)
1374 drawGrid();
1375 // update show connections
1377 // draw temporal junction
1379 // draw temporal drawing shape
1381 // draw testing elements
1383 // draw temporal E2 multilane detectors
1385 // draw temporal overhead wires
1387 // draw temporal trip/flow route
1389 // draw temporal person plan route
1392 // draw temporal container plan route
1395 // draw temporal route
1397 // draw temporal edgeRelPath
1399 // check menu checks of supermode demand
1401 // enable or disable menuCheckShowAllPersonPlans depending of there is a locked person
1404 } else {
1406 }
1407 }
1408 // clear pathDraw
1412 // update ignore hide by zoom
1414 // draw network (boundary
1416 // draw all GL elements
1417 int hits = drawGLElements(drawingBoundary);
1418 // draw routeDistributions (temporal)
1419 for (auto& routeDistribution : myNet->getAttributeCarriers()->getDemandElements().at(SUMO_TAG_ROUTE_DISTRIBUTION)) {
1420 routeDistribution.second->drawGL(*myVisualizationSettings);
1421 }
1422 // after drawing all elements, update list of merged junctions
1424 // draw temporal split junction
1426 // draw temporal roundabout
1428 // draw temporal lines between E1 detectors and junctions in TLS Mode
1430 // draw temporal lines between junctions in TLS Mode
1432 // draw netedit attributes references
1434 // draw test circle
1436 // pop draw matrix
1438 // update interval bar
1440 // check if recopute boundaries (Deactivated, continue after 1.14 release)
1441 /*
1442 if (gObjectsInPosition.recomputeBoundaries != GLO_NETWORK) {
1443 myNet->getGrid().updateBoundaries(gObjectsInPosition.recomputeBoundaries);
1444 }
1445 */
1446 return hits;
1447}
1448
1449
1450long
1451GNEViewNet::onLeftBtnPress(FXObject* obj, FXSelector, void* eventData) {
1452 // check if we're in test mode
1454 // set focus in view net
1455 setFocus();
1456 // update MouseButtonKeyPressed
1458 // process left button press function depending of supermode
1463 } else if (myEditModes.isCurrentSupermodeData()) {
1464 processLeftButtonPressData(eventData);
1465 }
1466 // update cursor
1467 updateCursor();
1468 // update view
1469 updateViewNet();
1470 return 1;
1471 } else {
1472 return 0;
1473 }
1474}
1475
1476
1477long
1478GNEViewNet::onLeftBtnRelease(FXObject* obj, FXSelector sel, void* eventData) {
1479 // check if we're in test mode
1481 // avoid closing Popup dialog in Linux
1482 if (myCreatedPopup) {
1483 myCreatedPopup = false;
1484 return 1;
1485 }
1486 // process parent function
1487 GUISUMOAbstractView::onLeftBtnRelease(obj, sel, eventData);
1488 // update MouseButtonKeyPressed
1490 // process left button release function depending of supermode
1495 } else if (myEditModes.isCurrentSupermodeData()) {
1497 }
1498 // update cursor
1499 updateCursor();
1500 // update view
1501 updateViewNet();
1502 return 1;
1503 } else {
1504 return 0;
1505 }
1506}
1507
1508
1509long
1510GNEViewNet::onMiddleBtnPress(FXObject* obj, FXSelector sel, void* eventData) {
1511 // check if we're in test mode
1513 // process parent function
1514 GUISUMOAbstractView::onMiddleBtnPress(obj, sel, eventData);
1515 // update cursor
1516 updateCursor();
1517 // update view
1518 updateViewNet();
1519 return 1;
1520 } else {
1521 return 0;
1522 }
1523}
1524
1525
1526long
1527GNEViewNet::onMiddleBtnRelease(FXObject* obj, FXSelector sel, void* eventData) {
1528 // check if we're in test mode
1530 // process parent function
1531 GUISUMOAbstractView::onMiddleBtnRelease(obj, sel, eventData);
1532 // update cursor
1533 updateCursor();
1534 // update view
1535 updateViewNet();
1536 return 1;
1537 } else {
1538 return 0;
1539 }
1540}
1541
1542
1543long
1544GNEViewNet::onRightBtnPress(FXObject* obj, FXSelector sel, void* eventData) {
1545 // check if we're in test mode
1547 // update MouseButtonKeyPressed
1549 // update cursor
1550 updateCursor();
1552 // disable right button press during drawing polygon
1553 return 1;
1554 } else {
1555 return GUISUMOAbstractView::onRightBtnPress(obj, sel, eventData);
1556 }
1557 } else {
1558 return 0;
1559 }
1560}
1561
1562
1563long
1564GNEViewNet::onRightBtnRelease(FXObject* obj, FXSelector sel, void* eventData) {
1565 // check if we're in test mode
1567 // update MouseButtonKeyPressed
1569 // update cursor
1570 updateCursor();
1571 // disable right button release during drawing polygon
1573 return 1;
1574 } else {
1575 return GUISUMOAbstractView::onRightBtnRelease(obj, sel, eventData);
1576 }
1577 } else {
1578 return 0;
1579 }
1580}
1581
1582
1583long
1584GNEViewNet::onMouseMove(FXObject* obj, FXSelector sel, void* eventData) {
1585 // check if we're in test mode
1587 // process mouse move in GUISUMOAbstractView
1588 GUISUMOAbstractView::onMouseMove(obj, sel, eventData);
1589 // update MouseButtonKeyPressed
1591 // update cursor
1592 updateCursor();
1593 // process mouse move function depending of supermode
1598 } else if (myEditModes.isCurrentSupermodeData()) {
1600 }
1601 // update view
1602 updateViewNet();
1603 return 1;
1604 } else {
1605 return 0;
1606 }
1607}
1608
1609
1610long
1611GNEViewNet::onKeyPress(FXObject* obj, FXSelector sel, void* eventData) {
1612 // check if we're in test mode
1614 // update MouseButtonKeyPressed
1616 // update cursor
1617 updateCursor();
1618 // continue depending of current edit mode
1620 // update viewNet (for temporal junction)
1621 updateViewNet();
1623 // change "delete last created point" depending of shift key
1626 // change "delete last created point" depending of shift key
1629 updateViewNet();
1630 }
1631 return GUISUMOAbstractView::onKeyPress(obj, sel, eventData);
1632 } else {
1633 return 0;
1634 }
1635}
1636
1637
1638long
1639GNEViewNet::onKeyRelease(FXObject* obj, FXSelector sel, void* eventData) {
1640 // check if we're in test mode
1642 // update MouseButtonKeyPressed
1644 // update cursor
1645 updateCursor();
1646 // continue depending of current edit mode
1648 // update viewNet (for temporal junction)
1649 updateViewNet();
1651 // change "delete last created point" depending of shift key
1654 // change "delete last created point" depending of shift key
1657 updateViewNet();
1658 }
1659 // check if selecting using rectangle has to be disabled
1662 updateViewNet();
1663 }
1664 return GUISUMOAbstractView::onKeyRelease(obj, sel, eventData);
1665 } else {
1666 return 0;
1667 }
1668}
1669
1670
1671void
1672GNEViewNet::abortOperation(bool clearSelection) {
1673 // steal focus from any text fields and place it over view net
1674 setFocus();
1675 // check what supermode is enabled
1677 // abort operation depending of current mode
1679 // abort edge creation in create edge frame
1683 // check if current selection has to be cleaned
1684 if (clearSelection) {
1686 }
1688 // abort changes in Connector Frame
1691 // continue depending of current TLS frame state
1696 } else {
1698 }
1704 // abort current drawing
1708 // abort current drawing
1710 } else if (myViewParent->getTAZFrame()->getCurrentTAZModule()->getTAZ() != nullptr) {
1711 // finish current editing TAZ
1713 }
1717 // clear view selection
1719 // abort path
1722 // abort path
1724 }
1726 // abort operation depending of current mode
1729 // check if current selection has to be cleaned
1730 if (clearSelection) {
1732 }
1745 }
1746 } else if (myEditModes.isCurrentSupermodeData()) {
1747 // abort operation depending of current mode
1750 // check if current selection has to be cleaned
1751 if (clearSelection) {
1753 }
1758 }
1759 }
1760 // abort undo list
1762 // update view
1763 updateViewNet();
1764}
1765
1766
1767void
1769 // delete elements depending of current supermode
1772 setStatusBarText(TL("Cannot delete in this mode"));
1774 // delete inspected elements
1775 myUndoList->begin(GUIIcon::MODEDELETE, TL("delete network inspected elements"));
1778 }
1779 myUndoList->end();
1780 } else {
1781 // get selected ACs
1782 const auto selectedNetworkACs = myNet->getAttributeCarriers()->getSelectedAttributeCarriers(false);
1783 // delete selected elements
1784 if (selectedNetworkACs.size() > 0) {
1785 myUndoList->begin(GUIIcon::MODEDELETE, TL("delete network selection"));
1786 for (const auto selectedAC : selectedNetworkACs) {
1788 }
1789 myUndoList->end();
1790 }
1791 }
1794 // delete inspected elements
1795 myUndoList->begin(GUIIcon::MODEDELETE, TL("delete demand inspected elements"));
1798 }
1799 myUndoList->end();
1800 } else {
1801 // get selected ACs
1802 const auto selectedDemandACs = myNet->getAttributeCarriers()->getSelectedAttributeCarriers(false);
1803 // delete selected elements
1804 if (selectedDemandACs.size() > 0) {
1805 myUndoList->begin(GUIIcon::MODEDELETE, TL("delete demand selection"));
1806 for (const auto selectedAC : selectedDemandACs) {
1807 deleteDemandAttributeCarrier(selectedAC);
1808 }
1809 myUndoList->end();
1810 }
1811 }
1812 } else if (myEditModes.isCurrentSupermodeData()) {
1814 // delete inspected elements
1815 myUndoList->begin(GUIIcon::MODEDELETE, TL("delete data inspected elements"));
1818 }
1819 myUndoList->end();
1820 } else {
1821 // get selected ACs
1822 const auto selectedDataACs = myNet->getAttributeCarriers()->getSelectedAttributeCarriers(false);
1823 // delete selected elements
1824 if (selectedDataACs.size() > 0) {
1825 myUndoList->begin(GUIIcon::MODEDELETE, TL("delete data selection"));
1826 for (const auto selectedAC : selectedDataACs) {
1827 deleteDataAttributeCarrier(selectedAC);
1828 }
1829 myUndoList->end();
1830 }
1831 }
1832 }
1834}
1835
1836
1837void
1839 // check what supermode is enabled
1841 // abort operation depending of current mode
1843 // Accept changes in Connector Frame
1846 // continue depending of current TLS frame state
1853 }
1858 // stop current drawing
1860 } else {
1861 // start drawing
1863 }
1868 // stop current drawing
1870 } else if (myViewParent->getTAZFrame()->getCurrentTAZModule()->getTAZ() == nullptr) {
1871 // start drawing
1874 // save pending changes
1876 }
1878 // create path element
1881 // create path element
1883 }
1888 myViewParent->getVehicleFrame()->getPathCreator()->onCmdCreatePath(nullptr, 0, nullptr);
1890 myViewParent->getPersonFrame()->getPlanCreator()->onCmdCreatePath(nullptr, 0, nullptr);
1897 }
1898 } else if (myEditModes.isCurrentSupermodeData()) {
1903 }
1904 }
1905}
1906
1907
1908void
1910 // check what supermode is enabled
1914 }
1928 }
1929 } else if (myEditModes.isCurrentSupermodeData()) {
1932 }
1933 }
1934}
1935
1936void
1938 // if there is a visible frame, set focus over it. In other case, set focus over ViewNet
1939 if (myCurrentFrame != nullptr) {
1941 } else {
1942 setFocus();
1943 }
1944}
1945
1946
1949 return myViewParent;
1950}
1951
1952
1953GNENet*
1955 return myNet;
1956}
1957
1958
1961 return myUndoList;
1962}
1963
1964
1969
1970
1975
1976
1981
1982
1987
1988
1989bool
1993
1994
1995bool
1996GNEViewNet::checkOverLockedElement(const GUIGlObject* GLObject, const bool isSelected) const {
1997 // check if elemet is blocked
1998 if (myLockManager.isObjectLocked(GLObject->getType(), isSelected)) {
1999 return false;
2000 }
2001 // get front GLObject
2002 const auto glObjectFront = myViewObjectsSelector.getGUIGlObjectFront();
2003 // check if element is under cursor
2004 if (glObjectFront) {
2005 if (glObjectFront == GLObject) {
2006 return true;
2007 } else if (glObjectFront->getType() == GLObject->getType()) {
2008 for (const auto& glObjectUnderCursor : myViewObjectsSelector.getGLObjects()) {
2009 if (glObjectUnderCursor == GLObject) {
2010 return true;
2011 }
2012 }
2013 }
2014 }
2015 return false;
2016}
2017
2018
2023
2024
2025void
2027 myLastCreatedRoute = lastCreatedRoute;
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 junction = myNet->getAttributeCarriers()->retrieveJunction(glObject.object->getMicrosimID(), false);
2037 if (junction) {
2038 return junction;
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 connection = myNet->getAttributeCarriers()->retrieveConnection(glObject.object, false);
2052 if (connection) {
2053 return connection;
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 crossing = myNet->getAttributeCarriers()->retrieveCrossing(glObject.object, false);
2067 if (crossing) {
2068 return crossing;
2069 }
2070 }
2071 }
2072 return nullptr;
2073}
2074
2075
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 walkingArea = myNet->getAttributeCarriers()->retrieveWalkingArea(glObject.object, false);
2082 if (walkingArea) {
2083 return walkingArea;
2084 }
2085 }
2086 }
2087 return nullptr;
2088}
2089
2090
2091GNEEdge*
2093 // get firt lanes
2094 for (const auto& glObjectLayer : gViewObjectsHandler.getSelectedObjects()) {
2095 for (const auto& glObject : glObjectLayer.second) {
2096 auto lane = myNet->getAttributeCarriers()->retrieveLane(glObject.object->getMicrosimID(), false);
2097 if (lane) {
2098 return lane->getParentEdge();
2099 }
2100 }
2101 }
2102 // now try to get edges
2103 for (const auto& glObjectLayer : gViewObjectsHandler.getSelectedObjects()) {
2104 for (const auto& glObject : glObjectLayer.second) {
2105 auto edge = myNet->getAttributeCarriers()->retrieveEdge(glObject.object->getMicrosimID(), false);
2106 if (edge) {
2107 return edge;
2108 }
2109 }
2110 }
2111 return nullptr;
2112}
2113
2114
2115GNELane*
2117 // get first object that can be found in their container
2118 for (const auto& glObjectLayer : gViewObjectsHandler.getSelectedObjects()) {
2119 for (const auto& glObject : glObjectLayer.second) {
2120 auto lane = myNet->getAttributeCarriers()->retrieveLane(glObject.object, false);
2121 if (lane) {
2122 return lane;
2123 }
2124 }
2125 }
2126 return nullptr;
2127}
2128
2129
2132 // get first object that can be found in their container
2133 for (const auto& glObjectLayer : gViewObjectsHandler.getSelectedObjects()) {
2134 for (const auto& glObject : glObjectLayer.second) {
2135 auto additionalElement = myNet->getAttributeCarriers()->retrieveAdditional(glObject.object, false);
2136 if (additionalElement) {
2137 return additionalElement;
2138 }
2139 }
2140 }
2141 return nullptr;
2142}
2143
2144
2147 // get first object that can be found in their container
2148 for (const auto& glObjectLayer : gViewObjectsHandler.getSelectedObjects()) {
2149 for (const auto& glObject : glObjectLayer.second) {
2150 auto demandElement = myNet->getAttributeCarriers()->retrieveDemandElement(glObject.object, false);
2151 if (demandElement) {
2152 return demandElement;
2153 }
2154 }
2155 }
2156 return nullptr;
2157}
2158
2159
2160GNEPoly*
2162 // get first object that can be parsed to poly element
2163 for (const auto& glObjectLayer : gViewObjectsHandler.getSelectedObjects()) {
2164 for (const auto& glObject : glObjectLayer.second) {
2165 auto polygon = dynamic_cast<GNEPoly*>(myNet->getAttributeCarriers()->retrieveAdditional(glObject.object, false));
2166 if (polygon) {
2167 return polygon;
2168 }
2169 }
2170 }
2171 return nullptr;
2172}
2173
2174
2175GNEPOI*
2177 // get first object that can be parsed to POI element
2178 for (const auto& glObjectLayer : gViewObjectsHandler.getSelectedObjects()) {
2179 for (const auto& glObject : glObjectLayer.second) {
2180 auto POI = dynamic_cast<GNEPOI*>(myNet->getAttributeCarriers()->retrieveAdditional(glObject.object, false));
2181 if (POI) {
2182 return POI;
2183 }
2184 }
2185 }
2186 return nullptr;
2187}
2188
2189
2190GNETAZ*
2192 // get first object that can be parsed to TAZ element
2193 for (const auto& glObjectLayer : gViewObjectsHandler.getSelectedObjects()) {
2194 for (const auto& glObject : glObjectLayer.second) {
2195 auto TAZ = dynamic_cast<GNETAZ*>(myNet->getAttributeCarriers()->retrieveAdditional(glObject.object, false));
2196 if (TAZ) {
2197 return TAZ;
2198 }
2199 }
2200 }
2201 return nullptr;
2202}
2203
2204
2207 // get first object that can be parsed to TAZ element
2208 for (const auto& glObjectLayer : gViewObjectsHandler.getSelectedObjects()) {
2209 for (const auto& glObject : glObjectLayer.second) {
2210 if (glObject.object->getType() == GLO_JUNCTION) {
2211 auto junction = myNet->getAttributeCarriers()->retrieveJunction(glObject.object->getMicrosimID());
2212 if (junction->isShapeEdited()) {
2213 return junction;
2214 }
2215 } else if (glObject.object->getType() == GLO_CROSSING) {
2216 auto crossing = myNet->getAttributeCarriers()->retrieveCrossing(glObject.object);
2217 if (crossing->isShapeEdited()) {
2218 return crossing;
2219 }
2220 } else if (glObject.object->getType() == GLO_CONNECTION) {
2221 auto connection = myNet->getAttributeCarriers()->retrieveConnection(glObject.object);
2222 if (connection->isShapeEdited()) {
2223 return connection;
2224 }
2225 }
2226 }
2227 }
2228 return nullptr;
2229}
2230
2231
2232long
2233GNEViewNet::onCmdSetSupermode(FXObject*, FXSelector sel, void*) {
2234 // check what network mode will be set
2235 switch (FXSELID(sel)) {
2237 if (myEditModes.networkButton->shown()) {
2239 }
2240 break;
2242 if (myEditModes.demandButton->shown()) {
2244 }
2245 break;
2247 if (myEditModes.dataButton->shown()) {
2249 }
2250 break;
2251 default:
2252 break;
2253 }
2254 return 1;
2255}
2256
2257
2258long
2259GNEViewNet::onCmdSetMode(FXObject*, FXSelector sel, void*) {
2260 // first filter modes depending of view
2262 // network
2264 switch (FXSELID(sel)) {
2265 // common
2269 // infrastructure
2274 // shapes
2277 break;
2278 default:
2279 return 0;
2280 }
2281 }
2282 // demand
2284 switch (FXSELID(sel)) {
2285 // common
2289 // persons
2292 // routes
2295 // types
2298 break;
2299 default:
2300 return 0;
2301 }
2302 }
2303 // data
2305 // all modes disabled
2306 return 0;
2307 }
2308 }
2309 // continue depending of supermode
2311 // check what network mode will be set
2312 switch (FXSELID(sel)) {
2315 break;
2318 break;
2321 break;
2324 break;
2327 break;
2330 break;
2333 break;
2336 break;
2339 break;
2342 break;
2345 break;
2348 break;
2351 break;
2354 break;
2355 default:
2356 break;
2357 }
2359 // check what demand mode will be set
2360 switch (FXSELID(sel)) {
2363 break;
2366 break;
2369 break;
2372 break;
2375 break;
2378 break;
2381 break;
2384 break;
2387 break;
2390 break;
2393 break;
2396 break;
2399 break;
2402 break;
2403 default:
2404 break;
2405 }
2406 } else if (myEditModes.isCurrentSupermodeData()) {
2407 // check what demand mode will be set
2408 switch (FXSELID(sel)) {
2411 break;
2414 break;
2417 break;
2420 break;
2423 break;
2426 break;
2429 break;
2430 default:
2431 break;
2432 }
2433 }
2434 return 1;
2435}
2436
2437
2438long
2439GNEViewNet::onCmdSplitEdge(FXObject*, FXSelector, void*) {
2441 if (edge != nullptr) {
2443 }
2444 return 1;
2445}
2446
2447
2448long
2449GNEViewNet::onCmdSplitEdgeBidi(FXObject*, FXSelector, void*) {
2451 if (edge != nullptr) {
2452 // obtain reverse edge
2453 const auto oppositeEdges = edge->getOppositeEdges();
2454 // check that reverse edge works
2455 if (oppositeEdges.size() > 0) {
2456 for (const auto& oppositeEdge : oppositeEdges) {
2457 // get reverse inner geometry
2458 const auto reverseGeometry = oppositeEdge->getNBEdge()->getInnerGeometry().reverse();
2459 if (reverseGeometry == edge->getNBEdge()->getInnerGeometry()) {
2460 myNet->splitEdgesBidi(edge, oppositeEdge, edge->getSplitPos(getPopupPosition()), myUndoList);
2461 return 1;
2462 }
2463 }
2464 }
2465 }
2466 return 1;
2467}
2468
2469
2470long
2471GNEViewNet::onCmdReverseEdge(FXObject*, FXSelector, void*) {
2473 if (edge != nullptr) {
2474 if (edge->isAttributeCarrierSelected()) {
2475 myUndoList->begin(edge, TL("Reverse selected edges"));
2476 const auto selectedEdges = myNet->getAttributeCarriers()->getSelectedEdges();
2477 for (const auto& selectedEdge : selectedEdges) {
2478 myNet->reverseEdge(selectedEdge, myUndoList);
2479 }
2480 myUndoList->end();
2481 } else {
2482 myUndoList->begin(edge, TL("Reverse edge"));
2484 myUndoList->end();
2485 }
2486 }
2487 return 1;
2488}
2489
2490
2491long
2492GNEViewNet::onCmdAddReversedEdge(FXObject*, FXSelector, void*) {
2494 if (edge != nullptr) {
2495 if (edge->isAttributeCarrierSelected()) {
2496 myUndoList->begin(edge, TL("Add Reverse edge for selected edges"));
2497 const auto selectedEdges = myNet->getAttributeCarriers()->getSelectedEdges();
2498 for (const auto& selectedEdge : selectedEdges) {
2499 myNet->addReversedEdge(selectedEdge, false, myUndoList);
2500 }
2501 myUndoList->end();
2502 } else {
2503 myUndoList->begin(edge, TL("Add reverse edge"));
2504 myNet->addReversedEdge(edge, false, myUndoList);
2505 myUndoList->end();
2506 }
2507 }
2508 return 1;
2509}
2510
2511
2512long
2515 if (edge != nullptr) {
2516 if (edge->isAttributeCarrierSelected()) {
2517 myUndoList->begin(edge, TL("Add Reverse disconnected edge for selected edges"));
2518 const auto selectedEdges = myNet->getAttributeCarriers()->getSelectedEdges();
2519 for (const auto& selectedEdge : selectedEdges) {
2520 myNet->addReversedEdge(selectedEdge, true, myUndoList);
2521 }
2522 myUndoList->end();
2523 } else {
2524 myUndoList->begin(edge, TL("Add reverse disconnected edge"));
2525 myNet->addReversedEdge(edge, true, myUndoList);
2526 myUndoList->end();
2527 }
2528 }
2529 return 1;
2530}
2531
2532
2533long
2534GNEViewNet::onCmdEditEdgeEndpoint(FXObject*, FXSelector, void*) {
2536 if (edge != nullptr) {
2537 // snap to active grid the Popup position
2539 }
2540 return 1;
2541}
2542
2543
2544long
2545GNEViewNet::onCmdResetEdgeEndpoint(FXObject*, FXSelector, void*) {
2547 if (edge != nullptr) {
2548 // check if edge is selected
2549 if (edge->isAttributeCarrierSelected()) {
2550 // get all selected edges
2551 const auto selectedEdges = myNet->getAttributeCarriers()->getSelectedEdges();
2552 // begin operation
2553 myUndoList->begin(edge, TL("reset geometry points"));
2554 // iterate over selected edges
2555 for (const auto& selectedEdge : selectedEdges) {
2556 // reset both end points
2557 selectedEdge->resetBothEndpoint(myUndoList);
2558 }
2559 // end operation
2560 myUndoList->end();
2561 } else {
2563 }
2564 }
2565 return 1;
2566}
2567
2568
2569long
2570GNEViewNet::onCmdStraightenEdges(FXObject*, FXSelector, void*) {
2572 if (edge != nullptr) {
2573 if (edge->isAttributeCarrierSelected()) {
2574 myUndoList->begin(edge, TL("straighten selected edges"));
2575 const auto selectedEdges = myNet->getAttributeCarriers()->getSelectedEdges();
2576 for (const auto& selectedEdge : selectedEdges) {
2577 selectedEdge->setAttribute(SUMO_ATTR_SHAPE, "", myUndoList);
2578 }
2579 myUndoList->end();
2580 } else {
2581
2582 myUndoList->begin(edge, TL("straighten edge"));
2584 myUndoList->end();
2585 }
2586 }
2587 return 1;
2588}
2589
2590
2591long
2592GNEViewNet::onCmdSmoothEdges(FXObject*, FXSelector, void*) {
2594 if (edge != nullptr) {
2595 if (edge->isAttributeCarrierSelected()) {
2596 myUndoList->begin(edge, TL("smooth selected edges"));
2597 const auto selectedEdges = myNet->getAttributeCarriers()->getSelectedEdges();
2598 for (const auto& selectedEdge : selectedEdges) {
2599 selectedEdge->smooth(myUndoList);
2600 }
2601 myUndoList->end();
2602 } else {
2603 myUndoList->begin(edge, TL("smooth edge"));
2604 edge->smooth(myUndoList);
2605 myUndoList->end();
2606 }
2607 }
2608 return 1;
2609}
2610
2611
2612long
2613GNEViewNet::onCmdStraightenEdgesElevation(FXObject*, FXSelector, void*) {
2615 if (edge != nullptr) {
2616 if (edge->isAttributeCarrierSelected()) {
2617 myUndoList->begin(edge, TL("straighten elevation of selected edges"));
2618 const auto selectedEdges = myNet->getAttributeCarriers()->getSelectedEdges();
2619 for (const auto& selectedEdge : selectedEdges) {
2620 selectedEdge->straightenElevation(myUndoList);
2621 }
2622 myUndoList->end();
2623 } else {
2624 myUndoList->begin(edge, TL("straighten edge elevation"));
2626 myUndoList->end();
2627 }
2628 }
2629 return 1;
2630}
2631
2632
2633long
2634GNEViewNet::onCmdSmoothEdgesElevation(FXObject*, FXSelector, void*) {
2636 if (edge != nullptr) {
2637 if (edge->isAttributeCarrierSelected()) {
2638 myUndoList->begin(edge, TL("smooth elevation of selected edges"));
2639 const auto selectedEdges = myNet->getAttributeCarriers()->getSelectedEdges();
2640 for (const auto& selectedEdge : selectedEdges) {
2641 selectedEdge->smoothElevation(myUndoList);
2642 }
2643 myUndoList->end();
2644 } else {
2645 myUndoList->begin(edge, TL("smooth edge elevation"));
2647 myUndoList->end();
2648 }
2649 }
2650 return 1;
2651}
2652
2653
2654long
2655GNEViewNet::onCmdResetLength(FXObject*, FXSelector, void*) {
2657 if (edge != nullptr) {
2658 if (edge->isAttributeCarrierSelected()) {
2659 myUndoList->begin(edge, TL("reset edge lengths"));
2660 const auto selectedEdges = myNet->getAttributeCarriers()->getSelectedEdges();
2661 for (const auto& selectedEdge : selectedEdges) {
2662 selectedEdge->setAttribute(SUMO_ATTR_LENGTH, "-1", myUndoList);
2663 }
2664 myUndoList->end();
2665 } else {
2667 }
2668 }
2669 return 1;
2670}
2671
2672
2673long
2674GNEViewNet::onCmdEdgeUseAsTemplate(FXObject*, FXSelector, void*) {
2676 if (edge != nullptr) {
2678 }
2679 return 1;
2680}
2681
2682
2683long
2684GNEViewNet::onCmdEgeApplyTemplate(FXObject*, FXSelector, void*) {
2685 GNEEdge* edgeAtPosition = getEdgeAtPopupPosition();
2686 if ((edgeAtPosition != nullptr) && myViewParent->getInspectorFrame()->getTemplateEditor()->getEdgeTemplate()) {
2687 // begin copy template
2688 myUndoList->begin(edgeAtPosition, TL("copy edge template"));
2689 if (edgeAtPosition->isAttributeCarrierSelected()) {
2690 // copy template in all selected edges
2691 for (const auto& edge : myNet->getAttributeCarriers()->getEdges()) {
2692 if (edge.second->isAttributeCarrierSelected()) {
2693 edge.second->copyTemplate(myViewParent->getInspectorFrame()->getTemplateEditor()->getEdgeTemplate(), myUndoList);
2694 }
2695 }
2696 } else {
2697 // copy template
2699 }
2700 // end copy template
2701 myUndoList->end();
2702 }
2703 return 1;
2704}
2705
2706
2707long
2708GNEViewNet::onCmdSimplifyShape(FXObject*, FXSelector, void*) {
2709 // get polygon under mouse
2710 GNEPoly* polygonUnderMouse = getPolygonAtPopupPosition();
2711 // check polygon
2712 if (polygonUnderMouse) {
2713 // check if shape is selected
2714 if (polygonUnderMouse->isAttributeCarrierSelected()) {
2715 // begin undo-list
2716 myNet->getUndoList()->begin(polygonUnderMouse, TL("simplify shapes"));
2717 // get shapes
2718 const auto selectedShapes = myNet->getAttributeCarriers()->getSelectedShapes();
2719 // iterate over shapes
2720 for (const auto& selectedShape : selectedShapes) {
2721 // check if shape is a poly
2722 if ((selectedShape->getTagProperty()->getTag() == SUMO_TAG_POLY) ||
2723 (selectedShape->getTagProperty()->getTag() == GNE_TAG_JPS_WALKABLEAREA) ||
2724 (selectedShape->getTagProperty()->getTag() == GNE_TAG_JPS_OBSTACLE)) {
2725 // simplify shape
2726 dynamic_cast<GNEPoly*>(selectedShape)->simplifyShape();
2727 }
2728 }
2729 // end undo-list
2730 myNet->getUndoList()->end();
2731 } else {
2732 polygonUnderMouse->simplifyShape();
2733 }
2734 }
2735 return 1;
2736}
2737
2738
2739long
2740GNEViewNet::onCmdDeleteGeometryPoint(FXObject*, FXSelector, void*) {
2741 GNEPoly* polygonUnderMouse = getPolygonAtPopupPosition();
2742 if (polygonUnderMouse) {
2743 polygonUnderMouse->deleteGeometryPoint(getPopupPosition());
2744 }
2745 return 1;
2746}
2747
2748
2749long
2750GNEViewNet::onCmdClosePolygon(FXObject*, FXSelector, void*) {
2751 // get polygon under mouse
2752 GNEPoly* polygonUnderMouse = getPolygonAtPopupPosition();
2753 // check polygon
2754 if (polygonUnderMouse) {
2755 // check if shape is selected
2756 if (polygonUnderMouse->isAttributeCarrierSelected()) {
2757 // begin undo-list
2758 myNet->getUndoList()->begin(polygonUnderMouse, TL("close polygon shapes"));
2759 // get selectedshapes
2760 const auto selectedShapes = myNet->getAttributeCarriers()->getSelectedShapes();
2761 // iterate over shapes
2762 for (const auto& selectedShape : selectedShapes) {
2763 // check if shape is a poly
2764 if ((selectedShape->getTagProperty()->getTag() == SUMO_TAG_POLY) ||
2765 (selectedShape->getTagProperty()->getTag() == GNE_TAG_JPS_WALKABLEAREA) ||
2766 (selectedShape->getTagProperty()->getTag() == GNE_TAG_JPS_OBSTACLE)) {
2767 // close polygon
2768 dynamic_cast<GNEPoly*>(selectedShape)->closePolygon();
2769 }
2770 }
2771 // end undo-list
2772 myNet->getUndoList()->end();
2773 } else {
2774 polygonUnderMouse->closePolygon();
2775 }
2776 }
2777 return 1;
2778}
2779
2780
2781long
2782GNEViewNet::onCmdOpenPolygon(FXObject*, FXSelector, void*) {
2783 // get polygon under mouse
2784 GNEPoly* polygonUnderMouse = getPolygonAtPopupPosition();
2785 // check polygon
2786 if (polygonUnderMouse) {
2787 // check if shape is selected
2788 if (polygonUnderMouse->isAttributeCarrierSelected()) {
2789 // begin undo-list
2790 myNet->getUndoList()->begin(polygonUnderMouse, TL("open polygon shapes"));
2791 // get shapes
2792 const auto selectedShapes = myNet->getAttributeCarriers()->getSelectedShapes();
2793 // iterate over shapes
2794 for (const auto& selectedShape : selectedShapes) {
2795 // check if shape is a poly
2796 if ((selectedShape->getTagProperty()->getTag() == SUMO_TAG_POLY) ||
2797 (selectedShape->getTagProperty()->getTag() == GNE_TAG_JPS_WALKABLEAREA) ||
2798 (selectedShape->getTagProperty()->getTag() == GNE_TAG_JPS_OBSTACLE)) {
2799 // open polygon
2800 dynamic_cast<GNEPoly*>(selectedShape)->openPolygon();
2801 }
2802 }
2803 // end undo-list
2804 myNet->getUndoList()->end();
2805 } else {
2806 polygonUnderMouse->openPolygon();
2807 }
2808 }
2809 return 1;
2810}
2811
2812
2813long
2814GNEViewNet::onCmdSelectPolygonElements(FXObject*, FXSelector, void*) {
2815 // get polygon under mouse
2816 GNEPoly* polygonUnderMouse = getPolygonAtPopupPosition();
2817 // check polygon
2818 if (polygonUnderMouse) {
2819 // get all elements under polygon shape
2820 updateObjectsInShape(polygonUnderMouse->getShape());
2821 // declare filtered ACs
2822 std::vector<GNEAttributeCarrier*> ACsUnderPolygon;
2823 ACsUnderPolygon.reserve(myViewObjectsSelector.getAttributeCarriers().size());
2824 // iterate over obtained GUIGlIDs
2825 for (const auto& AC : myViewObjectsSelector.getAttributeCarriers()) {
2826 if ((AC->getTagProperty()->getTag() == SUMO_TAG_EDGE) && checkSelectEdges()) {
2827 ACsUnderPolygon.push_back(AC);
2828 } else if ((AC->getTagProperty()->getTag() == SUMO_TAG_LANE) && !checkSelectEdges()) {
2829 ACsUnderPolygon.push_back(AC);
2830 } else if (!AC->getTagProperty()->isSymbol() && (AC != polygonUnderMouse)) {
2831 ACsUnderPolygon.push_back(AC);
2832 }
2833 }
2834 // continue if there are ACs
2835 if (ACsUnderPolygon.size() > 0) {
2836 // begin undo-list
2837 myNet->getUndoList()->begin(GUIIcon::MODESELECT, TL("select within polygon boundary"));
2838 // iterate over shapes
2839 for (const auto& AC : ACsUnderPolygon) {
2840 AC->setAttribute(GNE_ATTR_SELECTED, "true", myUndoList);
2841 }
2842 // end undo-list
2843 myNet->getUndoList()->end();
2844 }
2845 }
2846 return 1;
2847}
2848
2849
2850long
2851GNEViewNet::onCmdTriangulatePolygon(FXObject*, FXSelector, void*) {
2852// get polygon under mouse
2853 GNEPoly* polygonUnderMouse = getPolygonAtPopupPosition();
2854 // check polygon
2855 if (polygonUnderMouse) {
2856 // declare additional handler
2857 GNEAdditionalHandler additionalHandler(myNet, polygonUnderMouse->getFileBucket(), myViewParent->getGNEAppWindows()->isUndoRedoAllowed());
2858 // triangulate shape
2859 const auto triangulation = Triangle::triangulate(polygonUnderMouse->getShape());
2860 // begin undo-list
2861 myNet->getUndoList()->begin(GUIIcon::POLY, TL("triangulate polygon"));
2862 // create every individual triangle
2863 for (const auto& triangle : triangulation) {
2864 auto basePolygon = polygonUnderMouse->getSumoBaseObject();
2866 basePolygon->addPositionVectorAttribute(SUMO_ATTR_SHAPE, triangle.getShape());
2867 // build shape
2868 additionalHandler.parseSumoBaseObject(basePolygon);
2869 }
2870 // delete original polygon
2871 myNet->deleteAdditional(polygonUnderMouse, myNet->getUndoList());
2872 // end undo-list
2873 myNet->getUndoList()->end();
2874 }
2875 return 1;
2876}
2877
2878
2879long
2880GNEViewNet::onCmdSetFirstGeometryPoint(FXObject*, FXSelector, void*) {
2881 GNEPoly* polygonUnderMouse = getPolygonAtPopupPosition();
2882 if (polygonUnderMouse) {
2883 polygonUnderMouse->changeFirstGeometryPoint(polygonUnderMouse->getVertexIndex(getPopupPosition(), false));
2884 }
2885
2886 return 1;
2887}
2888
2889
2890long
2891GNEViewNet::onCmdSimplifyShapeEdited(FXObject*, FXSelector, void*) {
2892 auto undoList = myNet->getUndoList();
2893 // get shape edited under mouse
2895 if (shapeEdited) {
2896 // simplify edited shape using undo-redo
2897 undoList->begin(shapeEdited, TL("simplify edited shape"));
2898 shapeEdited->simplifyShapeEdited(undoList);
2899 undoList->end();
2900 }
2901 return 1;
2902}
2903
2904
2905long
2906GNEViewNet::onCmdStraightenShapeEdited(FXObject*, FXSelector, void*) {
2907 auto undoList = myNet->getUndoList();
2908 // get shape edited under mouse
2910 if (shapeEdited) {
2911 // simplify edited shape using undo-redo
2912 undoList->begin(shapeEdited, TL("straighten edited shape"));
2913 shapeEdited->straigthenShapeEdited(undoList);
2914 undoList->end();
2915 }
2916 return 1;
2917}
2918
2919
2920long
2921GNEViewNet::onCmdCloseShapeEdited(FXObject*, FXSelector, void*) {
2922 auto undoList = myNet->getUndoList();
2923 // get shape edited under mouse
2925 if (shapeEdited) {
2926 // close edited shape using undo-redo
2927 undoList->begin(shapeEdited, TL("simplify edited shape"));
2928 shapeEdited->closeShapeEdited(undoList);
2929 undoList->end();
2930 }
2931 return 1;
2932}
2933
2934
2935long
2936GNEViewNet::onCmdOpenShapeEdited(FXObject*, FXSelector, void*) {
2937 auto undoList = myNet->getUndoList();
2938 // get shape edited under mouse
2940 if (shapeEdited) {
2941 // open edited shape using undo-redo
2942 undoList->begin(shapeEdited, TL("simplify edited shape"));
2943 shapeEdited->openShapeEdited(undoList);
2944 undoList->end();
2945 }
2946 return 1;
2947}
2948
2949
2950long
2952 auto undoList = myNet->getUndoList();
2953 // get shape edited under mouse
2955 if (shapeEdited) {
2956 // get geometry point index under cursor
2957 const auto geometryPointIndex = shapeEdited->getGeometryPointUnderCursorShapeEdited();
2958 // set first geometry point in edited shape using undo-redo
2959 undoList->begin(shapeEdited, TL("simplify edited shape"));
2960 shapeEdited->setFirstGeometryPointShapeEdited(geometryPointIndex, undoList);
2961 undoList->end();
2962 }
2963 return 1;
2964}
2965
2966
2967long
2969 auto undoList = myNet->getUndoList();
2970 // get shape edited under mouse
2972 if (shapeEdited) {
2973 // get geometry point index under cursor
2974 const auto geometryPointIndex = shapeEdited->getGeometryPointUnderCursorShapeEdited();
2975 // delete geometry point edited shape using undo-redo
2976 undoList->begin(shapeEdited, TL("simplify edited shape"));
2977 shapeEdited->deleteGeometryPointShapeEdited(geometryPointIndex, undoList);
2978 undoList->end();
2979 }
2980 return 1;
2981}
2982
2983
2984long
2985GNEViewNet::onCmdResetShapeEdited(FXObject*, FXSelector, void*) {
2986 auto undoList = myNet->getUndoList();
2987 // get shape edited under mouse
2989 if (shapeEdited) {
2990 // simplify edited shape using undo-redo
2991 undoList->begin(shapeEdited, TL("simplify edited shape"));
2992 shapeEdited->resetShapeEdited(undoList);
2993 undoList->end();
2994 }
2995 return 1;
2996}
2997
2998
2999long
3000GNEViewNet::onCmdFinishShapeEdited(FXObject*, FXSelector, void*) {
3001 // the same behavior as when we press enter
3002 hotkeyEnter();
3003 return 1;
3004}
3005
3006
3007long
3008GNEViewNet::onCmdAttachPOI(FXObject*, FXSelector, void*) {
3009 // obtain POI at popup position
3011 if (POI && (POI->getTagProperty()->getTag() != GNE_TAG_POILANE)) {
3012 // declare additional handle
3013 GNEAdditionalHandler additionalHandler(myNet, POI->getFileBucket(), myViewParent->getGNEAppWindows()->isUndoRedoAllowed());
3014 // obtain lanes around POI boundary
3015 getObjectsInBoundary(POI->getCenteringBoundary());
3016 if (myViewObjectsSelector.getLaneFront() == nullptr) {
3017 WRITE_WARNINGF("No lanes around the % '%' to attach it", toString(SUMO_TAG_POI), POI->getID());
3018 } else {
3019 // obtain nearest lane to POI
3021 double minorPosOverLane = nearestLane->getLaneShape().nearest_offset_to_point2D(POI->getPositionInView());
3022 double minorLateralOffset = nearestLane->getLaneShape().positionAtOffset(minorPosOverLane).distanceTo(POI->getPositionInView());
3023 for (const auto& lane : myViewObjectsSelector.getLanes()) {
3024 double posOverLane = lane->getLaneShape().nearest_offset_to_point2D(POI->getPositionInView());
3025 double lateralOffset = lane->getLaneShape().positionAtOffset(posOverLane).distanceTo(POI->getPositionInView());
3026 if (lateralOffset < minorLateralOffset) {
3027 minorPosOverLane = posOverLane;
3028 minorLateralOffset = lateralOffset;
3029 nearestLane = lane;
3030 }
3031 }
3032 // get sumo base object of POI (And all common attributes)
3033 CommonXMLStructure::SumoBaseObject* POIBaseObject = POI->getSumoBaseObject();
3034 // add specific attributes
3035 POIBaseObject->addStringAttribute(SUMO_ATTR_LANE, nearestLane->getID());
3036 POIBaseObject->addDoubleAttribute(SUMO_ATTR_POSITION, minorPosOverLane);
3037 POIBaseObject->addBoolAttribute(SUMO_ATTR_FRIENDLY_POS, false);
3038 POIBaseObject->addDoubleAttribute(SUMO_ATTR_POSITION_LAT, 0);
3039 // remove POI
3040 myUndoList->begin(POI, TL("attach POI into lane"));
3042 // add new POI use route handler
3043 additionalHandler.parseSumoBaseObject(POIBaseObject);
3044 myUndoList->end();
3045 }
3046 }
3047 return 1;
3048}
3049
3050
3051long
3052GNEViewNet::onCmdReleasePOI(FXObject*, FXSelector, void*) {
3053 // obtain POI at popup position
3055 if (POI && (POI->getTagProperty()->getTag() == GNE_TAG_POILANE)) {
3056 // declare additional handler
3057 GNEAdditionalHandler additionalHandler(myNet, POI->getFileBucket(), myViewParent->getGNEAppWindows()->isUndoRedoAllowed());
3058 // get sumo base object of POI (And all common attributes)
3059 CommonXMLStructure::SumoBaseObject* POIBaseObject = POI->getSumoBaseObject();
3060 // add specific attributes
3061 POIBaseObject->addDoubleAttribute(SUMO_ATTR_X, POI->getPositionInView().x());
3062 POIBaseObject->addDoubleAttribute(SUMO_ATTR_Y, POI->getPositionInView().y());
3063 // remove POI
3064 myUndoList->begin(POI, TL("release POI from lane"));
3066 // add new POI use route handler
3067 additionalHandler.parseSumoBaseObject(POIBaseObject);
3068 myUndoList->end();
3069 }
3070 return 1;
3071}
3072
3073
3074long
3075GNEViewNet::onCmdTransformPOI(FXObject*, FXSelector, void*) {
3076 // obtain POI at popup position
3078 if (POI && (POI->getTagProperty()->getTag() != SUMO_TAG_POI)) {
3079 // declare additional handler
3080 GNEAdditionalHandler additionalHandler(myNet, POI->getFileBucket(), myViewParent->getGNEAppWindows()->isUndoRedoAllowed());
3081 // get sumo base object of POI (And all common attributes)
3082 CommonXMLStructure::SumoBaseObject* POIBaseObject = POI->getSumoBaseObject();
3083 // add specific attributes
3084 POIBaseObject->addDoubleAttribute(SUMO_ATTR_X, POI->getPositionInView().x());
3085 POIBaseObject->addDoubleAttribute(SUMO_ATTR_Y, POI->getPositionInView().y());
3086 // remove POI
3087 myUndoList->begin(POI, TL("transform to POI"));
3089 // add new POI use route handler
3090 additionalHandler.parseSumoBaseObject(POIBaseObject);
3091 myUndoList->end();
3092 }
3093 return 1;
3094}
3095
3096
3097long
3098GNEViewNet::onCmdTransformPOIGEO(FXObject*, FXSelector, void*) {
3099 // obtain POI at popup position
3101 if (POI && (POI->getTagProperty()->getTag() != GNE_TAG_POIGEO)) {
3102 // declare additional handler
3103 GNEAdditionalHandler additionalHandler(myNet, POI->getFileBucket(), myViewParent->getGNEAppWindows()->isUndoRedoAllowed());
3104 // get sumo base object of POI (And all common attributes)
3105 CommonXMLStructure::SumoBaseObject* POIBaseObject = POI->getSumoBaseObject();
3106 // calculate cartesian position
3107 Position GEOPosition = POI->getPositionInView();
3109 POIBaseObject->addDoubleAttribute(SUMO_ATTR_LON, GEOPosition.x());
3110 POIBaseObject->addDoubleAttribute(SUMO_ATTR_LAT, GEOPosition.y());
3111 // remove POI
3112 myUndoList->begin(POI, TL("transform to POI GEO"));
3114 // add new POI use route handler
3115 additionalHandler.parseSumoBaseObject(POIBaseObject);
3116 myUndoList->end();
3117 }
3118 return 1;
3119}
3120
3121
3122long
3123GNEViewNet::onCmdReverse(FXObject*, FXSelector, void*) {
3124 // obtain demand element at popup position
3126 if (demandElement) {
3127 // begin undo list
3128 myUndoList->begin(demandElement, TLF("reverse % '%'", demandElement->getTagStr(), demandElement->getID()));
3129 GNERouteHandler::reverse(demandElement);
3130 myUndoList->end();
3131 }
3132 return 1;
3133}
3134
3135
3136long
3137GNEViewNet::onCmdAddReverse(FXObject*, FXSelector, void*) {
3138 // obtain demand element at popup position
3140 if (demandElement) {
3141 // begin undo list
3142 myUndoList->begin(demandElement, TLF("add reverse '%'", demandElement->getTagStr()));
3143 GNERouteHandler::addReverse(demandElement);
3144 myUndoList->end();
3145 }
3146 return 1;
3147}
3148
3149
3150long
3151GNEViewNet::onCmdSetCustomGeometryPoint(FXObject*, FXSelector, void*) {
3152 // get element at popup position
3156 // check element
3157 if (edge != nullptr) {
3158 // make a copy of edge geometry
3159 auto edgeGeometry = edge->getNBEdge()->getGeometry();
3160 // get index position
3161 const int index = edgeGeometry.indexOfClosest(getPositionInformation(), true);
3162 // edit position using GNEGeometryPointDialog
3163 const GNEGeometryPointDialog geometryPointDialog(myViewParent->getGNEAppWindows(), edgeGeometry[index]);
3164 // now check position
3165 if ((geometryPointDialog.getResult() == GNEDialog::Result::ACCEPT) && (geometryPointDialog.getEditedPosition() != edgeGeometry[index])) {
3166 // update new position
3167 edgeGeometry[index] = geometryPointDialog.getEditedPosition();
3168 // begin undo list
3169 myUndoList->begin(edge, TL("change edge Geometry Point position"));
3170 // continue depending of index
3171 if (index == 0) {
3172 // change shape start
3174 } else if (index == ((int)edgeGeometry.size() - 1)) {
3175 // change shape end
3177 } else {
3178 // remove front and back geometry points
3179 edgeGeometry.pop_front();
3180 edgeGeometry.pop_back();
3181 // change shape
3183 }
3184 // end undo list
3185 myUndoList->end();
3186 }
3187 } else if (poly != nullptr) {
3188 // make a copy of polygon geometry
3189 PositionVector polygonGeometry = poly->getShape();
3190 // get index position
3191 const int index = polygonGeometry.indexOfClosest(getPositionInformation(), true);
3192 // edit position using GNEGeometryPointDialog
3193 const GNEGeometryPointDialog geometryPointDialog(myViewParent->getGNEAppWindows(), polygonGeometry[index]);
3194 // now check position
3195 if ((geometryPointDialog.getResult() == GNEDialog::Result::ACCEPT) && (geometryPointDialog.getEditedPosition() != polygonGeometry[index])) {
3196 // update new position
3197 polygonGeometry[index] = geometryPointDialog.getEditedPosition();
3198 // begin undo list
3199 myUndoList->begin(poly, TL("change polygon Geometry Point position"));
3200 // change shape
3202 // end undo list
3203 myUndoList->end();
3204 }
3205 } else if (TAZ != nullptr) {
3206 // make a copy of TAZ geometry
3207 PositionVector TAZGeometry = TAZ->getAdditionalGeometry().getShape();
3208 // get index position
3209 const int index = TAZGeometry.indexOfClosest(getPositionInformation(), true);
3210 // edit position using GNEGeometryPointDialog
3211 const GNEGeometryPointDialog geometryPointDialog(myViewParent->getGNEAppWindows(), TAZGeometry[index]);
3212 // now check position
3213 if ((geometryPointDialog.getResult() == GNEDialog::Result::ACCEPT) && (geometryPointDialog.getEditedPosition() != TAZGeometry[index])) {
3214 // update new position
3215 TAZGeometry[index] = geometryPointDialog.getEditedPosition();
3216 // begin undo list
3217 myUndoList->begin(TAZ, TL("change TAZ Geometry Point position"));
3218 // change shape
3220 // end undo list
3221 myUndoList->end();
3222 }
3223 }
3224 return 1;
3225}
3226
3227
3228long
3229GNEViewNet::onCmdResetEndPoints(FXObject*, FXSelector, void*) {
3230 // get lane at popup position
3231 GNELane* laneAtPopupPosition = getLaneAtPopupPosition();
3232 // check element
3233 if (laneAtPopupPosition != nullptr) {
3234 // get parent edge
3235 GNEEdge* edge = laneAtPopupPosition->getParentEdge();
3236 // check if edge is selected
3237 if (edge->isAttributeCarrierSelected()) {
3238 // get selected edges
3239 const auto selectedEdges = myNet->getAttributeCarriers()->getSelectedEdges();
3240 // begin undo list
3241 myUndoList->begin(edge, TL("reset end points of selected edges"));
3242 // iterate over edges
3243 for (const auto& selectedEdge : selectedEdges) {
3244 // reset both end points
3245 selectedEdge->setAttribute(GNE_ATTR_SHAPE_START, "", myUndoList);
3246 selectedEdge->setAttribute(GNE_ATTR_SHAPE_END, "", myUndoList);
3247 }
3248 // end undo list
3249 myUndoList->end();
3250 } else {
3251 // begin undo list
3252 myUndoList->begin(edge, TL("reset end points of edge '") + edge->getID());
3253 // reset both end points
3256 // end undo list
3257 myUndoList->end();
3258 }
3259 }
3260 return 1;
3261}
3262
3263
3264long
3265GNEViewNet::onCmdDuplicateLane(FXObject*, FXSelector, void*) {
3266 GNELane* laneAtPopupPosition = getLaneAtPopupPosition();
3267 if (laneAtPopupPosition != nullptr) {
3268 // when duplicating an unselected lane, keep all connections as they
3269 // are, otherwise recompute them
3270 if (laneAtPopupPosition->isAttributeCarrierSelected()) {
3271 myUndoList->begin(laneAtPopupPosition, TL("duplicate selected lanes"));
3272 const auto selectedLanes = myNet->getAttributeCarriers()->getSelectedLanes();
3273 for (const auto& lane : selectedLanes) {
3274 myNet->duplicateLane(lane, myUndoList, true);
3275 }
3276 myUndoList->end();
3277 } else {
3278 myUndoList->begin(laneAtPopupPosition, TL("duplicate lane"));
3279 myNet->duplicateLane(laneAtPopupPosition, myUndoList, false);
3280 myUndoList->end();
3281 }
3282 }
3283 return 1;
3284}
3285
3286
3287long
3288GNEViewNet::onCmdEditLaneShape(FXObject*, FXSelector, void*) {
3289 // Obtain lane under mouse
3291 if (lane) {
3293 }
3294 // destroy pop-up and update view Net
3295 destroyPopup();
3296 setFocus();
3297 return 1;
3298}
3299
3300
3301long
3302GNEViewNet::onCmdResetLaneCustomShape(FXObject*, FXSelector, void*) {
3303 GNELane* laneAtPopupPosition = getLaneAtPopupPosition();
3304 if (laneAtPopupPosition != nullptr) {
3305 // when duplicating an unselected lane, keep all connections as they
3306 // are, otherwise recompute them
3307 if (laneAtPopupPosition->isAttributeCarrierSelected()) {
3308 myUndoList->begin(laneAtPopupPosition, TL("reset custom lane shapes"));
3309 const auto selectedLanes = myNet->getAttributeCarriers()->getSelectedLanes();
3310 for (const auto& lane : selectedLanes) {
3311 lane->setAttribute(SUMO_ATTR_CUSTOMSHAPE, "", myUndoList);
3312 }
3313 myUndoList->end();
3314 } else {
3315 myUndoList->begin(laneAtPopupPosition, TL("reset custom lane shape"));
3316 laneAtPopupPosition->setAttribute(SUMO_ATTR_CUSTOMSHAPE, "", myUndoList);
3317 myUndoList->end();
3318 }
3319 }
3320 return 1;
3321}
3322
3323
3324long
3325GNEViewNet::onCmdResetOppositeLane(FXObject*, FXSelector, void*) {
3326 GNELane* laneAtPopupPosition = getLaneAtPopupPosition();
3327 if (laneAtPopupPosition != nullptr) {
3328 // when duplicating an unselected lane, keep all connections as they
3329 // are, otherwise recompute them
3330 if (laneAtPopupPosition->isAttributeCarrierSelected()) {
3331 myUndoList->begin(laneAtPopupPosition, TL("reset opposite lanes"));
3332 const auto selectedLanes = myNet->getAttributeCarriers()->getSelectedLanes();
3333 for (const auto& lane : selectedLanes) {
3334 lane->setAttribute(GNE_ATTR_OPPOSITE, "", myUndoList);
3335 }
3336 myUndoList->end();
3337 } else {
3338 myUndoList->begin(laneAtPopupPosition, TL("reset opposite lane"));
3339 laneAtPopupPosition->setAttribute(GNE_ATTR_OPPOSITE, "", myUndoList);
3340 myUndoList->end();
3341 }
3342 }
3343 return 1;
3344}
3345
3346
3347long
3348GNEViewNet::onCmdLaneOperation(FXObject*, FXSelector sel, void*) {
3349 GNELane* laneAtPopupPosition = getLaneAtPopupPosition();
3350 if (laneAtPopupPosition) {
3351 // check lane operation
3352 switch (FXSELID(sel)) {
3354 return restrictLane(laneAtPopupPosition, SVC_PEDESTRIAN);
3356 return restrictLane(laneAtPopupPosition, SVC_BICYCLE);
3358 return restrictLane(laneAtPopupPosition, SVC_BUS);
3360 return restrictLane(laneAtPopupPosition, SVC_IGNORING);
3362 return addRestrictedLane(laneAtPopupPosition, SVC_PEDESTRIAN, false);
3364 return addRestrictedLane(laneAtPopupPosition, SVC_BICYCLE, false);
3366 return addRestrictedLane(laneAtPopupPosition, SVC_BUS, false);
3368 return addRestrictedLane(laneAtPopupPosition, SVC_IGNORING, true);
3370 return addRestrictedLane(laneAtPopupPosition, SVC_IGNORING, false);
3372 return removeRestrictedLane(laneAtPopupPosition, SVC_PEDESTRIAN);
3374 return removeRestrictedLane(laneAtPopupPosition, SVC_BICYCLE);
3376 return removeRestrictedLane(laneAtPopupPosition, SVC_BUS);
3378 return removeRestrictedLane(laneAtPopupPosition, SVC_IGNORING);
3379 default:
3380 return 0;
3381 }
3382 } else {
3383 return 0;
3384 }
3385}
3386
3387
3388long
3389GNEViewNet::onCmdLaneReachability(FXObject* menu, FXSelector, void*) {
3390 GNELane* laneAtPopupPosition = getLaneAtPopupPosition();
3391 if (laneAtPopupPosition != nullptr) {
3392 // obtain vClass
3393 const SUMOVehicleClass vClass = SumoVehicleClassStrings.get(dynamic_cast<FXMenuCommand*>(menu)->getText().text());
3394 // calculate reachability
3396 // select all lanes with reachability greater than 0
3397 myUndoList->begin(laneAtPopupPosition, TL("select lane reachability"));
3398 for (const auto& edge : myNet->getAttributeCarriers()->getEdges()) {
3399 for (const auto& lane : edge.second->getChildLanes()) {
3400 if (lane->getReachability() >= 0) {
3401 lane->setAttribute(GNE_ATTR_SELECTED, "true", myUndoList);
3402 }
3403 }
3404 }
3405 myUndoList->end();
3406 }
3407 return 1;
3408}
3409
3410
3411long
3412GNEViewNet::onCmdOpenAdditionalDialog(FXObject*, FXSelector, void*) {
3413 // retrieve additional under cursor
3415 // check if additional can open dialog
3416 if (addtional && addtional->getTagProperty()->hasDialog()) {
3417 addtional->openAdditionalDialog(this);
3418 }
3419 return 1;
3420}
3421
3422
3423void
3425 FXEvent* evt = (FXEvent*)eventData;
3426 // process click
3427 destroyPopup();
3428 setFocus();
3429 myChanger->onLeftBtnPress(eventData);
3430 grab();
3431 // Check there are double click
3432 if (evt->click_count == 2) {
3433 handle(this, FXSEL(SEL_DOUBLECLICKED, 0), eventData);
3434 }
3435}
3436
3437
3438void
3440 // first check if we're panning
3441 if (myPanning) {
3442 // move view
3445 } else {
3446 // declare flags
3447 bool cursorMoveView = false;
3448 bool cursorInspect = false;
3449 bool cursorSelect = false;
3450 bool cursorMoveElement = false;
3451 bool cursorDelete = false;
3452 // continue depending of supermode
3454 // move view
3460 cursorMoveView = true;
3461 }
3462 // specific mode
3464 cursorInspect = true;
3466 cursorSelect = true;
3468 cursorMoveElement = true;
3470 cursorDelete = true;
3471 }
3473 // move view
3477 cursorMoveView = true;
3478 }
3479 // specific mode
3481 cursorInspect = true;
3483 cursorSelect = true;
3485 cursorMoveElement = true;
3487 cursorDelete = true;
3488 }
3489 } else if (myEditModes.isCurrentSupermodeData()) {
3490 // move view
3492 cursorMoveView = true;
3493 }
3494 // specific mode
3496 cursorInspect = true;
3498 cursorSelect = true;
3500 cursorDelete = true;
3501 }
3502 }
3503 // set cursor
3504 if (myMouseButtonKeyPressed.controlKeyPressed() && cursorMoveView) {
3505 // move view cursor if control key is pressed
3508 } else if (cursorInspect) {
3509 // special case for inspect lanes
3511 // inspect lane cursor
3514 } else {
3515 // inspect cursor
3518 }
3519 } else if (cursorSelect) {
3520 // special case for select lanes
3522 // select lane cursor
3525 } else {
3526 // select cursor
3529 }
3530 } else if (cursorMoveElement) {
3531 // move cursor
3534 } else if (cursorDelete) {
3535 // delete cursor
3538 } else {
3539 // default cursor
3542 }
3543 }
3544}
3545
3546
3547int
3549 // udpdate drawing toggle
3550 if (myDrawingToggle > 10000) {
3551 myDrawingToggle = 0;
3552 } else {
3554 }
3555 // set default scale
3557 // calculate boundary extremes
3558 const float minB[2] = { (float)bound.xmin(), (float)bound.ymin() };
3559 const float maxB[2] = { (float)bound.xmax(), (float)bound.ymax() };
3560 // reset gl line to 1
3561 glLineWidth(1);
3562 // set drawing modes
3563 glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
3564 glEnable(GL_POLYGON_OFFSET_FILL);
3565 glEnable(GL_POLYGON_OFFSET_LINE);
3566 // draw all elements between minB and maxB, obtain objects included in minB and maxB
3567 return myGrid->Search(minB, maxB, *myVisualizationSettings);
3568}
3569
3570
3571void
3573 // depending of the visualizationSettings, enable or disable check box show grid
3575 // change show grid
3578 // change to true
3581 // update show grid buttons
3584 }
3585 // draw grid only in network and demand mode
3587 paintGLGrid();
3588 }
3589 } else {
3590 // change show grid
3593 // change to false
3596 // update show grid buttons
3599 }
3600 }
3601}
3602
3603
3604long
3605GNEViewNet::onCmdResetEdgeEndPoints(FXObject*, FXSelector, void*) {
3606 // Obtain junction under mouse
3608 if (junction) {
3609 myUndoList->begin(GUIIcon::EDGE, TL("reset edge endpoints"));
3610 // are, otherwise recompute them
3611 if (junction->isAttributeCarrierSelected()) {
3612 const auto selectedJunctions = myNet->getAttributeCarriers()->getSelectedJunctions();
3613 for (const auto& selectedJunction : selectedJunctions) {
3614 // reset shape end from incoming edges
3615 for (const auto& incomingEdge : selectedJunction->getGNEIncomingEdges()) {
3616 incomingEdge->setAttribute(GNE_ATTR_SHAPE_END, "", myUndoList);
3617 }
3618 // reset shape start from outgoing edges
3619 for (const auto& outgoingEdge : selectedJunction->getGNEOutgoingEdges()) {
3620 outgoingEdge->setAttribute(GNE_ATTR_SHAPE_START, "", myUndoList);
3621 }
3622 }
3623 } else {
3624 // reset shape end from incoming edges
3625 for (const auto& incomingEdge : junction->getGNEIncomingEdges()) {
3626 incomingEdge->setAttribute(GNE_ATTR_SHAPE_END, "", myUndoList);
3627 }
3628 // reset shape start from outgoing edges
3629 for (const auto& outgoingEdge : junction->getGNEOutgoingEdges()) {
3630 outgoingEdge->setAttribute(GNE_ATTR_SHAPE_START, "", myUndoList);
3631 }
3632 }
3633 myUndoList->end();
3634 }
3635 // destroy pop-up and set focus in view net
3636 destroyPopup();
3637 setFocus();
3638 return 1;
3639}
3640
3641
3642long
3643GNEViewNet::onCmdEditJunctionShape(FXObject*, FXSelector, void*) {
3644 // Obtain junction under mouse
3646 if (junction) {
3647 // check if network has to be updated
3648 if (junction->getNBNode()->getShape().size() == 0) {
3649 // recompute the whole network
3651 }
3652 // if grid is enabled, show warning
3654 WRITE_WARNING(TL("Grid is still active, press ctrl+g to deactivate"));
3655 }
3656 // start edit custom shape
3658 }
3659 // destroy pop-up and set focus in view net
3660 destroyPopup();
3661 setFocus();
3662 return 1;
3663}
3664
3665
3666long
3667GNEViewNet::onCmdResetJunctionShape(FXObject*, FXSelector, void*) {
3668 // Obtain junction under mouse
3670 if (junction) {
3671 // are, otherwise recompute them
3672 if (junction->isAttributeCarrierSelected()) {
3673 myUndoList->begin(junction, TL("reset custom junction shapes"));
3674 const auto selectedJunctions = myNet->getAttributeCarriers()->getSelectedJunctions();
3675 for (const auto& selectedJunction : selectedJunctions) {
3676 selectedJunction->setAttribute(SUMO_ATTR_SHAPE, "", myUndoList);
3677 }
3678 myUndoList->end();
3679 } else {
3680 myUndoList->begin(junction, TL("reset custom junction shape"));
3681 junction->setAttribute(SUMO_ATTR_SHAPE, "", myUndoList);
3682 myUndoList->end();
3683 }
3684 }
3685 // destroy pop-up and set focus in view net
3686 destroyPopup();
3687 setFocus();
3688 return 1;
3689}
3690
3691
3692long
3693GNEViewNet::onCmdReplaceJunction(FXObject*, FXSelector, void*) {
3695 if (junction != nullptr) {
3697 }
3698 // destroy pop-up and set focus in view net
3699 destroyPopup();
3700 setFocus();
3701 return 1;
3702}
3703
3704
3705long
3706GNEViewNet::onCmdSplitJunction(FXObject*, FXSelector, void*) {
3708 if (junction != nullptr) {
3709 myNet->splitJunction(junction, false, myUndoList);
3710 }
3711 // destroy pop-up and set focus in view net
3712 destroyPopup();
3713 setFocus();
3714 return 1;
3715}
3716
3717
3718long
3719GNEViewNet::onCmdSplitJunctionReconnect(FXObject*, FXSelector, void*) {
3721 if (junction != nullptr) {
3722 myNet->splitJunction(junction, true, myUndoList);
3723 }
3724 // destroy pop-up and set focus in view net
3725 destroyPopup();
3726 setFocus();
3727 return 1;
3728}
3729
3730long
3731GNEViewNet::onCmdSelectRoundabout(FXObject*, FXSelector, void*) {
3733 if (junction != nullptr) {
3734 myNet->selectRoundabout(junction, myUndoList);
3735 }
3736 // destroy pop-up and set focus in view net
3737 destroyPopup();
3738 setFocus();
3739 return 1;
3740}
3741
3742long
3743GNEViewNet::onCmdConvertRoundabout(FXObject*, FXSelector, void*) {
3745 if (junction != nullptr) {
3746 myNet->createRoundabout(junction, myUndoList);
3747 }
3748 // destroy pop-up and set focus in view net
3749 destroyPopup();
3750 setFocus();
3751 return 1;
3752}
3753
3754
3755long
3756GNEViewNet::onEnterConvertRoundabout(FXObject*, FXSelector, void*) {
3758 update();
3759 return 1;
3760}
3761
3762
3763long
3764GNEViewNet::onLeaveConvertRoundabout(FXObject*, FXSelector, void*) {
3766 update();
3767 return 1;
3768}
3769
3770
3771long
3772GNEViewNet::onCmdClearConnections(FXObject*, FXSelector, void*) {
3774 if (junction != nullptr) {
3775 // make sure we do not inspect the connection will it is being deleted
3778 }
3779 // make sure that connections isn't the front attribute
3780 const auto frontElements = myMarkFrontElements.getACs();
3781 for (const auto& AC : frontElements) {
3782 if (AC->getTagProperty()->getTag() == SUMO_TAG_CONNECTION) {
3783 AC->unmarkForDrawingFront();
3784 }
3785 }
3786 // check if we're handling a selection
3787 if (junction->isAttributeCarrierSelected()) {
3788 const auto selectedJunctions = myNet->getAttributeCarriers()->getSelectedJunctions();
3789 myUndoList->begin(GUIIcon::CONNECTION, TL("clear connections of selected junctions"));
3790 for (const auto& selectedJunction : selectedJunctions) {
3791 myNet->clearJunctionConnections(selectedJunction, myUndoList);
3792 }
3793 myUndoList->end();
3794 } else {
3796 }
3797 }
3798 // destroy pop-up and set focus in view net
3799 destroyPopup();
3800 setFocus();
3801 return 1;
3802}
3803
3804
3805long
3806GNEViewNet::onCmdResetConnections(FXObject*, FXSelector, void*) {
3808 if (junction != nullptr) {
3809 // make sure we do not inspect the connection will it is being deleted
3812 }
3813 // make sure that connections isn't the front attribute
3814 const auto frontElements = myMarkFrontElements.getACs();
3815 for (const auto& AC : frontElements) {
3816 if (AC->getTagProperty()->getTag() == SUMO_TAG_CONNECTION) {
3817 AC->unmarkForDrawingFront();
3818 }
3819 }
3820 // check if we're handling a selection
3821 if (junction->isAttributeCarrierSelected()) {
3822 const auto selectedJunctions = myNet->getAttributeCarriers()->getSelectedJunctions();
3823 myUndoList->begin(GUIIcon::CONNECTION, TL("reset connections of selected junctions"));
3824 for (const auto& selectedJunction : selectedJunctions) {
3825 myNet->resetJunctionConnections(selectedJunction, myUndoList);
3826 }
3827 myUndoList->end();
3828 } else {
3830 }
3831 }
3832 // destroy pop-up and set focus in view net
3833 destroyPopup();
3834 setFocus();
3835 return 1;
3836}
3837
3838
3839long
3840GNEViewNet::onCmdAddTLS(FXObject*, FXSelector, void*) {
3842 if (junction != nullptr) {
3843 // check if we're adding TLS in multiple junctions
3844 if (junction->isAttributeCarrierSelected()) {
3845 const auto selectedJunctions = myNet->getAttributeCarriers()->getSelectedJunctions();
3846 myNet->getUndoList()->begin(GUIIcon::MODETLS, TL("add TLS in multiple junctions"));
3847 for (const auto& selectedJunction : selectedJunctions) {
3848 selectedJunction->setAttribute(SUMO_ATTR_TYPE, "traffic_light", myUndoList);
3849 }
3850 myNet->getUndoList()->end();
3851 } else {
3852 // change junction type
3853 junction->setAttribute(SUMO_ATTR_TYPE, "traffic_light", myUndoList);
3854 // change to TLS Mode
3856 // set junction in TLS mode
3858 }
3859 }
3860 // destroy pop-up and set focus in view net
3861 destroyPopup();
3862 setFocus();
3863 return 1;
3864}
3865
3866
3867long
3868GNEViewNet::onCmdAddJoinTLS(FXObject*, FXSelector, void*) {
3870 if (junction != nullptr) {
3871 // check if we're adding TLS in multiple junctions
3872 if (junction->isAttributeCarrierSelected()) {
3873 myNet->getUndoList()->begin(GUIIcon::MODETLS, TL("add TLS in multiple junctions"));
3874 }
3875 // change junction type
3876 junction->setAttribute(SUMO_ATTR_TYPE, "traffic_light", myUndoList);
3877 // if TLS was sucesfully created, apply the same TLID to other selected junctions
3878 if (junction->getAttribute(SUMO_ATTR_TLID).size() > 0) {
3879 const auto selectedJunctions = myNet->getAttributeCarriers()->getSelectedJunctions();
3880 // iterate over all selected junctions
3881 for (const auto& selectedJunction : selectedJunctions) {
3882 // check that doesn't have a TL
3883 if (selectedJunction->getNBNode()->getControllingTLS().empty()) {
3884 selectedJunction->setAttribute(SUMO_ATTR_TYPE, "traffic_light", myUndoList);
3885 selectedJunction->setAttribute(SUMO_ATTR_TLID, junction->getAttribute(SUMO_ATTR_TLID), myUndoList);
3886 }
3887 }
3888 }
3889 // rename traffic light
3890 if (junction->getNBNode()->getControllingTLS().size() > 0) {
3891 const auto TLSDef = (*junction->getNBNode()->getControllingTLS().begin());
3892 if (!myNet->getTLLogicCont().exist(TLSDef->getID() + "_joined")) {
3893 myUndoList->add(new GNEChange_TLS(junction, TLSDef, TLSDef->getID() + "_joined"), true);
3894 }
3895 }
3896 // end undoList
3897 if (junction->isAttributeCarrierSelected()) {
3898 myNet->getUndoList()->end();
3899 }
3900 // change to TLS Mode
3902 // set junction in TLS mode
3904 }
3905 // destroy pop-up and set focus in view net
3906 destroyPopup();
3907 setFocus();
3908 return 1;
3909}
3910
3911long
3912GNEViewNet::onCmdEditConnectionShape(FXObject*, FXSelector, void*) {
3913 // Obtain connection under mouse
3915 if (connection) {
3917 }
3918 // if grid is enabled, show warning
3920 WRITE_WARNING(TL("Grid is still active, press ctrl+g to deactivate"));
3921 }
3922 // destroy pop-up and update view Net
3923 destroyPopup();
3924 setFocus();
3925 return 1;
3926}
3927
3928
3929long
3930GNEViewNet::onCmdSmoothConnectionShape(FXObject*, FXSelector, void*) {
3931 // Obtain connection under mouse
3933 if (connection) {
3934 connection->smootShape();
3935 }
3936 // destroy pop-up and update view Net
3937 destroyPopup();
3938 setFocus();
3939 return 1;
3940}
3941
3942
3943long
3944GNEViewNet::onCmdEditCrossingShape(FXObject*, FXSelector, void*) {
3945 // Obtain crossing under mouse
3947 if (crossing) {
3948 // check if network has to be updated
3949 if (crossing->getParentJunctions().front()->getNBNode()->getShape().size() == 0) {
3950 // recompute the whole network
3952 }
3953 // if grid is enabled, show warning
3955 WRITE_WARNING(TL("Grid is still active, press ctrl+g to deactivate"));
3956 }
3957 // start edit custom shape
3959 }
3960 // destroy pop-up and update view Net
3961 destroyPopup();
3962 setFocus();
3963 return 1;
3964}
3965
3966
3967long
3968GNEViewNet::onCmdEditWalkingAreaShape(FXObject*, FXSelector, void*) {
3969 // Obtain walkingArea under mouse
3971 if (walkingArea) {
3972 // check if network has to be updated
3973 if (walkingArea->getParentJunctions().front()->getNBNode()->getShape().size() == 0) {
3974 // recompute the whole network
3976 // if grid is enabled, show warning
3978 WRITE_WARNING(TL("Grid is still active, press ctrl+g to deactivate"));
3979 }
3980 }
3981 // start edit custom shape
3983 }
3984 // destroy pop-up and update view Net
3985 destroyPopup();
3986 setFocus();
3987 return 1;
3988}
3989
3990
3991long
3992GNEViewNet::onCmdToggleSelectEdges(FXObject*, FXSelector sel, void*) {
3993 // Toggle menuCheckSelectEdges
3996 } else {
3998 }
4000 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4001 if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_SELECTEDGES)) {
4003 }
4004 return 1;
4005}
4006
4007
4008long
4009GNEViewNet::onCmdToggleShowConnections(FXObject*, FXSelector sel, void*) {
4010 // Toggle menuCheckShowConnections
4013 } else {
4015 }
4017 // if show was enabled, init GNEConnections
4020 }
4021 // change flag "showLane2Lane" in myVisualizationSettings
4023 // Hide/show connections require recompute
4025 // Update viewNet to show/hide connections
4026 updateViewNet();
4027 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4028 if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_SHOWCONNECTIONS)) {
4030 }
4031 return 1;
4032}
4033
4034
4035long
4036GNEViewNet::onCmdToggleHideConnections(FXObject*, FXSelector sel, void*) {
4037 // Toggle menuCheckHideConnections
4040 } else {
4042 }
4044 // Update viewNet to show/hide connections
4045 updateViewNet();
4046 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4047 if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_HIDECONNECTIONS)) {
4049 }
4050 return 1;
4051}
4052
4053
4054long
4055GNEViewNet::onCmdToggleShowAdditionalSubElements(FXObject*, FXSelector sel, void*) {
4056 // Toggle menuCheckShowAdditionalSubElements
4059 } else {
4061 }
4063 // Update viewNet to show/hide sub elements
4064 updateViewNet();
4065 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4066 if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_SHOWSUBADDITIONALS)) {
4068 }
4069 return 1;
4070}
4071
4072
4073long
4074GNEViewNet::onCmdToggleShowTAZElements(FXObject*, FXSelector sel, void*) {
4075 // Toggle menuCheckShowAdditionalSubElements
4078 } else {
4080 }
4082 // Update viewNet to show/hide TAZ elements
4083 updateViewNet();
4084 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4085 if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_SHOWTAZELEMENTS)) {
4087 }
4088 return 1;
4089}
4090
4091
4092long
4093GNEViewNet::onCmdToggleExtendSelection(FXObject*, FXSelector sel, void*) {
4094 // Toggle menuCheckExtendSelection
4097 } else {
4099 }
4101 // Only update view
4102 updateViewNet();
4103 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4104 if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_EXTENDSELECTION)) {
4106 }
4107 return 1;
4108}
4109
4110
4111long
4112GNEViewNet::onCmdToggleChangeAllPhases(FXObject*, FXSelector sel, void*) {
4113 // Toggle menuCheckChangeAllPhases
4116 } else {
4118 }
4120 // Only update view
4121 updateViewNet();
4122 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4123 if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_CHANGEALLPHASES)) {
4125 }
4126 return 1;
4127}
4128
4129
4130long
4131GNEViewNet::onCmdToggleShowGrid(FXObject*, FXSelector sel, void*) {
4132 // show or hide grid depending of myNetworkViewOptions.menuCheckToggleGrid
4137 } else {
4141 }
4144 // update view to show grid
4145 updateViewNet();
4146 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4147 if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_TOGGLEGRID)) {
4149 } else if (sel == FXSEL(SEL_COMMAND, MID_GNE_DEMANDVIEWOPTIONS_SHOWGRID)) {
4151 }
4152 return 1;
4153}
4154
4155
4156long
4157GNEViewNet::onCmdToggleDrawJunctionShape(FXObject*, FXSelector sel, void*) {
4158 // toggle state
4160 // gui button has 'hide' semantics
4161 const bool hide = !myVisualizationSettings->drawJunctionShape;
4165
4169 // update view to show DrawJunctionShape
4170 updateViewNet();
4171 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4172 if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_TOGGLEDRAWJUNCTIONSHAPE)) {
4174 } else if (sel == FXSEL(SEL_COMMAND, MID_GNE_DEMANDVIEWOPTIONS_TOGGLEDRAWJUNCTIONSHAPE)) {
4176 } else if (sel == FXSEL(SEL_COMMAND, MID_GNE_DATAVIEWOPTIONS_TOGGLEDRAWJUNCTIONSHAPE)) {
4178 }
4179 return 1;
4180}
4181
4182long
4183GNEViewNet::onCmdToggleDrawSpreadVehicles(FXObject*, FXSelector sel, void*) {
4184 // Toggle menuCheckShowDemandElements
4189 } else {
4192 }
4195 // declare edge set
4196 std::set<GNEEdge*> edgesToUpdate;
4197 // compute vehicle geometry
4198 for (const auto& vehicle : myNet->getAttributeCarriers()->getDemandElements().at(SUMO_TAG_VEHICLE)) {
4199 if (vehicle.second->getParentEdges().size() > 0) {
4200 edgesToUpdate.insert(vehicle.second->getParentEdges().front());
4201 } else if (vehicle.second->getChildDemandElements().size() > 0 && (vehicle.second->getChildDemandElements().front()->getTagProperty()->getTag() == GNE_TAG_ROUTE_EMBEDDED)) {
4202 edgesToUpdate.insert(vehicle.second->getChildDemandElements().front()->getParentEdges().front());
4203 }
4204 }
4205 for (const auto& routeFlow : myNet->getAttributeCarriers()->getDemandElements().at(GNE_TAG_FLOW_ROUTE)) {
4206 if (routeFlow.second->getParentEdges().size() > 0) {
4207 edgesToUpdate.insert(routeFlow.second->getParentEdges().front());
4208 } else if (routeFlow.second->getChildDemandElements().size() > 0 && (routeFlow.second->getChildDemandElements().front()->getTagProperty()->getTag() == GNE_TAG_ROUTE_EMBEDDED)) {
4209 edgesToUpdate.insert(routeFlow.second->getChildDemandElements().front()->getParentEdges().front());
4210 }
4211 }
4212 for (const auto& trip : myNet->getAttributeCarriers()->getDemandElements().at(SUMO_TAG_TRIP)) {
4213 if (trip.second->getParentEdges().size() > 0) {
4214 edgesToUpdate.insert(trip.second->getParentEdges().front());
4215 }
4216 }
4217 for (const auto& flow : myNet->getAttributeCarriers()->getDemandElements().at(SUMO_TAG_FLOW)) {
4218 if (flow.second->getParentEdges().size() > 0) {
4219 edgesToUpdate.insert(flow.second->getParentEdges().front());
4220 }
4221 }
4222 // update spread geometries of all edges
4223 for (const auto& edge : edgesToUpdate) {
4224 edge->updateVehicleSpreadGeometries();
4225 }
4226 // update view to show new vehicles positions
4227 updateViewNet();
4228 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4229 if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_DRAWSPREADVEHICLES)) {
4231 } else if (sel == FXSEL(SEL_COMMAND, MID_GNE_DEMANDVIEWOPTIONS_DRAWSPREADVEHICLES)) {
4233 }
4234 return 1;
4235}
4236
4237
4238long
4239GNEViewNet::onCmdToggleMergeAutomatically(FXObject*, FXSelector sel, void*) {
4240 // Toggle menuCheckWarnAboutMerge
4243 } else {
4245 }
4247 // Only update view
4248 updateViewNet();
4249 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4250 if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_MERGEAUTOMATICALLY)) {
4252 }
4253 return 1;
4254}
4255
4256
4257long
4258GNEViewNet::onCmdToggleShowJunctionBubbles(FXObject*, FXSelector sel, void*) {
4259 // Toggle menuCheckShowJunctionBubble
4262 } else {
4264 }
4266 // Only update view
4267 updateViewNet();
4268 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4269 if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_SHOWBUBBLES)) {
4271 }
4272 return 1;
4273}
4274
4275
4276long
4277GNEViewNet::onCmdToggleMoveElevation(FXObject*, FXSelector sel, void*) {
4278 // Toggle menuCheckMoveElevation
4281 } else {
4283 }
4285 // Only update view
4286 updateViewNet();
4287 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4288 if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_MOVEELEVATION)) {
4290 }
4291 return 1;
4292}
4293
4294
4295long
4296GNEViewNet::onCmdToggleChainEdges(FXObject*, FXSelector sel, void*) {
4297 // Toggle menuCheckMoveElevation
4300 } else {
4302 }
4304 // Only update view
4305 updateViewNet();
4306 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4307 if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_CHAINEDGES)) {
4309 }
4310 return 1;
4311}
4312
4313
4314long
4315GNEViewNet::onCmdToggleAutoOppositeEdge(FXObject*, FXSelector sel, void*) {
4316 // Toggle menuCheckAutoOppositeEdge
4319 } else {
4321 }
4323 // Only update view
4324 updateViewNet();
4325 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4326 if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_AUTOOPPOSITEEDGES)) {
4328 }
4329 return 1;
4330}
4331
4332
4333long
4334GNEViewNet::onCmdToggleShowPolygonSymbols(FXObject*, FXSelector sel, void*) {
4335 // Toggle menuCheckAutoOppositeEdge
4338 } else {
4340 }
4342 // Only update view
4343 updateViewNet();
4344 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4345 if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_SHOWPOLYGONSYMBOLS)) {
4347 }
4348 return 1;
4349}
4350
4351
4352long
4354 // Toggle menuCheckHideNonInspectedDemandElements
4357 } else {
4359 }
4361 // Only update view
4362 updateViewNet();
4363 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4364 if (sel == FXSEL(SEL_COMMAND, MID_GNE_DEMANDVIEWOPTIONS_HIDENONINSPECTED)) {
4366 }
4367 return 1;
4368}
4369
4370
4371long
4372GNEViewNet::onCmdToggleShowOverlappedRoutes(FXObject*, FXSelector sel, void*) {
4373 // Toggle menuCheckShowOverlappedRoutes
4376 } else {
4378 }
4380 // Only update view
4381 updateViewNet();
4382 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4383 if (sel == FXSEL(SEL_COMMAND, MID_GNE_DEMANDVIEWOPTIONS_SHOWOVERLAPPEDROUTES)) {
4385 }
4386 return 1;
4387}
4388
4389
4390long
4391GNEViewNet::onCmdToggleHideShapes(FXObject*, FXSelector sel, void*) {
4392 // Toggle menuCheckHideShapes
4395 } else {
4397 }
4399 // Only update view
4400 updateViewNet();
4401 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4402 if (sel == FXSEL(SEL_COMMAND, MID_GNE_DEMANDVIEWOPTIONS_HIDESHAPES)) {
4404 }
4405 return 1;
4406}
4407
4408
4409long
4410GNEViewNet::onCmdToggleShowTrips(FXObject*, FXSelector sel, void*) {
4411 // Toggle menuCheckHideShapes
4414 } else {
4416 }
4418 // Only update view
4419 updateViewNet();
4420 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4421 if (sel == FXSEL(SEL_COMMAND, MID_GNE_DEMANDVIEWOPTIONS_SHOWTRIPS)) {
4423 }
4424 return 1;
4425}
4426
4427
4428long
4429GNEViewNet::onCmdToggleShowAllPersonPlans(FXObject*, FXSelector sel, void*) {
4430 // Toggle menuCheckShowAllPersonPlans
4433 } else {
4435 }
4437 // Only update view
4438 updateViewNet();
4439 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4440 if (sel == FXSEL(SEL_COMMAND, MID_GNE_DEMANDVIEWOPTIONS_SHOWALLPERSONPLANS)) {
4442 }
4443 return 1;
4444}
4445
4446
4447long
4448GNEViewNet::onCmdToggleLockPerson(FXObject*, FXSelector sel, void*) {
4449 // Toggle menuCheckLockPerson
4454 }
4456 // lock or unlock current inspected person depending of menuCheckLockPerson value
4458 // obtain locked person or person plan
4459 const GNEDemandElement* personOrPersonPlan = dynamic_cast<const GNEDemandElement*>(myInspectedElements.getFirstAC());
4460 if (personOrPersonPlan) {
4461 // lock person depending if casted demand element is either a person or a person plan
4462 if (personOrPersonPlan->getTagProperty()->isPerson()) {
4463 myDemandViewOptions.lockPerson(personOrPersonPlan);
4464 } else {
4465 myDemandViewOptions.lockPerson(personOrPersonPlan->getParentDemandElements().front());
4466 }
4467 }
4468 } else {
4469 // unlock current person
4471 }
4472 // update view
4473 updateViewNet();
4474 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4475 if (sel == FXSEL(SEL_COMMAND, MID_GNE_DEMANDVIEWOPTIONS_LOCKPERSON)) {
4477 }
4478 return 1;
4479}
4480
4481
4482long
4483GNEViewNet::onCmdToggleShowAllContainerPlans(FXObject*, FXSelector sel, void*) {
4484 // Toggle menuCheckShowAllContainerPlans
4487 } else {
4489 }
4491 // Only update view
4492 updateViewNet();
4493 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4494 if (sel == FXSEL(SEL_COMMAND, MID_GNE_DEMANDVIEWOPTIONS_SHOWALLCONTAINERPLANS)) {
4496 }
4497 return 1;
4498}
4499
4500
4501long
4502GNEViewNet::onCmdToggleLockContainer(FXObject*, FXSelector sel, void*) {
4503 // Toggle menuCheckLockContainer
4508 }
4510 // lock or unlock current inspected container depending of menuCheckLockContainer value
4512 // obtain locked container or container plan
4513 const GNEDemandElement* containerOrContainerPlan = dynamic_cast<const GNEDemandElement*>(myInspectedElements.getFirstAC());
4514 if (containerOrContainerPlan) {
4515 // lock container depending if casted demand element is either a container or a container plan
4516 if (containerOrContainerPlan->getTagProperty()->isContainer()) {
4517 myDemandViewOptions.lockContainer(containerOrContainerPlan);
4518 } else {
4519 myDemandViewOptions.lockContainer(containerOrContainerPlan->getParentDemandElements().front());
4520 }
4521 }
4522 } else {
4523 // unlock current container
4525 }
4526 // update view
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_DEMANDVIEWOPTIONS_LOCKCONTAINER)) {
4531 }
4532 return 1;
4533}
4534
4535
4536long
4537GNEViewNet::onCmdToggleShowAdditionals(FXObject*, FXSelector sel, void*) {
4538 // Toggle menuCheckShowAdditionals
4541 } else {
4543 }
4545 // Only update view
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_SHOWADDITIONALS)) {
4550 }
4551 return 1;
4552}
4553
4554
4555long
4556GNEViewNet::onCmdToggleShowShapes(FXObject*, FXSelector sel, void*) {
4557 // Toggle menuCheckShowShapes
4560 } else {
4562 }
4564 // Only update view
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_SHOWSHAPES)) {
4569 }
4570 return 1;
4571}
4572
4573
4574long
4575GNEViewNet::onCmdToggleShowDemandElementsNetwork(FXObject*, FXSelector sel, void*) {
4576 // Toggle menuCheckShowDemandElements
4579 } else {
4581 }
4583 // compute demand elements
4585 // update view to show demand elements
4586 updateViewNet();
4587 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4588 if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_SHOWDEMANDELEMENTS)) {
4590 }
4591 return 1;
4592}
4593
4594
4595long
4596GNEViewNet::onCmdToggleShowDemandElementsData(FXObject*, FXSelector sel, void*) {
4597 // Toggle menuCheckShowDemandElements
4600 } else {
4602 }
4604 // compute demand elements
4606 // update view to show demand elements
4607 updateViewNet();
4608 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4609 if (sel == FXSEL(SEL_COMMAND, MID_GNE_DATAVIEWOPTIONS_SHOWDEMANDELEMENTS)) {
4611 }
4612 return 1;
4613}
4614
4615
4616long
4617GNEViewNet::onCmdToggleTAZRelDrawing(FXObject*, FXSelector sel, void*) {
4618 // Toggle menuCheckShowDemandElements
4621 } else {
4623 }
4625 // update view to show demand elements
4626 updateViewNet();
4627 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4628 if (sel == FXSEL(SEL_COMMAND, MID_GNE_DATAVIEWOPTIONS_TAZRELDRAWING)) {
4630 }
4631 return 1;
4632}
4633
4634
4635long
4636GNEViewNet::onCmdToggleTAZDrawFill(FXObject*, FXSelector sel, void*) {
4637 // Toggle menuCheckShowDemandElements
4640 } else {
4642 }
4644 // update view to show demand elements
4645 updateViewNet();
4646 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4647 if (sel == FXSEL(SEL_COMMAND, MID_GNE_DATAVIEWOPTIONS_TAZDRAWFILL)) {
4649 }
4650 return 1;
4651}
4652
4653
4654long
4655GNEViewNet::onCmdToggleTAZRelOnlyFrom(FXObject*, FXSelector sel, void*) {
4656 // Toggle menuCheckShowDemandElements
4659 } else {
4661 }
4663 // update view to show demand elements
4664 updateViewNet();
4665 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4666 if (sel == FXSEL(SEL_COMMAND, MID_GNE_DATAVIEWOPTIONS_TAZRELONLYFROM)) {
4668 }
4669 return 1;
4670}
4671
4672
4673long
4674GNEViewNet::onCmdToggleTAZRelOnlyTo(FXObject*, FXSelector sel, void*) {
4675 // Toggle menuCheckShowDemandElements
4678 } else {
4680 }
4682 // update view to show demand elements
4683 updateViewNet();
4684 // set focus in menu check again, if this function was called clicking over menu check instead using alt+<key number>
4685 if (sel == FXSEL(SEL_COMMAND, MID_GNE_DATAVIEWOPTIONS_TAZRELONLYTO)) {
4687 }
4688 return 1;
4689}
4690
4691
4692long
4693GNEViewNet::onCmdIntervalBarGenericDataType(FXObject*, FXSelector, void*) {
4695 return 1;
4696}
4697
4698
4699long
4700GNEViewNet::onCmdIntervalBarDataSet(FXObject*, FXSelector, void*) {
4702 return 1;
4703}
4704
4705
4706long
4707GNEViewNet::onCmdIntervalBarLimit(FXObject*, FXSelector, void*) {
4709 return 1;
4710}
4711
4712
4713long
4714GNEViewNet::onCmdIntervalBarSetBegin(FXObject*, FXSelector, void*) {
4716 return 1;
4717}
4718
4719
4720long
4721GNEViewNet::onCmdIntervalBarSetEnd(FXObject*, FXSelector, void*) {
4723 return 1;
4724}
4725
4726
4727long
4728GNEViewNet::onCmdIntervalBarSetParameter(FXObject*, FXSelector, void*) {
4730 return 1;
4731}
4732
4733
4734long
4735GNEViewNet::onCmdAddSelected(FXObject*, FXSelector, void*) {
4736 // only select if AC under cursor isn't previously selected
4738 if (AC && !AC->isAttributeCarrierSelected()) {
4740 }
4741 return 1;
4742}
4743
4744
4745long
4746GNEViewNet::onCmdRemoveSelected(FXObject*, FXSelector, void*) {
4747 // only unselect if AC under cursor isn't previously selected
4749 if (AC && AC->isAttributeCarrierSelected()) {
4751 }
4752 return 1;
4753}
4754
4755
4756long
4757GNEViewNet::onCmdAddEdgeSelected(FXObject*, FXSelector, void*) {
4758 // only select if edge under cursor isn't previously selected
4759 auto edge = myViewObjectsSelector.getEdgeFront();
4760 if (edge && !edge->isAttributeCarrierSelected()) {
4761 edge->selectAttributeCarrier();
4762 }
4763 return 1;
4764}
4765
4766
4767long
4768GNEViewNet::onCmdRemoveEdgeSelected(FXObject*, FXSelector, void*) {
4769 // only unselect if edge under cursor isn't previously selected
4770 auto edge = myViewObjectsSelector.getEdgeFront();
4771 if (edge && edge->isAttributeCarrierSelected()) {
4773 }
4774 return 1;
4775}
4776
4777
4778long
4779GNEViewNet::onCmdSetNeteditView(FXObject*, FXSelector sel, void*) {
4780 myEditModes.setView(FXSELID(sel));
4781 update();
4782 return 1;
4783}
4784
4785// ===========================================================================
4786// private
4787// ===========================================================================
4788
4789void
4791 // build supermode buttons
4793
4794 // build save elements buttons
4796
4797 // build time switch buttons
4799
4800 // build menu checks for Common checkable buttons
4802
4803 // build menu checks for Network checkable buttons
4805
4806 // build menu checks for Demand checkable buttons
4808
4809 // build menu checks of view options Data
4811
4812 // Create Vertical separator
4814 // XXX for some reason the vertical groove is not visible. adding more spacing to emphasize the separation
4817
4818 // build menu checks of view options Network
4820
4821 // build menu checks of view options Demand
4823
4824 // build menu checks of view options Data
4826
4827 // build interval bar
4829}
4830
4831
4832void
4834 // get menu checks
4836 // hide all checkbox of view options Network
4838 // hide all checkbox of view options Demand
4840 // hide all checkbox of view options Data
4842 // disable all common edit modes
4844 // disable all network edit modes
4846 // disable all network edit modes
4848 // hide interval bar
4850 // hide all frames
4852 // hide all menuchecks
4856 // In network mode, always show option "show grid", "draw spread vehicles" and "show demand elements"
4861 menuChecks.menuCheckToggleGrid->show();
4862 menuChecks.menuCheckToggleDrawJunctionShape->show();
4863 menuChecks.menuCheckDrawSpreadVehicles->show();
4864 menuChecks.menuCheckShowDemandElements->show();
4865 // show separator
4866 menuChecks.separator->show();
4867 // enable selected controls
4868 switch (myEditModes.networkEditMode) {
4869 // common modes
4875 // show view options
4882 // show menu checks
4883 menuChecks.menuCheckShowPolygonSymbols->show();
4884 menuChecks.menuCheckSelectEdges->show();
4885 menuChecks.menuCheckShowConnections->show();
4886 menuChecks.menuCheckShowAdditionalSubElements->show();
4887 menuChecks.menuCheckShowTAZElements->show();
4888 menuChecks.menuCheckShowJunctionBubble->show();
4889 // update lock menu bar
4891 // show
4892 break;
4898 // show view options
4906 // show menu checks
4907 menuChecks.menuCheckShowAdditionalSubElements->show();
4908 menuChecks.menuCheckShowTAZElements->show();
4909 menuChecks.menuCheckShowJunctionBubble->show();
4910 menuChecks.menuCheckShowPolygonSymbols->show();
4911 menuChecks.menuCheckSelectEdges->show();
4912 menuChecks.menuCheckShowConnections->show();
4913 break;
4919 // show view options
4927 // show menu checks
4928 menuChecks.menuCheckShowPolygonSymbols->show();
4929 menuChecks.menuCheckSelectEdges->show();
4930 menuChecks.menuCheckShowConnections->show();
4931 menuChecks.menuCheckExtendSelection->show();
4932 menuChecks.menuCheckShowAdditionalSubElements->show();
4933 menuChecks.menuCheckShowTAZElements->show();
4934 menuChecks.menuCheckShowJunctionBubble->show();
4935 break;
4936 // specific modes
4942 // show view options
4947 // show menu checks
4948 menuChecks.menuCheckShowPolygonSymbols->show();
4949 menuChecks.menuCheckChainEdges->show();
4950 menuChecks.menuCheckAutoOppositeEdge->show();
4951 menuChecks.menuCheckShowJunctionBubble->show();
4952 break;
4958 // show view options
4963 // show menu checks
4964 menuChecks.menuCheckShowPolygonSymbols->show();
4965 menuChecks.menuCheckMergeAutomatically->show();
4966 menuChecks.menuCheckShowJunctionBubble->show();
4967 menuChecks.menuCheckMoveElevation->show();
4968 break;
4974 // show view options
4976 // show menu checks
4977 menuChecks.menuCheckShowPolygonSymbols->show();
4978 break;
4984 // show view options
4987 // show menu checks
4988 menuChecks.menuCheckShowPolygonSymbols->show();
4989 menuChecks.menuCheckChangeAllPhases->show();
4990 break;
4996 // show view options
4999 // show menu checks
5000 menuChecks.menuCheckShowPolygonSymbols->show();
5001 menuChecks.menuCheckShowAdditionalSubElements->show();
5002 break;
5008 // show view options
5010 // show menu checks
5011 menuChecks.menuCheckShowPolygonSymbols->show();
5012 break;
5018 // show view options
5020 // show menu checks
5021 menuChecks.menuCheckShowPolygonSymbols->show();
5022 break;
5028 // show view options
5030 // show menu checks
5031 menuChecks.menuCheckShowPolygonSymbols->show();
5032 break;
5038 // show view options
5040 // show menu checks
5041 menuChecks.menuCheckShowPolygonSymbols->show();
5042 break;
5048 // show view options
5050 // show menu checks
5051 menuChecks.menuCheckShowPolygonSymbols->show();
5052 break;
5058 // show view options
5060 // show menu checks
5061 menuChecks.menuCheckShowPolygonSymbols->show();
5062 break;
5063 default:
5064 break;
5065 }
5066 // update menuChecks shorcuts
5067 menuChecks.updateShortcuts();
5068 // update common Network buttons
5070 // Update Network buttons
5072 // recalc toolbar
5075 // force repaint because different modes draw different things
5076 onPaint(nullptr, 0, nullptr);
5077 // finally update view
5078 updateViewNet();
5079}
5080
5081
5082void
5084 // get menu checks
5086 // hide all checkbox of view options Network
5088 // hide all checkbox of view options Demand
5090 // hide all checkbox of view options Data
5092 // disable all common edit modes
5094 // disable all Demand edit modes
5096 // disable all network edit modes
5098 // hide interval bar
5100 // hide all frames
5102 // hide all menuchecks
5106 // always show "hide shapes", "show grid", "draw spread vehicles", "show overlapped routes" and show/lock persons and containers
5117 menuChecks.menuCheckToggleGrid->show();
5118 menuChecks.menuCheckToggleDrawJunctionShape->show();
5119 menuChecks.menuCheckDrawSpreadVehicles->show();
5120 menuChecks.menuCheckHideShapes->show();
5121 menuChecks.menuCheckShowAllTrips->show();
5122 menuChecks.menuCheckShowAllPersonPlans->show();
5123 menuChecks.menuCheckLockPerson->show();
5124 menuChecks.menuCheckShowAllContainerPlans->show();
5125 menuChecks.menuCheckLockContainer->show();
5126 menuChecks.menuCheckShowOverlappedRoutes->show();
5127 // show separator
5128 menuChecks.separator->show();
5129 // enable selected controls
5130 switch (myEditModes.demandEditMode) {
5131 // common modes
5136 // set checkable button
5138 // show view options
5140 // show menu checks
5141 menuChecks.menuCheckHideNonInspectedDemandElements->show();
5142 break;
5147 // set checkable button
5149 break;
5154 // set checkable button
5156 break;
5161 // set checkable button
5163 break;
5164 // specific modes
5169 // set checkable button
5171 break;
5176 // set checkable button
5178 break;
5183 // set checkable button
5185 break;
5190 // set checkable button
5192 break;
5197 // set checkable button
5199 break;
5204 // set checkable button
5206 break;
5211 // set checkable button
5213 break;
5218 // set checkable button
5220 break;
5225 // set checkable button
5227 break;
5232 // set checkable button
5234 break;
5235 default:
5236 break;
5237 }
5238 // update menuChecks shorcuts
5239 menuChecks.updateShortcuts();
5240 // update common Network buttons
5242 // Update Demand buttons
5244 // recalc toolbar
5247 // force repaint because different modes draw different things
5248 onPaint(nullptr, 0, nullptr);
5249 // finally update view
5250 updateViewNet();
5251}
5252
5253
5254void
5256 // get menu checks
5258 // hide all checkbox of view options Network
5260 // hide all checkbox of view options Demand
5262 // hide all checkbox of view options Data
5264 // disable all common edit modes
5266 // disable all Data edit modes
5268 // show interval bar
5270 // hide all frames
5272 // hide all menuchecks
5276 // In data mode, always show options for show elements
5281 menuChecks.menuCheckToggleDrawJunctionShape->show();
5282 menuChecks.menuCheckShowAdditionals->show();
5283 menuChecks.menuCheckShowShapes->show();
5284 menuChecks.menuCheckShowDemandElements->show();
5285 // show separator
5286 menuChecks.separator->show();
5287 // enable selected controls
5288 switch (myEditModes.dataEditMode) {
5289 // common modes
5294 // set checkable button
5296 // show view option
5301 // show menu check
5302 menuChecks.menuCheckToggleTAZRelDrawing->show();
5303 menuChecks.menuCheckToggleTAZDrawFill->show();
5304 menuChecks.menuCheckToggleTAZRelOnlyFrom->show();
5305 menuChecks.menuCheckToggleTAZRelOnlyTo->show();
5306 break;
5311 // set checkable button
5313 // show toggle TAZRel drawing view option
5317 // show toggle TAZRel drawing menu check
5318 menuChecks.menuCheckToggleTAZRelDrawing->show();
5319 menuChecks.menuCheckToggleTAZRelOnlyFrom->show();
5320 menuChecks.menuCheckToggleTAZRelOnlyTo->show();
5321 break;
5326 // set checkable button
5328 // show toggle TAZRel drawing view option
5332 // show toggle TAZRel drawing menu check
5333 menuChecks.menuCheckToggleTAZRelDrawing->show();
5334 menuChecks.menuCheckToggleTAZRelOnlyFrom->show();
5335 menuChecks.menuCheckToggleTAZRelOnlyTo->show();
5336 break;
5341 // set checkable button
5343 break;
5348 // set checkable button
5350 break;
5355 // set checkable button
5357 // show view option
5362 // show menu check
5363 menuChecks.menuCheckToggleTAZRelDrawing->show();
5364 menuChecks.menuCheckToggleTAZDrawFill->show();
5365 menuChecks.menuCheckToggleTAZRelOnlyFrom->show();
5366 menuChecks.menuCheckToggleTAZRelOnlyTo->show();
5367 break;
5372 // set checkable button
5374 break;
5375 default:
5376 break;
5377 }
5378 // update menuChecks shorcuts
5379 menuChecks.updateShortcuts();
5380 // update common Network buttons
5382 // Update Data buttons
5384 // recalc toolbar
5387 // force repaint because different modes draw different things
5388 onPaint(nullptr, 0, nullptr);
5389 // finally update view
5390 updateViewNet();
5391}
5392
5393
5394void
5396 if (AC->getTagProperty()->getTag() == SUMO_TAG_JUNCTION) {
5397 // get junction (note: could be already removed if is a child, then hardfail=false)
5398 GNEJunction* junction = myNet->getAttributeCarriers()->retrieveJunction(AC->getID(), false);
5399 // if exist, remove it
5400 if (junction) {
5401 myNet->deleteJunction(junction, myUndoList);
5402 }
5403 } else if (AC->getTagProperty()->getTag() == SUMO_TAG_CROSSING) {
5404 // get crossing (note: could be already removed if is a child, then hardfail=false)
5406 // if exist, remove it
5407 if (crossing) {
5408 myNet->deleteCrossing(crossing, myUndoList);
5409 }
5410 } else if (AC->getTagProperty()->getTag() == SUMO_TAG_EDGE) {
5411 // get edge (note: could be already removed if is a child, then hardfail=false)
5412 GNEEdge* edge = myNet->getAttributeCarriers()->retrieveEdge(AC->getID(), false);
5413 // if exist, remove it
5414 if (edge) {
5415 myNet->deleteEdge(edge, myUndoList, false);
5416 }
5417 } else if (AC->getTagProperty()->getTag() == SUMO_TAG_LANE) {
5418 // get lane (note: could be already removed if is a child, then hardfail=false)
5420 // if exist, remove it
5421 if (lane) {
5422 myNet->deleteLane(lane, myUndoList, false);
5423 }
5424 } else if (AC->getTagProperty()->getTag() == SUMO_TAG_CONNECTION) {
5425 // get connection (note: could be already removed if is a child, then hardfail=false)
5427 // if exist, remove it
5428 if (connection) {
5429 myNet->deleteConnection(connection, myUndoList);
5430 }
5431 } else if ((AC->getTagProperty()->getTag() == SUMO_TAG_TAZSOURCE) || (AC->getTagProperty()->getTag() == SUMO_TAG_TAZSINK)) {
5432 // get TAZ SourceSink Element (note: could be already removed if is a child, then hardfail=false)
5433 GNETAZSourceSink* TAZSourceSink = myNet->getAttributeCarriers()->retrieveTAZSourceSink(AC, false);
5434 // if exist, remove it
5435 if (TAZSourceSink) {
5436 myNet->deleteTAZSourceSink(TAZSourceSink, myUndoList);
5437 }
5438 } else if (AC->getTagProperty()->isAdditionalElement()) {
5439 // get additional Element (note: could be already removed if is a child, then hardfail=false)
5440 GNEAdditional* additionalElement = myNet->getAttributeCarriers()->retrieveAdditional(AC->getGUIGlObject(), false);
5441 // if exist, remove it
5442 if (additionalElement) {
5443 myNet->deleteAdditional(additionalElement, myUndoList);
5444 }
5445 }
5446}
5447
5448
5449void
5451 // get demand Element (note: could be already removed if is a child, then hardfail=false)
5453 // if exist, remove it
5454 if (demandElement) {
5455 myNet->deleteDemandElement(demandElement, myUndoList);
5456 }
5457}
5458
5459
5460void
5462 if (AC->getTagProperty()->getTag() == SUMO_TAG_DATASET) {
5463 // get data set (note: could be already removed if is a child, then hardfail=false)
5464 GNEDataSet* dataSet = myNet->getAttributeCarriers()->retrieveDataSet(AC->getID(), false);
5465 // if exist, remove it
5466 if (dataSet) {
5467 myNet->deleteDataSet(dataSet, myUndoList);
5468 }
5469 } else if (AC->getTagProperty()->getTag() == SUMO_TAG_DATAINTERVAL) {
5470 // get data interval (note: could be already removed if is a child, then hardfail=false)
5471 GNEDataInterval* dataInterval = myNet->getAttributeCarriers()->retrieveDataInterval(AC, false);
5472 // if exist, remove it
5473 if (dataInterval) {
5474 myNet->deleteDataInterval(dataInterval, myUndoList);
5475 }
5476 } else {
5477 // get generic data (note: could be already removed if is a child, then hardfail=false)
5479 // if exist, remove it
5480 if (genericData) {
5481 myNet->deleteGenericData(genericData, myUndoList);
5482 }
5483 }
5484}
5485
5486
5487void
5490 switch (myEditModes.networkEditMode) {
5492 myViewParent->getInspectorFrame()->update();
5493 break;
5494 default:
5495 break;
5496 }
5497 }
5499 switch (myEditModes.demandEditMode) {
5501 myViewParent->getInspectorFrame()->update();
5502 break;
5505 break;
5508 break;
5511 break;
5514 break;
5517 break;
5520 break;
5523 break;
5526 break;
5529 break;
5530 default:
5531 break;
5532 }
5533 }
5535 switch (myEditModes.dataEditMode) {
5537 myViewParent->getInspectorFrame()->update();
5538 break;
5539 default:
5540 break;
5541 }
5542 // update data interval
5544 }
5545 // update view
5546 updateViewNet();
5547}
5548
5549// ---------------------------------------------------------------------------
5550// Private methods
5551// ---------------------------------------------------------------------------
5552
5553void
5555 PositionVector temporalShape;
5556 bool deleteLastCreatedPoint = false;
5557 // obtain temporal shape and delete last created point flag
5564 }
5565 // check if we're in drawing mode
5566 if (temporalShape.size() > 0) {
5567 // draw blue line with the current drawed shape
5569 glLineWidth(2);
5570 glTranslated(0, 0, GLO_TEMPORALSHAPE);
5572 GLHelper::drawLine(temporalShape);
5574 // draw red line from the last point of shape to the current mouse position
5576 glLineWidth(2);
5577 glTranslated(0, 0, GLO_TEMPORALSHAPE);
5578 // draw last line depending if shift key (delete last created point) is pressed
5579 if (deleteLastCreatedPoint) {
5581 } else {
5583 }
5586 }
5587}
5588
5589
5590void
5592 // first check if we're in correct mode
5597 // get mouse position
5598 const Position mousePosition = snapToActiveGrid(getPositionInformation());
5599 // get junction exaggeration
5600 const double junctionExaggeration = myVisualizationSettings->junctionSize.getExaggeration(*myVisualizationSettings, nullptr, 4);
5601 // get bubble color
5603 // change alpha
5604 bubbleColor.setAlpha(200);
5605 // push layer matrix
5607 // translate to temporal shape layer
5608 glTranslated(0, 0, GLO_TEMPORALSHAPE);
5609 // push junction matrix
5611 // move matrix junction center
5612 glTranslated(mousePosition.x(), mousePosition.y(), 0.1);
5613 // set color
5614 GLHelper::setColor(bubbleColor);
5615 // draw outline circle
5616 const double circleWidth = myVisualizationSettings->neteditSizeSettings.junctionBubbleRadius * junctionExaggeration;
5617 GLHelper::drawOutlineCircle(circleWidth, circleWidth * 0.75, 32);
5618 // pop junction matrix
5620 // draw temporal edge
5622 // set temporal edge color
5623 RGBColor temporalEdgeColor = RGBColor::BLACK;
5624 temporalEdgeColor.setAlpha(200);
5625 // declare temporal edge geometry
5626 GUIGeometry temporalEdgeGeometry;
5627 // calculate geometry between source junction and mouse position
5628 PositionVector temporalEdge = {mousePosition, myViewParent->getCreateEdgeFrame()->getJunctionSource()->getPositionInView()};
5629 // move temporal edge 2 side
5630 temporalEdge.move2side(-1);
5631 // update geometry
5632 temporalEdgeGeometry.updateGeometry(temporalEdge);
5633 // push temporal edge matrix
5635 // set color
5636 GLHelper::setColor(temporalEdgeColor);
5637 // draw temporal edge
5639 // check if we have to draw opposite edge
5641 // move temporal edge to opposite edge
5642 temporalEdge.move2side(2);
5643 // update geometry
5644 temporalEdgeGeometry.updateGeometry(temporalEdge);
5645 // draw temporal edge
5647 }
5648 // pop temporal edge matrix
5650 }
5651 // pop layer matrix
5653 }
5654}
5655
5656
5657void
5659 // first check if we're in correct mode
5664 (gViewObjectsHandler.markedEdge != nullptr)) {
5665 // calculate split position
5666 const auto lane = gViewObjectsHandler.markedEdge->getChildLanes().back();
5667 auto shape = lane->getLaneShape();
5668 // move shape to side
5669 shape.move2side(lane->getDrawingConstants()->getDrawingWidth() * -1);
5670 const auto offset = shape.nearest_offset_to_point2D(snapToActiveGrid(getPositionInformation()));
5671 const auto splitPosition = shape.positionAtOffset2D(offset);
5672 // get junction exaggeration
5673 const double junctionExaggeration = myVisualizationSettings->junctionSize.getExaggeration(*myVisualizationSettings, nullptr, 4);
5674 // get bubble color
5676 // push layer matrix
5678 // translate to temporal shape layer
5679 glTranslated(0, 0, GLO_TEMPORALSHAPE);
5680 // push junction matrix
5682 // move matrix junction center
5683 glTranslated(splitPosition.x(), splitPosition.y(), 0.1);
5684 // set color
5685 GLHelper::setColor(bubbleColor);
5686 // draw outline circle
5687 const double circleWidth = myVisualizationSettings->neteditSizeSettings.junctionBubbleRadius * junctionExaggeration;
5688 GLHelper::drawOutlineCircle(circleWidth, circleWidth * 0.75, 32);
5689 // draw filled circle
5691 // pop junction matrix
5693 // pop layer matrix
5695 }
5696}
5697
5698
5699void
5701 // check conditions
5702 if ((myCurrentObjectsDialog.size() > 0) && (myCurrentObjectsDialog.front()->getType() == GLO_JUNCTION) && myDrawPreviewRoundabout) {
5703 // get junction
5704 const auto junction = myNet->getAttributeCarriers()->retrieveJunction(myCurrentObjectsDialog.front()->getMicrosimID());
5705 // push layer matrix
5707 // translate to temporal shape layer
5708 glTranslated(0, 0, GLO_TEMPORALSHAPE);
5709 // push junction matrix
5711 // move matrix junction center
5712 glTranslated(junction->getNBNode()->getPosition().x(), junction->getNBNode()->getPosition().y(), 0.1);
5713 // set color
5715 // draw outline circle
5716 const double circleWidth = (junction->getNBNode()->getRadius() < 0) ? 4.0 : junction->getNBNode()->getRadius();
5717 GLHelper::drawOutlineCircle(circleWidth * 1.30, circleWidth, 32);
5718 // pop junction matrix
5720 // pop layer matrix
5722 }
5723}
5724
5725
5726void
5728 // check conditions
5730 // get junction
5732 // push layer matrix
5734 // translate to TLLogic
5735 glTranslated(0, 0, GLO_TEMPORALSHAPE);
5736 // iterate over all E1 detectors
5737 for (const auto& E1ID : myViewParent->getTLSEditorFrame()->getTLSAttributes()->getE1Detectors()) {
5738 // first check if E1 exists
5739 const auto E1 = myNet->getAttributeCarriers()->retrieveAdditional(SUMO_TAG_INDUCTION_LOOP, E1ID.second, false);
5740 if (E1) {
5741 // push line matrix
5743 // draw line between junction and E1
5744 GUIGeometry::drawChildLine(*myVisualizationSettings, junctionPos, E1->getPositionInView(),
5746 // pop line matrix
5748 }
5749 }
5750 // pop layer matrix
5752 }
5753}
5754
5755
5756void
5758 // check conditions
5760 // get junction
5762 // push layer matrix
5764 // translate to TLLogic
5765 glTranslated(0, 0, GLO_TEMPORALSHAPE);
5766 // iterate over all Junction detectors
5767 for (const auto& selectedJunctionID : myViewParent->getTLSEditorFrame()->getTLSJunction()->getSelectedJunctionIDs()) {
5768 // get junction
5769 const auto selectedJunction = myNet->getAttributeCarriers()->retrieveJunction(selectedJunctionID);
5770 // push line matrix
5772 // draw line between junction and Junction
5773 GUIGeometry::drawChildLine(*myVisualizationSettings, junctionPos, selectedJunction->getPositionInView(),
5775 // pop line matrix
5777 }
5778 // pop layer matrix
5780 }
5781}
5782
5783
5784void
5787 /*
5788 myViewParent->getAdditionalFrame()->getNeteditAttributesEditor()->drawLaneReference(gViewObjectsHandler.markedLane);
5789 // get element length
5790 const double elementLength = getElementLength();
5791 // check lane
5792 if (lane && shown() && myReferencePointComboBox->shown() && (myReferencePoint != ReferencePoint::INVALID) &&
5793 (elementLength != INVALID_DOUBLE)) {
5794 // Obtain position of the mouse over lane (limited over grid)
5795 const double mousePosOverLane = lane->getLaneShape().nearest_offset_to_point2D(myFrameParent->getViewNet()->snapToActiveGrid(myFrameParent->getViewNet()->getPositionInformation())) / lane->getLengthGeometryFactor();
5796 // continue depending of mouse pos over lane
5797 if (mousePosOverLane >= 0) {
5798 // set start and end position
5799 const double startPos = setStartPosition(mousePosOverLane, elementLength);
5800 const double endPos = setEndPosition(mousePosOverLane, elementLength, lane->getLaneShape().length2D());
5801 // get lane geometry
5802 const auto laneShape = lane->getLaneGeometry().getShape();
5803 // difference between start-end position and elementLength
5804 const auto lengthDifference = (endPos - startPos) - elementLength;
5805 // set color
5806 RGBColor segmentColor;
5807 // check if force length
5808 if (myForceLengthFrame->shown() && (myForceLengthCheckButton->getCheck() == TRUE) && abs(lengthDifference) >= 0.1) {
5809 segmentColor = RGBColor::RED;
5810 } else {
5811 segmentColor = RGBColor::ORANGE;
5812 }
5813 // declare geometries
5814 GUIGeometry geometry;
5815 // trim geomtry
5816 geometry.updateGeometry(laneShape,
5817 (startPos == INVALID_DOUBLE) ? -1 : startPos,
5818 Position::INVALID,
5819 (endPos == INVALID_DOUBLE) ? -1 : endPos,
5820 Position::INVALID);
5821 // push layer matrix
5822 GLHelper::pushMatrix();
5823 // translate to temporal shape layer
5824 glTranslated(0, 0, GLO_TEMPORALSHAPE);
5825 // set color
5826 GLHelper::setColor(segmentColor);
5827 // draw temporal edge
5828 GUIGeometry::drawGeometry(lane->getDrawingConstants()->getDetail(), geometry, 0.45);
5829 // check if draw starPos
5830 if (startPos != INVALID_DOUBLE) {
5831 // cut start pos
5832 geometry.updateGeometry(laneShape, startPos, Position::INVALID, startPos + 0.5, Position::INVALID);
5833 // draw startPos
5834 GUIGeometry::drawGeometry(lane->getDrawingConstants()->getDetail(), geometry, 1);
5835 } else {
5836 // push circle matrix
5837 GLHelper::pushMatrix();
5838 // translate to test layer, but under magenta square
5839 glTranslated(laneShape.front().x(), laneShape.front().y(), 0);
5840 // draw circle
5841 GLHelper::drawFilledCircle(0.8, 8);
5842 // pop circle matrix
5843 GLHelper::popMatrix();
5844 }
5845 // check if draw endPos
5846 if (endPos != INVALID_DOUBLE) {
5847 // cut endPos
5848 geometry.updateGeometry(laneShape, endPos - 0.5, Position::INVALID, endPos, Position::INVALID);
5849 // draw endPos
5850 GUIGeometry::drawGeometry(lane->getDrawingConstants()->getDetail(), geometry, 1);
5851 } else {
5852 // push circle matrix
5853 GLHelper::pushMatrix();
5854 // translate to test layer, but under magenta square
5855 glTranslated(laneShape.back().x(), laneShape.back().y(), 0);
5856 // draw circle
5857 GLHelper::drawFilledCircle(0.8, 8);
5858 // pop circle matrix
5859 GLHelper::popMatrix();
5860 }
5861 // set color
5862 GLHelper::setColor(segmentColor.changedBrightness(-32));
5863 // translate to front
5864 glTranslated(0, 0, 2);
5865 // check if draw at end, or over circle
5866 if (endPos == INVALID_DOUBLE) {
5867 // cut endPos
5868 geometry.updateGeometry(laneShape, laneShape.length() - 0.5, Position::INVALID, laneShape.length(), Position::INVALID);
5869 // draw triangle at end
5870 GLHelper::drawTriangleAtEnd(geometry.getShape().front(), geometry.getShape().back(), (double) 0.45, (double) 0.3, 0.3);
5871 } else {
5872 // draw triangle at end
5873 GLHelper::drawTriangleAtEnd(geometry.getShape().front(), geometry.getShape().back(), (double) 0.45, (double) 0.3, -0.1);
5874 }
5875 // pop layer matrix
5876 GLHelper::popMatrix();
5877 }
5878 }
5879 */
5880 }
5881}
5882
5883
5884void
5887 // get mouse position
5888 const Position mousePosition = snapToActiveGrid(getPositionInformation());
5889 // push layer matrix
5891 // translate to test layer, but under magenta square
5892 glTranslated(mousePosition.x(), mousePosition.y(), GLO_TESTELEMENT - 1);
5893 // set color
5895 // draw circle
5897 // pop layer matrix
5899 }
5900}
5901
5902
5903void
5905 // reset moving selected edge
5907 // decide what to do based on mode
5908 switch (myEditModes.networkEditMode) {
5910 // first swap lane to edges if mySelectEdges is enabled and shift key isn't pressed
5911 if (checkSelectEdges()) {
5913 } else {
5915 }
5916 // now filter locked elements
5918 // check if we're selecting a new parent for the current inspected element
5921 } else {
5922 // inspect clicked elements
5924 }
5925 // process click
5926 processClick(eventData);
5927 break;
5928 }
5930 // first swap lane to edges if mySelectEdges is enabled and shift key isn't pressed
5931 if (checkSelectEdges()) {
5933 } else {
5935 }
5936 // now filter locked elements forcing excluding walkingAreas
5938 // continue depending of AC
5940 // now check if we want only delete geometry points
5942 // only remove geometry point
5945 // remove all selected attribute carriers
5948 }
5949 } else {
5950 // remove attribute carrier under cursor
5952 }
5953 } else {
5954 // process click
5955 processClick(eventData);
5956 }
5957 break;
5958 }
5960 // first swap lane to edges if mySelectEdges is enabled and shift key isn't pressed
5961 if (checkSelectEdges()) {
5963 } else {
5965 }
5966 // now filter locked elements
5968 // avoid to select if control key is pressed
5970 // check if a rect for selecting is being created
5972 // begin rectangle selection
5975 // process click
5976 processClick(eventData);
5977 }
5978 } else {
5979 // process click
5980 processClick(eventData);
5981 }
5982 break;
5984 // check what buttons are pressed
5986 // get edge under cursor
5988 if (edge) {
5989 // obtain reverse edge
5990 const auto oppositeEdges = edge->getOppositeEdges();
5991 // check if we're split one or both edges
5994 } else if (oppositeEdges.size() > 0) {
5995 myNet->splitEdgesBidi(edge, oppositeEdges.front(), edge->getSplitPos(getPositionInformation()), myUndoList);
5996 } else {
5998 }
5999 }
6001 // process left click in create edge frame Frame
6006 }
6007 // process click
6008 processClick(eventData);
6009 break;
6010 }
6015 }
6016 // filter locked elements
6018 // check if we're editing a shape
6020 // check if we're removing a geometry point
6022 // remove geometry point
6025 }
6027 // process click if there isn't movable elements (to move camera using drag an drop)
6028 processClick(eventData);
6029 }
6030 } else {
6031 // filter connections and crossings, because are moved setting custom shape
6034 // get AC under cursor
6036 // check that AC is an network or additional element
6037 if (AC && (AC->getTagProperty()->isNetworkElement() || AC->getTagProperty()->isAdditionalElement())) {
6038 // check if we're moving a set of selected items
6039 if (AC->isAttributeCarrierSelected()) {
6040 // move selected ACs
6043 // process click if there isn't movable elements (to move camera using drag an drop)
6044 processClick(eventData);
6045 }
6046 } else {
6047 // process click if there isn't movable elements (to move camera using drag an drop)
6048 processClick(eventData);
6049 }
6050 }
6051 break;
6052 }
6054 // check if we're clicked over a non locked lane
6056 // Handle laneclick (shift key may pass connections, Control key allow conflicts)
6058 updateViewNet();
6059 }
6060 // process click
6061 processClick(eventData);
6062 break;
6063 }
6065 // edit TLS in TLSEditor frame
6067 // process click
6068 processClick(eventData);
6069 break;
6070 }
6072 // avoid create additionals if control key is pressed
6075 updateViewNet();
6076 }
6077 }
6078 // process click
6079 processClick(eventData);
6080 break;
6081 }
6083 // filter elements over junctions
6087 // call function addCrossing from crossing frame
6089 // process click
6090 processClick(eventData);
6091 break;
6092 }
6094 // avoid create TAZs if control key is pressed
6096 // check if we want to create a rect for selecting edges
6098 // begin rectangle selection
6100 } else {
6101 // check if process click was successfully
6103 updateViewNet();
6104 }
6105 // process click
6106 processClick(eventData);
6107 }
6108 } else {
6109 // process click
6110 processClick(eventData);
6111 }
6112 break;
6113 }
6115 // avoid create shapes if control key is pressed
6118 // declare processClick flag
6119 bool updateTemporalShape = false;
6120 // process click
6122 updateViewNet();
6123 // process click depending of the result of "process click"
6124 if (!updateTemporalShape) {
6125 // process click
6126 processClick(eventData);
6127 }
6128 }
6129 } else {
6130 // process click
6131 processClick(eventData);
6132 }
6133 break;
6134 }
6137 // shift key may pass connections, Control key allow conflicts.
6139 updateViewNet();
6140 }
6141 // process click
6142 processClick(eventData);
6143 break;
6144 }
6146 // avoid create wires if control key is pressed
6149 updateViewNet();
6150 }
6151 // process click
6152 processClick(eventData);
6153 break;
6154 }
6156 // process click
6157 processClick(eventData);
6158 break;
6159 }
6160 default: {
6161 // process click
6162 processClick(eventData);
6163 }
6164 }
6165}
6166
6167
6168void
6170 // check moved items
6174 // check if we're creating a rectangle selection or we want only to select a lane
6176 // check if we're selecting all type of elements o we only want a set of edges for TAZ
6180 // process edge selection
6182 }
6184 // check if there is a lane in objects under cursor
6186 // if we clicked over an lane with shift key pressed, select or unselect it
6189 } else {
6191 }
6193 }
6194 }
6195 // finish selection
6197 } else {
6198 // finish moving of single elements
6200 }
6201}
6202
6203
6204void
6205GNEViewNet::processMoveMouseNetwork(const bool mouseLeftButtonPressed) {
6206 // change "delete last created point" depending if during movement shift key is pressed
6211 }
6212 // check what type of additional is moved
6214 // move entire selection
6215 myMoveMultipleElements.moveSelection(mouseLeftButtonPressed);
6217 // update selection corner of selecting area
6219 } else {
6220 // move single elements
6221 myMoveSingleElement.moveSingleElement(mouseLeftButtonPressed);
6222 }
6223}
6224
6225
6226void
6228 // filter shapes (because POIs and polygons doesn't interact in demand mode)
6230 // decide what to do based on mode
6231 switch (myEditModes.demandEditMode) {
6233 // filter locked elements
6235 // inspect clicked elements
6237 // process click
6238 processClick(eventData);
6239 break;
6240 }
6242 // filter locked elements
6244 // get front AC
6245 const auto markAC = myViewObjectsSelector.getAttributeCarrierFront();
6246 // check conditions
6247 if (markAC) {
6248 // check if we are deleting a selection or an single attribute carrier
6249 if (markAC->isAttributeCarrierSelected()) {
6251 } else {
6253 }
6254 } else {
6255 // process click
6256 processClick(eventData);
6257 }
6258 break;
6259 }
6261 // filter locked elements
6263 // avoid to select if control key is pressed
6265 // check if a rect for selecting is being created
6267 // begin rectangle selection
6270 // process click
6271 processClick(eventData);
6272 }
6273 } else {
6274 // process click
6275 processClick(eventData);
6276 }
6277 break;
6279 // filter locked elements
6281 // get front AC
6282 const auto markAC = myViewObjectsSelector.getAttributeCarrierFront();
6283 // check that AC under cursor is a demand element
6284 if (markAC) {
6285 // check if we're moving a set of selected items
6286 if (markAC->isAttributeCarrierSelected()) {
6287 // move selected ACs
6290 // process click if there isn't movable elements (to move camera using drag an drop)
6291 processClick(eventData);
6292 }
6293 } else {
6294 // process click if there isn't movable elements (to move camera using drag an drop)
6295 processClick(eventData);
6296 }
6297 break;
6298 }
6300 // check if we clicked over a lane
6302 // Handle edge click
6304 }
6305 // process click
6306 processClick(eventData);
6307 break;
6308 }
6310 // filter additionals (except TAZs) and demands (except routes)
6313 // Handle click
6315 // process click
6316 processClick(eventData);
6317 break;
6318 }
6320 // filter additionals (except stoppingPlaces) and demands
6323 // Handle click
6325 updateViewNet();
6326 }
6327 // process click
6328 processClick(eventData);
6329 break;
6330 }
6332 // filter additionals (except stoppingPlaces and TAZs)
6335 // special case if we're creating person over walk routes
6338 } else {
6340 }
6341 // Handle click
6343 }
6344 // process click
6345 processClick(eventData);
6346 break;
6347 }
6349 // filter additionals (except stoppingPlaces and TAZs)
6352 // special case if we're creating person over walk routes
6355 } else {
6357 }
6358 // Handle person plan click
6360 }
6361 // process click
6362 processClick(eventData);
6363 break;
6364 }
6366 // filter additionals (except stoppingPlaces and TAZs) and demands
6369 // Handle click
6371 // process click
6372 processClick(eventData);
6373 break;
6374 }
6376 // filter additionals (except stoppingPlaces and TAZs) and demands
6379 // Handle container plan click
6381 // process click
6382 processClick(eventData);
6383 break;
6384 }
6385 default: {
6386 // process click
6387 processClick(eventData);
6388 }
6389 }
6390}
6391
6392
6393void
6395 // check moved items
6399 // check if we're creating a rectangle selection or we want only to select a lane
6402 }
6403 // finish selection
6405 } else {
6406 // finish moving of single elements
6408 }
6409}
6410
6411
6412void
6413GNEViewNet::processMoveMouseDemand(const bool mouseLeftButtonPressed) {
6415 // update selection corner of selecting area
6417 } else {
6418 // move single elements
6419 myMoveSingleElement.moveSingleElement(mouseLeftButtonPressed);
6420 }
6421}
6422
6423
6424void
6426 // get AC
6428 // decide what to do based on mode
6429 switch (myEditModes.dataEditMode) {
6431 // filter locked elements
6433 // process left click in Inspector Frame
6434 if (AC && AC->getTagProperty()->getTag() == SUMO_TAG_TAZ) {
6436 } else {
6437 // inspect clicked elements
6439 }
6440 // process click
6441 processClick(eventData);
6442 break;
6443 }
6445 // check conditions
6446 if (AC) {
6447 // check if we are deleting a selection or an single attribute carrier
6448 if (AC->isAttributeCarrierSelected()) {
6449 if (!AC->getGUIGlObject()->isGLObjectLocked()) {
6451 }
6452 } else {
6454 }
6455 } else {
6456 // process click
6457 processClick(eventData);
6458 }
6459 break;
6460 }
6462 // filter locked elements
6464 // avoid to select if control key is pressed
6466 // check if a rect for selecting is being created
6468 // begin rectangle selection
6471 // process click
6472 processClick(eventData);
6473 }
6474 } else {
6475 // process click
6476 processClick(eventData);
6477 }
6478 break;
6480 // avoid create edgeData if control key is pressed
6483 updateViewNet();
6484 }
6485 }
6486 // process click
6487 processClick(eventData);
6488 break;
6490 // avoid create edgeData if control key is pressed
6493 updateViewNet();
6494 }
6495 }
6496 // process click
6497 processClick(eventData);
6498 break;
6500 // avoid create TAZData if control key is pressed
6503 updateViewNet();
6504 }
6505 }
6506 // process click
6507 processClick(eventData);
6508 break;
6510 // avoid create TAZData if control key is pressed
6512 //
6513 }
6514 // process click
6515 processClick(eventData);
6516 break;
6517 default: {
6518 // process click
6519 processClick(eventData);
6520 }
6521 }
6522}
6523
6524
6525void
6527 // check moved items
6531 // check if we're creating a rectangle selection or we want only to select a lane
6534 }
6535 // finish selection
6537 } else {
6538 // finish moving of single elements
6540 }
6541}
6542
6543
6544void
6545GNEViewNet::processMoveMouseData(const bool mouseLeftButtonPressed) {
6547 // update selection corner of selecting area
6549 } else {
6550 // move single elements
6551 myMoveSingleElement.moveSingleElement(mouseLeftButtonPressed);
6552 }
6553}
6554
6555/****************************************************************************/
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:857
@ MID_GNE_ADDSELECT_EDGE
Add edge to selected items - menu entry.
Definition GUIAppEnum.h:861
@ MID_HOTKEY_F3_SUPERMODE_DEMAND
select demand supermode in netedit
Definition GUIAppEnum.h:236
@ MID_GNE_LANE_EDIT_SHAPE
edit lane shape
@ MID_GNE_DEMANDVIEWOPTIONS_SHOWALLPERSONPLANS
show all person plans
Definition GUIAppEnum.h:943
@ 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:967
@ 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:487
@ 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:831
@ MID_GNE_JUNCTION_RESET_EDGE_ENDPOINTS
reset edge endpoints
@ MID_GNE_NETWORKVIEWOPTIONS_MOVEELEVATION
move elevation instead of x,y
Definition GUIAppEnum.h:853
@ MID_GNE_NETWORKVIEWOPTIONS_HIDECONNECTIONS
hide connections
Definition GUIAppEnum.h:839
@ MID_GNE_REMOVESELECT_EDGE
Remove edge from selected items - Menu Entry.
Definition GUIAppEnum.h:863
@ MID_GNE_NETWORKVIEWOPTIONS_SHOWCONNECTIONS
show connections
Definition GUIAppEnum.h:837
@ MID_GNE_INTERVALBAR_BEGIN
begin changed in InterbalBar
Definition GUIAppEnum.h:987
@ MID_GNE_DATAVIEWOPTIONS_TAZRELONLYTO
toggle draw TAZRel only to
Definition GUIAppEnum.h:973
@ 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:959
@ MID_GNE_NETWORKVIEWOPTIONS_SHOWTAZELEMENTS
show TAZ elements
Definition GUIAppEnum.h:843
@ MID_GNE_DEMANDVIEWOPTIONS_LOCKPERSON
lock person
Definition GUIAppEnum.h:945
@ 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:933
@ MID_GNE_JUNCTION_CLEAR_CONNECTIONS
clear junction's connections
@ MID_HOTKEY_A_MODE_STARTSIMULATION_ADDITIONALS_STOPS
hotkey for start simulation in SUMO and set editing mode additionals AND stops in netedit
Definition GUIAppEnum.h:43
@ MID_GNE_JUNCTION_SELECT_ROUNDABOUT
select all roundabout nodes and edges of the current roundabout
@ MID_GNE_JUNCTION_RESET_SHAPE
reset junction shape
@ MID_GNE_JUNCTION_RESET_CONNECTIONS
reset junction's connections
@ MID_GNE_DEMANDVIEWOPTIONS_SHOWGRID
show grid
Definition GUIAppEnum.h:931
@ MID_GNE_POLYGON_TRIANGULATE
triangulate polygon
@ MID_GNE_JUNCTION_SPLIT
turn junction into multiple junctions
@ MID_GNE_EDGE_STRAIGHTEN_ELEVATION
interpolate z values linear between junctions
@ MID_HOTKEY_D_MODE_SINGLESIMULATIONSTEP_DELETE
hotkey for perform a single simulation step in SUMO and set delete mode in netedit
Definition GUIAppEnum.h:49
@ MID_GNE_NETWORKVIEWOPTIONS_CHAINEDGES
create edges in chain mode
Definition GUIAppEnum.h:855
@ MID_GNE_DATAVIEWOPTIONS_SHOWDEMANDELEMENTS
show demand elements
Definition GUIAppEnum.h:965
@ 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:939
@ 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:961
@ MID_HOTKEY_SHIFT_R_LOCATEROUTE
Locate route - button.
Definition GUIAppEnum.h:186
@ MID_GNE_NETWORKVIEWOPTIONS_SHOWBUBBLES
show junctions as bubbles
Definition GUIAppEnum.h:851
@ MID_GNE_LANE_ADD_GREENVERGE_FRONT
add greenVerge front of current lane
@ MID_GNE_INTERVALBAR_END
end changed in InterbalBar
Definition GUIAppEnum.h:989
@ MID_HOTKEY_SHIFT_W_LOCATEWALKINGAREA
Locate edge - button.
Definition GUIAppEnum.h:194
@ MID_GNE_NETWORKVIEWOPTIONS_EXTENDSELECTION
extend selection
Definition GUIAppEnum.h:845
@ 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:841
@ 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:947
@ MID_HOTKEY_SHIFT_V_LOCATEVEHICLE
Locate vehicle - button.
Definition GUIAppEnum.h:192
@ MID_GNE_VIEW_DEFAULT
set default view
Definition GUIAppEnum.h:793
@ MID_HOTKEY_F4_SUPERMODE_DATA
select data supermode in netedit
Definition GUIAppEnum.h:238
@ 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:795
@ MID_GNE_SHAPEEDITED_STRAIGHTEN
straighten shape edited geometry
@ MID_GNE_LANE_RESET_OPPOSITELANE
reset opposite lane
@ MID_GNE_INTERVALBAR_PARAMETER
parameter changed in InterbalBar
Definition GUIAppEnum.h:991
@ 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:969
@ MID_REACHABILITY
show reachability from a given lane
Definition GUIAppEnum.h:533
@ 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_NETWORKVIEWOPTIONS_SHOWPOLYGONSYMBOLS
show polygon symbols
Definition GUIAppEnum.h:859
@ MID_GNE_LANE_REMOVE_BUS
remove busLane
@ MID_GNE_NETWORKVIEWOPTIONS_SHOWDEMANDELEMENTS
show demand elements
Definition GUIAppEnum.h:833
@ 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:471
@ MID_GNE_WALKINGAREA_EDIT_SHAPE
edit crossing shape
@ MID_GNE_DEMANDVIEWOPTIONS_HIDENONINSPECTED
hide non-inspected demand element
Definition GUIAppEnum.h:937
@ 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:981
@ MID_GNE_LANE_ADD_GREENVERGE_BACK
add greenVerge back of current lane
@ MID_GNE_NETWORKVIEWOPTIONS_MERGEAUTOMATICALLY
don't ask before merging junctions
Definition GUIAppEnum.h:849
@ MID_GNE_EDGE_SMOOTH_ELEVATION
smooth elevation with regard to adjoining edges
@ MID_GNE_NETWORKVIEWOPTIONS_CHANGEALLPHASES
change all phases
Definition GUIAppEnum.h:847
@ MID_GNE_DATAVIEWOPTIONS_SHOWSHAPES
show shapes
Definition GUIAppEnum.h:963
@ 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:971
@ 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:829
@ MID_GNE_SHAPEEDITED_SIMPLIFY
simplify shape edited geometry
@ MID_GNE_DEMANDVIEWOPTIONS_DRAWSPREADVEHICLES
Draw vehicles in begin position or spread in lane.
Definition GUIAppEnum.h:935
@ MID_GNE_LANE_ADD_SIDEWALK
add sidewalk
@ MID_GNE_DEMANDVIEWOPTIONS_SHOWOVERLAPPEDROUTES
show overlapped routes
Definition GUIAppEnum.h:951
@ 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_POI_ATTACH
attach POI to lane
@ MID_GNE_INTERVALBAR_DATASET
data set selected
Definition GUIAppEnum.h:983
@ 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:234
@ MID_GNE_DEMANDVIEWOPTIONS_LOCKCONTAINER
lock container
Definition GUIAppEnum.h:949
@ MID_GNE_NETWORKVIEWOPTIONS_SELECTEDGES
select edges
Definition GUIAppEnum.h:835
@ 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_POI_TRANSFORM_POIGEO
Transform to POI Geo.
@ MID_GNE_POI_RELEASE
release POI from lane
@ MID_GNE_DEMANDVIEWOPTIONS_SHOWTRIPS
show all trips
Definition GUIAppEnum.h:941
@ MID_GNE_NETWORKVIEWOPTIONS_TOGGLEGRID
show grid
Definition GUIAppEnum.h:827
@ MID_GNE_INTERVALBAR_LIMITED
enable/disable show data elements by interval
Definition GUIAppEnum.h:985
@ 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_POI_TRANSFORM_POI
Transform to POI.
@ MID_GNE_POLYGON_SIMPLIFY_SHAPE
simplify polygon geometry
@ MID_REMOVESELECT
Remove from selected items - Menu Entry.
Definition GUIAppEnum.h:489
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:130
#define GUIDesignVerticalSeparator
vertical separator
Definition GUIDesigns.h:497
unsigned int GUIGlID
Definition GUIGlObject.h:44
GUIGlObjectType
@ GLO_TAZRELDATA
TAZ relation data.
@ GLO_WALKINGAREA
a walkingArea
@ GLO_TEMPORALSHAPE
temporal shape (used in netedit)
@ GLO_TESTELEMENT
test element (used in netedit)
@ GLO_JUNCTION
a junction
@ GLO_LANE
a lane
@ GLO_CONNECTION
a connection
@ GLO_EDGE
an edge
@ GLO_VEHICLE
a vehicle
@ GLO_TLLOGIC
a tl-logic
@ GLO_CROSSING
a tl-logic
GUIViewObjectsHandler gViewObjectsHandler
GUIViewUpdater gViewUpdater
@ LOCATEVEHICLE
@ LOCATEWALKINGAREA
@ LOCATEPERSON
@ LOCATECONTAINER
@ LOCATEJUNCTION
#define WRITE_WARNINGF(...)
Definition MsgHandler.h:287
#define WRITE_ERROR(msg)
Definition MsgHandler.h:295
#define WRITE_WARNING(msg)
Definition MsgHandler.h:286
#define TL(string)
Definition MsgHandler.h:304
#define TLF(string,...)
Definition MsgHandler.h:306
StringBijection< SUMOVehicleClass > SumoVehicleClassStrings(sumoVehicleClassStringInitializer, SVC_CUSTOM2, false)
long long int SVCPermissions
bitset where each bit declares whether a certain SVC may use this edge/lane
SUMOVehicleClass
Definition of vehicle classes to differ between different lane usage and authority types.
@ SVC_IGNORING
vehicles ignoring classes
@ SVC_BICYCLE
vehicle is a bicycle
@ SVC_BUS
vehicle is a bus
@ SVC_PEDESTRIAN
pedestrian
@ SUMO_TAG_EDGEREL
a relation between two edges
@ SUMO_TAG_DATAINTERVAL
@ SUMO_TAG_TAZ
a traffic assignment zone
@ SUMO_TAG_TAZSINK
a sink within a district (connection road)
@ GNE_TAG_EDGEREL_SINGLE
@ SUMO_TAG_POI
begin/end of the description of a Point of interest
@ SUMO_TAG_VEHICLE
description of a vehicle
@ GNE_TAG_FLOW_ROUTE
a flow definition using a route instead of a from-to edges route
@ SUMO_TAG_ROUTE_DISTRIBUTION
distribution of a route
@ GNE_TAG_POIGEO
Point of interest over view with GEO attributes.
@ 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
@ GNE_TAG_POILANE
Point of interest over Lane.
@ SUMO_TAG_DATASET
@ GNE_TAG_JPS_OBSTACLE
polygon used for draw juPedSim obstacles
@ SUMO_TAG_TAZREL
a relation between two TAZs
@ SUMO_TAG_TAZSOURCE
a source within a district (connection road)
@ GNE_TAG_ROUTE_EMBEDDED
embedded route
@ SUMO_TAG_INDUCTION_LOOP
alternative tag for e1 detector
@ GNE_TAG_JPS_WALKABLEAREA
polygon used for draw juPedSim walkable areas
@ SUMO_TAG_VIEWSETTINGS
@ SUMO_TAG_VIEWPORT
@ SUMO_TAG_TRIP
a single trip definition (used by router)
@ SUMO_TAG_EDGE
begin/end of the description of an edge
@ SUMO_ATTR_LANE
@ SUMO_ATTR_LON
@ 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_LAT
@ SUMO_ATTR_TYPE
@ SUMO_ATTR_LENGTH
@ SUMO_ATTR_ID
@ GNE_ATTR_SHAPE_START
first coordinate of edge shape
@ SUMO_ATTR_POSITION
const double SUMO_const_laneWidth
Definition StdDefs.h:52
T MIN2(T a, T b)
Definition StdDefs.h:80
T MAX2(T a, T b)
Definition StdDefs.h:86
const unsigned char TLS[]
Definition TLS.cpp:22
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
Definition ToString.h:49
void parseSumoBaseObject(CommonXMLStructure::SumoBaseObject *obj)
parse SumoBaseObject (it's called recursivelly)
A class that stores a 2D geometrical boundary.
Definition Boundary.h:39
void add(double x, double y, double z=0)
Makes the boundary include the given coordinate.
Definition Boundary.cpp:75
double ymin() const
Returns minimum y-coordinate.
Definition Boundary.cpp:127
double xmin() const
Returns minimum x-coordinate.
Definition Boundary.cpp:115
Boundary & grow(double by)
extends the boundary by the given amount
Definition Boundary.cpp:340
double ymax() const
Returns maximum y-coordinate.
Definition Boundary.cpp:133
double xmax() const
Returns maximum x-coordinate.
Definition Boundary.cpp:121
void addBoolAttribute(const SumoXMLAttr attr, const bool value)
add bool attribute into current SumoBaseObject node
void addDoubleAttribute(const SumoXMLAttr attr, const double value)
add double attribute into current SumoBaseObject node
void addStringAttribute(const SumoXMLAttr attr, const std::string &value)
add string attribute into current SumoBaseObject node
static void drawLine(const Position &beg, double rot, double visLength)
Draws a thin line.
Definition GLHelper.cpp:433
static void setColor(const RGBColor &c)
Sets the gl-color to this value.
Definition GLHelper.cpp:649
static void drawOutlineCircle(double radius, double iRadius, int steps=8)
Draws an unfilled circle around (0,0)
Definition GLHelper.cpp:591
static void drawFilledCircle(const double widradiusth, const int steps=8)
Draws a filled circle around (0,0)
Definition GLHelper.cpp:564
static void popMatrix()
pop matrix
Definition GLHelper.cpp:131
static void pushMatrix()
push matrix
Definition GLHelper.cpp:118
GNEConsecutiveSelector * getConsecutiveLaneSelector() const
get consecutive lane selector
bool createPath(const bool useLastRoute)
create path
bool addAdditional(const GNEViewNetHelper::ViewObjectsSelector &viewObjects)
add additional element
GNEViewObjectSelector * getViewObjetsSelector() const
get module for select view objects
virtual void openAdditionalDialog(FXWindow *restoringFocusWindow)
open Additional Dialog
FileBucket * getFileBucket() const override
get reference to fileBucket in which save this AC
GNEApplicationWindowHelper::EditMenuCommands & getEditMenuCommands()
get Edit Menu Commands (needed for show/hide menu commands)
bool allowInputSignals(FXObject *obj) const
check if ignore input signal (using during netedit tests)
GNEApplicationWindowHelper::ToolbarsGrip & getToolbarsGrip()
get ToolbarsGrip
bool isAttributeCarrierSelected() const
check if attribute carrier is selected
virtual GNEMoveElement * getMoveElement() const =0
get GNEMoveElement associated with this AttributeCarrier
const std::string getID() const override
get ID (all Attribute Carriers have one)
void unselectAttributeCarrier()
unselect attribute carrier using GUIGlobalSelection
const std::string & getTagStr() const
get tag assigned to this object in string format
const GNETagProperties * getTagProperty() const
get tagProperty associated with this Attribute Carrier
virtual GUIGlObject * getGUIGlObject()=0
get GUIGlObject associated with this AttributeCarrier
void setNewParent(const GNEAttributeCarrier *AC)
set new parent
static void changeAttribute(GNEAttributeCarrier *AC, SumoXMLAttr key, const std::string &value, GNEUndoList *undoList, const bool force=false)
change attribute
void smootShape()
smoothShape
long onCmdSaveModifications(FXObject *, FXSelector, void *)
Called when the user presses the OK-Button saves any connection modifications.
long onCmdCancelModifications(FXObject *, FXSelector, void *)
Called when the user presses the Cancel-button discards any connection modifications.
ConnectionModifications * getConnectionModifications() const
get pointer to ConnectionModifications module
void handleLaneClick(const GNEViewNetHelper::ViewObjectsSelector &viewObjects)
either sets the current lane or toggles the connection of the
void drawTemporalConsecutiveLanePath() const
draw temporal consecutive lane path
void abortPathCreation()
abort path creation
void removeLastElement()
remove path element
GNEPlanCreator * getPlanCreator() const
get plan creator module
bool addContainer(const GNEViewNetHelper::ViewObjectsSelector &viewObjects)
add vehicle element
void show()
show Frame
GNEPlanCreator * getPlanCreator() const
get plan creator module
bool addContainerPlanElement(const GNEViewNetHelper::ViewObjectsSelector &viewObjects)
add container plan element
void processClick(const Position &clickedPosition, const GNEViewNetHelper::ViewObjectsSelector &viewObjects, const bool oppositeEdge, const bool chainEdge)
handle processClick and set the relative coloring
void abortEdgeCreation()
abort current edge creation
void show()
show create edge frame
const GNEJunction * getJunctionSource() const
get junction source for new edge
void clearEdgesHotkey()
clear edges (used when user press ESC key in Crossing mode)
void createCrossingHotkey()
create crossing (used when user press ENTER key in Crossing mode)
void addCrossing(const GNEViewNetHelper::ViewObjectsSelector &viewObjects)
add Crossing element
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
Result getResult() const
get result to indicate if this dialog was closed accepting or rejecting changes
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
void smooth(GNEUndoList *undoList)
make geometry smooth
Definition GNEEdge.cpp:2368
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList) override
Definition GNEEdge.cpp:1248
NBEdge * getNBEdge() const
returns the internal NBEdge
Definition GNEEdge.cpp:773
void smoothElevation(GNEUndoList *undoList)
smooth elevation with regard to adjoining edges
Definition GNEEdge.cpp:2380
std::vector< GNEEdge * > getOppositeEdges() const
get opposite edges
Definition GNEEdge.cpp:707
void copyTemplate(const GNEEdgeTemplate *edgeTemplate, GNEUndoList *undoList)
copy edge attributes from edgetemplate
Definition GNEEdge.cpp:1042
void editEndpoint(Position pos, GNEUndoList *undoList)
makes pos the new geometry endpoint at the appropriate end, or remove current existent endpoint
Definition GNEEdge.cpp:795
Position getSplitPos(const Position &clickPos)
Definition GNEEdge.cpp:779
void straightenElevation(GNEUndoList *undoList)
interpolate z values linear between junctions
Definition GNEEdge.cpp:2285
void resetEndpoint(const Position &pos, GNEUndoList *undoList)
restores the endpoint to the junction position at the appropriate end
Definition GNEEdge.cpp:847
bool addEdgeRelationData(const GNEViewNetHelper::ViewObjectsSelector &viewObjects, const GNEViewNetHelper::MouseButtonKeyPressed &mouseButtonKeyPressed)
add additional element
void focusUpperElement()
focus upper element of frame
Definition GNEFrame.cpp:104
virtual void show()
show Frame
Definition GNEFrame.cpp:110
GNEPathCreator * getPathCreator() const
get GNEPathCreator modul
const Position & getEditedPosition() const
get edited position
const GNEHierarchicalContainerParents< GNEDemandElement * > & getParentDemandElements() const
get parent demand elements
const GNEHierarchicalContainerChildren< GNELane * > & getChildLanes() const
get child lanes
const GNEHierarchicalContainerParents< GNEJunction * > & getParentJunctions() const
get parent junctions
void setEdgeTemplate(const GNEEdge *edge)
set edge template
GNEEdgeTemplate * getEdgeTemplate() const
get edge template (to copy attributes from)
TemplateEditor * getTemplateEditor() const
get template editor
bool inspectClickedElements(GNEViewNetHelper::ViewObjectsSelector &viewObjects, const Position &clickedPosition, const bool shiftKeyPressed)
process click over Viewnet
void show()
show inspector frame
GNEOverlappedInspection * getOverlappedInspection() const
get GNEOverlappedInspection modul
void clearInspection()
clear inspection
GNEAttributesEditor * getAttributesEditor() const
get AttributesEditor
void inspectElement(GNEAttributeCarrier *AC, GNEAttributeCarrier *previousInspectedAC=nullptr)
Inspect a single element.
const std::vector< GNEEdge * > & getGNEIncomingEdges() const
Returns incoming GNEEdges.
std::string getAttribute(SumoXMLAttr key) const override
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList) override
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.
const PositionVector & getLaneShape() const
get elements shape
Definition GNELane.cpp:232
int getIndex() const
returns the index of the lane
Definition GNELane.cpp:625
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList) override
Definition GNELane.cpp:764
GNEEdge * getParentEdge() const
get parent edge
Definition GNELane.cpp:214
void show()
show Frame
virtual void removeGeometryPoint(const Position clickedPosition, GNEUndoList *undoList)=0
remove geometry point in the clicked position
void show()
show prohibition frame
const std::unordered_map< SumoXMLTag, std::unordered_map< const GUIGlObject *, GNEDemandElement * >, std::hash< int > > & getDemandElements() const
get demand elements
GNETAZSourceSink * retrieveTAZSourceSink(const GNEAttributeCarrier *sourceSink, bool hardFail=true) const
Returns the named sourceSink.
GNEAttributeCarrier * retrieveAttributeCarrier(const GUIGlID id, bool hardFail=true) const
get a single attribute carrier based on a GLID
std::vector< GNEAdditional * > getSelectedShapes() const
get selected shapes
GNELane * retrieveLane(const std::string &id, bool hardFail=true, bool checkVolatileChange=false) const
get lane by id
const std::unordered_map< SumoXMLTag, std::unordered_map< const GUIGlObject *, GNEGenericData * >, std::hash< int > > & getGenericDatas() const
get all generic datas
GNECrossing * retrieveCrossing(const GUIGlObject *glObject, bool hardFail=true) const
get Crossing by AC
GNEAdditional * retrieveAdditional(SumoXMLTag type, const std::string &id, bool hardFail=true) const
Returns the named additional.
GNEWalkingArea * retrieveWalkingArea(const GUIGlObject *glObject, bool hardFail=true) const
get WalkingArea by GlObject
GNEJunction * retrieveJunction(const std::string &id, bool hardFail=true) const
get junction by id
GNEDataSet * retrieveDataSet(const std::string &id, bool hardFail=true) const
Returns the named data set.
std::vector< GNELane * > getSelectedLanes() const
get selected lanes
const std::map< std::string, GNEEdge * > & getEdges() const
map with the ID and pointer to edges of net
std::string generateAdditionalID(SumoXMLTag type) const
generate additional id
std::vector< GNEJunction * > getSelectedJunctions() const
return selected junctions
GNEDataInterval * retrieveDataInterval(const GNEAttributeCarrier *AC, bool hardFail=true) const
Returns the data interval.
GNEEdge * retrieveEdge(const std::string &id, bool hardFail=true) const
get edge by id
const std::unordered_map< const GUIGlObject *, GNELane * > & getLanes() const
get lanes
std::vector< GNEEdge * > getSelectedEdges() const
return all edges
const std::map< std::string, GNEJunction * > & getJunctions() const
get junctions
GNEDemandElement * retrieveDemandElement(SumoXMLTag type, const std::string &id, bool hardFail=true) const
Returns the named demand element.
std::vector< std::string > getPOIParamKeys() const
return list of available POI parameters
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
void deleteEdge(GNEEdge *edge, GNEUndoList *undoList, bool recomputeConnections)
removes edge
Definition GNENet.cpp:485
void deleteLane(GNELane *lane, GNEUndoList *undoList, bool recomputeConnections)
removes lane
Definition GNENet.cpp:664
void deleteCrossing(GNECrossing *crossing, GNEUndoList *undoList)
remove crossing
Definition GNENet.cpp:721
SUMORTree & getGrid()
Returns the RTree used for visualisation speed-up.
Definition GNENet.cpp:217
void deleteAdditional(GNEAdditional *additional, GNEUndoList *undoList)
remove additional
Definition GNENet.cpp:739
void computeAndUpdate(OptionsCont &neteditOptions, bool volatileOptions)
recompute the network and update lane geometries
Definition GNENet.cpp:2985
GNEPathManager * getDataPathManager()
get data path manager
Definition GNENet.cpp:204
void reverseEdge(GNEEdge *edge, GNEUndoList *undoList)
reverse edge
Definition GNENet.cpp:1141
NBTrafficLightLogicCont & getTLLogicCont()
returns the tllcont of the underlying netbuilder
Definition GNENet.cpp:2203
bool restrictLane(SUMOVehicleClass vclass, GNELane *lane, GNEUndoList *undoList)
transform lane to restricted lane
Definition GNENet.cpp:880
void deleteDemandElement(GNEDemandElement *demandElement, GNEUndoList *undoList)
remove demand element
Definition GNENet.cpp:773
void duplicateLane(GNELane *lane, GNEUndoList *undoList, bool recomputeConnections)
duplicates lane
Definition GNENet.cpp:864
void deleteDataInterval(GNEDataInterval *dataInterval, GNEUndoList *undoList)
remove data interval
Definition GNENet.cpp:812
void deleteConnection(GNEConnection *connection, GNEUndoList *undoList)
remove connection
Definition GNENet.cpp:706
GNEPathManager * getDemandPathManager()
get demand path manager
Definition GNENet.cpp:198
void resetJunctionConnections(GNEJunction *junction, GNEUndoList *undoList)
reset junction's connections
Definition GNENet.cpp:2124
void deleteGenericData(GNEGenericData *genericData, GNEUndoList *undoList)
remove generic data
Definition GNENet.cpp:825
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:1000
GNENetHelper::AttributeCarriers * getAttributeCarriers() const
get all attribute carriers used in this net
Definition GNENet.cpp:174
GNEEdge * addReversedEdge(GNEEdge *edge, const bool disconnected, GNEUndoList *undoList)
add reversed edge
Definition GNENet.cpp:1157
void splitEdgesBidi(GNEEdge *edge, GNEEdge *oppositeEdge, const Position &pos, GNEUndoList *undoList)
split all edges at position by inserting one new junction
Definition GNENet.cpp:1117
bool removeRestrictedLane(SUMOVehicleClass vclass, GNEEdge *edge, GNEUndoList *undoList)
remove restricted lane
Definition GNENet.cpp:986
void deleteTAZSourceSink(GNETAZSourceSink *TAZSourceSink, GNEUndoList *undoList)
remove TAZSourceSink
Definition GNENet.cpp:764
bool addRestrictedLane(SUMOVehicleClass vclass, GNEEdge *edge, int index, GNEUndoList *undoList)
add restricted lane to edge
Definition GNENet.cpp:933
bool addGreenVergeLane(GNEEdge *edge, int index, GNEUndoList *undoList)
add restricted lane to edge
Definition GNENet.cpp:969
void deleteDataSet(GNEDataSet *dataSet, GNEUndoList *undoList)
remove data set
Definition GNENet.cpp:799
GNEPathManager * getNetworkPathManager()
get network path manager
Definition GNENet.cpp:192
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:2027
void selectRoundabout(GNEJunction *junction, GNEUndoList *undoList)
select all roundabout edges and junctions for the current roundabout
Definition GNENet.cpp:1226
void replaceJunctionByGeometry(GNEJunction *junction, GNEUndoList *undoList)
replace the selected junction by geometry node(s) and merge the edges
Definition GNENet.cpp:1982
void createRoundabout(GNEJunction *junction, GNEUndoList *undoList)
transform the given junction into a roundabout
Definition GNENet.cpp:1245
void requireRecompute()
inform the net about the need for recomputation
Definition GNENet.cpp:1619
void initGNEConnections()
initialize GNEConnections
Definition GNENet.cpp:2972
void deleteJunction(GNEJunction *junction, GNEUndoList *undoList)
removes junction and all incident edges
Definition GNENet.cpp:438
NBEdgeCont & getEdgeCont()
returns the NBEdgeCont of the underlying netbuilder
Definition GNENet.cpp:2209
GNEUndoList * getUndoList() const
get undo list(used for simplify code)
Definition GNENet.cpp:156
void drawGL(const GUIVisualizationSettings &s) const override
Draws the object.
Definition GNENet.cpp:251
GNEViewNet * getViewNet() const
get view net (used for simplify code)
Definition GNENet.cpp:144
void clearJunctionConnections(GNEJunction *junction, GNEUndoList *undoList)
clear junction's connections
Definition GNENet.cpp:2112
void computeDemandElements(GNEApplicationWindow *window)
compute demand elements param[in] window The window to inform about delay
Definition GNENet.cpp:1568
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)
straighten shape edited
void deleteGeometryPointShapeEdited(const int index, GNEUndoList *undoList)
delete geometry point shape edited
void resetShapeEdited(GNEUndoList *undoList)
reset shape edited
bool overlappedInspectionShown() const
check if overlappedInspection modul is shown
long onCmdCreatePath(FXObject *, FXSelector, void *)
void abortPathCreation()
abort path creation
void removeLastElement()
remove path element
bool createPath(const bool useLastRoute)
create path
void drawTemporalRoute(const GUIVisualizationSettings &s) const
draw temporal route
void calculateReachability(const SUMOVehicleClass vClass, GNEEdge *originEdge)
calculate reachability for given edge
void clearPathDraw()
clear path draw
PathCalculator * getPathCalculator()
obtain instance of PathCalculator
PathDraw * getPathDraw()
obtain instance of PathDraw
void redrawPathElements(const GUIVisualizationSettings &s) const
redraw path elements saved in gViewObjectsHandler buffer
void show()
show Frame
GNEPlanCreator * getPlanCreator() const
get plan creator module
GNEPlanSelector * getPlanSelector() const
get personPlan selector
bool addPerson(const GNEViewNetHelper::ViewObjectsSelector &viewObjects)
add vehicle element
bool addPersonPlanElement(const GNEViewNetHelper::ViewObjectsSelector &viewObjects)
add person plan element
GNEPlanCreator * getPlanCreator() const
get plan creator module
GNEPlanSelector * getPlanSelector() const
get personPlan selector
void removeLastElement()
remove path element
long onCmdCreatePath(FXObject *, FXSelector, void *)
void abortPathCreation()
abort path creation
void drawTemporalRoute(const GUIVisualizationSettings &s) const
draw temporal route
const GNETagProperties * getCurrentPlanTagProperties() const
get current plan tag properties
int getVertexIndex(Position pos, bool snapToGrid)
return index of a vertex of shape, or of a new vertex if position is over an shape's edge
Definition GNEPoly.cpp:361
void closePolygon(bool allowUndo=true)
close polygon
Definition GNEPoly.cpp:440
void changeFirstGeometryPoint(int oldIndex, bool allowUndo=true)
change first geometry point
Definition GNEPoly.cpp:461
void deleteGeometryPoint(const Position &pos, bool allowUndo=true)
delete the geometry point closest to the given pos
Definition GNEPoly.cpp:377
CommonXMLStructure::SumoBaseObject * getSumoBaseObject() const
get SUMOBaseObject with all polygon attributes
Definition GNEPoly.cpp:533
void simplifyShape(bool allowUndo=true)
replace the current shape with a rectangle
Definition GNEPoly.cpp:501
void openPolygon(bool allowUndo=true)
open polygon
Definition GNEPoly.cpp:419
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 updateInformationLabel()
update information label
void show()
show Frame
void clearCurrentSelection() const
clear current selection with possibility of undo/redo
SelectionInformation * getSelectionInformation() const
get modul for selection information
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 module
GNEDrawingShape * getDrawingShapeModule() const
get drawing mode module
CurrentTAZ * getCurrentTAZModule() const
get Current TAZ module
void show()
show TAZ Frame
void processEdgeSelection(const std::vector< GNEEdge * > &edges)
process selection of edges in view net
bool processClick(const Position &clickedPosition, const GNEViewNetHelper::ViewObjectsSelector &viewObjects)
process click over Viewnet
bool setTAZ(const GNEViewNetHelper::ViewObjectsSelector &viewObjects)
set clicked TAZ
void buildTAZRelationData()
build TAZRelation data
void clearTAZSelection()
clear TAZ selection
bool isSetDetectorsToggleButtonEnabled() const
toggle button for set detectors mode
void disableE1DetectorMode()
disable detector mode
const std::map< std::string, std::string > & getE1Detectors() const
get E1 detectors vinculated with this TLS
const std::vector< std::string > & getSelectedJunctionIDs() const
get selected junction IDs
long onCmdCancelJoin(FXObject *, FXSelector, void *)
cancel join
long onCmdAcceptJoin(FXObject *, FXSelector, void *)
accept join
GNEJunction * getCurrentJunction() const
get current modified junction
bool isJoiningJunctions() const
is joining junctions
bool checkHaveModifications() const
check if current TLS was modified
long onCmdSaveChanges(FXObject *, FXSelector, void *)
Called when the user presses the save-Button.
void discardChanges(const bool editJunctionAgain)
discard changes
GNETLSEditorFrame::TLSAttributes * getTLSAttributes() const
get module for TLS attributes
void editJunction(GNEJunction *junction)
edits the traffic light for the given junction
GNETLSEditorFrame::TLSJunction * getTLSJunction() const
get module for TLS Junction
void editTLS(GNEViewNetHelper::ViewObjectsSelector &viewObjects, const Position &clickedPosition, const bool shiftKeyPressed)
edits the traffic light for the given clicked junction
GNETLSEditorFrame::TLSPrograms * getTLSPrograms() const
get module for TLS Definition
void show()
show inspector frame
bool isContainer() const
return true if tag correspond to a container element
bool planRoute() const
return true if tag correspond to a plan placed over route
bool isPlacedInRTree() const
return true if Tag correspond to an element that has to be placed in RTREE
SumoXMLTag getTag() const
get Tag vinculated with this attribute Property
bool hasDialog() const
return true if tag correspond to an element that can be edited using a dialog
bool isAdditionalElement() const
return true if tag correspond to an additional element (note: this include TAZ, shapes and wires)
bool isPerson() const
return true if tag correspond to a person element
GNEDistributionFrame::DistributionSelector * getDistributionSelector() const
get type distribution selector
void show()
show Frame
void end()
End undo command sub-group. If the sub-group is still empty, it will be deleted; otherwise,...
void begin(GUIIcon icon, const std::string &description)
Begin undo command sub-group with current supermode. This begins a new group of commands that are tre...
void abortAllChangeGroups()
reverts and discards ALL active chained change groups
void add(GNEChange *command, bool doit=false, bool merge=true)
Add new command, executing it if desired. The new command will be merged with the previous command if...
GNEPathCreator * getPathCreator() const
get GNEPathCreator module
void show()
show Frame
bool addVehicle(const GNEViewNetHelper::ViewObjectsSelector &viewObjects, const GNEViewNetHelper::MouseButtonKeyPressed &mouseButtonKeyPressed)
add vehicle element
class used for group inspected elements
bool isInspectingElements() const
check if we're inspecting at least one element
const std::unordered_set< GNEAttributeCarrier * > & getACs() const
get hash table with all inspected ACs
GNEAttributeCarrier * getFirstAC() const
class used to group all variables related to interval bar
void hideIntervalBar()
hide all options menu checks
void setGenericDataType()
set generic data type
void showIntervalBar()
show interval option bar
void buildIntervalBarElements()
build interval bar elements
void setInterval()
update limit by interval
void updateLockMenuBar()
update lock inspect menuBar
bool isObjectLocked(GUIGlObjectType objectType, const bool selected) const
check if given GLObject is locked for inspect, select, delete and move
class used for group front elements
const std::unordered_set< GNEAttributeCarrier * > & getACs() const
get hash table with all fronted ACs
class used to group all variables related with objects under cursor after a click over view
void updateObjects()
update objects (using gViewObjectsHandler)
void filterConnections()
filter (remove) connections
void updateMergingJunctions()
update merging junctions
GNEConnection * getConnectionFront() const
get front connection or a pointer to nullptr
const std::vector< GNEAttributeCarrier * > & getAttributeCarriers() const
get vector with ACs
void filterEdges()
filter (remove) edges
void filterLockedElements(const std::vector< GUIGlObjectType > ignoreFilter={})
filter locked elements (except the ignoreFilter)
void filterCrossings()
filter (remove) crossings
GNEPOI * getPOIFront() const
get front POI or a pointer to nullptr
GNEEdge * getEdgeFront() const
get front edge or a pointer to nullptr
GNEAttributeCarrier * getAttributeCarrierFront() const
get front attribute carrier or a pointer to nullptr
void filterDemandElements(const bool includeRoutes)
filter (remove) demand elements
void filterWalkingAreas()
filter (remove) walkingAreas
void filterAdditionals(const bool includeStoppigPlaces, const bool includeTAZs)
filter (remove) additionals
GNELane * getLaneFront() const
get front lane or a pointer to nullptr
GNELane * getLaneFrontNonLocked() const
get front lane or a pointer to nullptr checking if is locked
const GUIGlObject * getGUIGlObjectFront() const
get front GUIGLObject or a pointer to nullptr
GNENetworkElement * getNetworkElementFront() const
get front network element or a pointer to nullptr
void filterLanes()
filter (remove) lanes
const std::vector< GUIGlObject * > & getGLObjects() const
get vector with GL objects
void filterShapes()
filter (remove) polys and POIs
const std::vector< GNELane * > & getLanes() const
get lanes
GNEViewNetHelper::EditNetworkElementShapes myEditNetworkElementShapes
struct for grouping all variables related with edit shapes
Definition GNEViewNet.h:716
long onCmdToggleShowDemandElementsNetwork(FXObject *, FXSelector, void *)
toggle show demand elements (network)
long onMouseMove(FXObject *, FXSelector, void *) override
called when user moves mouse
void openObjectDialogAtCursor(const FXEvent *ev) override
open object dialog
long onCmdClosePolygon(FXObject *, FXSelector, void *)
close opened polygon
bool isCurrentlyMovingElements() const
check if an element is being moved
long onCmdEditCrossingShape(FXObject *, FXSelector, void *)
edit crossing shape
void processMoveMouseNetwork(const bool mouseLeftButtonPressed)
process move mouse function in Supermode Network
const GNEViewNetHelper::DataViewOptions & getDataViewOptions() const
get data view options
GNENet * getNet() const
get the net object
long onCmdSetFirstGeometryPoint(FXObject *, FXSelector, void *)
set as first geometry point the closes geometry point
long onCmdEdgeUseAsTemplate(FXObject *, FXSelector, void *)
use edge as template
long onCmdSmoothConnectionShape(FXObject *, FXSelector, void *)
edit connection shape
GNEViewNetHelper::CommonCheckableButtons myCommonCheckableButtons
variable used to save checkable buttons for common supermodes
Definition GNEViewNet.h:654
void hotkeyBackSpace()
handle backspace keypress
GNEViewNetHelper::MarkFrontElements myMarkFrontElements
front element
Definition GNEViewNet.h:725
GNEDemandElement * myLastCreatedRoute
last created route
Definition GNEViewNet.h:740
const GNEViewNetHelper::EditModes & getEditModes() const
get edit modes
long onCmdAddSelected(FXObject *, FXSelector, void *)
select AC under cursor
const GNEViewNetHelper::EditNetworkElementShapes & getEditNetworkElementShapes() const
get Edit Shape module
GNECrossing * getCrossingAtPopupPosition()
try to retrieve a crossing at popup position
std::vector< std::string > getPOIParamKeys() const override
return list of available POI parameters
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:635
long onCmdReplaceJunction(FXObject *, FXSelector, void *)
replace node by geometry
bool restrictLane(GNELane *lane, SUMOVehicleClass vclass)
restrict lane
long onCmdSplitJunction(FXObject *, FXSelector, void *)
split junction into multiple junctions
void drawGrid() const
draw grid and update grid button
void deleteDemandAttributeCarrier(const GNEAttributeCarrier *AC)
delete given demand attribute carriers
long onCmdClearConnections(FXObject *, FXSelector, void *)
clear junction connections
void abortOperation(bool clearSelection=true)
abort current edition operation
long onCmdToggleTAZDrawFill(FXObject *, FXSelector, void *)
toggle TAZdrawFill
long onCmdResetEndPoints(FXObject *, FXSelector, void *)
reset edge end points
void updateObjectsInPosition(const Position &pos)
update objects and boundaries in position
GNEViewNetHelper::TestingMode myTestingMode
variable used to save variables related with testing mode
Definition GNEViewNet.h:638
GNEDemandElement * getLastCreatedRoute() const
get last created route
GNEViewNetHelper::InspectedElements & getInspectedElements()
get inspected elements
long onCmdToggleDrawSpreadVehicles(FXObject *, FXSelector, void *)
toggle draw vehicles in begin position or spread in lane
GNEPOI * getPOIAtPopupPosition()
try to retrieve a POILane at popup position
GNEViewNetHelper::SelectingArea mySelectingArea
variable used for grouping all variables related with selecting areas
Definition GNEViewNet.h:713
GNENetworkElement * getShapeEditedAtPopupPosition()
try to retreive a edited shape at popup position
const GNEViewNetHelper::MoveSingleElementModul & getMoveSingleElementValues() const
get move single element values
long onCmdToggleShowConnections(FXObject *, FXSelector, void *)
toggle show connections
long onCmdLaneReachability(FXObject *, FXSelector sel, void *)
show lane reachability
long onCmdToggleShowTAZElements(FXObject *, FXSelector, void *)
toggle show TAZ elements
long onLeftBtnPress(FXObject *, FXSelector, void *) override
GNEViewNetHelper::NetworkCheckableButtons myNetworkCheckableButtons
variable used to save checkable buttons for Supermode Network
Definition GNEViewNet.h:657
long onCmdCloseShapeEdited(FXObject *, FXSelector, void *)
close opened shape edited
bool myCreatedPopup
flag for mark if during this frame a popup was created (needed to avoid problems in linux with Cursor...
Definition GNEViewNet.h:746
void openSelectDialogAtCursor(const std::vector< GUIGlObject * > &GLObjects)
open select dialog at cursor
long onCmdSimplifyShapeEdited(FXObject *, FXSelector, void *)
void processClick(void *eventData)
Auxiliary function used by onLeftBtnPress(...)
void buildViewToolBars(GUIGlChildWindow *v) override
builds the view toolbars
void drawNeteditAttributesReferences()
draw circle in testing mode (needed for grid)
long onCmdSimplifyShape(FXObject *, FXSelector, void *)
simply shape of current polygon
GNELane * getLaneAtPopupPosition()
try to retrieve a lane at popup position
GNEViewNetHelper::MouseButtonKeyPressed myMouseButtonKeyPressed
variable used to save key status after certain events
Definition GNEViewNet.h:646
bool askMergeJunctions(const GNEJunction *movedJunction, const GNEJunction *targetJunction, bool &alreadyAsked)
ask merge junctions
GNEViewNetHelper::IntervalBar myIntervalBar
variable used to save IntervalBar
Definition GNEViewNet.h:682
GNEViewParent * myViewParent
view parent
Definition GNEViewNet.h:728
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
long onLeftBtnRelease(FXObject *, FXSelector, void *) override
called when user releases mouse's left button
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:674
void drawTemporalJunctionTLSLines() const
draw temporal Junction TLS Lines
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:734
bool autoSelectNodes()
whether to autoselect nodes or to lanes
void drawTemporalRoundabout() const
draw temporal roundabout
void deleteDataAttributeCarrier(const GNEAttributeCarrier *AC)
delete data attribute carriers
long onCmdToggleLockContainer(FXObject *, FXSelector, void *)
toggle lock container in super mode demand
GNEUndoList * myUndoList
a reference to the undolist maintained in the application
Definition GNEViewNet.h:737
GNEViewNetHelper::NetworkViewOptions myNetworkViewOptions
variable used to save variables related with view options in supermode Network
Definition GNEViewNet.h:671
GUIGlID getToolTipID() override
returns the id of object under cursor to show their tooltip
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:688
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:663
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:710
long onLeaveConvertRoundabout(FXObject *, FXSelector, void *)
leave to convert junction to roundabout
GNEViewNetHelper::IntervalBar & getIntervalBar()
get interval bar
long onCmdEditLaneShape(FXObject *, FXSelector, void *)
edit lane shape
GNEViewNetHelper::MarkFrontElements & getMarkFrontElements()
get marked for drawing front elements
long onCmdToggleHideNonInspecteDemandElements(FXObject *, FXSelector, void *)
toggle hide non inspected demand elements
GNEViewParent * getViewParent() const
get the net object
long onCmdToggleDrawJunctionShape(FXObject *, FXSelector, void *)
toggle draw junction shape
bool checkOverLockedElement(const GUIGlObject *GLObject, const bool isSelected) const
check if given element is locked (used for drawing select and delete contour)
long onCmdStraightenShapeEdited(FXObject *, FXSelector, void *)
straight shape edited
long onCmdAddReversedEdge(FXObject *, FXSelector, void *)
add reversed edge
void processLeftButtonReleaseNetwork()
process left button release function in Supermode Network
long onCmdDeleteGeometryPointShapeEdited(FXObject *, FXSelector, void *)
delete the closes geometry point in shape edited
long onMiddleBtnPress(FXObject *, FXSelector, void *) override
called when user press mouse's left button
bool checkSelectEdges() const
check if select edges (toggle using button or shift)
long onCmdAddReversedEdgeDisconnected(FXObject *, FXSelector, void *)
add reversed edge disconnected
long onCmdIntervalBarGenericDataType(FXObject *, FXSelector, void *)
change generic data type in interval bar
long onCmdConvertRoundabout(FXObject *, FXSelector, void *)
convert junction to roundabout
long onCmdRemoveEdgeSelected(FXObject *, FXSelector, void *)
unselect Edge under cursor
long onCmdAddReverse(FXObject *, FXSelector, void *)
add a reverse demand element
long onCmdToggleShowShapes(FXObject *, FXSelector, void *)
toggle show shapes in super mode data
long onCmdToggleMergeAutomatically(FXObject *, FXSelector, void *)
toggle warn for merge
long onCmdOpenPolygon(FXObject *, FXSelector, void *)
open closed polygon
GNEViewNetHelper::InspectedElements myInspectedElements
inspected element
Definition GNEViewNet.h:722
long onCmdSetCustomGeometryPoint(FXObject *, FXSelector, void *)
set custom geometry point
bool removeRestrictedLane(GNELane *lane, SUMOVehicleClass vclass)
remove restricted lane
long onCmdIntervalBarDataSet(FXObject *, FXSelector, void *)
change data set in interval bar
GNEViewNetHelper::SaveElements & getSaveElements()
get variable used to save elements
void processLeftButtonReleaseDemand()
process left button release function in Supermode Demand
const GNEViewNetHelper::TestingMode & getTestingMode() const
get testing mode
GNEUndoList * getUndoList() const
get the undoList object
void processLeftButtonPressData(void *eventData)
process left button press function in Supermode Data
long onCmdTransformPOI(FXObject *, FXSelector, void *)
transform to POI
void saveVisualizationSettings() const
GNEViewNetHelper::SaveElements mySaveElements
variable used for grouping all variables related with salve elements
Definition GNEViewNet.h:707
const GNEViewNetHelper::MoveMultipleElementModul & getMoveMultipleElementValues() const
get move multiple element values
void deleteNetworkAttributeCarrier(const GNEAttributeCarrier *AC)
delete given network attribute carriers
GNEViewNetHelper::LockManager myLockManager
lock manager
Definition GNEViewNet.h:719
long onCmdAddEdgeSelected(FXObject *, FXSelector, void *)
select Edge under cursor
long onCmdIntervalBarSetEnd(FXObject *, FXSelector, void *)
change end in interval bar
long onCmdTransformPOIGEO(FXObject *, FXSelector, void *)
transform to POIGEO
const GNEViewNetHelper::ViewObjectsSelector & getViewObjectsSelector() const
get objects under cursor
void drawTemporalDrawingShape() const
draw temporal polygon shape in Polygon Mode
void setLastCreatedRoute(GNEDemandElement *lastCreatedRoute)
set last created route
void drawTestsCircle() const
draw circle in testing mode (needed for grid)
long onCmdSplitEdgeBidi(FXObject *, FXSelector, void *)
split edge at cursor position
long onCmdAddJoinTLS(FXObject *, FXSelector, void *)
add Join TLS
GNEJunction * getJunctionAtPopupPosition()
try to retrieve a junction at popup position
void drawTemporalSplitJunction() const
draw temporal split junction in create edge mode
long onCmdSetSupermode(FXObject *, FXSelector sel, void *)
long onCmdToggleExtendSelection(FXObject *, FXSelector, void *)
toggle extend selection
long onCmdTriangulatePolygon(FXObject *, FXSelector, void *)
triangulate polygon
long onKeyPress(FXObject *o, FXSelector sel, void *data) override
called when user press a key
GNEViewNetHelper::DemandCheckableButtons myDemandCheckableButtons
variable used to save checkable buttons for Supermode Demand
Definition GNEViewNet.h:660
bool aksChangeSupermode(const std::string &operation, Supermode expectedSupermode)
ask about change supermode
GNETAZ * getTAZAtPopupPosition()
try to retrieve a TAZ at popup position
long onCmdSetMode(FXObject *, FXSelector sel, void *)
called when user press a mode button (Network or demand)
long onCmdResetEdgeEndpoint(FXObject *, FXSelector, void *)
change geometry endpoint
long onCmdIntervalBarSetBegin(FXObject *, FXSelector, void *)
change begin in interval bar
long onCmdResetLength(FXObject *, FXSelector, void *)
reset custom edge lengths
std::vector< std::string > getEdgeLaneParamKeys(bool edgeKeys) const override
return list of available edge parameters
long onCmdSelectPolygonElements(FXObject *, FXSelector, void *)
select elements within polygon boundary
long onCmdSetFirstGeometryPointShapeEdited(FXObject *, FXSelector, void *)
set first geometry point in shape edited
long onCmdRemoveSelected(FXObject *, FXSelector, void *)
unselect AC under cursor
long onCmdDeleteGeometryPoint(FXObject *, FXSelector, void *)
delete the closes geometry point
void doInit() override
called after some features are already initialized
long onCmdDuplicateLane(FXObject *, FXSelector, void *)
duplicate selected lane
long onRightBtnRelease(FXObject *, FXSelector, void *) override
called when user releases mouse's right button
void processLeftButtonPressNetwork(void *eventData)
mouse process functions
void hotkeyEnter()
handle enter keypress
GNEConnection * getConnectionAtPopupPosition()
try to retrieve a connection at popup position
long onCmdOpenShapeEdited(FXObject *, FXSelector, void *)
open closed shape edited
long onRightBtnPress(FXObject *, FXSelector, void *) override
called when user press mouse's right button
void recalculateBoundaries() override
recalculate boundaries
void buildColorRainbow(const GUIVisualizationSettings &s, GUIColorScheme &scheme, int active, GUIGlObjectType objectType, const GUIVisualizationRainbowSettings &rs) override
recalibrate color scheme according to the current value range
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:691
long onCmdSplitJunctionReconnect(FXObject *, FXSelector, void *)
split junction into multiple junctions and reconnect them
long onCmdFinishShapeEdited(FXObject *, FXSelector, void *)
finish shape edited
void hotkeyDel()
handle del keypress
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:743
void redrawPathElementContours()
redraw elements only for calculating boundary
GNEViewNet()
FOX needs this.
long onCmdToggleTAZRelDrawing(FXObject *, FXSelector, void *)
toggle TAZRel drawing
long onCmdToggleShowJunctionBubbles(FXObject *, FXSelector, void *)
toggle show junction bubbles
bool selectingDetectorsTLSMode() const
check if we're selecting detectors in TLS mode
bool selectingJunctionsTLSMode() const
check if we're selecting junctions in TLS mode
long onCmdToggleShowAdditionalSubElements(FXObject *, FXSelector, void *)
toggle show additional sub-elements
long onCmdSmoothEdgesElevation(FXObject *, FXSelector, void *)
smooth elevation with regard to adjoining edges
long onCmdToggleShowAllContainerPlans(FXObject *, FXSelector, void *)
toggle show all container plans in super mode demand
long onCmdResetJunctionShape(FXObject *, FXSelector, void *)
reset junction shape
long onCmdToggleTAZRelOnlyFrom(FXObject *, FXSelector, void *)
toggle TAZRez only from
long onCmdResetShapeEdited(FXObject *, FXSelector, void *)
reset shape edited
long onKeyRelease(FXObject *o, FXSelector sel, void *data) override
called when user release a key
long onCmdIntervalBarSetParameter(FXObject *, FXSelector, void *)
change parameter in interval bar
void drawTemporalE1TLSLines() const
draw temporal E1 TLS Lines
int doPaintGL(int mode, const Boundary &drawingBoundary) override
do paintGL
long onCmdReverseEdge(FXObject *, FXSelector, void *)
reverse edge
bool setColorScheme(const std::string &name) override
set color scheme
void processLeftButtonReleaseData()
process left button release function in Supermode Data
std::vector< std::string > getEdgeDataAttrs() const override
return list of loaded edgeData attributes
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:731
GNEPoly * getPolygonAtPopupPosition()
try to retrieve a polygon at popup position
long onMiddleBtnRelease(FXObject *, FXSelector, void *) override
called when user releases mouse's left button
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:677
int myDrawingToggle
drawin toggle (used in drawGLElements to avoid draw elements twice)
Definition GNEViewNet.h:749
long onCmdToggleShowTrips(FXObject *, FXSelector, void *)
toggle show all trips in super mode demand
long onCmdToggleHideShapes(FXObject *, FXSelector, void *)
toggle hide shapes in super mode demand
long onCmdEditEdgeEndpoint(FXObject *, FXSelector, void *)
change geometry endpoint
const GNEViewNetHelper::DemandViewOptions & getDemandViewOptions() const
get demand view options
long onCmdToggleHideConnections(FXObject *, FXSelector, void *)
toggle hide connections
void openDeleteDialogAtCursor(const std::vector< GUIGlObject * > &GLObjects)
open delete dialog at cursor
long onCmdResetConnections(FXObject *, FXSelector, void *)
reset junction connections
long onCmdResetLaneCustomShape(FXObject *, FXSelector, void *)
reset custom shapes of selected lanes
bool addRestrictedLane(GNELane *lane, SUMOVehicleClass vclass, const bool insertAtFront)
add restricted lane
void setStatusBarText(const std::string &text)
set statusBar text
long onCmdEditWalkingAreaShape(FXObject *, FXSelector, void *)
edit walkingArea shape
void processMoveMouseDemand(const bool mouseLeftButtonPressed)
process move mouse function in Supermode Demand
long onCmdReleasePOI(FXObject *, FXSelector, void *)
release POI from lane
long onCmdResetOppositeLane(FXObject *, FXSelector, void *)
reset oppositeLane of current lane
void setSelectorFrameScale(double selectionScale)
set selection scaling (in GNESelectorFrame)
void viewUpdated()
called when view is updated
long onCmdEditConnectionShape(FXObject *, FXSelector, void *)
edit connection shape
void updateObjectsInShape(const PositionVector &shape)
get objects in the given shape (using triangulation)
void updateDemandModeSpecificControls()
updates Demand mode specific controls
void forceSupemodeNetwork()
force supermode network(used after load/create new network)
long onCmdAttachPOI(FXObject *, FXSelector, void *)
attach POI in lane
std::vector< std::string > getRelDataAttrs() const override
return list of loaded edgeRelation and tazRelation attributes
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
void updateViewNet(const bool ignoreViewUpdater=true) const
Mark the entire GNEViewNet to be repainted later.
long onCmdToggleShowPolygonSymbols(FXObject *, FXSelector, void *)
toggle show polygon symbols
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:629
void clearSelection()
clear selection
A single child window which contains a view of the simulation area.
GNECrossingFrame * getCrossingFrame() const
get frame for NETWORK_CROSSING
GNEConnectorFrame * getConnectorFrame() const
get frame for NETWORK_CONNECT
GNEStopFrame * getStopFrame() const
get frame for DEMAND_STOP
GNEProhibitionFrame * getProhibitionFrame() const
get frame for NETWORK_PROHIBITION
GNEPersonPlanFrame * getPersonPlanFrame() const
get frame for DEMAND_PERSONFRAME
GNEMeanDataFrame * getMeanDataFrame() const
get frame for DATA_TAZRELDATA
GNEShapeFrame * getShapeFrame() const
get frame for NETWORK_SHAPE
GNETAZRelDataFrame * getTAZRelDataFrame() const
get frame for DATA_TAZRELDATA
GNEMoveFrame * getMoveFrame() const
get frame for move elements
GNESelectorFrame * getSelectorFrame() const
get frame for select elements
GNEContainerPlanFrame * getContainerPlanFrame() const
get frame for DEMAND_CONTAINERFRAME
GNEEdgeDataFrame * getEdgeDataFrame() const
get frame for DATA_EDGEDATA
GNEDeleteFrame * getDeleteFrame() const
get frame for delete elements
GNETypeDistributionFrame * getTypeDistributionFrame() const
get frame for DEMAND_TYPEDISTRIBUTION
GNEVehicleFrame * getVehicleFrame() const
get frame for DEMAND_VEHICLE
GNEDecalFrame * getDecalFrame() const
get frame for NETWORK_DECAL
void hideAllFrames()
hide all frames
GNETypeFrame * getTypeFrame() const
get frame for DEMAND_TYPE
GNETAZFrame * getTAZFrame() const
get frame for NETWORK_TAZ
GNETLSEditorFrame * getTLSEditorFrame() const
get frame for NETWORK_TLS
GNEApplicationWindow * getGNEAppWindows() const
get GNE Application Windows
GNEContainerFrame * getContainerFrame() const
get frame for DEMAND_CONTAINER
GNEAdditionalFrame * getAdditionalFrame() const
get frame for NETWORK_ADDITIONAL
GNERouteDistributionFrame * getRouteDistributionFrame() const
get frame for DEMAND_ROUTEDISTRIBUTION
GNEWireFrame * getWireFrame() const
get frame for NETWORK_WIRE
GNEPersonFrame * getPersonFrame() const
get frame for DEMAND_PERSON
GNEInspectorFrame * getInspectorFrame() const
get frame for inspect elements
GNEEdgeRelDataFrame * getEdgeRelDataFrame() const
get frame for DATA_EDGERELDATA
GNECreateEdgeFrame * getCreateEdgeFrame() const
get frame for NETWORK_CREATEEDGE
GNERouteFrame * getRouteFrame() const
get frame for DEMAND_ROUTE
GNEConsecutiveSelector * getConsecutiveLaneSelector() const
get consecutive lane selector
bool createPath(const bool useLastRoute)
create path
void show()
show wire frame
bool addWire(const GNEViewNetHelper::ViewObjectsSelector &viewObjects)
add wire element
bool contains(const std::string &name) const
Returns the information whether a setting with the given name is stored.
GUIVisualizationSettings & get(const std::string &name)
Returns the named scheme.
const std::vector< std::string > & getNames() const
Returns a list of stored settings names.
Dialog for edit rerouter intervals.
static FXCursor * getCursor(GUICursor which)
returns a cursor previously defined in the enum GUICursor
std::string getCurrentScheme() const
Returns the name of the currently chosen scheme.
void setCurrentScheme(const std::string &)
Sets the named scheme as the current.
static void drawGeometry(const GUIVisualizationSettings::Detail d, const GUIGeometry &geometry, const double width, double offset=0)
draw geometry
static void drawChildLine(const GUIVisualizationSettings &s, const Position &child, const Position &parent, const RGBColor &color, const bool drawEntire, const double lineWidth)
draw line between child and parent (used in netedit)
void updateGeometry(const PositionVector &shape)
update entire geometry
MFXComboBoxIcon * getColoringSchemesCombo()
return combobox with the current coloring schemes (standard, fastest standard, real world....
FXPopup * getLocatorPopup()
@ brief return a pointer to locator popup
const std::string & getMicrosimID() const
Returns the id of the object as known to microsim.
GUIGlObjectType getType() const
Returns the type of the object as coded in GUIGlObjectType.
virtual bool isGLObjectLocked() const
check if element is locked (Currently used only in netedit)
GUIGlID getGlID() const
Returns the numerical id of the object.
static FXIcon * getIcon(const GUIIcon which)
returns a icon previously defined in the enum GUIIcon
MFXStaticToolTip * getStaticTooltipMenu() const
get static toolTip for menus
virtual void setStatusBarText(const std::string &)
get status bar text (can be implemented in children)
virtual double getRotation() const =0
Returns the rotation of the canvas stored in this changer.
virtual double getZoom() const =0
Returns the zoom factor computed stored in this changer.
virtual void onLeftBtnPress(void *data)
mouse functions
virtual double getXPos() const =0
Returns the x-offset of the field to show stored in this changer.
virtual double getYPos() const =0
Returns the y-offset of the field to show stored in this changer.
T getColor(const double value) const
const std::string & getName() const
int addColor(const T &color, const double threshold, const std::string &name="")
bool myAmInitialised
Internal information whether doInit() was called.
Position snapToActiveGrid(const Position &pos, bool snapXY=true) const
Returns a position that is mapped to the closest grid point if the grid is active.
std::vector< GUIGlObject * > myCurrentObjectsDialog
vector with current objects dialog
virtual long onLeftBtnRelease(FXObject *, FXSelector, void *)
const SUMORTree * myGrid
The visualization speed-up.
void openObjectDialog(const std::vector< GUIGlObject * > &objects, const bool filter=true)
open object dialog for the given object
void paintGLGrid() const
paints a grid
FXbool makeCurrent()
A reimplementation due to some internal reasons.
Position myClickedPopupPosition
clicked poup position
void buildMinMaxRainbow(const GUIVisualizationSettings &s, GUIColorScheme &scheme, const GUIVisualizationRainbowSettings &rs, double minValue, double maxValue, bool hasMissingData)
helper function for buildColorRainbow
virtual long onMiddleBtnRelease(FXObject *, FXSelector, void *)
virtual long onMouseMove(FXObject *, FXSelector, void *)
bool myPanning
Panning flag.
GUIMainWindow * myApp
The application.
std::vector< GUIGlID > getObjectsInBoundary(Boundary bound)
returns the ids of all objects in the given boundary
const Position & getPopupPosition() const
get position of current popup
double m2p(double meter) const
meter-to-pixels conversion method
GUIVisualizationSettings * myVisualizationSettings
visualization settings
void destroyPopup()
destroys the popup
virtual long onKeyPress(FXObject *o, FXSelector sel, void *data)
keyboard functions
virtual long onMiddleBtnPress(FXObject *, FXSelector, void *)
virtual Position getPositionInformation() const
Returns the cursor's x/y position within the network.
virtual long onKeyRelease(FXObject *o, FXSelector sel, void *data)
GUIDialog_ViewSettings * myGUIDialogViewSettings
Visualization changer.
void drawDecals()
Draws the stored decals.
virtual long onRightBtnRelease(FXObject *, FXSelector, void *)
GUIPerspectiveChanger * myChanger
The perspective changer.
GUIGLObjectPopupMenu * myPopup
The current popup-menu.
virtual long onPaint(FXObject *, FXSelector, void *)
virtual long onRightBtnPress(FXObject *, FXSelector, void *)
void openPopupDialog()
open popup dialog
static void resetTextures()
Reset textures.
void setSelectionPosition(const Position &pos)
set selection position
void addToRedrawPathElements(const GNEPathElement *pathElement)
add path element to redrawing set
void reverseSelectedObjects()
reverse selected objects
void isolateEdgeGeometryPoints()
isolate edge geometry points (used for moving)
void reset()
reset view objects handler
void setSelectionTriangle(const Triangle &triangle)
set selection triangle
const GLObjectsSortedContainer & getSelectedObjects() const
get all elements under cursor sorted by layer
const GNEEdge * markedEdge
marked edge (used in create edge mode, for splitting)
void updateFrontObject(const GUIGlObject *GLObject)
move the given object to the front (currently used only in netedit)
bool allowUpdate()
allow update
Stores the information about how to visualize structures.
GUIVisualizationSizeSettings junctionSize
bool drawForRectangleSelection
whether drawing is performed for the purpose of selecting objects using a rectangle
std::string name
The name of this setting.
bool drawJunctionShape
whether the shape of the junction should be drawn
bool disableLaneIcons
whether drawing is performed in left-hand networks
bool lefthand
whether drawing is performed in left-hand networks
bool showLane2Lane
Information whether lane-to-lane arrows shall be drawn.
GUIVisualizationColorSettings colorSettings
color settings
bool showGrid
Information whether a grid shall be shown.
void save(OutputDevice &dev) const
Writes the settings into an output device.
double scale
information about a lane's width (temporary, used for a single view)
void updateIgnoreHideByZoom()
update ignore hide by zoom (call BEFORE drawing all elements).
bool drawForViewObjectsHandler
whether drawing is performed for the purpose of selecting objects in view using ViewObjectsHandler
GUIVisualizationAdditionalSettings additionalSettings
Additional settings.
double selectorFrameScale
the current selection scaling in netedit (set in SelectorFrame)
GUIColorer junctionColorer
The junction colorer.
static const std::string SCHEME_NAME_PERMISSION_CODE
GUIVisualizationNeteditSizeSettings neteditSizeSettings
netedit size settings
static const GeoConvHelper & getFinal()
the coordinate transformation for writing the location element and for tracking the original coordina...
void cartesian2geo(Position &cartesian) const
Converts the given cartesian (shifted) position to its geo (lat/long) representation.
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:789
const PositionVector getInnerGeometry() const
Returns the geometry of the edge without the endpoints.
Definition NBEdge.cpp:613
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:347
const Position & getPosition() const
Definition NBNode.h:262
const PositionVector & getShape() const
retrieve the junction shape
Definition NBNode.cpp:2792
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.
void close()
Closes the device and removes it from the dictionary.
OutputDevice & openTag(const std::string &xmlElement)
Opens an XML tag.
OutputDevice & writeAttr(const ATTR_TYPE &attr, const T &val, const bool isNull=false, const bool escape=false)
writes a named attribute
bool closeTag(const std::string &comment="")
Closes the most recently opened tag and optionally adds a comment.
static OutputDevice & getDevice(const std::string &name, bool usePrefix=true)
Returns the described OutputDevice.
C++ TraCI client API implementation.
A point in 2D or 3D with translation and scaling methods.
Definition Position.h:37
double distanceTo(const Position &p2) const
returns the euclidean distance in 3 dimensions
Definition Position.h:263
double distanceSquaredTo(const Position &p2) const
returns the square of the distance to another position
Definition Position.h:268
double x() const
Returns the x-position.
Definition Position.h:52
double y() const
Returns the y-position.
Definition Position.h:57
A list of positions.
Position positionAtOffset(double pos, double lateralOffset=0) const
Returns the position at the given length.
double nearest_offset_to_point2D(const Position &p, bool perpendicular=true) const
return the nearest offest to point 2D
int indexOfClosest(const Position &p, bool twoD=false) const
void move2side(double amount, double maxExtension=100)
move position vector to side using certain amount
void setAlpha(unsigned char alpha)
Sets a new alpha value.
Definition RGBColor.cpp:112
static const RGBColor BLUE
Definition RGBColor.h:200
static RGBColor fromHSV(double h, double s, double v, bool random=false)
Converts the given hsv-triplet to rgb, inspired by http://alvyray.com/Papers/CG/hsv2rgb....
Definition RGBColor.cpp:413
static const RGBColor ORANGE
Definition RGBColor.h:204
static const RGBColor GREEN
Definition RGBColor.h:199
static const RGBColor BLACK
Definition RGBColor.h:206
static const RGBColor RED
named colors
Definition RGBColor.h:198
const PositionVector & getShape() const
Returns the shape of the polygon.
void addAdditionalGLObject(GUIGlObject *o, const double exaggeration=1)
Adds an additional object (detector/shape/trigger) for visualisation.
Definition SUMORTree.h:122
void removeAdditionalGLObject(GUIGlObject *o, const double exaggeration=1)
Removes an additional object (detector/shape/trigger) from being visualised.
Definition SUMORTree.h:158
virtual int Search(const float a_min[2], const float a_max[2], const GUIVisualizationSettings &c) const
Find all within search rectangle.
Definition SUMORTree.h:114
static std::vector< Triangle > triangulate(PositionVector shape)
Definition Triangle.cpp:142
DemandViewOptions demandViewOptions
demand view options
NetworkViewOptions networkViewOptions
network view options
FXMenuBar * modes
The application menu bar (for select, inspect...)
void buildCommonCheckableButtons()
build checkable buttons
void updateCommonCheckableButtons()
update Common checkable buttons
void disableCommonCheckableButtons()
hide all options menu checks
MFXCheckableButton * selectButton
checkable button for edit mode select
MFXCheckableButton * inspectButton
checkable button for edit mode inspect
MFXCheckableButton * deleteButton
checkable button for edit mode delete
void disableDataCheckableButtons()
hide all options menu checks
void buildDataCheckableButtons()
build checkable buttons
void updateDataCheckableButtons()
update Data checkable buttons
MFXCheckableButton * edgeDataButton
checkable button for edit mode "edgeData"
MFXCheckableButton * edgeRelDataButton
checkable button for edit mode "edgeRelData"
MFXCheckableButton * TAZRelDataButton
checkable button for edit mode "TAZRelData"
MFXCheckableButton * meanDataButton
checkable button for edit mode "meanData"
struct used to group all variables related to view options in supermode Data
void hideDataViewOptionsMenuChecks()
hide all options menu checks
MFXCheckableButton * menuCheckToggleTAZDrawFill
menu check to toggle TAZ draw fill
MFXCheckableButton * menuCheckShowAdditionals
menu check to show Additionals
MFXCheckableButton * menuCheckShowShapes
menu check to show Shapes
MFXCheckableButton * menuCheckToggleTAZRelOnlyFrom
menu check to toggle TAZRel only from
MFXCheckableButton * menuCheckToggleDrawJunctionShape
checkable button to show junction shapes
void buildDataViewOptionsMenuChecks()
build menu checks
MFXCheckableButton * menuCheckToggleTAZRelDrawing
menu check to toggle TAZ Rel drawing
MFXCheckableButton * menuCheckShowDemandElements
menu check to show Demand Elements
MFXCheckableButton * menuCheckToggleTAZRelOnlyTo
menu check to toggle TAZRel only to
MFXCheckableButton * routeDistributionButton
checkable button for edit mode create route distributions
MFXCheckableButton * containerButton
checkable button for edit mode create containers
MFXCheckableButton * moveDemandElementsButton
checkable button for edit mode "move demand elements"
MFXCheckableButton * typeButton
checkable button for edit mode create type
void buildDemandCheckableButtons()
build checkable buttons
MFXCheckableButton * vehicleButton
checkable button for edit mode create vehicles
MFXCheckableButton * containerPlanButton
checkable button for edit mode create container plans
MFXCheckableButton * routeButton
checkable button for edit mode create routes
MFXCheckableButton * stopButton
checkable button for edit mode create stops
MFXCheckableButton * personPlanButton
checkable button for edit mode create person plans
MFXCheckableButton * personButton
checkable button for edit mode create persons
void updateDemandCheckableButtons()
update Demand checkable buttons
MFXCheckableButton * typeDistributionButton
checkable button for edit mode create type distribution
void disableDemandCheckableButtons()
hide all options menu checks
struct used to group all variables related to view options in supermode Demand
MFXCheckableButton * menuCheckShowAllTrips
show all trips
void lockPerson(const GNEDemandElement *person)
lock person
MFXCheckableButton * menuCheckToggleGrid
menu check to show grid button
MFXCheckableButton * menuCheckToggleDrawJunctionShape
checkable button to show junction shapes
void lockContainer(const GNEDemandElement *container)
lock container
void buildDemandViewOptionsMenuChecks()
build menu checks
const GNEDemandElement * getLockedPerson() const
get locked person
MFXCheckableButton * menuCheckDrawSpreadVehicles
menu check to draw vehicles in begin position or spread in lane
MFXCheckableButton * menuCheckShowOverlappedRoutes
show overlapped routes
void hideDemandViewOptionsMenuChecks()
hide all options menu checks
MFXCheckableButton * menuCheckShowAllPersonPlans
show all person plans
MFXCheckableButton * menuCheckShowAllContainerPlans
show all container plans
MFXCheckableButton * menuCheckHideNonInspectedDemandElements
Hide non inspected demand elements.
MFXCheckableButton * menuCheckHideShapes
Hide shapes (Polygons and POIs)
MFXCheckableButton * menuCheckLockPerson
Lock Person.
MFXCheckableButton * menuCheckLockContainer
Lock Container.
struct used to group all variables related with Supermodes
DataEditMode dataEditMode
the current Data edit mode
void buildSuperModeButtons()
build checkable buttons
DemandEditMode demandEditMode
the current Demand edit mode
Supermode currentSupermode
the current supermode
NetworkEditMode networkEditMode
the current Network edit mode
bool isCurrentSupermodeDemand() const
@check if current supermode is Demand
void setDemandEditMode(DemandEditMode demandMode, const bool force=false)
set Demand edit mode
MFXCheckableButton * dataButton
checkable button for supermode Data
bool isCurrentSupermodeData() const
@check if current supermode is Data
void setView(FXSelector sel)
set view
bool isCurrentSupermodeNetwork() const
@check if current supermode is Network
MFXCheckableButton * networkButton
checkable button for supermode Network
bool isJuPedSimView() const
check if default view is enabled
void setSupermode(Supermode supermode, const bool force)
set supermode
MFXCheckableButton * demandButton
checkable button for supermode Demand
void setNetworkEditMode(NetworkEditMode networkMode, const bool force=false)
set Network edit mode
void setDataEditMode(DataEditMode dataMode, const bool force=false)
set Data edit mode
struct used to group all variables related with edit shapes of NetworkElements
GNENetworkElement * getEditedNetworkElement() const
pointer to edited network element
void startEditCustomShape(GNENetworkElement *element)
start edit custom shape
class used to group all variables related with mouse buttons and key pressed after certain events
bool shiftKeyPressed() const
check if SHIFT is pressed during current event
bool altKeyPressed() const
check if ALT is pressed during current event
void update(void *eventData)
update status of MouseButtonKeyPressed during current event
bool controlKeyPressed() const
check if CONTROL is pressed during current event
bool mouseLeftButtonPressed() const
check if mouse left button is pressed during current event
struct used to group all variables related with movement of groups of elements
void moveSelection(const bool mouseLeftButtonPressed)
move selection
bool isCurrentlyMovingMultipleElements() const
check if there are moving elements
void finishMoveSelection()
finish moving selection
bool isMovingSelection() const
check if currently there is element being moved
void resetMovingSelectedEdge()
reset flag for moving edge
struct used to group all variables related with movement of single elements
bool beginMoveSingleElementDemandMode()
begin move single element in Demand mode
void moveSingleElement(const bool mouseLeftButtonPressed)
move single element in Network AND Demand mode
bool isCurrentlyMovingSingleElement() const
check if there are moving elements
bool beginMoveSingleElementNetworkMode()
begin move single element in Network mode
bool beginMoveNetworkElementShape()
begin move network elementshape
void finishMoveSingleElement()
finish moving single elements in Network AND Demand mode
void updateNetworkCheckableButtons()
update network checkable buttons
MFXCheckableButton * trafficLightButton
checkable button for edit mode traffic light
MFXCheckableButton * moveNetworkElementsButton
checkable button for edit mode "move network elements"
MFXCheckableButton * additionalButton
checkable button for edit mode additional
MFXCheckableButton * crossingButton
checkable button for edit mode crossing
MFXCheckableButton * createEdgeButton
checkable button for edit mode create edge
MFXCheckableButton * prohibitionButton
checkable button for edit mode prohibition
void buildNetworkCheckableButtons()
build checkable buttons
MFXCheckableButton * shapeButton
checkable button for edit mode shape
MFXCheckableButton * connectionButton
checkable button for edit mode connection
MFXCheckableButton * TAZButton
checkable button for edit mode TAZ
void disableNetworkCheckableButtons()
hide all options menu checks
MFXCheckableButton * wireButton
checkable button for edit mode wires
MFXCheckableButton * decalButton
checkable button for edit mode decals
struct used to group all variables related to view options in supermode Network
MFXCheckableButton * menuCheckSelectEdges
checkable button to select only edges
MFXCheckableButton * menuCheckChainEdges
checkable button to the endpoint for a created edge should be set as the new source
MFXCheckableButton * menuCheckShowDemandElements
checkable button to show Demand Elements
MFXCheckableButton * menuCheckMoveElevation
checkable button to apply movement to elevation
MFXCheckableButton * menuCheckShowTAZElements
checkable button to show TAZ elements
MFXCheckableButton * menuCheckAutoOppositeEdge
check checkable to create auto create opposite edge
MFXCheckableButton * menuCheckDrawSpreadVehicles
checkable button to draw vehicles in begin position or spread in lane
MFXCheckableButton * menuCheckShowConnections
checkable button to show connections
MFXCheckableButton * menuCheckHideConnections
checkable button to hide connections in connect mode
MFXCheckableButton * menuCheckToggleDrawJunctionShape
checkable button to show junction shapes
MFXCheckableButton * menuCheckToggleGrid
checkable button to show grid button
MFXCheckableButton * menuCheckMergeAutomatically
checkable button to we should't warn about merging junctions
bool selectEdges() const
check if select edges checkbox is enabled
MFXCheckableButton * menuCheckShowJunctionBubble
checkable button to show connection as bubble in "Move" mode.
void hideNetworkViewOptionsMenuChecks()
hide all options menu checks
MFXCheckableButton * menuCheckShowAdditionalSubElements
checkable button to show additional sub-elements
void buildNetworkViewOptionsMenuChecks()
build menu checks
MFXCheckableButton * menuCheckChangeAllPhases
checkable button to set change all phases
MFXCheckableButton * menuCheckShowPolygonSymbols
check checkable to show polygon symbols
MFXCheckableButton * menuCheckExtendSelection
checkable button to extend to edge nodes
struct used to group all variables related with save elements
void buildSaveElementsButtons()
build save buttons
void finishRectangleSelection()
finish rectangle selection
void drawRectangleSelection(const RGBColor &color) const
draw rectangle selection
void beginRectangleSelection()
begin rectangle selection
bool selectingUsingRectangle
whether we have started rectangle-selection
void moveRectangleSelection()
move rectangle selection
bool startDrawing
whether we have started rectangle-selection
void processRectangleSelection()
process rectangle Selection
std::vector< GNEEdge * > processEdgeRectangleSelection()
process rectangle Selection (only limited to Edges)
struct used to group all variables related with testing
void drawTestingElements(GUIMainWindow *mainWindow)
draw testing element
void initTestingMode()
init testing mode
struct used to group all variables related with time format
void buildTimeFormatButtons()
build time format buttons
static const RGBColor TLSConnectionColor
connection color between E1/junctions and TLS
RGBColor selectionColor
basic selection color
static const double junctionBubbleRadius
junction bubble radius
double getExaggeration(const GUIVisualizationSettings &s, const GUIGlObject *o, double factor=20) const
return the drawing size including exaggeration and constantSize values